@robota-sdk/agent-cli 3.0.0-beta.86 → 3.0.0-beta.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +103 -48
  2. package/README.md +289 -39
  3. package/bin/{robota.cjs → agent.cjs} +1 -1
  4. package/dist/node/bin.js +23 -23
  5. package/dist/node/{bounded-output-Bgx2Cgkx-28em7iHq.js → bounded-output-BdWv9SX3-28em7iHq.js} +1 -1
  6. package/dist/node/{bounded-output-Bgx2Cgkx-28em7iHq.js.map → bounded-output-BdWv9SX3-28em7iHq.js.map} +1 -1
  7. package/dist/node/cli-core-CEWWF4d6.js +2917 -0
  8. package/dist/node/{command-executor-d6DdfUTD-DhFSDHvb.js → command-executor-D_UBZHxh-CVZipoOV.js} +2 -2
  9. package/dist/node/{command-executor-d6DdfUTD-DhFSDHvb.js.map → command-executor-D_UBZHxh-CVZipoOV.js.map} +1 -1
  10. package/dist/node/{command-executor-d6DdfUTD-3KEnsTnN.js → command-executor-D_UBZHxh-D7UrdAlN.js} +1 -1
  11. package/dist/node/headless.js +2 -2
  12. package/dist/node/index.d.ts +2423 -166
  13. package/dist/node/index.d.ts.map +1 -1
  14. package/dist/node/index.js +610 -580
  15. package/dist/node/index.js.map +1 -1
  16. package/dist/node/{node-BfqR16CD.js → node-BIdvEvlf.js} +1 -1
  17. package/dist/node/node-BUERQysz.js +15 -0
  18. package/dist/node/node-BWNobqRD.js +15 -0
  19. package/dist/node/node-BWNobqRD.js.map +1 -0
  20. package/dist/node/node-C4_FOvnk.js.map +1 -1
  21. package/dist/node/node-CEI_VczS.js +165 -0
  22. package/dist/node/node-CrspydTR.js +165 -0
  23. package/dist/node/node-CrspydTR.js.map +1 -0
  24. package/dist/node/node-DENLEmMT.js.map +1 -1
  25. package/dist/web/assets/index-BSxTg2Py.css +1 -0
  26. package/dist/web/assets/index-BpCxNRj_.js +309 -0
  27. package/dist/web/index.html +3 -3
  28. package/package.json +49 -44
  29. package/dist/node/cli-core-DOdGt9XE.js +0 -2891
  30. package/dist/node/node-B48couEE.js +0 -14
  31. package/dist/node/node-B48couEE.js.map +0 -1
  32. package/dist/node/node-CgLYctGm.js +0 -67
  33. package/dist/node/node-CgLYctGm.js.map +0 -1
  34. package/dist/node/node-DAOCaE6N.js +0 -67
  35. package/dist/node/node-DlLm_kxn.js +0 -14
  36. package/dist/web/assets/index-DSLs7oij.js +0 -309
  37. package/dist/web/assets/index-OqCBtMJ2.css +0 -1
  38. /package/dist/node/{bounded-output-Bgx2Cgkx-C4ucXwLR.js → bounded-output-BdWv9SX3-C4ucXwLR.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-CrspydTR.js","names":["assert","net","EE","diagnosticsChannel","util","assert","#handler","EventEmitter","#abort","#paused","#aborted","#reason","#handler","#controller","net","assert","Buffer","Buffer","assert","assert","#map","#detectRuntimeFeature","assert","zlib","assert","performance","#target","#kind","#index","isUint8Array","Transform","#zlibOptions","nodeUtil","#state","assert","assert","isErrored","assert","exports","assert","pipeline","assert","net","Buffer","debuglog","Buffer","EventEmitter","URL","#client","#getUrl","#opts","#parseNoProxy","#getProxyAgentForUrl","#shouldProxy","#noProxyChanged","#noProxyEntries","#noProxyValue","#noProxyEnv","assert","#agent","#options","assert","Readable","assert","AsyncResource","assert","AsyncResource","assert","Readable","AsyncResource","assert","AsyncResource","assert","STATUS_CODES","promisify","Transform","crypto","#snapshotPath","#maxSnapshots","#autoFlush","#headerFilters","#isUrlExcluded","#startAutoFlush","#snapshots","#scheduleFlush","readFile","resolve","mkdir","dirname","writeFile","#flushTimeout","setTimeout","#stopAutoFlush","#asyncDispatch","#replaySnapshot","#recordAndReplay","#setupMockInterceptors","assert","#handler","#onCompleteCalled","#onErrorCalled","#onResponseStartCalled","assert","EE","#contentType","#statusCode","#decoder","#headers","#body","#checkContentType","#maxSize","#abort","#size","#dumped","#maxItems","#records","#maxTTL","#defaultLookup","#defaultPick","#origin","#newOrigin","#opts","#state","#dispatch","#firstTry","isIP","#store","#cacheType","#cacheByDefault","#cacheKey","#handler","#writeStream","EventEmitter","#maxCount","#maxSize","#maxEntrySize","#size","#count","#entries","Writable","#hasEmittedMaxSizeEvent","assert","#callback","#handler","#allowErrorStatusCodes","#successful","#context","assert","Readable","TransformStream","#skipStatusCodes","#skipErrorResponses","#maxSize","#terminated","#inputEnded","#decompressedSize","#fail","#decompressors","#setupDecompressorEvents","#cleanupDecompressors","#trailers","#shouldSkipDecompression","#createDecompressionChain","#setupSingleDecompressor","#setupMultipleDecompressors","#primaryHandler","#onComplete","#maxBufferSize","#completed","#responseDataStarted","#createWaitingHandler","#responseStarted","#statusCode","#headers","#statusMessage","#waitingHandlers","#controller","#pruneDoneWaitingHandlers","#aborted","#bufferWaitingChunk","#flushWaitingHandler","#errorWaitingHandler","#maxEntrySize","#maxCount","#db","#getValuesQuery","#updateValueQuery","#insertValueQuery","#deleteByUrlQuery","#countEntriesQuery","#deleteExpiredValuesQuery","#deleteOldValuesQuery","#findValue","#makeValueUrl","#prune","Writable","assert","#headersList","#guard","nodeUtil","assert","#state","#headers","assert","#dispatcher","#state","#signal","#headers","assert","assert","pipeline","assert","assert","#relevantRequestResponseList","#internalMatchAll","#batchCacheOperations","#queryCache","#requestMatchesCachedItem","#caches","assert","#eventInit","assert","#options","#maxPayloadSize","#inflate","#handler","#extensions","#maxFragments","#maxPayloadSize","#buffers","#byteOffset","#loop","#info","#fragmentsBytes","#state","#fragments","#validatePayloadLength","#socket","#running","#queue","#run","#onConnectionEstablished","#onMessage","#handler","#onParserDrain","#parser","#onSocketClose","#url","#binaryType","#bufferedAmount","#sendQueue","#extensions","#protocol","#events","#closeCode","#reason","#onConnectionEstablished","#onMessage","#handler","#parser","#onSocketClose","#url","#openedPromise","#closedPromise","#handshakeAborted","#readableStreamController","#cancel","#writableStreamController","#write","#closeUsingReason","#readableStream","#dispatcher","#state","#url","#withCredentials","#request","#connect","#readyState","#reconnect","#controller","#events","C","m","o","l","i","_","h","p","f","v","g","r","d","s","b","z","y","x","PROTECTED_DIRECTORY_NAMES","PROTECTED_FILE_NAMES","splitCommandSegments","resolvePlatformShell","zodToJsonSchema","ValidationError","FunctionTool","createBoundedOutput","subprocessTraceEnvironment","isPathInside","ToolExecutionError","fetchWithEgressPolicy","TOOL_SEARCH_TOOL_NAME"],"sources":["../../../agent-process/dist/node/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/symbols.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/util/timers.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/errors.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/constants.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/tree.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/util.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/util/stats.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/diagnostics.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/request.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/wrap-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/dispatcher.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/unwrap-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/dispatcher-base.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/connect.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/llhttp/utils.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/llhttp/constants.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/llhttp/llhttp-wasm.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/constants.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/global.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/encoding/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/infra/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/data-url.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/util/runtime-features.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/webidl/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/util.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/formdata.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/formdata-parser.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/util/promise.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/body.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/client-h1.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/client-h2.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/client.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/fixed-queue.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/pool-base.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/pool.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/balanced-pool.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/round-robin-pool.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/socks5-utils.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/core/socks5-client.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/proxy-agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/retry-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/retry-agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/h2c-client.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/readable.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/api-request.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/abort-signal.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/api-stream.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/api-pipeline.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/api-upgrade.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/api-connect.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/api/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-errors.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-symbols.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-utils.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-interceptor.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-client.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-call-history.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-pool.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/pending-interceptors-formatter.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/snapshot-utils.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/snapshot-recorder.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/snapshot-agent.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/global.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/decorator-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/redirect-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/redirect.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/response-error.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/retry.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/dump.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/dns.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/util/cache.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/util/date.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/cache-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/cache/memory-cache-store.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/cache-revalidation-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/cache.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/decompress.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/handler/deduplication-handler.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/interceptor/deduplicate.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/cache/sqlite-cache-store.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/headers.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/response.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/request.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/fetch/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cache/util.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cache/cache.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cache/cachestorage.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cookies/constants.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cookies/util.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cookies/parse.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/cookies/index.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/events.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/constants.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/util.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/frame.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/connection.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/permessage-deflate.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/receiver.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/sender.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/websocket.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/stream/websocketerror.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/websocket/stream/websocketstream.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/eventsource/util.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/eventsource/eventsource-stream.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/web/eventsource/eventsource.js","../../../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/index.js","../../../agent-core/dist/node/node.js","../../../agent-tools/dist/node/index.js"],"sourcesContent":["import{spawnSync as e}from\"node:child_process\";const t=2e3,n=process.platform===`win32`;function r(e){return e.exitCode!==null||e.signalCode!==null}function i(e,t,r){if(r&&!n&&typeof e.pid==`number`)try{process.kill(-e.pid,t);return}catch{}try{e.kill(t)}catch{}}function a(t,r){if(n&&typeof t.pid==`number`){e(`taskkill`,[`/pid`,String(t.pid),`/T`,`/F`],{stdio:`ignore`});return}i(t,`SIGKILL`,r)}async function o(e,t={}){let n=t.graceMs??2e3,o=t.signal??`SIGTERM`,s=t.processGroup??!1;if(!r(e)){if(typeof e.pid!=`number`)throw Error(`[agent-process] killProcessTree called with an unspawned child (no pid)`);if(t.preKill){try{await t.preKill()}catch{}if(r(e))return}return new Promise(t=>{let c,l=()=>{c&&clearTimeout(c),t()};if(e.once(`exit`,l),r(e)){e.removeListener(`exit`,l),t();return}i(e,o,s),c=setTimeout(()=>{r(e)||a(e,s)},n),c.unref?.()})}}export{t as DEFAULT_KILL_GRACE_MS,o as killProcessTree};\n//# sourceMappingURL=index.js.map","'use strict'\n\nmodule.exports = {\n kClose: Symbol('close'),\n kDestroy: Symbol('destroy'),\n kDispatch: Symbol('dispatch'),\n kUrl: Symbol('url'),\n kWriting: Symbol('writing'),\n kResuming: Symbol('resuming'),\n kQueue: Symbol('queue'),\n kConnect: Symbol('connect'),\n kConnecting: Symbol('connecting'),\n kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n kKeepAlive: Symbol('keep alive'),\n kHeadersTimeout: Symbol('headers timeout'),\n kBodyTimeout: Symbol('body timeout'),\n kServerName: Symbol('server name'),\n kLocalAddress: Symbol('local address'),\n kHost: Symbol('host'),\n kNoRef: Symbol('no ref'),\n kBodyUsed: Symbol('used'),\n kBody: Symbol('abstracted request body'),\n kRunning: Symbol('running'),\n kBlocking: Symbol('blocking'),\n kPending: Symbol('pending'),\n kSize: Symbol('size'),\n kBusy: Symbol('busy'),\n kQueued: Symbol('queued'),\n kFree: Symbol('free'),\n kConnected: Symbol('connected'),\n kClosed: Symbol('closed'),\n kNeedDrain: Symbol('need drain'),\n kReset: Symbol('reset'),\n kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n kResume: Symbol('resume'),\n kOnError: Symbol('on error'),\n kMaxHeadersSize: Symbol('max headers size'),\n kRunningIdx: Symbol('running index'),\n kPendingIdx: Symbol('pending index'),\n kError: Symbol('error'),\n kClients: Symbol('clients'),\n kClient: Symbol('client'),\n kParser: Symbol('parser'),\n kOnDestroyed: Symbol('destroy callbacks'),\n kPipelining: Symbol('pipelining'),\n kSocket: Symbol('socket'),\n kHostHeader: Symbol('host header'),\n kConnector: Symbol('connector'),\n kStrictContentLength: Symbol('strict content length'),\n kMaxRedirections: Symbol('maxRedirections'),\n kMaxRequests: Symbol('maxRequestsPerClient'),\n kProxy: Symbol('proxy agent options'),\n kCounter: Symbol('socket request counter'),\n kMaxResponseSize: Symbol('max response size'),\n kHTTP2Session: Symbol('http2Session'),\n kHTTP2SessionState: Symbol('http2Session state'),\n kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n kConstruct: Symbol('constructable'),\n kListeners: Symbol('listeners'),\n kHTTPContext: Symbol('http context'),\n kMaxConcurrentStreams: Symbol('max concurrent streams'),\n kHTTP2InitialWindowSize: Symbol('http2 initial window size'),\n kHTTP2ConnectionWindowSize: Symbol('http2 connection window size'),\n kEnableConnectProtocol: Symbol('http2session connect protocol'),\n kRemoteSettings: Symbol('http2session remote settings'),\n kHTTP2Stream: Symbol('http2session client stream'),\n kPingInterval: Symbol('ping interval'),\n kNoProxyAgent: Symbol('no proxy agent'),\n kHttpProxyAgent: Symbol('http proxy agent'),\n kHttpsProxyAgent: Symbol('https proxy agent'),\n kSocks5ProxyAgent: Symbol('socks5 proxy agent')\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n /**\n * Increment the fastNow value by the TICK_MS value, despite the actual time\n * that has passed since the last tick. This approach ensures independence\n * from the system clock and delays caused by a blocked event loop.\n *\n * @type {number}\n */\n fastNow += TICK_MS\n\n /**\n * The `idx` variable is used to iterate over the `fastTimers` array.\n * Expired timers are removed by replacing them with the last element in the array.\n * Consequently, `idx` is only incremented when the current element is not removed.\n *\n * @type {number}\n */\n let idx = 0\n\n /**\n * The len variable will contain the length of the fastTimers array\n * and will be decremented when a FastTimer should be removed from the\n * fastTimers array.\n *\n * @type {number}\n */\n let len = fastTimers.length\n\n while (idx < len) {\n /**\n * @type {FastTimer}\n */\n const timer = fastTimers[idx]\n\n // If the timer is in the ACTIVE state and the timer has expired, it will\n // be processed in the next tick.\n if (timer._state === PENDING) {\n // Set the _idleStart value to the fastNow value minus the TICK_MS value\n // to account for the time the timer was in the PENDING state.\n timer._idleStart = fastNow - TICK_MS\n timer._state = ACTIVE\n } else if (\n timer._state === ACTIVE &&\n fastNow >= timer._idleStart + timer._idleTimeout\n ) {\n timer._state = TO_BE_CLEARED\n timer._idleStart = -1\n timer._onTimeout(timer._timerArg)\n }\n\n if (timer._state === TO_BE_CLEARED) {\n timer._state = NOT_IN_LIST\n\n // Move the last element to the current index and decrement len if it is\n // not the only element in the array.\n if (--len !== 0) {\n fastTimers[idx] = fastTimers[len]\n }\n } else {\n ++idx\n }\n }\n\n // Set the length of the fastTimers array to the new length and thus\n // removing the excess FastTimers elements from the array.\n fastTimers.length = len\n\n // If there are still active FastTimers in the array, refresh the Timer.\n // If there are no active FastTimers, the timer will be refreshed again\n // when a new FastTimer is instantiated.\n if (fastTimers.length !== 0) {\n refreshTimeout()\n }\n}\n\nfunction refreshTimeout () {\n // If the fastNowTimeout is already set and the Timer has the refresh()-\n // method available, call it to refresh the timer.\n // Some timer objects returned by setTimeout may not have a .refresh()\n // method (e.g. mocked timers in tests).\n if (fastNowTimeout?.refresh) {\n fastNowTimeout.refresh()\n // fastNowTimeout is not instantiated yet or refresh is not availabe,\n // create a new Timer.\n } else {\n clearTimeout(fastNowTimeout)\n fastNowTimeout = setTimeout(onTick, TICK_MS)\n // If the Timer has an unref method, call it to allow the process to exit,\n // if there are no other active handles. When using fake timers or mocked\n // environments (like Jest), .unref() may not be defined,\n fastNowTimeout?.unref()\n }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n [kFastTimer] = true\n\n /**\n * The state of the timer, which can be one of the following:\n * - NOT_IN_LIST (-2)\n * - TO_BE_CLEARED (-1)\n * - PENDING (0)\n * - ACTIVE (1)\n *\n * @type {-2|-1|0|1}\n * @private\n */\n _state = NOT_IN_LIST\n\n /**\n * The number of milliseconds to wait before calling the callback.\n *\n * @type {number}\n * @private\n */\n _idleTimeout = -1\n\n /**\n * The time in milliseconds when the timer was started. This value is used to\n * calculate when the timer should expire.\n *\n * @type {number}\n * @default -1\n * @private\n */\n _idleStart = -1\n\n /**\n * The function to be executed when the timer expires.\n * @type {Function}\n * @private\n */\n _onTimeout\n\n /**\n * The argument to be passed to the callback when the timer expires.\n *\n * @type {*}\n * @private\n */\n _timerArg\n\n /**\n * @constructor\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should wait\n * before the specified function or code is executed.\n * @param {*} arg\n */\n constructor (callback, delay, arg) {\n this._onTimeout = callback\n this._idleTimeout = delay\n this._timerArg = arg\n\n this.refresh()\n }\n\n /**\n * Sets the timer's start time to the current time, and reschedules the timer\n * to call its callback at the previously specified duration adjusted to the\n * current time.\n * Using this on a timer that has already called its callback will reactivate\n * the timer.\n *\n * @returns {void}\n */\n refresh () {\n // In the special case that the timer is not in the list of active timers,\n // add it back to the array to be processed in the next tick by the onTick\n // function.\n if (this._state === NOT_IN_LIST) {\n fastTimers.push(this)\n }\n\n // If the timer is the only active timer, refresh the fastNowTimeout for\n // better resolution.\n if (!fastNowTimeout || fastTimers.length === 1) {\n refreshTimeout()\n }\n\n // Setting the state to PENDING will cause the timer to be reset in the\n // next tick by the onTick function.\n this._state = PENDING\n }\n\n /**\n * The `clear` method cancels the timer, preventing it from executing.\n *\n * @returns {void}\n * @private\n */\n clear () {\n // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n // tick by the onTick function.\n this._state = TO_BE_CLEARED\n\n // Reset the _idleStart value to -1 to indicate that the timer is no longer\n // active.\n this._idleStart = -1\n }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n /**\n * The setTimeout() method sets a timer which executes a function once the\n * timer expires.\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should\n * wait before the specified function or code is executed.\n * @param {*} [arg] An optional argument to be passed to the callback function\n * when the timer expires.\n * @returns {NodeJS.Timeout|FastTimer}\n */\n setTimeout (callback, delay, arg) {\n // If the delay is less than or equal to the RESOLUTION_MS value return a\n // native Node.js Timer instance.\n return delay <= RESOLUTION_MS\n ? setTimeout(callback, delay, arg)\n : new FastTimer(callback, delay, arg)\n },\n /**\n * The clearTimeout method cancels an instantiated Timer previously created\n * by calling setTimeout.\n *\n * @param {NodeJS.Timeout|FastTimer} timeout\n */\n clearTimeout (timeout) {\n // If the timeout is a FastTimer, call its own clear method.\n if (timeout[kFastTimer]) {\n /**\n * @type {FastTimer}\n */\n timeout.clear()\n // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n // Node.js native clearTimeout function.\n } else {\n clearTimeout(timeout)\n }\n },\n /**\n * The setFastTimeout() method sets a fastTimer which executes a function once\n * the timer expires.\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should\n * wait before the specified function or code is executed.\n * @param {*} [arg] An optional argument to be passed to the callback function\n * when the timer expires.\n * @returns {FastTimer}\n */\n setFastTimeout (callback, delay, arg) {\n return new FastTimer(callback, delay, arg)\n },\n /**\n * The clearTimeout method cancels an instantiated FastTimer previously\n * created by calling setFastTimeout.\n *\n * @param {FastTimer} timeout\n */\n clearFastTimeout (timeout) {\n timeout.clear()\n },\n /**\n * The now method returns the value of the internal fast timer clock.\n *\n * @returns {number}\n */\n now () {\n return fastNow\n },\n /**\n * Trigger the onTick function to process the fastTimers array.\n * Exported for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n */\n tick (delay = 0) {\n fastNow += delay - RESOLUTION_MS + 1\n onTick()\n onTick()\n },\n /**\n * Reset FastTimers.\n * Exported for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n */\n reset () {\n fastNow = 0\n fastTimers.length = 0\n clearTimeout(fastNowTimeout)\n fastNowTimeout = null\n },\n /**\n * Exporting for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n */\n kFastTimer\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n constructor (message, options) {\n super(message, options)\n this.name = 'UndiciError'\n this.code = 'UND_ERR'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kUndiciError] === true\n }\n\n get [kUndiciError] () {\n return true\n }\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ConnectTimeoutError'\n this.message = message || 'Connect Timeout Error'\n this.code = 'UND_ERR_CONNECT_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kConnectTimeoutError] === true\n }\n\n get [kConnectTimeoutError] () {\n return true\n }\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'HeadersTimeoutError'\n this.message = message || 'Headers Timeout Error'\n this.code = 'UND_ERR_HEADERS_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHeadersTimeoutError] === true\n }\n\n get [kHeadersTimeoutError] () {\n return true\n }\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'HeadersOverflowError'\n this.message = message || 'Headers Overflow Error'\n this.code = 'UND_ERR_HEADERS_OVERFLOW'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHeadersOverflowError] === true\n }\n\n get [kHeadersOverflowError] () {\n return true\n }\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'BodyTimeoutError'\n this.message = message || 'Body Timeout Error'\n this.code = 'UND_ERR_BODY_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kBodyTimeoutError] === true\n }\n\n get [kBodyTimeoutError] () {\n return true\n }\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InvalidArgumentError'\n this.message = message || 'Invalid Argument Error'\n this.code = 'UND_ERR_INVALID_ARG'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInvalidArgumentError] === true\n }\n\n get [kInvalidArgumentError] () {\n return true\n }\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InvalidReturnValueError'\n this.message = message || 'Invalid Return Value Error'\n this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInvalidReturnValueError] === true\n }\n\n get [kInvalidReturnValueError] () {\n return true\n }\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'AbortError'\n this.message = message || 'The operation was aborted'\n this.code = 'UND_ERR_ABORT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kAbortError] === true\n }\n\n get [kAbortError] () {\n return true\n }\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n constructor (message) {\n super(message)\n this.name = 'AbortError'\n this.message = message || 'Request aborted'\n this.code = 'UND_ERR_ABORTED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestAbortedError] === true\n }\n\n get [kRequestAbortedError] () {\n return true\n }\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InformationalError'\n this.message = message || 'Request information'\n this.code = 'UND_ERR_INFO'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInformationalError] === true\n }\n\n get [kInformationalError] () {\n return true\n }\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'RequestContentLengthMismatchError'\n this.message = message || 'Request body length does not match content-length header'\n this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestContentLengthMismatchError] === true\n }\n\n get [kRequestContentLengthMismatchError] () {\n return true\n }\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ResponseContentLengthMismatchError'\n this.message = message || 'Response body length does not match content-length header'\n this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseContentLengthMismatchError] === true\n }\n\n get [kResponseContentLengthMismatchError] () {\n return true\n }\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ClientDestroyedError'\n this.message = message || 'The client is destroyed'\n this.code = 'UND_ERR_DESTROYED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kClientDestroyedError] === true\n }\n\n get [kClientDestroyedError] () {\n return true\n }\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ClientClosedError'\n this.message = message || 'The client is closed'\n this.code = 'UND_ERR_CLOSED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kClientClosedError] === true\n }\n\n get [kClientClosedError] () {\n return true\n }\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n constructor (message, socket) {\n super(message)\n this.name = 'SocketError'\n this.message = message || 'Socket error'\n this.code = 'UND_ERR_SOCKET'\n this.socket = socket\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kSocketError] === true\n }\n\n get [kSocketError] () {\n return true\n }\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'NotSupportedError'\n this.message = message || 'Not supported error'\n this.code = 'UND_ERR_NOT_SUPPORTED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kNotSupportedError] === true\n }\n\n get [kNotSupportedError] () {\n return true\n }\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MissingUpstreamError'\n this.message = message || 'No upstream has been added to the BalancedPool'\n this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kBalancedPoolMissingUpstreamError] === true\n }\n\n get [kBalancedPoolMissingUpstreamError] () {\n return true\n }\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n constructor (message, code, data) {\n super(message)\n this.name = 'HTTPParserError'\n this.code = code ? `HPE_${code}` : undefined\n this.data = data ? data.toString() : undefined\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHTTPParserError] === true\n }\n\n get [kHTTPParserError] () {\n return true\n }\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ResponseExceededMaxSizeError'\n this.message = message || 'Response content exceeded max size'\n this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseExceededMaxSizeError] === true\n }\n\n get [kResponseExceededMaxSizeError] () {\n return true\n }\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n constructor (message, code, { headers, data }) {\n super(message)\n this.name = 'RequestRetryError'\n this.message = message || 'Request retry error'\n this.code = 'UND_ERR_REQ_RETRY'\n this.statusCode = code\n this.data = data\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestRetryError] === true\n }\n\n get [kRequestRetryError] () {\n return true\n }\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n constructor (message, code, { headers, body }) {\n super(message)\n this.name = 'ResponseError'\n this.message = message || 'Response error'\n this.code = 'UND_ERR_RESPONSE'\n this.statusCode = code\n this.body = body\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseError] === true\n }\n\n get [kResponseError] () {\n return true\n }\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n constructor (cause, message, options = {}) {\n super(message, { cause, ...options })\n this.name = 'SecureProxyConnectionError'\n this.message = message || 'Secure Proxy Connection failed'\n this.code = 'UND_ERR_PRX_TLS'\n this.cause = cause\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kSecureProxyConnectionError] === true\n }\n\n get [kSecureProxyConnectionError] () {\n return true\n }\n}\n\nconst kMaxOriginsReachedError = Symbol.for('undici.error.UND_ERR_MAX_ORIGINS_REACHED')\nclass MaxOriginsReachedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MaxOriginsReachedError'\n this.message = message || 'Maximum allowed origins reached'\n this.code = 'UND_ERR_MAX_ORIGINS_REACHED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMaxOriginsReachedError] === true\n }\n\n get [kMaxOriginsReachedError] () {\n return true\n }\n}\n\nclass Socks5ProxyError extends UndiciError {\n constructor (message, code) {\n super(message)\n this.name = 'Socks5ProxyError'\n this.message = message || 'SOCKS5 proxy error'\n this.code = code || 'UND_ERR_SOCKS5'\n }\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MessageSizeExceededError'\n this.message = message || 'Max decompressed message size exceeded'\n this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMessageSizeExceededError] === true\n }\n\n get [kMessageSizeExceededError] () {\n return true\n }\n}\n\nmodule.exports = {\n AbortError,\n HTTPParserError,\n UndiciError,\n HeadersTimeoutError,\n HeadersOverflowError,\n BodyTimeoutError,\n RequestContentLengthMismatchError,\n ConnectTimeoutError,\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError,\n ClientDestroyedError,\n ClientClosedError,\n InformationalError,\n SocketError,\n NotSupportedError,\n ResponseContentLengthMismatchError,\n BalancedPoolMissingUpstreamError,\n ResponseExceededMaxSizeError,\n RequestRetryError,\n ResponseError,\n SecureProxyConnectionError,\n MaxOriginsReachedError,\n Socks5ProxyError,\n MessageSizeExceededError\n}\n","'use strict'\n\n/**\n * @see https://developer.mozilla.org/docs/Web/HTTP/Headers\n */\nconst wellknownHeaderNames = /** @type {const} */ ([\n 'Accept',\n 'Accept-Encoding',\n 'Accept-Language',\n 'Accept-Ranges',\n 'Access-Control-Allow-Credentials',\n 'Access-Control-Allow-Headers',\n 'Access-Control-Allow-Methods',\n 'Access-Control-Allow-Origin',\n 'Access-Control-Expose-Headers',\n 'Access-Control-Max-Age',\n 'Access-Control-Request-Headers',\n 'Access-Control-Request-Method',\n 'Age',\n 'Allow',\n 'Alt-Svc',\n 'Alt-Used',\n 'Authorization',\n 'Cache-Control',\n 'Clear-Site-Data',\n 'Connection',\n 'Content-Disposition',\n 'Content-Encoding',\n 'Content-Language',\n 'Content-Length',\n 'Content-Location',\n 'Content-Range',\n 'Content-Security-Policy',\n 'Content-Security-Policy-Report-Only',\n 'Content-Type',\n 'Cookie',\n 'Cross-Origin-Embedder-Policy',\n 'Cross-Origin-Opener-Policy',\n 'Cross-Origin-Resource-Policy',\n 'Date',\n 'Device-Memory',\n 'Downlink',\n 'ECT',\n 'ETag',\n 'Expect',\n 'Expect-CT',\n 'Expires',\n 'Forwarded',\n 'From',\n 'Host',\n 'If-Match',\n 'If-Modified-Since',\n 'If-None-Match',\n 'If-Range',\n 'If-Unmodified-Since',\n 'Keep-Alive',\n 'Last-Modified',\n 'Link',\n 'Location',\n 'Max-Forwards',\n 'Origin',\n 'Permissions-Policy',\n 'Pragma',\n 'Proxy-Authenticate',\n 'Proxy-Authorization',\n 'RTT',\n 'Range',\n 'Referer',\n 'Referrer-Policy',\n 'Refresh',\n 'Retry-After',\n 'Sec-WebSocket-Accept',\n 'Sec-WebSocket-Extensions',\n 'Sec-WebSocket-Key',\n 'Sec-WebSocket-Protocol',\n 'Sec-WebSocket-Version',\n 'Server',\n 'Server-Timing',\n 'Service-Worker-Allowed',\n 'Service-Worker-Navigation-Preload',\n 'Set-Cookie',\n 'SourceMap',\n 'Strict-Transport-Security',\n 'Supports-Loading-Mode',\n 'TE',\n 'Timing-Allow-Origin',\n 'Trailer',\n 'Transfer-Encoding',\n 'Upgrade',\n 'Upgrade-Insecure-Requests',\n 'User-Agent',\n 'Vary',\n 'Via',\n 'WWW-Authenticate',\n 'X-Content-Type-Options',\n 'X-DNS-Prefetch-Control',\n 'X-Frame-Options',\n 'X-Permitted-Cross-Domain-Policies',\n 'X-Powered-By',\n 'X-Requested-With',\n 'X-XSS-Protection'\n])\n\n/** @type {Record<typeof wellknownHeaderNames[number]|Lowercase<typeof wellknownHeaderNames[number]>, string>} */\nconst headerNameLowerCasedRecord = {}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\n/**\n * @type {Record<Lowercase<typeof wellknownHeaderNames[number]>, Buffer>}\n */\nconst wellknownHeaderNameBuffers = {}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(wellknownHeaderNameBuffers, null)\n\n/**\n * @param {string} header Lowercased header\n * @returns {Buffer}\n */\nfunction getHeaderNameAsBuffer (header) {\n let buffer = wellknownHeaderNameBuffers[header]\n\n if (buffer === undefined) {\n buffer = Buffer.from(header)\n }\n\n return buffer\n}\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = wellknownHeaderNames[i]\n const lowerCasedKey = key.toLowerCase()\n headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n lowerCasedKey\n}\n\nmodule.exports = {\n wellknownHeaderNames,\n headerNameLowerCasedRecord,\n getHeaderNameAsBuffer\n}\n","'use strict'\n\nconst {\n wellknownHeaderNames,\n headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n /** @type {any} */\n value = null\n /** @type {null | TstNode} */\n left = null\n /** @type {null | TstNode} */\n middle = null\n /** @type {null | TstNode} */\n right = null\n /** @type {number} */\n code\n /**\n * @param {string} key\n * @param {any} value\n * @param {number} index\n */\n constructor (key, value, index) {\n if (index === undefined || index >= key.length) {\n throw new TypeError('Unreachable')\n }\n const code = this.code = key.charCodeAt(index)\n // check code is ascii string\n if (code > 0x7F) {\n throw new TypeError('key must be ascii string')\n }\n if (key.length !== ++index) {\n this.middle = new TstNode(key, value, index)\n } else {\n this.value = value\n }\n }\n\n /**\n * @param {string} key\n * @param {any} value\n * @returns {void}\n */\n add (key, value) {\n const length = key.length\n if (length === 0) {\n throw new TypeError('Unreachable')\n }\n let index = 0\n /**\n * @type {TstNode}\n */\n let node = this\n while (true) {\n const code = key.charCodeAt(index)\n // check code is ascii string\n if (code > 0x7F) {\n throw new TypeError('key must be ascii string')\n }\n if (node.code === code) {\n if (length === ++index) {\n node.value = value\n break\n } else if (node.middle !== null) {\n node = node.middle\n } else {\n node.middle = new TstNode(key, value, index)\n break\n }\n } else if (node.code < code) {\n if (node.left !== null) {\n node = node.left\n } else {\n node.left = new TstNode(key, value, index)\n break\n }\n } else if (node.right !== null) {\n node = node.right\n } else {\n node.right = new TstNode(key, value, index)\n break\n }\n }\n }\n\n /**\n * @param {Uint8Array} key\n * @returns {TstNode | null}\n */\n search (key) {\n const keylength = key.length\n let index = 0\n /**\n * @type {TstNode|null}\n */\n let node = this\n while (node !== null && index < keylength) {\n let code = key[index]\n // A-Z\n // First check if it is bigger than 0x5a.\n // Lowercase letters have higher char codes than uppercase ones.\n // Also we assume that headers will mostly contain lowercase characters.\n if (code <= 0x5a && code >= 0x41) {\n // Lowercase for uppercase.\n code |= 32\n }\n while (node !== null) {\n if (code === node.code) {\n if (keylength === ++index) {\n // Returns Node since it is the last key.\n return node\n }\n node = node.middle\n break\n }\n node = node.code < code ? node.left : node.right\n }\n }\n return null\n }\n}\n\nclass TernarySearchTree {\n /** @type {TstNode | null} */\n node = null\n\n /**\n * @param {string} key\n * @param {any} value\n * @returns {void}\n * */\n insert (key, value) {\n if (this.node === null) {\n this.node = new TstNode(key, value, 0)\n } else {\n this.node.add(key, value)\n }\n }\n\n /**\n * @param {Uint8Array} key\n * @returns {any}\n */\n lookup (key) {\n return this.node?.search(key)?.value ?? null\n }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n tree.insert(key, key)\n}\n\nmodule.exports = {\n TernarySearchTree,\n tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst timers = require('../util/timers')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.', 2).map(v => Number(v))\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nfunction noop () {}\n\n/**\n * @param {*} body\n * @returns {*}\n */\nfunction wrapRequestBody (body) {\n if (isStream(body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (bodyLength(body) === 0) {\n body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof body.readableDidRead !== 'boolean') {\n body[kBodyUsed] = false\n EE.prototype.on.call(body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n\n return body\n } else if (body && typeof body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n return new BodyAsyncIterable(body)\n } else if (body && isFormDataLike(body)) {\n return body\n } else if (\n body &&\n typeof body !== 'string' &&\n !ArrayBuffer.isView(body) &&\n isIterable(body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n return new BodyAsyncIterable(body)\n } else {\n return body\n }\n}\n\n/**\n * @param {*} obj\n * @returns {obj is import('node:stream').Stream}\n */\nfunction isStream (obj) {\n return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n/**\n * @param {*} object\n * @returns {object is Blob}\n * based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\n */\nfunction isBlobLike (object) {\n if (object === null) {\n return false\n } else if (object instanceof Blob) {\n return true\n } else if (typeof object !== 'object') {\n return false\n } else {\n const sTag = object[Symbol.toStringTag]\n\n return (sTag === 'Blob' || sTag === 'File') && (\n ('stream' in object && typeof object.stream === 'function') ||\n ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n )\n }\n}\n\n/**\n * @param {string} url The path to check for query strings or fragments.\n * @returns {boolean} Returns true if the path contains a query string or fragment.\n */\nfunction pathHasQueryOrFragment (url) {\n return (\n url.includes('?') ||\n url.includes('#')\n )\n}\n\n/**\n * @param {string} url The URL to add the query params to\n * @param {import('node:querystring').ParsedUrlQueryInput} queryParams The object to serialize into a URL query string\n * @returns {string} The URL with the query params added\n */\nfunction serializePathWithQuery (url, queryParams) {\n if (pathHasQueryOrFragment(url)) {\n throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n }\n\n const stringified = stringify(queryParams)\n\n if (stringified) {\n url += '?' + stringified\n }\n\n return url\n}\n\n/**\n * @param {number|string|undefined} port\n * @returns {boolean}\n */\nfunction isValidPort (port) {\n const value = parseInt(port, 10)\n return (\n value === Number(port) &&\n value >= 0 &&\n value <= 65535\n )\n}\n\n/**\n * Check if the value is a valid http or https prefixed string.\n *\n * @param {string} value\n * @returns {boolean}\n */\nfunction isHttpOrHttpsPrefixed (value) {\n return (\n value != null &&\n value[0] === 'h' &&\n value[1] === 't' &&\n value[2] === 't' &&\n value[3] === 'p' &&\n (\n value[4] === ':' ||\n (\n value[4] === 's' &&\n value[5] === ':'\n )\n )\n )\n}\n\n/**\n * @param {string|URL|Record<string,string>} url\n * @returns {URL}\n */\nfunction parseURL (url) {\n if (typeof url === 'string') {\n /**\n * @type {URL}\n */\n url = new URL(url)\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n }\n\n if (!url || typeof url !== 'object') {\n throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n }\n\n if (!(url instanceof URL)) {\n if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n }\n\n if (url.path != null && typeof url.path !== 'string') {\n throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n }\n\n if (url.pathname != null && typeof url.pathname !== 'string') {\n throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n }\n\n if (url.hostname != null && typeof url.hostname !== 'string') {\n throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n }\n\n if (url.origin != null && typeof url.origin !== 'string') {\n throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n }\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n const port = url.port != null\n ? url.port\n : (url.protocol === 'https:' ? 443 : 80)\n let origin = url.origin != null\n ? url.origin\n : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n let path = url.path != null\n ? url.path\n : `${url.pathname || ''}${url.search || ''}`\n\n if (origin[origin.length - 1] === '/') {\n origin = origin.slice(0, origin.length - 1)\n }\n\n if (path && path[0] !== '/') {\n path = `/${path}`\n }\n // new URL(path, origin) is unsafe when `path` contains an absolute URL\n // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n // If first parameter is an absolute URL, a given second param will be ignored.\n return new URL(`${origin}${path}`)\n }\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n}\n\n/**\n * @param {string|URL|Record<string, string>} url\n * @returns {URL}\n */\nfunction parseOrigin (url) {\n url = parseURL(url)\n\n if (url.pathname !== '/' || url.search || url.hash) {\n throw new InvalidArgumentError('invalid url')\n }\n\n return url\n}\n\n/**\n * @param {string} host\n * @returns {string}\n */\nfunction getHostname (host) {\n if (host[0] === '[') {\n const idx = host.indexOf(']')\n\n assert(idx !== -1)\n return host.substring(1, idx)\n }\n\n const idx = host.indexOf(':')\n if (idx === -1) return host\n\n return host.substring(0, idx)\n}\n\n/**\n * IP addresses are not valid server names per RFC6066\n * Currently, the only server names supported are DNS hostnames\n * @param {string|null} host\n * @returns {string|null}\n */\nfunction getServerName (host) {\n if (!host) {\n return null\n }\n\n assert(typeof host === 'string')\n\n const servername = getHostname(host)\n if (net.isIP(servername)) {\n return ''\n }\n\n return servername\n}\n\n/**\n * @function\n * @template T\n * @param {T} obj\n * @returns {T}\n */\nfunction deepClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\n/**\n * @param {*} obj\n * @returns {obj is AsyncIterable}\n */\nfunction isAsyncIterable (obj) {\n return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\n/**\n * @param {*} obj\n * @returns {obj is Iterable}\n */\nfunction isIterable (obj) {\n return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\n/**\n * Checks whether an object has a safe Symbol.iterator — i.e. one that is\n * either own or inherited from a non-Object.prototype chain. This prevents\n * prototype-pollution attacks from injecting a fake iterator on\n * Object.prototype.\n * @param {object} obj\n * @returns {boolean}\n */\nfunction hasSafeIterator (obj) {\n const prototype = Object.getPrototypeOf(obj)\n const ownIterator = Object.prototype.hasOwnProperty.call(obj, Symbol.iterator)\n return ownIterator || (prototype != null && prototype !== Object.prototype && typeof obj[Symbol.iterator] === 'function')\n}\n\n/**\n * @param {Blob|Buffer|import ('stream').Stream} body\n * @returns {number|null}\n */\nfunction bodyLength (body) {\n if (body == null) {\n return 0\n } else if (isStream(body)) {\n const state = body._readableState\n return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n ? state.length\n : null\n } else if (isBlobLike(body)) {\n return body.size != null ? body.size : null\n } else if (isBuffer(body)) {\n return body.byteLength\n }\n\n return null\n}\n\n/**\n * @param {import ('stream').Stream} body\n * @returns {boolean}\n */\nfunction isDestroyed (body) {\n return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\n/**\n * @param {import ('stream').Stream} stream\n * @param {Error} [err]\n * @returns {void}\n */\nfunction destroy (stream, err) {\n if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n return\n }\n\n if (typeof stream.destroy === 'function') {\n if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n // See: https://github.com/nodejs/node/pull/38505/files\n stream.socket = null\n }\n\n stream.destroy(err)\n } else if (err) {\n queueMicrotask(() => {\n stream.emit('error', err)\n })\n }\n\n if (stream.destroyed !== true) {\n stream[kDestroyed] = true\n }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\n/**\n * @param {string} val\n * @returns {number | null}\n */\nfunction parseKeepAliveTimeout (val) {\n const m = val.match(KEEPALIVE_TIMEOUT_EXPR)\n return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n return typeof value === 'string'\n ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {(Buffer | string)[]} headers\n * @param {Record<string, string | string[]>} [obj]\n * @returns {Record<string, string | string[]>}\n */\nfunction parseHeaders (headers, obj) {\n if (obj === undefined) obj = {}\n\n for (let i = 0; i < headers.length; i += 2) {\n const key = headerNameToString(headers[i])\n let val = obj[key]\n\n if (val !== undefined) {\n if (!Object.hasOwn(obj, key)) {\n const headersValue = typeof headers[i + 1] === 'string'\n ? headers[i + 1]\n : Array.isArray(headers[i + 1])\n ? headers[i + 1].map(x => x.toString('latin1'))\n : headers[i + 1].toString('latin1')\n\n if (key === '__proto__') {\n Object.defineProperty(obj, key, {\n value: headersValue,\n enumerable: true,\n configurable: true,\n writable: true\n })\n } else {\n obj[key] = headersValue\n }\n } else {\n if (typeof val === 'string') {\n val = [val]\n obj[key] = val\n }\n val.push(headers[i + 1].toString('latin1'))\n }\n } else {\n const headersValue = typeof headers[i + 1] === 'string'\n ? headers[i + 1]\n : Array.isArray(headers[i + 1])\n ? headers[i + 1].map(x => x.toString('latin1'))\n : headers[i + 1].toString('latin1')\n\n obj[key] = headersValue\n }\n }\n\n return obj\n}\n\n/**\n * @param {Buffer[]} headers\n * @returns {string[]}\n */\nfunction parseRawHeaders (headers) {\n const headersLength = headers.length\n /**\n * @type {string[]}\n */\n const ret = new Array(headersLength)\n\n let key\n let val\n\n for (let n = 0; n < headersLength; n += 2) {\n key = headers[n]\n val = headers[n + 1]\n\n typeof key !== 'string' && (key = key.toString())\n typeof val !== 'string' && (val = val.toString('latin1'))\n\n ret[n] = key\n ret[n + 1] = val\n }\n\n return ret\n}\n\n/**\n * @param {string[]} headers\n * @param {Buffer[]} headers\n */\nfunction encodeRawHeaders (headers) {\n if (!Array.isArray(headers)) {\n throw new TypeError('expected headers to be an array')\n }\n return headers.map(x => Buffer.from(x))\n}\n\n/**\n * @param {*} buffer\n * @returns {buffer is Buffer}\n */\nfunction isBuffer (buffer) {\n // See, https://github.com/mcollina/undici/pull/319\n return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\n/**\n * Asserts that the handler object is a request handler.\n *\n * @param {object} handler\n * @param {string} method\n * @param {string} [upgrade]\n * @returns {asserts handler is import('../api/api-request').RequestHandler}\n */\nfunction assertRequestHandler (handler, method, upgrade) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n if (typeof handler.onRequestStart === 'function') {\n // TODO (fix): More checks...\n return\n }\n\n if (typeof handler.onConnect !== 'function') {\n throw new InvalidArgumentError('invalid onConnect method')\n }\n\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n throw new InvalidArgumentError('invalid onBodySent method')\n }\n\n if (upgrade || method === 'CONNECT') {\n if (typeof handler.onUpgrade !== 'function') {\n throw new InvalidArgumentError('invalid onUpgrade method')\n }\n } else {\n if (typeof handler.onHeaders !== 'function') {\n throw new InvalidArgumentError('invalid onHeaders method')\n }\n\n if (typeof handler.onData !== 'function') {\n throw new InvalidArgumentError('invalid onData method')\n }\n\n if (typeof handler.onComplete !== 'function') {\n throw new InvalidArgumentError('invalid onComplete method')\n }\n }\n}\n\n/**\n * A body is disturbed if it has been read from and it cannot be re-used without\n * losing state or data.\n * @param {import('node:stream').Readable} body\n * @returns {boolean}\n */\nfunction isDisturbed (body) {\n // TODO (fix): Why is body[kBodyUsed] needed?\n return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\n/**\n * @typedef {object} SocketInfo\n * @property {string} [localAddress]\n * @property {number} [localPort]\n * @property {string} [remoteAddress]\n * @property {number} [remotePort]\n * @property {string} [remoteFamily]\n * @property {number} [timeout]\n * @property {number} bytesWritten\n * @property {number} bytesRead\n */\n\n/**\n * @param {import('net').Socket} socket\n * @returns {SocketInfo}\n */\nfunction getSocketInfo (socket) {\n return {\n localAddress: socket.localAddress,\n localPort: socket.localPort,\n remoteAddress: socket.remoteAddress,\n remotePort: socket.remotePort,\n remoteFamily: socket.remoteFamily,\n timeout: socket.timeout,\n bytesWritten: socket.bytesWritten,\n bytesRead: socket.bytesRead\n }\n}\n\n/**\n * @param {Iterable} iterable\n * @returns {ReadableStream}\n */\nfunction ReadableStreamFrom (iterable) {\n // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n let iterator\n return new ReadableStream(\n {\n start () {\n iterator = iterable[Symbol.asyncIterator]()\n },\n pull (controller) {\n return iterator.next().then(({ done, value }) => {\n if (done) {\n return queueMicrotask(() => {\n controller.close()\n controller.byobRequest?.respond(0)\n })\n } else {\n const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n if (buf.byteLength) {\n return controller.enqueue(new Uint8Array(buf))\n } else {\n return this.pull(controller)\n }\n }\n })\n },\n cancel () {\n return iterator.return()\n },\n type: 'bytes'\n }\n )\n}\n\n/**\n * The object should be a FormData instance and contains all the required\n * methods.\n * @param {*} object\n * @returns {object is FormData}\n */\nfunction isFormDataLike (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.append === 'function' &&\n typeof object.delete === 'function' &&\n typeof object.get === 'function' &&\n typeof object.getAll === 'function' &&\n typeof object.has === 'function' &&\n typeof object.set === 'function' &&\n object[Symbol.toStringTag] === 'FormData'\n )\n}\n\nfunction addAbortListener (signal, listener) {\n if ('addEventListener' in signal) {\n signal.addEventListener('abort', listener, { once: true })\n return () => signal.removeEventListener('abort', listener)\n }\n signal.once('abort', listener)\n return () => signal.removeListener('abort', listener)\n}\n\nconst validTokenChars = new Uint8Array([\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0-15\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31\n 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32-47 (!\"#$%&'()*+,-./)\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48-63 (0-9:;<=>?)\n 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64-79 (@A-O)\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80-95 (P-Z[\\]^_)\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96-111 (`a-o)\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, // 112-127 (p-z{|}~)\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128-143\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 144-159\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 160-175\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 176-191\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 192-207\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 208-223\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 224-239\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 240-255\n])\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n * @returns {boolean}\n */\nfunction isTokenCharCode (c) {\n return (validTokenChars[c] === 1)\n}\n\nconst tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/\n\n/**\n * @param {string} characters\n * @returns {boolean}\n */\nfunction isValidHTTPToken (characters) {\n if (characters.length >= 12) return tokenRegExp.test(characters)\n if (characters.length === 0) return false\n\n for (let i = 0; i < characters.length; i++) {\n if (validTokenChars[characters.charCodeAt(i)] !== 1) {\n return false\n }\n }\n return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n * field-value = *( field-content / obs-fold )\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n * @returns {boolean}\n */\nfunction isValidHeaderValue (characters) {\n return !headerCharRegex.test(characters)\n}\n\nconst rangeHeaderRegex = /^bytes (\\d+)-(\\d+)\\/(\\d+)?$/\n\n/**\n * @typedef {object} RangeHeader\n * @property {number} start\n * @property {number | null} end\n * @property {number | null} size\n */\n\n/**\n * Parse accordingly to RFC 9110\n * @see https://www.rfc-editor.org/rfc/rfc9110#field.content-range\n * @param {string} [range]\n * @returns {RangeHeader|null}\n */\nfunction parseRangeHeader (range) {\n if (range == null || range === '') return { start: 0, end: null, size: null }\n\n const m = range ? range.match(rangeHeaderRegex) : null\n return m\n ? {\n start: parseInt(m[1]),\n end: m[2] ? parseInt(m[2]) : null,\n size: m[3] ? parseInt(m[3]) : null\n }\n : null\n}\n\n/**\n * @template {import(\"events\").EventEmitter} T\n * @param {T} obj\n * @param {string} name\n * @param {(...args: any[]) => void} listener\n * @returns {T}\n */\nfunction addListener (obj, name, listener) {\n const listeners = (obj[kListeners] ??= [])\n listeners.push([name, listener])\n obj.on(name, listener)\n return obj\n}\n\n/**\n * @template {import(\"events\").EventEmitter} T\n * @param {T} obj\n * @returns {T}\n */\nfunction removeAllListeners (obj) {\n if (obj[kListeners] != null) {\n for (const [name, listener] of obj[kListeners]) {\n obj.removeListener(name, listener)\n }\n obj[kListeners] = null\n }\n return obj\n}\n\n/**\n * @param {import ('../dispatcher/client')} client\n * @param {import ('../core/request')} request\n * @param {Error} err\n */\nfunction errorRequest (client, request, err) {\n try {\n request.onError(err)\n assert(request.aborted)\n } catch (err) {\n client.emit('error', err)\n }\n}\n\n/**\n * @param {WeakRef<net.Socket>} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n ? (socketWeakRef, opts) => {\n if (!opts.timeout) {\n return noop\n }\n\n let s1 = null\n let s2 = null\n const fastTimer = timers.setFastTimeout(() => {\n // setImmediate is added to make sure that we prioritize socket error events over timeouts\n s1 = setImmediate(() => {\n // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n })\n }, opts.timeout)\n return () => {\n timers.clearFastTimeout(fastTimer)\n clearImmediate(s1)\n clearImmediate(s2)\n }\n }\n : (socketWeakRef, opts) => {\n if (!opts.timeout) {\n return noop\n }\n\n let s1 = null\n const fastTimer = timers.setFastTimeout(() => {\n // setImmediate is added to make sure that we prioritize socket error events over timeouts\n s1 = setImmediate(() => {\n onConnectTimeout(socketWeakRef.deref(), opts)\n })\n }, opts.timeout)\n return () => {\n timers.clearFastTimeout(fastTimer)\n clearImmediate(s1)\n }\n }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n // The socket could be already garbage collected\n if (socket == null) {\n return\n }\n\n let message = 'Connect Timeout Error'\n if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n } else {\n message += ` (attempted address: ${opts.hostname}:${opts.port},`\n }\n\n message += ` timeout: ${opts.timeout}ms)`\n\n destroy(socket, new ConnectTimeoutError(message))\n}\n\n/**\n * @param {string} urlString\n * @returns {string}\n */\nfunction getProtocolFromUrlString (urlString) {\n if (\n urlString[0] === 'h' &&\n urlString[1] === 't' &&\n urlString[2] === 't' &&\n urlString[3] === 'p'\n ) {\n switch (urlString[4]) {\n case ':':\n return 'http:'\n case 's':\n if (urlString[5] === ':') {\n return 'https:'\n }\n }\n }\n // fallback if none of the usual suspects\n return urlString.slice(0, urlString.indexOf(':') + 1)\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n delete: 'DELETE',\n DELETE: 'DELETE',\n get: 'GET',\n GET: 'GET',\n head: 'HEAD',\n HEAD: 'HEAD',\n options: 'OPTIONS',\n OPTIONS: 'OPTIONS',\n post: 'POST',\n POST: 'POST',\n put: 'PUT',\n PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n ...normalizedMethodRecordsBase,\n patch: 'patch',\n PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n kEnumerableProperty,\n isDisturbed,\n isBlobLike,\n parseOrigin,\n parseURL,\n getServerName,\n isStream,\n isIterable,\n hasSafeIterator,\n isAsyncIterable,\n isDestroyed,\n headerNameToString,\n bufferToLowerCasedHeaderName,\n addListener,\n removeAllListeners,\n errorRequest,\n parseRawHeaders,\n encodeRawHeaders,\n parseHeaders,\n parseKeepAliveTimeout,\n destroy,\n bodyLength,\n deepClone,\n ReadableStreamFrom,\n isBuffer,\n assertRequestHandler,\n getSocketInfo,\n isFormDataLike,\n pathHasQueryOrFragment,\n serializePathWithQuery,\n addAbortListener,\n isValidHTTPToken,\n isValidHeaderValue,\n isTokenCharCode,\n parseRangeHeader,\n normalizedMethodRecordsBase,\n normalizedMethodRecords,\n isValidPort,\n isHttpOrHttpsPrefixed,\n nodeMajor,\n nodeMinor,\n safeHTTPMethods: Object.freeze(['GET', 'HEAD', 'OPTIONS', 'TRACE']),\n wrapRequestBody,\n setupConnectTimeout,\n getProtocolFromUrlString\n}\n","'use strict'\n\nconst {\n kConnected,\n kPending,\n kRunning,\n kSize,\n kFree,\n kQueued\n} = require('../core/symbols')\n\nclass ClientStats {\n constructor (client) {\n this.connected = client[kConnected]\n this.pending = client[kPending]\n this.running = client[kRunning]\n this.size = client[kSize]\n }\n}\n\nclass PoolStats {\n constructor (pool) {\n this.connected = pool[kConnected]\n this.free = pool[kFree]\n this.pending = pool[kPending]\n this.queued = pool[kQueued]\n this.running = pool[kRunning]\n this.size = pool[kSize]\n }\n}\n\nmodule.exports = { ClientStats, PoolStats }\n","'use strict'\n\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\n\nconst channels = {\n // Client\n beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n connected: diagnosticsChannel.channel('undici:client:connected'),\n connectError: diagnosticsChannel.channel('undici:client:connectError'),\n sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n // Request\n create: diagnosticsChannel.channel('undici:request:create'),\n bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n bodyChunkSent: diagnosticsChannel.channel('undici:request:bodyChunkSent'),\n bodyChunkReceived: diagnosticsChannel.channel('undici:request:bodyChunkReceived'),\n headers: diagnosticsChannel.channel('undici:request:headers'),\n trailers: diagnosticsChannel.channel('undici:request:trailers'),\n error: diagnosticsChannel.channel('undici:request:error'),\n // WebSocket\n open: diagnosticsChannel.channel('undici:websocket:open'),\n close: diagnosticsChannel.channel('undici:websocket:close'),\n socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n ping: diagnosticsChannel.channel('undici:websocket:ping'),\n pong: diagnosticsChannel.channel('undici:websocket:pong'),\n // ProxyAgent\n proxyConnected: diagnosticsChannel.channel('undici:proxy:connected')\n}\n\nlet isTrackingClientEvents = false\n\nfunction trackClientEvents (debugLog = undiciDebugLog) {\n if (isTrackingClientEvents) {\n return\n }\n\n // Check if any of the channels already have subscribers to prevent duplicate subscriptions\n // This can happen when both Node.js built-in undici and undici as a dependency are present\n if (channels.beforeConnect.hasSubscribers || channels.connected.hasSubscribers ||\n channels.connectError.hasSubscribers || channels.sendHeaders.hasSubscribers) {\n isTrackingClientEvents = true\n return\n }\n\n isTrackingClientEvents = true\n\n diagnosticsChannel.subscribe('undici:client:beforeConnect',\n evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debugLog(\n 'connecting to %s%s using %s%s',\n host,\n port ? `:${port}` : '',\n protocol,\n version\n )\n })\n\n diagnosticsChannel.subscribe('undici:client:connected',\n evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debugLog(\n 'connected to %s%s using %s%s',\n host,\n port ? `:${port}` : '',\n protocol,\n version\n )\n })\n\n diagnosticsChannel.subscribe('undici:client:connectError',\n evt => {\n const {\n connectParams: { version, protocol, port, host },\n error\n } = evt\n debugLog(\n 'connection to %s%s using %s%s errored - %s',\n host,\n port ? `:${port}` : '',\n protocol,\n version,\n error.message\n )\n })\n\n diagnosticsChannel.subscribe('undici:client:sendHeaders',\n evt => {\n const {\n request: { method, path, origin }\n } = evt\n debugLog('sending request to %s %s%s', method, origin, path)\n })\n}\n\nlet isTrackingRequestEvents = false\n\nfunction trackRequestEvents (debugLog = undiciDebugLog) {\n if (isTrackingRequestEvents) {\n return\n }\n\n // Check if any of the channels already have subscribers to prevent duplicate subscriptions\n // This can happen when both Node.js built-in undici and undici as a dependency are present\n if (channels.headers.hasSubscribers || channels.trailers.hasSubscribers ||\n channels.error.hasSubscribers) {\n isTrackingRequestEvents = true\n return\n }\n\n isTrackingRequestEvents = true\n\n diagnosticsChannel.subscribe('undici:request:headers',\n evt => {\n const {\n request: { method, path, origin },\n response: { statusCode }\n } = evt\n debugLog(\n 'received response to %s %s%s - HTTP %d',\n method,\n origin,\n path,\n statusCode\n )\n })\n\n diagnosticsChannel.subscribe('undici:request:trailers',\n evt => {\n const {\n request: { method, path, origin }\n } = evt\n debugLog('trailers received from %s %s%s', method, origin, path)\n })\n\n diagnosticsChannel.subscribe('undici:request:error',\n evt => {\n const {\n request: { method, path, origin },\n error\n } = evt\n debugLog(\n 'request to %s %s%s errored - %s',\n method,\n origin,\n path,\n error.message\n )\n })\n}\n\nlet isTrackingWebSocketEvents = false\n\nfunction trackWebSocketEvents (debugLog = websocketDebuglog) {\n if (isTrackingWebSocketEvents) {\n return\n }\n\n // Check if any of the channels already have subscribers to prevent duplicate subscriptions\n // This can happen when both Node.js built-in undici and undici as a dependency are present\n if (channels.open.hasSubscribers || channels.close.hasSubscribers ||\n channels.socketError.hasSubscribers || channels.ping.hasSubscribers ||\n channels.pong.hasSubscribers) {\n isTrackingWebSocketEvents = true\n return\n }\n\n isTrackingWebSocketEvents = true\n\n diagnosticsChannel.subscribe('undici:websocket:open',\n evt => {\n if (evt.address != null) {\n const { address, port } = evt.address\n debugLog('connection opened %s%s', address, port ? `:${port}` : '')\n } else {\n debugLog('connection opened')\n }\n })\n\n diagnosticsChannel.subscribe('undici:websocket:close',\n evt => {\n const { websocket, code, reason } = evt\n debugLog(\n 'closed connection to %s - %s %s',\n websocket.url,\n code,\n reason\n )\n })\n\n diagnosticsChannel.subscribe('undici:websocket:socket_error',\n err => {\n debugLog('connection errored - %s', err.message)\n })\n\n diagnosticsChannel.subscribe('undici:websocket:ping',\n evt => {\n debugLog('ping received')\n })\n\n diagnosticsChannel.subscribe('undici:websocket:pong',\n evt => {\n debugLog('pong received')\n })\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n trackClientEvents(fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog)\n trackRequestEvents(fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog)\n}\n\nif (websocketDebuglog.enabled) {\n trackClientEvents(undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog)\n trackWebSocketEvents(websocketDebuglog)\n}\n\nmodule.exports = {\n channels\n}\n","'use strict'\n\nconst {\n InvalidArgumentError,\n NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n isValidHTTPToken,\n isValidHeaderValue,\n isStream,\n destroy,\n isBuffer,\n isFormDataLike,\n isIterable,\n hasSafeIterator,\n isBlobLike,\n serializePathWithQuery,\n assertRequestHandler,\n getServerName,\n normalizedMethodRecords,\n getProtocolFromUrlString\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nfunction isValidContentLengthHeaderValue (val) {\n if (typeof val !== 'string' || val.length === 0) {\n return false\n }\n\n for (let i = 0; i < val.length; i++) {\n const charCode = val.charCodeAt(i)\n if (charCode < 48 || charCode > 57) {\n return false\n }\n }\n\n return true\n}\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n constructor (origin, {\n path,\n method,\n body,\n headers,\n query,\n idempotent,\n blocking,\n upgrade,\n headersTimeout,\n bodyTimeout,\n reset,\n expectContinue,\n servername,\n throwOnError,\n maxRedirections,\n typeOfService\n }, handler) {\n if (typeof path !== 'string') {\n throw new InvalidArgumentError('path must be a string')\n } else if (\n path[0] !== '/' &&\n !(path.startsWith('http://') || path.startsWith('https://')) &&\n method !== 'CONNECT'\n ) {\n throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n } else if (invalidPathRegex.test(path)) {\n throw new InvalidArgumentError('invalid request path')\n }\n\n if (typeof method !== 'string') {\n throw new InvalidArgumentError('method must be a string')\n } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n throw new InvalidArgumentError('invalid request method')\n }\n\n if (upgrade && typeof upgrade !== 'string') {\n throw new InvalidArgumentError('upgrade must be a string')\n }\n\n if (upgrade && !isValidHeaderValue(upgrade)) {\n throw new InvalidArgumentError('invalid upgrade header')\n }\n\n if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('invalid headersTimeout')\n }\n\n if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('invalid bodyTimeout')\n }\n\n if (reset != null && typeof reset !== 'boolean') {\n throw new InvalidArgumentError('invalid reset')\n }\n\n if (expectContinue != null && typeof expectContinue !== 'boolean') {\n throw new InvalidArgumentError('invalid expectContinue')\n }\n\n if (throwOnError != null) {\n throw new InvalidArgumentError('invalid throwOnError')\n }\n\n if (maxRedirections != null && maxRedirections !== 0) {\n throw new InvalidArgumentError('maxRedirections is not supported, use the redirect interceptor')\n }\n\n if (typeOfService != null && (!Number.isInteger(typeOfService) || typeOfService < 0 || typeOfService > 255)) {\n throw new InvalidArgumentError('typeOfService must be an integer between 0 and 255')\n }\n\n this.headersTimeout = headersTimeout\n\n this.bodyTimeout = bodyTimeout\n\n this.method = method\n\n this.typeOfService = typeOfService ?? 0\n\n this.abort = null\n\n if (body == null) {\n this.body = null\n } else if (isStream(body)) {\n this.body = body\n\n const rState = this.body._readableState\n if (!rState || !rState.autoDestroy) {\n this.endHandler = function autoDestroy () {\n destroy(this)\n }\n this.body.on('end', this.endHandler)\n }\n\n this.errorHandler = err => {\n if (this.abort) {\n this.abort(err)\n } else {\n this.error = err\n }\n }\n this.body.on('error', this.errorHandler)\n } else if (isBuffer(body)) {\n this.body = body.byteLength ? body : null\n } else if (ArrayBuffer.isView(body)) {\n this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n } else if (body instanceof ArrayBuffer) {\n this.body = body.byteLength ? Buffer.from(body) : null\n } else if (typeof body === 'string') {\n this.body = body.length ? Buffer.from(body) : null\n } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n this.body = body\n } else {\n throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n }\n\n this.completed = false\n this.aborted = false\n\n this.upgrade = upgrade || null\n\n this.path = query ? serializePathWithQuery(path, query) : path\n\n // TODO: shall we maybe standardize it to an URL object?\n this.origin = origin\n\n this.protocol = getProtocolFromUrlString(origin)\n\n this.idempotent = idempotent == null\n ? method === 'HEAD' || method === 'GET'\n : idempotent\n\n this.blocking = blocking ?? this.method !== 'HEAD'\n\n this.reset = reset == null ? null : reset\n\n this.host = null\n\n this.contentLength = null\n\n this.contentType = null\n\n this.headers = []\n\n // Only for H2\n this.expectContinue = expectContinue != null ? expectContinue : false\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(this, headers[i], headers[i + 1])\n }\n } else if (headers && typeof headers === 'object') {\n if (hasSafeIterator(headers)) {\n for (const header of headers) {\n if (!Array.isArray(header) || header.length !== 2) {\n throw new InvalidArgumentError('headers must be in key-value pair format')\n }\n processHeader(this, header[0], header[1])\n }\n } else {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; ++i) {\n processHeader(this, keys[i], headers[keys[i]])\n }\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n assertRequestHandler(handler, method, upgrade)\n\n this.servername = servername || getServerName(this.host) || null\n\n this[kHandler] = handler\n\n if (channels.create.hasSubscribers) {\n channels.create.publish({ request: this })\n }\n }\n\n onBodySent (chunk) {\n if (channels.bodyChunkSent.hasSubscribers) {\n channels.bodyChunkSent.publish({ request: this, chunk })\n }\n if (this[kHandler].onBodySent) {\n try {\n return this[kHandler].onBodySent(chunk)\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onRequestSent () {\n if (channels.bodySent.hasSubscribers) {\n channels.bodySent.publish({ request: this })\n }\n\n if (this[kHandler].onRequestSent) {\n try {\n return this[kHandler].onRequestSent()\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onConnect (abort) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (this.error) {\n abort(this.error)\n } else {\n this.abort = abort\n return this[kHandler].onConnect(abort)\n }\n }\n\n onResponseStarted () {\n return this[kHandler].onResponseStarted?.()\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (channels.headers.hasSubscribers) {\n channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n }\n\n try {\n return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n } catch (err) {\n this.abort(err)\n }\n }\n\n onData (chunk) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (channels.bodyChunkReceived.hasSubscribers) {\n channels.bodyChunkReceived.publish({ request: this, chunk })\n }\n try {\n return this[kHandler].onData(chunk)\n } catch (err) {\n this.abort(err)\n return false\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n assert(!this.aborted)\n assert(!this.completed)\n\n return this[kHandler].onUpgrade(statusCode, headers, socket)\n }\n\n onComplete (trailers) {\n this.onFinally()\n\n assert(!this.aborted)\n assert(!this.completed)\n\n this.completed = true\n if (channels.trailers.hasSubscribers) {\n channels.trailers.publish({ request: this, trailers })\n }\n\n try {\n return this[kHandler].onComplete(trailers)\n } catch (err) {\n // TODO (fix): This might be a bad idea?\n this.onError(err)\n }\n }\n\n onError (error) {\n this.onFinally()\n\n if (channels.error.hasSubscribers) {\n channels.error.publish({ request: this, error })\n }\n\n if (this.aborted) {\n return\n }\n this.aborted = true\n\n return this[kHandler].onError(error)\n }\n\n onFinally () {\n if (this.errorHandler) {\n this.body.off('error', this.errorHandler)\n this.errorHandler = null\n }\n\n if (this.endHandler) {\n this.body.off('end', this.endHandler)\n this.endHandler = null\n }\n }\n\n addHeader (key, value) {\n processHeader(this, key, value)\n return this\n }\n}\n\nfunction processHeader (request, key, val) {\n if (val && (typeof val === 'object' && !Array.isArray(val))) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else if (val === undefined) {\n return\n }\n\n let headerName = headerNameLowerCasedRecord[key]\n\n if (headerName === undefined) {\n headerName = key.toLowerCase()\n if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n throw new InvalidArgumentError('invalid header key')\n }\n }\n\n if (Array.isArray(val)) {\n const arr = []\n for (let i = 0; i < val.length; i++) {\n if (typeof val[i] === 'string') {\n if (!isValidHeaderValue(val[i])) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n arr.push(val[i])\n } else if (val[i] === null) {\n arr.push('')\n } else if (typeof val[i] === 'object') {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else {\n // Coerce primitives (and reject unsafe coercions such as functions\n // with a crafted toString/Symbol.toPrimitive).\n const str = `${val[i]}`\n if (!isValidHeaderValue(str)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n arr.push(str)\n }\n }\n val = arr\n } else if (typeof val === 'string') {\n if (!isValidHeaderValue(val)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n } else if (val === null) {\n val = ''\n } else {\n // Coerce primitives (and reject unsafe coercions such as functions\n // with a crafted toString/Symbol.toPrimitive).\n val = `${val}`\n if (!isValidHeaderValue(val)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n }\n\n if (headerName === 'host') {\n if (request.host !== null) {\n throw new InvalidArgumentError('duplicate host header')\n }\n if (typeof val !== 'string') {\n throw new InvalidArgumentError('invalid host header')\n }\n // Consumed by Client\n request.host = val\n } else if (headerName === 'content-length') {\n if (request.contentLength !== null) {\n throw new InvalidArgumentError('duplicate content-length header')\n }\n if (!isValidContentLengthHeaderValue(val)) {\n throw new InvalidArgumentError('invalid content-length header')\n }\n request.contentLength = parseInt(val, 10)\n } else if (request.contentType === null && headerName === 'content-type') {\n request.contentType = val\n request.headers.push(key, val)\n } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n throw new InvalidArgumentError(`invalid ${headerName} header`)\n } else if (headerName === 'connection') {\n // Per RFC 7230 Section 6.1, Connection header can contain\n // a comma-separated list of connection option tokens (header names)\n const value = typeof val === 'string' ? val : null\n if (value === null) {\n throw new InvalidArgumentError('invalid connection header')\n }\n\n for (const token of value.toLowerCase().split(',')) {\n const trimmed = token.trim()\n if (!isValidHTTPToken(trimmed)) {\n throw new InvalidArgumentError('invalid connection header')\n }\n if (trimmed === 'close') {\n request.reset = true\n }\n }\n } else if (headerName === 'expect') {\n throw new NotSupportedError('expect header not supported')\n } else {\n request.headers.push(key, val)\n }\n}\n\nmodule.exports = Request\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\n\nmodule.exports = class WrapHandler {\n #handler\n\n constructor (handler) {\n this.#handler = handler\n }\n\n static wrap (handler) {\n // TODO (fix): More checks...\n return handler.onRequestStart ? handler : new WrapHandler(handler)\n }\n\n // Unwrap Interface\n\n onConnect (abort, context) {\n return this.#handler.onConnect?.(abort, context)\n }\n\n onResponseStarted () {\n return this.#handler.onResponseStarted?.()\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n return this.#handler.onHeaders?.(statusCode, rawHeaders, resume, statusMessage)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n return this.#handler.onUpgrade?.(statusCode, rawHeaders, socket)\n }\n\n onData (data) {\n return this.#handler.onData?.(data)\n }\n\n onComplete (trailers) {\n return this.#handler.onComplete?.(trailers)\n }\n\n onError (err) {\n if (!this.#handler.onError) {\n throw err\n }\n\n return this.#handler.onError?.(err)\n }\n\n // Wrap Interface\n\n onRequestStart (controller, context) {\n this.#handler.onConnect?.((reason) => controller.abort(reason), context)\n }\n\n onRequestUpgrade (controller, statusCode, headers, socket) {\n const rawHeaders = []\n for (const [key, val] of Object.entries(headers)) {\n rawHeaders.push(Buffer.from(key, 'latin1'), toRawHeaderValue(val))\n }\n\n this.#handler.onUpgrade?.(statusCode, rawHeaders, socket)\n }\n\n onResponseStart (controller, statusCode, headers, statusMessage) {\n const rawHeaders = []\n for (const [key, val] of Object.entries(headers)) {\n rawHeaders.push(Buffer.from(key, 'latin1'), toRawHeaderValue(val))\n }\n\n if (this.#handler.onHeaders?.(statusCode, rawHeaders, () => controller.resume(), statusMessage) === false) {\n controller.pause()\n }\n }\n\n onResponseData (controller, data) {\n if (this.#handler.onData?.(data) === false) {\n controller.pause()\n }\n }\n\n onResponseEnd (controller, trailers) {\n const rawTrailers = []\n for (const [key, val] of Object.entries(trailers)) {\n rawTrailers.push(Buffer.from(key, 'latin1'), toRawHeaderValue(val))\n }\n\n this.#handler.onComplete?.(rawTrailers)\n }\n\n onResponseError (controller, err) {\n if (!this.#handler.onError) {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n this.#handler.onError?.(err)\n }\n}\n\nfunction toRawHeaderValue (value) {\n return Array.isArray(value)\n ? value.map((item) => Buffer.from(item, 'latin1'))\n : Buffer.from(value, 'latin1')\n}\n","'use strict'\nconst EventEmitter = require('node:events')\nconst WrapHandler = require('../handler/wrap-handler')\n\nconst wrapInterceptor = (dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler))\n\nclass Dispatcher extends EventEmitter {\n dispatch () {\n throw new Error('not implemented')\n }\n\n close () {\n throw new Error('not implemented')\n }\n\n destroy () {\n throw new Error('not implemented')\n }\n\n compose (...args) {\n // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n const interceptors = Array.isArray(args[0]) ? args[0] : args\n let dispatch = this.dispatch.bind(this)\n\n for (const interceptor of interceptors) {\n if (interceptor == null) {\n continue\n }\n\n if (typeof interceptor !== 'function') {\n throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n }\n\n dispatch = interceptor(dispatch)\n dispatch = wrapInterceptor(dispatch)\n\n if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n throw new TypeError('invalid interceptor')\n }\n }\n\n return new Proxy(this, {\n get: (target, key) => key === 'dispatch' ? dispatch : target[key]\n })\n }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst { parseHeaders } = require('../core/util')\nconst { InvalidArgumentError } = require('../core/errors')\n\nconst kResume = Symbol('resume')\n\nclass UnwrapController {\n #paused = false\n #reason = null\n #aborted = false\n #abort\n\n [kResume] = null\n\n rawHeaders = null\n rawTrailers = null\n\n constructor (abort) {\n this.#abort = abort\n }\n\n pause () {\n this.#paused = true\n }\n\n resume () {\n if (this.#paused) {\n this.#paused = false\n this[kResume]?.()\n }\n }\n\n abort (reason) {\n if (!this.#aborted) {\n this.#aborted = true\n this.#reason = reason\n this.#abort(reason)\n }\n }\n\n get aborted () {\n return this.#aborted\n }\n\n get reason () {\n return this.#reason\n }\n\n get paused () {\n return this.#paused\n }\n}\n\nmodule.exports = class UnwrapHandler {\n #handler\n #controller\n\n constructor (handler) {\n this.#handler = handler\n }\n\n static unwrap (handler) {\n // TODO (fix): More checks...\n return !handler.onRequestStart ? handler : new UnwrapHandler(handler)\n }\n\n onConnect (abort, context) {\n this.#controller = new UnwrapController(abort)\n this.#handler.onRequestStart?.(this.#controller, context)\n }\n\n onResponseStarted () {\n return this.#handler.onResponseStarted?.()\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n this.#controller.rawHeaders = rawHeaders\n this.#handler.onRequestUpgrade?.(this.#controller, statusCode, parseHeaders(rawHeaders), socket)\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n this.#controller[kResume] = resume\n this.#controller.rawHeaders = rawHeaders\n this.#handler.onResponseStart?.(this.#controller, statusCode, parseHeaders(rawHeaders), statusMessage)\n return !this.#controller.paused\n }\n\n onData (data) {\n this.#handler.onResponseData?.(this.#controller, data)\n return !this.#controller.paused\n }\n\n onComplete (rawTrailers) {\n this.#controller.rawTrailers = rawTrailers\n this.#handler.onResponseEnd?.(this.#controller, parseHeaders(rawTrailers))\n }\n\n onError (err) {\n if (!this.#handler.onResponseError) {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n this.#handler.onResponseError?.(this.#controller, err)\n }\n}\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst UnwrapHandler = require('../handler/unwrap-handler')\nconst {\n ClientDestroyedError,\n ClientClosedError,\n InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n /** @type {boolean} */\n [kDestroyed] = false;\n\n /** @type {Array<Function|null} */\n [kOnDestroyed] = null;\n\n /** @type {boolean} */\n [kClosed] = false;\n\n /** @type {Array<Function>|null} */\n [kOnClosed] = null\n\n /**\n * @param {import('../../types/dispatcher').DispatcherOptions} [opts]\n */\n constructor (opts) {\n super()\n this[kWebSocketOptions] = opts?.webSocket ?? {}\n }\n\n /**\n * @returns {import('../../types/dispatcher').WebSocketOptions}\n */\n get webSocketOptions () {\n return {\n maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 // 128 MB default\n }\n }\n\n /** @returns {boolean} */\n get destroyed () {\n return this[kDestroyed]\n }\n\n /** @returns {boolean} */\n get closed () {\n return this[kClosed]\n }\n\n close (callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.close((err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n const err = new ClientDestroyedError()\n queueMicrotask(() => callback(err, null))\n return\n }\n\n if (this[kClosed]) {\n if (this[kOnClosed]) {\n this[kOnClosed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n this[kClosed] = true\n this[kOnClosed] ??= []\n this[kOnClosed].push(callback)\n\n const onClosed = () => {\n const callbacks = this[kOnClosed]\n this[kOnClosed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kClose]()\n .then(() => this.destroy())\n .then(() => queueMicrotask(onClosed))\n }\n\n destroy (err, callback) {\n if (typeof err === 'function') {\n callback = err\n err = null\n }\n\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.destroy(err, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n if (this[kOnDestroyed]) {\n this[kOnDestroyed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n if (!err) {\n err = new ClientDestroyedError()\n }\n\n this[kDestroyed] = true\n this[kOnDestroyed] ??= []\n this[kOnDestroyed].push(callback)\n\n const onDestroyed = () => {\n const callbacks = this[kOnDestroyed]\n this[kOnDestroyed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kDestroy](err)\n .then(() => queueMicrotask(onDestroyed))\n }\n\n dispatch (opts, handler) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n handler = UnwrapHandler.unwrap(handler)\n\n try {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object.')\n }\n\n if (this[kDestroyed] || this[kOnDestroyed]) {\n throw new ClientDestroyedError()\n }\n\n if (this[kClosed]) {\n throw new ClientClosedError()\n }\n\n return this[kDispatch](opts, handler)\n } catch (err) {\n if (typeof handler.onError !== 'function') {\n throw err\n }\n\n handler.onError(err)\n\n return false\n }\n }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError } = require('./errors')\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nconst SessionCache = class WeakSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n this._sessionRegistry = new FinalizationRegistry((key) => {\n if (this._sessionCache.size < this._maxCachedSessions) {\n return\n }\n\n const ref = this._sessionCache.get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this._sessionCache.delete(key)\n }\n })\n }\n\n get (sessionKey) {\n const ref = this._sessionCache.get(sessionKey)\n return ref ? ref.deref() : null\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n if (this._sessionCache.has(sessionKey)) {\n this._sessionCache.delete(sessionKey)\n } else if (this._sessionCache.size >= this._maxCachedSessions) {\n for (const [key, ref] of this._sessionCache) {\n if (ref.deref() === undefined) {\n this._sessionCache.delete(key)\n return\n }\n }\n\n const oldest = this._sessionCache.keys().next()\n if (!oldest.done) {\n this._sessionCache.delete(oldest.value)\n }\n }\n\n this._sessionCache.set(sessionKey, new WeakRef(session))\n this._sessionRegistry.register(session, sessionKey)\n }\n}\n\nfunction buildConnector ({ allowH2, useH2c, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n }\n\n const options = { path: socketPath, ...opts }\n const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n timeout = timeout == null ? 10e3 : timeout\n allowH2 = allowH2 != null ? allowH2 : false\n return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n let socket\n if (protocol === 'https:') {\n if (!tls) {\n tls = require('node:tls')\n }\n servername = servername || options.servername || util.getServerName(host) || null\n\n const sessionKey = servername || hostname\n assert(sessionKey)\n\n const session = customSession || sessionCache.get(sessionKey) || null\n\n port = port || 443\n\n socket = tls.connect({\n highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n ...options,\n servername,\n session,\n localAddress,\n ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n socket: httpSocket, // upgrade socket connection\n port,\n host: hostname\n })\n\n socket\n .on('session', function (session) {\n // TODO (fix): Can a session become invalid once established? Don't think so?\n sessionCache.set(sessionKey, session)\n })\n } else {\n assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n port = port || 80\n\n socket = net.connect({\n highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n ...options,\n localAddress,\n port,\n host: hostname\n })\n if (useH2c === true) {\n socket.alpnProtocol = 'h2'\n }\n }\n\n // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n if (options.keepAlive == null || options.keepAlive) {\n const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n socket.setKeepAlive(true, keepAliveInitialDelay)\n }\n\n const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n socket\n .setNoDelay(true)\n .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n queueMicrotask(clearConnectTimeout)\n\n if (callback) {\n const cb = callback\n callback = null\n cb(null, this)\n }\n })\n .on('error', function (err) {\n queueMicrotask(clearConnectTimeout)\n\n if (callback) {\n const cb = callback\n callback = null\n cb(err)\n }\n })\n\n return socket\n }\n}\n\nmodule.exports = buildConnector\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = enumToMap;\nfunction enumToMap(obj, filter = [], exceptions = []) {\n const emptyFilter = (filter?.length ?? 0) === 0;\n const emptyExceptions = (exceptions?.length ?? 0) === 0;\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => {\n return (typeof value === 'number' &&\n (emptyFilter || filter.includes(value)) &&\n (emptyExceptions || !exceptions.includes(value)));\n }));\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.MINOR = exports.MAJOR = exports.HTAB_SP_VCHAR_OBS_TEXT = exports.QUOTED_STRING = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.HEX = exports.URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.STATUSES_HTTP = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.HEADER_STATE = exports.FINISH = exports.STATUSES = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// Emums\nexports.ERROR = {\n OK: 0,\n INTERNAL: 1,\n STRICT: 2,\n CR_EXPECTED: 25,\n LF_EXPECTED: 3,\n UNEXPECTED_CONTENT_LENGTH: 4,\n UNEXPECTED_SPACE: 30,\n CLOSED_CONNECTION: 5,\n INVALID_METHOD: 6,\n INVALID_URL: 7,\n INVALID_CONSTANT: 8,\n INVALID_VERSION: 9,\n INVALID_HEADER_TOKEN: 10,\n INVALID_CONTENT_LENGTH: 11,\n INVALID_CHUNK_SIZE: 12,\n INVALID_STATUS: 13,\n INVALID_EOF_STATE: 14,\n INVALID_TRANSFER_ENCODING: 15,\n CB_MESSAGE_BEGIN: 16,\n CB_HEADERS_COMPLETE: 17,\n CB_MESSAGE_COMPLETE: 18,\n CB_CHUNK_HEADER: 19,\n CB_CHUNK_COMPLETE: 20,\n PAUSED: 21,\n PAUSED_UPGRADE: 22,\n PAUSED_H2_UPGRADE: 23,\n USER: 24,\n CB_URL_COMPLETE: 26,\n CB_STATUS_COMPLETE: 27,\n CB_METHOD_COMPLETE: 32,\n CB_VERSION_COMPLETE: 33,\n CB_HEADER_FIELD_COMPLETE: 28,\n CB_HEADER_VALUE_COMPLETE: 29,\n CB_CHUNK_EXTENSION_NAME_COMPLETE: 34,\n CB_CHUNK_EXTENSION_VALUE_COMPLETE: 35,\n CB_RESET: 31,\n CB_PROTOCOL_COMPLETE: 38,\n};\nexports.TYPE = {\n BOTH: 0, // default\n REQUEST: 1,\n RESPONSE: 2,\n};\nexports.FLAGS = {\n CONNECTION_KEEP_ALIVE: 1 << 0,\n CONNECTION_CLOSE: 1 << 1,\n CONNECTION_UPGRADE: 1 << 2,\n CHUNKED: 1 << 3,\n UPGRADE: 1 << 4,\n CONTENT_LENGTH: 1 << 5,\n SKIPBODY: 1 << 6,\n TRAILING: 1 << 7,\n // 1 << 8 is unused\n TRANSFER_ENCODING: 1 << 9,\n};\nexports.LENIENT_FLAGS = {\n HEADERS: 1 << 0,\n CHUNKED_LENGTH: 1 << 1,\n KEEP_ALIVE: 1 << 2,\n TRANSFER_ENCODING: 1 << 3,\n VERSION: 1 << 4,\n DATA_AFTER_CLOSE: 1 << 5,\n OPTIONAL_LF_AFTER_CR: 1 << 6,\n OPTIONAL_CRLF_AFTER_CHUNK: 1 << 7,\n OPTIONAL_CR_BEFORE_LF: 1 << 8,\n SPACES_AFTER_CHUNK_SIZE: 1 << 9,\n};\nexports.METHODS = {\n 'DELETE': 0,\n 'GET': 1,\n 'HEAD': 2,\n 'POST': 3,\n 'PUT': 4,\n /* pathological */\n 'CONNECT': 5,\n 'OPTIONS': 6,\n 'TRACE': 7,\n /* WebDAV */\n 'COPY': 8,\n 'LOCK': 9,\n 'MKCOL': 10,\n 'MOVE': 11,\n 'PROPFIND': 12,\n 'PROPPATCH': 13,\n 'SEARCH': 14,\n 'UNLOCK': 15,\n 'BIND': 16,\n 'REBIND': 17,\n 'UNBIND': 18,\n 'ACL': 19,\n /* subversion */\n 'REPORT': 20,\n 'MKACTIVITY': 21,\n 'CHECKOUT': 22,\n 'MERGE': 23,\n /* upnp */\n 'M-SEARCH': 24,\n 'NOTIFY': 25,\n 'SUBSCRIBE': 26,\n 'UNSUBSCRIBE': 27,\n /* RFC-5789 */\n 'PATCH': 28,\n 'PURGE': 29,\n /* CalDAV */\n 'MKCALENDAR': 30,\n /* RFC-2068, section 19.6.1.2 */\n 'LINK': 31,\n 'UNLINK': 32,\n /* icecast */\n 'SOURCE': 33,\n /* RFC-7540, section 11.6 */\n 'PRI': 34,\n /* RFC-2326 RTSP */\n 'DESCRIBE': 35,\n 'ANNOUNCE': 36,\n 'SETUP': 37,\n 'PLAY': 38,\n 'PAUSE': 39,\n 'TEARDOWN': 40,\n 'GET_PARAMETER': 41,\n 'SET_PARAMETER': 42,\n 'REDIRECT': 43,\n 'RECORD': 44,\n /* RAOP */\n 'FLUSH': 45,\n /* DRAFT https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-02.html */\n 'QUERY': 46,\n};\nexports.STATUSES = {\n CONTINUE: 100,\n SWITCHING_PROTOCOLS: 101,\n PROCESSING: 102,\n EARLY_HINTS: 103,\n RESPONSE_IS_STALE: 110, // Unofficial\n REVALIDATION_FAILED: 111, // Unofficial\n DISCONNECTED_OPERATION: 112, // Unofficial\n HEURISTIC_EXPIRATION: 113, // Unofficial\n MISCELLANEOUS_WARNING: 199, // Unofficial\n OK: 200,\n CREATED: 201,\n ACCEPTED: 202,\n NON_AUTHORITATIVE_INFORMATION: 203,\n NO_CONTENT: 204,\n RESET_CONTENT: 205,\n PARTIAL_CONTENT: 206,\n MULTI_STATUS: 207,\n ALREADY_REPORTED: 208,\n TRANSFORMATION_APPLIED: 214, // Unofficial\n IM_USED: 226,\n MISCELLANEOUS_PERSISTENT_WARNING: 299, // Unofficial\n MULTIPLE_CHOICES: 300,\n MOVED_PERMANENTLY: 301,\n FOUND: 302,\n SEE_OTHER: 303,\n NOT_MODIFIED: 304,\n USE_PROXY: 305,\n SWITCH_PROXY: 306, // No longer used\n TEMPORARY_REDIRECT: 307,\n PERMANENT_REDIRECT: 308,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n PAYMENT_REQUIRED: 402,\n FORBIDDEN: 403,\n NOT_FOUND: 404,\n METHOD_NOT_ALLOWED: 405,\n NOT_ACCEPTABLE: 406,\n PROXY_AUTHENTICATION_REQUIRED: 407,\n REQUEST_TIMEOUT: 408,\n CONFLICT: 409,\n GONE: 410,\n LENGTH_REQUIRED: 411,\n PRECONDITION_FAILED: 412,\n PAYLOAD_TOO_LARGE: 413,\n URI_TOO_LONG: 414,\n UNSUPPORTED_MEDIA_TYPE: 415,\n RANGE_NOT_SATISFIABLE: 416,\n EXPECTATION_FAILED: 417,\n IM_A_TEAPOT: 418,\n PAGE_EXPIRED: 419, // Unofficial\n ENHANCE_YOUR_CALM: 420, // Unofficial\n MISDIRECTED_REQUEST: 421,\n UNPROCESSABLE_ENTITY: 422,\n LOCKED: 423,\n FAILED_DEPENDENCY: 424,\n TOO_EARLY: 425,\n UPGRADE_REQUIRED: 426,\n PRECONDITION_REQUIRED: 428,\n TOO_MANY_REQUESTS: 429,\n REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL: 430, // Unofficial\n REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n LOGIN_TIMEOUT: 440, // Unofficial\n NO_RESPONSE: 444, // Unofficial\n RETRY_WITH: 449, // Unofficial\n BLOCKED_BY_PARENTAL_CONTROL: 450, // Unofficial\n UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n CLIENT_CLOSED_LOAD_BALANCED_REQUEST: 460, // Unofficial\n INVALID_X_FORWARDED_FOR: 463, // Unofficial\n REQUEST_HEADER_TOO_LARGE: 494, // Unofficial\n SSL_CERTIFICATE_ERROR: 495, // Unofficial\n SSL_CERTIFICATE_REQUIRED: 496, // Unofficial\n HTTP_REQUEST_SENT_TO_HTTPS_PORT: 497, // Unofficial\n INVALID_TOKEN: 498, // Unofficial\n CLIENT_CLOSED_REQUEST: 499, // Unofficial\n INTERNAL_SERVER_ERROR: 500,\n NOT_IMPLEMENTED: 501,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n HTTP_VERSION_NOT_SUPPORTED: 505,\n VARIANT_ALSO_NEGOTIATES: 506,\n INSUFFICIENT_STORAGE: 507,\n LOOP_DETECTED: 508,\n BANDWIDTH_LIMIT_EXCEEDED: 509,\n NOT_EXTENDED: 510,\n NETWORK_AUTHENTICATION_REQUIRED: 511,\n WEB_SERVER_UNKNOWN_ERROR: 520, // Unofficial\n WEB_SERVER_IS_DOWN: 521, // Unofficial\n CONNECTION_TIMEOUT: 522, // Unofficial\n ORIGIN_IS_UNREACHABLE: 523, // Unofficial\n TIMEOUT_OCCURED: 524, // Unofficial\n SSL_HANDSHAKE_FAILED: 525, // Unofficial\n INVALID_SSL_CERTIFICATE: 526, // Unofficial\n RAILGUN_ERROR: 527, // Unofficial\n SITE_IS_OVERLOADED: 529, // Unofficial\n SITE_IS_FROZEN: 530, // Unofficial\n IDENTITY_PROVIDER_AUTHENTICATION_ERROR: 561, // Unofficial\n NETWORK_READ_TIMEOUT: 598, // Unofficial\n NETWORK_CONNECT_TIMEOUT: 599, // Unofficial\n};\nexports.FINISH = {\n SAFE: 0,\n SAFE_WITH_CB: 1,\n UNSAFE: 2,\n};\nexports.HEADER_STATE = {\n GENERAL: 0,\n CONNECTION: 1,\n CONTENT_LENGTH: 2,\n TRANSFER_ENCODING: 3,\n UPGRADE: 4,\n CONNECTION_KEEP_ALIVE: 5,\n CONNECTION_CLOSE: 6,\n CONNECTION_UPGRADE: 7,\n TRANSFER_ENCODING_CHUNKED: 8,\n};\n// C headers\nexports.METHODS_HTTP = [\n exports.METHODS.DELETE,\n exports.METHODS.GET,\n exports.METHODS.HEAD,\n exports.METHODS.POST,\n exports.METHODS.PUT,\n exports.METHODS.CONNECT,\n exports.METHODS.OPTIONS,\n exports.METHODS.TRACE,\n exports.METHODS.COPY,\n exports.METHODS.LOCK,\n exports.METHODS.MKCOL,\n exports.METHODS.MOVE,\n exports.METHODS.PROPFIND,\n exports.METHODS.PROPPATCH,\n exports.METHODS.SEARCH,\n exports.METHODS.UNLOCK,\n exports.METHODS.BIND,\n exports.METHODS.REBIND,\n exports.METHODS.UNBIND,\n exports.METHODS.ACL,\n exports.METHODS.REPORT,\n exports.METHODS.MKACTIVITY,\n exports.METHODS.CHECKOUT,\n exports.METHODS.MERGE,\n exports.METHODS['M-SEARCH'],\n exports.METHODS.NOTIFY,\n exports.METHODS.SUBSCRIBE,\n exports.METHODS.UNSUBSCRIBE,\n exports.METHODS.PATCH,\n exports.METHODS.PURGE,\n exports.METHODS.MKCALENDAR,\n exports.METHODS.LINK,\n exports.METHODS.UNLINK,\n exports.METHODS.PRI,\n // TODO(indutny): should we allow it with HTTP?\n exports.METHODS.SOURCE,\n exports.METHODS.QUERY,\n];\nexports.METHODS_ICE = [\n exports.METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n exports.METHODS.OPTIONS,\n exports.METHODS.DESCRIBE,\n exports.METHODS.ANNOUNCE,\n exports.METHODS.SETUP,\n exports.METHODS.PLAY,\n exports.METHODS.PAUSE,\n exports.METHODS.TEARDOWN,\n exports.METHODS.GET_PARAMETER,\n exports.METHODS.SET_PARAMETER,\n exports.METHODS.REDIRECT,\n exports.METHODS.RECORD,\n exports.METHODS.FLUSH,\n // For AirPlay\n exports.METHODS.GET,\n exports.METHODS.POST,\n];\nexports.METHOD_MAP = (0, utils_1.enumToMap)(exports.METHODS);\nexports.H_METHOD_MAP = Object.fromEntries(Object.entries(exports.METHODS).filter(([k]) => k.startsWith('H')));\nexports.STATUSES_HTTP = [\n exports.STATUSES.CONTINUE,\n exports.STATUSES.SWITCHING_PROTOCOLS,\n exports.STATUSES.PROCESSING,\n exports.STATUSES.EARLY_HINTS,\n exports.STATUSES.RESPONSE_IS_STALE,\n exports.STATUSES.REVALIDATION_FAILED,\n exports.STATUSES.DISCONNECTED_OPERATION,\n exports.STATUSES.HEURISTIC_EXPIRATION,\n exports.STATUSES.MISCELLANEOUS_WARNING,\n exports.STATUSES.OK,\n exports.STATUSES.CREATED,\n exports.STATUSES.ACCEPTED,\n exports.STATUSES.NON_AUTHORITATIVE_INFORMATION,\n exports.STATUSES.NO_CONTENT,\n exports.STATUSES.RESET_CONTENT,\n exports.STATUSES.PARTIAL_CONTENT,\n exports.STATUSES.MULTI_STATUS,\n exports.STATUSES.ALREADY_REPORTED,\n exports.STATUSES.TRANSFORMATION_APPLIED,\n exports.STATUSES.IM_USED,\n exports.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,\n exports.STATUSES.MULTIPLE_CHOICES,\n exports.STATUSES.MOVED_PERMANENTLY,\n exports.STATUSES.FOUND,\n exports.STATUSES.SEE_OTHER,\n exports.STATUSES.NOT_MODIFIED,\n exports.STATUSES.USE_PROXY,\n exports.STATUSES.SWITCH_PROXY,\n exports.STATUSES.TEMPORARY_REDIRECT,\n exports.STATUSES.PERMANENT_REDIRECT,\n exports.STATUSES.BAD_REQUEST,\n exports.STATUSES.UNAUTHORIZED,\n exports.STATUSES.PAYMENT_REQUIRED,\n exports.STATUSES.FORBIDDEN,\n exports.STATUSES.NOT_FOUND,\n exports.STATUSES.METHOD_NOT_ALLOWED,\n exports.STATUSES.NOT_ACCEPTABLE,\n exports.STATUSES.PROXY_AUTHENTICATION_REQUIRED,\n exports.STATUSES.REQUEST_TIMEOUT,\n exports.STATUSES.CONFLICT,\n exports.STATUSES.GONE,\n exports.STATUSES.LENGTH_REQUIRED,\n exports.STATUSES.PRECONDITION_FAILED,\n exports.STATUSES.PAYLOAD_TOO_LARGE,\n exports.STATUSES.URI_TOO_LONG,\n exports.STATUSES.UNSUPPORTED_MEDIA_TYPE,\n exports.STATUSES.RANGE_NOT_SATISFIABLE,\n exports.STATUSES.EXPECTATION_FAILED,\n exports.STATUSES.IM_A_TEAPOT,\n exports.STATUSES.PAGE_EXPIRED,\n exports.STATUSES.ENHANCE_YOUR_CALM,\n exports.STATUSES.MISDIRECTED_REQUEST,\n exports.STATUSES.UNPROCESSABLE_ENTITY,\n exports.STATUSES.LOCKED,\n exports.STATUSES.FAILED_DEPENDENCY,\n exports.STATUSES.TOO_EARLY,\n exports.STATUSES.UPGRADE_REQUIRED,\n exports.STATUSES.PRECONDITION_REQUIRED,\n exports.STATUSES.TOO_MANY_REQUESTS,\n exports.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,\n exports.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,\n exports.STATUSES.LOGIN_TIMEOUT,\n exports.STATUSES.NO_RESPONSE,\n exports.STATUSES.RETRY_WITH,\n exports.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,\n exports.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,\n exports.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,\n exports.STATUSES.INVALID_X_FORWARDED_FOR,\n exports.STATUSES.REQUEST_HEADER_TOO_LARGE,\n exports.STATUSES.SSL_CERTIFICATE_ERROR,\n exports.STATUSES.SSL_CERTIFICATE_REQUIRED,\n exports.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,\n exports.STATUSES.INVALID_TOKEN,\n exports.STATUSES.CLIENT_CLOSED_REQUEST,\n exports.STATUSES.INTERNAL_SERVER_ERROR,\n exports.STATUSES.NOT_IMPLEMENTED,\n exports.STATUSES.BAD_GATEWAY,\n exports.STATUSES.SERVICE_UNAVAILABLE,\n exports.STATUSES.GATEWAY_TIMEOUT,\n exports.STATUSES.HTTP_VERSION_NOT_SUPPORTED,\n exports.STATUSES.VARIANT_ALSO_NEGOTIATES,\n exports.STATUSES.INSUFFICIENT_STORAGE,\n exports.STATUSES.LOOP_DETECTED,\n exports.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,\n exports.STATUSES.NOT_EXTENDED,\n exports.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,\n exports.STATUSES.WEB_SERVER_UNKNOWN_ERROR,\n exports.STATUSES.WEB_SERVER_IS_DOWN,\n exports.STATUSES.CONNECTION_TIMEOUT,\n exports.STATUSES.ORIGIN_IS_UNREACHABLE,\n exports.STATUSES.TIMEOUT_OCCURED,\n exports.STATUSES.SSL_HANDSHAKE_FAILED,\n exports.STATUSES.INVALID_SSL_CERTIFICATE,\n exports.STATUSES.RAILGUN_ERROR,\n exports.STATUSES.SITE_IS_OVERLOADED,\n exports.STATUSES.SITE_IS_FROZEN,\n exports.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,\n exports.STATUSES.NETWORK_READ_TIMEOUT,\n exports.STATUSES.NETWORK_CONNECT_TIMEOUT,\n];\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n // Upper case\n exports.ALPHA.push(String.fromCharCode(i));\n // Lower case\n exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n .concat(exports.MARK)\n .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.URL_CHAR = [\n '!', '\"', '$', '%', '&', '\\'',\n '(', ')', '*', '+', ',', '-', '.', '/',\n ':', ';', '<', '=', '>',\n '@', '[', '\\\\', ']', '^', '_',\n '`',\n '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n * token = 1*<any CHAR except CTLs or separators>\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n */\nexports.TOKEN = [\n '!', '#', '$', '%', '&', '\\'',\n '*', '+', '-', '.',\n '^', '_', '`',\n '|', '~',\n].concat(exports.ALPHANUM);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n if (i !== 127) {\n exports.HEADER_CHARS.push(i);\n }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.QUOTED_STRING = ['\\t', ' '];\nfor (let i = 0x21; i <= 0xff; i++) {\n if (i !== 0x22 && i !== 0x5c) { // All characters in ASCII except \\ and \"\n exports.QUOTED_STRING.push(i);\n }\n}\nexports.HTAB_SP_VCHAR_OBS_TEXT = ['\\t', ' '];\n// VCHAR: https://tools.ietf.org/html/rfc5234#appendix-B.1\nfor (let i = 0x21; i <= 0x7E; i++) {\n exports.HTAB_SP_VCHAR_OBS_TEXT.push(i);\n}\n// OBS_TEXT: https://datatracker.ietf.org/doc/html/rfc9110#name-collected-abnf\nfor (let i = 0x80; i <= 0xff; i++) {\n exports.HTAB_SP_VCHAR_OBS_TEXT.push(i);\n}\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nexports.SPECIAL_HEADERS = {\n 'connection': exports.HEADER_STATE.CONNECTION,\n 'content-length': exports.HEADER_STATE.CONTENT_LENGTH,\n 'proxy-connection': exports.HEADER_STATE.CONNECTION,\n 'transfer-encoding': exports.HEADER_STATE.TRANSFER_ENCODING,\n 'upgrade': exports.HEADER_STATE.UPGRADE,\n};\nexports.default = {\n ERROR: exports.ERROR,\n TYPE: exports.TYPE,\n FLAGS: exports.FLAGS,\n LENIENT_FLAGS: exports.LENIENT_FLAGS,\n METHODS: exports.METHODS,\n STATUSES: exports.STATUSES,\n FINISH: exports.FINISH,\n HEADER_STATE: exports.HEADER_STATE,\n ALPHA: exports.ALPHA,\n NUM_MAP: exports.NUM_MAP,\n HEX_MAP: exports.HEX_MAP,\n NUM: exports.NUM,\n ALPHANUM: exports.ALPHANUM,\n MARK: exports.MARK,\n USERINFO_CHARS: exports.USERINFO_CHARS,\n URL_CHAR: exports.URL_CHAR,\n HEX: exports.HEX,\n TOKEN: exports.TOKEN,\n HEADER_CHARS: exports.HEADER_CHARS,\n CONNECTION_TOKEN_CHARS: exports.CONNECTION_TOKEN_CHARS,\n QUOTED_STRING: exports.QUOTED_STRING,\n HTAB_SP_VCHAR_OBS_TEXT: exports.HTAB_SP_VCHAR_OBS_TEXT,\n MAJOR: exports.MAJOR,\n MINOR: exports.MINOR,\n SPECIAL_HEADERS: exports.SPECIAL_HEADERS,\n METHODS_HTTP: exports.METHODS_HTTP,\n METHODS_ICE: exports.METHODS_ICE,\n METHODS_RTSP: exports.METHODS_RTSP,\n METHOD_MAP: exports.METHOD_MAP,\n H_METHOD_MAP: exports.H_METHOD_MAP,\n STATUSES_HTTP: exports.STATUSES_HTTP,\n};\n","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nconst wasmBase64 = 'AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2R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cEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlA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kACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6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iEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIA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A0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4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ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB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BAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQ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ADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBK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BCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQ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w0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANg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wMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw=='\n\nlet wasmBuffer\n\nObject.defineProperty(module, 'exports', {\n get: () => {\n return wasmBuffer\n ? wasmBuffer\n : (wasmBuffer = Buffer.from(wasmBase64, 'base64'))\n }\n})\n","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nconst wasmBase64 = 'AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJ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F0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJ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BDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIAN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QsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBg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NjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqI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gAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEB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EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQ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UAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw=='\n\nlet wasmBuffer\n\nObject.defineProperty(module, 'exports', {\n get: () => {\n return wasmBuffer\n ? wasmBuffer\n : (wasmBuffer = Buffer.from(wasmBase64, 'base64'))\n }\n})\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header\n */\nconst referrerPolicyTokens = /** @type {const} */ ([\n 'no-referrer',\n 'no-referrer-when-downgrade',\n 'same-origin',\n 'origin',\n 'strict-origin',\n 'origin-when-cross-origin',\n 'strict-origin-when-cross-origin',\n 'unsafe-url'\n])\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n '',\n ...referrerPolicyTokens\n])\nconst referrerPolicyTokensSet = new Set(referrerPolicyTokens)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n 'default',\n 'no-store',\n 'reload',\n 'no-cache',\n 'force-cache',\n 'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-type',\n // See https://github.com/nodejs/undici/issues/2021\n // 'Content-Length' is a forbidden header name, which is typically\n // removed in the Headers implementation. However, undici doesn't\n // filter out headers, so we add it here.\n 'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n 'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n 'audio',\n 'audioworklet',\n 'font',\n 'image',\n 'manifest',\n 'paintworklet',\n 'script',\n 'style',\n 'track',\n 'video',\n 'xslt',\n ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n subresource,\n forbiddenMethods,\n requestBodyHeader,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n redirectStatus,\n corsSafeListedMethods,\n nullBodyStatus,\n safeMethods,\n badPorts,\n requestDuplex,\n subresourceSet,\n badPortsSet,\n redirectStatusSet,\n corsSafeListedMethodsSet,\n safeMethodsSet,\n forbiddenMethodsSet,\n referrerPolicyTokens: referrerPolicyTokensSet\n}\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n if (newOrigin === undefined) {\n Object.defineProperty(globalThis, globalOrigin, {\n value: undefined,\n writable: true,\n enumerable: false,\n configurable: false\n })\n\n return\n }\n\n const parsedURL = new URL(newOrigin)\n\n if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n }\n\n Object.defineProperty(globalThis, globalOrigin, {\n value: parsedURL,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nmodule.exports = {\n getGlobalOrigin,\n setGlobalOrigin\n}\n","'use strict'\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Uint8Array} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n if (buffer.length === 0) {\n return ''\n }\n\n // 1. Let buffer be the result of peeking three bytes from\n // ioQueue, converted to a byte sequence.\n\n // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n // bytes from ioQueue. (Do nothing with those bytes.)\n if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n buffer = buffer.subarray(3)\n }\n\n // 3. Process a queue with an instance of UTF-8’s\n // decoder, ioQueue, output, and \"replacement\".\n const output = textDecoder.decode(buffer)\n\n // 4. Return output.\n return output\n}\n\nmodule.exports = {\n utf8DecodeBytes\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { utf8DecodeBytes } = require('../../encoding')\n\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n * @returns {string}\n *\n * @see https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n // 1. Let result be the empty string.\n let result = ''\n\n // 2. While position doesn’t point past the end of input and the\n // code point at position within input meets the condition condition:\n while (position.position < input.length && condition(input[position.position])) {\n // 1. Append that code point to the end of result.\n result += input[position.position]\n\n // 2. Advance position by 1.\n position.position++\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n * @returns {string}\n *\n * @see https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n const idx = input.indexOf(char, position.position)\n const start = position.position\n\n if (idx === -1) {\n position.position = input.length\n return input.slice(start)\n }\n\n position.position = idx\n return input.slice(start, position.position)\n}\n\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line no-control-regex\n\n/**\n * @param {string} data\n * @returns {Uint8Array | 'failure'}\n *\n * @see https://infra.spec.whatwg.org/#forgiving-base64-decode\n */\nfunction forgivingBase64 (data) {\n // 1. Remove all ASCII whitespace from data.\n data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '')\n\n let dataLength = data.length\n // 2. If data’s code point length divides by 4 leaving\n // no remainder, then:\n if (dataLength % 4 === 0) {\n // 1. If data ends with one or two U+003D (=) code points,\n // then remove them from data.\n if (data.charCodeAt(dataLength - 1) === 0x003D) {\n --dataLength\n if (data.charCodeAt(dataLength - 1) === 0x003D) {\n --dataLength\n }\n }\n }\n\n // 3. If data’s code point length divides by 4 leaving\n // a remainder of 1, then return failure.\n if (dataLength % 4 === 1) {\n return 'failure'\n }\n\n // 4. If data contains a code point that is not one of\n // U+002B (+)\n // U+002F (/)\n // ASCII alphanumeric\n // then return failure.\n if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n return 'failure'\n }\n\n const buffer = Buffer.from(data, 'base64')\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n/**\n * @param {number} char\n * @returns {boolean}\n *\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n */\nfunction isASCIIWhitespace (char) {\n return (\n char === 0x09 || // \\t\n char === 0x0a || // \\n\n char === 0x0c || // \\f\n char === 0x0d || // \\r\n char === 0x20 // space\n )\n}\n\n/**\n * @param {Uint8Array} input\n * @returns {string}\n *\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n */\nfunction isomorphicDecode (input) {\n // 1. To isomorphic decode a byte sequence input, return a string whose code point\n // length is equal to input’s length and whose code points have the same values\n // as the values of input’s bytes, in the same order.\n const length = input.length\n if ((2 << 15) - 1 > length) {\n return String.fromCharCode.apply(null, input)\n }\n let result = ''\n let i = 0\n let addition = (2 << 15) - 1\n while (i < length) {\n if (i + addition > length) {\n addition = length - i\n }\n result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n }\n return result\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line no-control-regex\n\n/**\n * @param {string} input\n * @returns {string}\n *\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n */\nfunction isomorphicEncode (input) {\n // 1. Assert: input contains no code points greater than U+00FF.\n assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n // 2. Return a byte sequence whose length is equal to input’s code\n // point length and whose bytes have the same values as the\n // values of input’s code points, in the same order\n return input\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n * @returns {string}\n *\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {string}\n */\nfunction removeChars (str, leading, trailing, predicate) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n }\n\n if (trailing) {\n while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n }\n\n return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n const result = JSON.stringify(value)\n\n // 2. If result is undefined, then throw a TypeError.\n if (result === undefined) {\n throw new TypeError('Value is not JSON serializable')\n }\n\n // 3. Assert: result is a string.\n assert(typeof result === 'string')\n\n // 4. Return result.\n return result\n}\n\nmodule.exports = {\n collectASequenceOfCodePoints,\n collectASequenceOfCodePointsFast,\n forgivingBase64,\n isASCIIWhitespace,\n isomorphicDecode,\n isomorphicEncode,\n parseJSONFromBytes,\n removeASCIIWhitespace,\n removeChars,\n serializeJavascriptValueToJSONString\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require('../infra')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/u // eslint-disable-line\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/u // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n // 1. Assert: dataURL’s scheme is \"data\".\n assert(dataURL.protocol === 'data:')\n\n // 2. Let input be the result of running the URL\n // serializer on dataURL with exclude fragment\n // set to true.\n let input = URLSerializer(dataURL, true)\n\n // 3. Remove the leading \"data:\" string from input.\n input = input.slice(5)\n\n // 4. Let position point at the start of input.\n const position = { position: 0 }\n\n // 5. Let mimeType be the result of collecting a\n // sequence of code points that are not equal\n // to U+002C (,), given position.\n let mimeType = collectASequenceOfCodePointsFast(\n ',',\n input,\n position\n )\n\n // 6. Strip leading and trailing ASCII whitespace\n // from mimeType.\n // Undici implementation note: we need to store the\n // length because if the mimetype has spaces removed,\n // the wrong amount will be sliced from the input in\n // step #9\n const mimeTypeLength = mimeType.length\n mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n // 7. If position is past the end of input, then\n // return failure\n if (position.position >= input.length) {\n return 'failure'\n }\n\n // 8. Advance position by 1.\n position.position++\n\n // 9. Let encodedBody be the remainder of input.\n const encodedBody = input.slice(mimeTypeLength + 1)\n\n // 10. Let body be the percent-decoding of encodedBody.\n let body = stringPercentDecode(encodedBody)\n\n // 11. If mimeType ends with U+003B (;), followed by\n // zero or more U+0020 SPACE, followed by an ASCII\n // case-insensitive match for \"base64\", then:\n if (/;(?:\\u0020*)base64$/ui.test(mimeType)) {\n // 1. Let stringBody be the isomorphic decode of body.\n const stringBody = isomorphicDecode(body)\n\n // 2. Set body to the forgiving-base64 decode of\n // stringBody.\n body = forgivingBase64(stringBody)\n\n // 3. If body is failure, then return failure.\n if (body === 'failure') {\n return 'failure'\n }\n\n // 4. Remove the last 6 code points from mimeType.\n mimeType = mimeType.slice(0, -6)\n\n // 5. Remove trailing U+0020 SPACE code points from mimeType,\n // if any.\n mimeType = mimeType.replace(/(\\u0020+)$/u, '')\n\n // 6. Remove the last U+003B (;) code point from mimeType.\n mimeType = mimeType.slice(0, -1)\n }\n\n // 12. If mimeType starts with U+003B (;), then prepend\n // \"text/plain\" to mimeType.\n if (mimeType.startsWith(';')) {\n mimeType = 'text/plain' + mimeType\n }\n\n // 13. Let mimeTypeRecord be the result of parsing\n // mimeType.\n let mimeTypeRecord = parseMIMEType(mimeType)\n\n // 14. If mimeTypeRecord is failure, then set\n // mimeTypeRecord to text/plain;charset=US-ASCII.\n if (mimeTypeRecord === 'failure') {\n mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n }\n\n // 15. Return a new data: URL struct whose MIME\n // type is mimeTypeRecord and body is body.\n // https://fetch.spec.whatwg.org/#data-url-struct\n return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n if (!excludeFragment) {\n return url.href\n }\n\n const href = url.href\n const hashLength = url.hash.length\n\n const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n if (!hashLength && href.endsWith('#')) {\n return serialized.slice(0, -1)\n }\n\n return serialized\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n // 1. Let bytes be the UTF-8 encoding of input.\n const bytes = encoder.encode(input)\n\n // 2. Return the percent-decoding of bytes.\n return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n // 0-9 A-F a-f\n return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n return (\n // 0-9\n byte >= 0x30 && byte <= 0x39\n ? (byte - 48)\n // Convert to uppercase\n // ((byte & 0xDF) - 65) + 10\n : ((byte & 0xDF) - 55)\n )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n const length = input.length\n // 1. Let output be an empty byte sequence.\n /** @type {Uint8Array} */\n const output = new Uint8Array(length)\n let j = 0\n let i = 0\n // 2. For each byte byte in input:\n while (i < length) {\n const byte = input[i]\n\n // 1. If byte is not 0x25 (%), then append byte to output.\n if (byte !== 0x25) {\n output[j++] = byte\n\n // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n // after byte in input are not in the ranges\n // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n // to output.\n } else if (\n byte === 0x25 &&\n !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n ) {\n output[j++] = 0x25\n\n // 3. Otherwise:\n } else {\n // 1. Let bytePoint be the two bytes after byte in input,\n // decoded, and then interpreted as hexadecimal number.\n // 2. Append a byte whose value is bytePoint to output.\n output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n // 3. Skip the next two bytes in input.\n i += 2\n }\n ++i\n }\n\n // 3. Return output.\n return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n // 1. Remove any leading and trailing HTTP whitespace\n // from input.\n input = removeHTTPWhitespace(input, true, true)\n\n // 2. Let position be a position variable for input,\n // initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let type be the result of collecting a sequence\n // of code points that are not U+002F (/) from\n // input, given position.\n const type = collectASequenceOfCodePointsFast(\n '/',\n input,\n position\n )\n\n // 4. If type is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n // https://mimesniff.spec.whatwg.org/#http-token-code-point\n if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n return 'failure'\n }\n\n // 5. If position is past the end of input, then return\n // failure\n if (position.position >= input.length) {\n return 'failure'\n }\n\n // 6. Advance position by 1. (This skips past U+002F (/).)\n position.position++\n\n // 7. Let subtype be the result of collecting a sequence of\n // code points that are not U+003B (;) from input, given\n // position.\n let subtype = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 8. Remove any trailing HTTP whitespace from subtype.\n subtype = removeHTTPWhitespace(subtype, false, true)\n\n // 9. If subtype is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n return 'failure'\n }\n\n const typeLowercase = type.toLowerCase()\n const subtypeLowercase = subtype.toLowerCase()\n\n // 10. Let mimeType be a new MIME type record whose type\n // is type, in ASCII lowercase, and subtype is subtype,\n // in ASCII lowercase.\n // https://mimesniff.spec.whatwg.org/#mime-type\n const mimeType = {\n type: typeLowercase,\n subtype: subtypeLowercase,\n /** @type {Map<string, string>} */\n parameters: new Map(),\n // https://mimesniff.spec.whatwg.org/#mime-type-essence\n essence: `${typeLowercase}/${subtypeLowercase}`\n }\n\n // 11. While position is not past the end of input:\n while (position.position < input.length) {\n // 1. Advance position by 1. (This skips past U+003B (;).)\n position.position++\n\n // 2. Collect a sequence of code points that are HTTP\n // whitespace from input given position.\n collectASequenceOfCodePoints(\n // https://fetch.spec.whatwg.org/#http-whitespace\n char => HTTP_WHITESPACE_REGEX.test(char),\n input,\n position\n )\n\n // 3. Let parameterName be the result of collecting a\n // sequence of code points that are not U+003B (;)\n // or U+003D (=) from input, given position.\n let parameterName = collectASequenceOfCodePoints(\n (char) => char !== ';' && char !== '=',\n input,\n position\n )\n\n // 4. Set parameterName to parameterName, in ASCII\n // lowercase.\n parameterName = parameterName.toLowerCase()\n\n // 5. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 1. If the code point at position within input is\n // U+003B (;), then continue.\n if (input[position.position] === ';') {\n continue\n }\n\n // 2. Advance position by 1. (This skips past U+003D (=).)\n position.position++\n }\n\n // 6. If position is past the end of input, then break.\n if (position.position >= input.length) {\n break\n }\n\n // 7. Let parameterValue be null.\n let parameterValue = null\n\n // 8. If the code point at position within input is\n // U+0022 (\"), then:\n if (input[position.position] === '\"') {\n // 1. Set parameterValue to the result of collecting\n // an HTTP quoted string from input, given position\n // and the extract-value flag.\n parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n // 2. Collect a sequence of code points that are not\n // U+003B (;) from input, given position.\n collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 9. Otherwise:\n } else {\n // 1. Set parameterValue to the result of collecting\n // a sequence of code points that are not U+003B (;)\n // from input, given position.\n parameterValue = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 2. Remove any trailing HTTP whitespace from parameterValue.\n parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n // 3. If parameterValue is the empty string, then continue.\n if (parameterValue.length === 0) {\n continue\n }\n }\n\n // 10. If all of the following are true\n // - parameterName is not the empty string\n // - parameterName solely contains HTTP token code points\n // - parameterValue solely contains HTTP quoted-string token code points\n // - mimeType’s parameters[parameterName] does not exist\n // then set mimeType’s parameters[parameterName] to parameterValue.\n if (\n parameterName.length !== 0 &&\n HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n !mimeType.parameters.has(parameterName)\n ) {\n mimeType.parameters.set(parameterName, parameterValue)\n }\n }\n\n // 12. Return mimeType.\n return mimeType\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean} [extractValue=false]\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue = false) {\n // 1. Let positionStart be position.\n const positionStart = position.position\n\n // 2. Let value be the empty string.\n let value = ''\n\n // 3. Assert: the code point at position within input\n // is U+0022 (\").\n assert(input[position.position] === '\"')\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. While true:\n while (true) {\n // 1. Append the result of collecting a sequence of code points\n // that are not U+0022 (\") or U+005C (\\) from input, given\n // position, to value.\n value += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== '\\\\',\n input,\n position\n )\n\n // 2. If position is past the end of input, then break.\n if (position.position >= input.length) {\n break\n }\n\n // 3. Let quoteOrBackslash be the code point at position within\n // input.\n const quoteOrBackslash = input[position.position]\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. If quoteOrBackslash is U+005C (\\), then:\n if (quoteOrBackslash === '\\\\') {\n // 1. If position is past the end of input, then append\n // U+005C (\\) to value and break.\n if (position.position >= input.length) {\n value += '\\\\'\n break\n }\n\n // 2. Append the code point at position within input to value.\n value += input[position.position]\n\n // 3. Advance position by 1.\n position.position++\n\n // 6. Otherwise:\n } else {\n // 1. Assert: quoteOrBackslash is U+0022 (\").\n assert(quoteOrBackslash === '\"')\n\n // 2. Break.\n break\n }\n }\n\n // 6. If the extract-value flag is set, then return value.\n if (extractValue) {\n return value\n }\n\n // 7. Return the code points from positionStart to position,\n // inclusive, within input.\n return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n assert(mimeType !== 'failure')\n const { parameters, essence } = mimeType\n\n // 1. Let serialization be the concatenation of mimeType’s\n // type, U+002F (/), and mimeType’s subtype.\n let serialization = essence\n\n // 2. For each name → value of mimeType’s parameters:\n for (let [name, value] of parameters.entries()) {\n // 1. Append U+003B (;) to serialization.\n serialization += ';'\n\n // 2. Append name to serialization.\n serialization += name\n\n // 3. Append U+003D (=) to serialization.\n serialization += '='\n\n // 4. If value does not solely contain HTTP token code\n // points or value is the empty string, then:\n if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n // 1. Precede each occurrence of U+0022 (\") or\n // U+005C (\\) in value with U+005C (\\).\n value = value.replace(/[\\\\\"]/ug, '\\\\$&')\n\n // 2. Prepend U+0022 (\") to value.\n value = '\"' + value\n\n // 3. Append U+0022 (\") to value.\n value += '\"'\n }\n\n // 5. Append value to serialization.\n serialization += value\n }\n\n // 3. Return serialization.\n return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n // \"\\r\\n\\t \"\n return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude<ReturnType<typeof parseMIMEType>, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n switch (mimeType.essence) {\n case 'application/ecmascript':\n case 'application/javascript':\n case 'application/x-ecmascript':\n case 'application/x-javascript':\n case 'text/ecmascript':\n case 'text/javascript':\n case 'text/javascript1.0':\n case 'text/javascript1.1':\n case 'text/javascript1.2':\n case 'text/javascript1.3':\n case 'text/javascript1.4':\n case 'text/javascript1.5':\n case 'text/jscript':\n case 'text/livescript':\n case 'text/x-ecmascript':\n case 'text/x-javascript':\n // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n return 'text/javascript'\n case 'application/json':\n case 'text/json':\n // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n return 'application/json'\n case 'image/svg+xml':\n // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n return 'image/svg+xml'\n case 'text/xml':\n case 'application/xml':\n // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n return 'application/xml'\n }\n\n // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n if (mimeType.subtype.endsWith('+json')) {\n return 'application/json'\n }\n\n // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n if (mimeType.subtype.endsWith('+xml')) {\n return 'application/xml'\n }\n\n // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n // Technically, node doesn't support any mimetypes.\n\n // 6. Return the empty string.\n return ''\n}\n\nmodule.exports = {\n dataURLProcessor,\n URLSerializer,\n stringPercentDecode,\n parseMIMEType,\n collectAnHTTPQuotedString,\n serializeAMimeType,\n removeHTTPWhitespace,\n minimizeSupportedMimeType,\n HTTP_TOKEN_CODEPOINTS\n}\n","'use strict'\n\n/** @typedef {`node:${string}`} NodeModuleName */\n\n/** @type {Record<NodeModuleName, () => any>} */\nconst lazyLoaders = {\n __proto__: null,\n 'node:crypto': () => require('node:crypto'),\n 'node:sqlite': () => require('node:sqlite'),\n 'node:worker_threads': () => require('node:worker_threads'),\n 'node:zlib': () => require('node:zlib')\n}\n\n/**\n * @param {NodeModuleName} moduleName\n * @returns {boolean}\n */\nfunction detectRuntimeFeatureByNodeModule (moduleName) {\n try {\n lazyLoaders[moduleName]()\n return true\n } catch (err) {\n if (err.code !== 'ERR_UNKNOWN_BUILTIN_MODULE' && err.code !== 'ERR_NO_CRYPTO') {\n throw err\n }\n return false\n }\n}\n\n/**\n * @param {NodeModuleName} moduleName\n * @param {string} property\n * @returns {boolean}\n */\nfunction detectRuntimeFeatureByExportedProperty (moduleName, property) {\n const module = lazyLoaders[moduleName]()\n return typeof module[property] !== 'undefined'\n}\n\nconst runtimeFeaturesByExportedProperty = /** @type {const} */ (['markAsUncloneable', 'zstd'])\n\n/** @type {Record<RuntimeFeatureByExportedProperty, [NodeModuleName, string]>} */\nconst exportedPropertyLookup = {\n markAsUncloneable: ['node:worker_threads', 'markAsUncloneable'],\n zstd: ['node:zlib', 'createZstdDecompress']\n}\n\n/** @typedef {typeof runtimeFeaturesByExportedProperty[number]} RuntimeFeatureByExportedProperty */\n\nconst runtimeFeaturesAsNodeModule = /** @type {const} */ (['crypto', 'sqlite'])\n/** @typedef {typeof runtimeFeaturesAsNodeModule[number]} RuntimeFeatureByNodeModule */\n\nconst features = /** @type {const} */ ([\n ...runtimeFeaturesAsNodeModule,\n ...runtimeFeaturesByExportedProperty\n])\n\n/** @typedef {typeof features[number]} Feature */\n\n/**\n * @param {Feature} feature\n * @returns {boolean}\n */\nfunction detectRuntimeFeature (feature) {\n if (runtimeFeaturesAsNodeModule.includes(/** @type {RuntimeFeatureByNodeModule} */ (feature))) {\n return detectRuntimeFeatureByNodeModule(`node:${feature}`)\n } else if (runtimeFeaturesByExportedProperty.includes(/** @type {RuntimeFeatureByExportedProperty} */ (feature))) {\n const [moduleName, property] = exportedPropertyLookup[feature]\n return detectRuntimeFeatureByExportedProperty(moduleName, property)\n }\n throw new TypeError(`unknown feature: ${feature}`)\n}\n\n/**\n * @class\n * @name RuntimeFeatures\n */\nclass RuntimeFeatures {\n /** @type {Map<Feature, boolean>} */\n #map = new Map()\n\n /**\n * Clears all cached feature detections.\n */\n clear () {\n this.#map.clear()\n }\n\n /**\n * @param {Feature} feature\n * @returns {boolean}\n */\n has (feature) {\n return (\n this.#map.get(feature) ?? this.#detectRuntimeFeature(feature)\n )\n }\n\n /**\n * @param {Feature} feature\n * @param {boolean} value\n */\n set (feature, value) {\n if (features.includes(feature) === false) {\n throw new TypeError(`unknown feature: ${feature}`)\n }\n this.#map.set(feature, value)\n }\n\n /**\n * @param {Feature} feature\n * @returns {boolean}\n */\n #detectRuntimeFeature (feature) {\n const result = detectRuntimeFeature(feature)\n this.#map.set(feature, result)\n return result\n }\n}\n\nconst instance = new RuntimeFeatures()\n\nmodule.exports.runtimeFeatures = instance\nmodule.exports.default = instance\n","'use strict'\n\nconst assert = require('node:assert')\nconst { types, inspect } = require('node:util')\nconst { runtimeFeatures } = require('../../util/runtime-features')\n\nconst UNDEFINED = 1\nconst BOOLEAN = 2\nconst STRING = 3\nconst SYMBOL = 4\nconst NUMBER = 5\nconst BIGINT = 6\nconst NULL = 7\nconst OBJECT = 8 // function and object\n\nconst FunctionPrototypeSymbolHasInstance = Function.call.bind(Function.prototype[Symbol.hasInstance])\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {\n converters: {},\n util: {},\n errors: {},\n is: {}\n}\n\n/**\n * @description Instantiate an error.\n *\n * @param {Object} opts\n * @param {string} opts.header\n * @param {string} opts.message\n * @returns {TypeError}\n */\nwebidl.errors.exception = function (message) {\n return new TypeError(`${message.header}: ${message.message}`)\n}\n\n/**\n * @description Instantiate an error when conversion from one type to another has failed.\n *\n * @param {Object} opts\n * @param {string} opts.prefix\n * @param {string} opts.argument\n * @param {string[]} opts.types\n * @returns {TypeError}\n */\nwebidl.errors.conversionFailed = function (opts) {\n const plural = opts.types.length === 1 ? '' : ' one of'\n const message =\n `${opts.argument} could not be converted to` +\n `${plural}: ${opts.types.join(', ')}.`\n\n return webidl.errors.exception({\n header: opts.prefix,\n message\n })\n}\n\n/**\n * @description Instantiate an error when an invalid argument is provided\n *\n * @param {Object} context\n * @param {string} context.prefix\n * @param {string} context.value\n * @param {string} context.type\n * @returns {TypeError}\n */\nwebidl.errors.invalidArgument = function (context) {\n return webidl.errors.exception({\n header: context.prefix,\n message: `\"${context.value}\" is an invalid ${context.type}.`\n })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I) {\n if (!FunctionPrototypeSymbolHasInstance(I, V)) {\n const err = new TypeError('Illegal invocation')\n err.code = 'ERR_INVALID_THIS' // node compat.\n throw err\n }\n}\n\nwebidl.brandCheckMultiple = function (List) {\n const prototypes = List.map((c) => webidl.util.MakeTypeAssertion(c))\n\n return (V) => {\n if (prototypes.every(typeCheck => !typeCheck(V))) {\n const err = new TypeError('Illegal invocation')\n err.code = 'ERR_INVALID_THIS' // node compat.\n throw err\n }\n }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n if (length < min) {\n throw webidl.errors.exception({\n message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n `but${length ? ' only' : ''} ${length} found.`,\n header: ctx\n })\n }\n}\n\nwebidl.illegalConstructor = function () {\n throw webidl.errors.exception({\n header: 'TypeError',\n message: 'Illegal constructor'\n })\n}\n\nwebidl.util.MakeTypeAssertion = function (I) {\n return (O) => FunctionPrototypeSymbolHasInstance(I, O)\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n switch (typeof V) {\n case 'undefined': return UNDEFINED\n case 'boolean': return BOOLEAN\n case 'string': return STRING\n case 'symbol': return SYMBOL\n case 'number': return NUMBER\n case 'bigint': return BIGINT\n case 'function':\n case 'object': {\n if (V === null) {\n return NULL\n }\n\n return OBJECT\n }\n }\n}\n\nwebidl.util.Types = {\n UNDEFINED,\n BOOLEAN,\n STRING,\n SYMBOL,\n NUMBER,\n BIGINT,\n NULL,\n OBJECT\n}\n\nwebidl.util.TypeValueToString = function (o) {\n switch (webidl.util.Type(o)) {\n case UNDEFINED: return 'Undefined'\n case BOOLEAN: return 'Boolean'\n case STRING: return 'String'\n case SYMBOL: return 'Symbol'\n case NUMBER: return 'Number'\n case BIGINT: return 'BigInt'\n case NULL: return 'Null'\n case OBJECT: return 'Object'\n }\n}\n\nwebidl.util.markAsUncloneable = runtimeFeatures.has('markAsUncloneable')\n ? require('node:worker_threads').markAsUncloneable\n : () => {}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, flags) {\n let upperBound\n let lowerBound\n\n // 1. If bitLength is 64, then:\n if (bitLength === 64) {\n // 1. Let upperBound be 2^53 − 1.\n upperBound = Math.pow(2, 53) - 1\n\n // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n if (signedness === 'unsigned') {\n lowerBound = 0\n } else {\n // 3. Otherwise let lowerBound be −2^53 + 1.\n lowerBound = Math.pow(-2, 53) + 1\n }\n } else if (signedness === 'unsigned') {\n // 2. Otherwise, if signedness is \"unsigned\", then:\n\n // 1. Let lowerBound be 0.\n lowerBound = 0\n\n // 2. Let upperBound be 2^bitLength − 1.\n upperBound = Math.pow(2, bitLength) - 1\n } else {\n // 3. Otherwise:\n\n // 1. Let lowerBound be -2^(bitLength − 1).\n lowerBound = -Math.pow(2, bitLength - 1)\n\n // 2. Let upperBound be 2^(bitLength − 1) − 1.\n upperBound = Math.pow(2, bitLength - 1) - 1\n }\n\n // 4. Let x be ? ToNumber(V).\n let x = Number(V)\n\n // 5. If x is −0, then set x to +0.\n if (x === 0) {\n x = 0\n }\n\n // 6. If the conversion is to an IDL type associated\n // with the [EnforceRange] extended attribute, then:\n if (webidl.util.HasFlag(flags, webidl.attributes.EnforceRange)) {\n // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n if (\n Number.isNaN(x) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n })\n }\n\n // 2. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 3. If x < lowerBound or x > upperBound, then\n // throw a TypeError.\n if (x < lowerBound || x > upperBound) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n })\n }\n\n // 4. Return x.\n return x\n }\n\n // 7. If x is not NaN and the conversion is to an IDL\n // type associated with the [Clamp] extended\n // attribute, then:\n if (!Number.isNaN(x) && webidl.util.HasFlag(flags, webidl.attributes.Clamp)) {\n // 1. Set x to min(max(x, lowerBound), upperBound).\n x = Math.min(Math.max(x, lowerBound), upperBound)\n\n // 2. Round x to the nearest integer, choosing the\n // even integer if it lies halfway between two,\n // and choosing +0 rather than −0.\n if (Math.floor(x) % 2 === 0) {\n x = Math.floor(x)\n } else {\n x = Math.ceil(x)\n }\n\n // 3. Return x.\n return x\n }\n\n // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n if (\n Number.isNaN(x) ||\n (x === 0 && Object.is(0, x)) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n return 0\n }\n\n // 9. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 10. Set x to x modulo 2^bitLength.\n x = x % Math.pow(2, bitLength)\n\n // 11. If signedness is \"signed\" and x ≥ 2^(bitLength − 1),\n // then return x − 2^bitLength.\n if (signedness === 'signed' && x >= Math.pow(2, bitLength - 1)) {\n return x - Math.pow(2, bitLength)\n }\n\n // 12. Otherwise, return x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n // 1. Let r be floor(abs(n)).\n const r = Math.floor(Math.abs(n))\n\n // 2. If n < 0, then return -1 × r.\n if (n < 0) {\n return -1 * r\n }\n\n // 3. Otherwise, return r.\n return r\n}\n\nwebidl.util.Stringify = function (V) {\n const type = webidl.util.Type(V)\n\n switch (type) {\n case SYMBOL:\n return `Symbol(${V.description})`\n case OBJECT:\n return inspect(V)\n case STRING:\n return `\"${V}\"`\n case BIGINT:\n return `${V}n`\n default:\n return `${V}`\n }\n}\n\nwebidl.util.IsResizableArrayBuffer = function (V) {\n if (types.isArrayBuffer(V)) {\n return V.resizable\n }\n\n if (types.isSharedArrayBuffer(V)) {\n return V.growable\n }\n\n throw webidl.errors.exception({\n header: 'IsResizableArrayBuffer',\n message: `\"${webidl.util.Stringify(V)}\" is not an array buffer.`\n })\n}\n\nwebidl.util.HasFlag = function (flags, attributes) {\n return typeof flags === 'number' && (flags & attributes) === attributes\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n return (V, prefix, argument, Iterable) => {\n // 1. If Type(V) is not Object, throw a TypeError.\n if (webidl.util.Type(V) !== OBJECT) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n })\n }\n\n // 2. Let method be ? GetMethod(V, @@iterator).\n /** @type {Generator} */\n const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n const seq = []\n let index = 0\n\n // 3. If method is undefined, throw a TypeError.\n if (\n method === undefined ||\n typeof method.next !== 'function'\n ) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is not iterable.`\n })\n }\n\n // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n while (true) {\n const { done, value } = method.next()\n\n if (done) {\n break\n }\n\n seq.push(converter(value, prefix, `${argument}[${index++}]`))\n }\n\n return seq\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n return (O, prefix, argument) => {\n // 1. If Type(O) is not Object, throw a TypeError.\n if (webidl.util.Type(O) !== OBJECT) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} (\"${webidl.util.TypeValueToString(O)}\") is not an Object.`\n })\n }\n\n // 2. Let result be a new empty instance of record<K, V>.\n const result = {}\n\n if (!types.isProxy(O)) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n for (const key of keys) {\n const keyName = webidl.util.Stringify(key)\n\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key, prefix, `Key ${keyName} in ${argument}`)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key], prefix, `${argument}[${keyName}]`)\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n\n // 5. Return result.\n return result\n }\n\n // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n const keys = Reflect.ownKeys(O)\n\n // 4. For each key of keys.\n for (const key of keys) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n if (desc?.enumerable) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key, prefix, argument)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key], prefix, argument)\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n }\n\n // 5. Return result.\n return result\n }\n}\n\nwebidl.interfaceConverter = function (TypeCheck, name) {\n return (V, prefix, argument) => {\n if (!TypeCheck(V)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${name}.`\n })\n }\n\n return V\n }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n // \"For each dictionary member member declared on dictionary, in lexicographical order:\"\n converters.sort((a, b) => (a.key > b.key) - (a.key < b.key))\n\n return (dictionary, prefix, argument) => {\n const dict = {}\n\n if (dictionary != null && webidl.util.Type(dictionary) !== OBJECT) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n })\n }\n\n for (const options of converters) {\n const { key, defaultValue, required, converter } = options\n\n if (required === true) {\n if (dictionary == null || !Object.hasOwn(dictionary, key)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Missing required key \"${key}\".`\n })\n }\n }\n\n let value = dictionary?.[key]\n const hasDefault = defaultValue !== undefined\n\n // Only use defaultValue if value is undefined and\n // a defaultValue options was provided.\n if (hasDefault && value === undefined) {\n value = defaultValue()\n }\n\n // A key can be optional and have no default value.\n // When this happens, do not perform a conversion,\n // and do not assign the key a value.\n if (required || hasDefault || value !== undefined) {\n value = converter(value, prefix, `${argument}.${key}`)\n\n if (\n options.allowedValues &&\n !options.allowedValues.includes(value)\n ) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n })\n }\n\n dict[key] = value\n }\n }\n\n return dict\n }\n}\n\nwebidl.nullableConverter = function (converter) {\n return (V, prefix, argument) => {\n if (V === null) {\n return V\n }\n\n return converter(V, prefix, argument)\n }\n}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nwebidl.is.USVString = function (value) {\n return (\n typeof value === 'string' &&\n value.isWellFormed()\n )\n}\n\nwebidl.is.ReadableStream = webidl.util.MakeTypeAssertion(ReadableStream)\nwebidl.is.Blob = webidl.util.MakeTypeAssertion(Blob)\nwebidl.is.URLSearchParams = webidl.util.MakeTypeAssertion(URLSearchParams)\nwebidl.is.File = webidl.util.MakeTypeAssertion(File)\nwebidl.is.URL = webidl.util.MakeTypeAssertion(URL)\nwebidl.is.AbortSignal = webidl.util.MakeTypeAssertion(AbortSignal)\nwebidl.is.MessagePort = webidl.util.MakeTypeAssertion(MessagePort)\n\nwebidl.is.BufferSource = function (V) {\n return types.isArrayBuffer(V) || (\n ArrayBuffer.isView(V) &&\n types.isArrayBuffer(V.buffer)\n )\n}\n\n// https://webidl.spec.whatwg.org/#dfn-get-buffer-source-copy\nwebidl.util.getCopyOfBytesHeldByBufferSource = function (bufferSource) {\n // 1. Let jsBufferSource be the result of converting bufferSource to a JavaScript value.\n const jsBufferSource = bufferSource\n\n // 2. Let jsArrayBuffer be jsBufferSource.\n let jsArrayBuffer = jsBufferSource\n\n // 3. Let offset be 0.\n let offset = 0\n\n // 4. Let length be 0.\n let length = 0\n\n // 5. If jsBufferSource has a [[ViewedArrayBuffer]] internal slot, then:\n if (types.isTypedArray(jsBufferSource) || types.isDataView(jsBufferSource)) {\n // 5.1. Set jsArrayBuffer to jsBufferSource.[[ViewedArrayBuffer]].\n jsArrayBuffer = jsBufferSource.buffer\n\n // 5.2. Set offset to jsBufferSource.[[ByteOffset]].\n offset = jsBufferSource.byteOffset\n\n // 5.3. Set length to jsBufferSource.[[ByteLength]].\n length = jsBufferSource.byteLength\n } else {\n // 6. Otherwise:\n\n // 6.1. Assert: jsBufferSource is an ArrayBuffer or SharedArrayBuffer object.\n assert(types.isAnyArrayBuffer(jsBufferSource))\n\n // 6.2. Set length to jsBufferSource.[[ArrayBufferByteLength]].\n length = jsBufferSource.byteLength\n }\n\n // 7. If IsDetachedBuffer(jsArrayBuffer) is true, then return the empty byte sequence.\n if (jsArrayBuffer.detached) {\n return new Uint8Array(0)\n }\n\n // 8. Let bytes be a new byte sequence of length equal to length.\n const bytes = new Uint8Array(length)\n\n // 9. For i in the range offset to offset + length − 1, inclusive,\n // set bytes[i − offset] to GetValueFromBuffer(jsArrayBuffer, i, Uint8, true, Unordered).\n const view = new Uint8Array(jsArrayBuffer, offset, length)\n bytes.set(view)\n\n // 10. Return bytes.\n return bytes\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, flags) {\n // 1. If V is null and the conversion is to an IDL type\n // associated with the [LegacyNullToEmptyString]\n // extended attribute, then return the DOMString value\n // that represents the empty string.\n if (V === null && webidl.util.HasFlag(flags, webidl.attributes.LegacyNullToEmptyString)) {\n return ''\n }\n\n // 2. Let x be ? ToString(V).\n if (typeof V === 'symbol') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n })\n }\n\n // 3. Return the IDL DOMString value that represents the\n // same sequence of code units as the one the\n // ECMAScript String value x represents.\n return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n // 1. Let x be ? ToString(V).\n if (typeof V === 'symbol') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is a symbol, which cannot be converted to a ByteString.`\n })\n }\n\n const x = String(V)\n\n // 2. If the value of any element of x is greater than\n // 255, then throw a TypeError.\n for (let index = 0; index < x.length; index++) {\n if (x.charCodeAt(index) > 255) {\n throw new TypeError(\n 'Cannot convert argument to a ByteString because the character at ' +\n `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n )\n }\n }\n\n // 3. Return an IDL ByteString value whose length is the\n // length of x, and where the value of each element is\n // the value of the corresponding element of x.\n return x\n}\n\n/**\n * @param {unknown} value\n * @returns {string}\n * @see https://webidl.spec.whatwg.org/#es-USVString\n */\nwebidl.converters.USVString = function (value) {\n // TODO: rewrite this so we can control the errors thrown\n if (typeof value === 'string') {\n return value.toWellFormed()\n }\n return `${value}`.toWellFormed()\n}\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n // 1. Let x be the result of computing ToBoolean(V).\n // https://262.ecma-international.org/10.0/index.html#table-10\n const x = Boolean(V)\n\n // 2. Return the IDL boolean value that is the one that represents\n // the same truth value as the ECMAScript Boolean value x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n const x = webidl.util.ConvertToInt(V, 64, 'signed', 0, prefix, argument)\n\n // 2. Return the IDL long long value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 64, 'unsigned', 0, prefix, argument)\n\n // 2. Return the IDL unsigned long long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 32, 'unsigned', 0, prefix, argument)\n\n // 2. Return the IDL unsigned long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, flags) {\n // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 16, 'unsigned', flags, prefix, argument)\n\n // 2. Return the IDL unsigned short value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, flags) {\n // 1. If V is not an Object, or V does not have an\n // [[ArrayBufferData]] internal slot, then throw a\n // TypeError.\n // 2. If IsSharedArrayBuffer(V) is true, then throw a\n // TypeError.\n // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n if (\n webidl.util.Type(V) !== OBJECT ||\n !types.isArrayBuffer(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['ArrayBuffer']\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V) is true, then throw a\n // TypeError.\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a resizable ArrayBuffer.`\n })\n }\n\n // 4. Return the IDL ArrayBuffer value that is a\n // reference to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#idl-SharedArrayBuffer\nwebidl.converters.SharedArrayBuffer = function (V, prefix, argument, flags) {\n // 1. If V is not an Object, or V does not have an\n // [[ArrayBufferData]] internal slot, then throw a\n // TypeError.\n // 2. If IsSharedArrayBuffer(V) is false, then throw a\n // TypeError.\n // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n if (\n webidl.util.Type(V) !== OBJECT ||\n !types.isSharedArrayBuffer(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['SharedArrayBuffer']\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V) is true, then throw a\n // TypeError.\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a resizable SharedArrayBuffer.`\n })\n }\n\n // 4. Return the IDL SharedArrayBuffer value that is a\n // reference to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#dfn-typed-array-type\nwebidl.converters.TypedArray = function (V, T, prefix, argument, flags) {\n // 1. Let T be the IDL type V is being converted to.\n\n // 2. If Type(V) is not Object, or V does not have a\n // [[TypedArrayName]] internal slot with a value\n // equal to T’s name, then throw a TypeError.\n if (\n webidl.util.Type(V) !== OBJECT ||\n !types.isTypedArray(V) ||\n V.constructor.name !== T.name\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: [T.name]\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a view on a shared array buffer.`\n })\n }\n\n // 4. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a view on a resizable array buffer.`\n })\n }\n\n // 5. Return the IDL value of type T that is a reference\n // to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#idl-DataView\nwebidl.converters.DataView = function (V, prefix, argument, flags) {\n // 1. If Type(V) is not Object, or V does not have a\n // [[DataView]] internal slot, then throw a TypeError.\n if (webidl.util.Type(V) !== OBJECT || !types.isDataView(V)) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['DataView']\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n // then throw a TypeError.\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a view on a shared array buffer.`\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a view on a resizable array buffer.`\n })\n }\n\n // 4. Return the IDL DataView value that is a reference\n // to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#ArrayBufferView\nwebidl.converters.ArrayBufferView = function (V, prefix, argument, flags) {\n if (\n webidl.util.Type(V) !== OBJECT ||\n !types.isArrayBufferView(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['ArrayBufferView']\n })\n }\n\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a view on a shared array buffer.`\n })\n }\n\n if (!webidl.util.HasFlag(flags, webidl.attributes.AllowResizable) && webidl.util.IsResizableArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a view on a resizable array buffer.`\n })\n }\n\n return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, argument, flags) {\n if (types.isArrayBuffer(V)) {\n return webidl.converters.ArrayBuffer(V, prefix, argument, flags)\n }\n\n if (types.isArrayBufferView(V)) {\n flags &= ~webidl.attributes.AllowShared\n\n return webidl.converters.ArrayBufferView(V, prefix, argument, flags)\n }\n\n // Make this explicit for easier debugging\n if (types.isSharedArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} cannot be a SharedArrayBuffer.`\n })\n }\n\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['ArrayBuffer', 'ArrayBufferView']\n })\n}\n\n// https://webidl.spec.whatwg.org/#AllowSharedBufferSource\nwebidl.converters.AllowSharedBufferSource = function (V, prefix, argument, flags) {\n if (types.isArrayBuffer(V)) {\n return webidl.converters.ArrayBuffer(V, prefix, argument, flags)\n }\n\n if (types.isSharedArrayBuffer(V)) {\n return webidl.converters.SharedArrayBuffer(V, prefix, argument, flags)\n }\n\n if (types.isArrayBufferView(V)) {\n flags |= webidl.attributes.AllowShared\n return webidl.converters.ArrayBufferView(V, prefix, argument, flags)\n }\n\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['ArrayBuffer', 'SharedArrayBuffer', 'ArrayBufferView']\n })\n}\n\nwebidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(\n webidl.converters.ByteString\n)\n\nwebidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(\n webidl.converters['sequence<ByteString>']\n)\n\nwebidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(\n webidl.converters.ByteString,\n webidl.converters.ByteString\n)\n\nwebidl.converters.Blob = webidl.interfaceConverter(webidl.is.Blob, 'Blob')\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n webidl.is.AbortSignal,\n 'AbortSignal'\n)\n\n/**\n * [LegacyTreatNonObjectAsNull]\n * callback EventHandlerNonNull = any (Event event);\n * typedef EventHandlerNonNull? EventHandler;\n * @param {*} V\n */\nwebidl.converters.EventHandlerNonNull = function (V) {\n if (webidl.util.Type(V) !== OBJECT) {\n return null\n }\n\n // [I]f the value is not an object, it will be converted to null, and if the value is not callable,\n // it will be converted to a callback function value that does nothing when called.\n if (typeof V === 'function') {\n return V\n }\n\n return () => {}\n}\n\nwebidl.attributes = {\n Clamp: 1 << 0,\n EnforceRange: 1 << 1,\n AllowShared: 1 << 2,\n AllowResizable: 1 << 3,\n LegacyNullToEmptyString: 1 << 4\n}\n\nmodule.exports = {\n webidl\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectAnHTTPQuotedString, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('../webidl')\nconst { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require('../infra')\n\nfunction responseURL (response) {\n // https://fetch.spec.whatwg.org/#responses\n // A response has an associated URL. It is a pointer to the last URL\n // in response’s URL list and null if response’s URL list is empty.\n const urlList = response.urlList\n const length = urlList.length\n return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n // 1. If response’s status is not a redirect status, then return null.\n if (!redirectStatusSet.has(response.status)) {\n return null\n }\n\n // 2. Let location be the result of extracting header list values given\n // `Location` and response’s header list.\n let location = response.headersList.get('location', true)\n\n // 3. If location is a header value, then set location to the result of\n // parsing location with response’s URL.\n if (location !== null && isValidHeaderValue(location)) {\n if (!isValidEncodedURL(location)) {\n // Some websites respond location header in UTF-8 form without encoding them as ASCII\n // and major browsers redirect them to correctly UTF-8 encoded addresses.\n // Here, we handle that behavior in the same way.\n location = normalizeBinaryStringToUtf8(location)\n }\n location = new URL(location, responseURL(response))\n }\n\n // 4. If location is a URL whose fragment is null, then set location’s\n // fragment to requestFragment.\n if (location && !location.hash) {\n location.hash = requestFragment\n }\n\n // 5. Return location.\n return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n for (let i = 0; i < url.length; ++i) {\n const code = url.charCodeAt(i)\n\n if (\n code > 0x7E || // Non-US-ASCII + DEL\n code < 0x20 // Control characters NUL - US\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n // 1. Let url be request’s current URL.\n const url = requestCurrentURL(request)\n\n // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n // then return blocked.\n if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n return 'blocked'\n }\n\n // 3. Return allowed.\n return 'allowed'\n}\n\nfunction isErrorLike (object) {\n return object instanceof Error || (\n object?.constructor?.name === 'Error' ||\n object?.constructor?.name === 'DOMException'\n )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n for (let i = 0; i < statusText.length; ++i) {\n const c = statusText.charCodeAt(i)\n if (\n !(\n (\n c === 0x09 || // HTAB\n (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n (c >= 0x80 && c <= 0xff)\n ) // obs-text\n )\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n // - Has no leading or trailing HTTP tab or space bytes.\n // - Contains no 0x00 (NUL) or HTTP newline bytes.\n return (\n potentialValue[0] === '\\t' ||\n potentialValue[0] === ' ' ||\n potentialValue[potentialValue.length - 1] === '\\t' ||\n potentialValue[potentialValue.length - 1] === ' ' ||\n potentialValue.includes('\\n') ||\n potentialValue.includes('\\r') ||\n potentialValue.includes('\\0')\n ) === false\n}\n\n/**\n * Parse a referrer policy from a Referrer-Policy header\n * @see https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header\n */\nfunction parseReferrerPolicy (actualResponse) {\n // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n const policyHeader = (actualResponse.headersList.get('referrer-policy', true) ?? '').split(',')\n\n // 2. Let policy be the empty string.\n let policy = ''\n\n // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n\n // Note: As the referrer-policy can contain multiple policies\n // separated by comma, we need to loop through all of them\n // and pick the first valid one.\n // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n if (policyHeader.length) {\n // The right-most policy takes precedence.\n // The left-most policy is the fallback.\n for (let i = policyHeader.length; i !== 0; i--) {\n const token = policyHeader[i - 1].trim()\n if (referrerPolicyTokens.has(token)) {\n policy = token\n break\n }\n }\n }\n\n // 4. Return policy.\n return policy\n}\n\n/**\n * Given a request request and a response actualResponse, this algorithm\n * updates request’s referrer policy according to the Referrer-Policy\n * header (if any) in actualResponse.\n * @see https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\n * @param {import('./request').Request} request\n * @param {import('./response').Response} actualResponse\n */\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n // from a Referrer-Policy header on actualResponse.\n const policy = parseReferrerPolicy(actualResponse)\n\n // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n if (policy !== '') {\n request.referrerPolicy = policy\n }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n // TODO\n return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n // TODO\n return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n // TODO\n return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n // 1. Assert: r’s url is a potentially trustworthy URL.\n // TODO\n\n // 2. Let header be a Structured Header whose value is a token.\n let header = null\n\n // 3. Set header’s value to r’s mode.\n header = httpRequest.mode\n\n // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n // TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n // 1. Let serializedOrigin be the result of byte-serializing a request origin\n // with request.\n // TODO: implement \"byte-serializing a request origin\"\n let serializedOrigin = request.origin\n\n // - \"'client' is changed to an origin during fetching.\"\n // This doesn't happen in undici (in most cases) because undici, by default,\n // has no concept of origin.\n // - request.origin can also be set to request.client.origin (client being\n // an environment settings object), which is undefined without using\n // setGlobalOrigin.\n if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n return\n }\n\n // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n // then append (`Origin`, serializedOrigin) to request’s header list.\n // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n request.headersList.append('origin', serializedOrigin, true)\n } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n // 1. Switch on request’s referrer policy:\n switch (request.referrerPolicy) {\n case 'no-referrer':\n // Set serializedOrigin to `null`.\n serializedOrigin = null\n break\n case 'no-referrer-when-downgrade':\n case 'strict-origin':\n case 'strict-origin-when-cross-origin':\n // If request’s origin is a tuple origin, its scheme is \"https\", and\n // request’s current URL’s scheme is not \"https\", then set\n // serializedOrigin to `null`.\n if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n case 'same-origin':\n // If request’s origin is not same origin with request’s current URL’s\n // origin, then set serializedOrigin to `null`.\n if (!sameOrigin(request, requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n default:\n // Do nothing.\n }\n\n // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n request.headersList.append('origin', serializedOrigin, true)\n }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n // TODO\n return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n return {\n domainLookupStartTime: defaultStartTime,\n domainLookupEndTime: defaultStartTime,\n connectionStartTime: defaultStartTime,\n connectionEndTime: defaultStartTime,\n secureConnectionStartTime: defaultStartTime,\n ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n }\n }\n\n return {\n domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n return {\n startTime: timingInfo.startTime ?? 0,\n redirectStartTime: 0,\n redirectEndTime: 0,\n postRedirectStartTime: timingInfo.startTime ?? 0,\n finalServiceWorkerStartTime: 0,\n finalNetworkResponseStartTime: 0,\n finalNetworkRequestStartTime: 0,\n endTime: 0,\n encodedBodySize: 0,\n decodedBodySize: 0,\n finalConnectionTimingInfo: null\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n // Note: the fetch spec doesn't make use of embedder policy or CSP list\n return {\n referrerPolicy: 'strict-origin-when-cross-origin'\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n return {\n referrerPolicy: policyContainer.referrerPolicy\n }\n}\n\n/**\n * Determine request’s Referrer\n *\n * @see https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\n */\nfunction determineRequestsReferrer (request) {\n // Given a request request, we can determine the correct referrer information\n // to send by examining its referrer policy as detailed in the following\n // steps, which return either no referrer or a URL:\n\n // 1. Let policy be request's referrer policy.\n const policy = request.referrerPolicy\n\n // Note: policy cannot (shouldn't) be null or an empty string.\n assert(policy)\n\n // 2. Let environment be request’s client.\n\n let referrerSource = null\n\n // 3. Switch on request’s referrer:\n\n // \"client\"\n if (request.referrer === 'client') {\n // Note: node isn't a browser and doesn't implement document/iframes,\n // so we bypass this step and replace it with our own.\n\n const globalOrigin = getGlobalOrigin()\n\n if (!globalOrigin || globalOrigin.origin === 'null') {\n return 'no-referrer'\n }\n\n // Note: we need to clone it as it's mutated\n referrerSource = new URL(globalOrigin)\n // a URL\n } else if (webidl.is.URL(request.referrer)) {\n // Let referrerSource be request’s referrer.\n referrerSource = request.referrer\n }\n\n // 4. Let request’s referrerURL be the result of stripping referrerSource for\n // use as a referrer.\n let referrerURL = stripURLForReferrer(referrerSource)\n\n // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n // a referrer, with the origin-only flag set to true.\n const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n // 6. If the result of serializing referrerURL is a string whose length is\n // greater than 4096, set referrerURL to referrerOrigin.\n if (referrerURL.toString().length > 4096) {\n referrerURL = referrerOrigin\n }\n\n // 7. The user agent MAY alter referrerURL or referrerOrigin at this point\n // to enforce arbitrary policy considerations in the interests of minimizing\n // data leakage. For example, the user agent could strip the URL down to an\n // origin, modify its host, replace it with an empty string, etc.\n\n // 8. Execute the switch statements corresponding to the value of policy:\n switch (policy) {\n case 'no-referrer':\n // Return no referrer\n return 'no-referrer'\n case 'origin':\n // Return referrerOrigin\n if (referrerOrigin != null) {\n return referrerOrigin\n }\n return stripURLForReferrer(referrerSource, true)\n case 'unsafe-url':\n // Return referrerURL.\n return referrerURL\n case 'strict-origin': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n // 2. Return referrerOrigin\n return referrerOrigin\n }\n case 'strict-origin-when-cross-origin': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(referrerURL, currentURL)) {\n return referrerURL\n }\n\n // 2. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n\n // 3. Return referrerOrigin.\n return referrerOrigin\n }\n case 'same-origin':\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(request, referrerURL)) {\n return referrerURL\n }\n // 2. Return no referrer.\n return 'no-referrer'\n case 'origin-when-cross-origin':\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(request, referrerURL)) {\n return referrerURL\n }\n // 2. Return referrerOrigin.\n return referrerOrigin\n case 'no-referrer-when-downgrade': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n // 2. Return referrerURL.\n return referrerURL\n }\n }\n}\n\n/**\n * Certain portions of URLs must not be included when sending a URL as the\n * value of a `Referer` header: a URLs fragment, username, and password\n * components must be stripped from the URL before it’s sent out. This\n * algorithm accepts a origin-only flag, which defaults to false. If set to\n * true, the algorithm will additionally remove the URL’s path and query\n * components, leaving only the scheme, host, and port.\n *\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean} [originOnly=false]\n */\nfunction stripURLForReferrer (url, originOnly = false) {\n // 1. Assert: url is a URL.\n assert(webidl.is.URL(url))\n\n // Note: Create a new URL instance to avoid mutating the original URL.\n url = new URL(url)\n\n // 2. If url’s scheme is a local scheme, then return no referrer.\n if (urlIsLocal(url)) {\n return 'no-referrer'\n }\n\n // 3. Set url’s username to the empty string.\n url.username = ''\n\n // 4. Set url’s password to the empty string.\n url.password = ''\n\n // 5. Set url’s fragment to null.\n url.hash = ''\n\n // 6. If the origin-only flag is true, then:\n if (originOnly === true) {\n // 1. Set url’s path to « the empty string ».\n url.pathname = ''\n\n // 2. Set url’s query to null.\n url.search = ''\n }\n\n // 7. Return url.\n return url\n}\n\nconst isPotentialleTrustworthyIPv4 = RegExp.prototype.test\n .bind(/^127\\.(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)\\.){2}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)$/)\n\nconst isPotentiallyTrustworthyIPv6 = RegExp.prototype.test\n .bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/)\n\n/**\n * Check if host matches one of the CIDR notations 127.0.0.0/8 or ::1/128.\n *\n * @param {string} origin\n * @returns {boolean}\n */\nfunction isOriginIPPotentiallyTrustworthy (origin) {\n // IPv6\n if (origin.includes(':')) {\n // Remove brackets from IPv6 addresses\n if (origin[0] === '[' && origin[origin.length - 1] === ']') {\n origin = origin.slice(1, -1)\n }\n return isPotentiallyTrustworthyIPv6(origin)\n }\n\n // IPv4\n return isPotentialleTrustworthyIPv4(origin)\n}\n\n/**\n * A potentially trustworthy origin is one which a user agent can generally\n * trust as delivering data securely.\n *\n * Return value `true` means `Potentially Trustworthy`.\n * Return value `false` means `Not Trustworthy`.\n *\n * @see https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy\n * @param {string} origin\n * @returns {boolean}\n */\nfunction isOriginPotentiallyTrustworthy (origin) {\n // 1. If origin is an opaque origin, return \"Not Trustworthy\".\n if (origin == null || origin === 'null') {\n return false\n }\n\n // 2. Assert: origin is a tuple origin.\n origin = new URL(origin)\n\n // 3. If origin’s scheme is either \"https\" or \"wss\",\n // return \"Potentially Trustworthy\".\n if (origin.protocol === 'https:' || origin.protocol === 'wss:') {\n return true\n }\n\n // 4. If origin’s host matches one of the CIDR notations 127.0.0.0/8 or\n // ::1/128 [RFC4632], return \"Potentially Trustworthy\".\n if (isOriginIPPotentiallyTrustworthy(origin.hostname)) {\n return true\n }\n\n // 5. If the user agent conforms to the name resolution rules in\n // [let-localhost-be-localhost] and one of the following is true:\n\n // origin’s host is \"localhost\" or \"localhost.\"\n if (origin.hostname === 'localhost' || origin.hostname === 'localhost.') {\n return true\n }\n\n // origin’s host ends with \".localhost\" or \".localhost.\"\n if (origin.hostname.endsWith('.localhost') || origin.hostname.endsWith('.localhost.')) {\n return true\n }\n\n // 6. If origin’s scheme is \"file\", return \"Potentially Trustworthy\".\n if (origin.protocol === 'file:') {\n return true\n }\n\n // 7. If origin’s scheme component is one which the user agent considers to\n // be authenticated, return \"Potentially Trustworthy\".\n\n // 8. If origin has been configured as a trustworthy origin, return\n // \"Potentially Trustworthy\".\n\n // 9. Return \"Not Trustworthy\".\n return false\n}\n\n/**\n * A potentially trustworthy URL is one which either inherits context from its\n * creator (about:blank, about:srcdoc, data) or one whose origin is a\n * potentially trustworthy origin.\n *\n * Return value `true` means `Potentially Trustworthy`.\n * Return value `false` means `Not Trustworthy`.\n *\n * @see https://www.w3.org/TR/secure-contexts/#is-url-trustworthy\n * @param {URL} url\n * @returns {boolean}\n */\nfunction isURLPotentiallyTrustworthy (url) {\n // Given a URL record (url), the following algorithm returns \"Potentially\n // Trustworthy\" or \"Not Trustworthy\" as appropriate:\n if (!webidl.is.URL(url)) {\n return false\n }\n\n // 1. If url is \"about:blank\" or \"about:srcdoc\",\n // return \"Potentially Trustworthy\".\n if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n return true\n }\n\n // 2. If url’s scheme is \"data\", return \"Potentially Trustworthy\".\n if (url.protocol === 'data:') return true\n\n // Note: The origin of blob: URLs is the origin of the context in which they\n // were created. Therefore, blobs created in a trustworthy origin will\n // themselves be potentially trustworthy.\n if (url.protocol === 'blob:') return true\n\n // 3. Return the result of executing § 3.1 Is origin potentially trustworthy?\n // on url’s origin.\n return isOriginPotentiallyTrustworthy(url.origin)\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n // 1. If A and B are the same opaque origin, then return true.\n if (A.origin === B.origin && A.origin === 'null') {\n return true\n }\n\n // 2. If A and B are both tuple origins and their schemes,\n // hosts, and port are identical, then return true.\n if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n return true\n }\n\n // 3. Return false.\n return false\n}\n\nfunction isAborted (fetchParams) {\n return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n return fetchParams.controller.state === 'aborted' ||\n fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {((target: any) => any)} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n class FastIterableIterator {\n /** @type {any} */\n #target\n /** @type {'key' | 'value' | 'key+value'} */\n #kind\n /** @type {number} */\n #index\n\n /**\n * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n * @param {unknown} target\n * @param {'key' | 'value' | 'key+value'} kind\n */\n constructor (target, kind) {\n this.#target = target\n this.#kind = kind\n this.#index = 0\n }\n\n next () {\n // 1. Let interface be the interface for which the iterator prototype object exists.\n // 2. Let thisValue be the this value.\n // 3. Let object be ? ToObject(thisValue).\n // 4. If object is a platform object, then perform a security\n // check, passing:\n // 5. If object is not a default iterator object for interface,\n // then throw a TypeError.\n if (typeof this !== 'object' || this === null || !(#target in this)) {\n throw new TypeError(\n `'next' called on an object that does not implement interface ${name} Iterator.`\n )\n }\n\n // 6. Let index be object’s index.\n // 7. Let kind be object’s kind.\n // 8. Let values be object’s target's value pairs to iterate over.\n const index = this.#index\n const values = kInternalIterator(this.#target)\n\n // 9. Let len be the length of values.\n const len = values.length\n\n // 10. If index is greater than or equal to len, then return\n // CreateIterResultObject(undefined, true).\n if (index >= len) {\n return {\n value: undefined,\n done: true\n }\n }\n\n // 11. Let pair be the entry in values at index index.\n const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n // 12. Set object’s index to index + 1.\n this.#index = index + 1\n\n // 13. Return the iterator result for pair and kind.\n\n // https://webidl.spec.whatwg.org/#iterator-result\n\n // 1. Let result be a value determined by the value of kind:\n let result\n switch (this.#kind) {\n case 'key':\n // 1. Let idlKey be pair’s key.\n // 2. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 3. result is key.\n result = key\n break\n case 'value':\n // 1. Let idlValue be pair’s value.\n // 2. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 3. result is value.\n result = value\n break\n case 'key+value':\n // 1. Let idlKey be pair’s key.\n // 2. Let idlValue be pair’s value.\n // 3. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 4. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 5. Let array be ! ArrayCreate(2).\n // 6. Call ! CreateDataProperty(array, \"0\", key).\n // 7. Call ! CreateDataProperty(array, \"1\", value).\n // 8. result is array.\n result = [key, value]\n break\n }\n\n // 2. Return CreateIterResultObject(result, false).\n return {\n value: result,\n done: false\n }\n }\n }\n\n // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n // @ts-ignore\n delete FastIterableIterator.prototype.constructor\n\n Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n Object.defineProperties(FastIterableIterator.prototype, {\n [Symbol.toStringTag]: {\n writable: false,\n enumerable: false,\n configurable: true,\n value: `${name} Iterator`\n },\n next: { writable: true, enumerable: true, configurable: true }\n })\n\n /**\n * @param {unknown} target\n * @param {'key' | 'value' | 'key+value'} kind\n * @returns {IterableIterator<any>}\n */\n return function (target, kind) {\n return new FastIterableIterator(target, kind)\n }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {(target: any) => any} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n const properties = {\n keys: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function keys () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'key')\n }\n },\n values: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function values () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'value')\n }\n },\n entries: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function entries () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'key+value')\n }\n },\n forEach: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function forEach (callbackfn, thisArg = globalThis) {\n webidl.brandCheck(this, object)\n webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n if (typeof callbackfn !== 'function') {\n throw new TypeError(\n `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n )\n }\n for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n callbackfn.call(thisArg, value, key, this)\n }\n }\n }\n }\n\n return Object.defineProperties(object.prototype, {\n ...properties,\n [Symbol.iterator]: {\n writable: true,\n enumerable: false,\n configurable: true,\n value: properties.entries.value\n }\n })\n}\n\n/**\n * @param {import('./body').ExtractBodyResult} body\n * @param {(bytes: Uint8Array) => void} processBody\n * @param {(error: Error) => void} processBodyError\n * @returns {void}\n *\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nfunction fullyReadBody (body, processBody, processBodyError) {\n // 1. If taskDestination is null, then set taskDestination to\n // the result of starting a new parallel queue.\n\n // 2. Let successSteps given a byte sequence bytes be to queue a\n // fetch task to run processBody given bytes, with taskDestination.\n const successSteps = processBody\n\n // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n // with taskDestination.\n const errorSteps = processBodyError\n\n try {\n // 4. Let reader be the result of getting a reader for body’s stream.\n // If that threw an exception, then run errorSteps with that\n // exception and return.\n const reader = body.stream.getReader()\n\n // 5. Read all bytes from reader, given successSteps and errorSteps.\n readAllBytes(reader, successSteps, errorSteps)\n } catch (e) {\n errorSteps(e)\n }\n}\n\n/**\n * @param {ReadableStreamController<Uint8Array>} controller\n */\nfunction readableStreamClose (controller) {\n try {\n controller.close()\n controller.byobRequest?.respond(0)\n } catch (err) {\n // TODO: add comment explaining why this error occurs.\n if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n throw err\n }\n }\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStream<Uint8Array<ArrayBuffer>>} reader\n * @param {(bytes: Uint8Array) => void} successSteps\n * @param {(error: Error) => void} failureSteps\n * @returns {Promise<void>}\n */\nasync function readAllBytes (reader, successSteps, failureSteps) {\n try {\n const bytes = []\n let byteLength = 0\n\n do {\n const { done, value: chunk } = await reader.read()\n\n if (done) {\n // 1. Call successSteps with bytes.\n successSteps(Buffer.concat(bytes, byteLength))\n return\n }\n\n // 1. If chunk is not a Uint8Array object, call failureSteps\n // with a TypeError and abort these steps.\n if (!isUint8Array(chunk)) {\n failureSteps(new TypeError('Received non-Uint8Array chunk'))\n return\n }\n\n // 2. Append the bytes represented by chunk to bytes.\n bytes.push(chunk)\n byteLength += chunk.length\n\n // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n } while (true)\n } catch (e) {\n // 1. Call failureSteps with e.\n failureSteps(e)\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n * @returns {boolean}\n */\nfunction urlIsLocal (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n // A URL is local if its scheme is a local scheme.\n // A local scheme is \"about\", \"blob\", or \"data\".\n return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n return (\n (\n typeof url === 'string' &&\n url[5] === ':' &&\n url[0] === 'h' &&\n url[1] === 't' &&\n url[2] === 't' &&\n url[3] === 'p' &&\n url[4] === 's'\n ) ||\n url.protocol === 'https:'\n )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @typedef {Object} RangeHeaderValue\n * @property {number|null} rangeStartValue\n * @property {number|null} rangeEndValue\n */\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n * @return {RangeHeaderValue|'failure'}\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n // 1. Let data be the isomorphic decoding of value.\n // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n // nothing more. We obviously don't need to do that if value is a string already.\n const data = value\n\n // 2. If data does not start with \"bytes\", then return failure.\n if (!data.startsWith('bytes')) {\n return 'failure'\n }\n\n // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n const position = { position: 5 }\n\n // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n // from data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 5. If the code point at position within data is not U+003D (=), then return failure.\n if (data.charCodeAt(position.position) !== 0x3D) {\n return 'failure'\n }\n\n // 6. Advance position by 1.\n position.position++\n\n // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n // data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n // from data given position.\n const rangeStart = collectASequenceOfCodePoints(\n (char) => {\n const code = char.charCodeAt(0)\n\n return code >= 0x30 && code <= 0x39\n },\n data,\n position\n )\n\n // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n // empty string; otherwise null.\n const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n // from data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 11. If the code point at position within data is not U+002D (-), then return failure.\n if (data.charCodeAt(position.position) !== 0x2D) {\n return 'failure'\n }\n\n // 12. Advance position by 1.\n position.position++\n\n // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n // or space, from data given position.\n // Note from Khafra: its the same step as in #8 again lol\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n // ASCII digits, from data given position.\n // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n const rangeEnd = collectASequenceOfCodePoints(\n (char) => {\n const code = char.charCodeAt(0)\n\n return code >= 0x30 && code <= 0x39\n },\n data,\n position\n )\n\n // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n // is not the empty string; otherwise null.\n // Note from Khafra: THE SAME STEP, AGAIN!!!\n // Note: why interpret as a decimal if we only collect ascii digits?\n const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n // 16. If position is not past the end of data, then return failure.\n if (position.position < data.length) {\n return 'failure'\n }\n\n // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n if (rangeEndValue === null && rangeStartValue === null) {\n return 'failure'\n }\n\n // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n // greater than rangeEndValue, then return failure.\n // Note: ... when can they not be numbers?\n if (rangeStartValue > rangeEndValue) {\n return 'failure'\n }\n\n // 19. Return (rangeStartValue, rangeEndValue).\n return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n // 1. Let contentRange be `bytes `.\n let contentRange = 'bytes '\n\n // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n contentRange += isomorphicEncode(`${rangeStart}`)\n\n // 3. Append 0x2D (-) to contentRange.\n contentRange += '-'\n\n // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n contentRange += isomorphicEncode(`${rangeEnd}`)\n\n // 5. Append 0x2F (/) to contentRange.\n contentRange += '/'\n\n // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n contentRange += isomorphicEncode(`${fullLength}`)\n\n // 7. Return contentRange.\n return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n #zlibOptions\n\n /** @param {zlib.ZlibOptions} [zlibOptions] */\n constructor (zlibOptions) {\n super()\n this.#zlibOptions = zlibOptions\n }\n\n _transform (chunk, encoding, callback) {\n if (!this._inflateStream) {\n if (chunk.length === 0) {\n callback()\n return\n }\n this._inflateStream = (chunk[0] & 0x0F) === 0x08\n ? zlib.createInflate(this.#zlibOptions)\n : zlib.createInflateRaw(this.#zlibOptions)\n\n this._inflateStream.on('data', this.push.bind(this))\n this._inflateStream.on('end', () => this.push(null))\n this._inflateStream.on('error', (err) => this.destroy(err))\n }\n\n this._inflateStream.write(chunk, encoding, callback)\n }\n\n _final (callback) {\n if (this._inflateStream) {\n this._inflateStream.end()\n this._inflateStream = null\n }\n callback()\n }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n // 1. Let charset be null.\n let charset = null\n\n // 2. Let essence be null.\n let essence = null\n\n // 3. Let mimeType be null.\n let mimeType = null\n\n // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n const values = getDecodeSplit('content-type', headers)\n\n // 5. If values is null, then return failure.\n if (values === null) {\n return 'failure'\n }\n\n // 6. For each value of values:\n for (const value of values) {\n // 6.1. Let temporaryMimeType be the result of parsing value.\n const temporaryMimeType = parseMIMEType(value)\n\n // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n continue\n }\n\n // 6.3. Set mimeType to temporaryMimeType.\n mimeType = temporaryMimeType\n\n // 6.4. If mimeType’s essence is not essence, then:\n if (mimeType.essence !== essence) {\n // 6.4.1. Set charset to null.\n charset = null\n\n // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n // mimeType’s parameters[\"charset\"].\n if (mimeType.parameters.has('charset')) {\n charset = mimeType.parameters.get('charset')\n }\n\n // 6.4.3. Set essence to mimeType’s essence.\n essence = mimeType.essence\n } else if (!mimeType.parameters.has('charset') && charset !== null) {\n // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n // charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n mimeType.parameters.set('charset', charset)\n }\n }\n\n // 7. If mimeType is null, then return failure.\n if (mimeType == null) {\n return 'failure'\n }\n\n // 8. Return mimeType.\n return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n // 1. Let input be the result of isomorphic decoding value.\n const input = value\n\n // 2. Let position be a position variable for input, initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let values be a list of strings, initially empty.\n const values = []\n\n // 4. Let temporaryValue be the empty string.\n let temporaryValue = ''\n\n // 5. While position is not past the end of input:\n while (position.position < input.length) {\n // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n // or U+002C (,) from input, given position, to temporaryValue.\n temporaryValue += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== ',',\n input,\n position\n )\n\n // 5.2. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n if (input.charCodeAt(position.position) === 0x22) {\n // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n temporaryValue += collectAnHTTPQuotedString(\n input,\n position\n )\n\n // 5.2.1.2. If position is not past the end of input, then continue.\n if (position.position < input.length) {\n continue\n }\n } else {\n // 5.2.2. Otherwise:\n\n // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n assert(input.charCodeAt(position.position) === 0x2C)\n\n // 5.2.2.2. Advance position by 1.\n position.position++\n }\n }\n\n // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n // 5.4. Append temporaryValue to values.\n values.push(temporaryValue)\n\n // 5.6. Set temporaryValue to the empty string.\n temporaryValue = ''\n }\n\n // 6. Return values.\n return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n // 1. Let value be the result of getting name from list.\n const value = list.get(name, true)\n\n // 2. If value is null, then return null.\n if (value === null) {\n return null\n }\n\n // 3. Return the result of getting, decoding, and splitting value.\n return gettingDecodingSplitting(value)\n}\n\nfunction hasAuthenticationEntry (request) {\n return false\n}\n\n/**\n * @see https://url.spec.whatwg.org/#include-credentials\n * @param {URL} url\n */\nfunction includesCredentials (url) {\n // A URL includes credentials if its username or password is not the empty string.\n return !!(url.username || url.password)\n}\n\n/**\n * @see https://html.spec.whatwg.org/multipage/document-sequences.html#traversable-navigable\n * @param {object|string} navigable\n */\nfunction isTraversableNavigable (navigable) {\n // Returns true only if we have an actual traversable navigable object\n // that can prompt the user for credentials. In Node.js, this will always\n // be false since there's no Window object or navigable.\n return navigable != null && navigable !== 'client' && navigable !== 'no-traversable'\n}\n\nclass EnvironmentSettingsObjectBase {\n get baseUrl () {\n return getGlobalOrigin()\n }\n\n get origin () {\n return this.baseUrl?.origin\n }\n\n policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n isAborted,\n isCancelled,\n isValidEncodedURL,\n ReadableStreamFrom,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n clampAndCoarsenConnectionTimingInfo,\n coarsenedSharedCurrentTime,\n determineRequestsReferrer,\n makePolicyContainer,\n clonePolicyContainer,\n appendFetchMetadata,\n appendRequestOriginHeader,\n TAOCheck,\n corsCheck,\n crossOriginResourcePolicyCheck,\n createOpaqueTimingInfo,\n setRequestReferrerPolicyOnRedirect,\n isValidHTTPToken,\n requestBadPort,\n requestCurrentURL,\n responseURL,\n responseLocationURL,\n isURLPotentiallyTrustworthy,\n isValidReasonPhrase,\n sameOrigin,\n normalizeMethod,\n iteratorMixin,\n createIterator,\n isValidHeaderName,\n isValidHeaderValue,\n isErrorLike,\n fullyReadBody,\n readableStreamClose,\n urlIsLocal,\n urlHasHttpsScheme,\n urlIsHttpHttpsScheme,\n readAllBytes,\n simpleRangeHeaderValue,\n buildContentRange,\n createInflate,\n extractMimeType,\n getDecodeSplit,\n environmentSettingsObject,\n isOriginIPPotentiallyTrustworthy,\n hasAuthenticationEntry,\n includesCredentials,\n isTraversableNavigable\n}\n","'use strict'\n\nconst { iteratorMixin } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { webidl } = require('../webidl')\nconst nodeUtil = require('node:util')\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n #state = []\n\n constructor (form = undefined) {\n webidl.util.markAsUncloneable(this)\n\n if (form !== undefined) {\n throw webidl.errors.conversionFailed({\n prefix: 'FormData constructor',\n argument: 'Argument 1',\n types: ['undefined']\n })\n }\n }\n\n append (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.append'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n name = webidl.converters.USVString(name)\n\n if (arguments.length === 3 || webidl.is.Blob(value)) {\n value = webidl.converters.Blob(value, prefix, 'value')\n\n if (filename !== undefined) {\n filename = webidl.converters.USVString(filename)\n }\n } else {\n value = webidl.converters.USVString(value)\n }\n\n // 1. Let value be value if given; otherwise blobValue.\n\n // 2. Let entry be the result of creating an entry with\n // name, value, and filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. Append entry to this’s entry list.\n this.#state.push(entry)\n }\n\n delete (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name)\n\n // The delete(name) method steps are to remove all entries whose name\n // is name from this’s entry list.\n this.#state = this.#state.filter(entry => entry.name !== name)\n }\n\n get (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.get'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name)\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return null.\n const idx = this.#state.findIndex((entry) => entry.name === name)\n if (idx === -1) {\n return null\n }\n\n // 2. Return the value of the first entry whose name is name from\n // this’s entry list.\n return this.#state[idx].value\n }\n\n getAll (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.getAll'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name)\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return the empty list.\n // 2. Return the values of all entries whose name is name, in order,\n // from this’s entry list.\n return this.#state\n .filter((entry) => entry.name === name)\n .map((entry) => entry.value)\n }\n\n has (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.has'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name)\n\n // The has(name) method steps are to return true if there is an entry\n // whose name is name in this’s entry list; otherwise false.\n return this.#state.findIndex((entry) => entry.name === name) !== -1\n }\n\n set (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.set'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n name = webidl.converters.USVString(name)\n\n if (arguments.length === 3 || webidl.is.Blob(value)) {\n value = webidl.converters.Blob(value, prefix, 'value')\n\n if (filename !== undefined) {\n filename = webidl.converters.USVString(filename)\n }\n } else {\n value = webidl.converters.USVString(value)\n }\n\n // The set(name, value) and set(name, blobValue, filename) method steps\n // are:\n\n // 1. Let value be value if given; otherwise blobValue.\n\n // 2. Let entry be the result of creating an entry with name, value, and\n // filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. If there are entries in this’s entry list whose name is name, then\n // replace the first such entry with entry and remove the others.\n const idx = this.#state.findIndex((entry) => entry.name === name)\n if (idx !== -1) {\n this.#state = [\n ...this.#state.slice(0, idx),\n entry,\n ...this.#state.slice(idx + 1).filter((entry) => entry.name !== name)\n ]\n } else {\n // 4. Otherwise, append entry to this’s entry list.\n this.#state.push(entry)\n }\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n const state = this.#state.reduce((a, b) => {\n if (a[b.name]) {\n if (Array.isArray(a[b.name])) {\n a[b.name].push(b.value)\n } else {\n a[b.name] = [a[b.name], b.value]\n }\n } else {\n a[b.name] = b.value\n }\n\n return a\n }, { __proto__: null })\n\n options.depth ??= depth\n options.colors ??= true\n\n const output = nodeUtil.formatWithOptions(options, state)\n\n // remove [Object null prototype]\n return `FormData ${output.slice(output.indexOf(']') + 2)}`\n }\n\n /**\n * @param {FormData} formData\n */\n static getFormDataState (formData) {\n return formData.#state\n }\n\n /**\n * @param {FormData} formData\n * @param {any[]} newState\n */\n static setFormDataState (formData, newState) {\n formData.#state = newState\n }\n}\n\nconst { getFormDataState, setFormDataState } = FormData\nReflect.deleteProperty(FormData, 'getFormDataState')\nReflect.deleteProperty(FormData, 'setFormDataState')\n\niteratorMixin('FormData', FormData, getFormDataState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n getAll: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FormData',\n configurable: true\n }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n // 1. Set name to the result of converting name into a scalar value string.\n // Note: This operation was done by the webidl converter USVString.\n\n // 2. If value is a string, then set value to the result of converting\n // value into a scalar value string.\n if (typeof value === 'string') {\n // Note: This operation was done by the webidl converter USVString.\n } else {\n // 3. Otherwise:\n\n // 1. If value is not a File object, then set value to a new File object,\n // representing the same bytes, whose name attribute value is \"blob\"\n if (!webidl.is.File(value)) {\n value = new File([value], 'blob', { type: value.type })\n }\n\n // 2. If filename is given, then set value to a new File object,\n // representing the same bytes, whose name attribute is filename.\n if (filename !== undefined) {\n /** @type {FilePropertyBag} */\n const options = {\n type: value.type,\n lastModified: value.lastModified\n }\n\n value = new File([value], filename, options)\n }\n }\n\n // 4. Return an entry whose name is name and whose value is value.\n return { name, value }\n}\n\nwebidl.is.FormData = webidl.util.MakeTypeAssertion(FormData)\n\nmodule.exports = { FormData, makeEntry, setFormDataState }\n","'use strict'\n\nconst { bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { HTTP_TOKEN_CODEPOINTS } = require('./data-url')\nconst { makeEntry } = require('./formdata')\nconst { webidl } = require('../webidl')\nconst assert = require('node:assert')\nconst { isomorphicDecode } = require('../infra')\n\nconst dd = Buffer.from('--')\nconst decoder = new TextDecoder()\nconst decoderIgnoreBOM = new TextDecoder('utf-8', { ignoreBOM: true })\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n for (let i = 0; i < chars.length; ++i) {\n if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n const length = boundary.length\n\n // - its length is greater or equal to 27 and lesser or equal to 70, and\n if (length < 27 || length > 70) {\n return false\n }\n\n // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n // 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n // 0x2D (-) or 0x5F (_).\n for (let i = 0; i < length; ++i) {\n const cp = boundary.charCodeAt(i)\n\n if (!(\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5a) ||\n (cp >= 0x61 && cp <= 0x7a) ||\n cp === 0x27 ||\n cp === 0x2d ||\n cp === 0x5f\n )) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType<import('./data-url')['parseMIMEType']>} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n const boundaryString = mimeType.parameters.get('boundary')\n\n // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n // Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n // parameters[\"boundary\"].\n if (boundaryString === undefined) {\n throw parsingError('missing boundary in content-type header')\n }\n\n const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n // 3. Let entry list be an empty entry list.\n const entryList = []\n\n // 4. Let position be a pointer to a byte in input, initially pointing at\n // the first byte.\n const position = { position: 0 }\n\n // Note: Per RFC 2046 Section 5.1.1, we must ignore anything before the\n // first boundary delimiter line (preamble). Search for the first boundary.\n const firstBoundaryIndex = input.indexOf(boundary)\n\n if (firstBoundaryIndex === -1) {\n throw parsingError('no boundary found in multipart body')\n }\n\n // Start parsing from the first boundary, ignoring any preamble\n position.position = firstBoundaryIndex\n\n // 5. While true:\n while (true) {\n // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n // (`--`) followed by boundary, advance position by 2 + the length of\n // boundary. Otherwise, return failure.\n // Note: boundary is padded with 2 dashes already, no need to add 2.\n if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n position.position += boundary.length\n } else {\n throw parsingError('expected a value starting with -- and the boundary')\n }\n\n // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n // (`--` followed by CR LF) followed by the end of input, return entry list.\n // Note: Per RFC 2046 Section 5.1.1, we must ignore anything after the\n // final boundary delimiter (epilogue). Check for -- or --CRLF and return\n // regardless of what follows.\n if (bufferStartsWith(input, dd, position)) {\n // Found closing boundary delimiter (--), ignore any epilogue\n return entryList\n }\n\n // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n // 0x0A (CR LF), return failure.\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n throw parsingError('expected CRLF')\n }\n\n // 5.4. Advance position by 2. (This skips past the newline.)\n position.position += 2\n\n // 5.5. Let name, filename and contentType be the result of parsing\n // multipart/form-data headers on input and position, if the result\n // is not failure. Otherwise, return failure.\n const result = parseMultipartFormDataHeaders(input, position)\n\n let { name, filename, contentType, encoding } = result\n\n // 5.6. Advance position by 2. (This skips past the empty line that marks\n // the end of the headers.)\n position.position += 2\n\n // 5.7. Let body be the empty byte sequence.\n let body\n\n // 5.8. Body loop: While position is not past the end of input:\n // TODO: the steps here are completely wrong\n {\n const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n if (boundaryIndex === -1) {\n throw parsingError('expected boundary after body')\n }\n\n body = input.subarray(position.position, boundaryIndex - 4)\n\n position.position += body.length\n\n // Note: position must be advanced by the body's length before being\n // decoded, otherwise the parsing will fail.\n if (encoding === 'base64') {\n body = Buffer.from(body.toString(), 'base64')\n }\n }\n\n // 5.9. If position does not point to a sequence of bytes starting with\n // 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n throw parsingError('expected CRLF')\n } else {\n position.position += 2\n }\n\n // 5.10. If filename is not null:\n let value\n\n if (filename !== null) {\n // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n contentType ??= 'text/plain'\n\n // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n if (!isAsciiString(contentType)) {\n contentType = ''\n }\n\n // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n value = new File([body], filename, { type: contentType })\n } else {\n // 5.11. Otherwise:\n\n // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n value = decoderIgnoreBOM.decode(Buffer.from(body))\n }\n\n // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n assert(webidl.is.USVString(name))\n assert((typeof value === 'string' && webidl.is.USVString(value)) || webidl.is.File(value))\n\n // 5.13. Create an entry with name and value, and append it to entry list.\n entryList.push(makeEntry(name, value, filename))\n }\n}\n\n/**\n * Parses content-disposition attributes (e.g., name=\"value\" or filename*=utf-8''encoded)\n * @param {Buffer} input\n * @param {{ position: number }} position\n * @returns {{ name: string, value: string, extended: boolean } | null}\n */\nfunction parseContentDispositionAttribute (input, position) {\n // Skip leading semicolon and whitespace\n if (input[position.position] === 0x3b /* ; */) {\n position.position++\n }\n\n // Skip whitespace\n collectASequenceOfBytes(\n (char) => char === 0x20 || char === 0x09,\n input,\n position\n )\n\n // Collect attribute name (token characters)\n const attributeName = collectASequenceOfBytes(\n (char) => isToken(char) && char !== 0x3d && char !== 0x2a, // not = or *\n input,\n position\n )\n\n if (attributeName.length === 0) {\n return null\n }\n\n const attrNameStr = attributeName.toString('ascii').toLowerCase()\n\n // Check for extended notation (attribute*)\n const isExtended = input[position.position] === 0x2a /* * */\n if (isExtended) {\n position.position++ // skip *\n }\n\n // Expect = sign\n if (input[position.position] !== 0x3d /* = */) {\n return null\n }\n position.position++ // skip =\n\n // Skip whitespace\n collectASequenceOfBytes(\n (char) => char === 0x20 || char === 0x09,\n input,\n position\n )\n\n let value\n\n if (isExtended) {\n // Extended attribute format: charset'language'encoded-value\n const headerValue = collectASequenceOfBytes(\n (char) => char !== 0x20 && char !== 0x0d && char !== 0x0a && char !== 0x3b, // not space, CRLF, or ;\n input,\n position\n )\n\n // Check for utf-8'' prefix (case insensitive)\n if (\n (headerValue[0] !== 0x75 && headerValue[0] !== 0x55) || // u or U\n (headerValue[1] !== 0x74 && headerValue[1] !== 0x54) || // t or T\n (headerValue[2] !== 0x66 && headerValue[2] !== 0x46) || // f or F\n headerValue[3] !== 0x2d || // -\n headerValue[4] !== 0x38 // 8\n ) {\n throw parsingError('unknown encoding, expected utf-8\\'\\'')\n }\n\n // Skip utf-8'' and decode the rest\n value = decodeURIComponent(decoder.decode(headerValue.subarray(7)))\n } else if (input[position.position] === 0x22 /* \" */) {\n // Quoted string\n position.position++ // skip opening quote\n\n const quotedValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d && char !== 0x22, // not LF, CR, or \"\n input,\n position\n )\n\n if (input[position.position] !== 0x22) {\n throw parsingError('Closing quote not found')\n }\n position.position++ // skip closing quote\n\n value = decoder.decode(quotedValue)\n .replace(/%0A/ig, '\\n')\n .replace(/%0D/ig, '\\r')\n .replace(/%22/g, '\"')\n } else {\n // Token value (no quotes)\n const tokenValue = collectASequenceOfBytes(\n (char) => isToken(char) && char !== 0x3b, // not ;\n input,\n position\n )\n\n value = decoder.decode(tokenValue)\n }\n\n return { name: attrNameStr, value, extended: isExtended }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n // 1. Let name, filename and contentType be null.\n let name = null\n let filename = null\n let contentType = null\n let encoding = null\n\n // 2. While true:\n while (true) {\n // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n // 2.1.1. If name is null, return failure.\n if (name === null) {\n throw parsingError('header name is null')\n }\n\n // 2.1.2. Return name, filename and contentType.\n return { name, filename, contentType, encoding }\n }\n\n // 2.2. Let header name be the result of collecting a sequence of bytes that are\n // not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n let headerName = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n input,\n position\n )\n\n // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n // 2.4. If header name does not match the field-name token production, return failure.\n if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n throw parsingError('header name does not match the field-name token production')\n }\n\n // 2.5. If the byte at position is not 0x3A (:), return failure.\n if (input[position.position] !== 0x3a) {\n throw parsingError('expected :')\n }\n\n // 2.6. Advance position by 1.\n position.position++\n\n // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n // (Do nothing with those bytes.)\n collectASequenceOfBytes(\n (char) => char === 0x20 || char === 0x09,\n input,\n position\n )\n\n // 2.8. Byte-lowercase header name and switch on the result:\n switch (bufferToLowerCasedHeaderName(headerName)) {\n case 'content-disposition': {\n name = filename = null\n // Track whether filename was set from the extended (RFC 5987) form so\n // a subsequent legacy `filename` attribute does not override it.\n let filenameIsExtended = false\n\n // Collect the disposition type (should be \"form-data\")\n const dispositionType = collectASequenceOfBytes(\n (char) => isToken(char),\n input,\n position\n )\n\n if (dispositionType.toString('ascii').toLowerCase() !== 'form-data') {\n throw parsingError('expected form-data for content-disposition header')\n }\n\n // Parse attributes recursively until CRLF\n while (\n position.position < input.length &&\n (input[position.position] !== 0x0d ||\n input[position.position + 1] !== 0x0a)\n ) {\n const attribute = parseContentDispositionAttribute(input, position)\n\n if (!attribute) {\n break\n }\n\n if (attribute.name === 'name') {\n name = attribute.value\n } else if (attribute.name === 'filename') {\n // Per RFC 5987 §4.1, when both legacy and extended forms of the\n // same parameter are present, the extended (filename*) form takes\n // precedence regardless of the order they appear in.\n if (attribute.extended) {\n filename = attribute.value\n filenameIsExtended = true\n } else if (!filenameIsExtended) {\n filename = attribute.value\n }\n }\n }\n\n if (name === null) {\n throw parsingError('name attribute is required in content-disposition header')\n }\n\n break\n }\n case 'content-type': {\n // 1. Let header value be the result of collecting a sequence of bytes that are\n // not 0x0A (LF) or 0x0D (CR), given position.\n let headerValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n\n // 2. Remove any HTTP tab or space bytes from the end of header value.\n headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n // 3. Set contentType to the isomorphic decoding of header value.\n contentType = isomorphicDecode(headerValue)\n\n break\n }\n case 'content-transfer-encoding': {\n let headerValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n\n headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n encoding = isomorphicDecode(headerValue)\n\n break\n }\n default: {\n // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n // (Do nothing with those bytes.)\n collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n }\n }\n\n // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n // (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n throw parsingError('expected CRLF')\n } else {\n position.position += 2\n }\n }\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n let start = position.position\n\n while (start < input.length && condition(input[start])) {\n ++start\n }\n\n return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n let lead = 0\n let trail = buf.length - 1\n\n if (leading) {\n while (lead < buf.length && predicate(buf[lead])) lead++\n }\n\n if (trailing) {\n while (trail > 0 && predicate(buf[trail])) trail--\n }\n\n return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n if (buffer.length < start.length) {\n return false\n }\n\n for (let i = 0; i < start.length; i++) {\n if (start[i] !== buffer[position.position + i]) {\n return false\n }\n }\n\n return true\n}\n\nfunction parsingError (cause) {\n return new TypeError('Failed to parse body as FormData.', { cause: new TypeError(cause) })\n}\n\n/**\n * CTL = <any US-ASCII control character\n * (octets 0 - 31) and DEL (127)>\n * @param {number} char\n */\nfunction isCTL (char) {\n return char <= 0x1f || char === 0x7f\n}\n\n/**\n * tspecials := \"(\" / \")\" / \"<\" / \">\" / \"@\" /\n * \",\" / \";\" / \":\" / \"\\\" / <\">\n * \"/\" / \"[\" / \"]\" / \"?\" / \"=\"\n * ; Must be in quoted-string,\n * ; to use within parameter values\n * @param {number} char\n */\nfunction isTSpecial (char) {\n return (\n char === 0x28 || // (\n char === 0x29 || // )\n char === 0x3c || // <\n char === 0x3e || // >\n char === 0x40 || // @\n char === 0x2c || // ,\n char === 0x3b || // ;\n char === 0x3a || // :\n char === 0x5c || // \\\n char === 0x22 || // \"\n char === 0x2f || // /\n char === 0x5b || // [\n char === 0x5d || // ]\n char === 0x3f || // ?\n char === 0x3d // +\n )\n}\n\n/**\n * token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,\n * or tspecials>\n * @param {number} char\n */\nfunction isToken (char) {\n return (\n char <= 0x7f && // ascii\n char !== 0x20 && // space\n char !== 0x09 &&\n !isCTL(char) &&\n !isTSpecial(char)\n )\n}\n\nmodule.exports = {\n multipartFormDataParser,\n validateBoundary\n}\n","'use strict'\n\n/**\n * @template {*} T\n * @typedef {Object} DeferredPromise\n * @property {Promise<T>} promise\n * @property {(value?: T) => void} resolve\n * @property {(reason?: any) => void} reject\n */\n\n/**\n * @template {*} T\n * @returns {DeferredPromise<T>} An object containing a promise and its resolve/reject methods.\n */\nfunction createDeferredPromise () {\n let res\n let rej\n const promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n return { promise, resolve: res, reject: rej }\n}\n\nmodule.exports = {\n createDeferredPromise\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n ReadableStreamFrom,\n readableStreamClose,\n fullyReadBody,\n extractMimeType\n} = require('./util')\nconst { FormData, setFormDataState } = require('./formdata')\nconst { webidl } = require('../webidl')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isUint8Array } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nconst { createDeferredPromise } = require('../../util/promise')\nconst { parseJSONFromBytes } = require('../infra')\nconst { utf8DecodeBytes } = require('../../encoding')\nconst { runtimeFeatures } = require('../../util/runtime-features.js')\n\nconst random = runtimeFeatures.has('crypto')\n ? require('node:crypto').randomInt\n : (max) => Math.floor(Math.random() * max)\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst streamRegistry = new FinalizationRegistry((weakRef) => {\n const stream = weakRef.deref()\n if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n stream.cancel('Response object has been garbage collected').catch(noop)\n }\n})\n\n/**\n * Extract a body with type from a byte sequence or BodyInit object\n *\n * @param {import('../../../types').BodyInit} object - The BodyInit object to extract from\n * @param {boolean} [keepalive=false] - If true, indicates that the body\n * @returns {[{stream: ReadableStream, source: any, length: number | null}, string | null]} - Returns a tuple containing the body and its type\n *\n * @see https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n */\nfunction extractBody (object, keepalive = false) {\n // 1. Let stream be null.\n let stream = null\n let controller = null\n\n // 2. If object is a ReadableStream object, then set stream to object.\n if (webidl.is.ReadableStream(object)) {\n stream = object\n } else if (webidl.is.Blob(object)) {\n // 3. Otherwise, if object is a Blob object, set stream to the\n // result of running object’s get stream.\n stream = object.stream()\n } else {\n // 4. Otherwise, set stream to a new ReadableStream object, and set\n // up stream with byte reading support.\n stream = new ReadableStream({\n pull () {},\n start (c) {\n controller = c\n },\n cancel () {},\n type: 'bytes'\n })\n }\n\n // 5. Assert: stream is a ReadableStream object.\n assert(webidl.is.ReadableStream(stream))\n\n // 6. Let action be null.\n let action = null\n\n // 7. Let source be null.\n let source = null\n\n // 8. Let length be null.\n let length = null\n\n // 9. Let type be null.\n let type = null\n\n // 10. Switch on object:\n if (typeof object === 'string') {\n // Set source to the UTF-8 encoding of object.\n // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n source = object\n\n // Set type to `text/plain;charset=UTF-8`.\n type = 'text/plain;charset=UTF-8'\n } else if (webidl.is.URLSearchParams(object)) {\n // URLSearchParams\n\n // spec says to run application/x-www-form-urlencoded on body.list\n // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n source = object.toString()\n\n // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n type = 'application/x-www-form-urlencoded;charset=UTF-8'\n } else if (webidl.is.BufferSource(object)) {\n // Set source to a copy of the bytes held by object.\n source = webidl.util.getCopyOfBytesHeldByBufferSource(object)\n } else if (webidl.is.FormData(object)) {\n const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */\n const formdataEscape = (str) =>\n str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n // Set action to this step: run the multipart/form-data\n // encoding algorithm, with object’s entry list and UTF-8.\n // - This ensures that the body is immutable and can't be changed afterwords\n // - That the content-length is calculated in advance.\n // - And that all parts are pre-encoded and ready to be sent.\n\n const blobParts = []\n const rn = new Uint8Array([13, 10]) // '\\r\\n'\n length = 0\n let hasUnknownSizeValue = false\n\n for (const [name, value] of object) {\n if (typeof value === 'string') {\n const chunk = textEncoder.encode(prefix +\n `; name=\"${formdataEscape(normalizeLinefeeds(name))}\"` +\n `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n } else {\n const chunk = textEncoder.encode(`${prefix}; name=\"${formdataEscape(normalizeLinefeeds(name))}\"` +\n (value.name ? `; filename=\"${formdataEscape(value.name)}\"` : '') + '\\r\\n' +\n `Content-Type: ${\n value.type || 'application/octet-stream'\n }\\r\\n\\r\\n`)\n blobParts.push(chunk, value, rn)\n if (typeof value.size === 'number') {\n length += chunk.byteLength + value.size + rn.byteLength\n } else {\n hasUnknownSizeValue = true\n }\n }\n }\n\n // CRLF is appended to the body to function with legacy servers and match other implementations.\n // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n // https://github.com/form-data/form-data/issues/63\n const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n if (hasUnknownSizeValue) {\n length = null\n }\n\n // Set source to object.\n source = object\n\n action = async function * () {\n for (const part of blobParts) {\n if (part.stream) {\n yield * part.stream()\n } else {\n yield part\n }\n }\n }\n\n // Set type to `multipart/form-data; boundary=`,\n // followed by the multipart/form-data boundary string generated\n // by the multipart/form-data encoding algorithm.\n type = `multipart/form-data; boundary=${boundary}`\n } else if (webidl.is.Blob(object)) {\n // Blob\n\n // Set source to object.\n source = object\n\n // Set length to object’s size.\n length = object.size\n\n // If object’s type attribute is not the empty byte sequence, set\n // type to its value.\n if (object.type) {\n type = object.type\n }\n } else if (typeof object[Symbol.asyncIterator] === 'function') {\n // If keepalive is true, then throw a TypeError.\n if (keepalive) {\n throw new TypeError('keepalive')\n }\n\n // If object is disturbed or locked, then throw a TypeError.\n if (util.isDisturbed(object) || object.locked) {\n throw new TypeError(\n 'Response body object should not be disturbed or locked'\n )\n }\n\n stream =\n webidl.is.ReadableStream(object) ? object : ReadableStreamFrom(object)\n }\n\n // 11. If source is a byte sequence, then set action to a\n // step that returns source and length to source’s length.\n if (typeof source === 'string' || isUint8Array(source)) {\n action = () => {\n length = typeof source === 'string' ? Buffer.byteLength(source) : source.length\n return source\n }\n }\n\n // 12. If action is non-null, then run these steps in parallel:\n if (action != null) {\n ;(async () => {\n // 1. Run action.\n const result = action()\n\n // 2. Whenever one or more bytes are available and stream is not errored,\n // enqueue the result of creating a Uint8Array from the available bytes into stream.\n const iterator = result?.[Symbol.asyncIterator]?.()\n if (iterator) {\n for await (const bytes of iterator) {\n if (isErrored(stream)) break\n if (bytes.length) {\n controller.enqueue(new Uint8Array(bytes))\n }\n }\n } else if (result?.length && !isErrored(stream)) {\n controller.enqueue(typeof result === 'string' ? textEncoder.encode(result) : new Uint8Array(result))\n }\n\n // 3. When running action is done, close stream.\n queueMicrotask(() => readableStreamClose(controller))\n })()\n }\n\n // 13. Let body be a body whose stream is stream, source is source,\n // and length is length.\n const body = { stream, source, length }\n\n // 14. Return (body, type).\n return [body, type]\n}\n\n/**\n * @typedef {object} ExtractBodyResult\n * @property {ReadableStream<Uint8Array<ArrayBuffer>>} stream - The ReadableStream containing the body data\n * @property {any} source - The original source of the body data\n * @property {number | null} length - The length of the body data, or null\n */\n\n/**\n * Safely extract a body with type from a byte sequence or BodyInit object.\n *\n * @param {import('../../../types').BodyInit} object - The BodyInit object to extract from\n * @param {boolean} [keepalive=false] - If true, indicates that the body\n * @returns {[ExtractBodyResult, string | null]} - Returns a tuple containing the body and its type\n *\n * @see https://fetch.spec.whatwg.org/#bodyinit-safely-extract\n */\nfunction safelyExtractBody (object, keepalive = false) {\n // To safely extract a body and a `Content-Type` value from\n // a byte sequence or BodyInit object object, run these steps:\n\n // 1. If object is a ReadableStream object, then:\n if (webidl.is.ReadableStream(object)) {\n // Assert: object is neither disturbed nor locked.\n assert(!util.isDisturbed(object), 'The body has already been consumed.')\n assert(!object.locked, 'The stream is locked.')\n }\n\n // 2. Return the results of extracting object.\n return extractBody(object, keepalive)\n}\n\nfunction cloneBody (body) {\n // To clone a body body, run these steps:\n\n // https://fetch.spec.whatwg.org/#concept-body-clone\n\n // 1. Let « out1, out2 » be the result of teeing body’s stream.\n const { 0: out1, 1: out2 } = body.stream.tee()\n\n // 2. Set body’s stream to out1.\n body.stream = out1\n\n // 3. Return a body whose stream is out2 and other members are copied from body.\n return {\n stream: out2,\n length: body.length,\n source: body.source\n }\n}\n\nfunction bodyMixinMethods (instance, getInternalState) {\n const methods = {\n blob () {\n // The blob() method steps are to return the result of\n // running consume body with this and the following step\n // given a byte sequence bytes: return a Blob whose\n // contents are bytes and whose type attribute is this’s\n // MIME type.\n return consumeBody(this, (bytes) => {\n let mimeType = bodyMimeType(getInternalState(this))\n\n if (mimeType === null) {\n mimeType = ''\n } else if (mimeType) {\n mimeType = serializeAMimeType(mimeType)\n }\n\n // Return a Blob whose contents are bytes and type attribute\n // is mimeType.\n return new Blob([bytes], { type: mimeType })\n }, instance, getInternalState)\n },\n\n arrayBuffer () {\n // The arrayBuffer() method steps are to return the result\n // of running consume body with this and the following step\n // given a byte sequence bytes: return a new ArrayBuffer\n // whose contents are bytes.\n return consumeBody(this, (bytes) => {\n return new Uint8Array(bytes).buffer\n }, instance, getInternalState)\n },\n\n text () {\n // The text() method steps are to return the result of running\n // consume body with this and UTF-8 decode.\n return consumeBody(this, utf8DecodeBytes, instance, getInternalState)\n },\n\n json () {\n // The json() method steps are to return the result of running\n // consume body with this and parse JSON from bytes.\n return consumeBody(this, parseJSONFromBytes, instance, getInternalState)\n },\n\n formData () {\n // The formData() method steps are to return the result of running\n // consume body with this and the following step given a byte sequence bytes:\n return consumeBody(this, (value) => {\n // 1. Let mimeType be the result of get the MIME type with this.\n const mimeType = bodyMimeType(getInternalState(this))\n\n // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n // the corresponding steps:\n if (mimeType !== null) {\n switch (mimeType.essence) {\n case 'multipart/form-data': {\n // 1. ... [long step]\n // 2. If that fails for some reason, then throw a TypeError.\n const parsed = multipartFormDataParser(value, mimeType)\n\n // 3. Return a new FormData object, appending each entry,\n // resulting from the parsing operation, to its entry list.\n const fd = new FormData()\n setFormDataState(fd, parsed)\n\n return fd\n }\n case 'application/x-www-form-urlencoded': {\n // 1. Let entries be the result of parsing bytes.\n const entries = new URLSearchParams(value.toString())\n\n // 2. If entries is failure, then throw a TypeError.\n\n // 3. Return a new FormData object whose entry list is entries.\n const fd = new FormData()\n\n for (const [name, value] of entries) {\n fd.append(name, value)\n }\n\n return fd\n }\n }\n }\n\n // 3. Throw a TypeError.\n throw new TypeError(\n 'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n )\n }, instance, getInternalState)\n },\n\n bytes () {\n // The bytes() method steps are to return the result of running consume body\n // with this and the following step given a byte sequence bytes: return the\n // result of creating a Uint8Array from bytes in this’s relevant realm.\n return consumeBody(this, (bytes) => {\n return new Uint8Array(bytes)\n }, instance, getInternalState)\n }\n }\n\n return methods\n}\n\nfunction mixinBody (prototype, getInternalState) {\n Object.assign(prototype.prototype, bodyMixinMethods(prototype, getInternalState))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {any} object internal state\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {any} instance\n * @param {(target: any) => any} getInternalState\n */\nfunction consumeBody (object, convertBytesToJSValue, instance, getInternalState) {\n try {\n webidl.brandCheck(object, instance)\n } catch (e) {\n return Promise.reject(e)\n }\n\n object = getInternalState(object)\n\n // 1. If object is unusable, then return a promise rejected\n // with a TypeError.\n if (bodyUnusable(object)) {\n return Promise.reject(new TypeError('Body is unusable: Body has already been read'))\n }\n\n // 2. Let promise be a new promise.\n const promise = createDeferredPromise()\n\n // 3. Let errorSteps given error be to reject promise with error.\n const errorSteps = promise.reject\n\n // 4. Let successSteps given a byte sequence data be to resolve\n // promise with the result of running convertBytesToJSValue\n // with data. If that threw an exception, then run errorSteps\n // with that exception.\n const successSteps = (data) => {\n try {\n promise.resolve(convertBytesToJSValue(data))\n } catch (e) {\n errorSteps(e)\n }\n }\n\n // 5. If object’s body is null, then run successSteps with an\n // empty byte sequence.\n if (object.body == null) {\n successSteps(Buffer.allocUnsafe(0))\n return promise.promise\n }\n\n // 6. Otherwise, fully read object’s body given successSteps,\n // errorSteps, and object’s relevant global object.\n fullyReadBody(object.body, successSteps, errorSteps)\n\n // 7. Return promise.\n return promise.promise\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-unusable\n * @param {any} object internal state\n */\nfunction bodyUnusable (object) {\n const body = object.body\n\n // An object including the Body interface mixin is\n // said to be unusable if its body is non-null and\n // its body’s stream is disturbed or locked.\n return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {any} requestOrResponse internal state\n */\nfunction bodyMimeType (requestOrResponse) {\n // 1. Let headers be null.\n // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n /** @type {import('./headers').HeadersList} */\n const headers = requestOrResponse.headersList\n\n // 4. Let mimeType be the result of extracting a MIME type from headers.\n const mimeType = extractMimeType(headers)\n\n // 5. If mimeType is failure, then return null.\n if (mimeType === 'failure') {\n return null\n }\n\n // 6. Return mimeType.\n return mimeType\n}\n\nmodule.exports = {\n extractBody,\n safelyExtractBody,\n cloneBody,\n mixinBody,\n streamRegistry,\n bodyUnusable\n}\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n RequestContentLengthMismatchError,\n ResponseContentLengthMismatchError,\n RequestAbortedError,\n InvalidArgumentError,\n HeadersTimeoutError,\n HeadersOverflowError,\n SocketError,\n InformationalError,\n BodyTimeoutError,\n HTTPParserError,\n ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n kUrl,\n kReset,\n kClient,\n kParser,\n kBlocking,\n kRunning,\n kPending,\n kSize,\n kWriting,\n kQueue,\n kNoRef,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kSocket,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kMaxRequests,\n kCounter,\n kMaxResponseSize,\n kOnError,\n kResume,\n kHTTPContext,\n kClosed\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nfunction lazyllhttp () {\n const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n let mod\n\n // We disable wasm SIMD on ppc64 as it seems to be broken on Power 9 architectures.\n let useWasmSIMD = process.arch !== 'ppc64'\n // The Env Variable UNDICI_NO_WASM_SIMD allows explicitly overriding the default behavior\n if (process.env.UNDICI_NO_WASM_SIMD === '1') {\n useWasmSIMD = false\n } else if (process.env.UNDICI_NO_WASM_SIMD === '0') {\n useWasmSIMD = true\n }\n\n if (useWasmSIMD) {\n try {\n mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js'))\n } catch {\n }\n }\n\n if (!mod) {\n // We could check if the error was caused by the simd option not\n // being enabled, but the occurring of this other error\n // * https://github.com/emscripten-core/emscripten/issues/11495\n // got me to remove that check to avoid breaking Node 12.\n mod = new WebAssembly.Module(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n }\n\n return new WebAssembly.Instance(mod, {\n env: {\n /**\n * @param {number} p\n * @param {number} at\n * @param {number} len\n * @returns {number}\n */\n wasm_on_url: (p, at, len) => {\n return 0\n },\n /**\n * @param {number} p\n * @param {number} at\n * @param {number} len\n * @returns {number}\n */\n wasm_on_status: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len))\n },\n /**\n * @param {number} p\n * @returns {number}\n */\n wasm_on_message_begin: (p) => {\n assert(currentParser.ptr === p)\n return currentParser.onMessageBegin()\n },\n /**\n * @param {number} p\n * @param {number} at\n * @param {number} len\n * @returns {number}\n */\n wasm_on_header_field: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len))\n },\n /**\n * @param {number} p\n * @param {number} at\n * @param {number} len\n * @returns {number}\n */\n wasm_on_header_value: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len))\n },\n /**\n * @param {number} p\n * @param {number} statusCode\n * @param {0|1} upgrade\n * @param {0|1} shouldKeepAlive\n * @returns {number}\n */\n wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n assert(currentParser.ptr === p)\n return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1)\n },\n /**\n * @param {number} p\n * @param {number} at\n * @param {number} len\n * @returns {number}\n */\n wasm_on_body: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len))\n },\n /**\n * @param {number} p\n * @returns {number}\n */\n wasm_on_message_complete: (p) => {\n assert(currentParser.ptr === p)\n return currentParser.onMessageComplete()\n }\n\n }\n })\n}\n\nlet llhttpInstance = null\n\n/**\n * @type {Parser|null}\n */\nlet currentParser = null\nlet currentBufferRef = null\n/**\n * @type {number}\n */\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n /**\n * @param {import('./client.js')} client\n * @param {import('net').Socket} socket\n * @param {*} llhttp\n */\n constructor (client, socket, { exports }) {\n this.llhttp = exports\n this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n this.client = client\n /**\n * @type {import('net').Socket}\n */\n this.socket = socket\n this.timeout = null\n this.timeoutWeakRef = new WeakRef(this)\n this.timeoutValue = null\n this.timeoutType = null\n this.statusCode = 0\n this.statusText = ''\n this.upgrade = false\n this.headers = []\n this.headersSize = 0\n this.headersMaxSize = client[kMaxHeadersSize]\n this.shouldKeepAlive = false\n this.paused = false\n this.resume = this.resume.bind(this)\n\n this.bytesRead = 0\n\n this.keepAlive = ''\n this.contentLength = ''\n this.connection = ''\n this.maxResponseSize = client[kMaxResponseSize]\n }\n\n setTimeout (delay, type) {\n // If the existing timer and the new timer are of different timer type\n // (fast or native) or have different delay, we need to clear the existing\n // timer and set a new one.\n if (\n delay !== this.timeoutValue ||\n (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n ) {\n // If a timeout is already set, clear it with clearTimeout of the fast\n // timer implementation, as it can clear fast and native timers.\n if (this.timeout) {\n timers.clearTimeout(this.timeout)\n this.timeout = null\n }\n\n if (delay) {\n if (type & USE_FAST_TIMER) {\n this.timeout = timers.setFastTimeout(onParserTimeout, delay, this.timeoutWeakRef)\n } else {\n this.timeout = setTimeout(onParserTimeout, delay, this.timeoutWeakRef)\n this.timeout?.unref()\n }\n }\n\n this.timeoutValue = delay\n } else if (this.timeout) {\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.timeoutType = type\n }\n\n resume () {\n if (this.socket.destroyed || !this.paused) {\n return\n }\n\n assert(this.ptr != null)\n assert(currentParser === null)\n\n this.llhttp.llhttp_resume(this.ptr)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.paused = false\n this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n this.readMore()\n }\n\n readMore () {\n while (!this.paused && this.ptr) {\n const chunk = this.socket.read()\n if (chunk === null) {\n break\n }\n this.execute(chunk)\n }\n }\n\n /**\n * @param {Buffer} chunk\n */\n execute (chunk) {\n assert(currentParser === null)\n assert(this.ptr != null)\n assert(!this.paused)\n\n const { socket, llhttp } = this\n\n // Allocate a new buffer if the current buffer is too small.\n if (chunk.length > currentBufferSize) {\n if (currentBufferPtr) {\n llhttp.free(currentBufferPtr)\n }\n // Allocate a buffer that is a multiple of 4096 bytes.\n currentBufferSize = Math.ceil(chunk.length / 4096) * 4096\n currentBufferPtr = llhttp.malloc(currentBufferSize)\n }\n\n new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(chunk)\n\n // Call `execute` on the wasm parser.\n // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n // and finally the length of bytes to parse.\n // The return value is an error code or `constants.ERROR.OK`.\n try {\n let ret\n\n try {\n currentBufferRef = chunk\n currentParser = this\n ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, chunk.length)\n } finally {\n currentParser = null\n currentBufferRef = null\n }\n\n if (ret !== constants.ERROR.OK) {\n const data = chunk.subarray(llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr)\n\n if (ret === constants.ERROR.PAUSED_UPGRADE) {\n this.onUpgrade(data)\n } else if (ret === constants.ERROR.PAUSED) {\n this.paused = true\n socket.unshift(data)\n } else {\n throw this.createError(ret, data)\n }\n }\n } catch (err) {\n util.destroy(socket, err)\n }\n }\n\n finish () {\n assert(currentParser === null)\n assert(this.ptr != null)\n assert(!this.paused)\n\n const { llhttp } = this\n\n let ret\n\n try {\n currentParser = this\n ret = llhttp.llhttp_finish(this.ptr)\n } finally {\n currentParser = null\n }\n\n if (ret === constants.ERROR.OK) {\n return null\n }\n\n if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n this.paused = true\n return null\n }\n\n return this.createError(ret, EMPTY_BUF)\n }\n\n createError (ret, data) {\n const { llhttp, contentLength, bytesRead } = this\n\n if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n return new ResponseContentLengthMismatchError()\n }\n\n const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n let message = ''\n if (ptr) {\n const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n message =\n 'Response does not match the HTTP/1.1 protocol (' +\n Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n ')'\n }\n\n return new HTTPParserError(message, constants.ERROR[ret], data)\n }\n\n destroy () {\n assert(currentParser === null)\n assert(this.ptr != null)\n\n this.llhttp.llhttp_free(this.ptr)\n this.ptr = null\n\n this.timeout && timers.clearTimeout(this.timeout)\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n\n this.paused = false\n }\n\n /**\n * @param {Buffer} buf\n * @returns {0}\n */\n onStatus (buf) {\n this.statusText = buf.toString()\n return 0\n }\n\n /**\n * @returns {0|-1}\n */\n onMessageBegin () {\n const { socket, client } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n if (client[kRunning] === 0) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n if (!request) {\n return -1\n }\n request.onResponseStarted()\n\n return 0\n }\n\n /**\n * @param {Buffer} buf\n * @returns {number}\n */\n onHeaderField (buf) {\n const len = this.headers.length\n\n if ((len & 1) === 0) {\n this.headers.push(buf)\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n this.trackHeader(buf.length)\n\n return 0\n }\n\n /**\n * @param {Buffer} buf\n * @returns {number}\n */\n onHeaderValue (buf) {\n let len = this.headers.length\n\n if ((len & 1) === 1) {\n this.headers.push(buf)\n len += 1\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n const key = this.headers[len - 2]\n if (key.length === 10) {\n const headerName = util.bufferToLowerCasedHeaderName(key)\n if (headerName === 'keep-alive') {\n this.keepAlive += buf.toString()\n } else if (headerName === 'connection') {\n this.connection += buf.toString()\n }\n } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n this.contentLength += buf.toString()\n }\n\n this.trackHeader(buf.length)\n\n return 0\n }\n\n /**\n * @param {number} len\n */\n trackHeader (len) {\n this.headersSize += len\n if (this.headersSize >= this.headersMaxSize) {\n util.destroy(this.socket, new HeadersOverflowError())\n }\n }\n\n /**\n * @param {Buffer} head\n */\n onUpgrade (head) {\n const { upgrade, client, socket, headers, statusCode } = this\n\n assert(upgrade)\n assert(client[kSocket] === socket)\n assert(!socket.destroyed)\n assert(!this.paused)\n assert((headers.length & 1) === 0)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n assert(request.upgrade || request.method === 'CONNECT')\n\n this.statusCode = 0\n this.statusText = ''\n this.shouldKeepAlive = false\n\n this.headers = []\n this.headersSize = 0\n\n socket.unshift(head)\n\n socket[kParser].destroy()\n socket[kParser] = null\n\n socket[kClient] = null\n socket[kError] = null\n\n removeAllListeners(socket)\n\n client[kSocket] = null\n client[kHTTPContext] = null // TODO (fix): This is hacky...\n client[kQueue][client[kRunningIdx]++] = null\n client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n try {\n request.onUpgrade(statusCode, headers, socket)\n } catch (err) {\n util.destroy(socket, err)\n }\n\n client[kResume]()\n }\n\n /**\n * @param {number} statusCode\n * @param {boolean} upgrade\n * @param {boolean} shouldKeepAlive\n * @returns {number}\n */\n onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n const { client, socket, headers, statusText } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n if (client[kRunning] === 0) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n\n if (!request) {\n return -1\n }\n\n assert(!this.upgrade)\n assert(this.statusCode < 200)\n\n if (statusCode === 100) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n /* this can only happen if server is misbehaving */\n if (upgrade && !request.upgrade) {\n util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n return -1\n }\n\n assert(this.timeoutType === TIMEOUT_HEADERS)\n\n this.statusCode = statusCode\n this.shouldKeepAlive = (\n shouldKeepAlive ||\n // Override llhttp value which does not allow keepAlive for HEAD.\n (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n )\n\n if (this.statusCode >= 200) {\n const bodyTimeout = request.bodyTimeout != null\n ? request.bodyTimeout\n : client[kBodyTimeout]\n this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n } else if (this.timeout) {\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n if (request.method === 'CONNECT') {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n if (upgrade) {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n assert((this.headers.length & 1) === 0)\n this.headers = []\n this.headersSize = 0\n\n if (this.shouldKeepAlive && client[kPipelining]) {\n const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n if (keepAliveTimeout != null) {\n const timeout = Math.min(\n keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n client[kKeepAliveMaxTimeout]\n )\n if (timeout <= 0) {\n socket[kReset] = true\n } else {\n client[kKeepAliveTimeoutValue] = timeout\n }\n } else {\n client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n }\n } else {\n // Stop more requests from being dispatched.\n socket[kReset] = true\n }\n\n const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n if (request.aborted) {\n return -1\n }\n\n if (request.method === 'HEAD') {\n return 1\n }\n\n if (statusCode < 200) {\n return 1\n }\n\n if (socket[kBlocking]) {\n socket[kBlocking] = false\n client[kResume]()\n }\n\n return pause ? constants.ERROR.PAUSED : 0\n }\n\n /**\n * @param {Buffer} buf\n * @returns {number}\n */\n onBody (buf) {\n const { client, socket, statusCode, maxResponseSize } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n assert(statusCode >= 200)\n\n if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n util.destroy(socket, new ResponseExceededMaxSizeError())\n return -1\n }\n\n this.bytesRead += buf.length\n\n if (request.onData(buf) === false) {\n return constants.ERROR.PAUSED\n }\n\n return 0\n }\n\n /**\n * @returns {number}\n */\n onMessageComplete () {\n const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n return -1\n }\n\n if (upgrade) {\n return 0\n }\n\n assert(statusCode >= 100)\n assert((this.headers.length & 1) === 0)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n this.statusCode = 0\n this.statusText = ''\n this.bytesRead = 0\n this.contentLength = ''\n this.keepAlive = ''\n this.connection = ''\n\n this.headers = []\n this.headersSize = 0\n\n if (statusCode < 200) {\n return 0\n }\n\n if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n util.destroy(socket, new ResponseContentLengthMismatchError())\n return -1\n }\n\n request.onComplete(headers)\n\n client[kQueue][client[kRunningIdx]++] = null\n socket[kSocketUsed] = client[kPending] === 0\n\n if (socket[kWriting]) {\n assert(client[kRunning] === 0)\n // Response completed before request.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (!shouldKeepAlive) {\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (socket[kReset] && client[kRunning] === 0) {\n // Destroy socket once all requests have completed.\n // The request at the tail of the pipeline is the one\n // that requested reset and no further requests should\n // have been queued since then.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n // We must wait a full event loop cycle to reuse this socket to make sure\n // that non-spec compliant servers are not closing the connection even if they\n // said they won't.\n setImmediate(client[kResume])\n } else {\n client[kResume]()\n }\n\n return 0\n }\n}\n\nfunction onParserTimeout (parserWeakRef) {\n const parser = parserWeakRef.deref()\n if (!parser) {\n return\n }\n\n const { socket, timeoutType, client, paused } = parser\n\n if (timeoutType === TIMEOUT_HEADERS) {\n if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n assert(!paused, 'cannot be paused while waiting for headers')\n util.destroy(socket, new HeadersTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_BODY) {\n if (!paused) {\n util.destroy(socket, new BodyTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n util.destroy(socket, new InformationalError('socket idle timeout'))\n }\n}\n\n/**\n * @param {import ('./client.js')} client\n * @param {import('net').Socket} socket\n * @returns\n */\nfunction connectH1 (client, socket) {\n client[kSocket] = socket\n\n if (!llhttpInstance) {\n llhttpInstance = lazyllhttp()\n }\n\n if (socket.errored) {\n throw socket.errored\n }\n\n if (socket.destroyed) {\n throw new SocketError('destroyed')\n }\n\n socket[kNoRef] = false\n socket[kWriting] = false\n socket[kReset] = false\n socket[kBlocking] = false\n socket[kIdleSocketValidation] = 0\n socket[kIdleSocketValidationTimeout] = null\n socket[kSocketUsed] = false\n socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n util.addListener(socket, 'error', onHttpSocketError)\n util.addListener(socket, 'readable', onHttpSocketReadable)\n util.addListener(socket, 'end', onHttpSocketEnd)\n util.addListener(socket, 'close', onHttpSocketClose)\n\n socket[kClosed] = false\n socket.on('close', onSocketClose)\n\n return {\n version: 'h1',\n defaultPipelining: 1,\n write (request) {\n return writeH1(client, request)\n },\n resume () {\n resumeH1(client)\n },\n /**\n * @param {Error|undefined} err\n * @param {() => void} callback\n */\n destroy (err, callback) {\n if (socket[kClosed]) {\n queueMicrotask(callback)\n } else {\n socket.on('close', callback)\n socket.destroy(err)\n }\n },\n /**\n * @returns {boolean}\n */\n get destroyed () {\n return socket.destroyed\n },\n /**\n * @param {import('../core/request.js')} request\n * @returns {boolean}\n */\n busy (request) {\n if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n return true\n }\n\n if (request) {\n if (client[kRunning] > 0 && !request.idempotent) {\n // Non-idempotent request cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return true\n }\n\n if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n // Don't dispatch an upgrade until all preceding requests have completed.\n // A misbehaving server might upgrade the connection before all pipelined\n // request has completed.\n return true\n }\n\n if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n // Request with stream or iterator body can error while other requests\n // are inflight and indirectly error those as well.\n // Ensure this doesn't happen by waiting for inflight\n // to complete before dispatching.\n\n // Request with stream or iterator body cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return true\n }\n }\n\n return false\n }\n }\n}\n\nfunction onHttpSocketError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n const parser = this[kParser]\n\n // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n // to the user.\n if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n const parserErr = parser.finish()\n if (parserErr) {\n this[kError] = parserErr\n this[kClient][kOnError](parserErr)\n }\n return\n }\n\n this[kError] = err\n\n this[kClient][kOnError](err)\n}\n\nfunction onHttpSocketReadable () {\n this[kParser]?.readMore()\n}\n\nfunction onHttpSocketEnd () {\n const parser = this[kParser]\n\n if (parser.statusCode && !parser.shouldKeepAlive) {\n const parserErr = parser.finish()\n if (parserErr) {\n util.destroy(this, parserErr)\n }\n return\n }\n\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n}\n\nfunction onHttpSocketClose () {\n const parser = this[kParser]\n\n clearIdleSocketValidation(this)\n\n if (parser) {\n if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n this[kError] = parser.finish() || this[kError]\n }\n\n this[kParser].destroy()\n this[kParser] = null\n }\n\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n const client = this[kClient]\n\n client[kSocket] = null\n client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n util.errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n}\n\nfunction onSocketClose () {\n this[kClosed] = true\n}\n\nfunction clearIdleSocketValidation (socket) {\n if (socket[kIdleSocketValidationTimeout]) {\n clearImmediate(socket[kIdleSocketValidationTimeout])\n socket[kIdleSocketValidationTimeout] = null\n }\n\n socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n socket[kIdleSocketValidation] = 1\n // Yield to the check phase (after poll) so unsolicited bytes / FIN / RST\n // already pending on this idle keep-alive socket are processed before the\n // next request is written (GHSA-35p6-xmwp-9g52).\n //\n // setTimeout(0) pays Node's ~1ms timer floor on every sequential reuse\n // (#5493). setImmediate avoids that, but an *unref'd* Immediate lets poll\n // block for ~500ms when the event loop is otherwise idle (#5600 / #5606).\n // A ref'd Immediate both keeps the pending request alive and makes poll\n // return immediately — the hybrid those issues asked for.\n socket[kIdleSocketValidationTimeout] = setImmediate(() => {\n socket[kIdleSocketValidationTimeout] = null\n socket[kIdleSocketValidation] = 2\n\n if (client[kSocket] === socket && !socket.destroyed) {\n client[kResume]()\n }\n })\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n const socket = client[kSocket]\n\n if (socket && !socket.destroyed) {\n if (client[kSize] === 0) {\n if (!socket[kNoRef] && socket.unref) {\n socket.unref()\n socket[kNoRef] = true\n }\n } else if (socket[kNoRef] && socket.ref) {\n socket.ref()\n socket[kNoRef] = false\n }\n\n if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n if (socket[kIdleSocketValidation] === 0) {\n scheduleIdleSocketValidation(client, socket)\n socket[kParser].readMore()\n if (socket.destroyed) {\n return\n }\n return\n }\n\n if (socket[kIdleSocketValidation] === 1) {\n socket[kParser].readMore()\n if (socket.destroyed) {\n return\n }\n return\n }\n }\n\n if (client[kRunning] === 0) {\n socket[kParser].readMore()\n if (socket.destroyed) {\n return\n }\n }\n\n if (client[kSize] === 0) {\n if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n }\n } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n const request = client[kQueue][client[kRunningIdx]]\n const headersTimeout = request.headersTimeout != null\n ? request.headersTimeout\n : client[kHeadersTimeout]\n socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n }\n }\n }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\n/**\n * @param {import('./client.js')} client\n * @param {import('../core/request.js')} request\n * @returns\n */\nfunction writeH1 (client, request) {\n const { method, path, host, upgrade, blocking, reset } = request\n\n let { body, headers, contentLength } = request\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH' ||\n method === 'QUERY' ||\n method === 'PROPFIND' ||\n method === 'PROPPATCH'\n )\n\n if (util.isFormDataLike(body)) {\n if (!extractBody) {\n extractBody = require('../web/fetch/body.js').extractBody\n }\n\n const [bodyStream, contentType] = extractBody(body)\n if (request.contentType == null) {\n headers.push('content-type', contentType)\n }\n body = bodyStream.stream\n contentLength = bodyStream.length\n } else if (util.isBlobLike(body) && request.contentType == null) {\n const contentType = body.type\n if (contentType) {\n const contentTypeValue = `${contentType}`\n if (!util.isValidHeaderValue(contentTypeValue)) {\n util.errorRequest(client, request, new InvalidArgumentError('invalid content-type header'))\n return false\n }\n headers.push('content-type', contentTypeValue)\n }\n }\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n const bodyLength = util.bodyLength(body)\n\n contentLength = bodyLength ?? contentLength\n\n if (contentLength === null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 && !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n util.errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n const socket = client[kSocket]\n clearIdleSocketValidation(socket)\n\n /**\n * @param {Error} [err]\n * @returns {void}\n */\n const abort = (err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n util.errorRequest(client, request, err || new RequestAbortedError())\n\n util.destroy(body)\n util.destroy(socket, new InformationalError('aborted'))\n }\n\n try {\n request.onConnect(abort)\n } catch (err) {\n util.errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'HEAD') {\n // https://github.com/mcollina/undici/issues/258\n // Close after a HEAD request to interop with misbehaving servers\n // that may send a body in the response.\n\n socket[kReset] = true\n }\n\n if (upgrade || method === 'CONNECT') {\n // On CONNECT or upgrade, block pipeline from dispatching further\n // requests on this connection.\n\n socket[kReset] = true\n }\n\n if (reset != null) {\n socket[kReset] = reset\n }\n\n if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n socket[kReset] = true\n }\n\n if (blocking) {\n socket[kBlocking] = true\n }\n\n if (socket.setTypeOfService) {\n socket.setTypeOfService(request.typeOfService)\n }\n\n let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n if (typeof host === 'string') {\n header += `host: ${host}\\r\\n`\n } else {\n header += client[kHostHeader]\n }\n\n if (upgrade) {\n header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n } else if (client[kPipelining] && !socket[kReset]) {\n header += 'connection: keep-alive\\r\\n'\n } else {\n header += 'connection: close\\r\\n'\n }\n\n if (Array.isArray(headers)) {\n for (let n = 0; n < headers.length; n += 2) {\n const key = headers[n + 0]\n const val = headers[n + 1]\n\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n header += `${key}: ${val[i]}\\r\\n`\n }\n } else {\n header += `${key}: ${val}\\r\\n`\n }\n }\n }\n\n if (channels.sendHeaders.hasSubscribers) {\n channels.sendHeaders.publish({ request, headers: header, socket })\n }\n\n if (!body || bodyLength === 0) {\n writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isBuffer(body)) {\n writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n } else {\n writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n }\n } else if (util.isStream(body)) {\n writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isIterable(body)) {\n writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else {\n assert(false)\n }\n\n return true\n}\n\n/**\n * @param {AbortCallback} abort\n * @param {import('stream').Stream} body\n * @param {import('./client.js')} client\n * @param {import('../core/request.js')} request\n * @param {import('net').Socket} socket\n * @param {number} contentLength\n * @param {string} header\n * @param {boolean} expectsPayload\n */\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n let finished = false\n\n const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n /**\n * @param {Buffer} chunk\n * @returns {void}\n */\n const onData = function (chunk) {\n if (finished) {\n return\n }\n\n try {\n if (!writer.write(chunk) && this.pause) {\n this.pause()\n }\n } catch (err) {\n util.destroy(this, err)\n }\n }\n\n /**\n * @returns {void}\n */\n const onDrain = function () {\n if (finished) {\n return\n }\n\n if (body.resume) {\n body.resume()\n }\n }\n\n /**\n * @returns {void}\n */\n const onClose = function () {\n // 'close' might be emitted *before* 'error' for\n // broken streams. Wait a tick to avoid this case.\n queueMicrotask(() => {\n // It's only safe to remove 'error' listener after\n // 'close'.\n body.removeListener('error', onFinished)\n })\n\n if (!finished) {\n const err = new RequestAbortedError()\n queueMicrotask(() => onFinished(err))\n }\n }\n\n /**\n * @param {Error} [err]\n * @returns\n */\n const onFinished = function (err) {\n if (finished) {\n return\n }\n\n finished = true\n\n assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n socket\n .off('drain', onDrain)\n .off('error', onFinished)\n\n body\n .removeListener('data', onData)\n .removeListener('end', onFinished)\n .removeListener('close', onClose)\n\n if (!err) {\n try {\n writer.end()\n } catch (er) {\n err = er\n }\n }\n\n writer.destroy(err)\n\n if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n util.destroy(body, err)\n } else {\n util.destroy(body)\n }\n }\n\n body\n .on('data', onData)\n .on('end', onFinished)\n .on('error', onFinished)\n .on('close', onClose)\n\n if (body.resume) {\n body.resume()\n }\n\n socket\n .on('drain', onDrain)\n .on('error', onFinished)\n\n if (body.errorEmitted ?? body.errored) {\n setImmediate(onFinished, body.errored)\n } else if (body.endEmitted ?? body.readableEnded) {\n setImmediate(onFinished, null)\n }\n\n if (body.closeEmitted ?? body.closed) {\n setImmediate(onClose)\n }\n}\n\n/**\n * @typedef AbortCallback\n * @type {Function}\n * @param {Error} [err]\n * @returns {void}\n */\n\n/**\n * @param {AbortCallback} abort\n * @param {Uint8Array|null} body\n * @param {import('./client.js')} client\n * @param {import('../core/request.js')} request\n * @param {import('net').Socket} socket\n * @param {number} contentLength\n * @param {string} header\n * @param {boolean} expectsPayload\n * @returns {void}\n */\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n try {\n if (!body) {\n if (contentLength === 0) {\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n assert(contentLength === null, 'no body must not have content length')\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(body)\n socket.uncork()\n request.onBodySent(body)\n\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n }\n request.onRequestSent()\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\n/**\n * @param {AbortCallback} abort\n * @param {Blob} body\n * @param {import('./client.js')} client\n * @param {import('../core/request.js')} request\n * @param {import('net').Socket} socket\n * @param {number} contentLength\n * @param {string} header\n * @param {boolean} expectsPayload\n * @returns {Promise<void>}\n */\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(buffer)\n socket.uncork()\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\n/**\n * @param {AbortCallback} abort\n * @param {Iterable} body\n * @param {import('./client.js')} client\n * @param {import('../core/request.js')} request\n * @param {import('net').Socket} socket\n * @param {number} contentLength\n * @param {string} header\n * @param {boolean} expectsPayload\n * @returns {Promise<void>}\n */\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n socket\n .on('close', onDrain)\n .on('drain', onDrain)\n\n const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (!writer.write(chunk)) {\n await waitForDrain()\n }\n }\n\n writer.end()\n } catch (err) {\n writer.destroy(err)\n } finally {\n socket\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nclass AsyncWriter {\n /**\n *\n * @param {object} arg\n * @param {AbortCallback} arg.abort\n * @param {import('net').Socket} arg.socket\n * @param {import('../core/request.js')} arg.request\n * @param {number} arg.contentLength\n * @param {import('./client.js')} arg.client\n * @param {boolean} arg.expectsPayload\n * @param {string} arg.header\n */\n constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n this.socket = socket\n this.request = request\n this.contentLength = contentLength\n this.client = client\n this.bytesWritten = 0\n this.expectsPayload = expectsPayload\n this.header = header\n this.abort = abort\n\n socket[kWriting] = true\n }\n\n /**\n * @param {Buffer} chunk\n * @returns\n */\n write (chunk) {\n const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return false\n }\n\n const len = Buffer.byteLength(chunk)\n if (!len) {\n return true\n }\n\n // We should defer writing chunks.\n if (contentLength !== null && bytesWritten + len > contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n socket.cork()\n\n if (bytesWritten === 0) {\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n\n if (contentLength === null) {\n socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n }\n }\n\n if (contentLength === null) {\n socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n }\n\n this.bytesWritten += len\n\n const ret = socket.write(chunk)\n\n socket.uncork()\n\n request.onBodySent(chunk)\n\n if (!ret) {\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n }\n\n return ret\n }\n\n /**\n * @returns {void}\n */\n end () {\n const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n request.onRequestSent()\n\n socket[kWriting] = false\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return\n }\n\n if (bytesWritten === 0) {\n if (expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body.\n\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (contentLength === null) {\n socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n }\n\n if (contentLength !== null && bytesWritten !== contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n } else {\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n }\n\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n\n client[kResume]()\n }\n\n /**\n * @param {Error} [err]\n * @returns {void}\n */\n destroy (err) {\n const { socket, client, abort } = this\n\n socket[kWriting] = false\n\n if (err) {\n assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n abort(err)\n }\n }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n RequestContentLengthMismatchError,\n RequestAbortedError,\n SocketError,\n InformationalError,\n InvalidArgumentError,\n HeadersTimeoutError,\n BodyTimeoutError\n} = require('../core/errors.js')\nconst {\n kUrl,\n kReset,\n kClient,\n kRunning,\n kPending,\n kQueue,\n kPendingIdx,\n kRunningIdx,\n kError,\n kSocket,\n kStrictContentLength,\n kOnError,\n kMaxConcurrentStreams,\n kPingInterval,\n kHTTP2Session,\n kHTTP2InitialWindowSize,\n kHTTP2ConnectionWindowSize,\n kResume,\n kSize,\n kHTTPContext,\n kClosed,\n kBodyTimeout,\n kHeadersTimeout,\n kEnableConnectProtocol,\n kRemoteSettings,\n kHTTP2Stream,\n kHTTP2SessionState\n} = require('../core/symbols.js')\nconst { channels } = require('../core/diagnostics.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n/** @type {import('http2')} */\nlet http2\ntry {\n http2 = require('node:http2')\n} catch {\n // @ts-ignore\n http2 = { constants: {} }\n}\n\nconst {\n constants: {\n HTTP2_HEADER_AUTHORITY,\n HTTP2_HEADER_METHOD,\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_SCHEME,\n HTTP2_HEADER_CONTENT_LENGTH,\n HTTP2_HEADER_EXPECT,\n HTTP2_HEADER_STATUS,\n HTTP2_HEADER_PROTOCOL,\n NGHTTP2_REFUSED_STREAM,\n NGHTTP2_CANCEL\n }\n} = http2\n\nfunction parseH2Headers (headers) {\n const result = []\n\n for (const [name, value] of Object.entries(headers)) {\n // h2 may concat the header value by array\n // e.g. Set-Cookie\n if (Array.isArray(value)) {\n for (const subvalue of value) {\n // we need to provide each header value of header name\n // because the headers handler expect name-value pair\n result.push(Buffer.from(name), Buffer.from(subvalue))\n }\n } else {\n result.push(Buffer.from(name), Buffer.from(value))\n }\n }\n\n return result\n}\n\nfunction connectH2 (client, socket) {\n client[kSocket] = socket\n\n const http2InitialWindowSize = client[kHTTP2InitialWindowSize]\n const http2ConnectionWindowSize = client[kHTTP2ConnectionWindowSize]\n\n const session = http2.connect(client[kUrl], {\n createConnection: () => socket,\n peerMaxConcurrentStreams: client[kMaxConcurrentStreams],\n settings: {\n // TODO(metcoder95): add support for PUSH\n enablePush: false,\n ...(http2InitialWindowSize != null ? { initialWindowSize: http2InitialWindowSize } : null)\n }\n })\n\n client[kSocket] = socket\n session[kOpenStreams] = 0\n session[kClient] = client\n session[kSocket] = socket\n session[kHTTP2SessionState] = {\n ping: {\n interval: client[kPingInterval] === 0 ? null : setInterval(onHttp2SendPing, client[kPingInterval], session).unref()\n }\n }\n // We set it to true by default in a best-effort; however once connected to an H2 server\n // we will check if extended CONNECT protocol is supported or not\n // and set this value accordingly.\n session[kEnableConnectProtocol] = false\n // States whether or not we have received the remote settings from the server\n session[kRemoteSettings] = false\n\n // Apply connection-level flow control once connected (if supported).\n if (http2ConnectionWindowSize) {\n util.addListener(session, 'connect', applyConnectionWindowSize.bind(session, http2ConnectionWindowSize))\n }\n\n util.addListener(session, 'error', onHttp2SessionError)\n util.addListener(session, 'frameError', onHttp2FrameError)\n util.addListener(session, 'end', onHttp2SessionEnd)\n util.addListener(session, 'goaway', onHttp2SessionGoAway)\n util.addListener(session, 'close', onHttp2SessionClose)\n util.addListener(session, 'remoteSettings', onHttp2RemoteSettings)\n // TODO (@metcoder95): implement SETTINGS support\n // util.addListener(session, 'localSettings', onHttp2RemoteSettings)\n\n session.unref()\n\n client[kHTTP2Session] = session\n socket[kHTTP2Session] = session\n\n util.addListener(socket, 'error', onHttp2SocketError)\n util.addListener(socket, 'end', onHttp2SocketEnd)\n util.addListener(socket, 'close', onHttp2SocketClose)\n\n socket[kClosed] = false\n socket.on('close', onSocketClose)\n\n return {\n version: 'h2',\n defaultPipelining: Infinity,\n /**\n * @param {import('../core/request.js')} request\n * @returns {boolean}\n */\n write (request) {\n return writeH2(client, request)\n },\n /**\n * @returns {void}\n */\n resume () {\n resumeH2(client)\n },\n /**\n * @param {Error | null} err\n * @param {() => void} callback\n */\n destroy (err, callback) {\n if (socket[kClosed]) {\n queueMicrotask(callback)\n } else {\n socket.destroy(err).on('close', callback)\n }\n },\n /**\n * @type {boolean}\n */\n get destroyed () {\n return socket.destroyed\n },\n /**\n * @param {import('../core/request.js')} request\n * @returns {boolean}\n */\n busy (request) {\n if (request != null) {\n if (client[kRunning] > 0) {\n // We are already processing requests\n\n // Non-idempotent request cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n if (request.idempotent === false) return true\n // Don't dispatch an upgrade until all preceding requests have completed.\n // Possibly, we do not have remote settings confirmed yet.\n if ((request.upgrade === 'websocket' || request.method === 'CONNECT') && session[kRemoteSettings] === false) return true\n // Request with stream or iterator body can error while other requests\n // are inflight and indirectly error those as well.\n // Ensure this doesn't happen by waiting for inflight\n // to complete before dispatching.\n\n // Request with stream or iterator body cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n if (util.bodyLength(request.body) !== 0 &&\n (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) return true\n } else {\n return (request.upgrade === 'websocket' || request.method === 'CONNECT') && session[kRemoteSettings] === false\n }\n }\n\n return false\n }\n }\n}\n\nfunction resumeH2 (client) {\n const socket = client[kSocket]\n\n if (socket?.destroyed === false) {\n // Only let the process exit when there is genuinely nothing outstanding.\n // Unreffing because the peer advertised MAX_CONCURRENT_STREAMS = 0 left\n // queued requests with nothing holding the event loop open, so the process\n // could exit with status 0 while an awaited request never settled.\n if (client[kSize] === 0) {\n socket.unref()\n client[kHTTP2Session].unref()\n } else {\n socket.ref()\n client[kHTTP2Session].ref()\n }\n }\n}\n\nfunction applyConnectionWindowSize (connectionWindowSize) {\n try {\n if (typeof this.setLocalWindowSize === 'function') {\n this.setLocalWindowSize(connectionWindowSize)\n }\n } catch {\n // Best-effort only.\n }\n}\n\nfunction onHttp2RemoteSettings (settings) {\n // Fallbacks are a safe bet, remote setting will always override\n this[kClient][kMaxConcurrentStreams] = settings.maxConcurrentStreams ?? this[kClient][kMaxConcurrentStreams]\n /**\n * From RFC-8441\n * A sender MUST NOT send a SETTINGS_ENABLE_CONNECT_PROTOCOL parameter\n * with the value of 0 after previously sending a value of 1.\n */\n // Note: Cannot be tested in Node, it does not supports disabling the extended CONNECT protocol once enabled\n if (this[kRemoteSettings] === true && this[kEnableConnectProtocol] === true && settings.enableConnectProtocol === false) {\n const err = new InformationalError('HTTP/2: Server disabled extended CONNECT protocol against RFC-8441')\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n return\n }\n\n this[kEnableConnectProtocol] = settings.enableConnectProtocol ?? this[kEnableConnectProtocol]\n this[kRemoteSettings] = true\n this[kClient][kResume]()\n}\n\nfunction onHttp2SendPing (session) {\n const state = session[kHTTP2SessionState]\n if ((session.closed || session.destroyed) && state.ping.interval != null) {\n clearInterval(state.ping.interval)\n state.ping.interval = null\n return\n }\n\n // If no ping sent, do nothing\n session.ping(onPing.bind(session))\n\n function onPing (err, duration) {\n const client = this[kClient]\n const socket = this[kClient]\n\n if (err != null) {\n const error = new InformationalError(`HTTP/2: \"PING\" errored - type ${err.message}`)\n socket[kError] = error\n client[kOnError](error)\n } else {\n client.emit('ping', duration)\n }\n }\n}\n\nfunction onHttp2SessionError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n if (id === 0) {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n }\n}\n\nfunction onHttp2SessionEnd () {\n const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n this.destroy(err)\n util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n *\n * @this {import('http2').ClientHttp2Session}\n * @param {number} errorCode\n */\n// Backport of #5410 and #5569. HTTP/2 multiplexes, so requests complete out of\n// order; advancing kRunningIdx blindly retired whichever request happened to\n// sit at the head instead of the one that actually finished, which both lost\n// requests and left phantom running slots behind.\nfunction completeRequest (client, request, resetPendingIdx = false) {\n const queue = client[kQueue]\n const runningIdx = client[kRunningIdx]\n\n // In-order completion: clear the request and advance without splicing.\n // The client's resume loop compacts cleared slots once the index grows.\n if (runningIdx < client[kPendingIdx] && queue[runningIdx] === request) {\n queue[runningIdx] = null\n client[kRunningIdx] = runningIdx + 1\n return\n }\n\n const index = queue.indexOf(request, runningIdx)\n\n if (index === -1 || index >= client[kPendingIdx]) {\n return\n }\n\n queue.splice(index, 1)\n client[kPendingIdx]--\n\n if (resetPendingIdx && client[kPendingIdx] < client[kRunningIdx]) {\n client[kPendingIdx] = client[kRunningIdx]\n }\n}\n\nfunction onHttp2SessionGoAway (errorCode) {\n // TODO(mcollina): Verify if GOAWAY implements the spec correctly:\n // https://datatracker.ietf.org/doc/html/rfc7540#section-6.8\n // Specifically, we do not verify the \"valid\" stream id.\n\n const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${errorCode}`, util.getSocketInfo(this[kSocket]))\n const client = this[kClient]\n\n client[kSocket] = null\n client[kHTTPContext] = null\n\n // this is an HTTP2 session\n this.close()\n this[kHTTP2Session] = null\n\n util.destroy(this[kSocket], err)\n\n // Fail head of pipeline.\n if (client[kRunningIdx] < client[kQueue].length) {\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n if (request != null) {\n util.errorRequest(client, request, err)\n }\n client[kPendingIdx] = client[kRunningIdx]\n }\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n client.emit('connectionError', client[kUrl], [client], err)\n\n client[kResume]()\n}\n\nfunction onHttp2SessionClose () {\n const { [kClient]: client, [kHTTP2SessionState]: state } = this\n const { [kSocket]: socket } = client\n\n const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n client[kSocket] = null\n client[kHTTPContext] = null\n\n if (state.ping.interval != null) {\n clearInterval(state.ping.interval)\n state.ping.interval = null\n }\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n if (request != null) {\n util.errorRequest(client, request, err)\n }\n }\n }\n}\n\nfunction onHttp2SocketClose () {\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n const client = this[kHTTP2Session][kClient]\n\n client[kSocket] = null\n client[kHTTPContext] = null\n\n if (this[kHTTP2Session] !== null) {\n this[kHTTP2Session].destroy(err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n}\n\nfunction onHttp2SocketError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kError] = err\n\n this[kClient][kOnError](err)\n}\n\nfunction onHttp2SocketEnd () {\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n}\n\nfunction onSocketClose () {\n this[kClosed] = true\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n // Time to the response headers, then time between body chunks. Using\n // bodyTimeout for both made headersTimeout a no-op over HTTP/2.\n const headersTimeout = request.headersTimeout ?? client[kHeadersTimeout]\n const bodyTimeout = request.bodyTimeout ?? client[kBodyTimeout]\n const session = client[kHTTP2Session]\n const { method, path, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request\n let { body } = request\n\n if (upgrade != null && upgrade !== 'websocket') {\n util.errorRequest(client, request, new InvalidArgumentError(`Custom upgrade \"${upgrade}\" not supported over HTTP/2`))\n return false\n }\n\n const headers = {}\n for (let n = 0; n < reqHeaders.length; n += 2) {\n const key = reqHeaders[n + 0]\n const val = reqHeaders[n + 1]\n\n if (key === 'cookie') {\n if (headers[key] != null) {\n headers[key] = Array.isArray(headers[key]) ? (headers[key].push(val), headers[key]) : [headers[key], val]\n } else {\n headers[key] = val\n }\n\n continue\n }\n\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n if (headers[key]) {\n headers[key] += `, ${val[i]}`\n } else {\n headers[key] = val[i]\n }\n }\n } else if (headers[key]) {\n headers[key] += `, ${val}`\n } else {\n headers[key] = val\n }\n }\n\n /** @type {import('node:http2').ClientHttp2Stream} */\n let stream = null\n\n const { hostname, port } = client[kUrl]\n\n headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n headers[HTTP2_HEADER_METHOD] = method\n\n const abort = (err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n err = err || new RequestAbortedError()\n\n util.errorRequest(client, request, err)\n\n if (stream != null) {\n // Some chunks might still come after abort,\n // let's ignore them\n stream.removeAllListeners('data')\n\n // On Abort, we close the stream to send RST_STREAM frame\n stream.close()\n\n // We move the running index to the next request\n client[kOnError](err)\n completeRequest(client, request)\n client[kResume]()\n }\n\n // We do not destroy the socket as we can continue using the session\n // the stream gets destroyed and the session remains to create new streams\n util.destroy(body, err)\n }\n\n try {\n // We are already connected, streams are pending.\n // We can call on connect, and wait for abort\n request.onConnect(abort)\n } catch (err) {\n util.errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (upgrade || method === 'CONNECT') {\n session.ref()\n\n if (upgrade === 'websocket') {\n // We cannot upgrade to websocket if extended CONNECT protocol is not supported\n if (session[kEnableConnectProtocol] === false) {\n util.errorRequest(client, request, new InformationalError('HTTP/2: Extended CONNECT protocol not supported by server'))\n session.unref()\n return false\n }\n\n // We force the method to CONNECT\n // as per RFC-8441\n // https://datatracker.ietf.org/doc/html/rfc8441#section-4\n headers[HTTP2_HEADER_METHOD] = 'CONNECT'\n headers[HTTP2_HEADER_PROTOCOL] = 'websocket'\n // :path and :scheme headers must be omitted when sending CONNECT but set if extended-CONNECT\n headers[HTTP2_HEADER_PATH] = path\n\n if (protocol === 'ws:' || protocol === 'wss:') {\n headers[HTTP2_HEADER_SCHEME] = protocol === 'ws:' ? 'http' : 'https'\n } else {\n headers[HTTP2_HEADER_SCHEME] = protocol === 'http:' ? 'http' : 'https'\n }\n\n stream = session.request(headers, { endStream: false, signal })\n stream[kHTTP2Stream] = true\n\n stream.once('response', (headers, _flags) => {\n const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n\n request.onUpgrade(statusCode, parseH2Headers(realHeaders), stream)\n\n ++session[kOpenStreams]\n completeRequest(client, request)\n })\n\n stream.on('error', () => {\n if (stream.rstCode === NGHTTP2_REFUSED_STREAM || stream.rstCode === NGHTTP2_CANCEL) {\n // NGHTTP2_REFUSED_STREAM (7) or NGHTTP2_CANCEL (8)\n // We do not treat those as errors as the server might\n // not support websockets and refuse the stream\n abort(new InformationalError(`HTTP/2: \"stream error\" received - code ${stream.rstCode}`))\n }\n })\n\n stream.once('close', () => {\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) session.unref()\n })\n\n stream.setTimeout(headersTimeout)\n return true\n }\n\n // TODO: consolidate once we support CONNECT properly\n // NOTE: We are already connected, streams are pending, first request\n // will create a new stream. We trigger a request to create the stream and wait until\n // `ready` event is triggered\n // We disabled endStream to allow the user to write to the stream\n stream = session.request(headers, { endStream: false, signal })\n stream[kHTTP2Stream] = true\n stream.on('response', headers => {\n const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n\n request.onUpgrade(statusCode, parseH2Headers(realHeaders), stream)\n ++session[kOpenStreams]\n completeRequest(client, request)\n })\n stream.on('error', abort)\n stream.once('close', () => {\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) session.unref()\n })\n stream.setTimeout(headersTimeout)\n\n return true\n }\n\n // https://tools.ietf.org/html/rfc7540#section-8.3\n // :path and :scheme headers must be omitted when sending CONNECT\n headers[HTTP2_HEADER_PATH] = path\n headers[HTTP2_HEADER_SCHEME] = protocol === 'http:' ? 'http' : 'https'\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n let contentLength = util.bodyLength(body)\n\n if (util.isFormDataLike(body)) {\n extractBody ??= require('../web/fetch/body.js').extractBody\n\n const [bodyStream, contentType] = extractBody(body)\n headers['content-type'] = contentType\n\n body = bodyStream.stream\n contentLength = bodyStream.length\n }\n\n if (contentLength == null) {\n contentLength = request.contentLength\n }\n\n if (!expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n // And for methods that don't expect a payload, omit Content-Length.\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n util.errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n if (contentLength != null) {\n assert(body || contentLength === 0, 'no body must not have content length')\n headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n }\n\n session.ref()\n\n if (channels.sendHeaders.hasSubscribers) {\n let header = ''\n for (const key in headers) {\n header += `${key}: ${headers[key]}\\r\\n`\n }\n channels.sendHeaders.publish({ request, headers: header, socket: session[kSocket] })\n }\n\n // TODO(metcoder95): add support for sending trailers\n const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n if (expectContinue) {\n headers[HTTP2_HEADER_EXPECT] = '100-continue'\n stream = session.request(headers, { endStream: shouldEndStream, signal })\n stream[kHTTP2Stream] = true\n\n stream.once('continue', writeBodyH2)\n } else {\n stream = session.request(headers, {\n endStream: shouldEndStream,\n signal\n })\n stream[kHTTP2Stream] = true\n\n writeBodyH2()\n }\n\n // Increment counter as we have new streams open\n ++session[kOpenStreams]\n stream.setTimeout(headersTimeout)\n\n // Track whether we received a response (headers)\n let responseReceived = false\n\n stream.once('response', headers => {\n const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n request.onResponseStarted()\n responseReceived = true\n stream.setTimeout(bodyTimeout)\n\n // Due to the stream nature, it is possible we face a race condition\n // where the stream has been assigned, but the request has been aborted\n // the request remains in-flight and headers hasn't been received yet\n // for those scenarios, best effort is to destroy the stream immediately\n // as there's no value to keep it open.\n if (request.aborted) {\n stream.removeAllListeners('data')\n return\n }\n\n if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n stream.pause()\n }\n\n stream.on('data', (chunk) => {\n if (request.aborted || request.completed) {\n return\n }\n\n if (request.onData(chunk) === false) {\n stream.pause()\n }\n })\n })\n\n stream.once('end', () => {\n stream.removeAllListeners('data')\n // If we received a response, this is a normal completion\n if (responseReceived) {\n if (!request.aborted && !request.completed) {\n request.onComplete({})\n }\n\n completeRequest(client, request)\n client[kResume]()\n } else {\n // Stream ended without receiving a response - this is an error\n // (e.g., server destroyed the stream before sending headers)\n abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n completeRequest(client, request, true)\n client[kResume]()\n }\n })\n\n stream.once('close', () => {\n stream.removeAllListeners('data')\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) {\n session.unref()\n }\n\n // A stream can close without ever emitting 'end' or 'error': a peer's\n // RST_STREAM(CANCEL) received before the response is reported by Node as a\n // bare 'close', and destroying the stream unenrolls its timeout, so no\n // 'timeout' follows either. Nothing else would ever settle this request.\n if (!request.aborted && !request.completed) {\n abort(new InformationalError('HTTP/2: stream closed before the response was complete'))\n }\n })\n\n stream.once('error', function (err) {\n stream.removeAllListeners('data')\n abort(err)\n })\n\n stream.once('frameError', (type, code) => {\n stream.removeAllListeners('data')\n abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n })\n\n stream.on('aborted', () => {\n stream.removeAllListeners('data')\n })\n\n stream.on('timeout', () => {\n const err = responseReceived\n ? new BodyTimeoutError(`HTTP/2: \"body timeout after ${bodyTimeout}\"`)\n : new HeadersTimeoutError(`HTTP/2: \"headers timeout after ${headersTimeout}\"`)\n stream.removeAllListeners('data')\n session[kOpenStreams] -= 1\n\n if (session[kOpenStreams] === 0) {\n session.unref()\n }\n\n abort(err)\n })\n\n stream.once('trailers', trailers => {\n if (request.aborted || request.completed) {\n return\n }\n\n stream.removeAllListeners('data')\n request.onComplete(trailers)\n })\n\n return true\n\n function writeBodyH2 () {\n if (!body || contentLength === 0) {\n writeBuffer(\n abort,\n stream,\n null,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else if (util.isBuffer(body)) {\n writeBuffer(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable(\n abort,\n stream,\n body.stream(),\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else {\n writeBlob(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n }\n } else if (util.isStream(body)) {\n writeStream(\n abort,\n client[kSocket],\n expectsPayload,\n stream,\n body,\n client,\n request,\n contentLength\n )\n } else if (util.isIterable(body)) {\n writeIterable(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else {\n assert(false)\n }\n }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n try {\n if (body != null && util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n h2stream.cork()\n h2stream.write(body)\n h2stream.uncork()\n h2stream.end()\n\n request.onBodySent(body)\n }\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n request.onRequestSent()\n client[kResume]()\n } catch (error) {\n abort(error)\n }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n // For HTTP/2, is enough to pipe the stream\n const pipe = pipeline(\n body,\n h2stream,\n (err) => {\n if (err) {\n util.destroy(pipe, err)\n abort(err)\n } else {\n util.removeAllListeners(pipe)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n }\n }\n )\n\n util.addListener(pipe, 'data', onPipeData)\n\n function onPipeData (chunk) {\n request.onBodySent(chunk)\n }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n h2stream.cork()\n h2stream.write(buffer)\n h2stream.uncork()\n h2stream.end()\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n h2stream\n .on('close', onDrain)\n .on('drain', onDrain)\n\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n const res = h2stream.write(chunk)\n request.onBodySent(chunk)\n if (!res) {\n await waitForDrain()\n }\n }\n\n h2stream.end()\n\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n } finally {\n h2stream\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nmodule.exports = connectH2\n","'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { ClientStats } = require('../util/stats.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n InvalidArgumentError,\n InformationalError,\n ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n kUrl,\n kServerName,\n kClient,\n kBusy,\n kConnect,\n kResuming,\n kRunning,\n kPending,\n kSize,\n kQueue,\n kConnected,\n kConnecting,\n kNeedDrain,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kConnector,\n kMaxRequests,\n kCounter,\n kClose,\n kDestroy,\n kDispatch,\n kLocalAddress,\n kMaxResponseSize,\n kOnError,\n kHTTPContext,\n kMaxConcurrentStreams,\n kHTTP2InitialWindowSize,\n kHTTP2ConnectionWindowSize,\n kResume,\n kPingInterval\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst getDefaultNodeMaxHeaderSize = http &&\n http.maxHeaderSize &&\n Number.isInteger(http.maxHeaderSize) &&\n http.maxHeaderSize > 0\n ? () => http.maxHeaderSize\n : () => { throw new InvalidArgumentError('http module not available or http.maxHeaderSize invalid') }\n\nconst noop = () => { }\n\nfunction getPipelining (client) {\n return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n /**\n *\n * @param {string|URL} url\n * @param {import('../../types/client.js').Client.Options} options\n */\n constructor (url, {\n maxHeaderSize,\n headersTimeout,\n socketTimeout,\n requestTimeout,\n connectTimeout,\n bodyTimeout,\n idleTimeout,\n keepAlive,\n keepAliveTimeout,\n maxKeepAliveTimeout,\n keepAliveMaxTimeout,\n keepAliveTimeoutThreshold,\n socketPath,\n pipelining,\n tls,\n strictContentLength,\n maxCachedSessions,\n connect,\n maxRequestsPerClient,\n localAddress,\n maxResponseSize,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n // h2\n maxConcurrentStreams,\n allowH2,\n useH2c,\n initialWindowSize,\n connectionWindowSize,\n pingInterval,\n webSocket\n } = {}) {\n if (keepAlive !== undefined) {\n throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n }\n\n if (socketTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (requestTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (idleTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n }\n\n if (maxKeepAliveTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n }\n\n if (maxHeaderSize != null) {\n if (!Number.isInteger(maxHeaderSize) || maxHeaderSize < 1) {\n throw new InvalidArgumentError('invalid maxHeaderSize')\n }\n } else {\n // If maxHeaderSize is not provided, use the default value from the http module\n // or if that is not available, throw an error.\n maxHeaderSize = getDefaultNodeMaxHeaderSize()\n }\n\n if (socketPath != null && typeof socketPath !== 'string') {\n throw new InvalidArgumentError('invalid socketPath')\n }\n\n if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n throw new InvalidArgumentError('invalid connectTimeout')\n }\n\n if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveTimeout')\n }\n\n if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n }\n\n if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n }\n\n if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n }\n\n if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n }\n\n if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n throw new InvalidArgumentError('localAddress must be valid string IP address')\n }\n\n if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n throw new InvalidArgumentError('maxResponseSize must be a positive number')\n }\n\n if (\n autoSelectFamilyAttemptTimeout != null &&\n (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n ) {\n throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n }\n\n // h2\n if (allowH2 != null && typeof allowH2 !== 'boolean') {\n throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n }\n\n if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n }\n\n if (useH2c != null && typeof useH2c !== 'boolean') {\n throw new InvalidArgumentError('useH2c must be a valid boolean value')\n }\n\n if (initialWindowSize != null && (!Number.isInteger(initialWindowSize) || initialWindowSize < 1)) {\n throw new InvalidArgumentError('initialWindowSize must be a positive integer, greater than 0')\n }\n\n if (connectionWindowSize != null && (!Number.isInteger(connectionWindowSize) || connectionWindowSize < 1)) {\n throw new InvalidArgumentError('connectionWindowSize must be a positive integer, greater than 0')\n }\n\n if (pingInterval != null && (typeof pingInterval !== 'number' || !Number.isInteger(pingInterval) || pingInterval < 0)) {\n throw new InvalidArgumentError('pingInterval must be a positive integer, greater or equal to 0')\n }\n\n super({ webSocket })\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n useH2c,\n socketPath,\n timeout: connectTimeout,\n ...(typeof autoSelectFamily === 'boolean' ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n } else {\n const customConnect = connect\n connect = (opts, callback) => customConnect({\n ...opts,\n ...(socketPath != null ? { socketPath } : null),\n ...(allowH2 != null ? { allowH2 } : null)\n }, callback)\n }\n\n this[kUrl] = util.parseOrigin(url)\n this[kConnector] = connect\n this[kPipelining] = pipelining != null ? pipelining : 1\n this[kMaxHeadersSize] = maxHeaderSize\n this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n this[kServerName] = null\n this[kLocalAddress] = localAddress != null ? localAddress : null\n this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n this[kMaxRequests] = maxRequestsPerClient\n this[kClosedResolve] = null\n this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n this[kHTTPContext] = null\n // h2\n this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n // HTTP/2 window sizes are set to higher defaults than Node.js core for better performance:\n // - initialWindowSize: 262144 (256KB) vs Node.js default 65535 (64KB - 1)\n // Allows more data to be sent before requiring acknowledgment, improving throughput\n // especially on high-latency networks. This matches common production HTTP/2 servers.\n // - connectionWindowSize: 524288 (512KB) vs Node.js default (none set)\n // Provides better flow control for the entire connection across multiple streams.\n this[kHTTP2InitialWindowSize] = initialWindowSize != null ? initialWindowSize : 262144\n this[kHTTP2ConnectionWindowSize] = connectionWindowSize != null ? connectionWindowSize : 524288\n this[kPingInterval] = pingInterval != null ? pingInterval : 60e3 // Default ping interval for h2 - 1 minute\n\n // kQueue is built up of 3 sections separated by\n // the kRunningIdx and kPendingIdx indices.\n // | complete | running | pending |\n // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n // kRunningIdx points to the first running element.\n // kPendingIdx points to the first pending element.\n // This implements a fast queue with an amortized\n // time of O(1).\n\n this[kQueue] = []\n this[kRunningIdx] = 0\n this[kPendingIdx] = 0\n\n this[kResume] = (sync) => resume(this, sync)\n this[kOnError] = (err) => onError(this, err)\n }\n\n get pipelining () {\n return this[kPipelining]\n }\n\n set pipelining (value) {\n this[kPipelining] = value\n this[kResume](true)\n }\n\n get stats () {\n return new ClientStats(this)\n }\n\n get [kPending] () {\n return this[kQueue].length - this[kPendingIdx]\n }\n\n get [kRunning] () {\n return this[kPendingIdx] - this[kRunningIdx]\n }\n\n get [kSize] () {\n return this[kQueue].length - this[kRunningIdx]\n }\n\n get [kConnected] () {\n return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n }\n\n get [kBusy] () {\n return Boolean(\n this[kHTTPContext]?.busy(null) ||\n (this[kSize] >= (getPipelining(this) || 1)) ||\n this[kPending] > 0\n )\n }\n\n [kConnect] (cb) {\n connect(this)\n this.once('connect', cb)\n }\n\n [kDispatch] (opts, handler) {\n const request = new Request(this[kUrl].origin, opts, handler)\n\n this[kQueue].push(request)\n if (this[kResuming]) {\n // Do nothing.\n } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n // Wait a tick in case stream/iterator is ended in the same tick.\n this[kResuming] = 1\n queueMicrotask(() => resume(this))\n } else {\n this[kResume](true)\n }\n\n if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n this[kNeedDrain] = 2\n }\n\n return this[kNeedDrain] < 2\n }\n\n [kClose] () {\n // TODO: for H2 we need to gracefully flush the remaining enqueued\n // request and close each stream.\n return new Promise((resolve) => {\n if (this[kSize]) {\n this[kClosedResolve] = resolve\n } else {\n resolve(null)\n }\n })\n }\n\n [kDestroy] (err) {\n return new Promise((resolve) => {\n const requests = this[kQueue].splice(this[kPendingIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n if (request != null) {\n util.errorRequest(this, request, err)\n }\n }\n\n const callback = () => {\n if (this[kClosedResolve]) {\n // TODO (fix): Should we error here with ClientDestroyedError?\n this[kClosedResolve]()\n this[kClosedResolve] = null\n }\n resolve(null)\n }\n\n if (this[kHTTPContext]) {\n this[kHTTPContext].destroy(err, callback)\n this[kHTTPContext] = null\n } else {\n queueMicrotask(callback)\n }\n\n this[kResume]()\n })\n }\n}\n\nfunction onError (client, err) {\n if (\n client[kRunning] === 0 &&\n err.code !== 'UND_ERR_INFO' &&\n err.code !== 'UND_ERR_SOCKET'\n ) {\n // Error is not caused by running request and not a recoverable\n // socket error.\n\n assert(client[kPendingIdx] === client[kRunningIdx])\n\n const requests = client[kQueue].splice(client[kRunningIdx])\n\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n if (request != null) {\n util.errorRequest(client, request, err)\n }\n }\n assert(client[kSize] === 0)\n }\n}\n\n/**\n * @param {Client} client\n * @returns {void}\n */\nfunction connect (client) {\n assert(!client[kConnecting])\n assert(!client[kHTTPContext])\n\n let { host, hostname, protocol, port } = client[kUrl]\n\n // Resolve ipv6\n if (hostname[0] === '[') {\n const idx = hostname.indexOf(']')\n\n assert(idx !== -1)\n const ip = hostname.substring(1, idx)\n\n assert(net.isIPv6(ip))\n hostname = ip\n }\n\n client[kConnecting] = true\n\n if (channels.beforeConnect.hasSubscribers) {\n channels.beforeConnect.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector]\n })\n }\n\n try {\n client[kConnector]({\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n }, (err, socket) => {\n if (err) {\n handleConnectError(client, err, { host, hostname, protocol, port })\n client[kResume]()\n return\n }\n\n if (client.destroyed) {\n util.destroy(socket.on('error', noop), new ClientDestroyedError())\n client[kResume]()\n return\n }\n\n assert(socket)\n\n try {\n client[kHTTPContext] = socket.alpnProtocol === 'h2'\n ? connectH2(client, socket)\n : connectH1(client, socket)\n } catch (err) {\n socket.destroy().on('error', noop)\n handleConnectError(client, err, { host, hostname, protocol, port })\n client[kResume]()\n return\n }\n\n client[kConnecting] = false\n\n socket[kCounter] = 0\n socket[kMaxRequests] = client[kMaxRequests]\n socket[kClient] = client\n socket[kError] = null\n\n if (channels.connected.hasSubscribers) {\n channels.connected.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n socket\n })\n }\n\n client.emit('connect', client[kUrl], [client])\n client[kResume]()\n })\n } catch (err) {\n handleConnectError(client, err, { host, hostname, protocol, port })\n client[kResume]()\n }\n}\n\nfunction handleConnectError (client, err, { host, hostname, protocol, port }) {\n if (client.destroyed) {\n return\n }\n\n client[kConnecting] = false\n\n if (channels.connectError.hasSubscribers) {\n channels.connectError.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n error: err\n })\n }\n\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n assert(client[kRunning] === 0)\n while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n const request = client[kQueue][client[kPendingIdx]++]\n util.errorRequest(client, request, err)\n }\n } else {\n onError(client, err)\n }\n\n client.emit('connectionError', client[kUrl], [client], err)\n}\n\nfunction emitDrain (client) {\n client[kNeedDrain] = 0\n client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n if (client[kResuming] === 2) {\n return\n }\n\n client[kResuming] = 2\n\n _resume(client, sync)\n client[kResuming] = 0\n\n if (client[kRunningIdx] > 256) {\n client[kQueue].splice(0, client[kRunningIdx])\n client[kPendingIdx] -= client[kRunningIdx]\n client[kRunningIdx] = 0\n }\n}\n\nfunction _resume (client, sync) {\n while (true) {\n if (client.destroyed) {\n assert(client[kPending] === 0)\n return\n }\n\n if (client[kClosedResolve] && !client[kSize]) {\n client[kClosedResolve]()\n client[kClosedResolve] = null\n return\n }\n\n if (client[kHTTPContext]) {\n client[kHTTPContext].resume()\n }\n\n if (client[kBusy]) {\n client[kNeedDrain] = 2\n } else if (client[kNeedDrain] === 2) {\n if (sync) {\n client[kNeedDrain] = 1\n queueMicrotask(() => emitDrain(client))\n } else {\n emitDrain(client)\n }\n continue\n }\n\n if (client[kPending] === 0) {\n return\n }\n\n if (client[kRunning] >= (getPipelining(client) || 1)) {\n return\n }\n\n const request = client[kQueue][client[kPendingIdx]]\n\n if (request === null) {\n return\n }\n\n if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n if (client[kRunning] > 0) {\n return\n }\n\n client[kServerName] = request.servername\n client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n client[kHTTPContext] = null\n resume(client)\n })\n }\n\n if (client[kConnecting]) {\n return\n }\n\n if (!client[kHTTPContext]) {\n connect(client)\n return\n }\n\n if (client[kHTTPContext].destroyed) {\n return\n }\n\n if (client[kHTTPContext].busy(request)) {\n return\n }\n\n if (!request.aborted && client[kHTTPContext].write(request)) {\n client[kPendingIdx]++\n } else {\n client[kQueue].splice(client[kPendingIdx], 1)\n }\n }\n}\n\nmodule.exports = Client\n","'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048\nconst kMask = kSize - 1\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n// head tail\n// | |\n// v v\n// +-----------+ <-----\\ +-----------+ <------\\ +-----------+\n// | [null] | \\----- | next | \\------- | next |\n// +-----------+ +-----------+ +-----------+\n// | item | <-- bottom | item | <-- bottom | undefined |\n// | item | | item | | undefined |\n// | item | | item | | undefined |\n// | item | | item | | undefined |\n// | item | | item | bottom --> | item |\n// | item | | item | | item |\n// | ... | | ... | | ... |\n// | item | | item | | item |\n// | item | | item | | item |\n// | undefined | <-- top | item | | item |\n// | undefined | | item | | item |\n// | undefined | | undefined | <-- top top --> | undefined |\n// +-----------+ +-----------+ +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n// head tail head tail\n// | | | |\n// v v v v\n// +-----------+ +-----------+\n// | [null] | | [null] |\n// +-----------+ +-----------+\n// | undefined | | item |\n// | undefined | | item |\n// | item | <-- bottom top --> | undefined |\n// | item | | undefined |\n// | undefined | <-- top bottom --> | item |\n// | undefined | | item |\n// +-----------+ +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\n/**\n * @type {FixedCircularBuffer}\n * @template T\n */\nclass FixedCircularBuffer {\n /** @type {number} */\n bottom = 0\n /** @type {number} */\n top = 0\n /** @type {Array<T|undefined>} */\n list = new Array(kSize).fill(undefined)\n /** @type {T|null} */\n next = null\n\n /** @returns {boolean} */\n isEmpty () {\n return this.top === this.bottom\n }\n\n /** @returns {boolean} */\n isFull () {\n return ((this.top + 1) & kMask) === this.bottom\n }\n\n /**\n * @param {T} data\n * @returns {void}\n */\n push (data) {\n this.list[this.top] = data\n this.top = (this.top + 1) & kMask\n }\n\n /** @returns {T|null} */\n shift () {\n const nextItem = this.list[this.bottom]\n if (nextItem === undefined) { return null }\n this.list[this.bottom] = undefined\n this.bottom = (this.bottom + 1) & kMask\n return nextItem\n }\n}\n\n/**\n * @template T\n */\nmodule.exports = class FixedQueue {\n constructor () {\n /** @type {FixedCircularBuffer<T>} */\n this.head = this.tail = new FixedCircularBuffer()\n }\n\n /** @returns {boolean} */\n isEmpty () {\n return this.head.isEmpty()\n }\n\n /** @param {T} data */\n push (data) {\n if (this.head.isFull()) {\n // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n // and sets it as the new main queue.\n this.head = this.head.next = new FixedCircularBuffer()\n }\n this.head.push(data)\n }\n\n /** @returns {T|null} */\n shift () {\n const tail = this.tail\n const next = tail.shift()\n if (tail.isEmpty() && tail.next !== null) {\n // If there is another queue, it forms the new tail.\n this.tail = tail.next\n tail.next = null\n }\n return next\n }\n}\n","'use strict'\n\nconst { PoolStats } = require('../util/stats.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\n\nclass PoolBase extends DispatcherBase {\n [kQueue] = new FixedQueue();\n\n [kQueued] = 0;\n\n [kClients] = [];\n\n [kNeedDrain] = false;\n\n [kOnDrain] (client, origin, targets) {\n const queue = this[kQueue]\n\n let needDrain = false\n\n while (!needDrain) {\n const item = queue.shift()\n if (!item) {\n break\n }\n this[kQueued]--\n needDrain = !client.dispatch(item.opts, item.handler)\n }\n\n client[kNeedDrain] = needDrain\n\n if (!needDrain && this[kNeedDrain]) {\n this[kNeedDrain] = false\n this.emit('drain', origin, [this, ...targets])\n }\n\n if (this[kClosedResolve] && queue.isEmpty()) {\n const closeAll = []\n for (let i = 0; i < this[kClients].length; i++) {\n const client = this[kClients][i]\n if (!client.destroyed) {\n closeAll.push(client.close())\n }\n }\n return Promise.all(closeAll)\n .then(this[kClosedResolve])\n }\n }\n\n [kOnConnect] = (origin, targets) => {\n this.emit('connect', origin, [this, ...targets])\n };\n\n [kOnDisconnect] = (origin, targets, err) => {\n this.emit('disconnect', origin, [this, ...targets], err)\n };\n\n [kOnConnectionError] = (origin, targets, err) => {\n this.emit('connectionError', origin, [this, ...targets], err)\n }\n\n get [kBusy] () {\n return this[kNeedDrain]\n }\n\n get [kConnected] () {\n let ret = 0\n for (const { [kConnected]: connected } of this[kClients]) {\n ret += connected\n }\n return ret\n }\n\n get [kFree] () {\n let ret = 0\n for (const { [kConnected]: connected, [kNeedDrain]: needDrain } of this[kClients]) {\n ret += connected && !needDrain\n }\n return ret\n }\n\n get [kPending] () {\n let ret = this[kQueued]\n for (const { [kPending]: pending } of this[kClients]) {\n ret += pending\n }\n return ret\n }\n\n get [kRunning] () {\n let ret = 0\n for (const { [kRunning]: running } of this[kClients]) {\n ret += running\n }\n return ret\n }\n\n get [kSize] () {\n let ret = this[kQueued]\n for (const { [kSize]: size } of this[kClients]) {\n ret += size\n }\n return ret\n }\n\n get stats () {\n return new PoolStats(this)\n }\n\n [kClose] () {\n if (this[kQueue].isEmpty()) {\n const closeAll = []\n for (let i = 0; i < this[kClients].length; i++) {\n const client = this[kClients][i]\n if (!client.destroyed) {\n closeAll.push(client.close())\n }\n }\n return Promise.all(closeAll)\n } else {\n return new Promise((resolve) => {\n this[kClosedResolve] = resolve\n })\n }\n }\n\n [kDestroy] (err) {\n while (true) {\n const item = this[kQueue].shift()\n if (!item) {\n break\n }\n item.handler.onError(err)\n }\n\n const destroyAll = new Array(this[kClients].length)\n for (let i = 0; i < this[kClients].length; i++) {\n destroyAll[i] = this[kClients][i].destroy(err)\n }\n return Promise.all(destroyAll)\n }\n\n [kDispatch] (opts, handler) {\n const dispatcher = this[kGetDispatcher]()\n\n if (!dispatcher) {\n this[kNeedDrain] = true\n this[kQueue].push({ opts, handler })\n this[kQueued]++\n } else if (!dispatcher.dispatch(opts, handler)) {\n dispatcher[kNeedDrain] = true\n this[kNeedDrain] = !this[kGetDispatcher]()\n }\n\n return !this[kNeedDrain]\n }\n\n [kAddClient] (client) {\n client\n .on('drain', this[kOnDrain].bind(this, client))\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].push(client)\n\n if (this[kNeedDrain]) {\n queueMicrotask(() => {\n if (this[kNeedDrain]) {\n this[kOnDrain](client, client[kUrl], [client, this])\n }\n })\n }\n\n return this\n }\n\n [kRemoveClient] (client) {\n client.close(() => {\n const idx = this[kClients].indexOf(client)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n })\n\n this[kNeedDrain] = this[kClients].some(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n }\n}\n\nmodule.exports = {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n}\n","'use strict'\n\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kGetDispatcher,\n kRemoveClient\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n constructor (origin, {\n connections,\n factory = defaultFactory,\n connect,\n connectTimeout,\n tls,\n maxCachedSessions,\n socketPath,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n allowH2,\n clientTtl,\n ...options\n } = {}) {\n if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n throw new InvalidArgumentError('invalid connections')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(typeof autoSelectFamily === 'boolean' ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n super(options)\n\n this[kConnections] = connections || null\n this[kUrl] = util.parseOrigin(origin)\n this[kOptions] = { ...util.deepClone(options), connect, allowH2, clientTtl, socketPath }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kFactory] = factory\n\n this.on('connect', (origin, targets) => {\n if (clientTtl != null && clientTtl > 0) {\n for (const target of targets) {\n Object.assign(target, { ttl: Date.now() })\n }\n }\n })\n\n this.on('connectionError', (origin, targets, error) => {\n // If a connection error occurs, we remove the client from the pool,\n // and emit a connectionError event. They will not be re-used.\n // Fixes https://github.com/nodejs/undici/issues/3895\n for (const target of targets) {\n // Do not use kRemoveClient here, as it will close the client,\n // but the client cannot be closed in this state.\n const idx = this[kClients].indexOf(target)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n }\n })\n }\n\n [kGetDispatcher] () {\n const clientTtlOption = this[kOptions].clientTtl\n for (const client of this[kClients]) {\n // check ttl of client and if it's stale, remove it from the pool\n if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && ((Date.now() - client.ttl) > clientTtlOption)) {\n this[kRemoveClient](client)\n } else if (!client[kNeedDrain]) {\n return client\n }\n }\n\n if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n return dispatcher\n }\n }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst {\n BalancedPoolMissingUpstreamError,\n InvalidArgumentError\n} = require('../core/errors')\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl } = require('../core/symbols')\nconst util = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n if (a === 0) return b\n\n while (b !== 0) {\n const t = b\n b = a % b\n a = t\n }\n return a\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n constructor (upstreams = [], { factory = defaultFactory, connect, tls, ...opts } = {}) {\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n super(opts)\n\n if (connect && typeof connect !== 'function') connect = { ...connect }\n if (tls && typeof tls !== 'function') tls = { ...tls }\n this[kOptions] = { ...util.deepClone(opts), connect, tls }\n this[kOptions].interceptors = opts.interceptors\n ? { ...opts.interceptors }\n : undefined\n this[kIndex] = -1\n this[kCurrentWeight] = 0\n\n this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n if (!Array.isArray(upstreams)) {\n upstreams = [upstreams]\n }\n\n this[kFactory] = factory\n\n for (const upstream of upstreams) {\n this.addUpstream(upstream)\n }\n this._updateBalancedPoolStats()\n }\n\n addUpstream (upstream) {\n const upstreamOrigin = util.parseOrigin(upstream).origin\n\n if (this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))) {\n return this\n }\n const pool = this[kFactory](upstreamOrigin, this[kOptions])\n\n this[kAddClient](pool)\n pool.on('connect', () => {\n pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n })\n\n pool.on('connectionError', () => {\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n })\n\n pool.on('disconnect', (...args) => {\n const err = args[2]\n if (err && err.code === 'UND_ERR_SOCKET') {\n // decrease the weight of the pool.\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n }\n })\n\n for (const client of this[kClients]) {\n client[kWeight] = this[kMaxWeightPerServer]\n }\n\n this._updateBalancedPoolStats()\n\n return this\n }\n\n _updateBalancedPoolStats () {\n let result = 0\n for (let i = 0; i < this[kClients].length; i++) {\n result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n }\n\n this[kGreatestCommonDivisor] = result\n }\n\n removeUpstream (upstream) {\n const upstreamOrigin = util.parseOrigin(upstream).origin\n\n const pool = this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))\n\n if (pool) {\n this[kRemoveClient](pool)\n }\n\n return this\n }\n\n getUpstream (upstream) {\n const upstreamOrigin = util.parseOrigin(upstream).origin\n\n return this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))\n }\n\n get upstreams () {\n return this[kClients]\n .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n .map((p) => p[kUrl].origin)\n }\n\n [kGetDispatcher] () {\n // We validate that pools is greater than 0,\n // otherwise we would have to wait until an upstream\n // is added, which might never happen.\n if (this[kClients].length === 0) {\n throw new BalancedPoolMissingUpstreamError()\n }\n\n const dispatcher = this[kClients].find(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n\n if (!dispatcher) {\n return\n }\n\n const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n if (allClientsBusy) {\n return\n }\n\n let counter = 0\n\n let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n while (counter++ < this[kClients].length) {\n this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n const pool = this[kClients][this[kIndex]]\n\n // find pool index with the largest weight\n if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n maxWeightIndex = this[kIndex]\n }\n\n // decrease the current weight every `this[kClients].length`.\n if (this[kIndex] === 0) {\n // Set the current weight to the next lower weight.\n this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n if (this[kCurrentWeight] <= 0) {\n this[kCurrentWeight] = this[kMaxWeightPerServer]\n }\n }\n if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n return pool\n }\n }\n\n this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n this[kIndex] = maxWeightIndex\n return this[kClients][maxWeightIndex]\n }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kGetDispatcher,\n kRemoveClient\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\nconst kIndex = Symbol('index')\n\nfunction defaultFactory (origin, opts) {\n return new Client(origin, opts)\n}\n\nclass RoundRobinPool extends PoolBase {\n constructor (origin, {\n connections,\n factory = defaultFactory,\n connect,\n connectTimeout,\n tls,\n maxCachedSessions,\n socketPath,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n allowH2,\n clientTtl,\n ...options\n } = {}) {\n if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n throw new InvalidArgumentError('invalid connections')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(typeof autoSelectFamily === 'boolean' ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n super()\n\n this[kConnections] = connections || null\n this[kUrl] = util.parseOrigin(origin)\n this[kOptions] = { ...util.deepClone(options), connect, allowH2, clientTtl, socketPath }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kFactory] = factory\n this[kIndex] = -1\n\n this.on('connect', (origin, targets) => {\n if (clientTtl != null && clientTtl > 0) {\n for (const target of targets) {\n Object.assign(target, { ttl: Date.now() })\n }\n }\n })\n\n this.on('connectionError', (origin, targets, error) => {\n for (const target of targets) {\n const idx = this[kClients].indexOf(target)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n }\n })\n }\n\n [kGetDispatcher] () {\n const clientTtlOption = this[kOptions].clientTtl\n const clientsLength = this[kClients].length\n\n // If we have no clients yet, create one\n if (clientsLength === 0) {\n const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n return dispatcher\n }\n\n // Round-robin through existing clients\n let checked = 0\n while (checked < clientsLength) {\n this[kIndex] = (this[kIndex] + 1) % clientsLength\n const client = this[kClients][this[kIndex]]\n\n // Check if client is stale (TTL expired)\n if (clientTtlOption != null && clientTtlOption > 0 && client.ttl && ((Date.now() - client.ttl) > clientTtlOption)) {\n this[kRemoveClient](client)\n checked++\n continue\n }\n\n // Return client if it's not draining\n if (!client[kNeedDrain]) {\n return client\n }\n\n checked++\n }\n\n // All clients are busy, create a new one if we haven't reached the limit\n if (!this[kConnections] || clientsLength < this[kConnections]) {\n const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n return dispatcher\n }\n }\n}\n\nmodule.exports = RoundRobinPool\n","'use strict'\n\nconst { InvalidArgumentError, MaxOriginsReachedError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kUrl } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\nconst kOrigins = Symbol('origins')\n\nfunction defaultFactory (origin, opts) {\n return opts && opts.connections === 1\n ? new Client(origin, opts)\n : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n constructor ({ factory = defaultFactory, maxOrigins = Infinity, connect, ...options } = {}) {\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof maxOrigins !== 'number' || Number.isNaN(maxOrigins) || maxOrigins <= 0) {\n throw new InvalidArgumentError('maxOrigins must be a number greater than 0')\n }\n\n super(options)\n\n if (connect && typeof connect !== 'function') {\n connect = { ...connect }\n }\n\n this[kOptions] = { ...util.deepClone(options), maxOrigins, connect }\n this[kFactory] = factory\n this[kClients] = new Map()\n this[kOrigins] = new Set()\n\n this[kOnDrain] = (origin, targets) => {\n this.emit('drain', origin, [this, ...targets])\n }\n\n this[kOnConnect] = (origin, targets) => {\n this.emit('connect', origin, [this, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n this.emit('disconnect', origin, [this, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n this.emit('connectionError', origin, [this, ...targets], err)\n }\n }\n\n get [kRunning] () {\n let ret = 0\n for (const { dispatcher } of this[kClients].values()) {\n ret += dispatcher[kRunning]\n }\n return ret\n }\n\n [kDispatch] (opts, handler) {\n let key\n if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n key = String(opts.origin)\n } else {\n throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n }\n\n if (this[kOrigins].size >= this[kOptions].maxOrigins && !this[kOrigins].has(key)) {\n throw new MaxOriginsReachedError()\n }\n\n const result = this[kClients].get(key)\n let dispatcher = result && result.dispatcher\n if (!dispatcher) {\n const closeClientIfUnused = (connected) => {\n const result = this[kClients].get(key)\n if (result) {\n if (connected) result.count -= 1\n if (result.count <= 0) {\n this[kClients].delete(key)\n if (!result.dispatcher.destroyed) {\n result.dispatcher.close()\n }\n }\n this[kOrigins].delete(key)\n }\n }\n dispatcher = this[kFactory](opts.origin, this[kOptions])\n .on('drain', this[kOnDrain])\n .on('connect', (origin, targets) => {\n const result = this[kClients].get(key)\n if (result) {\n result.count += 1\n }\n this[kOnConnect](origin, targets)\n })\n .on('disconnect', (origin, targets, err) => {\n closeClientIfUnused(true)\n this[kOnDisconnect](origin, targets, err)\n })\n .on('connectionError', (origin, targets, err) => {\n closeClientIfUnused(false)\n this[kOnConnectionError](origin, targets, err)\n })\n\n this[kClients].set(key, { count: 0, dispatcher })\n this[kOrigins].add(key)\n }\n\n return dispatcher.dispatch(opts, handler)\n }\n\n [kClose] () {\n const closePromises = []\n for (const { dispatcher } of this[kClients].values()) {\n closePromises.push(dispatcher.close())\n }\n this[kClients].clear()\n\n return Promise.all(closePromises)\n }\n\n [kDestroy] (err) {\n const destroyPromises = []\n for (const { dispatcher } of this[kClients].values()) {\n destroyPromises.push(dispatcher.destroy(err))\n }\n this[kClients].clear()\n\n return Promise.all(destroyPromises)\n }\n\n get stats () {\n const allClientStats = {}\n for (const { dispatcher } of this[kClients].values()) {\n if (dispatcher.stats) {\n allClientStats[dispatcher[kUrl].origin] = dispatcher.stats\n }\n }\n return allClientStats\n }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst { Buffer } = require('node:buffer')\nconst net = require('node:net')\nconst { InvalidArgumentError } = require('./errors')\n\n/**\n * Parse an address and determine its type\n * @param {string} address - The address to parse\n * @returns {{type: number, buffer: Buffer}} Address type and buffer\n */\nfunction parseAddress (address) {\n // Check if it's an IPv4 address\n if (net.isIPv4(address)) {\n const parts = address.split('.').map(Number)\n return {\n type: 0x01, // IPv4\n buffer: Buffer.from(parts)\n }\n }\n\n // Check if it's an IPv6 address\n if (net.isIPv6(address)) {\n return {\n type: 0x04, // IPv6\n buffer: parseIPv6(address)\n }\n }\n\n // Otherwise, treat as domain name\n const domainBuffer = Buffer.from(address, 'utf8')\n if (domainBuffer.length > 255) {\n throw new InvalidArgumentError('Domain name too long (max 255 bytes)')\n }\n\n return {\n type: 0x03, // Domain\n buffer: Buffer.concat([Buffer.from([domainBuffer.length]), domainBuffer])\n }\n}\n\n/**\n * Parse IPv6 address to buffer\n * @param {string} address - IPv6 address string\n * @returns {Buffer} 16-byte buffer\n */\nfunction parseIPv6 (address) {\n const buffer = Buffer.alloc(16)\n let normalizedAddress = address\n\n // Expand an embedded IPv4 tail into the last two IPv6 groups.\n if (address.includes('.')) {\n const lastColonIndex = address.lastIndexOf(':')\n const ipv4Part = address.slice(lastColonIndex + 1)\n\n if (net.isIPv4(ipv4Part)) {\n const octets = ipv4Part.split('.').map(Number)\n const high = ((octets[0] << 8) | octets[1]).toString(16)\n const low = ((octets[2] << 8) | octets[3]).toString(16)\n normalizedAddress = `${address.slice(0, lastColonIndex)}:${high}:${low}`\n }\n }\n\n // Handle compressed notation (::)\n const doubleColonIndex = normalizedAddress.indexOf('::')\n if (doubleColonIndex !== -1) {\n const before = normalizedAddress.slice(0, doubleColonIndex)\n const after = normalizedAddress.slice(doubleColonIndex + 2)\n const beforeParts = before === '' ? [] : before.split(':')\n const afterParts = after === '' ? [] : after.split(':')\n\n let bufferIndex = 0\n for (const part of beforeParts) {\n buffer.writeUInt16BE(parseInt(part, 16), bufferIndex)\n bufferIndex += 2\n }\n bufferIndex = 16 - afterParts.length * 2\n for (const part of afterParts) {\n buffer.writeUInt16BE(parseInt(part, 16), bufferIndex)\n bufferIndex += 2\n }\n } else {\n const parts = normalizedAddress.split(':')\n for (let i = 0; i < parts.length; i++) {\n buffer.writeUInt16BE(parseInt(parts[i], 16), i * 2)\n }\n }\n\n return buffer\n}\n\n/**\n * Build a SOCKS5 address buffer\n * @param {number} type - Address type (1=IPv4, 3=Domain, 4=IPv6)\n * @param {Buffer} addressBuffer - The address data\n * @param {number} port - Port number\n * @returns {Buffer} Complete address buffer including type, address, and port\n */\nfunction buildAddressBuffer (type, addressBuffer, port) {\n const portBuffer = Buffer.allocUnsafe(2)\n portBuffer.writeUInt16BE(port, 0)\n\n return Buffer.concat([\n Buffer.from([type]),\n addressBuffer,\n portBuffer\n ])\n}\n\n/**\n * Parse address from SOCKS5 response\n * @param {Buffer} buffer - Buffer containing the address\n * @param {number} offset - Starting offset in buffer\n * @returns {{address: string, port: number, bytesRead: number}}\n */\nfunction parseResponseAddress (buffer, offset = 0) {\n if (buffer.length < offset + 1) {\n throw new InvalidArgumentError('Buffer too small to contain address type')\n }\n\n const addressType = buffer[offset]\n let address\n let currentOffset = offset + 1\n\n switch (addressType) {\n case 0x01: { // IPv4\n if (buffer.length < currentOffset + 6) {\n throw new InvalidArgumentError('Buffer too small for IPv4 address')\n }\n address = Array.from(buffer.subarray(currentOffset, currentOffset + 4)).join('.')\n currentOffset += 4\n break\n }\n\n case 0x03: { // Domain\n if (buffer.length < currentOffset + 1) {\n throw new InvalidArgumentError('Buffer too small for domain length')\n }\n const domainLength = buffer[currentOffset]\n currentOffset += 1\n\n if (buffer.length < currentOffset + domainLength + 2) {\n throw new InvalidArgumentError('Buffer too small for domain address')\n }\n address = buffer.subarray(currentOffset, currentOffset + domainLength).toString('utf8')\n currentOffset += domainLength\n break\n }\n\n case 0x04: { // IPv6\n if (buffer.length < currentOffset + 18) {\n throw new InvalidArgumentError('Buffer too small for IPv6 address')\n }\n // Convert buffer to IPv6 string\n const parts = []\n for (let i = 0; i < 8; i++) {\n const value = buffer.readUInt16BE(currentOffset + i * 2)\n parts.push(value.toString(16))\n }\n address = parts.join(':')\n currentOffset += 16\n break\n }\n\n default:\n throw new InvalidArgumentError(`Invalid address type: ${addressType}`)\n }\n\n // Parse port\n if (buffer.length < currentOffset + 2) {\n throw new InvalidArgumentError('Buffer too small for port')\n }\n const port = buffer.readUInt16BE(currentOffset)\n currentOffset += 2\n\n return {\n address,\n port,\n bytesRead: currentOffset - offset\n }\n}\n\n/**\n * Create error for SOCKS5 reply code\n * @param {number} replyCode - SOCKS5 reply code\n * @returns {Error} Appropriate error object\n */\nfunction createReplyError (replyCode) {\n const messages = {\n 0x01: 'General SOCKS server failure',\n 0x02: 'Connection not allowed by ruleset',\n 0x03: 'Network unreachable',\n 0x04: 'Host unreachable',\n 0x05: 'Connection refused',\n 0x06: 'TTL expired',\n 0x07: 'Command not supported',\n 0x08: 'Address type not supported'\n }\n\n const message = messages[replyCode] || `Unknown SOCKS5 error code: ${replyCode}`\n const error = new Error(message)\n error.code = `SOCKS5_${replyCode}`\n return error\n}\n\nmodule.exports = {\n parseAddress,\n parseIPv6,\n buildAddressBuffer,\n parseResponseAddress,\n createReplyError\n}\n","'use strict'\n\nconst { EventEmitter } = require('node:events')\nconst { Buffer } = require('node:buffer')\nconst { InvalidArgumentError, Socks5ProxyError } = require('./errors')\nconst { debuglog } = require('node:util')\nconst { parseAddress } = require('./socks5-utils')\n\nconst debug = debuglog('undici:socks5')\nconst EMPTY_BUFFER = Buffer.alloc(0)\n\n// SOCKS5 constants\nconst SOCKS_VERSION = 0x05\n\n// Authentication methods\nconst AUTH_METHODS = {\n NO_AUTH: 0x00,\n GSSAPI: 0x01,\n USERNAME_PASSWORD: 0x02,\n NO_ACCEPTABLE: 0xFF\n}\n\n// SOCKS5 commands\nconst COMMANDS = {\n CONNECT: 0x01,\n BIND: 0x02,\n UDP_ASSOCIATE: 0x03\n}\n\n// Address types\nconst ADDRESS_TYPES = {\n IPV4: 0x01,\n DOMAIN: 0x03,\n IPV6: 0x04\n}\n\n// Reply codes\nconst REPLY_CODES = {\n SUCCEEDED: 0x00,\n GENERAL_FAILURE: 0x01,\n CONNECTION_NOT_ALLOWED: 0x02,\n NETWORK_UNREACHABLE: 0x03,\n HOST_UNREACHABLE: 0x04,\n CONNECTION_REFUSED: 0x05,\n TTL_EXPIRED: 0x06,\n COMMAND_NOT_SUPPORTED: 0x07,\n ADDRESS_TYPE_NOT_SUPPORTED: 0x08\n}\n\n// State machine states\nconst STATES = {\n INITIAL: 'initial',\n HANDSHAKING: 'handshaking',\n AUTHENTICATING: 'authenticating',\n AUTHENTICATED: 'authenticated',\n CONNECTING: 'connecting',\n CONNECTED: 'connected',\n ERROR: 'error',\n CLOSED: 'closed'\n}\n\n/**\n * SOCKS5 client implementation\n * Handles SOCKS5 protocol negotiation and connection establishment\n */\nclass Socks5Client extends EventEmitter {\n constructor (socket, options = {}) {\n super()\n\n if (!socket) {\n throw new InvalidArgumentError('socket is required')\n }\n\n this.socket = socket\n this.options = options\n this.state = STATES.INITIAL\n this.buffer = EMPTY_BUFFER\n this.onSocketData = this.onData.bind(this)\n this.onSocketError = this.onError.bind(this)\n this.onSocketClose = this.onClose.bind(this)\n\n // Authentication settings\n this.authMethods = []\n if (options.username && options.password) {\n this.authMethods.push(AUTH_METHODS.USERNAME_PASSWORD)\n }\n this.authMethods.push(AUTH_METHODS.NO_AUTH)\n\n // Socket event handlers\n this.socket.on('data', this.onSocketData)\n this.socket.on('error', this.onSocketError)\n this.socket.on('close', this.onSocketClose)\n }\n\n /**\n * Handle incoming data from the socket\n */\n onData (data) {\n debug('received data', data.length, 'bytes in state', this.state)\n this.buffer = Buffer.concat([this.buffer, data])\n\n try {\n switch (this.state) {\n case STATES.HANDSHAKING:\n this.handleHandshakeResponse()\n break\n case STATES.AUTHENTICATING:\n this.handleAuthResponse()\n break\n case STATES.CONNECTING:\n this.handleConnectResponse()\n break\n }\n } catch (err) {\n this.onError(err)\n }\n }\n\n /**\n * Handle socket errors\n */\n onError (err) {\n debug('socket error', err)\n this.state = STATES.ERROR\n this.emit('error', err)\n this.destroy()\n }\n\n /**\n * Handle socket close\n */\n onClose () {\n debug('socket closed')\n this.state = STATES.CLOSED\n this.emit('close')\n }\n\n /**\n * Destroy the client and underlying socket\n */\n destroy () {\n if (this.socket && !this.socket.destroyed) {\n this.socket.destroy()\n }\n }\n\n markAuthenticated () {\n this.state = STATES.AUTHENTICATED\n this.emit('authenticated')\n }\n\n /**\n * Start the SOCKS5 handshake\n */\n handshake () {\n if (this.state !== STATES.INITIAL) {\n throw new InvalidArgumentError('Handshake already started')\n }\n\n debug('starting handshake with', this.authMethods.length, 'auth methods')\n this.state = STATES.HANDSHAKING\n\n // Build handshake request\n // +----+----------+----------+\n // |VER | NMETHODS | METHODS |\n // +----+----------+----------+\n // | 1 | 1 | 1 to 255 |\n // +----+----------+----------+\n const request = Buffer.alloc(2 + this.authMethods.length)\n request[0] = SOCKS_VERSION\n request[1] = this.authMethods.length\n this.authMethods.forEach((method, i) => {\n request[2 + i] = method\n })\n\n this.socket.write(request)\n }\n\n /**\n * Handle handshake response from server\n */\n handleHandshakeResponse () {\n if (this.buffer.length < 2) {\n return // Not enough data yet\n }\n\n const version = this.buffer[0]\n const method = this.buffer[1]\n\n if (version !== SOCKS_VERSION) {\n throw new Socks5ProxyError(`Invalid SOCKS version: ${version}`, 'UND_ERR_SOCKS5_VERSION')\n }\n\n if (method === AUTH_METHODS.NO_ACCEPTABLE) {\n throw new Socks5ProxyError('No acceptable authentication method', 'UND_ERR_SOCKS5_AUTH_REJECTED')\n }\n\n this.buffer = this.buffer.subarray(2)\n debug('server selected auth method', method)\n\n if (method === AUTH_METHODS.NO_AUTH) {\n this.markAuthenticated()\n } else if (method === AUTH_METHODS.USERNAME_PASSWORD) {\n this.state = STATES.AUTHENTICATING\n this.sendAuthRequest()\n } else {\n throw new Socks5ProxyError(`Unsupported authentication method: ${method}`, 'UND_ERR_SOCKS5_AUTH_METHOD')\n }\n }\n\n /**\n * Send username/password authentication request\n */\n sendAuthRequest () {\n const { username, password } = this.options\n\n if (!username || !password) {\n throw new InvalidArgumentError('Username and password required for authentication')\n }\n\n debug('sending username/password auth')\n\n // Username/Password authentication request (RFC 1929)\n // +----+------+----------+------+----------+\n // |VER | ULEN | UNAME | PLEN | PASSWD |\n // +----+------+----------+------+----------+\n // | 1 | 1 | 1 to 255 | 1 | 1 to 255 |\n // +----+------+----------+------+----------+\n const usernameBuffer = Buffer.from(username)\n const passwordBuffer = Buffer.from(password)\n\n if (usernameBuffer.length > 255 || passwordBuffer.length > 255) {\n throw new InvalidArgumentError('Username or password too long')\n }\n\n const request = Buffer.alloc(3 + usernameBuffer.length + passwordBuffer.length)\n request[0] = 0x01 // Sub-negotiation version\n request[1] = usernameBuffer.length\n usernameBuffer.copy(request, 2)\n request[2 + usernameBuffer.length] = passwordBuffer.length\n passwordBuffer.copy(request, 3 + usernameBuffer.length)\n\n this.socket.write(request)\n }\n\n /**\n * Handle authentication response\n */\n handleAuthResponse () {\n if (this.buffer.length < 2) {\n return // Not enough data yet\n }\n\n const version = this.buffer[0]\n const status = this.buffer[1]\n\n if (version !== 0x01) {\n throw new Socks5ProxyError(`Invalid auth sub-negotiation version: ${version}`, 'UND_ERR_SOCKS5_AUTH_VERSION')\n }\n\n if (status !== 0x00) {\n throw new Socks5ProxyError('Authentication failed', 'UND_ERR_SOCKS5_AUTH_FAILED')\n }\n\n this.buffer = this.buffer.subarray(2)\n debug('authentication successful')\n this.markAuthenticated()\n }\n\n /**\n * Send CONNECT command\n * @param {string} address - Target address (IP or domain)\n * @param {number} port - Target port\n */\n connect (address, port) {\n if (this.state === STATES.CONNECTING || this.state === STATES.CONNECTED) {\n throw new InvalidArgumentError('Connection already in progress')\n }\n\n if (this.state !== STATES.AUTHENTICATED) {\n throw new InvalidArgumentError('Client must be authenticated before CONNECT')\n }\n\n debug('connecting to', address, port)\n this.state = STATES.CONNECTING\n\n const request = this.buildConnectRequest(COMMANDS.CONNECT, address, port)\n this.socket.write(request)\n }\n\n /**\n * Build a SOCKS5 request\n */\n buildConnectRequest (command, address, port) {\n // Parse address to determine type and buffer\n const { type: addressType, buffer: addressBuffer } = parseAddress(address)\n\n // Build request\n // +----+-----+-------+------+----------+----------+\n // |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |\n // +----+-----+-------+------+----------+----------+\n // | 1 | 1 | X'00' | 1 | Variable | 2 |\n // +----+-----+-------+------+----------+----------+\n const request = Buffer.alloc(4 + addressBuffer.length + 2)\n request[0] = SOCKS_VERSION\n request[1] = command\n request[2] = 0x00 // Reserved\n request[3] = addressType\n addressBuffer.copy(request, 4)\n request.writeUInt16BE(port, 4 + addressBuffer.length)\n\n return request\n }\n\n /**\n * Handle CONNECT response\n */\n handleConnectResponse () {\n if (this.buffer.length < 4) {\n return // Not enough data for header\n }\n\n const version = this.buffer[0]\n const reply = this.buffer[1]\n const addressType = this.buffer[3]\n\n if (version !== SOCKS_VERSION) {\n throw new Socks5ProxyError(`Invalid SOCKS version in reply: ${version}`, 'UND_ERR_SOCKS5_REPLY_VERSION')\n }\n\n // Calculate the expected response length\n let responseLength = 4 // VER + REP + RSV + ATYP\n if (addressType === ADDRESS_TYPES.IPV4) {\n responseLength += 4 + 2 // IPv4 + port\n } else if (addressType === ADDRESS_TYPES.DOMAIN) {\n if (this.buffer.length < 5) {\n return // Need domain length byte\n }\n responseLength += 1 + this.buffer[4] + 2 // length byte + domain + port\n } else if (addressType === ADDRESS_TYPES.IPV6) {\n responseLength += 16 + 2 // IPv6 + port\n } else {\n throw new Socks5ProxyError(`Invalid address type in reply: ${addressType}`, 'UND_ERR_SOCKS5_ADDR_TYPE')\n }\n\n if (this.buffer.length < responseLength) {\n return // Not enough data for full response\n }\n\n if (reply !== REPLY_CODES.SUCCEEDED) {\n const errorMessage = this.getReplyErrorMessage(reply)\n throw new Socks5ProxyError(`SOCKS5 connection failed: ${errorMessage}`, `UND_ERR_SOCKS5_REPLY_${reply}`)\n }\n\n // Parse bound address and port\n let boundAddress\n let offset = 4\n\n if (addressType === ADDRESS_TYPES.IPV4) {\n boundAddress = Array.from(this.buffer.subarray(offset, offset + 4)).join('.')\n offset += 4\n } else if (addressType === ADDRESS_TYPES.DOMAIN) {\n const domainLength = this.buffer[offset]\n offset += 1\n boundAddress = this.buffer.subarray(offset, offset + domainLength).toString()\n offset += domainLength\n } else if (addressType === ADDRESS_TYPES.IPV6) {\n // Parse IPv6 address from 16-byte buffer\n const parts = []\n for (let i = 0; i < 8; i++) {\n const value = this.buffer.readUInt16BE(offset + i * 2)\n parts.push(value.toString(16))\n }\n boundAddress = parts.join(':')\n offset += 16\n }\n\n const boundPort = this.buffer.readUInt16BE(offset)\n\n this.buffer = EMPTY_BUFFER\n this.state = STATES.CONNECTED\n this.socket.removeListener('data', this.onSocketData)\n\n debug('connected, bound address:', boundAddress, 'port:', boundPort)\n this.emit('connected', { address: boundAddress, port: boundPort })\n }\n\n /**\n * Get human-readable error message for reply code\n */\n getReplyErrorMessage (reply) {\n switch (reply) {\n case REPLY_CODES.GENERAL_FAILURE:\n return 'General SOCKS server failure'\n case REPLY_CODES.CONNECTION_NOT_ALLOWED:\n return 'Connection not allowed by ruleset'\n case REPLY_CODES.NETWORK_UNREACHABLE:\n return 'Network unreachable'\n case REPLY_CODES.HOST_UNREACHABLE:\n return 'Host unreachable'\n case REPLY_CODES.CONNECTION_REFUSED:\n return 'Connection refused'\n case REPLY_CODES.TTL_EXPIRED:\n return 'TTL expired'\n case REPLY_CODES.COMMAND_NOT_SUPPORTED:\n return 'Command not supported'\n case REPLY_CODES.ADDRESS_TYPE_NOT_SUPPORTED:\n return 'Address type not supported'\n default:\n return `Unknown error code: ${reply}`\n }\n }\n}\n\nmodule.exports = {\n Socks5Client,\n AUTH_METHODS,\n COMMANDS,\n ADDRESS_TYPES,\n REPLY_CODES,\n STATES\n}\n","'use strict'\n\nconst { URL } = require('node:url')\n\nlet tls // include tls conditionally since it is not always available\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { Socks5Client, STATES } = require('../core/socks5-client')\nconst { kDispatch, kClose, kDestroy } = require('../core/symbols')\nconst Pool = require('./pool')\nconst buildConnector = require('../core/connect')\nconst { debuglog } = require('node:util')\n\nconst debug = debuglog('undici:socks5-proxy')\n\nconst kProxyUrl = Symbol('proxy url')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kProxyAuth = Symbol('proxy auth')\nconst kProxyProtocol = Symbol('proxy protocol')\nconst kPools = Symbol('pools')\nconst kConnector = Symbol('connector')\nconst kRequestTls = Symbol('request tls settings')\n\n// Static flag to ensure warning is only emitted once per process\nlet experimentalWarningEmitted = false\n\n/**\n * SOCKS5 proxy agent for dispatching requests through a SOCKS5 proxy\n */\nclass Socks5ProxyAgent extends DispatcherBase {\n constructor (proxyUrl, options = {}) {\n super()\n\n // Emit experimental warning only once\n if (!experimentalWarningEmitted) {\n process.emitWarning(\n 'SOCKS5 proxy support is experimental and subject to change',\n 'ExperimentalWarning'\n )\n experimentalWarningEmitted = true\n }\n\n if (!proxyUrl) {\n throw new InvalidArgumentError('Proxy URL is mandatory')\n }\n\n // Parse proxy URL\n const url = typeof proxyUrl === 'string' ? new URL(proxyUrl) : proxyUrl\n\n if (url.protocol !== 'socks5:' && url.protocol !== 'socks:') {\n throw new InvalidArgumentError('Proxy URL must use socks5:// or socks:// protocol')\n }\n\n this[kProxyUrl] = url\n this[kProxyHeaders] = options.headers || {}\n this[kProxyProtocol] = options.proxyTls ? 'https:' : 'http:'\n this[kRequestTls] = options.requestTls\n\n // Extract auth from URL or options\n this[kProxyAuth] = {\n username: options.username || (url.username ? decodeURIComponent(url.username) : null),\n password: options.password || (url.password ? decodeURIComponent(url.password) : null)\n }\n\n // Create connector for proxy connection\n this[kConnector] = options.connect || buildConnector({\n ...options.proxyTls,\n servername: options.proxyTls?.servername || url.hostname\n })\n\n // Pools for the actual HTTP connections (with SOCKS5 tunnel connect function), keyed by origin\n this[kPools] = new Map()\n }\n\n /**\n * Create a SOCKS5 connection to the proxy\n */\n async createSocks5Connection (targetHost, targetPort) {\n const proxyHost = this[kProxyUrl].hostname\n const proxyPort = parseInt(this[kProxyUrl].port) || 1080\n\n debug('creating SOCKS5 connection to', proxyHost, proxyPort)\n\n // Connect to the SOCKS5 proxy\n const socket = await new Promise((resolve, reject) => {\n this[kConnector]({\n hostname: proxyHost,\n host: proxyHost,\n port: proxyPort,\n protocol: this[kProxyProtocol]\n }, (err, socket) => {\n if (err) {\n reject(err)\n } else {\n resolve(socket)\n }\n })\n })\n\n // Create SOCKS5 client\n const socks5Client = new Socks5Client(socket, this[kProxyAuth])\n\n // Handle SOCKS5 errors\n socks5Client.on('error', (err) => {\n debug('SOCKS5 error:', err)\n socket.destroy()\n })\n\n // Perform SOCKS5 handshake\n await socks5Client.handshake()\n\n // Wait for authentication (if required)\n await new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n reject(new Error('SOCKS5 authentication timeout'))\n }, 5000)\n\n const onAuthenticated = () => {\n clearTimeout(timeout)\n socks5Client.removeListener('error', onError)\n resolve()\n }\n\n const onError = (err) => {\n clearTimeout(timeout)\n socks5Client.removeListener('authenticated', onAuthenticated)\n reject(err)\n }\n\n // Check if already authenticated (for NO_AUTH method)\n if (socks5Client.state === STATES.AUTHENTICATED) {\n clearTimeout(timeout)\n resolve()\n } else {\n socks5Client.once('authenticated', onAuthenticated)\n socks5Client.once('error', onError)\n }\n })\n\n // Send CONNECT command\n await socks5Client.connect(targetHost, targetPort)\n\n // Wait for connection\n await new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n reject(new Error('SOCKS5 connection timeout'))\n }, 5000)\n\n const onConnected = (info) => {\n debug('SOCKS5 tunnel established to', targetHost, targetPort, 'via', info)\n clearTimeout(timeout)\n socks5Client.removeListener('error', onError)\n resolve()\n }\n\n const onError = (err) => {\n clearTimeout(timeout)\n socks5Client.removeListener('connected', onConnected)\n reject(err)\n }\n\n socks5Client.once('connected', onConnected)\n socks5Client.once('error', onError)\n })\n\n return socket\n }\n\n /**\n * Dispatch a request through the SOCKS5 proxy\n */\n [kDispatch] (opts, handler) {\n const { origin } = opts\n\n debug('dispatching request to', origin, 'via SOCKS5')\n\n try {\n const originKey = String(origin)\n let pool = this[kPools].get(originKey)\n // Create a Pool per origin so requests are not routed to the wrong host\n if (!pool || pool.destroyed || pool.closed) {\n pool = new Pool(origin, {\n pipelining: opts.pipelining,\n connections: opts.connections,\n connect: async (connectOpts, callback) => {\n try {\n const url = new URL(origin)\n const targetHost = url.hostname\n const targetPort = parseInt(url.port) || (url.protocol === 'https:' ? 443 : 80)\n\n debug('establishing SOCKS5 connection to', targetHost, targetPort)\n\n // Create SOCKS5 tunnel\n const socket = await this.createSocks5Connection(targetHost, targetPort)\n\n // Handle TLS if needed\n let finalSocket = socket\n if (url.protocol === 'https:') {\n if (!tls) {\n tls = require('node:tls')\n }\n debug('upgrading to TLS')\n finalSocket = tls.connect({\n ...this[kRequestTls],\n socket,\n servername: this[kRequestTls]?.servername || targetHost\n })\n\n await new Promise((resolve, reject) => {\n finalSocket.once('secureConnect', resolve)\n finalSocket.once('error', reject)\n })\n }\n\n callback(null, finalSocket)\n } catch (err) {\n debug('SOCKS5 connection error:', err)\n callback(err)\n }\n }\n })\n this[kPools].set(originKey, pool)\n }\n\n // Dispatch the request through the per-origin pool\n return pool[kDispatch](opts, handler)\n } catch (err) {\n debug('dispatch error:', err)\n if (typeof handler.onResponseError === 'function') {\n handler.onResponseError(null, err)\n return false\n } else if (typeof handler.onError === 'function') {\n handler.onError(err)\n return false\n } else {\n throw err\n }\n }\n }\n\n async [kClose] () {\n const closePromises = []\n for (const pool of this[kPools].values()) {\n closePromises.push(pool.close())\n }\n this[kPools].clear()\n await Promise.all(closePromises)\n }\n\n async [kDestroy] (err) {\n const destroyPromises = []\n for (const pool of this[kPools].values()) {\n destroyPromises.push(pool.destroy(err))\n }\n this[kPools].clear()\n await Promise.all(destroyPromises)\n }\n}\n\nmodule.exports = Socks5ProxyAgent\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\nconst { channels } = require('../core/diagnostics')\nconst Socks5ProxyAgent = require('./socks5-proxy-agent')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n if (opts.connections === 1) {\n return new Client(origin, opts)\n }\n return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n #client\n\n constructor (proxyUrl, { headers = {}, connect, factory }) {\n if (!proxyUrl) {\n throw new InvalidArgumentError('Proxy URL is mandatory')\n }\n\n super()\n\n this[kProxyHeaders] = headers\n if (factory) {\n this.#client = factory(proxyUrl, { connect })\n } else {\n this.#client = new Client(proxyUrl, { connect })\n }\n }\n\n [kDispatch] (opts, handler) {\n const onHeaders = handler.onHeaders\n handler.onHeaders = function (statusCode, data, resume) {\n if (statusCode === 407) {\n if (typeof handler.onError === 'function') {\n handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n }\n return\n }\n if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n }\n\n // Rewrite request as an HTTP1 Proxy request, without tunneling.\n const {\n origin,\n path = '/',\n headers = {}\n } = opts\n\n opts.path = origin + path\n\n if (!('host' in headers) && !('Host' in headers)) {\n const { host } = new URL(origin)\n headers.host = host\n }\n opts.headers = { ...this[kProxyHeaders], ...headers }\n\n return this.#client[kDispatch](opts, handler)\n }\n\n [kClose] () {\n return this.#client.close()\n }\n\n [kDestroy] (err) {\n return this.#client.destroy(err)\n }\n}\n\nclass ProxyAgent extends DispatcherBase {\n constructor (opts) {\n if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n throw new InvalidArgumentError('Proxy uri is mandatory')\n }\n\n const { clientFactory = defaultFactory } = opts\n if (typeof clientFactory !== 'function') {\n throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n }\n\n const { proxyTunnel = true } = opts\n\n super()\n\n const url = this.#getUrl(opts)\n const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n this[kProxy] = { uri: href, protocol }\n this[kRequestTls] = opts.requestTls\n this[kProxyTls] = opts.proxyTls\n this[kProxyHeaders] = opts.headers || {}\n this[kTunnelProxy] = proxyTunnel\n\n if (opts.auth && opts.token) {\n throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n } else if (opts.auth) {\n /* @deprecated in favour of opts.token */\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n } else if (opts.token) {\n this[kProxyHeaders]['proxy-authorization'] = opts.token\n } else if (username && password) {\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n }\n\n const connect = buildConnector({ ...opts.proxyTls })\n this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n const agentFactory = opts.factory || defaultAgentFactory\n const factory = (origin, options) => {\n const { protocol } = new URL(origin)\n\n // Handle SOCKS5 proxy\n if (this[kProxy].protocol === 'socks5:' || this[kProxy].protocol === 'socks:') {\n return new Socks5ProxyAgent(this[kProxy].uri, {\n headers: this[kProxyHeaders],\n connect,\n factory: agentFactory,\n username: opts.username || username,\n password: opts.password || password,\n proxyTls: opts.proxyTls,\n requestTls: opts.requestTls\n })\n }\n\n if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n return new Http1ProxyWrapper(this[kProxy].uri, {\n headers: this[kProxyHeaders],\n connect,\n factory: agentFactory\n })\n }\n return agentFactory(origin, options)\n }\n\n // For SOCKS5 proxies, we don't need a client to the proxy itself\n // The SOCKS5 connection is handled within Socks5ProxyAgent\n if (protocol === 'socks5:' || protocol === 'socks:') {\n this[kClient] = null\n } else {\n this[kClient] = clientFactory(url, { connect })\n }\n\n this[kAgent] = new Agent({\n ...opts,\n factory,\n connect: async (opts, callback) => {\n // SOCKS5 proxies handle their own connections via Socks5ProxyAgent,\n // so this connect function should never be called for them.\n if (!this[kClient]) {\n callback(new InvalidArgumentError('Cannot establish tunnel connection without a proxy client'))\n return\n }\n\n let requestedPath = opts.host\n if (!opts.port) {\n requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n }\n try {\n const connectParams = {\n origin,\n port,\n path: requestedPath,\n signal: opts.signal,\n headers: {\n ...this[kProxyHeaders],\n host: opts.host,\n ...(opts.connections == null || opts.connections > 0 ? { 'proxy-connection': 'keep-alive' } : {})\n },\n servername: this[kProxyTls]?.servername || proxyHostname\n }\n const { socket, statusCode } = await this[kClient].connect(connectParams)\n if (statusCode !== 200) {\n socket.on('error', noop).destroy()\n callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n return\n }\n\n if (channels.proxyConnected.hasSubscribers) {\n channels.proxyConnected.publish({\n socket,\n connectParams\n })\n }\n\n if (opts.protocol !== 'https:') {\n callback(null, socket)\n return\n }\n let servername\n if (this[kRequestTls]) {\n servername = this[kRequestTls].servername\n } else {\n servername = opts.servername\n }\n this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n } catch (err) {\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n // Throw a custom error to avoid loop in client.js#connect\n callback(new SecureProxyConnectionError(err))\n } else {\n callback(err)\n }\n }\n }\n })\n }\n\n dispatch (opts, handler) {\n const headers = buildHeaders(opts.headers)\n throwIfProxyAuthIsSent(headers)\n\n if (headers && !('host' in headers) && !('Host' in headers)) {\n const { host } = new URL(opts.origin)\n headers.host = host\n }\n\n return this[kAgent].dispatch(\n {\n ...opts,\n headers\n },\n handler\n )\n }\n\n /**\n * @param {import('../../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n * @returns {URL}\n */\n #getUrl (opts) {\n if (typeof opts === 'string') {\n return new URL(opts)\n } else if (opts instanceof URL) {\n return opts\n } else {\n return new URL(opts.uri)\n }\n }\n\n [kClose] () {\n const promises = [this[kAgent].close()]\n if (this[kClient]) {\n promises.push(this[kClient].close())\n }\n return Promise.all(promises)\n }\n\n [kDestroy] () {\n const promises = [this[kAgent].destroy()]\n if (this[kClient]) {\n promises.push(this[kClient].destroy())\n }\n return Promise.all(promises)\n }\n}\n\n/**\n * @param {string[] | Record<string, string>} headers\n * @returns {Record<string, string>}\n */\nfunction buildHeaders (headers) {\n // When using undici.fetch, the headers list is stored\n // as an array.\n if (Array.isArray(headers)) {\n /** @type {Record<string, string>} */\n const headersPair = {}\n\n for (let i = 0; i < headers.length; i += 2) {\n headersPair[headers[i]] = headers[i + 1]\n }\n\n return headersPair\n }\n\n return headers\n}\n\n/**\n * @param {Record<string, string>} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n const existProxyAuth = headers && Object.keys(headers)\n .find((key) => key.toLowerCase() === 'proxy-authorization')\n if (existProxyAuth) {\n throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n 'http:': 80,\n 'https:': 443\n}\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n #noProxyValue = null\n #noProxyEntries = null\n #opts = null\n\n constructor (opts = {}) {\n super()\n this.#opts = opts\n\n const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n this[kNoProxyAgent] = new Agent(agentOpts)\n\n const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n if (HTTP_PROXY) {\n this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n } else {\n this[kHttpProxyAgent] = this[kNoProxyAgent]\n }\n\n const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n if (HTTPS_PROXY) {\n this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n } else {\n this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n }\n\n this.#parseNoProxy()\n }\n\n [kDispatch] (opts, handler) {\n const url = new URL(opts.origin)\n const agent = this.#getProxyAgentForUrl(url)\n return agent.dispatch(opts, handler)\n }\n\n [kClose] () {\n return Promise.all([\n this[kNoProxyAgent].close(),\n !this[kHttpProxyAgent][kClosed] && this[kHttpProxyAgent].close(),\n !this[kHttpsProxyAgent][kClosed] && this[kHttpsProxyAgent].close()\n ])\n }\n\n [kDestroy] (err) {\n return Promise.all([\n this[kNoProxyAgent].destroy(err),\n !this[kHttpProxyAgent][kDestroyed] && this[kHttpProxyAgent].destroy(err),\n !this[kHttpsProxyAgent][kDestroyed] && this[kHttpsProxyAgent].destroy(err)\n ])\n }\n\n #getProxyAgentForUrl (url) {\n let { protocol, host: hostname, port } = url\n\n // Stripping ports in this way instead of using parsedUrl.hostname to make\n // sure that the brackets around IPv6 addresses are kept.\n hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n if (!this.#shouldProxy(hostname, port)) {\n return this[kNoProxyAgent]\n }\n if (protocol === 'https:') {\n return this[kHttpsProxyAgent]\n }\n return this[kHttpProxyAgent]\n }\n\n #shouldProxy (hostname, port) {\n if (this.#noProxyChanged) {\n this.#parseNoProxy()\n }\n\n if (this.#noProxyEntries.length === 0) {\n return true // Always proxy if NO_PROXY is not set or empty.\n }\n if (this.#noProxyValue === '*') {\n return false // Never proxy if wildcard is set.\n }\n\n for (let i = 0; i < this.#noProxyEntries.length; i++) {\n const entry = this.#noProxyEntries[i]\n if (entry.port && entry.port !== port) {\n continue // Skip if ports don't match.\n }\n // Don't proxy if the hostname is equal with the no_proxy host.\n if (hostname === entry.hostname) {\n return false\n }\n // Don't proxy if the hostname is the subdomain of the no_proxy host.\n // Reference - https://github.com/denoland/deno/blob/6fbce91e40cc07fc6da74068e5cc56fdd40f7b4c/ext/fetch/proxy.rs#L485\n if (hostname.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) {\n return false\n }\n }\n\n return true\n }\n\n #parseNoProxy () {\n const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n const noProxySplit = noProxyValue.split(/[,\\s]/)\n const noProxyEntries = []\n\n for (let i = 0; i < noProxySplit.length; i++) {\n const entry = noProxySplit[i]\n if (!entry) {\n continue\n }\n const parsed = entry.match(/^(.+):(\\d+)$/)\n noProxyEntries.push({\n // strip leading dot or asterisk with dot\n hostname: (parsed ? parsed[1] : entry).replace(/^\\*?\\./, '').toLowerCase(),\n port: parsed ? Number.parseInt(parsed[2], 10) : 0\n })\n }\n\n this.#noProxyValue = noProxyValue\n this.#noProxyEntries = noProxyEntries\n }\n\n get #noProxyChanged () {\n if (this.#opts.noProxy !== undefined) {\n return false\n }\n return this.#noProxyValue !== this.#noProxyEnv\n }\n\n get #noProxyEnv () {\n return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst WrapHandler = require('./wrap-handler')\nconst {\n isDisturbed,\n parseRangeHeader,\n wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n const retryTime = new Date(retryAfter).getTime()\n return isNaN(retryTime) ? 0 : retryTime - Date.now()\n}\n\nfunction validatePartialResponseContentLength (headers, range, statusCode, retryCount) {\n const contentLength = headers['content-length']\n if (contentLength == null) {\n return\n }\n\n if (!Number.isFinite(range.start) || !Number.isFinite(range.end)) {\n return\n }\n\n const length = Number(contentLength)\n const expectedLength = range.end - range.start + 1\n if (!Number.isFinite(length) || length !== expectedLength) {\n throw new RequestRetryError('Content-Length mismatch', statusCode, {\n headers,\n data: { count: retryCount }\n })\n }\n}\n\nclass RetryHandler {\n constructor (opts, { dispatch, handler }) {\n const { retryOptions, ...dispatchOpts } = opts\n const {\n // Retry scoped\n retry: retryFn,\n maxRetries,\n maxTimeout,\n minTimeout,\n timeoutFactor,\n // Response scoped\n methods,\n errorCodes,\n retryAfter,\n statusCodes,\n throwOnError\n } = retryOptions ?? {}\n\n this.error = null\n this.dispatch = dispatch\n this.handler = WrapHandler.wrap(handler)\n this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n this.retryOpts = {\n throwOnError: throwOnError ?? true,\n retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n retryAfter: retryAfter ?? true,\n maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n minTimeout: minTimeout ?? 500, // .5s\n timeoutFactor: timeoutFactor ?? 2,\n maxRetries: maxRetries ?? 5,\n // What errors we should retry\n methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n // Indicates which errors to retry\n statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n // List of errors to retry\n errorCodes: errorCodes ?? [\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'ENOTFOUND',\n 'ENETDOWN',\n 'ENETUNREACH',\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'EPIPE',\n 'UND_ERR_SOCKET'\n ]\n }\n\n this.retryCount = 0\n this.retryCountCheckpoint = 0\n this.headersSent = false\n this.start = 0\n this.end = null\n this.etag = null\n }\n\n onResponseStartWithRetry (controller, statusCode, headers, statusMessage, err) {\n if (this.retryOpts.throwOnError) {\n // Preserve old behavior for status codes that are not eligible for retry\n if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n if (this.headersSent) {\n // The downstream handler already received the response from an\n // earlier attempt. Forwarding this response would replace the\n // downstream body and leave the original body pending forever.\n this.handler.onResponseError?.(controller, err)\n } else {\n this.headersSent = true\n this.checkpointResponseEnd(headers)\n this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage)\n }\n } else {\n this.error = err\n }\n\n return\n }\n\n if (isDisturbed(this.opts.body)) {\n this.headersSent = true\n this.checkpointResponseEnd(headers)\n this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage)\n return\n }\n\n function shouldRetry (passedErr) {\n if (passedErr) {\n if (this.headersSent) {\n // The downstream handler already received the response from an\n // earlier attempt. Forwarding this response would replace the\n // downstream body and leave the original body pending forever.\n this.handler.onResponseError?.(controller, passedErr)\n } else {\n this.headersSent = true\n this.checkpointResponseEnd(headers)\n this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage)\n }\n controller.resume()\n return\n }\n\n this.error = err\n controller.resume()\n }\n\n controller.pause()\n this.retryOpts.retry(\n err,\n {\n state: { counter: this.retryCount },\n opts: { retryOptions: this.retryOpts, ...this.opts }\n },\n shouldRetry.bind(this)\n )\n }\n\n checkpointResponseEnd (headers) {\n if (this.end == null && this.opts.method !== 'HEAD') {\n const contentLength = headers['content-length']\n this.end = contentLength != null ? Number(contentLength) - 1 : null\n\n assert(\n this.end == null || Number.isFinite(this.end),\n 'invalid content-length'\n )\n\n this.resume = this.end != null\n }\n }\n\n onRequestStart (controller, context) {\n if (!this.headersSent) {\n this.handler.onRequestStart?.(controller, context)\n }\n }\n\n onRequestUpgrade (controller, statusCode, headers, socket) {\n this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket)\n }\n\n static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n const { statusCode, code, headers } = err\n const { method, retryOptions } = opts\n const {\n maxRetries,\n minTimeout,\n maxTimeout,\n timeoutFactor,\n statusCodes,\n errorCodes,\n methods\n } = retryOptions\n const { counter } = state\n\n // Any code that is not a Undici's originated and allowed to retry\n if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n cb(err)\n return\n }\n\n // If a set of method are provided and the current method is not in the list\n if (Array.isArray(methods) && !methods.includes(method)) {\n cb(err)\n return\n }\n\n // If a set of status code are provided and the current status code is not in the list\n if (\n statusCode != null &&\n Array.isArray(statusCodes) &&\n !statusCodes.includes(statusCode)\n ) {\n cb(err)\n return\n }\n\n // If we reached the max number of retries\n if (counter > maxRetries) {\n cb(err)\n return\n }\n\n let retryAfterHeader = headers?.['retry-after']\n if (retryAfterHeader) {\n retryAfterHeader = Number(retryAfterHeader)\n retryAfterHeader = Number.isNaN(retryAfterHeader)\n ? calculateRetryAfterHeader(headers['retry-after'])\n : retryAfterHeader * 1e3 // Retry-After is in seconds\n }\n\n const retryTimeout =\n retryAfterHeader > 0\n ? Math.min(retryAfterHeader, maxTimeout)\n : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n setTimeout(() => cb(null), retryTimeout)\n }\n\n onResponseStart (controller, statusCode, headers, statusMessage) {\n this.error = null\n this.retryCount += 1\n\n if (statusCode >= 300) {\n const err = new RequestRetryError('Request failed', statusCode, {\n headers,\n data: {\n count: this.retryCount\n }\n })\n\n this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err)\n return\n }\n\n // Checkpoint for resume from where we left it\n if (this.headersSent) {\n // Only Partial Content 206 supposed to provide Content-Range,\n // any other status code that partially consumed the payload\n // should not be retried because it would result in downstream\n // wrongly concatenate multiple responses.\n if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n throw new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n }\n\n const contentRange = parseRangeHeader(headers['content-range'])\n // If no content range\n if (!contentRange) {\n // We always throw here as we want to indicate that we entred unexpected path\n throw new RequestRetryError('Content-Range mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n }\n\n // Let's start with a weak etag check\n if (this.etag != null && this.etag !== headers.etag) {\n // We always throw here as we want to indicate that we entred unexpected path\n throw new RequestRetryError('ETag mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n }\n\n validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount)\n\n const { start, size, end = size ? size - 1 : null } = contentRange\n\n if (this.start !== start || (this.end != null && this.end !== end)) {\n throw new RequestRetryError('Content-Range mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n }\n\n return\n }\n\n if (this.end == null) {\n if (statusCode === 206) {\n // First time we receive 206\n const range = parseRangeHeader(headers['content-range'])\n\n if (range == null) {\n this.headersSent = true\n this.handler.onResponseStart?.(\n controller,\n statusCode,\n headers,\n statusMessage\n )\n return\n }\n\n validatePartialResponseContentLength(headers, range, statusCode, this.retryCount)\n\n const { start, size, end = size ? size - 1 : null } = range\n assert(\n start != null && Number.isFinite(start),\n 'content-range mismatch'\n )\n assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n this.start = start\n this.end = end\n }\n\n // We make our best to checkpoint the body for further range headers\n if (this.end == null) {\n const contentLength = headers['content-length']\n this.end = contentLength != null ? Number(contentLength) - 1 : null\n }\n\n assert(Number.isFinite(this.start))\n assert(\n this.end == null || Number.isFinite(this.end),\n 'invalid content-length'\n )\n\n this.resume = true\n this.etag = headers.etag != null ? headers.etag : null\n\n // Weak etags are not useful for comparison nor cache\n // for instance not safe to assume if the response is byte-per-byte\n // equal\n if (\n this.etag != null &&\n this.etag[0] === 'W' &&\n this.etag[1] === '/'\n ) {\n this.etag = null\n }\n\n this.headersSent = true\n this.handler.onResponseStart?.(\n controller,\n statusCode,\n headers,\n statusMessage\n )\n } else {\n throw new RequestRetryError('Request failed', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n }\n }\n\n onResponseData (controller, chunk) {\n if (this.error) {\n return\n }\n\n this.start += chunk.length\n\n this.handler.onResponseData?.(controller, chunk)\n }\n\n onResponseEnd (controller, trailers) {\n if (this.error && this.retryOpts.throwOnError) {\n throw this.error\n }\n\n if (!this.error) {\n this.retryCount = 0\n return this.handler.onResponseEnd?.(controller, trailers)\n }\n\n this.retry(controller)\n }\n\n retry (controller) {\n if (this.start !== 0) {\n const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n // Weak etag check - weak etags will make comparison algorithms never match\n if (this.etag != null) {\n headers['if-match'] = this.etag\n }\n\n this.opts = {\n ...this.opts,\n headers: {\n ...this.opts.headers,\n ...headers\n }\n }\n }\n\n try {\n this.retryCountCheckpoint = this.retryCount\n this.dispatch(this.opts, this)\n } catch (err) {\n this.handler.onResponseError?.(controller, err)\n }\n }\n\n onResponseError (controller, err) {\n if (controller?.aborted || isDisturbed(this.opts.body) || (this.headersSent && !this.resume)) {\n this.handler.onResponseError?.(controller, err)\n return\n }\n\n function shouldRetry (returnedErr) {\n if (!returnedErr) {\n this.retry(controller)\n return\n }\n\n this.handler?.onResponseError?.(controller, returnedErr)\n }\n\n // We reconcile in case of a mix between network errors\n // and server error response\n if (this.retryCount - this.retryCountCheckpoint > 0) {\n // We count the difference between the last checkpoint and the current retry count\n this.retryCount =\n this.retryCountCheckpoint +\n (this.retryCount - this.retryCountCheckpoint)\n } else {\n this.retryCount += 1\n }\n\n this.retryOpts.retry(\n err,\n {\n state: { counter: this.retryCount },\n opts: { retryOptions: this.retryOpts, ...this.opts }\n },\n shouldRetry.bind(this)\n )\n }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n #agent = null\n #options = null\n constructor (agent, options = {}) {\n super(options)\n this.#agent = agent\n this.#options = options\n }\n\n dispatch (opts, handler) {\n const retry = new RetryHandler({\n ...opts,\n retryOptions: this.#options\n }, {\n dispatch: this.#agent.dispatch.bind(this.#agent),\n handler\n })\n return this.#agent.dispatch(opts, retry)\n }\n\n close () {\n return this.#agent.close()\n }\n\n destroy () {\n return this.#agent.destroy()\n }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst Client = require('./client')\n\nclass H2CClient extends Client {\n constructor (origin, clientOpts) {\n if (typeof origin === 'string') {\n origin = new URL(origin)\n }\n\n if (origin.protocol !== 'http:') {\n throw new InvalidArgumentError(\n 'h2c-client: Only h2c protocol is supported'\n )\n }\n\n const { maxConcurrentStreams, pipelining, ...opts } =\n clientOpts ?? {}\n let defaultMaxConcurrentStreams = 100\n let defaultPipelining = 100\n\n if (\n maxConcurrentStreams != null &&\n Number.isInteger(maxConcurrentStreams) &&\n maxConcurrentStreams > 0\n ) {\n defaultMaxConcurrentStreams = maxConcurrentStreams\n }\n\n if (pipelining != null && Number.isInteger(pipelining) && pipelining > 0) {\n defaultPipelining = pipelining\n }\n\n if (defaultPipelining > defaultMaxConcurrentStreams) {\n throw new InvalidArgumentError(\n 'h2c-client: pipelining cannot be greater than maxConcurrentStreams'\n )\n }\n\n super(origin, {\n ...opts,\n maxConcurrentStreams: defaultMaxConcurrentStreams,\n pipelining: defaultPipelining,\n allowH2: true,\n useH2c: true\n })\n }\n}\n\nmodule.exports = H2CClient\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\nconst kUsed = Symbol('kUsed')\nconst kBytesRead = Symbol('kBytesRead')\n\nconst noop = () => {}\n\n/**\n * @class\n * @extends {Readable}\n * @see https://fetch.spec.whatwg.org/#body\n */\nclass BodyReadable extends Readable {\n /**\n * @param {object} opts\n * @param {(this: Readable, size: number) => void} opts.resume\n * @param {() => (void | null)} opts.abort\n * @param {string} [opts.contentType = '']\n * @param {number} [opts.contentLength]\n * @param {number} [opts.highWaterMark = 64 * 1024]\n */\n constructor ({\n resume,\n abort,\n contentType = '',\n contentLength,\n highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n }) {\n super({\n autoDestroy: true,\n read: resume,\n highWaterMark\n })\n\n this._readableState.dataEmitted = false\n\n this[kAbort] = abort\n\n /** @type {Consume | null} */\n this[kConsume] = null\n\n /** @type {number} */\n this[kBytesRead] = 0\n\n /** @type {ReadableStream|null} */\n this[kBody] = null\n\n /** @type {boolean} */\n this[kUsed] = false\n\n /** @type {string} */\n this[kContentType] = contentType\n\n /** @type {number|null} */\n this[kContentLength] = Number.isFinite(contentLength) ? contentLength : null\n\n /**\n * Is stream being consumed through Readable API?\n * This is an optimization so that we avoid checking\n * for 'data' and 'readable' listeners in the hot path\n * inside push().\n *\n * @type {boolean}\n */\n this[kReading] = false\n }\n\n /**\n * @param {Error|null} err\n * @param {(error:(Error|null)) => void} callback\n * @returns {void}\n */\n _destroy (err, callback) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (err) {\n this[kAbort]()\n }\n\n // Workaround for Node \"bug\". If the stream is destroyed in same\n // tick as it is created, then a user who is waiting for a\n // promise (i.e micro tick) for installing an 'error' listener will\n // never get a chance and will always encounter an unhandled exception.\n if (!this[kUsed]) {\n setImmediate(callback, err)\n } else {\n callback(err)\n }\n }\n\n /**\n * @param {string|symbol} event\n * @param {(...args: any[]) => void} listener\n * @returns {this}\n */\n on (event, listener) {\n if (event === 'data' || event === 'readable') {\n this[kReading] = true\n this[kUsed] = true\n }\n return super.on(event, listener)\n }\n\n /**\n * @param {string|symbol} event\n * @param {(...args: any[]) => void} listener\n * @returns {this}\n */\n addListener (event, listener) {\n return this.on(event, listener)\n }\n\n /**\n * @param {string|symbol} event\n * @param {(...args: any[]) => void} listener\n * @returns {this}\n */\n off (event, listener) {\n const ret = super.off(event, listener)\n if (event === 'data' || event === 'readable') {\n this[kReading] = (\n this.listenerCount('data') > 0 ||\n this.listenerCount('readable') > 0\n )\n }\n return ret\n }\n\n /**\n * @param {string|symbol} event\n * @param {(...args: any[]) => void} listener\n * @returns {this}\n */\n removeListener (event, listener) {\n return this.off(event, listener)\n }\n\n /**\n * @param {Buffer|null} chunk\n * @returns {boolean}\n */\n push (chunk) {\n if (chunk) {\n this[kBytesRead] += chunk.length\n if (this[kConsume]) {\n consumePush(this[kConsume], chunk)\n return this[kReading] ? super.push(chunk) : true\n }\n }\n\n return super.push(chunk)\n }\n\n /**\n * Consumes and returns the body as a string.\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-text\n * @returns {Promise<string>}\n */\n text () {\n return consume(this, 'text')\n }\n\n /**\n * Consumes and returns the body as a JavaScript Object.\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-json\n * @returns {Promise<unknown>}\n */\n json () {\n return consume(this, 'json')\n }\n\n /**\n * Consumes and returns the body as a Blob\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-blob\n * @returns {Promise<Blob>}\n */\n blob () {\n return consume(this, 'blob')\n }\n\n /**\n * Consumes and returns the body as an Uint8Array.\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-bytes\n * @returns {Promise<Uint8Array>}\n */\n bytes () {\n return consume(this, 'bytes')\n }\n\n /**\n * Consumes and returns the body as an ArrayBuffer.\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n * @returns {Promise<ArrayBuffer>}\n */\n arrayBuffer () {\n return consume(this, 'arrayBuffer')\n }\n\n /**\n * Not implemented\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-formdata\n * @throws {NotSupportedError}\n */\n async formData () {\n // TODO: Implement.\n throw new NotSupportedError()\n }\n\n /**\n * Returns true if the body is not null and the body has been consumed.\n * Otherwise, returns false.\n *\n * @see https://fetch.spec.whatwg.org/#dom-body-bodyused\n * @readonly\n * @returns {boolean}\n */\n get bodyUsed () {\n return util.isDisturbed(this)\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#dom-body-body\n * @readonly\n * @returns {ReadableStream}\n */\n get body () {\n if (!this[kBody]) {\n this[kBody] = ReadableStreamFrom(this)\n if (this[kConsume]) {\n // TODO: Is this the best way to force a lock?\n this[kBody].getReader() // Ensure stream is locked.\n assert(this[kBody].locked)\n }\n }\n return this[kBody]\n }\n\n /**\n * Dumps the response body by reading `limit` number of bytes.\n * @param {object} opts\n * @param {number} [opts.limit = 131072] Number of bytes to read.\n * @param {AbortSignal} [opts.signal] An AbortSignal to cancel the dump.\n * @returns {Promise<null>}\n */\n dump (opts) {\n const signal = opts?.signal\n\n if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n return Promise.reject(new InvalidArgumentError('signal must be an AbortSignal'))\n }\n\n const limit = opts?.limit && Number.isFinite(opts.limit)\n ? opts.limit\n : 128 * 1024\n\n if (signal?.aborted) {\n return Promise.reject(signal.reason ?? new AbortError())\n }\n\n if (this._readableState.closeEmitted) {\n return Promise.resolve(null)\n }\n\n return new Promise((resolve, reject) => {\n if (\n (this[kContentLength] && (this[kContentLength] > limit)) ||\n this[kBytesRead] > limit\n ) {\n this.destroy(new AbortError())\n }\n\n if (signal) {\n const onAbort = () => {\n this.destroy(signal.reason ?? new AbortError())\n }\n signal.addEventListener('abort', onAbort)\n this\n .on('close', function () {\n signal.removeEventListener('abort', onAbort)\n if (signal.aborted) {\n reject(signal.reason ?? new AbortError())\n } else {\n resolve(null)\n }\n })\n } else {\n this.on('close', resolve)\n }\n\n this\n .on('error', noop)\n .on('data', () => {\n if (this[kBytesRead] > limit) {\n this.destroy()\n }\n })\n .resume()\n })\n }\n\n /**\n * @param {BufferEncoding} encoding\n * @returns {this}\n */\n setEncoding (encoding) {\n if (Buffer.isEncoding(encoding)) {\n this._readableState.encoding = encoding\n }\n return this\n }\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestream-locked\n * @param {BodyReadable} bodyReadable\n * @returns {boolean}\n */\nfunction isLocked (bodyReadable) {\n // Consume is an implicit lock.\n return bodyReadable[kBody]?.locked === true || bodyReadable[kConsume] !== null\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-unusable\n * @param {BodyReadable} bodyReadable\n * @returns {boolean}\n */\nfunction isUnusable (bodyReadable) {\n return util.isDisturbed(bodyReadable) || isLocked(bodyReadable)\n}\n\n/**\n * @typedef {'text' | 'json' | 'blob' | 'bytes' | 'arrayBuffer'} ConsumeType\n */\n\n/**\n * @template {ConsumeType} T\n * @typedef {T extends 'text' ? string :\n * T extends 'json' ? unknown :\n * T extends 'blob' ? Blob :\n * T extends 'arrayBuffer' ? ArrayBuffer :\n * T extends 'bytes' ? Uint8Array :\n * never\n * } ConsumeReturnType\n */\n/**\n * @typedef {object} Consume\n * @property {ConsumeType} type\n * @property {BodyReadable} stream\n * @property {((value?: any) => void)} resolve\n * @property {((err: Error) => void)} reject\n * @property {number} length\n * @property {Buffer[]} body\n */\n\n/**\n * @template {ConsumeType} T\n * @param {BodyReadable} stream\n * @param {T} type\n * @returns {Promise<ConsumeReturnType<T>>}\n */\nfunction consume (stream, type) {\n assert(!stream[kConsume])\n\n return new Promise((resolve, reject) => {\n if (isUnusable(stream)) {\n const rState = stream._readableState\n if (rState.destroyed && rState.closeEmitted === false) {\n stream\n .on('error', reject)\n .on('close', () => {\n reject(new TypeError('unusable'))\n })\n } else {\n reject(rState.errored ?? new TypeError('unusable'))\n }\n } else {\n queueMicrotask(() => {\n stream[kConsume] = {\n type,\n stream,\n resolve,\n reject,\n length: 0,\n body: []\n }\n\n stream\n .on('error', function (err) {\n consumeFinish(this[kConsume], err)\n })\n .on('close', function () {\n if (this[kConsume].body !== null) {\n consumeFinish(this[kConsume], new RequestAbortedError())\n }\n })\n\n consumeStart(stream[kConsume])\n })\n }\n })\n}\n\n/**\n * @param {Consume} consume\n * @returns {void}\n */\nfunction consumeStart (consume) {\n if (consume.body === null) {\n return\n }\n\n const { _readableState: state } = consume.stream\n\n if (state.bufferIndex) {\n const start = state.bufferIndex\n const end = state.buffer.length\n for (let n = start; n < end; n++) {\n consumePush(consume, state.buffer[n])\n }\n } else {\n for (const chunk of state.buffer) {\n consumePush(consume, chunk)\n }\n }\n\n if (state.endEmitted) {\n consumeEnd(this[kConsume], this._readableState.encoding)\n } else {\n consume.stream.on('end', function () {\n consumeEnd(this[kConsume], this._readableState.encoding)\n })\n }\n\n consume.stream.resume()\n\n while (consume.stream.read() != null) {\n // Loop\n }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @param {BufferEncoding} [encoding='utf8']\n * @returns {string}\n */\nfunction chunksDecode (chunks, length, encoding) {\n if (chunks.length === 0 || length === 0) {\n return ''\n }\n const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n const bufferLength = buffer.length\n\n // Skip BOM.\n const start =\n bufferLength > 2 &&\n buffer[0] === 0xef &&\n buffer[1] === 0xbb &&\n buffer[2] === 0xbf\n ? 3\n : 0\n if (!encoding || encoding === 'utf8' || encoding === 'utf-8') {\n return buffer.utf8Slice(start, bufferLength)\n } else {\n return buffer.subarray(start, bufferLength).toString(encoding)\n }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n if (chunks.length === 0 || length === 0) {\n return new Uint8Array(0)\n }\n if (chunks.length === 1) {\n // fast-path\n return new Uint8Array(chunks[0])\n }\n const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n let offset = 0\n for (let i = 0; i < chunks.length; ++i) {\n const chunk = chunks[i]\n buffer.set(chunk, offset)\n offset += chunk.length\n }\n\n return buffer\n}\n\n/**\n * @param {Consume} consume\n * @param {BufferEncoding} encoding\n * @returns {void}\n */\nfunction consumeEnd (consume, encoding) {\n const { type, body, resolve, stream, length } = consume\n\n try {\n if (type === 'text') {\n resolve(chunksDecode(body, length, encoding))\n } else if (type === 'json') {\n resolve(JSON.parse(chunksDecode(body, length, encoding)))\n } else if (type === 'arrayBuffer') {\n resolve(chunksConcat(body, length).buffer)\n } else if (type === 'blob') {\n resolve(new Blob(body, { type: stream[kContentType] }))\n } else if (type === 'bytes') {\n resolve(chunksConcat(body, length))\n }\n\n consumeFinish(consume)\n } catch (err) {\n stream.destroy(err)\n }\n}\n\n/**\n * @param {Consume} consume\n * @param {Buffer} chunk\n * @returns {void}\n */\nfunction consumePush (consume, chunk) {\n consume.length += chunk.length\n consume.body.push(chunk)\n}\n\n/**\n * @param {Consume} consume\n * @param {Error} [err]\n * @returns {void}\n */\nfunction consumeFinish (consume, err) {\n if (consume.body === null) {\n return\n }\n\n if (err) {\n consume.reject(err)\n } else {\n consume.resolve()\n }\n\n // Reset the consume object to allow for garbage collection.\n consume.type = null\n consume.stream = null\n consume.resolve = null\n consume.reject = null\n consume.length = 0\n consume.body = null\n}\n\nmodule.exports = {\n Readable: BodyReadable,\n chunksDecode\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\n\nfunction noop () {}\n\nclass RequestHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, highWaterMark } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (highWaterMark != null && (!Number.isFinite(highWaterMark) || highWaterMark < 0)) {\n throw new InvalidArgumentError('invalid highWaterMark')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_REQUEST')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', noop), err)\n }\n throw err\n }\n\n this.method = method\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.res = null\n this.abort = null\n this.body = body\n this.trailers = {}\n this.context = null\n this.onInfo = onInfo || null\n this.highWaterMark = highWaterMark\n this.reason = null\n this.removeAbortListener = null\n\n if (signal?.aborted) {\n this.reason = signal.reason ?? new RequestAbortedError()\n } else if (signal) {\n this.removeAbortListener = util.addAbortListener(signal, () => {\n this.reason = signal.reason ?? new RequestAbortedError()\n if (this.res) {\n util.destroy(this.res.on('error', noop), this.reason)\n } else if (this.abort) {\n this.abort(this.reason)\n }\n })\n }\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n const contentLength = parsedHeaders['content-length']\n const res = new Readable({\n resume,\n abort,\n contentType,\n contentLength: this.method !== 'HEAD' && contentLength\n ? Number(contentLength)\n : null,\n highWaterMark\n })\n\n if (this.removeAbortListener) {\n res.on('close', this.removeAbortListener)\n this.removeAbortListener = null\n }\n\n this.callback = null\n this.res = res\n if (callback !== null) {\n try {\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n statusText: statusMessage,\n headers,\n trailers: this.trailers,\n opaque,\n body: res,\n context\n })\n } catch (err) {\n // If the callback throws synchronously, we need to handle it\n // Remove reference to res to allow res being garbage collected\n this.res = null\n\n // Destroy the response stream\n util.destroy(res.on('error', noop), err)\n\n // Use queueMicrotask to re-throw the error so it reaches uncaughtException\n queueMicrotask(() => {\n throw err\n })\n }\n }\n }\n\n onData (chunk) {\n return this.res.push(chunk)\n }\n\n onComplete (trailers) {\n util.parseHeaders(trailers, this.trailers)\n this.res.push(null)\n }\n\n onError (err) {\n const { res, callback, body, opaque } = this\n\n if (callback) {\n // TODO: Does this need queueMicrotask?\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (res) {\n this.res = null\n // Ensure all queued handlers are invoked before destroying res.\n queueMicrotask(() => {\n util.destroy(res.on('error', noop), err)\n })\n }\n\n if (body) {\n this.body = null\n\n if (util.isStream(body)) {\n body.on('error', noop)\n util.destroy(body, err)\n }\n }\n\n if (this.removeAbortListener) {\n this.removeAbortListener()\n this.removeAbortListener = null\n }\n }\n}\n\nfunction request (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n request.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const handler = new RequestHandler(opts, callback)\n\n this.dispatch(opts, handler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n if (self.abort) {\n self.abort(self[kSignal]?.reason)\n } else {\n self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n }\n removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n self.reason = null\n\n self[kSignal] = null\n self[kListener] = null\n\n if (!signal) {\n return\n }\n\n if (signal.aborted) {\n abort(self)\n return\n }\n\n self[kSignal] = signal\n self[kListener] = () => {\n abort(self)\n }\n\n addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n if (!self[kSignal]) {\n return\n }\n\n if ('removeEventListener' in self[kSignal]) {\n self[kSignal].removeEventListener('abort', self[kListener])\n } else {\n self[kSignal].removeListener('abort', self[kListener])\n }\n\n self[kSignal] = null\n self[kListener] = null\n}\n\nmodule.exports = {\n addSignal,\n removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished } = require('node:stream')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nfunction noop () {}\n\nclass StreamHandler extends AsyncResource {\n constructor (opts, factory, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('invalid factory')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_STREAM')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', noop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.factory = factory\n this.callback = callback\n this.res = null\n this.abort = null\n this.context = null\n this.trailers = null\n this.body = body\n this.onInfo = onInfo || null\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { factory, opaque, context, responseHeaders } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.factory = null\n\n if (factory === null) {\n return\n }\n\n const res = this.runInAsyncScope(factory, null, {\n statusCode,\n headers,\n opaque,\n context\n })\n\n if (\n !res ||\n typeof res.write !== 'function' ||\n typeof res.end !== 'function' ||\n typeof res.on !== 'function'\n ) {\n throw new InvalidReturnValueError('expected Writable')\n }\n\n // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n finished(res, { readable: false }, (err) => {\n const { callback, res, opaque, trailers, abort } = this\n\n this.res = null\n if (err || !res?.readable) {\n util.destroy(res, err)\n }\n\n this.callback = null\n this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n if (err) {\n abort()\n }\n })\n\n res.on('drain', resume)\n\n this.res = res\n\n const needDrain = res.writableNeedDrain !== undefined\n ? res.writableNeedDrain\n : res._writableState?.needDrain\n\n return needDrain !== true\n }\n\n onData (chunk) {\n const { res } = this\n\n return res ? res.write(chunk) : true\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n if (!res) {\n return\n }\n\n this.trailers = util.parseHeaders(trailers)\n\n res.end()\n }\n\n onError (err) {\n const { res, callback, opaque, body } = this\n\n removeSignal(this)\n\n this.factory = null\n\n if (res) {\n this.res = null\n util.destroy(res, err)\n } else if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction stream (opts, factory, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n stream.call(this, opts, factory, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const handler = new StreamHandler(opts, factory, callback)\n\n this.dispatch(opts, handler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst {\n Readable,\n Duplex,\n PassThrough\n} = require('node:stream')\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nfunction noop () {}\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n constructor () {\n super({ autoDestroy: true })\n\n this[kResume] = null\n }\n\n _read () {\n const { [kResume]: resume } = this\n\n if (resume) {\n this[kResume] = null\n resume()\n }\n }\n\n _destroy (err, callback) {\n this._read()\n\n callback(err)\n }\n}\n\nclass PipelineResponse extends Readable {\n constructor (resume) {\n super({ autoDestroy: true })\n this[kResume] = resume\n }\n\n _read () {\n this[kResume]()\n }\n\n _destroy (err, callback) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n callback(err)\n }\n}\n\nclass PipelineHandler extends AsyncResource {\n constructor (opts, handler) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof handler !== 'function') {\n throw new InvalidArgumentError('invalid handler')\n }\n\n const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_PIPELINE')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.handler = handler\n this.abort = null\n this.context = null\n this.onInfo = onInfo || null\n\n this.req = new PipelineRequest().on('error', noop)\n\n this.ret = new Duplex({\n readableObjectMode: opts.objectMode,\n autoDestroy: true,\n read: () => {\n const { body } = this\n\n if (body?.resume) {\n body.resume()\n }\n },\n write: (chunk, encoding, callback) => {\n const { req } = this\n\n if (req.push(chunk, encoding) || req._readableState.destroyed) {\n callback()\n } else {\n req[kResume] = callback\n }\n },\n destroy: (err, callback) => {\n const { body, req, res, ret, abort } = this\n\n if (!err && !ret._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (abort && err) {\n abort()\n }\n\n util.destroy(body, err)\n util.destroy(req, err)\n util.destroy(res, err)\n\n removeSignal(this)\n\n callback(err)\n }\n }).on('prefinish', () => {\n const { req } = this\n\n // Node < 15 does not call _final in same tick.\n req.push(null)\n })\n\n this.res = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n const { res } = this\n\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(!res, 'pipeline cannot be retried')\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume) {\n const { opaque, handler, context } = this\n\n if (statusCode < 200) {\n if (this.onInfo) {\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.res = new PipelineResponse(resume)\n\n let body\n try {\n this.handler = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n body = this.runInAsyncScope(handler, null, {\n statusCode,\n headers,\n opaque,\n body: this.res,\n context\n })\n } catch (err) {\n this.res.on('error', noop)\n throw err\n }\n\n if (!body || typeof body.on !== 'function') {\n throw new InvalidReturnValueError('expected Readable')\n }\n\n body\n .on('data', (chunk) => {\n const { ret, body } = this\n\n if (!ret.push(chunk) && body.pause) {\n body.pause()\n }\n })\n .on('error', (err) => {\n const { ret } = this\n\n util.destroy(ret, err)\n })\n .on('end', () => {\n const { ret } = this\n\n ret.push(null)\n })\n .on('close', () => {\n const { ret } = this\n\n if (!ret._readableState.ended) {\n util.destroy(ret, new RequestAbortedError())\n }\n })\n\n this.body = body\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n res.push(null)\n }\n\n onError (err) {\n const { ret } = this\n this.handler = null\n util.destroy(ret, err)\n }\n}\n\nfunction pipeline (opts, handler) {\n try {\n const pipelineHandler = new PipelineHandler(opts, handler)\n this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n return pipelineHandler.ret\n } catch (err) {\n return new PassThrough().destroy(err)\n }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst assert = require('node:assert')\nconst util = require('../core/util')\nconst { kHTTP2Stream } = require('../core/symbols')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass UpgradeHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_UPGRADE')\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.abort = null\n this.context = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = null\n }\n\n onHeaders () {\n throw new SocketError('bad upgrade', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n assert(socket[kHTTP2Stream] === true ? statusCode === 200 : statusCode === 101)\n\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.runInAsyncScope(callback, null, null, {\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction upgrade (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n upgrade.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const upgradeHandler = new UpgradeHandler(opts, callback)\n const upgradeOpts = {\n ...opts,\n method: opts.method || 'GET',\n upgrade: opts.protocol || 'Websocket'\n }\n\n this.dispatch(upgradeOpts, upgradeHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_CONNECT')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.callback = callback\n this.abort = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders () {\n throw new SocketError('bad connect', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n\n let headers = rawHeaders\n // Indicates is an HTTP2Session\n if (headers != null) {\n headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n }\n\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction connect (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n connect.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const connectHandler = new ConnectHandler(opts, callback)\n const connectOptions = { ...opts, method: 'CONNECT' }\n\n this.dispatch(connectOptions, connectHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = connect\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MockNotMatchedError'\n this.message = message || 'The request does not match any registered mock dispatches'\n this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMockNotMatchedError] === true\n }\n\n get [kMockNotMatchedError] () {\n return true\n }\n}\n\nmodule.exports = {\n MockNotMatchedError\n}\n","'use strict'\n\nmodule.exports = {\n kAgent: Symbol('agent'),\n kOptions: Symbol('options'),\n kFactory: Symbol('factory'),\n kDispatches: Symbol('dispatches'),\n kDispatchKey: Symbol('dispatch key'),\n kDefaultHeaders: Symbol('default headers'),\n kDefaultTrailers: Symbol('default trailers'),\n kContentLength: Symbol('content length'),\n kMockAgent: Symbol('mock agent'),\n kMockAgentSet: Symbol('mock agent set'),\n kMockAgentGet: Symbol('mock agent get'),\n kMockDispatch: Symbol('mock dispatch'),\n kClose: Symbol('close'),\n kOriginalClose: Symbol('original agent close'),\n kOriginalDispatch: Symbol('original dispatch'),\n kOrigin: Symbol('origin'),\n kIsMockActive: Symbol('is mock active'),\n kNetConnect: Symbol('net connect'),\n kGetNetConnect: Symbol('get net connect'),\n kConnected: Symbol('connected'),\n kIgnoreTrailingSlash: Symbol('ignore trailing slash'),\n kMockAgentMockCallHistoryInstance: Symbol('mock agent mock call history name'),\n kMockAgentRegisterCallHistory: Symbol('mock agent register mock call history'),\n kMockAgentAddCallHistoryLog: Symbol('mock agent add call history log'),\n kMockAgentIsCallHistoryEnabled: Symbol('mock agent is call history enabled'),\n kMockAgentAcceptsNonStandardSearchParameters: Symbol('mock agent accepts non standard search parameters'),\n kMockCallHistoryAddLog: Symbol('mock call history add log'),\n kTotalDispatchCount: Symbol('total dispatch count')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n kDispatches,\n kMockAgent,\n kOriginalDispatch,\n kOrigin,\n kGetNetConnect,\n kTotalDispatchCount\n} = require('./mock-symbols')\nconst { serializePathWithQuery } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n types: {\n isPromise\n }\n} = require('node:util')\nconst { InvalidArgumentError } = require('../core/errors')\n\nfunction matchValue (match, value) {\n if (typeof match === 'string') {\n return match === value\n }\n if (match instanceof RegExp) {\n return match.test(value)\n }\n if (typeof match === 'function') {\n return match(value) === true\n }\n return false\n}\n\nfunction lowerCaseEntries (headers) {\n return Object.fromEntries(\n Object.entries(headers).map(([headerName, headerValue]) => {\n return [headerName.toLocaleLowerCase(), headerValue]\n })\n )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record<string, string>} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n return headers[i + 1]\n }\n }\n\n return undefined\n } else if (typeof headers.get === 'function') {\n return headers.get(key)\n } else {\n return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n const clone = headers.slice()\n const entries = []\n for (let index = 0; index < clone.length; index += 2) {\n entries.push([clone[index], clone[index + 1]])\n }\n return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n if (typeof mockDispatch.headers === 'function') {\n if (Array.isArray(headers)) { // fetch HeadersList\n headers = buildHeadersFromArray(headers)\n }\n return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n }\n if (typeof mockDispatch.headers === 'undefined') {\n return true\n }\n if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n return false\n }\n\n for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n const headerValue = getHeaderByName(headers, matchHeaderName)\n\n if (!matchValue(matchHeaderValue, headerValue)) {\n return false\n }\n }\n return true\n}\n\nfunction normalizeSearchParams (query) {\n if (typeof query !== 'string') {\n return query\n }\n\n const originalQp = new URLSearchParams(query)\n const normalizedQp = new URLSearchParams()\n\n for (let [key, value] of originalQp.entries()) {\n key = key.replace('[]', '')\n\n const valueRepresentsString = /^(['\"]).*\\1$/.test(value)\n if (valueRepresentsString) {\n normalizedQp.append(key, value)\n continue\n }\n\n if (value.includes(',')) {\n const values = value.split(',')\n for (const v of values) {\n normalizedQp.append(key, v)\n }\n continue\n }\n\n normalizedQp.append(key, value)\n }\n\n return normalizedQp\n}\n\nfunction safeUrl (path) {\n if (typeof path !== 'string') {\n return path\n }\n const pathSegments = path.split('?', 3)\n if (pathSegments.length !== 2) {\n return path\n }\n\n const qp = new URLSearchParams(pathSegments.pop())\n qp.sort()\n return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n const pathMatch = matchValue(mockDispatch.path, path)\n const methodMatch = matchValue(mockDispatch.method, method)\n const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n const headersMatch = matchHeaders(mockDispatch, headers)\n return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n if (Buffer.isBuffer(data)) {\n return data\n } else if (data instanceof Uint8Array) {\n return data\n } else if (data instanceof ArrayBuffer) {\n return data\n } else if (typeof data === 'object') {\n return JSON.stringify(data)\n } else if (data) {\n return data.toString()\n } else {\n return ''\n }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path\n const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath)\n\n // Match path\n let matchedMockDispatches = mockDispatches\n .filter(({ consumed }) => !consumed)\n .filter(({ path, ignoreTrailingSlash }) => {\n return ignoreTrailingSlash\n ? matchValue(removeTrailingSlash(safeUrl(path)), resolvedPathWithoutTrailingSlash)\n : matchValue(safeUrl(path), resolvedPath)\n })\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n }\n\n // Match method\n matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n }\n\n // Match body\n matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n }\n\n // Match headers\n matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n if (matchedMockDispatches.length === 0) {\n const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n }\n\n return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data, opts) {\n const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false, ...opts }\n const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n mockDispatches.push(newMockDispatch)\n // Track total number of intercepts ever registered for better error messages\n mockDispatches[kTotalDispatchCount] = (mockDispatches[kTotalDispatchCount] || 0) + 1\n return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n const index = mockDispatches.findIndex(dispatch => {\n if (!dispatch.consumed) {\n return false\n }\n return matchKey(dispatch, key)\n })\n if (index !== -1) {\n mockDispatches.splice(index, 1)\n }\n}\n\n/**\n * @param {string} path Path to remove trailing slash from\n */\nfunction removeTrailingSlash (path) {\n while (path.endsWith('/')) {\n path = path.slice(0, -1)\n }\n\n if (path.length === 0) {\n path = '/'\n }\n\n return path\n}\n\nfunction buildKey (opts) {\n const { path, method, body, headers, query } = opts\n\n return {\n path,\n method,\n body,\n headers,\n query\n }\n}\n\nfunction generateKeyValues (data) {\n const keys = Object.keys(data)\n const result = []\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n const value = data[key]\n const name = Buffer.from(`${key}`)\n if (Array.isArray(value)) {\n for (let j = 0; j < value.length; ++j) {\n result.push(name, Buffer.from(`${value[j]}`))\n }\n } else {\n result.push(name, Buffer.from(`${value}`))\n }\n }\n return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n const buffers = []\n for await (const data of body) {\n buffers.push(data)\n }\n return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n // Get mock dispatch from built key\n const key = buildKey(opts)\n const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n mockDispatch.timesInvoked++\n\n // Here's where we resolve a callback if a callback is present for the dispatch data.\n if (mockDispatch.data.callback) {\n mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n }\n\n // Parse mockDispatch data\n const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n const { timesInvoked, times } = mockDispatch\n\n // If it's used up and not persistent, mark as consumed\n mockDispatch.consumed = !persist && timesInvoked >= times\n mockDispatch.pending = timesInvoked < times\n\n // If specified, trigger dispatch error\n if (error !== null) {\n deleteMockDispatch(this[kDispatches], key)\n handler.onError(error)\n return true\n }\n\n // Track whether the request has been aborted\n let aborted = false\n let timer = null\n\n function abort (err) {\n if (aborted) {\n return\n }\n aborted = true\n\n // Clear the pending delayed response if any\n if (timer !== null) {\n clearTimeout(timer)\n timer = null\n }\n\n // Notify the handler of the abort\n handler.onError(err)\n }\n\n // Call onConnect to allow the handler to register the abort callback\n handler.onConnect?.(abort, null)\n\n // Handle the request with a delay if necessary\n if (typeof delay === 'number' && delay > 0) {\n timer = setTimeout(() => {\n timer = null\n handleReply(this[kDispatches])\n }, delay)\n } else {\n handleReply(this[kDispatches])\n }\n\n function handleReply (mockDispatches, _data = data) {\n // Don't send response if the request was aborted\n if (aborted) {\n return\n }\n\n // fetch's HeadersList is a 1D string array\n const optsHeaders = Array.isArray(opts.headers)\n ? buildHeadersFromArray(opts.headers)\n : opts.headers\n const body = typeof _data === 'function'\n ? _data({ ...opts, headers: optsHeaders })\n : _data\n\n // util.types.isPromise is likely needed for jest.\n if (isPromise(body)) {\n // If handleReply is asynchronous, throwing an error\n // in the callback will reject the promise, rather than\n // synchronously throw the error, which breaks some tests.\n // Rather, we wait for the callback to resolve if it is a\n // promise, and then re-run handleReply with the new body.\n return body.then((newData) => handleReply(mockDispatches, newData))\n }\n\n // Check again if aborted after async body resolution\n if (aborted) {\n return\n }\n\n const responseData = getResponseData(body)\n const responseHeaders = generateKeyValues(headers)\n const responseTrailers = generateKeyValues(trailers)\n\n handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n handler.onData?.(Buffer.from(responseData))\n handler.onComplete?.(responseTrailers)\n deleteMockDispatch(mockDispatches, key)\n }\n\n function resume () {}\n\n return true\n}\n\nfunction buildMockDispatch () {\n const agent = this[kMockAgent]\n const origin = this[kOrigin]\n const originalDispatch = this[kOriginalDispatch]\n\n return function dispatch (opts, handler) {\n if (agent.isMockActive) {\n try {\n mockDispatch.call(this, opts, handler)\n } catch (error) {\n if (error.code === 'UND_MOCK_ERR_MOCK_NOT_MATCHED') {\n const netConnect = agent[kGetNetConnect]()\n const totalInterceptsCount = this[kDispatches][kTotalDispatchCount] || this[kDispatches].length\n const pendingInterceptsCount = this[kDispatches].filter(({ consumed }) => !consumed).length\n const interceptsMessage = `, ${pendingInterceptsCount} interceptor(s) remaining out of ${totalInterceptsCount} defined`\n if (netConnect === false) {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)${interceptsMessage}`)\n }\n if (checkNetConnect(netConnect, origin)) {\n originalDispatch.call(this, opts, handler)\n } else {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)${interceptsMessage}`)\n }\n } else {\n throw error\n }\n }\n } else {\n originalDispatch.call(this, opts, handler)\n }\n }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n const url = new URL(origin)\n if (netConnect === true) {\n return true\n } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n return true\n }\n return false\n}\n\nfunction normalizeOrigin (origin) {\n if (typeof origin !== 'string' && !(origin instanceof URL)) {\n return origin\n }\n\n if (origin instanceof URL) {\n return origin.origin\n }\n\n return origin.toLowerCase()\n}\n\nfunction buildAndValidateMockOptions (opts) {\n const { agent, ...mockOptions } = opts\n\n if ('enableCallHistory' in mockOptions && typeof mockOptions.enableCallHistory !== 'boolean') {\n throw new InvalidArgumentError('options.enableCallHistory must to be a boolean')\n }\n\n if ('acceptNonStandardSearchParameters' in mockOptions && typeof mockOptions.acceptNonStandardSearchParameters !== 'boolean') {\n throw new InvalidArgumentError('options.acceptNonStandardSearchParameters must to be a boolean')\n }\n\n if ('ignoreTrailingSlash' in mockOptions && typeof mockOptions.ignoreTrailingSlash !== 'boolean') {\n throw new InvalidArgumentError('options.ignoreTrailingSlash must to be a boolean')\n }\n\n return mockOptions\n}\n\nmodule.exports = {\n getResponseData,\n getMockDispatch,\n addMockDispatch,\n deleteMockDispatch,\n buildKey,\n generateKeyValues,\n matchValue,\n getResponse,\n getStatusText,\n mockDispatch,\n buildMockDispatch,\n checkNetConnect,\n buildAndValidateMockOptions,\n getHeaderByName,\n buildHeadersFromArray,\n normalizeSearchParams,\n normalizeOrigin\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kDispatchKey,\n kDefaultHeaders,\n kDefaultTrailers,\n kContentLength,\n kMockDispatch,\n kIgnoreTrailingSlash\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { serializePathWithQuery } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n constructor (mockDispatch) {\n this[kMockDispatch] = mockDispatch\n }\n\n /**\n * Delay a reply by a set amount in ms.\n */\n delay (waitInMs) {\n if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n }\n\n this[kMockDispatch].delay = waitInMs\n return this\n }\n\n /**\n * For a defined reply, never mark as consumed.\n */\n persist () {\n this[kMockDispatch].persist = true\n return this\n }\n\n /**\n * Allow one to define a reply for a set amount of matching requests.\n */\n times (repeatTimes) {\n if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n }\n\n this[kMockDispatch].times = repeatTimes\n return this\n }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n constructor (opts, mockDispatches) {\n if (typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object')\n }\n if (typeof opts.path === 'undefined') {\n throw new InvalidArgumentError('opts.path must be defined')\n }\n if (typeof opts.method === 'undefined') {\n opts.method = 'GET'\n }\n // See https://github.com/nodejs/undici/issues/1245\n // As per RFC 3986, clients are not supposed to send URI\n // fragments to servers when they retrieve a document,\n if (typeof opts.path === 'string') {\n if (opts.query) {\n opts.path = serializePathWithQuery(opts.path, opts.query)\n } else {\n // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n const parsedURL = new URL(opts.path, 'data://')\n opts.path = parsedURL.pathname + parsedURL.search\n }\n }\n if (typeof opts.method === 'string') {\n opts.method = opts.method.toUpperCase()\n }\n\n this[kDispatchKey] = buildKey(opts)\n this[kDispatches] = mockDispatches\n this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false\n this[kDefaultHeaders] = {}\n this[kDefaultTrailers] = {}\n this[kContentLength] = false\n }\n\n createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n const responseData = getResponseData(data)\n const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n return { statusCode, data, headers, trailers }\n }\n\n validateReplyParameters (replyParameters) {\n if (typeof replyParameters.statusCode === 'undefined') {\n throw new InvalidArgumentError('statusCode must be defined')\n }\n if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n throw new InvalidArgumentError('responseOptions must be an object')\n }\n }\n\n /**\n * Mock an undici request with a defined reply.\n */\n reply (replyOptionsCallbackOrStatusCode) {\n // Values of reply aren't available right now as they\n // can only be available when the reply callback is invoked.\n if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n // We'll first wrap the provided callback in another function,\n // this function will properly resolve the data from the callback\n // when invoked.\n const wrappedDefaultsCallback = (opts) => {\n // Our reply options callback contains the parameter for statusCode, data and options.\n const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n // Check if it is in the right format\n if (typeof resolvedData !== 'object' || resolvedData === null) {\n throw new InvalidArgumentError('reply options callback must return an object')\n }\n\n const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n this.validateReplyParameters(replyParameters)\n // Since the values can be obtained immediately we return them\n // from this higher order function that will be resolved later.\n return {\n ...this.createMockScopeDispatchData(replyParameters)\n }\n }\n\n // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] })\n return new MockScope(newMockDispatch)\n }\n\n // We can have either one or three parameters, if we get here,\n // we should have 1-3 parameters. So we spread the arguments of\n // this function to obtain the parameters, since replyData will always\n // just be the statusCode.\n const replyParameters = {\n statusCode: replyOptionsCallbackOrStatusCode,\n data: arguments[1] === undefined ? '' : arguments[1],\n responseOptions: arguments[2] === undefined ? {} : arguments[2]\n }\n this.validateReplyParameters(replyParameters)\n\n // Send in-already provided data like usual\n const dispatchData = this.createMockScopeDispatchData(replyParameters)\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Mock an undici request with a defined error.\n */\n replyWithError (error) {\n if (typeof error === 'undefined') {\n throw new InvalidArgumentError('error must be defined')\n }\n\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Set default reply headers on the interceptor for subsequent replies\n */\n defaultReplyHeaders (headers) {\n if (typeof headers === 'undefined') {\n throw new InvalidArgumentError('headers must be defined')\n }\n\n this[kDefaultHeaders] = headers\n return this\n }\n\n /**\n * Set default reply trailers on the interceptor for subsequent replies\n */\n defaultReplyTrailers (trailers) {\n if (typeof trailers === 'undefined') {\n throw new InvalidArgumentError('trailers must be defined')\n }\n\n this[kDefaultTrailers] = trailers\n return this\n }\n\n /**\n * Set reply content length header for replies on the interceptor\n */\n replyContentLength () {\n this[kContentLength] = true\n return this\n }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected,\n kIgnoreTrailingSlash\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n constructor (origin, opts) {\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n super(origin, opts)\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(\n opts && { ignoreTrailingSlash: this[kIgnoreTrailingSlash], ...opts },\n this[kDispatches]\n )\n }\n\n cleanMocks () {\n this[kDispatches] = []\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { kMockCallHistoryAddLog } = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\nfunction handleFilterCallsWithOptions (criteria, options, handler, store, allLogs) {\n switch (options.operator) {\n case 'OR':\n store.push(...handler(criteria, allLogs))\n\n return store\n case 'AND':\n return handler(criteria, store)\n default:\n // guard -- should never happens because buildAndValidateFilterCallsOptions is called before\n throw new InvalidArgumentError('options.operator must to be a case insensitive string equal to \\'OR\\' or \\'AND\\'')\n }\n}\n\nfunction buildAndValidateFilterCallsOptions (options = {}) {\n const finalOptions = {}\n\n if ('operator' in options) {\n if (typeof options.operator !== 'string' || (options.operator.toUpperCase() !== 'OR' && options.operator.toUpperCase() !== 'AND')) {\n throw new InvalidArgumentError('options.operator must to be a case insensitive string equal to \\'OR\\' or \\'AND\\'')\n }\n\n return {\n ...finalOptions,\n operator: options.operator.toUpperCase()\n }\n }\n\n return finalOptions\n}\n\nfunction makeFilterCalls (parameterName) {\n return (parameterValue, logs) => {\n if (typeof parameterValue === 'string' || parameterValue == null) {\n return logs.filter((log) => {\n return log[parameterName] === parameterValue\n })\n }\n if (parameterValue instanceof RegExp) {\n return logs.filter((log) => {\n return parameterValue.test(log[parameterName])\n })\n }\n\n throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`)\n }\n}\nfunction computeUrlWithMaybeSearchParameters (requestInit) {\n // path can contains query url parameters\n // or query can contains query url parameters\n try {\n const url = new URL(requestInit.path, requestInit.origin)\n\n // requestInit.path contains query url parameters\n // requestInit.query is then undefined\n if (url.search.length !== 0) {\n return url\n }\n\n // requestInit.query can be populated here\n url.search = new URLSearchParams(requestInit.query).toString()\n\n return url\n } catch (error) {\n throw new InvalidArgumentError('An error occurred when computing MockCallHistoryLog.url', { cause: error })\n }\n}\n\nclass MockCallHistoryLog {\n constructor (requestInit = {}) {\n this.body = requestInit.body\n this.headers = requestInit.headers\n this.method = requestInit.method\n\n const url = computeUrlWithMaybeSearchParameters(requestInit)\n\n this.fullUrl = url.toString()\n this.origin = url.origin\n this.path = url.pathname\n this.searchParams = Object.fromEntries(url.searchParams)\n this.protocol = url.protocol\n this.host = url.host\n this.port = url.port\n this.hash = url.hash\n }\n\n toMap () {\n return new Map([\n ['protocol', this.protocol],\n ['host', this.host],\n ['port', this.port],\n ['origin', this.origin],\n ['path', this.path],\n ['hash', this.hash],\n ['searchParams', this.searchParams],\n ['fullUrl', this.fullUrl],\n ['method', this.method],\n ['body', this.body],\n ['headers', this.headers]]\n )\n }\n\n toString () {\n const options = { betweenKeyValueSeparator: '->', betweenPairSeparator: '|' }\n let result = ''\n\n this.toMap().forEach((value, key) => {\n if (typeof value === 'string' || value === undefined || value === null) {\n result = `${result}${key}${options.betweenKeyValueSeparator}${value}${options.betweenPairSeparator}`\n }\n if ((typeof value === 'object' && value !== null) || Array.isArray(value)) {\n result = `${result}${key}${options.betweenKeyValueSeparator}${JSON.stringify(value)}${options.betweenPairSeparator}`\n }\n // maybe miss something for non Record / Array headers and searchParams here\n })\n\n // delete last betweenPairSeparator\n return result.slice(0, -1)\n }\n}\n\nclass MockCallHistory {\n logs = []\n\n calls () {\n return this.logs\n }\n\n firstCall () {\n return this.logs.at(0)\n }\n\n lastCall () {\n return this.logs.at(-1)\n }\n\n nthCall (number) {\n if (typeof number !== 'number') {\n throw new InvalidArgumentError('nthCall must be called with a number')\n }\n if (!Number.isInteger(number)) {\n throw new InvalidArgumentError('nthCall must be called with an integer')\n }\n if (Math.sign(number) !== 1) {\n throw new InvalidArgumentError('nthCall must be called with a positive value. use firstCall or lastCall instead')\n }\n\n // non zero based index. this is more human readable\n return this.logs.at(number - 1)\n }\n\n filterCalls (criteria, options) {\n // perf\n if (this.logs.length === 0) {\n return this.logs\n }\n if (typeof criteria === 'function') {\n return this.logs.filter(criteria)\n }\n if (criteria instanceof RegExp) {\n return this.logs.filter((log) => {\n return criteria.test(log.toString())\n })\n }\n if (typeof criteria === 'object' && criteria !== null) {\n // no criteria - returning all logs\n if (Object.keys(criteria).length === 0) {\n return this.logs\n }\n\n const finalOptions = { operator: 'OR', ...buildAndValidateFilterCallsOptions(options) }\n\n let maybeDuplicatedLogsFiltered = finalOptions.operator === 'AND' ? this.logs : []\n if ('protocol' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('host' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('port' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('origin' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('path' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('hash' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('fullUrl' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered, this.logs)\n }\n if ('method' in criteria) {\n maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered, this.logs)\n }\n\n const uniqLogsFiltered = [...new Set(maybeDuplicatedLogsFiltered)]\n\n return uniqLogsFiltered\n }\n\n throw new InvalidArgumentError('criteria parameter should be one of function, regexp, or object')\n }\n\n filterCallsByProtocol = makeFilterCalls.call(this, 'protocol')\n\n filterCallsByHost = makeFilterCalls.call(this, 'host')\n\n filterCallsByPort = makeFilterCalls.call(this, 'port')\n\n filterCallsByOrigin = makeFilterCalls.call(this, 'origin')\n\n filterCallsByPath = makeFilterCalls.call(this, 'path')\n\n filterCallsByHash = makeFilterCalls.call(this, 'hash')\n\n filterCallsByFullUrl = makeFilterCalls.call(this, 'fullUrl')\n\n filterCallsByMethod = makeFilterCalls.call(this, 'method')\n\n clear () {\n this.logs = []\n }\n\n [kMockCallHistoryAddLog] (requestInit) {\n const log = new MockCallHistoryLog(requestInit)\n\n this.logs.push(log)\n\n return log\n }\n\n * [Symbol.iterator] () {\n for (const log of this.calls()) {\n yield log\n }\n }\n}\n\nmodule.exports.MockCallHistory = MockCallHistory\nmodule.exports.MockCallHistoryLog = MockCallHistoryLog\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected,\n kIgnoreTrailingSlash\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n constructor (origin, opts) {\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n super(origin, opts)\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(\n opts && { ignoreTrailingSlash: this[kIgnoreTrailingSlash], ...opts },\n this[kDispatches]\n )\n }\n\n cleanMocks () {\n this[kDispatches] = []\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n constructor ({ disableColors } = {}) {\n this.transform = new Transform({\n transform (chunk, _enc, cb) {\n cb(null, chunk)\n }\n })\n\n this.logger = new Console({\n stdout: this.transform,\n inspectOptions: {\n colors: !disableColors && !process.env.CI\n }\n })\n }\n\n format (pendingInterceptors) {\n const withPrettyHeaders = pendingInterceptors.map(\n ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n Method: method,\n Origin: origin,\n Path: path,\n 'Status code': statusCode,\n Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n Invocations: timesInvoked,\n Remaining: persist ? Infinity : times - timesInvoked\n }))\n\n this.logger.table(withPrettyHeaders)\n return this.transform.read().toString()\n }\n}\n","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n kAgent,\n kMockAgentSet,\n kMockAgentGet,\n kDispatches,\n kIsMockActive,\n kNetConnect,\n kGetNetConnect,\n kOptions,\n kFactory,\n kMockAgentRegisterCallHistory,\n kMockAgentIsCallHistoryEnabled,\n kMockAgentAddCallHistoryLog,\n kMockAgentMockCallHistoryInstance,\n kMockAgentAcceptsNonStandardSearchParameters,\n kMockCallHistoryAddLog,\n kIgnoreTrailingSlash\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, normalizeSearchParams, buildAndValidateMockOptions, normalizeOrigin } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\nconst { MockCallHistory } = require('./mock-call-history')\n\nclass MockAgent extends Dispatcher {\n constructor (opts = {}) {\n super(opts)\n\n const mockOptions = buildAndValidateMockOptions(opts)\n\n this[kNetConnect] = true\n this[kIsMockActive] = true\n this[kMockAgentIsCallHistoryEnabled] = mockOptions.enableCallHistory ?? false\n this[kMockAgentAcceptsNonStandardSearchParameters] = mockOptions.acceptNonStandardSearchParameters ?? false\n this[kIgnoreTrailingSlash] = mockOptions.ignoreTrailingSlash ?? false\n\n // Instantiate Agent and encapsulate\n if (opts?.agent && typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n const agent = opts?.agent ? opts.agent : new Agent(opts)\n this[kAgent] = agent\n\n this[kClients] = agent[kClients]\n this[kOptions] = mockOptions\n\n if (this[kMockAgentIsCallHistoryEnabled]) {\n this[kMockAgentRegisterCallHistory]()\n }\n }\n\n get (origin) {\n // Normalize origin to handle URL objects and case-insensitive hostnames\n const normalizedOrigin = normalizeOrigin(origin)\n const originKey = this[kIgnoreTrailingSlash] ? normalizedOrigin.replace(/\\/$/, '') : normalizedOrigin\n\n let dispatcher = this[kMockAgentGet](originKey)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](originKey)\n this[kMockAgentSet](originKey, dispatcher)\n }\n return dispatcher\n }\n\n dispatch (opts, handler) {\n opts.origin = normalizeOrigin(opts.origin)\n\n // Call MockAgent.get to perform additional setup before dispatching as normal\n this.get(opts.origin)\n\n this[kMockAgentAddCallHistoryLog](opts)\n\n const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters]\n\n const dispatchOpts = { ...opts }\n\n if (acceptNonStandardSearchParameters && dispatchOpts.path) {\n const [path, searchParams] = dispatchOpts.path.split('?')\n const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)\n dispatchOpts.path = `${path}?${normalizedSearchParams}`\n }\n\n return this[kAgent].dispatch(dispatchOpts, handler)\n }\n\n async close () {\n this.clearCallHistory()\n await this[kAgent].close()\n this[kClients].clear()\n }\n\n deactivate () {\n this[kIsMockActive] = false\n }\n\n activate () {\n this[kIsMockActive] = true\n }\n\n enableNetConnect (matcher) {\n if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n if (Array.isArray(this[kNetConnect])) {\n this[kNetConnect].push(matcher)\n } else {\n this[kNetConnect] = [matcher]\n }\n } else if (typeof matcher === 'undefined') {\n this[kNetConnect] = true\n } else {\n throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n }\n }\n\n disableNetConnect () {\n this[kNetConnect] = false\n }\n\n enableCallHistory () {\n this[kMockAgentIsCallHistoryEnabled] = true\n\n return this\n }\n\n disableCallHistory () {\n this[kMockAgentIsCallHistoryEnabled] = false\n\n return this\n }\n\n getCallHistory () {\n return this[kMockAgentMockCallHistoryInstance]\n }\n\n clearCallHistory () {\n if (this[kMockAgentMockCallHistoryInstance] !== undefined) {\n this[kMockAgentMockCallHistoryInstance].clear()\n }\n }\n\n // This is required to bypass issues caused by using global symbols - see:\n // https://github.com/nodejs/undici/issues/1447\n get isMockActive () {\n return this[kIsMockActive]\n }\n\n [kMockAgentRegisterCallHistory] () {\n if (this[kMockAgentMockCallHistoryInstance] === undefined) {\n this[kMockAgentMockCallHistoryInstance] = new MockCallHistory()\n }\n }\n\n [kMockAgentAddCallHistoryLog] (opts) {\n if (this[kMockAgentIsCallHistoryEnabled]) {\n // additional setup when enableCallHistory class method is used after mockAgent instantiation\n this[kMockAgentRegisterCallHistory]()\n\n // add call history log on every call (intercepted or not)\n this[kMockAgentMockCallHistoryInstance][kMockCallHistoryAddLog](opts)\n }\n }\n\n [kMockAgentSet] (origin, dispatcher) {\n this[kClients].set(origin, { count: 0, dispatcher })\n }\n\n [kFactory] (origin) {\n const mockOptions = Object.assign({ agent: this }, this[kOptions])\n return this[kOptions] && this[kOptions].connections === 1\n ? new MockClient(origin, mockOptions)\n : new MockPool(origin, mockOptions)\n }\n\n [kMockAgentGet] (origin) {\n // First check if we can immediately find it\n const result = this[kClients].get(origin)\n if (result?.dispatcher) {\n return result.dispatcher\n }\n\n // If the origin is not a string create a dummy parent pool and return to user\n if (typeof origin !== 'string') {\n const dispatcher = this[kFactory]('http://localhost:9999')\n this[kMockAgentSet](origin, dispatcher)\n return dispatcher\n }\n\n // If we match, create a pool and assign the same dispatches\n for (const [keyMatcher, result] of Array.from(this[kClients])) {\n if (result && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n const dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n dispatcher[kDispatches] = result.dispatcher[kDispatches]\n return dispatcher\n }\n }\n }\n\n [kGetNetConnect] () {\n return this[kNetConnect]\n }\n\n pendingInterceptors () {\n const mockAgentClients = this[kClients]\n\n return Array.from(mockAgentClients.entries())\n .flatMap(([origin, result]) => result.dispatcher[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n .filter(({ pending }) => pending)\n }\n\n assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n const pending = this.pendingInterceptors()\n\n if (pending.length === 0) {\n return\n }\n\n throw new UndiciError(\n pending.length === 1\n ? `1 interceptor is pending:\\n\\n${pendingInterceptorsFormatter.format(pending)}`.trim()\n : `${pending.length} interceptors are pending:\\n\\n${pendingInterceptorsFormatter.format(pending)}`.trim()\n )\n }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { runtimeFeatures } = require('../util/runtime-features.js')\n\n/**\n * @typedef {Object} HeaderFilters\n * @property {Set<string>} ignore - Set of headers to ignore for matching\n * @property {Set<string>} exclude - Set of headers to exclude from matching\n * @property {Set<string>} match - Set of headers to match (empty means match\n */\n\n/**\n * Creates cached header sets for performance\n *\n * @param {import('./snapshot-recorder').SnapshotRecorderMatchOptions} matchOptions - Matching options for headers\n * @returns {HeaderFilters} - Cached sets for ignore, exclude, and match headers\n */\nfunction createHeaderFilters (matchOptions = {}) {\n const { ignoreHeaders = [], excludeHeaders = [], matchHeaders = [], caseSensitive = false } = matchOptions\n\n return {\n ignore: new Set(ignoreHeaders.map(header => caseSensitive ? header : header.toLowerCase())),\n exclude: new Set(excludeHeaders.map(header => caseSensitive ? header : header.toLowerCase())),\n match: new Set(matchHeaders.map(header => caseSensitive ? header : header.toLowerCase()))\n }\n}\n\nconst crypto = runtimeFeatures.has('crypto')\n ? require('node:crypto')\n : null\n\n/**\n * @callback HashIdFunction\n * @param {string} value - The value to hash\n * @returns {string} - The base64url encoded hash of the value\n */\n\n/**\n * Generates a hash for a given value\n * @type {HashIdFunction}\n */\nconst hashId = crypto?.hash\n ? (value) => crypto.hash('sha256', value, 'base64url')\n : (value) => Buffer.from(value).toString('base64url')\n\n/**\n * @typedef {(url: string) => boolean} IsUrlExcluded Checks if a URL matches any of the exclude patterns\n */\n\n/** @typedef {{[key: Lowercase<string>]: string}} NormalizedHeaders */\n/** @typedef {Array<string>} UndiciHeaders */\n/** @typedef {Record<string, string|string[]>} Headers */\n\n/**\n * @param {*} headers\n * @returns {headers is UndiciHeaders}\n */\nfunction isUndiciHeaders (headers) {\n return Array.isArray(headers) && (headers.length & 1) === 0\n}\n\n/**\n * Factory function to create a URL exclusion checker\n * @param {Array<string| RegExp>} [excludePatterns=[]] - Array of patterns to exclude\n * @returns {IsUrlExcluded} - A function that checks if a URL matches any of the exclude patterns\n */\nfunction isUrlExcludedFactory (excludePatterns = []) {\n if (excludePatterns.length === 0) {\n return () => false\n }\n\n return function isUrlExcluded (url) {\n let urlLowerCased\n\n for (const pattern of excludePatterns) {\n if (typeof pattern === 'string') {\n if (!urlLowerCased) {\n // Convert URL to lowercase only once\n urlLowerCased = url.toLowerCase()\n }\n // Simple string match (case-insensitive)\n if (urlLowerCased.includes(pattern.toLowerCase())) {\n return true\n }\n } else if (pattern instanceof RegExp) {\n // Regex pattern match\n if (pattern.test(url)) {\n return true\n }\n }\n }\n\n return false\n }\n}\n\n/**\n * Normalizes headers for consistent comparison\n *\n * @param {Object|UndiciHeaders} headers - Headers to normalize\n * @returns {NormalizedHeaders} - Normalized headers as a lowercase object\n */\nfunction normalizeHeaders (headers) {\n /** @type {NormalizedHeaders} */\n const normalizedHeaders = {}\n\n if (!headers) return normalizedHeaders\n\n // Handle array format (undici internal format: [name, value, name, value, ...])\n if (isUndiciHeaders(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n const key = headers[i]\n const value = headers[i + 1]\n if (key && value !== undefined) {\n // Convert Buffers to strings if needed\n const keyStr = Buffer.isBuffer(key) ? key.toString() : key\n const valueStr = Buffer.isBuffer(value) ? value.toString() : value\n normalizedHeaders[keyStr.toLowerCase()] = valueStr\n }\n }\n return normalizedHeaders\n }\n\n // Handle object format\n if (headers && typeof headers === 'object') {\n for (const [key, value] of Object.entries(headers)) {\n if (key && typeof key === 'string') {\n normalizedHeaders[key.toLowerCase()] = Array.isArray(value) ? value.join(', ') : String(value)\n }\n }\n }\n\n return normalizedHeaders\n}\n\nconst validSnapshotModes = /** @type {const} */ (['record', 'playback', 'update'])\n\n/** @typedef {typeof validSnapshotModes[number]} SnapshotMode */\n\n/**\n * @param {*} mode - The snapshot mode to validate\n * @returns {asserts mode is SnapshotMode}\n */\nfunction validateSnapshotMode (mode) {\n if (!validSnapshotModes.includes(mode)) {\n throw new InvalidArgumentError(`Invalid snapshot mode: ${mode}. Must be one of: ${validSnapshotModes.join(', ')}`)\n }\n}\n\nmodule.exports = {\n createHeaderFilters,\n hashId,\n isUndiciHeaders,\n normalizeHeaders,\n isUrlExcludedFactory,\n validateSnapshotMode\n}\n","'use strict'\n\nconst { writeFile, readFile, mkdir } = require('node:fs/promises')\nconst { dirname, resolve } = require('node:path')\nconst { setTimeout, clearTimeout } = require('node:timers')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require('./snapshot-utils')\n\n/**\n * @typedef {Object} SnapshotRequestOptions\n * @property {string} method - HTTP method (e.g. 'GET', 'POST', etc.)\n * @property {string} path - Request path\n * @property {string} origin - Request origin (base URL)\n * @property {import('./snapshot-utils').Headers|import('./snapshot-utils').UndiciHeaders} headers - Request headers\n * @property {import('./snapshot-utils').NormalizedHeaders} _normalizedHeaders - Request headers as a lowercase object\n * @property {string|Buffer} [body] - Request body (optional)\n */\n\n/**\n * @typedef {Object} SnapshotEntryRequest\n * @property {string} method - HTTP method (e.g. 'GET', 'POST', etc.)\n * @property {string} url - Full URL of the request\n * @property {import('./snapshot-utils').NormalizedHeaders} headers - Normalized headers as a lowercase object\n * @property {string|Buffer} [body] - Request body (optional)\n */\n\n/**\n * @typedef {Object} SnapshotEntryResponse\n * @property {number} statusCode - HTTP status code of the response\n * @property {import('./snapshot-utils').NormalizedHeaders} headers - Normalized response headers as a lowercase object\n * @property {string} body - Response body as a base64url encoded string\n * @property {Object} [trailers] - Optional response trailers\n */\n\n/**\n * @typedef {Object} SnapshotEntry\n * @property {SnapshotEntryRequest} request - The request object\n * @property {Array<SnapshotEntryResponse>} responses - Array of response objects\n * @property {number} callCount - Number of times this snapshot has been called\n * @property {string} timestamp - ISO timestamp of when the snapshot was created\n */\n\n/**\n * @typedef {Object} SnapshotRecorderMatchOptions\n * @property {Array<string>} [matchHeaders=[]] - Headers to match (empty array means match all headers)\n * @property {Array<string>} [ignoreHeaders=[]] - Headers to ignore for matching\n * @property {Array<string>} [excludeHeaders=[]] - Headers to exclude from matching\n * @property {boolean} [matchBody=true] - Whether to match request body\n * @property {boolean} [matchQuery=true] - Whether to match query properties\n * @property {boolean} [caseSensitive=false] - Whether header matching is case-sensitive\n */\n\n/**\n * @typedef {Object} SnapshotRecorderOptions\n * @property {string} [snapshotPath] - Path to save/load snapshots\n * @property {import('./snapshot-utils').SnapshotMode} [mode='record'] - Mode: 'record' or 'playback'\n * @property {number} [maxSnapshots=Infinity] - Maximum number of snapshots to keep\n * @property {boolean} [autoFlush=false] - Whether to automatically flush snapshots to disk\n * @property {number} [flushInterval=30000] - Auto-flush interval in milliseconds (default: 30 seconds)\n * @property {Array<string|RegExp>} [excludeUrls=[]] - URLs to exclude from recording\n * @property {function} [shouldRecord=null] - Function to filter requests for recording\n * @property {function} [shouldPlayback=null] - Function to filter requests\n */\n\n/**\n * @typedef {Object} SnapshotFormattedRequest\n * @property {string} method - HTTP method (e.g. 'GET', 'POST', etc.)\n * @property {string} url - Full URL of the request (with query parameters if matchQuery is true)\n * @property {import('./snapshot-utils').NormalizedHeaders} headers - Normalized headers as a lowercase object\n * @property {string} body - Request body (optional, only if matchBody is true)\n */\n\n/**\n * @typedef {Object} SnapshotInfo\n * @property {string} hash - Hash key for the snapshot\n * @property {SnapshotEntryRequest} request - The request object\n * @property {number} responseCount - Number of responses recorded for this request\n * @property {number} callCount - Number of times this snapshot has been called\n * @property {string} timestamp - ISO timestamp of when the snapshot was created\n */\n\n/**\n * Formats a request for consistent snapshot storage\n * Caches normalized headers to avoid repeated processing\n *\n * @param {SnapshotRequestOptions} opts - Request options\n * @param {import('./snapshot-utils').HeaderFilters} headerFilters - Cached header sets for performance\n * @param {SnapshotRecorderMatchOptions} [matchOptions] - Matching options for headers and body\n * @returns {SnapshotFormattedRequest} - Formatted request object\n */\nfunction formatRequestKey (opts, headerFilters, matchOptions = {}) {\n const url = new URL(opts.path, opts.origin)\n\n // Cache normalized headers if not already done\n const normalized = opts._normalizedHeaders || normalizeHeaders(opts.headers)\n if (!opts._normalizedHeaders) {\n opts._normalizedHeaders = normalized\n }\n\n return {\n method: opts.method || 'GET',\n url: matchOptions.matchQuery !== false ? url.toString() : `${url.origin}${url.pathname}`,\n headers: filterHeadersForMatching(normalized, headerFilters, matchOptions),\n body: matchOptions.matchBody !== false && opts.body ? String(opts.body) : ''\n }\n}\n\n/**\n * Filters headers based on matching configuration\n *\n * @param {import('./snapshot-utils').Headers} headers - Headers to filter\n * @param {import('./snapshot-utils').HeaderFilters} headerFilters - Cached sets for ignore, exclude, and match headers\n * @param {SnapshotRecorderMatchOptions} [matchOptions] - Matching options for headers\n */\nfunction filterHeadersForMatching (headers, headerFilters, matchOptions = {}) {\n if (!headers || typeof headers !== 'object') return {}\n\n const {\n caseSensitive = false\n } = matchOptions\n\n const filtered = {}\n const { ignore, exclude, match } = headerFilters\n\n for (const [key, value] of Object.entries(headers)) {\n const headerKey = caseSensitive ? key : key.toLowerCase()\n\n // Skip if in exclude list (for security)\n if (exclude.has(headerKey)) continue\n\n // Skip if in ignore list (for matching)\n if (ignore.has(headerKey)) continue\n\n // If matchHeaders is specified, only include those headers\n if (match.size !== 0) {\n if (!match.has(headerKey)) continue\n }\n\n filtered[headerKey] = value\n }\n\n return filtered\n}\n\n/**\n * Filters headers for storage (only excludes sensitive headers)\n *\n * @param {import('./snapshot-utils').Headers} headers - Headers to filter\n * @param {import('./snapshot-utils').HeaderFilters} headerFilters - Cached sets for ignore, exclude, and match headers\n * @param {SnapshotRecorderMatchOptions} [matchOptions] - Matching options for headers\n */\nfunction filterHeadersForStorage (headers, headerFilters, matchOptions = {}) {\n if (!headers || typeof headers !== 'object') return {}\n\n const {\n caseSensitive = false\n } = matchOptions\n\n const filtered = {}\n const { exclude: excludeSet } = headerFilters\n\n for (const [key, value] of Object.entries(headers)) {\n const headerKey = caseSensitive ? key : key.toLowerCase()\n\n // Skip if in exclude list (for security)\n if (excludeSet.has(headerKey)) continue\n\n filtered[headerKey] = value\n }\n\n return filtered\n}\n\n/**\n * Creates a hash key for request matching\n * Properly orders headers to avoid conflicts and uses crypto hashing when available\n *\n * @param {SnapshotFormattedRequest} formattedRequest - Request object\n * @returns {string} - Base64url encoded hash of the request\n */\nfunction createRequestHash (formattedRequest) {\n const parts = [\n formattedRequest.method,\n formattedRequest.url\n ]\n\n // Process headers in a deterministic way to avoid conflicts\n if (formattedRequest.headers && typeof formattedRequest.headers === 'object') {\n const headerKeys = Object.keys(formattedRequest.headers).sort()\n for (const key of headerKeys) {\n const values = Array.isArray(formattedRequest.headers[key])\n ? formattedRequest.headers[key]\n : [formattedRequest.headers[key]]\n\n // Add header name\n parts.push(key)\n\n // Add all values for this header, sorted for consistency\n for (const value of values.sort()) {\n parts.push(String(value))\n }\n }\n }\n\n // Add body\n parts.push(formattedRequest.body)\n\n const content = parts.join('|')\n\n return hashId(content)\n}\n\nclass SnapshotRecorder {\n /** @type {NodeJS.Timeout | null} */\n #flushTimeout\n\n /** @type {import('./snapshot-utils').IsUrlExcluded} */\n #isUrlExcluded\n\n /** @type {Map<string, SnapshotEntry>} */\n #snapshots = new Map()\n\n /** @type {string|undefined} */\n #snapshotPath\n\n /** @type {number} */\n #maxSnapshots = Infinity\n\n /** @type {boolean} */\n #autoFlush = false\n\n /** @type {import('./snapshot-utils').HeaderFilters} */\n #headerFilters\n\n /**\n * Creates a new SnapshotRecorder instance\n * @param {SnapshotRecorderOptions&SnapshotRecorderMatchOptions} [options={}] - Configuration options for the recorder\n */\n constructor (options = {}) {\n this.#snapshotPath = options.snapshotPath\n this.#maxSnapshots = options.maxSnapshots || Infinity\n this.#autoFlush = options.autoFlush || false\n this.flushInterval = options.flushInterval || 30000 // 30 seconds default\n this._flushTimer = null\n\n // Matching configuration\n /** @type {Required<SnapshotRecorderMatchOptions>} */\n this.matchOptions = {\n matchHeaders: options.matchHeaders || [], // empty means match all headers\n ignoreHeaders: options.ignoreHeaders || [],\n excludeHeaders: options.excludeHeaders || [],\n matchBody: options.matchBody !== false, // default: true\n matchQuery: options.matchQuery !== false, // default: true\n caseSensitive: options.caseSensitive || false\n }\n\n // Cache processed header sets to avoid recreating them on every request\n this.#headerFilters = createHeaderFilters(this.matchOptions)\n\n // Request filtering callbacks\n this.shouldRecord = options.shouldRecord || (() => true) // function(requestOpts) -> boolean\n this.shouldPlayback = options.shouldPlayback || (() => true) // function(requestOpts) -> boolean\n\n // URL pattern filtering\n this.#isUrlExcluded = isUrlExcludedFactory(options.excludeUrls) // Array of regex patterns or strings\n\n // Start auto-flush timer if enabled\n if (this.#autoFlush && this.#snapshotPath) {\n this.#startAutoFlush()\n }\n }\n\n /**\n * Records a request-response interaction\n * @param {SnapshotRequestOptions} requestOpts - Request options\n * @param {SnapshotEntryResponse} response - Response data to record\n * @return {Promise<void>} - Resolves when the recording is complete\n */\n async record (requestOpts, response) {\n // Check if recording should be filtered out\n if (!this.shouldRecord(requestOpts)) {\n return // Skip recording\n }\n\n // Check URL exclusion patterns\n if (this.isUrlExcluded(requestOpts)) {\n return // Skip recording\n }\n\n const request = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions)\n const hash = createRequestHash(request)\n\n // Extract response data - always store body as base64\n const normalizedHeaders = normalizeHeaders(response.headers)\n\n /** @type {SnapshotEntryResponse} */\n const responseData = {\n statusCode: response.statusCode,\n headers: filterHeadersForStorage(normalizedHeaders, this.#headerFilters, this.matchOptions),\n body: Buffer.isBuffer(response.body)\n ? response.body.toString('base64')\n : Buffer.from(String(response.body || '')).toString('base64'),\n trailers: response.trailers\n }\n\n // Remove oldest snapshot if we exceed maxSnapshots limit\n if (this.#snapshots.size >= this.#maxSnapshots && !this.#snapshots.has(hash)) {\n const oldestKey = this.#snapshots.keys().next().value\n this.#snapshots.delete(oldestKey)\n }\n\n // Support sequential responses - if snapshot exists, add to responses array\n const existingSnapshot = this.#snapshots.get(hash)\n if (existingSnapshot && existingSnapshot.responses) {\n existingSnapshot.responses.push(responseData)\n existingSnapshot.timestamp = new Date().toISOString()\n } else {\n this.#snapshots.set(hash, {\n request,\n responses: [responseData], // Always store as array for consistency\n callCount: 0,\n timestamp: new Date().toISOString()\n })\n }\n\n // Auto-flush if enabled\n if (this.#autoFlush && this.#snapshotPath) {\n this.#scheduleFlush()\n }\n }\n\n /**\n * Checks if a URL should be excluded from recording/playback\n * @param {SnapshotRequestOptions} requestOpts - Request options to check\n * @returns {boolean} - True if URL is excluded\n */\n isUrlExcluded (requestOpts) {\n const url = new URL(requestOpts.path, requestOpts.origin).toString()\n return this.#isUrlExcluded(url)\n }\n\n /**\n * Finds a matching snapshot for the given request\n * Returns the appropriate response based on call count for sequential responses\n *\n * @param {SnapshotRequestOptions} requestOpts - Request options to match\n * @returns {SnapshotEntry&Record<'response', SnapshotEntryResponse>|undefined} - Matching snapshot response or undefined if not found\n */\n findSnapshot (requestOpts) {\n // Check if playback should be filtered out\n if (!this.shouldPlayback(requestOpts)) {\n return undefined // Skip playback\n }\n\n // Check URL exclusion patterns\n if (this.isUrlExcluded(requestOpts)) {\n return undefined // Skip playback\n }\n\n const request = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions)\n const hash = createRequestHash(request)\n const snapshot = this.#snapshots.get(hash)\n\n if (!snapshot) return undefined\n\n // Handle sequential responses\n const currentCallCount = snapshot.callCount || 0\n const responseIndex = Math.min(currentCallCount, snapshot.responses.length - 1)\n snapshot.callCount = currentCallCount + 1\n\n return {\n ...snapshot,\n response: snapshot.responses[responseIndex]\n }\n }\n\n /**\n * Loads snapshots from file\n * @param {string} [filePath] - Optional file path to load snapshots from\n * @return {Promise<void>} - Resolves when snapshots are loaded\n */\n async loadSnapshots (filePath) {\n const path = filePath || this.#snapshotPath\n if (!path) {\n throw new InvalidArgumentError('Snapshot path is required')\n }\n\n try {\n const data = await readFile(resolve(path), 'utf8')\n const parsed = JSON.parse(data)\n\n // Convert array format back to Map\n if (Array.isArray(parsed)) {\n this.#snapshots.clear()\n for (const { hash, snapshot } of parsed) {\n this.#snapshots.set(hash, snapshot)\n }\n } else {\n // Legacy object format\n this.#snapshots = new Map(Object.entries(parsed))\n }\n } catch (error) {\n if (error.code === 'ENOENT') {\n // File doesn't exist yet - that's ok for recording mode\n this.#snapshots.clear()\n } else {\n throw new UndiciError(`Failed to load snapshots from ${path}`, { cause: error })\n }\n }\n }\n\n /**\n * Saves snapshots to file\n *\n * @param {string} [filePath] - Optional file path to save snapshots\n * @returns {Promise<void>} - Resolves when snapshots are saved\n */\n async saveSnapshots (filePath) {\n const path = filePath || this.#snapshotPath\n if (!path) {\n throw new InvalidArgumentError('Snapshot path is required')\n }\n\n const resolvedPath = resolve(path)\n\n // Ensure directory exists\n await mkdir(dirname(resolvedPath), { recursive: true })\n\n // Convert Map to serializable format\n const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({\n hash,\n snapshot\n }))\n\n await writeFile(resolvedPath, JSON.stringify(data, null, 2), { flush: true })\n }\n\n /**\n * Clears all recorded snapshots\n * @returns {void}\n */\n clear () {\n this.#snapshots.clear()\n }\n\n /**\n * Gets all recorded snapshots\n * @return {Array<SnapshotEntry>} - Array of all recorded snapshots\n */\n getSnapshots () {\n return Array.from(this.#snapshots.values())\n }\n\n /**\n * Gets snapshot count\n * @return {number} - Number of recorded snapshots\n */\n size () {\n return this.#snapshots.size\n }\n\n /**\n * Resets call counts for all snapshots (useful for test cleanup)\n * @returns {void}\n */\n resetCallCounts () {\n for (const snapshot of this.#snapshots.values()) {\n snapshot.callCount = 0\n }\n }\n\n /**\n * Deletes a specific snapshot by request options\n * @param {SnapshotRequestOptions} requestOpts - Request options to match\n * @returns {boolean} - True if snapshot was deleted, false if not found\n */\n deleteSnapshot (requestOpts) {\n const request = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions)\n const hash = createRequestHash(request)\n return this.#snapshots.delete(hash)\n }\n\n /**\n * Gets information about a specific snapshot\n * @param {SnapshotRequestOptions} requestOpts - Request options to match\n * @returns {SnapshotInfo|null} - Snapshot information or null if not found\n */\n getSnapshotInfo (requestOpts) {\n const request = formatRequestKey(requestOpts, this.#headerFilters, this.matchOptions)\n const hash = createRequestHash(request)\n const snapshot = this.#snapshots.get(hash)\n\n if (!snapshot) return null\n\n return {\n hash,\n request: snapshot.request,\n responseCount: snapshot.responses ? snapshot.responses.length : (snapshot.response ? 1 : 0), // .response for legacy snapshots\n callCount: snapshot.callCount || 0,\n timestamp: snapshot.timestamp\n }\n }\n\n /**\n * Replaces all snapshots with new data (full replacement)\n * @param {Array<{hash: string; snapshot: SnapshotEntry}>|Record<string, SnapshotEntry>} snapshotData - New snapshot data to replace existing ones\n * @returns {void}\n */\n replaceSnapshots (snapshotData) {\n this.#snapshots.clear()\n\n if (Array.isArray(snapshotData)) {\n for (const { hash, snapshot } of snapshotData) {\n this.#snapshots.set(hash, snapshot)\n }\n } else if (snapshotData && typeof snapshotData === 'object') {\n // Legacy object format\n this.#snapshots = new Map(Object.entries(snapshotData))\n }\n }\n\n /**\n * Starts the auto-flush timer\n * @returns {void}\n */\n #startAutoFlush () {\n return this.#scheduleFlush()\n }\n\n /**\n * Stops the auto-flush timer\n * @returns {void}\n */\n #stopAutoFlush () {\n if (this.#flushTimeout) {\n clearTimeout(this.#flushTimeout)\n // Ensure any pending flush is completed\n this.saveSnapshots().catch(() => {\n // Ignore flush errors\n })\n this.#flushTimeout = null\n }\n }\n\n /**\n * Schedules a flush (debounced to avoid excessive writes)\n */\n #scheduleFlush () {\n this.#flushTimeout = setTimeout(() => {\n this.saveSnapshots().catch(() => {\n // Ignore flush errors\n })\n if (this.#autoFlush) {\n this.#flushTimeout?.refresh()\n } else {\n this.#flushTimeout = null\n }\n }, 1000) // 1 second debounce\n }\n\n /**\n * Cleanup method to stop timers\n * @returns {void}\n */\n destroy () {\n this.#stopAutoFlush()\n if (this.#flushTimeout) {\n clearTimeout(this.#flushTimeout)\n this.#flushTimeout = null\n }\n }\n\n /**\n * Async close method that saves all recordings and performs cleanup\n * @returns {Promise<void>}\n */\n async close () {\n // Save any pending recordings if we have a snapshot path\n if (this.#snapshotPath && this.#snapshots.size !== 0) {\n await this.saveSnapshots()\n }\n\n // Perform cleanup\n this.destroy()\n }\n}\n\nmodule.exports = { SnapshotRecorder, formatRequestKey, createRequestHash, filterHeadersForMatching, filterHeadersForStorage, createHeaderFilters }\n","'use strict'\n\nconst Agent = require('../dispatcher/agent')\nconst MockAgent = require('./mock-agent')\nconst { SnapshotRecorder } = require('./snapshot-recorder')\nconst WrapHandler = require('../handler/wrap-handler')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst { validateSnapshotMode } = require('./snapshot-utils')\n\nconst kSnapshotRecorder = Symbol('kSnapshotRecorder')\nconst kSnapshotMode = Symbol('kSnapshotMode')\nconst kSnapshotPath = Symbol('kSnapshotPath')\nconst kSnapshotLoaded = Symbol('kSnapshotLoaded')\nconst kRealAgent = Symbol('kRealAgent')\n\n// Static flag to ensure warning is only emitted once per process\nlet warningEmitted = false\n\nclass SnapshotAgent extends MockAgent {\n constructor (opts = {}) {\n // Emit experimental warning only once\n if (!warningEmitted) {\n process.emitWarning(\n 'SnapshotAgent is experimental and subject to change',\n 'ExperimentalWarning'\n )\n warningEmitted = true\n }\n\n const {\n mode = 'record',\n snapshotPath = null,\n ...mockAgentOpts\n } = opts\n\n super(mockAgentOpts)\n\n validateSnapshotMode(mode)\n\n // Validate snapshotPath is provided when required\n if ((mode === 'playback' || mode === 'update') && !snapshotPath) {\n throw new InvalidArgumentError(`snapshotPath is required when mode is '${mode}'`)\n }\n\n this[kSnapshotMode] = mode\n this[kSnapshotPath] = snapshotPath\n\n this[kSnapshotRecorder] = new SnapshotRecorder({\n snapshotPath: this[kSnapshotPath],\n mode: this[kSnapshotMode],\n maxSnapshots: opts.maxSnapshots,\n autoFlush: opts.autoFlush,\n flushInterval: opts.flushInterval,\n matchHeaders: opts.matchHeaders,\n ignoreHeaders: opts.ignoreHeaders,\n excludeHeaders: opts.excludeHeaders,\n matchBody: opts.matchBody,\n matchQuery: opts.matchQuery,\n caseSensitive: opts.caseSensitive,\n shouldRecord: opts.shouldRecord,\n shouldPlayback: opts.shouldPlayback,\n excludeUrls: opts.excludeUrls\n })\n this[kSnapshotLoaded] = false\n\n // For recording/update mode, we need a real agent to make actual requests\n // For playback mode, we need a real agent if there are excluded URLs\n if (this[kSnapshotMode] === 'record' || this[kSnapshotMode] === 'update' ||\n (this[kSnapshotMode] === 'playback' && opts.excludeUrls && opts.excludeUrls.length > 0)) {\n this[kRealAgent] = new Agent(opts)\n }\n\n // Auto-load snapshots in playback/update mode\n if ((this[kSnapshotMode] === 'playback' || this[kSnapshotMode] === 'update') && this[kSnapshotPath]) {\n this.loadSnapshots().catch(() => {\n // Ignore load errors - file might not exist yet\n })\n }\n }\n\n dispatch (opts, handler) {\n handler = WrapHandler.wrap(handler)\n const mode = this[kSnapshotMode]\n\n // Check if URL should be excluded (pass through without mocking/recording)\n if (this[kSnapshotRecorder].isUrlExcluded(opts)) {\n // Real agent is guaranteed by constructor when excludeUrls is configured\n return this[kRealAgent].dispatch(opts, handler)\n }\n\n if (mode === 'playback' || mode === 'update') {\n // Ensure snapshots are loaded\n if (!this[kSnapshotLoaded]) {\n // Need to load asynchronously, delegate to async version\n return this.#asyncDispatch(opts, handler)\n }\n\n // Try to find existing snapshot (synchronous)\n const snapshot = this[kSnapshotRecorder].findSnapshot(opts)\n\n if (snapshot) {\n // Use recorded response (synchronous)\n return this.#replaySnapshot(snapshot, handler)\n } else if (mode === 'update') {\n // Make real request and record it (async required)\n return this.#recordAndReplay(opts, handler)\n } else {\n // Playback mode but no snapshot found\n const error = new UndiciError(`No snapshot found for ${opts.method || 'GET'} ${opts.path}`)\n if (handler.onError) {\n handler.onError(error)\n return\n }\n throw error\n }\n } else if (mode === 'record') {\n // Record mode - make real request and save response (async required)\n return this.#recordAndReplay(opts, handler)\n }\n }\n\n /**\n * Async version of dispatch for when we need to load snapshots first\n */\n async #asyncDispatch (opts, handler) {\n await this.loadSnapshots()\n return this.dispatch(opts, handler)\n }\n\n /**\n * Records a real request and replays the response\n */\n #recordAndReplay (opts, handler) {\n const responseData = {\n statusCode: null,\n headers: {},\n trailers: {},\n body: []\n }\n\n const self = this // Capture 'this' context for use within nested handler callbacks\n\n const recordingHandler = {\n onRequestStart (controller, context) {\n return handler.onRequestStart(controller, { ...context, history: this.history })\n },\n\n onRequestUpgrade (controller, statusCode, headers, socket) {\n return handler.onRequestUpgrade(controller, statusCode, headers, socket)\n },\n\n onResponseStart (controller, statusCode, headers, statusMessage) {\n responseData.statusCode = statusCode\n responseData.headers = headers\n return handler.onResponseStart(controller, statusCode, headers, statusMessage)\n },\n\n onResponseData (controller, chunk) {\n responseData.body.push(chunk)\n return handler.onResponseData(controller, chunk)\n },\n\n onResponseEnd (controller, trailers) {\n responseData.trailers = trailers\n\n // Record the interaction using captured 'self' context (fire and forget)\n const responseBody = Buffer.concat(responseData.body)\n self[kSnapshotRecorder].record(opts, {\n statusCode: responseData.statusCode,\n headers: responseData.headers,\n body: responseBody,\n trailers: responseData.trailers\n })\n .then(() => handler.onResponseEnd(controller, trailers))\n .catch((error) => handler.onResponseError(controller, error))\n }\n }\n\n // Use composed agent if available (includes interceptors), otherwise use real agent\n const agent = this[kRealAgent]\n return agent.dispatch(opts, recordingHandler)\n }\n\n /**\n * Replays a recorded response\n *\n * @param {Object} snapshot - The recorded snapshot to replay.\n * @param {Object} handler - The handler to call with the response data.\n * @returns {void}\n */\n #replaySnapshot (snapshot, handler) {\n try {\n const { response } = snapshot\n\n const controller = {\n pause () { },\n resume () { },\n abort (reason) {\n this.aborted = true\n this.reason = reason\n },\n\n aborted: false,\n paused: false\n }\n\n handler.onRequestStart(controller)\n\n handler.onResponseStart(controller, response.statusCode, response.headers)\n\n // Body is always stored as base64 string\n const body = Buffer.from(response.body, 'base64')\n handler.onResponseData(controller, body)\n\n handler.onResponseEnd(controller, response.trailers)\n } catch (error) {\n handler.onError?.(error)\n }\n }\n\n /**\n * Loads snapshots from file\n *\n * @param {string} [filePath] - Optional file path to load snapshots from.\n * @returns {Promise<void>} - Resolves when snapshots are loaded.\n */\n async loadSnapshots (filePath) {\n await this[kSnapshotRecorder].loadSnapshots(filePath || this[kSnapshotPath])\n this[kSnapshotLoaded] = true\n\n // In playback mode, set up MockAgent interceptors for all snapshots\n if (this[kSnapshotMode] === 'playback') {\n this.#setupMockInterceptors()\n }\n }\n\n /**\n * Saves snapshots to file\n *\n * @param {string} [filePath] - Optional file path to save snapshots to.\n * @returns {Promise<void>} - Resolves when snapshots are saved.\n */\n async saveSnapshots (filePath) {\n return this[kSnapshotRecorder].saveSnapshots(filePath || this[kSnapshotPath])\n }\n\n /**\n * Sets up MockAgent interceptors based on recorded snapshots.\n *\n * This method creates MockAgent interceptors for each recorded snapshot,\n * allowing the SnapshotAgent to fall back to MockAgent's standard intercept\n * mechanism in playback mode. Each interceptor is configured to persist\n * (remain active for multiple requests) and responds with the recorded\n * response data.\n *\n * Called automatically when loading snapshots in playback mode.\n *\n * @returns {void}\n */\n #setupMockInterceptors () {\n for (const snapshot of this[kSnapshotRecorder].getSnapshots()) {\n const { request, responses, response } = snapshot\n const url = new URL(request.url)\n\n const mockPool = this.get(url.origin)\n\n // Handle both new format (responses array) and legacy format (response object)\n const responseData = responses ? responses[0] : response\n if (!responseData) continue\n\n mockPool.intercept({\n path: url.pathname + url.search,\n method: request.method,\n headers: request.headers,\n body: request.body\n }).reply(responseData.statusCode, responseData.body, {\n headers: responseData.headers,\n trailers: responseData.trailers\n }).persist()\n }\n }\n\n /**\n * Gets the snapshot recorder\n * @return {SnapshotRecorder} - The snapshot recorder instance\n */\n getRecorder () {\n return this[kSnapshotRecorder]\n }\n\n /**\n * Gets the current mode\n * @return {import('./snapshot-utils').SnapshotMode} - The current snapshot mode\n */\n getMode () {\n return this[kSnapshotMode]\n }\n\n /**\n * Clears all snapshots\n * @returns {void}\n */\n clearSnapshots () {\n this[kSnapshotRecorder].clear()\n }\n\n /**\n * Resets call counts for all snapshots (useful for test cleanup)\n * @returns {void}\n */\n resetCallCounts () {\n this[kSnapshotRecorder].resetCallCounts()\n }\n\n /**\n * Deletes a specific snapshot by request options\n * @param {import('./snapshot-recorder').SnapshotRequestOptions} requestOpts - Request options to identify the snapshot\n * @return {Promise<boolean>} - Returns true if the snapshot was deleted, false if not found\n */\n deleteSnapshot (requestOpts) {\n return this[kSnapshotRecorder].deleteSnapshot(requestOpts)\n }\n\n /**\n * Gets information about a specific snapshot\n * @returns {import('./snapshot-recorder').SnapshotInfo|null} - Snapshot information or null if not found\n */\n getSnapshotInfo (requestOpts) {\n return this[kSnapshotRecorder].getSnapshotInfo(requestOpts)\n }\n\n /**\n * Replaces all snapshots with new data (full replacement)\n * @param {Array<{hash: string; snapshot: import('./snapshot-recorder').SnapshotEntryshotEntry}>|Record<string, import('./snapshot-recorder').SnapshotEntry>} snapshotData - New snapshot data to replace existing snapshots\n * @returns {void}\n */\n replaceSnapshots (snapshotData) {\n this[kSnapshotRecorder].replaceSnapshots(snapshotData)\n }\n\n /**\n * Closes the agent, saving snapshots and cleaning up resources.\n *\n * @returns {Promise<void>}\n */\n async close () {\n await this[kSnapshotRecorder].close()\n await this[kRealAgent]?.close()\n await super.close()\n }\n}\n\nmodule.exports = SnapshotAgent\n","'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')\n\nif (getGlobalDispatcher() === undefined) {\n setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n if (!agent || typeof agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument agent must implement Agent')\n }\n\n Object.defineProperty(globalThis, globalDispatcher, {\n value: agent,\n writable: true,\n enumerable: false,\n configurable: false\n })\n\n Object.defineProperty(globalThis, legacyGlobalDispatcher, {\n value: agent,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nfunction getGlobalDispatcher () {\n return globalThis[legacyGlobalDispatcher]\n}\n\n// These are the globals that can be installed by undici.install().\n// Not exported by index.js to avoid use outside of this module.\nconst installedExports = /** @type {const} */ (\n [\n 'fetch',\n 'Headers',\n 'Response',\n 'Request',\n 'FormData',\n 'WebSocket',\n 'CloseEvent',\n 'ErrorEvent',\n 'MessageEvent',\n 'EventSource'\n ]\n)\n\nmodule.exports = {\n setGlobalDispatcher,\n getGlobalDispatcher,\n installedExports\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst WrapHandler = require('./wrap-handler')\n\n/**\n * @deprecated\n */\nmodule.exports = class DecoratorHandler {\n #handler\n #onCompleteCalled = false\n #onErrorCalled = false\n #onResponseStartCalled = false\n\n constructor (handler) {\n if (typeof handler !== 'object' || handler === null) {\n throw new TypeError('handler must be an object')\n }\n this.#handler = WrapHandler.wrap(handler)\n }\n\n onRequestStart (...args) {\n this.#handler.onRequestStart?.(...args)\n }\n\n onRequestUpgrade (...args) {\n assert(!this.#onCompleteCalled)\n assert(!this.#onErrorCalled)\n\n return this.#handler.onRequestUpgrade?.(...args)\n }\n\n onResponseStart (...args) {\n assert(!this.#onCompleteCalled)\n assert(!this.#onErrorCalled)\n assert(!this.#onResponseStartCalled)\n\n this.#onResponseStartCalled = true\n\n return this.#handler.onResponseStart?.(...args)\n }\n\n onResponseData (...args) {\n assert(!this.#onCompleteCalled)\n assert(!this.#onErrorCalled)\n\n return this.#handler.onResponseData?.(...args)\n }\n\n onResponseEnd (...args) {\n assert(!this.#onCompleteCalled)\n assert(!this.#onErrorCalled)\n\n this.#onCompleteCalled = true\n return this.#handler.onResponseEnd?.(...args)\n }\n\n onResponseError (...args) {\n this.#onErrorCalled = true\n return this.#handler.onResponseError?.(...args)\n }\n\n /**\n * @deprecated\n */\n onBodySent () {}\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nconst noop = () => {}\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nclass RedirectHandler {\n static buildDispatch (dispatcher, maxRedirections) {\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n const dispatch = dispatcher.dispatch.bind(dispatcher)\n return (opts, originalHandler) => dispatch(opts, new RedirectHandler(dispatch, maxRedirections, opts, originalHandler))\n }\n\n constructor (dispatch, maxRedirections, opts, handler) {\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n this.dispatch = dispatch\n this.location = null\n const { maxRedirections: _, ...cleanOpts } = opts\n this.opts = cleanOpts // opts must be a copy, exclude maxRedirections\n this.maxRedirections = maxRedirections\n this.handler = handler\n this.history = []\n\n if (util.isStream(this.opts.body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (util.bodyLength(this.opts.body) === 0) {\n this.opts.body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof this.opts.body.readableDidRead !== 'boolean') {\n this.opts.body[kBodyUsed] = false\n EE.prototype.on.call(this.opts.body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n } else if (\n this.opts.body &&\n typeof this.opts.body !== 'string' &&\n !ArrayBuffer.isView(this.opts.body) &&\n util.isIterable(this.opts.body) &&\n !util.isFormDataLike(this.opts.body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n }\n }\n\n onRequestStart (controller, context) {\n this.handler.onRequestStart?.(controller, { ...context, history: this.history })\n }\n\n onRequestUpgrade (controller, statusCode, headers, socket) {\n this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket)\n }\n\n onResponseStart (controller, statusCode, headers, statusMessage) {\n if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n throw new Error('max redirects')\n }\n\n // https://tools.ietf.org/html/rfc7231#section-6.4.2\n // https://fetch.spec.whatwg.org/#http-redirect-fetch\n // In case of HTTP 301 or 302 with POST, change the method to GET\n if ((statusCode === 301 || statusCode === 302) && this.opts.method === 'POST') {\n this.opts.method = 'GET'\n if (util.isStream(this.opts.body)) {\n util.destroy(this.opts.body.on('error', noop))\n }\n this.opts.body = null\n }\n\n // https://tools.ietf.org/html/rfc7231#section-6.4.4\n // In case of HTTP 303, always replace method to be either HEAD or GET\n if (statusCode === 303 && this.opts.method !== 'HEAD') {\n this.opts.method = 'GET'\n if (util.isStream(this.opts.body)) {\n util.destroy(this.opts.body.on('error', noop))\n }\n this.opts.body = null\n }\n\n this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1\n ? null\n : headers.location\n\n if (this.opts.origin) {\n this.history.push(new URL(this.opts.path, this.opts.origin))\n }\n\n if (!this.location) {\n this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage)\n return\n }\n\n const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n const path = search ? `${pathname}${search}` : pathname\n\n // Check for redirect loops by seeing if we've already visited this URL in our history\n // This catches the case where Client/Pool try to handle cross-origin redirects but fail\n // and keep redirecting to the same URL in an infinite loop\n const redirectUrlString = `${origin}${path}`\n for (const historyUrl of this.history) {\n if (historyUrl.toString() === redirectUrlString) {\n throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`)\n }\n }\n\n // Remove headers referring to the original URL.\n // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n // https://tools.ietf.org/html/rfc7231#section-6.4\n this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n this.opts.path = path\n this.opts.origin = origin\n this.opts.query = null\n }\n\n onResponseData (controller, chunk) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response bodies.\n\n Redirection is used to serve the requested resource from another URL, so it assumes that\n no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n (which means it's optional and not mandated) contain just an hyperlink to the value of\n the Location response header, so the body can be ignored safely.\n\n For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n response header AND a response body with the other possible location to follow.\n Since the spec explicitly chooses not to specify a format for such body and leave it to\n servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n */\n } else {\n this.handler.onResponseData?.(controller, chunk)\n }\n }\n\n onResponseEnd (controller, trailers) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n and neither are useful if present.\n\n See comment on onData method above for more detailed information.\n */\n this.dispatch(this.opts, this)\n } else {\n this.handler.onResponseEnd(controller, trailers)\n }\n }\n\n onResponseError (controller, error) {\n this.handler.onResponseError?.(controller, error)\n }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n if (header.length === 4) {\n return util.headerNameToString(header) === 'host'\n }\n if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n return true\n }\n if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n const name = util.headerNameToString(header)\n return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n }\n return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n const ret = []\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n ret.push(headers[i], headers[i + 1])\n }\n }\n } else if (headers && typeof headers === 'object') {\n const entries = util.hasSafeIterator(headers) ? headers : Object.entries(headers)\n\n for (const [key, value] of entries) {\n if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n ret.push(key, value)\n }\n }\n } else {\n assert(headers == null, 'headers must be an object or an array')\n }\n return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections } = {}) {\n return (dispatch) => {\n return function Intercept (opts, handler) {\n const { maxRedirections = defaultMaxRedirections, ...rest } = opts\n\n if (maxRedirections == null || maxRedirections === 0) {\n return dispatch(opts, handler)\n }\n\n const dispatchOpts = { ...rest } // Stop sub dispatcher from also redirecting.\n const redirectHandler = new RedirectHandler(dispatch, maxRedirections, dispatchOpts, handler)\n return dispatch(dispatchOpts, redirectHandler)\n }\n }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\n\n// const { parseHeaders } = require('../core/util')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { ResponseError } = require('../core/errors')\n\nclass ResponseErrorHandler extends DecoratorHandler {\n #statusCode\n #contentType\n #decoder\n #headers\n #body\n\n constructor (_opts, { handler }) {\n super(handler)\n }\n\n #checkContentType (contentType) {\n return (this.#contentType ?? '').indexOf(contentType) === 0\n }\n\n onRequestStart (controller, context) {\n this.#statusCode = 0\n this.#contentType = null\n this.#decoder = null\n this.#headers = null\n this.#body = ''\n\n return super.onRequestStart(controller, context)\n }\n\n onResponseStart (controller, statusCode, headers, statusMessage) {\n this.#statusCode = statusCode\n this.#headers = headers\n this.#contentType = headers['content-type']\n\n if (this.#statusCode < 400) {\n return super.onResponseStart(controller, statusCode, headers, statusMessage)\n }\n\n if (this.#checkContentType('application/json') || this.#checkContentType('text/plain')) {\n this.#decoder = new TextDecoder('utf-8')\n }\n }\n\n onResponseData (controller, chunk) {\n if (this.#statusCode < 400) {\n return super.onResponseData(controller, chunk)\n }\n\n this.#body += this.#decoder?.decode(chunk, { stream: true }) ?? ''\n }\n\n onResponseEnd (controller, trailers) {\n if (this.#statusCode >= 400) {\n this.#body += this.#decoder?.decode(undefined, { stream: false }) ?? ''\n\n if (this.#checkContentType('application/json')) {\n try {\n this.#body = JSON.parse(this.#body)\n } catch {\n // Do nothing...\n }\n }\n\n let err\n const stackTraceLimit = Error.stackTraceLimit\n Error.stackTraceLimit = 0\n try {\n err = new ResponseError('Response Error', this.#statusCode, {\n body: this.#body,\n headers: this.#headers\n })\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n\n super.onResponseError(controller, err)\n } else {\n super.onResponseEnd(controller, trailers)\n }\n }\n\n onResponseError (controller, err) {\n super.onResponseError(controller, err)\n }\n}\n\nmodule.exports = () => {\n return (dispatch) => {\n return function Intercept (opts, handler) {\n return dispatch(opts, new ResponseErrorHandler(opts, { handler }))\n }\n }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n return dispatch => {\n return function retryInterceptor (opts, handler) {\n return dispatch(\n opts,\n new RetryHandler(\n { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n {\n handler,\n dispatch\n }\n )\n )\n }\n }\n}\n","'use strict'\n\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n #maxSize = 1024 * 1024\n #dumped = false\n #size = 0\n aborted = false\n reason = false\n\n constructor ({ maxSize, signal }, handler) {\n if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n throw new InvalidArgumentError('maxSize must be a number greater than 0')\n }\n\n super(handler)\n\n this.#maxSize = maxSize ?? this.#maxSize\n // this.#handler = handler\n }\n\n #abort (reason) {\n this.aborted = true\n this.reason = reason\n }\n\n onRequestStart (controller, context) {\n controller.abort = this.#abort.bind(this)\n\n return super.onRequestStart(controller, context)\n }\n\n onResponseStart (controller, statusCode, headers, statusMessage) {\n const contentLength = headers['content-length']\n\n if (contentLength != null && contentLength > this.#maxSize) {\n throw new RequestAbortedError(\n `Response size (${contentLength}) larger than maxSize (${\n this.#maxSize\n })`\n )\n }\n\n if (this.aborted === true) {\n return true\n }\n\n return super.onResponseStart(controller, statusCode, headers, statusMessage)\n }\n\n onResponseError (controller, err) {\n super.onResponseError(controller, this.aborted === true ? this.reason : err)\n }\n\n onResponseData (controller, chunk) {\n this.#size = this.#size + chunk.length\n\n if (this.#size > this.#maxSize) {\n throw new RequestAbortedError(\n `Response size (${this.#size}) larger than maxSize (${this.#maxSize})`\n )\n }\n\n if (this.#size === this.#maxSize) {\n this.#dumped = true\n }\n\n return true\n }\n\n onResponseEnd (controller, trailers) {\n if (this.aborted === true) {\n super.onResponseError(controller, this.reason)\n return\n }\n\n super.onResponseEnd(controller, this.#dumped ? {} : trailers)\n }\n}\n\nfunction createDumpInterceptor (\n { maxSize: defaultMaxSize } = {\n maxSize: 1024 * 1024\n }\n) {\n return dispatch => {\n return function Intercept (opts, handler) {\n const { dumpMaxSize = defaultMaxSize } = opts\n\n const dumpHandler = new DumpHandler({ maxSize: dumpMaxSize, signal: opts.signal }, handler)\n\n return dispatch(opts, dumpHandler)\n }\n }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nfunction hasSafeIterator (headers) {\n const prototype = Object.getPrototypeOf(headers)\n const ownIterator = Object.prototype.hasOwnProperty.call(headers, Symbol.iterator)\n return ownIterator || (prototype != null && prototype !== Object.prototype && typeof headers[Symbol.iterator] === 'function')\n}\n\nfunction isHostHeader (key) {\n return typeof key === 'string' && key.toLowerCase() === 'host'\n}\n\nfunction normalizeHeaders (headers) {\n if (headers == null) {\n return null\n }\n\n if (Array.isArray(headers)) {\n if (headers.length === 0 || !Array.isArray(headers[0])) {\n return headers\n }\n\n const normalized = []\n for (const header of headers) {\n if (Array.isArray(header) && header.length === 2) {\n normalized.push(header[0], header[1])\n } else {\n normalized.push(header)\n }\n }\n\n return normalized\n }\n\n if (typeof headers === 'object' && hasSafeIterator(headers)) {\n const normalized = []\n for (const header of headers) {\n if (Array.isArray(header) && header.length === 2) {\n normalized.push(header[0], header[1])\n } else {\n normalized.push(header)\n }\n }\n\n return normalized\n }\n\n return headers\n}\n\nfunction hasHostHeader (headers) {\n if (headers == null) {\n return false\n }\n\n if (Array.isArray(headers)) {\n if (headers.length === 0) {\n return false\n }\n\n for (let i = 0; i < headers.length; i += 2) {\n if (isHostHeader(headers[i])) {\n return true\n }\n }\n\n return false\n }\n\n if (typeof headers === 'object') {\n for (const key in headers) {\n if (isHostHeader(key)) {\n return true\n }\n }\n }\n\n return false\n}\n\nfunction withHostHeader (host, headers) {\n const normalizedHeaders = normalizeHeaders(headers)\n\n if (hasHostHeader(normalizedHeaders)) {\n return normalizedHeaders\n }\n\n if (Array.isArray(normalizedHeaders)) {\n return ['host', host, ...normalizedHeaders]\n }\n\n if (normalizedHeaders && typeof normalizedHeaders === 'object') {\n return {\n host,\n ...normalizedHeaders\n }\n }\n\n return { host }\n}\n\nclass DNSStorage {\n #maxItems = 0\n #records = new Map()\n\n constructor (opts) {\n this.#maxItems = opts.maxItems\n }\n\n get size () {\n return this.#records.size\n }\n\n get (hostname) {\n return this.#records.get(hostname) ?? null\n }\n\n set (hostname, records) {\n this.#records.set(hostname, records)\n }\n\n delete (hostname) {\n this.#records.delete(hostname)\n }\n\n // Delegate to storage decide can we do more lookups or not\n full () {\n return this.size >= this.#maxItems\n }\n}\n\nclass DNSInstance {\n #maxTTL = 0\n #maxItems = 0\n dualStack = true\n affinity = null\n lookup = null\n pick = null\n storage = null\n\n constructor (opts) {\n this.#maxTTL = opts.maxTTL\n this.#maxItems = opts.maxItems\n this.dualStack = opts.dualStack\n this.affinity = opts.affinity\n this.lookup = opts.lookup ?? this.#defaultLookup\n this.pick = opts.pick ?? this.#defaultPick\n this.storage = opts.storage ?? new DNSStorage(opts)\n }\n\n runLookup (origin, opts, cb) {\n const ips = this.storage.get(origin.hostname)\n\n // If full, we just return the origin\n if (ips == null && this.storage.full()) {\n cb(null, origin)\n return\n }\n\n const newOpts = {\n affinity: this.affinity,\n dualStack: this.dualStack,\n lookup: this.lookup,\n pick: this.pick,\n ...opts.dns,\n maxTTL: this.#maxTTL,\n maxItems: this.#maxItems\n }\n\n // If no IPs we lookup\n if (ips == null) {\n this.lookup(origin, newOpts, (err, addresses) => {\n if (err || addresses == null || addresses.length === 0) {\n cb(err ?? new InformationalError('No DNS entries found'))\n return\n }\n\n this.setRecords(origin, addresses)\n const records = this.storage.get(origin.hostname)\n\n const ip = this.pick(\n origin,\n records,\n newOpts.affinity\n )\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (origin.port !== '') {\n port = `:${origin.port}`\n } else {\n port = ''\n }\n\n cb(\n null,\n new URL(`${origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`)\n )\n })\n } else {\n // If there's IPs we pick\n const ip = this.pick(\n origin,\n ips,\n newOpts.affinity\n )\n\n // If no IPs we lookup - deleting old records\n if (ip == null) {\n this.storage.delete(origin.hostname)\n this.runLookup(origin, opts, cb)\n return\n }\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (origin.port !== '') {\n port = `:${origin.port}`\n } else {\n port = ''\n }\n\n cb(\n null,\n new URL(`${origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`)\n )\n }\n }\n\n #defaultLookup (origin, opts, cb) {\n lookup(\n origin.hostname,\n {\n all: true,\n family: this.dualStack === false ? this.affinity : 0,\n order: 'ipv4first'\n },\n (err, addresses) => {\n if (err) {\n return cb(err)\n }\n\n const results = new Map()\n\n for (const addr of addresses) {\n // On linux we found duplicates, we attempt to remove them with\n // the latest record\n results.set(`${addr.address}:${addr.family}`, addr)\n }\n\n cb(null, results.values())\n }\n )\n }\n\n #defaultPick (origin, hostnameRecords, affinity) {\n let ip = null\n const { records, offset } = hostnameRecords\n\n let family\n if (this.dualStack) {\n if (affinity == null) {\n // Balance between ip families\n if (offset == null || offset === maxInt) {\n hostnameRecords.offset = 0\n affinity = 4\n } else {\n hostnameRecords.offset++\n affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n }\n }\n\n if (records[affinity] != null && records[affinity].ips.length > 0) {\n family = records[affinity]\n } else {\n family = records[affinity === 4 ? 6 : 4]\n }\n } else {\n family = records[affinity]\n }\n\n // If no IPs we return null\n if (family == null || family.ips.length === 0) {\n return ip\n }\n\n if (family.offset == null || family.offset === maxInt) {\n family.offset = 0\n } else {\n family.offset++\n }\n\n const position = family.offset % family.ips.length\n ip = family.ips[position] ?? null\n\n if (ip == null) {\n return ip\n }\n\n if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n // We delete expired records\n // It is possible that they have different TTL, so we manage them individually\n family.ips.splice(position, 1)\n return this.pick(origin, hostnameRecords, affinity)\n }\n\n return ip\n }\n\n pickFamily (origin, ipFamily) {\n const records = this.storage.get(origin.hostname)?.records\n if (!records) {\n return null\n }\n\n const family = records[ipFamily]\n if (!family) {\n return null\n }\n\n if (family.offset == null || family.offset === maxInt) {\n family.offset = 0\n } else {\n family.offset++\n }\n\n const position = family.offset % family.ips.length\n const ip = family.ips[position] ?? null\n if (ip == null) {\n return ip\n }\n\n if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n // We delete expired records\n // It is possible that they have different TTL, so we manage them individually\n family.ips.splice(position, 1)\n }\n\n return ip\n }\n\n setRecords (origin, addresses) {\n const timestamp = Date.now()\n const records = { records: { 4: null, 6: null } }\n let minTTL = this.#maxTTL\n for (const record of addresses) {\n record.timestamp = timestamp\n if (typeof record.ttl === 'number') {\n // The record TTL is expected to be in ms\n record.ttl = Math.min(record.ttl, this.#maxTTL)\n minTTL = Math.min(minTTL, record.ttl)\n } else {\n record.ttl = this.#maxTTL\n }\n\n const familyRecords = records.records[record.family] ?? { ips: [] }\n\n familyRecords.ips.push(record)\n records.records[record.family] = familyRecords\n }\n\n // We provide a default TTL if external storage will be used without TTL per record-level support\n this.storage.set(origin.hostname, records, { ttl: minTTL })\n }\n\n deleteRecords (origin) {\n this.storage.delete(origin.hostname)\n }\n\n getHandler (meta, opts) {\n return new DNSDispatchHandler(this, meta, opts)\n }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n #state = null\n #opts = null\n #dispatch = null\n #origin = null\n #controller = null\n #newOrigin = null\n #firstTry = true\n\n constructor (state, { origin, handler, dispatch, newOrigin }, opts) {\n super(handler)\n this.#origin = origin\n this.#newOrigin = newOrigin\n this.#opts = { ...opts }\n this.#state = state\n this.#dispatch = dispatch\n }\n\n onResponseError (controller, err) {\n switch (err.code) {\n case 'ETIMEDOUT':\n case 'ECONNREFUSED': {\n if (this.#state.dualStack) {\n if (!this.#firstTry) {\n super.onResponseError(controller, err)\n return\n }\n this.#firstTry = false\n\n // Pick an ip address from the other family\n const otherFamily = this.#newOrigin.hostname[0] === '[' ? 4 : 6\n const ip = this.#state.pickFamily(this.#origin, otherFamily)\n if (ip == null) {\n super.onResponseError(controller, err)\n return\n }\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (this.#origin.port !== '') {\n port = `:${this.#origin.port}`\n } else {\n port = ''\n }\n\n const dispatchOpts = {\n ...this.#opts,\n origin: `${this.#origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`,\n headers: withHostHeader(this.#origin.host, this.#opts.headers)\n }\n this.#dispatch(dispatchOpts, this)\n return\n }\n\n // if dual-stack disabled, we error out\n super.onResponseError(controller, err)\n break\n }\n case 'ENOTFOUND':\n this.#state.deleteRecords(this.#origin)\n super.onResponseError(controller, err)\n break\n default:\n super.onResponseError(controller, err)\n break\n }\n }\n}\n\nmodule.exports = interceptorOpts => {\n if (\n interceptorOpts?.maxTTL != null &&\n (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n ) {\n throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n }\n\n if (\n interceptorOpts?.maxItems != null &&\n (typeof interceptorOpts?.maxItems !== 'number' ||\n interceptorOpts?.maxItems < 1)\n ) {\n throw new InvalidArgumentError(\n 'Invalid maxItems. Must be a positive number and greater than zero'\n )\n }\n\n if (\n interceptorOpts?.affinity != null &&\n interceptorOpts?.affinity !== 4 &&\n interceptorOpts?.affinity !== 6\n ) {\n throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n }\n\n if (\n interceptorOpts?.dualStack != null &&\n typeof interceptorOpts?.dualStack !== 'boolean'\n ) {\n throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n }\n\n if (\n interceptorOpts?.lookup != null &&\n typeof interceptorOpts?.lookup !== 'function'\n ) {\n throw new InvalidArgumentError('Invalid lookup. Must be a function')\n }\n\n if (\n interceptorOpts?.pick != null &&\n typeof interceptorOpts?.pick !== 'function'\n ) {\n throw new InvalidArgumentError('Invalid pick. Must be a function')\n }\n\n if (\n interceptorOpts?.storage != null &&\n (typeof interceptorOpts?.storage?.get !== 'function' ||\n typeof interceptorOpts?.storage?.set !== 'function' ||\n typeof interceptorOpts?.storage?.full !== 'function' ||\n typeof interceptorOpts?.storage?.delete !== 'function'\n )\n ) {\n throw new InvalidArgumentError('Invalid storage. Must be a object with methods: { get, set, full, delete }')\n }\n\n const dualStack = interceptorOpts?.dualStack ?? true\n let affinity\n if (dualStack) {\n affinity = interceptorOpts?.affinity ?? null\n } else {\n affinity = interceptorOpts?.affinity ?? 4\n }\n\n const opts = {\n maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n lookup: interceptorOpts?.lookup ?? null,\n pick: interceptorOpts?.pick ?? null,\n dualStack,\n affinity,\n maxItems: interceptorOpts?.maxItems ?? Infinity,\n storage: interceptorOpts?.storage\n }\n\n const instance = new DNSInstance(opts)\n\n return dispatch => {\n return function dnsInterceptor (origDispatchOpts, handler) {\n const origin =\n origDispatchOpts.origin.constructor === URL\n ? origDispatchOpts.origin\n : new URL(origDispatchOpts.origin)\n\n if (isIP(origin.hostname) !== 0) {\n return dispatch(origDispatchOpts, handler)\n }\n\n instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n if (err) {\n return handler.onResponseError(null, err)\n }\n\n const dispatchOpts = {\n ...origDispatchOpts,\n servername: origin.hostname, // For SNI on TLS\n origin: newOrigin.origin,\n headers: withHostHeader(origin.host, origDispatchOpts.headers)\n }\n\n dispatch(\n dispatchOpts,\n instance.getHandler(\n { origin, dispatch, handler, newOrigin },\n origDispatchOpts\n )\n )\n })\n\n return true\n }\n }\n}\n","'use strict'\n\nconst {\n safeHTTPMethods,\n pathHasQueryOrFragment,\n hasSafeIterator,\n isValidHTTPToken\n} = require('../core/util')\n\nconst { serializePathWithQuery } = require('../core/util')\n\nconst MAX_DELTA_SECONDS = 2147483647\nconst RESTRICTIVE_DIRECTIVE_NAMES = ['no-store', 'private', 'no-cache']\nconst kInvalidCacheControlDirectives = Symbol('invalid cache-control directives')\n\nfunction trimOWS (value) {\n return value.replace(/^[\\t ]+|[\\t ]+$/g, '')\n}\n\nfunction arrayIncludes (array, value) {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true\n }\n }\n\n return false\n}\n\nfunction trimOWSStart (value) {\n return value.replace(/^[\\t ]+/, '')\n}\n\nfunction trimOWSEnd (value) {\n return value.replace(/[\\t ]+$/, '')\n}\n\nfunction findUnescapedQuote (value, start) {\n let escaped = false\n for (let i = start; i < value.length; i++) {\n if (escaped) {\n escaped = false\n } else if (value[i] === '\\\\') {\n escaped = true\n } else if (value[i] === '\"') {\n return i\n }\n }\n\n return -1\n}\n\nfunction splitCacheControlHeaderValue (value) {\n const directives = []\n let start = 0\n let quoteStart = -1\n let inQuote = false\n let escaped = false\n\n for (let i = 0; i < value.length; i++) {\n if (inQuote) {\n if (escaped) {\n escaped = false\n } else if (value[i] === '\\\\') {\n escaped = true\n } else if (value[i] === '\"') {\n inQuote = false\n quoteStart = -1\n }\n } else if (value[i] === '\"') {\n inQuote = true\n quoteStart = i\n } else if (value[i] === ',') {\n directives.push({ value: value.substring(start, i), fromMalformedQuote: false })\n start = i + 1\n }\n }\n\n if (!inQuote) {\n directives.push({ value: value.substring(start), fromMalformedQuote: false })\n return directives\n }\n\n const tail = value.substring(start)\n const quoteOffset = quoteStart - start\n let tailStart = 0\n for (let i = 0; i < tail.length; i++) {\n if (tail[i] === ',') {\n directives.push({\n value: tail.substring(tailStart, i),\n fromMalformedQuote: tailStart > quoteOffset\n })\n tailStart = i + 1\n }\n }\n\n directives.push({\n value: tail.substring(tailStart),\n fromMalformedQuote: tailStart > quoteOffset\n })\n return directives\n}\n\nfunction markInvalidCacheControlDirective (directives, key) {\n let invalidDirectives = directives[kInvalidCacheControlDirectives]\n\n if (invalidDirectives === undefined) {\n invalidDirectives = new Set()\n Object.defineProperty(directives, kInvalidCacheControlDirectives, {\n value: invalidDirectives\n })\n }\n\n invalidDirectives.add(key)\n}\n\nfunction hasInvalidCacheControlDirective (directives, key) {\n return directives[kInvalidCacheControlDirectives]?.has(key) === true\n}\n\nfunction getMalformedRestrictiveDirectiveName (key) {\n for (const directiveName of RESTRICTIVE_DIRECTIVE_NAMES) {\n if (\n key.startsWith(directiveName) &&\n key.length > directiveName.length &&\n !isValidHTTPToken(key[directiveName.length])\n ) {\n return directiveName\n }\n }\n\n let tokenOnlyKey = ''\n let hasInvalidTokenChar = false\n for (let i = 0; i < key.length; i++) {\n if (isValidHTTPToken(key[i])) {\n tokenOnlyKey += key[i]\n } else {\n hasInvalidTokenChar = true\n }\n }\n\n if (hasInvalidTokenChar && arrayIncludes(RESTRICTIVE_DIRECTIVE_NAMES, tokenOnlyKey)) {\n return tokenOnlyKey\n }\n}\n\n/**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchOptions} opts\n */\nfunction makeCacheKey (opts) {\n if (!opts.origin) {\n throw new Error('opts.origin is undefined')\n }\n\n let fullPath = opts.path || '/'\n\n if (opts.query && !pathHasQueryOrFragment(fullPath)) {\n fullPath = serializePathWithQuery(fullPath, opts.query)\n }\n\n return {\n origin: opts.origin.toString(),\n method: opts.method,\n path: fullPath,\n headers: opts.headers\n }\n}\n\nfunction appendHeader (headers, key, val) {\n const headerName = key.toLowerCase()\n const current = headers[headerName]\n const values = Array.isArray(val) ? val : [val]\n\n if (current === undefined) {\n headers[headerName] = Array.isArray(val) ? val.slice() : val\n } else if (Array.isArray(current)) {\n current.push(...values)\n } else {\n headers[headerName] = [current, ...values]\n }\n}\n\n/**\n * @param {Record<string, string[] | string>}\n * @returns {Record<string, string[] | string>}\n */\nfunction normalizeHeaders (opts) {\n let headers\n if (opts.headers == null) {\n headers = {}\n } else if (typeof opts.headers === 'object') {\n headers = {}\n\n if (hasSafeIterator(opts.headers)) {\n for (const x of opts.headers) {\n if (!Array.isArray(x)) {\n throw new Error('opts.headers is not a valid header map')\n }\n const [key, val] = x\n if (typeof key !== 'string' || typeof val !== 'string') {\n throw new Error('opts.headers is not a valid header map')\n }\n appendHeader(headers, key, val)\n }\n } else {\n for (const key of Object.keys(opts.headers)) {\n appendHeader(headers, key, opts.headers[key])\n }\n }\n } else {\n throw new Error('opts.headers is not an object')\n }\n\n return headers\n}\n\n/**\n * @param {any} key\n */\nfunction assertCacheKey (key) {\n if (typeof key !== 'object') {\n throw new TypeError(`expected key to be object, got ${typeof key}`)\n }\n\n for (const property of ['origin', 'method', 'path']) {\n if (typeof key[property] !== 'string') {\n throw new TypeError(`expected key.${property} to be string, got ${typeof key[property]}`)\n }\n }\n\n if (key.headers !== undefined && typeof key.headers !== 'object') {\n throw new TypeError(`expected headers to be object, got ${typeof key}`)\n }\n}\n\n/**\n * @param {any} value\n */\nfunction assertCacheValue (value) {\n if (typeof value !== 'object') {\n throw new TypeError(`expected value to be object, got ${typeof value}`)\n }\n\n for (const property of ['statusCode', 'cachedAt', 'staleAt', 'deleteAt']) {\n if (typeof value[property] !== 'number') {\n throw new TypeError(`expected value.${property} to be number, got ${typeof value[property]}`)\n }\n }\n\n if (typeof value.statusMessage !== 'string') {\n throw new TypeError(`expected value.statusMessage to be string, got ${typeof value.statusMessage}`)\n }\n\n if (value.headers != null && typeof value.headers !== 'object') {\n throw new TypeError(`expected value.rawHeaders to be object, got ${typeof value.headers}`)\n }\n\n if (value.vary !== undefined && typeof value.vary !== 'object') {\n throw new TypeError(`expected value.vary to be object, got ${typeof value.vary}`)\n }\n\n if (value.etag !== undefined && typeof value.etag !== 'string') {\n throw new TypeError(`expected value.etag to be string, got ${typeof value.etag}`)\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control\n * @see https://www.iana.org/assignments/http-cache-directives/http-cache-directives.xhtml\n\n * @param {string | string[]} header\n * @returns {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives}\n */\nfunction parseCacheControlHeader (header) {\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives}\n */\n const output = {}\n const invalidNumericDirectives = new Set()\n const invalidNoArgumentDirectives = new Set()\n\n const directives = splitCacheControlHeaderValue(Array.isArray(header) ? header.join(',') : header)\n\n for (let i = 0; i < directives.length; i++) {\n const directiveRecord = directives[i]\n const directive = directiveRecord.value.toLowerCase()\n const fromMalformedQuote = directiveRecord.fromMalformedQuote\n const keyValueDelimiter = directive.indexOf('=')\n\n let key\n let value\n let keyHasTrailingWhitespace = false\n let valueHasLeadingWhitespace = false\n if (keyValueDelimiter !== -1) {\n const rawKey = directive.substring(0, keyValueDelimiter)\n const rawValue = directive.substring(keyValueDelimiter + 1)\n\n keyHasTrailingWhitespace = trimOWSEnd(rawKey) !== rawKey\n valueHasLeadingWhitespace = trimOWSStart(rawValue) !== rawValue\n key = trimOWS(rawKey)\n value = trimOWSStart(rawValue)\n } else {\n key = trimOWS(directive)\n }\n\n const malformedRestrictiveDirectiveName = getMalformedRestrictiveDirectiveName(key)\n if (malformedRestrictiveDirectiveName !== undefined) {\n output[malformedRestrictiveDirectiveName] = true\n continue\n }\n\n switch (key) {\n case 'min-fresh':\n case 'max-stale':\n case 'max-age':\n case 's-maxage':\n case 'stale-while-revalidate':\n case 'stale-if-error': {\n if (fromMalformedQuote || invalidNumericDirectives.has(key)) {\n continue\n }\n\n if (value === undefined || keyHasTrailingWhitespace || valueHasLeadingWhitespace) {\n delete output[key]\n invalidNumericDirectives.add(key)\n markInvalidCacheControlDirective(output, key)\n continue\n }\n\n if (\n value.length >= 2 &&\n value[0] === '\"' &&\n value[value.length - 1] === '\"'\n ) {\n value = value.substring(1, value.length - 1)\n }\n\n if (!/^[0-9]+$/.test(value)) {\n delete output[key]\n invalidNumericDirectives.add(key)\n markInvalidCacheControlDirective(output, key)\n continue\n }\n\n const parsedValue = Math.min(parseInt(value, 10), MAX_DELTA_SECONDS)\n\n if (key === 'min-fresh') {\n if (!(key in output) || output[key] < parsedValue) {\n output[key] = parsedValue\n }\n } else if (!(key in output) || output[key] > parsedValue) {\n output[key] = parsedValue\n }\n\n break\n }\n case 'private':\n case 'no-cache': {\n if (fromMalformedQuote) {\n output[key] = true\n break\n }\n\n if (value !== undefined && value.length === 0) {\n output[key] = true\n break\n }\n\n if (value) {\n // The private and no-cache directives can be unqualified (aka just\n // `private` or `no-cache`) or qualified (w/ a value). When they're\n // qualified, it's a list of headers like `no-cache=header1`,\n // `no-cache=\"header1\"`, or `no-cache=\"header1, header2\"`\n // If we're given multiple headers, the comma messes us up since\n // we split the full header by commas. So, let's loop through the\n // remaining parts in front of us until we find one that contains a\n // closing quote. We can then skip the consumed quoted-list fragments and\n // continue parsing like normal.\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-no-cache-2\n if (value[0] === '\"') {\n // Something like `no-cache=\"some-header\"` OR `no-cache=\"some-header, another-header\"`.\n value = trimOWSEnd(value)\n\n let fieldList = ''\n let lastQuotedPart = i\n let foundEndingQuote = false\n const closingQuote = findUnescapedQuote(value, 1)\n\n if (closingQuote !== -1) {\n fieldList = value.substring(1, closingQuote)\n foundEndingQuote = true\n } else {\n // Something like `no-cache=\"some-header, another-header\"`\n // This can still be something invalid, e.g. `no-cache=\"some-header, ...`\n const fieldListParts = [value.substring(1)]\n\n for (let j = i + 1; j < directives.length; j++) {\n const nextPart = trimOWS(directives[j].value)\n const closingQuote = findUnescapedQuote(nextPart, 0)\n\n lastQuotedPart = j\n\n if (closingQuote !== -1) {\n fieldListParts.push(nextPart.substring(0, closingQuote))\n foundEndingQuote = true\n break\n }\n\n fieldListParts.push(nextPart)\n }\n\n fieldList = fieldListParts.join(',')\n }\n\n if (!foundEndingQuote) {\n output[key] = true\n break\n }\n\n i = lastQuotedPart\n\n const headers = fieldList.split(',')\n let validFieldNames = true\n for (let j = 0; j < headers.length; j++) {\n headers[j] = trimOWS(headers[j])\n if (!isValidHTTPToken(headers[j])) {\n validFieldNames = false\n }\n }\n\n if (!validFieldNames) {\n output[key] = true\n } else if (output[key] !== true) {\n if (key in output) {\n output[key] = output[key].concat(headers)\n } else {\n output[key] = headers\n }\n }\n } else {\n // Something like `no-cache=some-header`\n const fieldName = trimOWS(value)\n\n if (!isValidHTTPToken(fieldName)) {\n output[key] = true\n } else if (output[key] !== true) {\n if (key in output) {\n output[key] = output[key].concat(fieldName)\n } else {\n output[key] = [fieldName]\n }\n }\n }\n\n break\n }\n }\n // eslint-disable-next-line no-fallthrough\n case 'public':\n case 'must-revalidate':\n case 'proxy-revalidate':\n case 'immutable':\n case 'no-transform':\n case 'must-understand':\n case 'only-if-cached':\n if (fromMalformedQuote || invalidNoArgumentDirectives.has(key)) {\n continue\n }\n\n if (value !== undefined) {\n // These are qualified (something like `public=...`) when they aren't\n // allowed to be, skip all instances of the malformed directive.\n delete output[key]\n invalidNoArgumentDirectives.add(key)\n continue\n }\n\n output[key] = true\n break\n case 'no-store':\n output[key] = true\n break\n default:\n // Ignore unknown directives as per https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.3-1\n continue\n }\n }\n\n return output\n}\n\n/**\n * @param {string | string[]} varyHeader Vary header from the server\n * @returns {string[]}\n */\nfunction splitVaryHeader (varyHeader) {\n const values = Array.isArray(varyHeader) ? varyHeader : [varyHeader]\n const output = []\n\n for (let i = 0; i < values.length; i++) {\n const parts = values[i].split(',')\n for (let j = 0; j < parts.length; j++) {\n output.push(parts[j])\n }\n }\n\n return output\n}\n\n/**\n * @param {string | string[]} varyHeader Vary header from the server\n * @returns {boolean}\n */\nfunction hasVaryStar (varyHeader) {\n const values = splitVaryHeader(varyHeader)\n for (let i = 0; i < values.length; i++) {\n if (trimOWS(values[i]).indexOf('*') !== -1) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * @param {string | string[]} varyHeader Vary header from the server\n * @param {Record<string, string | string[]>} headers Request headers\n * @returns {Record<string, string | string[] | null> | undefined}\n */\nfunction parseVaryHeader (varyHeader, headers) {\n if (hasVaryStar(varyHeader)) {\n return headers\n }\n\n const output = /** @type {Record<string, string | string[] | null>} */ ({})\n\n const varyingHeaders = splitVaryHeader(varyHeader)\n\n for (const header of varyingHeaders) {\n const trimmedHeader = trimOWS(header).toLowerCase()\n\n if (trimmedHeader.length === 0) {\n continue\n }\n\n if (!isValidHTTPToken(trimmedHeader)) {\n return undefined\n }\n\n const headerValue = headers[trimmedHeader]\n output[trimmedHeader] = Array.isArray(headerValue) ? headerValue.slice() : headerValue ?? null\n }\n\n return output\n}\n\n/**\n * @param {string | string[]} varyHeader Vary header from the server\n * @returns {boolean}\n */\nfunction isInvalidOrWildcardVaryHeader (varyHeader) {\n return hasVaryStar(varyHeader) || parseVaryHeader(varyHeader, {}) === undefined\n}\n\n/**\n * Note: this deviates from the spec a little. Empty etags (\"\", W/\"\") are valid,\n * however, including them in cached resposnes serves little to no purpose.\n *\n * @see https://www.rfc-editor.org/rfc/rfc9110.html#name-etag\n *\n * @param {string} etag\n * @returns {boolean}\n */\nfunction isEtagUsable (etag) {\n if (etag.length <= 2) {\n // Shortest an etag can be is two chars (just \"\"). This is where we deviate\n // from the spec requiring a min of 3 chars however\n return false\n }\n\n if (etag[0] === '\"' && etag[etag.length - 1] === '\"') {\n // ETag: \"\"asd123\"\" or ETag: \"W/\"asd123\"\", kinda undefined behavior in the\n // spec. Some servers will accept these while others don't.\n // ETag: \"asd123\"\n return !(etag[1] === '\"' || etag.startsWith('\"W/'))\n }\n\n if (etag.startsWith('W/\"') && etag[etag.length - 1] === '\"') {\n // ETag: W/\"\", also where we deviate from the spec & require a min of 3\n // chars\n // ETag: for W/\"\", W/\"asd123\"\n return etag.length !== 4\n }\n\n // Anything else\n return false\n}\n\n/**\n * @param {unknown} store\n * @returns {asserts store is import('../../types/cache-interceptor.d.ts').default.CacheStore}\n */\nfunction assertCacheStore (store, name = 'CacheStore') {\n if (typeof store !== 'object' || store === null) {\n throw new TypeError(`expected type of ${name} to be a CacheStore, got ${store === null ? 'null' : typeof store}`)\n }\n\n for (const fn of ['get', 'createWriteStream', 'delete']) {\n if (typeof store[fn] !== 'function') {\n throw new TypeError(`${name} needs to have a \\`${fn}()\\` function`)\n }\n }\n}\n/**\n * @param {unknown} methods\n * @returns {asserts methods is import('../../types/cache-interceptor.d.ts').default.CacheMethods[]}\n */\nfunction assertCacheMethods (methods, name = 'CacheMethods') {\n if (!Array.isArray(methods)) {\n throw new TypeError(`expected type of ${name} needs to be an array, got ${methods === null ? 'null' : typeof methods}`)\n }\n\n if (methods.length === 0) {\n throw new TypeError(`${name} needs to have at least one method`)\n }\n\n for (const method of methods) {\n if (!arrayIncludes(safeHTTPMethods, method)) {\n throw new TypeError(`element of ${name}-array needs to be one of following values: ${safeHTTPMethods.join(', ')}, got ${method}`)\n }\n }\n}\n\n/**\n * Creates a string key for request deduplication purposes.\n * This key is used to identify in-flight requests that can be shared.\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey\n * @param {Set<string>} [excludeHeaders] Set of lowercase header names to exclude from the key\n * @returns {string}\n */\nfunction makeDeduplicationKey (cacheKey, excludeHeaders) {\n // Use JSON.stringify to produce a collision-resistant key.\n // Previous format used `:` and `=` delimiters without escaping, which\n // allowed different header sets to produce identical keys (e.g.\n // {a:\"x:b=y\"} vs {a:\"x\", b:\"y\"}). See: https://github.com/nodejs/undici/issues/5012\n const headers = {}\n\n if (cacheKey.headers) {\n const sortedHeaders = Object.keys(cacheKey.headers).sort()\n for (const header of sortedHeaders) {\n // Skip excluded headers\n if (excludeHeaders?.has(header.toLowerCase())) {\n continue\n }\n headers[header] = cacheKey.headers[header]\n }\n }\n\n return JSON.stringify([cacheKey.origin, cacheKey.method, cacheKey.path, headers])\n}\n\nmodule.exports = {\n makeCacheKey,\n normalizeHeaders,\n assertCacheKey,\n assertCacheValue,\n parseCacheControlHeader,\n hasInvalidCacheControlDirective,\n parseVaryHeader,\n hasVaryStar,\n isInvalidOrWildcardVaryHeader,\n isEtagUsable,\n assertCacheMethods,\n assertCacheStore,\n makeDeduplicationKey\n}\n","'use strict'\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc9110.html#name-date-time-formats\n *\n * @param {string} date\n * @returns {Date | undefined}\n */\nfunction parseHttpDate (date) {\n // Sun, 06 Nov 1994 08:49:37 GMT ; IMF-fixdate\n // Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format\n // Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format\n\n switch (date[3]) {\n case ',': return parseImfDate(date)\n case ' ': return parseAscTimeDate(date)\n default: return parseRfc850Date(date)\n }\n}\n\nfunction makeDate (year, monthIdx, day, hour, minute, second, weekday) {\n const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second))\n\n // Date.UTC treats years 0-99 as 1900-1999. Reset the full year so component\n // checks below validate the HTTP date as written.\n if (year >= 0 && year <= 99) {\n result.setUTCFullYear(year)\n }\n\n return result.getUTCFullYear() === year &&\n result.getUTCMonth() === monthIdx &&\n result.getUTCDate() === day &&\n result.getUTCHours() === hour &&\n result.getUTCMinutes() === minute &&\n result.getUTCSeconds() === second &&\n result.getUTCDay() === weekday\n ? result\n : undefined\n}\n\n/**\n * @see https://httpwg.org/specs/rfc9110.html#preferred.date.format\n *\n * @param {string} date\n * @returns {Date | undefined}\n */\nfunction parseImfDate (date) {\n if (\n date.length !== 29 ||\n date[4] !== ' ' ||\n date[7] !== ' ' ||\n date[11] !== ' ' ||\n date[16] !== ' ' ||\n date[19] !== ':' ||\n date[22] !== ':' ||\n date[25] !== ' ' ||\n date[26] !== 'G' ||\n date[27] !== 'M' ||\n date[28] !== 'T'\n ) {\n return undefined\n }\n\n let weekday = -1\n if (date[0] === 'S' && date[1] === 'u' && date[2] === 'n') { // Sunday\n weekday = 0\n } else if (date[0] === 'M' && date[1] === 'o' && date[2] === 'n') { // Monday\n weekday = 1\n } else if (date[0] === 'T' && date[1] === 'u' && date[2] === 'e') { // Tuesday\n weekday = 2\n } else if (date[0] === 'W' && date[1] === 'e' && date[2] === 'd') { // Wednesday\n weekday = 3\n } else if (date[0] === 'T' && date[1] === 'h' && date[2] === 'u') { // Thursday\n weekday = 4\n } else if (date[0] === 'F' && date[1] === 'r' && date[2] === 'i') { // Friday\n weekday = 5\n } else if (date[0] === 'S' && date[1] === 'a' && date[2] === 't') { // Saturday\n weekday = 6\n } else {\n return undefined // Not a valid day of the week\n }\n\n let day = 0\n if (date[5] === '0') {\n // Single digit day, e.g. \"Sun Nov 6 08:49:37 1994\"\n const code = date.charCodeAt(6)\n if (code < 49 || code > 57) {\n return undefined // Not a digit\n }\n day = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(5)\n if (code1 < 49 || code1 > 51) {\n return undefined // Not a digit between 1 and 3\n }\n const code2 = date.charCodeAt(6)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n day = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let monthIdx = -1\n if (\n (date[8] === 'J' && date[9] === 'a' && date[10] === 'n')\n ) {\n monthIdx = 0 // Jan\n } else if (\n (date[8] === 'F' && date[9] === 'e' && date[10] === 'b')\n ) {\n monthIdx = 1 // Feb\n } else if (\n (date[8] === 'M' && date[9] === 'a')\n ) {\n if (date[10] === 'r') {\n monthIdx = 2 // Mar\n } else if (date[10] === 'y') {\n monthIdx = 4 // May\n } else {\n return undefined // Invalid month\n }\n } else if (\n (date[8] === 'J')\n ) {\n if (date[9] === 'a' && date[10] === 'n') {\n monthIdx = 0 // Jan\n } else if (date[9] === 'u') {\n if (date[10] === 'n') {\n monthIdx = 5 // Jun\n } else if (date[10] === 'l') {\n monthIdx = 6 // Jul\n } else {\n return undefined // Invalid month\n }\n } else {\n return undefined // Invalid month\n }\n } else if (\n (date[8] === 'A')\n ) {\n if (date[9] === 'p' && date[10] === 'r') {\n monthIdx = 3 // Apr\n } else if (date[9] === 'u' && date[10] === 'g') {\n monthIdx = 7 // Aug\n } else {\n return undefined // Invalid month\n }\n } else if (\n (date[8] === 'S' && date[9] === 'e' && date[10] === 'p')\n ) {\n monthIdx = 8 // Sep\n } else if (\n (date[8] === 'O' && date[9] === 'c' && date[10] === 't')\n ) {\n monthIdx = 9 // Oct\n } else if (\n (date[8] === 'N' && date[9] === 'o' && date[10] === 'v')\n ) {\n monthIdx = 10 // Nov\n } else if (\n (date[8] === 'D' && date[9] === 'e' && date[10] === 'c')\n ) {\n monthIdx = 11 // Dec\n } else {\n // Not a valid month\n return undefined\n }\n\n const yearDigit1 = date.charCodeAt(12)\n if (yearDigit1 < 48 || yearDigit1 > 57) {\n return undefined // Not a digit\n }\n const yearDigit2 = date.charCodeAt(13)\n if (yearDigit2 < 48 || yearDigit2 > 57) {\n return undefined // Not a digit\n }\n const yearDigit3 = date.charCodeAt(14)\n if (yearDigit3 < 48 || yearDigit3 > 57) {\n return undefined // Not a digit\n }\n const yearDigit4 = date.charCodeAt(15)\n if (yearDigit4 < 48 || yearDigit4 > 57) {\n return undefined // Not a digit\n }\n const year = (yearDigit1 - 48) * 1000 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48)\n\n let hour = 0\n if (date[17] === '0') {\n const code = date.charCodeAt(18)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n hour = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(17)\n if (code1 < 48 || code1 > 50) {\n return undefined // Not a digit between 0 and 2\n }\n const code2 = date.charCodeAt(18)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n if (code1 === 50 && code2 > 51) {\n return undefined // Hour cannot be greater than 23\n }\n hour = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let minute = 0\n if (date[20] === '0') {\n const code = date.charCodeAt(21)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n minute = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(20)\n if (code1 < 48 || code1 > 53) {\n return undefined // Not a digit between 0 and 5\n }\n const code2 = date.charCodeAt(21)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n minute = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let second = 0\n if (date[23] === '0') {\n const code = date.charCodeAt(24)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n second = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(23)\n if (code1 < 48 || code1 > 53) {\n return undefined // Not a digit between 0 and 5\n }\n const code2 = date.charCodeAt(24)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n second = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n return makeDate(year, monthIdx, day, hour, minute, second, weekday)\n}\n\n/**\n * @see https://httpwg.org/specs/rfc9110.html#obsolete.date.formats\n *\n * @param {string} date\n * @returns {Date | undefined}\n */\nfunction parseAscTimeDate (date) {\n // This is assumed to be in UTC\n\n if (\n date.length !== 24 ||\n date[7] !== ' ' ||\n date[10] !== ' ' ||\n date[19] !== ' '\n ) {\n return undefined\n }\n\n let weekday = -1\n if (date[0] === 'S' && date[1] === 'u' && date[2] === 'n') { // Sunday\n weekday = 0\n } else if (date[0] === 'M' && date[1] === 'o' && date[2] === 'n') { // Monday\n weekday = 1\n } else if (date[0] === 'T' && date[1] === 'u' && date[2] === 'e') { // Tuesday\n weekday = 2\n } else if (date[0] === 'W' && date[1] === 'e' && date[2] === 'd') { // Wednesday\n weekday = 3\n } else if (date[0] === 'T' && date[1] === 'h' && date[2] === 'u') { // Thursday\n weekday = 4\n } else if (date[0] === 'F' && date[1] === 'r' && date[2] === 'i') { // Friday\n weekday = 5\n } else if (date[0] === 'S' && date[1] === 'a' && date[2] === 't') { // Saturday\n weekday = 6\n } else {\n return undefined // Not a valid day of the week\n }\n\n let monthIdx = -1\n if (\n (date[4] === 'J' && date[5] === 'a' && date[6] === 'n')\n ) {\n monthIdx = 0 // Jan\n } else if (\n (date[4] === 'F' && date[5] === 'e' && date[6] === 'b')\n ) {\n monthIdx = 1 // Feb\n } else if (\n (date[4] === 'M' && date[5] === 'a')\n ) {\n if (date[6] === 'r') {\n monthIdx = 2 // Mar\n } else if (date[6] === 'y') {\n monthIdx = 4 // May\n } else {\n return undefined // Invalid month\n }\n } else if (\n (date[4] === 'J')\n ) {\n if (date[5] === 'a' && date[6] === 'n') {\n monthIdx = 0 // Jan\n } else if (date[5] === 'u') {\n if (date[6] === 'n') {\n monthIdx = 5 // Jun\n } else if (date[6] === 'l') {\n monthIdx = 6 // Jul\n } else {\n return undefined // Invalid month\n }\n } else {\n return undefined // Invalid month\n }\n } else if (\n (date[4] === 'A')\n ) {\n if (date[5] === 'p' && date[6] === 'r') {\n monthIdx = 3 // Apr\n } else if (date[5] === 'u' && date[6] === 'g') {\n monthIdx = 7 // Aug\n } else {\n return undefined // Invalid month\n }\n } else if (\n (date[4] === 'S' && date[5] === 'e' && date[6] === 'p')\n ) {\n monthIdx = 8 // Sep\n } else if (\n (date[4] === 'O' && date[5] === 'c' && date[6] === 't')\n ) {\n monthIdx = 9 // Oct\n } else if (\n (date[4] === 'N' && date[5] === 'o' && date[6] === 'v')\n ) {\n monthIdx = 10 // Nov\n } else if (\n (date[4] === 'D' && date[5] === 'e' && date[6] === 'c')\n ) {\n monthIdx = 11 // Dec\n } else {\n // Not a valid month\n return undefined\n }\n\n let day = 0\n if (date[8] === ' ') {\n // Single digit day, e.g. \"Sun Nov 6 08:49:37 1994\"\n const code = date.charCodeAt(9)\n if (code < 49 || code > 57) {\n return undefined // Not a digit\n }\n day = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(8)\n if (code1 < 49 || code1 > 51) {\n return undefined // Not a digit between 1 and 3\n }\n const code2 = date.charCodeAt(9)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n day = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let hour = 0\n if (date[11] === '0') {\n const code = date.charCodeAt(12)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n hour = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(11)\n if (code1 < 48 || code1 > 50) {\n return undefined // Not a digit between 0 and 2\n }\n const code2 = date.charCodeAt(12)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n if (code1 === 50 && code2 > 51) {\n return undefined // Hour cannot be greater than 23\n }\n hour = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let minute = 0\n if (date[14] === '0') {\n const code = date.charCodeAt(15)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n minute = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(14)\n if (code1 < 48 || code1 > 53) {\n return undefined // Not a digit between 0 and 5\n }\n const code2 = date.charCodeAt(15)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n minute = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let second = 0\n if (date[17] === '0') {\n const code = date.charCodeAt(18)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n second = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(17)\n if (code1 < 48 || code1 > 53) {\n return undefined // Not a digit between 0 and 5\n }\n const code2 = date.charCodeAt(18)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n second = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n const yearDigit1 = date.charCodeAt(20)\n if (yearDigit1 < 48 || yearDigit1 > 57) {\n return undefined // Not a digit\n }\n const yearDigit2 = date.charCodeAt(21)\n if (yearDigit2 < 48 || yearDigit2 > 57) {\n return undefined // Not a digit\n }\n const yearDigit3 = date.charCodeAt(22)\n if (yearDigit3 < 48 || yearDigit3 > 57) {\n return undefined // Not a digit\n }\n const yearDigit4 = date.charCodeAt(23)\n if (yearDigit4 < 48 || yearDigit4 > 57) {\n return undefined // Not a digit\n }\n const year = (yearDigit1 - 48) * 1000 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48)\n\n return makeDate(year, monthIdx, day, hour, minute, second, weekday)\n}\n\n/**\n * @see https://httpwg.org/specs/rfc9110.html#obsolete.date.formats\n *\n * @param {string} date\n * @returns {Date | undefined}\n */\nfunction parseRfc850Date (date) {\n let commaIndex = -1\n\n let weekday = -1\n if (date[0] === 'S') {\n if (date[1] === 'u' && date[2] === 'n' && date[3] === 'd' && date[4] === 'a' && date[5] === 'y') {\n weekday = 0 // Sunday\n commaIndex = 6\n } else if (date[1] === 'a' && date[2] === 't' && date[3] === 'u' && date[4] === 'r' && date[5] === 'd' && date[6] === 'a' && date[7] === 'y') {\n weekday = 6 // Saturday\n commaIndex = 8\n }\n } else if (date[0] === 'M' && date[1] === 'o' && date[2] === 'n' && date[3] === 'd' && date[4] === 'a' && date[5] === 'y') {\n weekday = 1 // Monday\n commaIndex = 6\n } else if (date[0] === 'T') {\n if (date[1] === 'u' && date[2] === 'e' && date[3] === 's' && date[4] === 'd' && date[5] === 'a' && date[6] === 'y') {\n weekday = 2 // Tuesday\n commaIndex = 7\n } else if (date[1] === 'h' && date[2] === 'u' && date[3] === 'r' && date[4] === 's' && date[5] === 'd' && date[6] === 'a' && date[7] === 'y') {\n weekday = 4 // Thursday\n commaIndex = 8\n }\n } else if (date[0] === 'W' && date[1] === 'e' && date[2] === 'd' && date[3] === 'n' && date[4] === 'e' && date[5] === 's' && date[6] === 'd' && date[7] === 'a' && date[8] === 'y') {\n weekday = 3 // Wednesday\n commaIndex = 9\n } else if (date[0] === 'F' && date[1] === 'r' && date[2] === 'i' && date[3] === 'd' && date[4] === 'a' && date[5] === 'y') {\n weekday = 5 // Friday\n commaIndex = 6\n } else {\n // Not a valid day name\n return undefined\n }\n\n if (\n date[commaIndex] !== ',' ||\n (date.length - commaIndex - 1) !== 23 ||\n date[commaIndex + 1] !== ' ' ||\n date[commaIndex + 4] !== '-' ||\n date[commaIndex + 8] !== '-' ||\n date[commaIndex + 11] !== ' ' ||\n date[commaIndex + 14] !== ':' ||\n date[commaIndex + 17] !== ':' ||\n date[commaIndex + 20] !== ' ' ||\n date[commaIndex + 21] !== 'G' ||\n date[commaIndex + 22] !== 'M' ||\n date[commaIndex + 23] !== 'T'\n ) {\n return undefined\n }\n\n let day = 0\n if (date[commaIndex + 2] === '0') {\n // Single digit day, e.g. \"Sun Nov 6 08:49:37 1994\"\n const code = date.charCodeAt(commaIndex + 3)\n if (code < 49 || code > 57) {\n return undefined // Not a digit\n }\n day = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(commaIndex + 2)\n if (code1 < 49 || code1 > 51) {\n return undefined // Not a digit between 1 and 3\n }\n const code2 = date.charCodeAt(commaIndex + 3)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n day = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let monthIdx = -1\n if (\n (date[commaIndex + 5] === 'J' && date[commaIndex + 6] === 'a' && date[commaIndex + 7] === 'n')\n ) {\n monthIdx = 0 // Jan\n } else if (\n (date[commaIndex + 5] === 'F' && date[commaIndex + 6] === 'e' && date[commaIndex + 7] === 'b')\n ) {\n monthIdx = 1 // Feb\n } else if (\n (date[commaIndex + 5] === 'M' && date[commaIndex + 6] === 'a' && date[commaIndex + 7] === 'r')\n ) {\n monthIdx = 2 // Mar\n } else if (\n (date[commaIndex + 5] === 'A' && date[commaIndex + 6] === 'p' && date[commaIndex + 7] === 'r')\n ) {\n monthIdx = 3 // Apr\n } else if (\n (date[commaIndex + 5] === 'M' && date[commaIndex + 6] === 'a' && date[commaIndex + 7] === 'y')\n ) {\n monthIdx = 4 // May\n } else if (\n (date[commaIndex + 5] === 'J' && date[commaIndex + 6] === 'u' && date[commaIndex + 7] === 'n')\n ) {\n monthIdx = 5 // Jun\n } else if (\n (date[commaIndex + 5] === 'J' && date[commaIndex + 6] === 'u' && date[commaIndex + 7] === 'l')\n ) {\n monthIdx = 6 // Jul\n } else if (\n (date[commaIndex + 5] === 'A' && date[commaIndex + 6] === 'u' && date[commaIndex + 7] === 'g')\n ) {\n monthIdx = 7 // Aug\n } else if (\n (date[commaIndex + 5] === 'S' && date[commaIndex + 6] === 'e' && date[commaIndex + 7] === 'p')\n ) {\n monthIdx = 8 // Sep\n } else if (\n (date[commaIndex + 5] === 'O' && date[commaIndex + 6] === 'c' && date[commaIndex + 7] === 't')\n ) {\n monthIdx = 9 // Oct\n } else if (\n (date[commaIndex + 5] === 'N' && date[commaIndex + 6] === 'o' && date[commaIndex + 7] === 'v')\n ) {\n monthIdx = 10 // Nov\n } else if (\n (date[commaIndex + 5] === 'D' && date[commaIndex + 6] === 'e' && date[commaIndex + 7] === 'c')\n ) {\n monthIdx = 11 // Dec\n } else {\n // Not a valid month\n return undefined\n }\n\n const yearDigit1 = date.charCodeAt(commaIndex + 9)\n if (yearDigit1 < 48 || yearDigit1 > 57) {\n return undefined // Not a digit\n }\n const yearDigit2 = date.charCodeAt(commaIndex + 10)\n if (yearDigit2 < 48 || yearDigit2 > 57) {\n return undefined // Not a digit\n }\n\n let year = (yearDigit1 - 48) * 10 + (yearDigit2 - 48) // Convert ASCII codes to number\n\n // RFC 6265 states that the year is in the range 1970-2069.\n // @see https://datatracker.ietf.org/doc/html/rfc6265#section-5.1.1\n //\n // 3. If the year-value is greater than or equal to 70 and less than or\n // equal to 99, increment the year-value by 1900.\n // 4. If the year-value is greater than or equal to 0 and less than or\n // equal to 69, increment the year-value by 2000.\n year += year < 70 ? 2000 : 1900\n\n let hour = 0\n if (date[commaIndex + 12] === '0') {\n const code = date.charCodeAt(commaIndex + 13)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n hour = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(commaIndex + 12)\n if (code1 < 48 || code1 > 50) {\n return undefined // Not a digit between 0 and 2\n }\n const code2 = date.charCodeAt(commaIndex + 13)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n if (code1 === 50 && code2 > 51) {\n return undefined // Hour cannot be greater than 23\n }\n hour = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let minute = 0\n if (date[commaIndex + 15] === '0') {\n const code = date.charCodeAt(commaIndex + 16)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n minute = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(commaIndex + 15)\n if (code1 < 48 || code1 > 53) {\n return undefined // Not a digit between 0 and 5\n }\n const code2 = date.charCodeAt(commaIndex + 16)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n minute = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n let second = 0\n if (date[commaIndex + 18] === '0') {\n const code = date.charCodeAt(commaIndex + 19)\n if (code < 48 || code > 57) {\n return undefined // Not a digit\n }\n second = code - 48 // Convert ASCII code to number\n } else {\n const code1 = date.charCodeAt(commaIndex + 18)\n if (code1 < 48 || code1 > 53) {\n return undefined // Not a digit between 0 and 5\n }\n const code2 = date.charCodeAt(commaIndex + 19)\n if (code2 < 48 || code2 > 57) {\n return undefined // Not a digit\n }\n second = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number\n }\n\n return makeDate(year, monthIdx, day, hour, minute, second, weekday)\n}\n\nmodule.exports = {\n parseHttpDate\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst {\n parseCacheControlHeader,\n hasInvalidCacheControlDirective,\n parseVaryHeader,\n hasVaryStar,\n isInvalidOrWildcardVaryHeader,\n isEtagUsable\n} = require('../util/cache')\nconst { parseHttpDate } = require('../util/date.js')\n\nfunction noop () {}\n\n// Status codes that we can use some heuristics on to cache\nconst HEURISTICALLY_CACHEABLE_STATUS_CODES = [\n 200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414, 501\n]\n\n// Status codes which semantic is not handled by the cache\n// https://datatracker.ietf.org/doc/html/rfc9111#section-3\n// This list should not grow beyond 206 unless the RFC is updated\n// by a newer one including more. Please introduce another list if\n// implementing caching of responses with the 'must-understand' directive.\nconst NOT_UNDERSTOOD_STATUS_CODES = [\n 206\n]\n\nconst MAX_RESPONSE_AGE = 2147483647000\n\nfunction trimOWS (value) {\n return value.replace(/^[\\t ]+|[\\t ]+$/g, '')\n}\n\nfunction arrayIncludes (array, value) {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true\n }\n }\n\n return false\n}\n\nfunction appendConnectionHeaderTokens (headersToRemove, connectionHeader) {\n const values = Array.isArray(connectionHeader) ? connectionHeader : [connectionHeader]\n\n for (let i = 0; i < values.length; i++) {\n const tokens = values[i].split(',')\n for (let j = 0; j < tokens.length; j++) {\n headersToRemove.push(trimOWS(tokens[j]).toLowerCase())\n }\n }\n}\n\nfunction getSameOriginPath (cacheKey, location) {\n if (typeof location !== 'string') {\n return undefined\n }\n\n let originUrl\n let requestUrl\n let locationUrl\n try {\n originUrl = new URL(cacheKey.origin)\n requestUrl = new URL(cacheKey.path, originUrl)\n locationUrl = new URL(location, requestUrl)\n } catch {\n return undefined\n }\n\n if (locationUrl.origin !== originUrl.origin) {\n return undefined\n }\n\n return locationUrl.pathname + locationUrl.search\n}\n\nfunction deleteCachedUri (store, cacheKey, path) {\n deleteCachedValue(store, {\n ...cacheKey,\n path\n })\n\n for (let i = 0; i < util.safeHTTPMethods.length; i++) {\n const method = util.safeHTTPMethods[i]\n if (method !== cacheKey.method) {\n deleteCachedValue(store, {\n ...cacheKey,\n method,\n path\n })\n }\n }\n}\n\nfunction deleteLocationTargets (store, cacheKey, headerValue) {\n if (headerValue === undefined) {\n return\n }\n\n const values = Array.isArray(headerValue) ? headerValue : [headerValue]\n for (let i = 0; i < values.length; i++) {\n const path = getSameOriginPath(cacheKey, values[i])\n if (path !== undefined) {\n deleteCachedUri(store, cacheKey, path)\n }\n }\n}\n\nfunction invalidateUnsafeRequest (store, cacheKey, resHeaders) {\n deleteCachedUri(store, cacheKey, cacheKey.path)\n deleteLocationTargets(store, cacheKey, resHeaders.location)\n deleteLocationTargets(store, cacheKey, resHeaders['content-location'])\n}\n\n/**\n * @typedef {import('../../types/dispatcher.d.ts').default.DispatchHandler} DispatchHandler\n *\n * @implements {DispatchHandler}\n */\nclass CacheHandler {\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheKey}\n */\n #cacheKey\n\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions['type']}\n */\n #cacheType\n\n /**\n * @type {number | undefined}\n */\n #cacheByDefault\n\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheStore}\n */\n #store\n\n /**\n * @type {import('../../types/dispatcher.d.ts').default.DispatchHandler}\n */\n #handler\n\n /**\n * @type {import('node:stream').Writable | undefined}\n */\n #writeStream\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} opts\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey\n * @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler\n */\n constructor ({ store, type, cacheByDefault }, cacheKey, handler) {\n this.#store = store\n this.#cacheType = type\n this.#cacheByDefault = cacheByDefault\n this.#cacheKey = cacheKey\n this.#handler = handler\n }\n\n onRequestStart (controller, context) {\n this.#writeStream?.destroy()\n this.#writeStream = undefined\n this.#handler.onRequestStart?.(controller, context)\n }\n\n onRequestUpgrade (controller, statusCode, headers, socket) {\n this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket)\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {number} statusCode\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders\n * @param {string} statusMessage\n */\n onResponseStart (\n controller,\n statusCode,\n resHeaders,\n statusMessage\n ) {\n const downstreamOnHeaders = () =>\n this.#handler.onResponseStart?.(\n controller,\n statusCode,\n resHeaders,\n statusMessage\n )\n const handler = this\n\n if (\n !arrayIncludes(util.safeHTTPMethods, this.#cacheKey.method) &&\n statusCode >= 200 &&\n statusCode <= 399\n ) {\n // Successful response to an unsafe method, delete it from cache\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-response\n invalidateUnsafeRequest(this.#store, this.#cacheKey, resHeaders)\n return downstreamOnHeaders()\n }\n\n const cacheControlHeader = resHeaders['cache-control']\n const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {}\n\n if (revalidationResponseDisallowsCachedReuse(this.#cacheType, resHeaders, cacheControlDirectives)) {\n deleteCachedValue(this.#store, this.#cacheKey)\n return downstreamOnHeaders()\n }\n\n const heuristicallyCacheable = resHeaders['last-modified'] && arrayIncludes(HEURISTICALLY_CACHEABLE_STATUS_CODES, statusCode)\n if (\n !cacheControlHeader &&\n !resHeaders['expires'] &&\n !heuristicallyCacheable &&\n !this.#cacheByDefault\n ) {\n if (statusCode === 304 && resHeaders.vary && isInvalidOrWildcardVaryHeader(resHeaders.vary)) {\n deleteCachedValue(this.#store, this.#cacheKey)\n }\n\n // Don't have anything to tell us this response is cachable and we're not\n // caching by default\n return downstreamOnHeaders()\n }\n\n if (!canCacheResponse(this.#cacheType, this.#cacheKey.method, statusCode, resHeaders, cacheControlDirectives, this.#cacheKey.headers)) {\n if (statusCode === 304 && (cacheControlHeader || revalidationResponseDisallowsCachedReuse(this.#cacheType, resHeaders, cacheControlDirectives))) {\n deleteCachedValue(this.#store, this.#cacheKey)\n }\n\n return downstreamOnHeaders()\n }\n\n const now = Date.now()\n const resAge = Object.hasOwn(resHeaders, 'age') ? getAge(resHeaders.age) : undefined\n if (resAge !== undefined && resAge >= MAX_RESPONSE_AGE) {\n // Response considered stale\n deleteCachedValueIfNotModified(statusCode, this.#store, this.#cacheKey)\n return downstreamOnHeaders()\n }\n\n const resDate = Object.hasOwn(resHeaders, 'date') ? getDate(resHeaders.date) : undefined\n if (resDate === null) {\n deleteCachedValueIfNotModified(statusCode, this.#store, this.#cacheKey)\n return downstreamOnHeaders()\n }\n\n const apparentAge = resDate ? Math.max(0, now - resDate.getTime()) : 0\n const currentAge = Math.max(apparentAge, resAge ?? 0)\n\n const staleAt =\n determineStaleAt(this.#cacheType, now, resAge, resHeaders, resDate, cacheControlDirectives) ??\n this.#cacheByDefault\n if (staleAt === undefined || currentAge >= staleAt) {\n if (cacheControlHeader || staleAt !== undefined) {\n deleteCachedValueIfNotModified(statusCode, this.#store, this.#cacheKey)\n }\n\n return downstreamOnHeaders()\n }\n\n const baseTime = now - currentAge\n const absoluteStaleAt = staleAt + baseTime\n if (now >= absoluteStaleAt) {\n // Response is already stale\n deleteCachedValueIfNotModified(statusCode, this.#store, this.#cacheKey)\n return downstreamOnHeaders()\n }\n\n let varyDirectives\n if (this.#cacheKey.headers && resHeaders.vary) {\n varyDirectives = parseVaryHeader(resHeaders.vary, this.#cacheKey.headers)\n if (!varyDirectives) {\n // Parse error\n return downstreamOnHeaders()\n }\n }\n\n const cachedAt = baseTime\n const deleteAt = determineDeleteAt(baseTime, now, cacheControlDirectives, absoluteStaleAt)\n const strippedHeaders = stripNecessaryHeaders(resHeaders, cacheControlDirectives)\n\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheValue}\n */\n const value = {\n statusCode,\n statusMessage,\n headers: strippedHeaders,\n vary: varyDirectives,\n cacheControlDirectives,\n cachedAt,\n staleAt: absoluteStaleAt,\n deleteAt\n }\n\n // Not modified, re-use the cached value\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-handling-304-not-modified\n if (statusCode === 304) {\n const handle304 = (cachedValue) => {\n if (!cachedValue) {\n // Do not create a new cache entry, as a 304 won't have a body - so cannot be cached.\n return downstreamOnHeaders()\n }\n\n // Re-use the cached value: statuscode, statusmessage, headers and body\n value.statusCode = cachedValue.statusCode\n value.statusMessage = cachedValue.statusMessage\n value.etag = cachedValue.etag\n value.vary = varyDirectives ?? cachedValue.vary\n value.headers = { ...cachedValue.headers, ...strippedHeaders }\n\n downstreamOnHeaders()\n\n this.#writeStream = this.#store.createWriteStream(this.#cacheKey, value)\n\n if (!this.#writeStream || !cachedValue?.body) {\n return\n }\n\n if (typeof cachedValue.body.values === 'function') {\n const bodyIterator = cachedValue.body.values()\n\n const streamCachedBody = () => {\n for (const chunk of bodyIterator) {\n const full = this.#writeStream.write(chunk) === false\n this.#handler.onResponseData?.(controller, chunk)\n // when stream is full stop writing until we get a 'drain' event\n if (full) {\n break\n }\n }\n }\n\n this.#writeStream\n .on('error', function () {\n handler.#writeStream = undefined\n handler.#store.delete(handler.#cacheKey)\n })\n .on('drain', () => {\n streamCachedBody()\n })\n .on('close', function () {\n if (handler.#writeStream === this) {\n handler.#writeStream = undefined\n }\n })\n\n streamCachedBody()\n } else if (typeof cachedValue.body.on === 'function') {\n // Readable stream body (e.g. from async/remote cache stores)\n cachedValue.body\n .on('data', (chunk) => {\n this.#writeStream.write(chunk)\n this.#handler.onResponseData?.(controller, chunk)\n })\n .on('end', () => {\n this.#writeStream.end()\n })\n .on('error', () => {\n this.#writeStream = undefined\n this.#store.delete(this.#cacheKey)\n })\n\n this.#writeStream\n .on('error', function () {\n handler.#writeStream = undefined\n handler.#store.delete(handler.#cacheKey)\n })\n .on('close', function () {\n if (handler.#writeStream === this) {\n handler.#writeStream = undefined\n }\n })\n }\n }\n\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheValue}\n */\n const result = this.#store.get(this.#cacheKey)\n if (result && typeof result.then === 'function') {\n result.then(handle304)\n } else {\n handle304(result)\n }\n } else {\n if (typeof resHeaders.etag === 'string' && isEtagUsable(resHeaders.etag)) {\n value.etag = resHeaders.etag\n }\n\n this.#writeStream = this.#store.createWriteStream(this.#cacheKey, value)\n\n if (!this.#writeStream) {\n return downstreamOnHeaders()\n }\n\n this.#writeStream\n .on('drain', () => controller.resume())\n .on('error', function () {\n // TODO (fix): Make error somehow observable?\n handler.#writeStream = undefined\n\n // Delete the value in case the cache store is holding onto state from\n // the call to createWriteStream\n handler.#store.delete(handler.#cacheKey)\n })\n .on('close', function () {\n if (handler.#writeStream === this) {\n handler.#writeStream = undefined\n }\n\n // TODO (fix): Should we resume even if was paused downstream?\n controller.resume()\n })\n\n downstreamOnHeaders()\n }\n }\n\n onResponseData (controller, chunk) {\n if (this.#writeStream?.write(chunk) === false) {\n controller.pause()\n }\n\n this.#handler.onResponseData?.(controller, chunk)\n }\n\n onResponseEnd (controller, trailers) {\n this.#writeStream?.end()\n this.#handler.onResponseEnd?.(controller, trailers)\n }\n\n onResponseError (controller, err) {\n this.#writeStream?.destroy(err)\n this.#writeStream = undefined\n this.#handler.onResponseError?.(controller, err)\n }\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheStore} store\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey\n */\nfunction deleteCachedValue (store, cacheKey) {\n try {\n store.delete(cacheKey)?.catch?.(noop)\n } catch {\n // Fail silently\n }\n}\n\nfunction deleteCachedValueIfNotModified (statusCode, store, cacheKey) {\n if (statusCode === 304) {\n deleteCachedValue(store, cacheKey)\n }\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives} cacheControlDirectives\n * @returns {boolean}\n */\nfunction revalidationResponseDisallowsCachedReuse (cacheType, resHeaders, cacheControlDirectives) {\n return cacheControlDirectives['no-store'] === true ||\n (cacheType === 'shared' && (\n cacheControlDirectives.private === true ||\n Object.hasOwn(resHeaders, 'set-cookie')\n )) ||\n (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false)\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-storing-responses-to-authen\n *\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @param {string} method\n * @param {number} statusCode\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives} cacheControlDirectives\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} [reqHeaders]\n */\nfunction canCacheResponse (cacheType, method, statusCode, resHeaders, cacheControlDirectives, reqHeaders) {\n if (!arrayIncludes(util.safeHTTPMethods, method)) {\n return false\n }\n // Status code must be final and understood.\n if (statusCode < 200 || arrayIncludes(NOT_UNDERSTOOD_STATUS_CODES, statusCode)) {\n return false\n }\n // Responses with neither status codes that are heuristically cacheable, nor \"explicit enough\" caching\n // directives, are not cacheable. \"Explicit enough\": see https://www.rfc-editor.org/rfc/rfc9111.html#section-3\n if (!arrayIncludes(HEURISTICALLY_CACHEABLE_STATUS_CODES, statusCode) && !resHeaders['expires'] &&\n !cacheControlDirectives.public &&\n cacheControlDirectives['max-age'] === undefined &&\n // RFC 9111: a private response directive, if the cache is not shared\n !(cacheControlDirectives.private && cacheType === 'private') &&\n !(cacheControlDirectives['s-maxage'] !== undefined && cacheType === 'shared')\n ) {\n return false\n }\n\n if (cacheControlDirectives['no-store']) {\n return false\n }\n\n if (cacheType === 'shared' && (\n cacheControlDirectives.private === true ||\n Object.hasOwn(resHeaders, 'set-cookie')\n )) {\n return false\n }\n\n // https://www.rfc-editor.org/rfc/rfc9111.html#section-4.1-5\n if (resHeaders.vary && hasVaryStar(resHeaders.vary)) {\n return false\n }\n\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-storing-responses-to-authen\n if (reqHeaders != null && Object.hasOwn(reqHeaders, 'authorization')) {\n if (\n !cacheControlDirectives.public &&\n !cacheControlDirectives['s-maxage'] &&\n !cacheControlDirectives['must-revalidate']\n ) {\n return false\n }\n\n if (typeof reqHeaders.authorization !== 'string') {\n return false\n }\n\n if (\n Array.isArray(cacheControlDirectives['no-cache']) &&\n arrayIncludes(cacheControlDirectives['no-cache'], 'authorization')\n ) {\n return false\n }\n\n if (\n Array.isArray(cacheControlDirectives['private']) &&\n arrayIncludes(cacheControlDirectives['private'], 'authorization')\n ) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @param {string | string[]} dateHeader\n * @returns {Date | null | undefined}\n */\nfunction getDate (dateHeader) {\n let dateValue = dateHeader\n if (Array.isArray(dateValue)) {\n if (dateValue.length !== 1) {\n return null\n }\n\n dateValue = dateValue[0]\n }\n\n if (typeof dateValue !== 'string') {\n return null\n }\n\n return parseHttpDate(dateValue)\n}\n\n/**\n * @param {string | string[]} ageHeader\n * @returns {number | undefined}\n */\nfunction getAge (ageHeader) {\n let ageValue = ageHeader\n if (Array.isArray(ageValue)) {\n if (ageValue.length !== 1) {\n return MAX_RESPONSE_AGE\n }\n\n ageValue = ageValue[0]\n }\n\n if (typeof ageValue !== 'string' || !/^[\\t ]*[0-9]+[\\t ]*$/.test(ageValue)) {\n return MAX_RESPONSE_AGE\n }\n\n const age = BigInt(ageValue.replace(/^[\\t ]+|[\\t ]+$/g, ''))\n if (age >= BigInt(MAX_RESPONSE_AGE / 1000)) {\n return MAX_RESPONSE_AGE\n }\n\n return Number(age) * 1000\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @param {number} now\n * @param {number | undefined} age\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders\n * @param {Date | undefined} responseDate\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives} cacheControlDirectives\n *\n * @returns {number | undefined} time that the value is stale at in seconds or undefined if it shouldn't be cached\n */\nfunction determineStaleAt (cacheType, now, age, resHeaders, responseDate, cacheControlDirectives) {\n if (cacheType === 'shared') {\n // Prioritize s-maxage since we're a shared cache\n // s-maxage > max-age > Expire\n // https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.2.10-3\n if (hasInvalidCacheControlDirective(cacheControlDirectives, 's-maxage')) {\n return 0\n }\n\n const sMaxAge = cacheControlDirectives['s-maxage']\n if (sMaxAge !== undefined) {\n return sMaxAge * 1000\n }\n }\n\n if (hasInvalidCacheControlDirective(cacheControlDirectives, 'max-age')) {\n return 0\n }\n\n const maxAge = cacheControlDirectives['max-age']\n if (maxAge !== undefined) {\n return maxAge * 1000\n }\n\n if (Object.hasOwn(resHeaders, 'expires')) {\n // https://www.rfc-editor.org/rfc/rfc9111.html#section-5.3\n if (typeof resHeaders.expires !== 'string') {\n return 0\n }\n\n const expiresDate = parseHttpDate(resHeaders.expires)\n if (!expiresDate) {\n return 0\n }\n\n if (now >= expiresDate.getTime()) {\n return 0\n }\n\n if (responseDate) {\n if (responseDate >= expiresDate) {\n return 0\n }\n\n const freshnessLifetime = expiresDate.getTime() - responseDate.getTime()\n if (age !== undefined && age >= freshnessLifetime) {\n return 0\n }\n\n return freshnessLifetime\n }\n\n return expiresDate.getTime() - now\n }\n\n if (typeof resHeaders['last-modified'] === 'string') {\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-calculating-heuristic-fresh\n const lastModified = parseHttpDate(resHeaders['last-modified'])\n if (lastModified) {\n if (lastModified.getTime() >= now) {\n return undefined\n }\n\n const responseAge = now - lastModified.getTime()\n\n return responseAge * 0.1\n }\n }\n\n if (cacheControlDirectives.immutable) {\n // https://www.rfc-editor.org/rfc/rfc8246.html#section-2.2\n return 31536000000\n }\n\n return undefined\n}\n\n/**\n * @param {number} baseTime\n * @param {number} cachedAt\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives} cacheControlDirectives\n * @param {number} staleAt\n */\nfunction determineDeleteAt (baseTime, cachedAt, cacheControlDirectives, staleAt) {\n let staleWhileRevalidate = -Infinity\n let staleIfError = -Infinity\n let immutable = -Infinity\n\n if (cacheControlDirectives['stale-while-revalidate']) {\n staleWhileRevalidate = staleAt + (cacheControlDirectives['stale-while-revalidate'] * 1000)\n }\n\n if (cacheControlDirectives['stale-if-error']) {\n staleIfError = staleAt + (cacheControlDirectives['stale-if-error'] * 1000)\n }\n\n if (cacheControlDirectives.immutable && staleWhileRevalidate === -Infinity && staleIfError === -Infinity) {\n immutable = cachedAt + 31536000000\n }\n\n // When no stale directives or immutable flag, add a revalidation buffer\n // equal to the freshness lifetime so the entry survives past staleAt long\n // enough to be revalidated instead of silently disappearing.\n //\n // Response Date headers only have second precision, so baseTime can trail the\n // actual cache insertion time by up to ~1s. Pad the buffer by that bounded\n // skew so short-lived entries do not disappear exactly when they should be\n // revalidated.\n if (staleWhileRevalidate === -Infinity && staleIfError === -Infinity && immutable === -Infinity) {\n const freshnessLifetime = staleAt - baseTime\n const datePrecisionPadding = Math.min(Math.max(cachedAt - baseTime, 0), 1000)\n return staleAt + freshnessLifetime + datePrecisionPadding\n }\n\n return Math.max(staleAt, staleWhileRevalidate, staleIfError, immutable)\n}\n\n/**\n * Strips headers required to be removed in cached responses\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives} cacheControlDirectives\n * @returns {Record<string, string | string []>}\n */\nfunction stripNecessaryHeaders (resHeaders, cacheControlDirectives) {\n const headersToRemove = [\n 'connection',\n 'proxy-authenticate',\n 'proxy-authentication-info',\n 'proxy-authorization',\n 'proxy-connection',\n 'te',\n 'transfer-encoding',\n 'upgrade',\n // We'll add age back when serving it\n 'age'\n ]\n\n if (resHeaders['connection']) {\n appendConnectionHeaderTokens(headersToRemove, resHeaders['connection'])\n }\n\n if (Array.isArray(cacheControlDirectives['no-cache'])) {\n headersToRemove.push(...cacheControlDirectives['no-cache'])\n }\n\n if (Array.isArray(cacheControlDirectives['private'])) {\n headersToRemove.push(...cacheControlDirectives['private'])\n }\n\n let strippedHeaders\n for (const headerName of headersToRemove) {\n if (Object.hasOwn(resHeaders, headerName)) {\n strippedHeaders ??= { ...resHeaders }\n delete strippedHeaders[headerName]\n }\n }\n\n return strippedHeaders ?? resHeaders\n}\n\nmodule.exports = CacheHandler\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst { EventEmitter } = require('node:events')\nconst { assertCacheKey, assertCacheValue } = require('../util/cache.js')\n\n/**\n * @typedef {import('../../types/cache-interceptor.d.ts').default.CacheKey} CacheKey\n * @typedef {import('../../types/cache-interceptor.d.ts').default.CacheValue} CacheValue\n * @typedef {import('../../types/cache-interceptor.d.ts').default.CacheStore} CacheStore\n * @typedef {import('../../types/cache-interceptor.d.ts').default.GetResult} GetResult\n */\n\n/**\n * @implements {CacheStore}\n * @extends {EventEmitter}\n */\nclass MemoryCacheStore extends EventEmitter {\n #maxCount = 1024\n #maxSize = 104857600 // 100MB\n #maxEntrySize = 5242880 // 5MB\n\n #size = 0\n #count = 0\n #entries = new Map()\n #hasEmittedMaxSizeEvent = false\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.MemoryCacheStoreOpts | undefined} [opts]\n */\n constructor (opts) {\n super()\n if (opts) {\n if (typeof opts !== 'object') {\n throw new TypeError('MemoryCacheStore options must be an object')\n }\n\n if (opts.maxCount !== undefined) {\n if (\n typeof opts.maxCount !== 'number' ||\n !Number.isInteger(opts.maxCount) ||\n opts.maxCount < 0\n ) {\n throw new TypeError('MemoryCacheStore options.maxCount must be a non-negative integer')\n }\n this.#maxCount = opts.maxCount\n }\n\n if (opts.maxSize !== undefined) {\n if (\n typeof opts.maxSize !== 'number' ||\n !Number.isInteger(opts.maxSize) ||\n opts.maxSize < 0\n ) {\n throw new TypeError('MemoryCacheStore options.maxSize must be a non-negative integer')\n }\n this.#maxSize = opts.maxSize\n }\n\n if (opts.maxEntrySize !== undefined) {\n if (\n typeof opts.maxEntrySize !== 'number' ||\n !Number.isInteger(opts.maxEntrySize) ||\n opts.maxEntrySize < 0\n ) {\n throw new TypeError('MemoryCacheStore options.maxEntrySize must be a non-negative integer')\n }\n this.#maxEntrySize = opts.maxEntrySize\n }\n }\n }\n\n /**\n * Get the current size of the cache in bytes\n * @returns {number} The current size of the cache in bytes\n */\n get size () {\n return this.#size\n }\n\n /**\n * Check if the cache is full (either max size or max count reached)\n * @returns {boolean} True if the cache is full, false otherwise\n */\n isFull () {\n return this.#size >= this.#maxSize || this.#count >= this.#maxCount\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} req\n * @returns {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined}\n */\n get (key) {\n assertCacheKey(key)\n\n const topLevelKey = `${key.origin}:${key.path}`\n\n const now = Date.now()\n const entries = this.#entries.get(topLevelKey)\n\n const entry = entries ? findEntry(key, entries, now) : null\n\n return entry == null\n ? undefined\n : {\n statusMessage: entry.statusMessage,\n statusCode: entry.statusCode,\n headers: entry.headers,\n body: entry.body,\n vary: entry.vary ? entry.vary : undefined,\n etag: entry.etag,\n cacheControlDirectives: entry.cacheControlDirectives,\n cachedAt: entry.cachedAt,\n staleAt: entry.staleAt,\n deleteAt: entry.deleteAt\n }\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue} val\n * @returns {Writable | undefined}\n */\n createWriteStream (key, val) {\n assertCacheKey(key)\n assertCacheValue(val)\n\n const topLevelKey = `${key.origin}:${key.path}`\n\n const store = this\n const entry = { ...key, ...val, body: [], size: 0 }\n\n return new Writable({\n write (chunk, encoding, callback) {\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding)\n }\n\n entry.size += chunk.byteLength\n\n if (entry.size >= store.#maxEntrySize) {\n this.destroy()\n } else {\n entry.body.push(chunk)\n }\n\n callback(null)\n },\n final (callback) {\n let entries = store.#entries.get(topLevelKey)\n if (!entries) {\n entries = []\n store.#entries.set(topLevelKey, entries)\n }\n const previousEntry = findEntry(key, entries, Date.now())\n if (previousEntry) {\n const index = entries.indexOf(previousEntry)\n entries.splice(index, 1, entry)\n store.#size -= previousEntry.size\n } else {\n entries.push(entry)\n store.#count += 1\n }\n\n store.#size += entry.size\n\n // Check if cache is full and emit event if needed\n if (store.#size > store.#maxSize || store.#count > store.#maxCount) {\n // Emit maxSizeExceeded event if we haven't already\n if (!store.#hasEmittedMaxSizeEvent) {\n store.emit('maxSizeExceeded', {\n size: store.#size,\n maxSize: store.#maxSize,\n count: store.#count,\n maxCount: store.#maxCount\n })\n store.#hasEmittedMaxSizeEvent = true\n }\n\n // Perform eviction\n for (const [key, entries] of store.#entries) {\n for (const entry of entries.splice(0, entries.length / 2)) {\n store.#size -= entry.size\n store.#count -= 1\n }\n if (entries.length === 0) {\n store.#entries.delete(key)\n }\n }\n\n // Reset the event flag after eviction\n if (store.#size < store.#maxSize && store.#count < store.#maxCount) {\n store.#hasEmittedMaxSizeEvent = false\n }\n }\n\n callback(null)\n }\n })\n }\n\n /**\n * @param {CacheKey} key\n */\n delete (key) {\n if (typeof key !== 'object') {\n throw new TypeError(`expected key to be object, got ${typeof key}`)\n }\n\n const topLevelKey = `${key.origin}:${key.path}`\n\n for (const entry of this.#entries.get(topLevelKey) ?? []) {\n this.#size -= entry.size\n this.#count -= 1\n }\n this.#entries.delete(topLevelKey)\n }\n}\n\nfunction findEntry (key, entries, now) {\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i]\n if (\n entry.deleteAt > now &&\n entry.method === key.method &&\n varyMatches(key, entry)\n ) {\n return entry\n }\n }\n}\n\nfunction varyMatches (key, entry) {\n if (entry.vary == null) {\n return true\n }\n\n for (const headerName in entry.vary) {\n if (Object.hasOwn(entry.vary, headerName) && !headerValueEquals(key.headers?.[headerName], entry.vary[headerName])) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @param {string|string[]|null|undefined} lhs\n * @param {string|string[]|null|undefined} rhs\n * @returns {boolean}\n */\nfunction headerValueEquals (lhs, rhs) {\n if (lhs == null && rhs == null) {\n return true\n }\n\n if ((lhs == null && rhs != null) ||\n (lhs != null && rhs == null)) {\n return false\n }\n\n if (Array.isArray(lhs) && Array.isArray(rhs)) {\n if (lhs.length !== rhs.length) {\n return false\n }\n\n for (let i = 0; i < lhs.length; i++) {\n if (lhs[i] !== rhs[i]) {\n return false\n }\n }\n\n return true\n }\n\n return lhs === rhs\n}\n\nmodule.exports = MemoryCacheStore\n","'use strict'\n\nconst assert = require('node:assert')\n\n/**\n * This takes care of revalidation requests we send to the origin. If we get\n * a response indicating that what we have is cached (via a HTTP 304), we can\n * continue using the cached value. Otherwise, we'll receive the new response\n * here, which we then just pass on to the next handler (most likely a\n * CacheHandler). Note that this assumes the proper headers were already\n * included in the request to tell the origin that we want to revalidate the\n * response (i.e. if-modified-since or if-none-match).\n *\n * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-validation\n *\n * @implements {import('../../types/dispatcher.d.ts').default.DispatchHandler}\n */\nclass CacheRevalidationHandler {\n #successful = false\n\n /**\n * @type {((success: boolean, context?: any, statusCode?: number, headers?: import('../../types/header.d.ts').IncomingHttpHeaders) => void) | null}\n */\n #callback\n\n /**\n * @type {(import('../../types/dispatcher.d.ts').default.DispatchHandler)}\n */\n #handler\n\n #context\n\n /**\n * @type {boolean}\n */\n #allowErrorStatusCodes\n\n /**\n * @param {(success: boolean, context?: any, statusCode?: number, headers?: import('../../types/header.d.ts').IncomingHttpHeaders) => void} callback Function to call if the cached value is valid\n * @param {import('../../types/dispatcher.d.ts').default.DispatchHandlers} handler\n * @param {boolean} allowErrorStatusCodes\n */\n constructor (callback, handler, allowErrorStatusCodes) {\n if (typeof callback !== 'function') {\n throw new TypeError('callback must be a function')\n }\n\n this.#callback = callback\n this.#handler = handler\n this.#allowErrorStatusCodes = allowErrorStatusCodes\n }\n\n onRequestStart (_, context) {\n this.#successful = false\n this.#context = context\n }\n\n onRequestUpgrade (controller, statusCode, headers, socket) {\n this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket)\n }\n\n onResponseStart (\n controller,\n statusCode,\n headers,\n statusMessage\n ) {\n assert(this.#callback != null)\n\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-handling-a-validation-respo\n // https://datatracker.ietf.org/doc/html/rfc5861#section-4\n this.#successful = statusCode === 304 ||\n (this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504)\n this.#callback(this.#successful, this.#context, statusCode, headers)\n this.#callback = null\n\n if (this.#successful) {\n return true\n }\n\n this.#handler.onRequestStart?.(controller, this.#context)\n this.#handler.onResponseStart?.(\n controller,\n statusCode,\n headers,\n statusMessage\n )\n }\n\n onResponseData (controller, chunk) {\n if (this.#successful) {\n return\n }\n\n return this.#handler.onResponseData?.(controller, chunk)\n }\n\n onResponseEnd (controller, trailers) {\n if (this.#successful) {\n return\n }\n\n this.#handler.onResponseEnd?.(controller, trailers)\n }\n\n onResponseError (controller, err) {\n if (this.#successful) {\n return\n }\n\n if (this.#callback) {\n this.#callback(false)\n this.#callback = null\n }\n\n if (typeof this.#handler.onResponseError === 'function') {\n this.#handler.onResponseError(controller, err)\n } else {\n throw err\n }\n }\n}\n\nmodule.exports = CacheRevalidationHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst util = require('../core/util')\nconst CacheHandler = require('../handler/cache-handler')\nconst MemoryCacheStore = require('../cache/memory-cache-store')\nconst CacheRevalidationHandler = require('../handler/cache-revalidation-handler')\nconst { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader, isInvalidOrWildcardVaryHeader } = require('../util/cache.js')\nconst { AbortError } = require('../core/errors.js')\nconst { parseHttpDate } = require('../util/date.js')\n\n/**\n * @param {(string | RegExp)[] | undefined} origins\n * @param {string} name\n */\nfunction assertCacheOrigins (origins, name) {\n if (origins === undefined) return\n if (!Array.isArray(origins)) {\n throw new TypeError(`expected ${name} to be an array or undefined, got ${typeof origins}`)\n }\n for (let i = 0; i < origins.length; i++) {\n const origin = origins[i]\n if (typeof origin !== 'string' && !(origin instanceof RegExp)) {\n throw new TypeError(`expected ${name}[${i}] to be a string or RegExp, got ${typeof origin}`)\n }\n }\n}\n\nconst nop = () => {}\n\nfunction trimOWS (value) {\n return value.replace(/^[\\t ]+|[\\t ]+$/g, '')\n}\n\nfunction arrayIncludes (array, value) {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true\n }\n }\n\n return false\n}\n\nfunction hasPragmaNoCache (headers) {\n const pragma = headers?.pragma\n if (!pragma) {\n return false\n }\n\n const values = Array.isArray(pragma) ? pragma : [pragma]\n for (let i = 0; i < values.length; i++) {\n const value = values[i]\n if (typeof value !== 'string') {\n continue\n }\n\n const directives = value.split(',')\n for (let j = 0; j < directives.length; j++) {\n if (trimOWS(directives[j]).toLowerCase() === 'no-cache') {\n return true\n }\n }\n }\n\n return false\n}\n\n/**\n * @typedef {(options: import('../../types/dispatcher.d.ts').default.DispatchOptions, handler: import('../../types/dispatcher.d.ts').default.DispatchHandler) => void} DispatchFn\n */\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} cacheControlDirectives\n * @param {import('../../types/dispatcher.d.ts').default.RequestOptions} opts\n * @returns {boolean}\n */\nfunction needsRevalidation (result, cacheControlDirectives, { headers = {} }) {\n // Always revalidate requests with the no-cache request directive.\n if (cacheControlDirectives?.['no-cache']) {\n return true\n }\n\n // Always revalidate requests with unqualified no-cache response directive.\n if (result.cacheControlDirectives?.['no-cache'] && !Array.isArray(result.cacheControlDirectives['no-cache'])) {\n return true\n }\n\n // Always revalidate requests with conditional headers.\n if (headers['if-modified-since'] || headers['if-none-match']) {\n return true\n }\n\n return false\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @returns {boolean}\n */\nfunction staleResponseRequiresRevalidation (result, cacheType) {\n return result.cacheControlDirectives?.['must-revalidate'] === true ||\n (cacheType === 'shared' && (\n result.cacheControlDirectives?.['proxy-revalidate'] === true ||\n // https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.2.10\n // s-maxage implies proxy-revalidate for shared caches.\n result.cacheControlDirectives?.['s-maxage'] !== undefined\n ))\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} headers\n * @returns {boolean}\n */\nfunction revalidationResponseDisallowsCachedReuse (cacheType, headers) {\n if (\n (headers.vary && isInvalidOrWildcardVaryHeader(headers.vary)) ||\n (cacheType === 'shared' && Object.hasOwn(headers, 'set-cookie'))\n ) {\n return true\n }\n\n const cacheControl = headers['cache-control']\n if (!cacheControl) {\n return false\n }\n\n const cacheControlDirectives = parseCacheControlHeader(cacheControl)\n return cacheControlDirectives['no-store'] === true ||\n (cacheType === 'shared' && cacheControlDirectives.private === true)\n}\n\nfunction revalidationResponseUpdatesCacheControl (headers) {\n return headers['cache-control'] !== undefined\n}\n\nfunction deleteCachedValue (store, cacheKey) {\n try {\n store.delete(cacheKey)?.catch?.(nop)\n } catch {\n // Fail silently\n }\n}\n\nfunction getUsableLastModified (headers) {\n const lastModified = headers?.['last-modified']\n if (typeof lastModified === 'string' && parseHttpDate(lastModified)) {\n return lastModified\n }\n}\n\nfunction makeRevalidationHeaders (opts, result) {\n const headers = {\n ...opts.headers,\n 'if-modified-since': getUsableLastModified(result.headers) ?? new Date(result.cachedAt).toUTCString()\n }\n\n if (result.etag) {\n headers['if-none-match'] = result.etag\n }\n\n if (result.vary) {\n for (const key in result.vary) {\n if (result.vary[key] != null) {\n headers[key] = result.vary[key]\n }\n }\n }\n\n return headers\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} cacheControlDirectives\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @returns {boolean}\n */\nfunction isStale (result, cacheControlDirectives, cacheType) {\n const now = Date.now()\n if (now > result.staleAt) {\n // Response is stale\n if (!staleResponseRequiresRevalidation(result, cacheType) && cacheControlDirectives?.['max-stale']) {\n // There's a threshold where we can serve stale responses, let's see if\n // we're in it\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-max-stale\n const gracePeriod = result.staleAt + (cacheControlDirectives['max-stale'] * 1000)\n return now > gracePeriod\n }\n\n return true\n }\n\n if (cacheControlDirectives?.['min-fresh']) {\n // https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.1.3\n\n // At this point, staleAt is always > now\n const timeLeftTillStale = result.staleAt - now\n const threshold = cacheControlDirectives['min-fresh'] * 1000\n\n return timeLeftTillStale <= threshold\n }\n\n return false\n}\n\n/**\n * Check if we're within the stale-while-revalidate window for a stale response\n * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType\n * @returns {boolean}\n */\nfunction withinStaleWhileRevalidateWindow (result, cacheType) {\n const staleWhileRevalidate = result.cacheControlDirectives?.['stale-while-revalidate']\n if (!staleWhileRevalidate || staleResponseRequiresRevalidation(result, cacheType)) {\n return false\n }\n\n const now = Date.now()\n const staleWhileRevalidateExpiry = result.staleAt + (staleWhileRevalidate * 1000)\n return now <= staleWhileRevalidateExpiry\n}\n\n/**\n * @param {DispatchFn} dispatch\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} globalOpts\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey\n * @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler\n * @param {import('../../types/dispatcher.d.ts').default.RequestOptions} opts\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} reqCacheControl\n */\nfunction handleUncachedResponse (\n dispatch,\n globalOpts,\n cacheKey,\n handler,\n opts,\n reqCacheControl\n) {\n if (reqCacheControl?.['only-if-cached']) {\n let aborted = false\n try {\n if (typeof handler.onConnect === 'function') {\n handler.onConnect(() => {\n aborted = true\n })\n\n if (aborted) {\n return\n }\n }\n\n if (typeof handler.onHeaders === 'function') {\n handler.onHeaders(504, [], nop, 'Gateway Timeout')\n if (aborted) {\n return\n }\n }\n\n if (typeof handler.onComplete === 'function') {\n handler.onComplete([])\n }\n } catch (err) {\n if (typeof handler.onError === 'function') {\n handler.onError(err)\n }\n }\n\n return true\n }\n\n return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))\n}\n\n/**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler\n * @param {import('../../types/dispatcher.d.ts').default.RequestOptions} opts\n * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result\n * @param {number} age\n * @param {any} context\n * @param {boolean} isStale\n */\nfunction sendCachedValue (handler, opts, result, age, context, isStale) {\n // TODO (perf): Readable.from path can be optimized...\n const stream = util.isStream(result.body)\n ? result.body\n : Readable.from(result.body ?? [])\n\n assert(!stream.destroyed, 'stream should not be destroyed')\n assert(!stream.readableDidRead, 'stream should not be readableDidRead')\n\n const controller = {\n resume () {\n stream.resume()\n },\n pause () {\n stream.pause()\n },\n get paused () {\n return stream.isPaused()\n },\n get aborted () {\n return stream.destroyed\n },\n get reason () {\n return stream.errored\n },\n abort (reason) {\n stream.destroy(reason ?? new AbortError())\n }\n }\n\n stream\n .on('error', function (err) {\n if (!this.readableEnded) {\n if (typeof handler.onResponseError === 'function') {\n handler.onResponseError(controller, err)\n } else {\n throw err\n }\n }\n })\n .on('close', function () {\n if (!this.errored) {\n handler.onResponseEnd?.(controller, {})\n }\n })\n\n handler.onRequestStart?.(controller, context)\n\n if (stream.destroyed) {\n return\n }\n\n // Add the age header\n // https://www.rfc-editor.org/rfc/rfc9111.html#name-age\n const headers = { ...result.headers, age: String(age) }\n\n if (isStale) {\n // Add warning header\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning\n headers.warning = '110 - \"response is stale\"'\n }\n\n handler.onResponseStart?.(controller, result.statusCode, headers, result.statusMessage)\n\n if (opts.method === 'HEAD') {\n stream.destroy()\n } else {\n stream.on('data', function (chunk) {\n handler.onResponseData?.(controller, chunk)\n })\n }\n}\n\n/**\n * @param {DispatchFn} dispatch\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} globalOpts\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey\n * @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler\n * @param {import('../../types/dispatcher.d.ts').default.RequestOptions} opts\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} reqCacheControl\n * @param {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined} result\n */\nfunction handleResult (\n dispatch,\n globalOpts,\n cacheKey,\n handler,\n opts,\n reqCacheControl,\n result\n) {\n if (!result) {\n return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl)\n }\n\n // Shared stores may outlive the Undici version that wrote them. Do not\n // re-serve a Set-Cookie header from an existing shared-cache entry.\n if (globalOpts.type === 'shared' && Object.hasOwn(result.headers, 'set-cookie')) {\n if (util.isStream(result.body)) {\n result.body.on('error', nop).destroy()\n }\n\n deleteCachedValue(globalOpts.store, cacheKey)\n return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl)\n }\n\n const now = Date.now()\n if (now > result.deleteAt) {\n // Response is expired, cache store shouldn't have given this to us\n return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))\n }\n\n const age = Math.round((now - result.cachedAt) / 1000)\n const requestMaxAgeExpired = reqCacheControl?.['max-age'] !== undefined && age >= reqCacheControl['max-age']\n\n const stale = requestMaxAgeExpired || isStale(result, reqCacheControl, globalOpts.type)\n const revalidate = requestMaxAgeExpired || needsRevalidation(result, reqCacheControl, opts)\n\n // Check if the response is stale\n if (stale || revalidate) {\n if (util.isStream(opts.body) && util.bodyLength(opts.body) !== 0) {\n // If body is a stream we can't revalidate...\n // TODO (fix): This could be less strict...\n return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))\n }\n\n // RFC 5861: If we're within stale-while-revalidate window, serve stale immediately\n // and revalidate in background, unless immediate revalidation is necessary\n if (!revalidate && withinStaleWhileRevalidateWindow(result, globalOpts.type)) {\n // Serve stale response immediately\n sendCachedValue(handler, opts, result, age, null, true)\n\n // Start background revalidation (fire-and-forget)\n queueMicrotask(() => {\n const headers = makeRevalidationHeaders(opts, result)\n\n // Background revalidation - update cache if we get new data\n dispatch(\n {\n ...opts,\n headers\n },\n new CacheHandler(globalOpts, cacheKey, {\n // Silent handler that just updates the cache\n onRequestStart () {},\n onRequestUpgrade () {},\n onResponseStart () {},\n onResponseData () {},\n onResponseEnd () {},\n onResponseError () {}\n })\n )\n })\n\n return true\n }\n\n let withinStaleIfErrorThreshold = false\n if (!staleResponseRequiresRevalidation(result, globalOpts.type)) {\n const staleIfErrorExpiry = result.cacheControlDirectives['stale-if-error'] ?? reqCacheControl?.['stale-if-error']\n if (staleIfErrorExpiry) {\n withinStaleIfErrorThreshold = now < (result.staleAt + (staleIfErrorExpiry * 1000))\n }\n }\n\n const headers = makeRevalidationHeaders(opts, result)\n\n // We need to revalidate the response\n return dispatch(\n {\n ...opts,\n headers\n },\n new CacheRevalidationHandler(\n (success, context, statusCode, headers) => {\n if (success) {\n if (statusCode === 304) {\n if (revalidationResponseDisallowsCachedReuse(globalOpts.type, headers)) {\n if (util.isStream(result.body)) {\n result.body.on('error', nop).destroy()\n }\n\n deleteCachedValue(globalOpts.store, cacheKey)\n return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))\n }\n\n if (revalidationResponseUpdatesCacheControl(headers)) {\n deleteCachedValue(globalOpts.store, cacheKey)\n }\n }\n\n // TODO: successful revalidation should be considered fresh (not give stale warning).\n sendCachedValue(handler, opts, result, age, context, stale)\n } else if (util.isStream(result.body)) {\n result.body.on('error', nop).destroy()\n }\n },\n new CacheHandler(globalOpts, cacheKey, handler),\n withinStaleIfErrorThreshold\n )\n )\n }\n\n // Dump request body.\n if (util.isStream(opts.body)) {\n opts.body.on('error', nop).destroy()\n }\n\n sendCachedValue(handler, opts, result, age, null, false)\n}\n\n/**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions} [opts]\n * @returns {import('../../types/dispatcher.d.ts').default.DispatcherComposeInterceptor}\n */\nmodule.exports = (opts = {}) => {\n const {\n store = new MemoryCacheStore(),\n methods = ['GET'],\n cacheByDefault = undefined,\n type = 'shared',\n origins = undefined\n } = opts\n\n if (typeof opts !== 'object' || opts === null) {\n throw new TypeError(`expected type of opts to be an Object, got ${opts === null ? 'null' : typeof opts}`)\n }\n\n assertCacheStore(store, 'opts.store')\n assertCacheMethods(methods, 'opts.methods')\n assertCacheOrigins(origins, 'opts.origins')\n\n if (typeof cacheByDefault !== 'undefined' && typeof cacheByDefault !== 'number') {\n throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof cacheByDefault}`)\n }\n\n if (typeof type !== 'undefined' && type !== 'shared' && type !== 'private') {\n throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof type}`)\n }\n\n const globalOpts = {\n store,\n methods,\n cacheByDefault,\n type\n }\n\n const safeMethodsToNotCache = []\n for (let i = 0; i < util.safeHTTPMethods.length; i++) {\n const method = util.safeHTTPMethods[i]\n if (!arrayIncludes(methods, method)) {\n safeMethodsToNotCache.push(method)\n }\n }\n\n return dispatch => {\n return (opts, handler) => {\n if (!opts.origin || arrayIncludes(safeMethodsToNotCache, opts.method)) {\n // Not a method we want to cache or we don't have the origin, skip\n return dispatch(opts, handler)\n }\n\n // Check if origin is in whitelist\n if (origins !== undefined) {\n const requestOrigin = opts.origin.toString().toLowerCase()\n let isAllowed = false\n\n for (let i = 0; i < origins.length; i++) {\n const allowed = origins[i]\n if (typeof allowed === 'string') {\n if (allowed.toLowerCase() === requestOrigin) {\n isAllowed = true\n break\n }\n } else if (allowed.test(requestOrigin)) {\n isAllowed = true\n break\n }\n }\n\n if (!isAllowed) {\n return dispatch(opts, handler)\n }\n }\n\n opts = {\n ...opts,\n headers: normalizeHeaders(opts)\n }\n\n const reqCacheControl = opts.headers?.['cache-control']\n ? parseCacheControlHeader(opts.headers['cache-control'])\n : hasPragmaNoCache(opts.headers)\n ? { 'no-cache': true }\n : undefined\n\n if (reqCacheControl?.['no-store']) {\n return dispatch(opts, handler)\n }\n\n /**\n * @type {import('../../types/cache-interceptor.d.ts').default.CacheKey}\n */\n const cacheKey = makeCacheKey(opts)\n\n if (!arrayIncludes(util.safeHTTPMethods, opts.method)) {\n return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))\n }\n\n const result = store.get(cacheKey)\n\n if (result && typeof result.then === 'function') {\n return result\n .then(result => handleResult(dispatch,\n globalOpts,\n cacheKey,\n handler,\n opts,\n reqCacheControl,\n result\n ))\n } else {\n return handleResult(\n dispatch,\n globalOpts,\n cacheKey,\n handler,\n opts,\n reqCacheControl,\n result\n )\n }\n }\n }\n}\n","'use strict'\n\nconst { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require('node:zlib')\nconst { pipeline, Transform: TransformStream } = require('node:stream')\nconst { InvalidArgumentError, ResponseExceededMaxSizeError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { runtimeFeatures } = require('../util/runtime-features')\n\n/** @typedef {import('node:stream').Transform} Transform */\n/** @typedef {import('node:stream').Transform} Controller */\n/** @typedef {Transform&import('node:zlib').Zlib} DecompressorStream */\n\n/** @type {Record<string, () => DecompressorStream>} */\nconst supportedEncodings = {\n gzip: createGunzip,\n 'x-gzip': createGunzip,\n br: createBrotliDecompress,\n deflate: createInflate,\n compress: createInflate,\n 'x-compress': createInflate,\n ...(runtimeFeatures.has('zstd') ? { zstd: createZstdDecompress } : {})\n}\n\nconst defaultSkipStatusCodes = /** @type {const} */ ([204, 304])\nconst defaultMaxSize = 64 * 1024 * 1024\n\n/**\n * Limits the output of one stage in a decompression chain.\n * @param {number} maxSize - Maximum output size in bytes\n * @returns {Transform}\n */\nfunction createMaxSizeLimiter (maxSize) {\n let size = 0\n\n return new TransformStream({\n transform (chunk, _encoding, callback) {\n const decompressedSize = size + chunk.length\n if (decompressedSize > maxSize) {\n callback(new ResponseExceededMaxSizeError(\n `Decompressed response size (${decompressedSize}) exceeded maxSize (${maxSize})`\n ))\n return\n }\n\n size = decompressedSize\n callback(null, chunk)\n }\n })\n}\n\nlet warningEmitted = /** @type {boolean} */ (false)\n\n/**\n * @typedef {Object} DecompressHandlerOptions\n * @property {number[]|Readonly<number[]>} [skipStatusCodes=[204, 304]] - List of status codes to skip decompression for\n * @property {boolean} [skipErrorResponses] - Whether to skip decompression for error responses (status codes >= 400)\n * @property {number} [maxSize=67108864] - Maximum decompressed response size in bytes\n */\n\nclass DecompressHandler extends DecoratorHandler {\n /** @type {Transform[]} */\n #decompressors = []\n /** @type {Record<string, string | string[]> | undefined} */\n #trailers\n /** @type {Readonly<number[]>} */\n #skipStatusCodes\n /** @type {boolean} */\n #skipErrorResponses\n /** @type {number} */\n #maxSize\n /** @type {number} */\n #decompressedSize = 0\n /** @type {boolean} */\n #terminated = false\n /** @type {boolean} */\n #inputEnded = false\n\n constructor (handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true, maxSize = defaultMaxSize } = {}) {\n if (!Number.isSafeInteger(maxSize) || maxSize < 1) {\n throw new InvalidArgumentError('maxSize must be a positive integer')\n }\n\n super(handler)\n this.#skipStatusCodes = skipStatusCodes\n this.#skipErrorResponses = skipErrorResponses\n this.#maxSize = maxSize\n }\n\n /**\n * Determines if decompression should be skipped based on encoding and status code\n * @param {string} contentEncoding - Content-Encoding header value\n * @param {number} statusCode - HTTP status code of the response\n * @returns {boolean} - True if decompression should be skipped\n */\n #shouldSkipDecompression (contentEncoding, statusCode) {\n if (!contentEncoding || statusCode < 200) return true\n if (this.#skipStatusCodes.includes(statusCode)) return true\n if (this.#skipErrorResponses && statusCode >= 400) return true\n return false\n }\n\n /**\n * Creates a chain of decompressors for multiple content encodings\n *\n * @param {string} encodings - Comma-separated list of content encodings\n * @returns {Array<Transform>} - Array of decompressor and limiting streams\n * @throws {Error} - If the number of content-encodings exceeds the maximum allowed\n */\n #createDecompressionChain (encodings) {\n const parts = encodings.split(',')\n\n // Limit the number of content-encodings to prevent resource exhaustion.\n // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n const maxContentEncodings = 5\n if (parts.length > maxContentEncodings) {\n throw new Error(`too many content-encodings in response: ${parts.length}, maximum allowed is ${maxContentEncodings}`)\n }\n\n /** @type {DecompressorStream[]} */\n const decompressors = []\n\n for (let i = parts.length - 1; i >= 0; i--) {\n const encoding = parts[i].trim()\n if (!encoding) continue\n\n if (!supportedEncodings[encoding]) {\n decompressors.length = 0 // Clear if unsupported encoding\n return decompressors // Unsupported encoding\n }\n\n decompressors.push(supportedEncodings[encoding]())\n }\n\n if (decompressors.length < 2) {\n return decompressors\n }\n\n /** @type {Transform[]} */\n const streams = []\n for (let i = 0; i < decompressors.length; i++) {\n streams.push(decompressors[i])\n if (i < decompressors.length - 1) {\n streams.push(createMaxSizeLimiter(this.#maxSize))\n }\n }\n\n return streams\n }\n\n /**\n * Stops decompression and reports an error.\n * @param {Controller} controller - The controller to coordinate with\n * @param {Error} error - The decompression error\n * @returns {void}\n */\n #fail (controller, error) {\n if (this.#terminated) {\n return\n }\n\n if (this.#inputEnded) {\n // The request is already marked complete once the compressed input ends,\n // so controller.abort() can no longer propagate decoder flush errors.\n this.onResponseError(controller, error)\n } else {\n controller.abort(error)\n }\n }\n\n /**\n * Sets up event handlers for a decompressor stream using readable events\n * @param {DecompressorStream} decompressor - The decompressor stream\n * @param {Controller} controller - The controller to coordinate with\n * @returns {void}\n */\n #setupDecompressorEvents (decompressor, controller) {\n decompressor.on('readable', () => {\n if (this.#terminated) {\n return\n }\n\n let chunk\n while ((chunk = decompressor.read()) !== null) {\n const decompressedSize = this.#decompressedSize + chunk.length\n if (decompressedSize > this.#maxSize) {\n this.#fail(controller, new ResponseExceededMaxSizeError(\n `Decompressed response size (${decompressedSize}) exceeded maxSize (${this.#maxSize})`\n ))\n return\n }\n\n this.#decompressedSize = decompressedSize\n const result = super.onResponseData(controller, chunk)\n if (result === false) {\n break\n }\n }\n })\n\n decompressor.on('error', (error) => {\n this.#fail(controller, error)\n })\n }\n\n /**\n * Sets up event handling for a single decompressor\n * @param {Controller} controller - The controller to handle events\n * @returns {void}\n */\n #setupSingleDecompressor (controller) {\n const decompressor = this.#decompressors[0]\n this.#setupDecompressorEvents(decompressor, controller)\n\n decompressor.on('end', () => {\n if (this.#terminated) {\n return\n }\n\n this.#terminated = true\n this.#cleanupDecompressors()\n super.onResponseEnd(controller, this.#trailers)\n })\n }\n\n /**\n * Sets up event handling for multiple chained decompressors using pipeline\n * @param {Controller} controller - The controller to handle events\n * @returns {void}\n */\n #setupMultipleDecompressors (controller) {\n const lastDecompressor = this.#decompressors[this.#decompressors.length - 1]\n this.#setupDecompressorEvents(lastDecompressor, controller)\n\n pipeline(this.#decompressors, (err) => {\n if (this.#terminated) {\n return\n }\n\n if (err) {\n this.#fail(controller, err)\n return\n }\n\n this.#terminated = true\n this.#cleanupDecompressors()\n super.onResponseEnd(controller, this.#trailers)\n })\n }\n\n /**\n * Cleans up decompressor references to prevent memory leaks\n * @returns {void}\n */\n #cleanupDecompressors () {\n this.#decompressors.length = 0\n }\n\n /**\n * @param {Controller} controller\n * @param {number} statusCode\n * @param {Record<string, string | string[] | undefined>} headers\n * @param {string} statusMessage\n * @returns {void}\n */\n onResponseStart (controller, statusCode, headers, statusMessage) {\n const contentEncoding = headers['content-encoding']\n\n // If content encoding is not supported or status code is in skip list\n if (this.#shouldSkipDecompression(contentEncoding, statusCode)) {\n return super.onResponseStart(controller, statusCode, headers, statusMessage)\n }\n\n const decompressors = this.#createDecompressionChain(contentEncoding.toLowerCase())\n\n if (decompressors.length === 0) {\n this.#cleanupDecompressors()\n return super.onResponseStart(controller, statusCode, headers, statusMessage)\n }\n\n this.#decompressors = decompressors\n\n // Remove compression headers since we're decompressing\n const { 'content-encoding': _, 'content-length': __, ...newHeaders } = headers\n\n if (controller?.rawHeaders) {\n const rawHeaders = controller.rawHeaders\n\n if (Array.isArray(rawHeaders)) {\n const filteredHeaders = []\n for (let i = 0; i < rawHeaders.length; i += 2) {\n const headerName = rawHeaders[i]\n const name = Buffer.isBuffer(headerName) ? headerName.toString('latin1') : `${headerName}`\n const lowerName = name.toLowerCase()\n\n if (lowerName === 'content-encoding' || lowerName === 'content-length') {\n continue\n }\n\n filteredHeaders.push(rawHeaders[i], rawHeaders[i + 1])\n }\n rawHeaders.splice(0, rawHeaders.length, ...filteredHeaders)\n } else if (typeof rawHeaders === 'object') {\n for (const name of Object.keys(rawHeaders)) {\n const lowerName = name.toLowerCase()\n if (lowerName === 'content-encoding' || lowerName === 'content-length') {\n delete rawHeaders[name]\n }\n }\n }\n }\n\n if (this.#decompressors.length === 1) {\n this.#setupSingleDecompressor(controller)\n } else {\n this.#setupMultipleDecompressors(controller)\n }\n\n return super.onResponseStart(controller, statusCode, newHeaders, statusMessage)\n }\n\n /**\n * @param {Controller} controller\n * @param {Buffer} chunk\n * @returns {void}\n */\n onResponseData (controller, chunk) {\n if (this.#decompressors.length > 0) {\n this.#decompressors[0].write(chunk)\n return\n }\n super.onResponseData(controller, chunk)\n }\n\n /**\n * @param {Controller} controller\n * @param {Record<string, string | string[]> | undefined} trailers\n * @returns {void}\n */\n onResponseEnd (controller, trailers) {\n if (this.#decompressors.length > 0) {\n this.#inputEnded = true\n this.#trailers = trailers\n this.#decompressors[0].end()\n return\n }\n super.onResponseEnd(controller, trailers)\n }\n\n /**\n * @param {Controller} controller\n * @param {Error} err\n * @returns {void}\n */\n onResponseError (controller, err) {\n if (this.#terminated) {\n return\n }\n\n this.#terminated = true\n for (const decompressor of this.#decompressors) {\n decompressor.destroy()\n }\n this.#cleanupDecompressors()\n super.onResponseError(controller, err)\n }\n}\n\n/**\n * Creates a decompression interceptor for HTTP responses\n * @param {DecompressHandlerOptions} [options] - Options for the interceptor\n * @returns {Function} - Interceptor function\n */\nfunction createDecompressInterceptor (options = {}) {\n // Emit experimental warning only once\n if (!warningEmitted) {\n process.emitWarning(\n 'DecompressInterceptor is experimental and subject to change',\n 'ExperimentalWarning'\n )\n warningEmitted = true\n }\n\n return (dispatch) => {\n return (opts, handler) => {\n const decompressHandler = new DecompressHandler(handler, options)\n return dispatch(opts, decompressHandler)\n }\n }\n}\n\nmodule.exports = createDecompressInterceptor\n","'use strict'\n\nconst { RequestAbortedError } = require('../core/errors')\n\n/**\n * @typedef {import('../../types/dispatcher.d.ts').default.DispatchHandler} DispatchHandler\n */\n\nconst DEFAULT_MAX_BUFFER_SIZE = 5 * 1024 * 1024\n\n/**\n * @typedef {Object} WaitingHandler\n * @property {DispatchHandler} handler\n * @property {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @property {Buffer[]} bufferedChunks\n * @property {number} bufferedBytes\n * @property {object | null} pendingTrailers\n * @property {boolean} done\n */\n\n/**\n * Handler that forwards response events to multiple waiting handlers.\n * Used for request deduplication.\n *\n * @implements {DispatchHandler}\n */\nclass DeduplicationHandler {\n /**\n * @type {DispatchHandler}\n */\n #primaryHandler\n\n /**\n * @type {WaitingHandler[]}\n */\n #waitingHandlers = []\n\n /**\n * @type {number}\n */\n #maxBufferSize = DEFAULT_MAX_BUFFER_SIZE\n\n /**\n * @type {number}\n */\n #statusCode = 0\n\n /**\n * @type {Record<string, string | string[]>}\n */\n #headers = {}\n\n /**\n * @type {string}\n */\n #statusMessage = ''\n\n /**\n * @type {boolean}\n */\n #aborted = false\n\n /**\n * @type {boolean}\n */\n #responseStarted = false\n\n /**\n * @type {boolean}\n */\n #responseDataStarted = false\n\n /**\n * @type {boolean}\n */\n #completed = false\n\n /**\n * @type {import('../../types/dispatcher.d.ts').default.DispatchController | null}\n */\n #controller = null\n\n /**\n * @type {(() => void) | null}\n */\n #onComplete = null\n\n /**\n * @param {DispatchHandler} primaryHandler The primary handler\n * @param {() => void} onComplete Callback when request completes\n * @param {number} [maxBufferSize] Maximum paused buffer size per waiting handler\n */\n constructor (primaryHandler, onComplete, maxBufferSize = DEFAULT_MAX_BUFFER_SIZE) {\n this.#primaryHandler = primaryHandler\n this.#onComplete = onComplete\n this.#maxBufferSize = maxBufferSize\n }\n\n /**\n * Add a waiting handler that will receive response events.\n * Returns false if deduplication can no longer safely attach this handler.\n *\n * @param {DispatchHandler} handler\n * @returns {boolean}\n */\n addWaitingHandler (handler) {\n if (this.#completed || this.#responseDataStarted) {\n return false\n }\n\n const waitingHandler = this.#createWaitingHandler(handler)\n const waitingController = waitingHandler.controller\n\n try {\n handler.onRequestStart?.(waitingController, null)\n\n if (waitingController.aborted) {\n waitingHandler.done = true\n return true\n }\n\n if (this.#responseStarted) {\n handler.onResponseStart?.(\n waitingController,\n this.#statusCode,\n this.#headers,\n this.#statusMessage\n )\n }\n } catch {\n // Ignore errors from waiting handlers\n waitingHandler.done = true\n return true\n }\n\n if (!waitingController.aborted) {\n this.#waitingHandlers.push(waitingHandler)\n }\n\n return true\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {any} context\n */\n onRequestStart (controller, context) {\n this.#controller = controller\n this.#primaryHandler.onRequestStart?.(controller, context)\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {number} statusCode\n * @param {import('../../types/header.d.ts').IncomingHttpHeaders} headers\n * @param {Socket} socket\n */\n onRequestUpgrade (controller, statusCode, headers, socket) {\n this.#primaryHandler.onRequestUpgrade?.(controller, statusCode, headers, socket)\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {number} statusCode\n * @param {Record<string, string | string[]>} headers\n * @param {string} statusMessage\n */\n onResponseStart (controller, statusCode, headers, statusMessage) {\n this.#responseStarted = true\n this.#statusCode = statusCode\n this.#headers = headers\n this.#statusMessage = statusMessage\n\n this.#primaryHandler.onResponseStart?.(controller, statusCode, headers, statusMessage)\n\n for (const waitingHandler of this.#waitingHandlers) {\n const { handler, controller: waitingController } = waitingHandler\n\n if (waitingHandler.done || waitingController.aborted) {\n waitingHandler.done = true\n continue\n }\n\n try {\n handler.onResponseStart?.(\n waitingController,\n statusCode,\n headers,\n statusMessage\n )\n } catch {\n // Ignore errors from waiting handlers\n }\n\n if (waitingController.aborted) {\n waitingHandler.done = true\n }\n }\n\n this.#pruneDoneWaitingHandlers()\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {Buffer} chunk\n */\n onResponseData (controller, chunk) {\n if (this.#aborted || this.#completed) {\n return\n }\n\n this.#responseDataStarted = true\n\n this.#primaryHandler.onResponseData?.(controller, chunk)\n\n for (const waitingHandler of this.#waitingHandlers) {\n const { handler, controller: waitingController } = waitingHandler\n\n if (waitingHandler.done || waitingController.aborted) {\n waitingHandler.done = true\n continue\n }\n\n if (waitingController.paused) {\n this.#bufferWaitingChunk(waitingHandler, chunk)\n continue\n }\n\n try {\n handler.onResponseData?.(waitingController, chunk)\n } catch {\n // Ignore errors from waiting handlers\n }\n\n if (waitingController.aborted) {\n waitingHandler.done = true\n waitingHandler.bufferedChunks = []\n waitingHandler.bufferedBytes = 0\n }\n }\n\n this.#pruneDoneWaitingHandlers()\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {object} trailers\n */\n onResponseEnd (controller, trailers) {\n if (this.#aborted || this.#completed) {\n return\n }\n\n this.#completed = true\n this.#primaryHandler.onResponseEnd?.(controller, trailers)\n\n for (const waitingHandler of this.#waitingHandlers) {\n if (waitingHandler.done || waitingHandler.controller.aborted) {\n waitingHandler.done = true\n continue\n }\n\n this.#flushWaitingHandler(waitingHandler)\n\n if (waitingHandler.done || waitingHandler.controller.aborted) {\n waitingHandler.done = true\n continue\n }\n\n if (waitingHandler.controller.paused && waitingHandler.bufferedChunks.length > 0) {\n waitingHandler.pendingTrailers = trailers\n continue\n }\n\n try {\n waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, trailers)\n } catch {\n // Ignore errors from waiting handlers\n }\n\n waitingHandler.done = true\n }\n\n this.#pruneDoneWaitingHandlers()\n this.#onComplete?.()\n }\n\n /**\n * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller\n * @param {Error} err\n */\n onResponseError (controller, err) {\n if (this.#completed) {\n return\n }\n\n this.#aborted = true\n this.#completed = true\n\n this.#primaryHandler.onResponseError?.(controller, err)\n\n for (const waitingHandler of this.#waitingHandlers) {\n this.#errorWaitingHandler(waitingHandler, err)\n }\n\n this.#waitingHandlers = []\n this.#onComplete?.()\n }\n\n /**\n * @param {DispatchHandler} handler\n * @returns {WaitingHandler}\n */\n #createWaitingHandler (handler) {\n /** @type {WaitingHandler} */\n const waitingHandler = {\n handler,\n controller: null,\n bufferedChunks: [],\n bufferedBytes: 0,\n pendingTrailers: null,\n done: false\n }\n\n const state = {\n aborted: false,\n paused: false,\n reason: null\n }\n\n waitingHandler.controller = {\n resume: () => {\n if (state.aborted) {\n return\n }\n\n state.paused = false\n this.#flushWaitingHandler(waitingHandler)\n\n if (\n this.#completed &&\n waitingHandler.pendingTrailers &&\n waitingHandler.bufferedChunks.length === 0 &&\n !state.paused &&\n !state.aborted\n ) {\n try {\n waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, waitingHandler.pendingTrailers)\n } catch {\n // Ignore errors from waiting handlers\n }\n\n waitingHandler.pendingTrailers = null\n waitingHandler.done = true\n }\n\n this.#pruneDoneWaitingHandlers()\n },\n pause: () => {\n if (!state.aborted) {\n state.paused = true\n }\n },\n get paused () { return state.paused },\n get aborted () { return state.aborted },\n get reason () { return state.reason },\n abort: (reason) => {\n state.aborted = true\n state.reason = reason ?? null\n waitingHandler.done = true\n waitingHandler.pendingTrailers = null\n waitingHandler.bufferedChunks = []\n waitingHandler.bufferedBytes = 0\n }\n }\n\n return waitingHandler\n }\n\n /**\n * @param {WaitingHandler} waitingHandler\n * @param {Buffer} chunk\n */\n #bufferWaitingChunk (waitingHandler, chunk) {\n if (waitingHandler.done || waitingHandler.controller.aborted) {\n waitingHandler.done = true\n waitingHandler.bufferedChunks = []\n waitingHandler.bufferedBytes = 0\n return\n }\n\n const bufferedChunk = Buffer.from(chunk)\n waitingHandler.bufferedChunks.push(bufferedChunk)\n waitingHandler.bufferedBytes += bufferedChunk.length\n\n if (waitingHandler.bufferedBytes > this.#maxBufferSize) {\n const err = new RequestAbortedError(`Deduplicated waiting handler exceeded maxBufferSize (${this.#maxBufferSize} bytes) while paused`)\n this.#errorWaitingHandler(waitingHandler, err)\n }\n }\n\n /**\n * @param {WaitingHandler} waitingHandler\n */\n #flushWaitingHandler (waitingHandler) {\n const { handler, controller } = waitingHandler\n\n while (\n !waitingHandler.done &&\n !controller.aborted &&\n !controller.paused &&\n waitingHandler.bufferedChunks.length > 0\n ) {\n const bufferedChunk = waitingHandler.bufferedChunks.shift()\n waitingHandler.bufferedBytes -= bufferedChunk.length\n\n try {\n handler.onResponseData?.(controller, bufferedChunk)\n } catch {\n // Ignore errors from waiting handlers\n }\n\n if (controller.aborted) {\n waitingHandler.done = true\n waitingHandler.pendingTrailers = null\n waitingHandler.bufferedChunks = []\n waitingHandler.bufferedBytes = 0\n break\n }\n }\n }\n\n /**\n * @param {WaitingHandler} waitingHandler\n * @param {Error} err\n */\n #errorWaitingHandler (waitingHandler, err) {\n if (waitingHandler.done) {\n return\n }\n\n waitingHandler.done = true\n waitingHandler.pendingTrailers = null\n waitingHandler.bufferedChunks = []\n waitingHandler.bufferedBytes = 0\n\n try {\n waitingHandler.controller.abort(err)\n waitingHandler.handler.onResponseError?.(waitingHandler.controller, err)\n } catch {\n // Ignore errors from waiting handlers\n }\n }\n\n #pruneDoneWaitingHandlers () {\n this.#waitingHandlers = this.#waitingHandlers.filter(waitingHandler => waitingHandler.done === false)\n }\n}\n\nmodule.exports = DeduplicationHandler\n","'use strict'\n\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('../core/util')\nconst DeduplicationHandler = require('../handler/deduplication-handler')\nconst { normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require('../util/cache.js')\n\nconst pendingRequestsChannel = diagnosticsChannel.channel('undici:request:pending-requests')\n\n/**\n * @param {import('../../types/interceptors.d.ts').default.DeduplicateInterceptorOpts} [opts]\n * @returns {import('../../types/dispatcher.d.ts').default.DispatcherComposeInterceptor}\n */\nmodule.exports = (opts = {}) => {\n const {\n methods = ['GET'],\n skipHeaderNames = [],\n excludeHeaderNames = [],\n maxBufferSize = 5 * 1024 * 1024\n } = opts\n\n if (typeof opts !== 'object' || opts === null) {\n throw new TypeError(`expected type of opts to be an Object, got ${opts === null ? 'null' : typeof opts}`)\n }\n\n if (!Array.isArray(methods)) {\n throw new TypeError(`expected opts.methods to be an array, got ${typeof methods}`)\n }\n\n for (const method of methods) {\n if (!util.safeHTTPMethods.includes(method)) {\n throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${method}`)\n }\n }\n\n if (!Array.isArray(skipHeaderNames)) {\n throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof skipHeaderNames}`)\n }\n\n if (!Array.isArray(excludeHeaderNames)) {\n throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof excludeHeaderNames}`)\n }\n\n if (!Number.isFinite(maxBufferSize) || maxBufferSize <= 0) {\n throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${maxBufferSize}`)\n }\n\n // Convert to lowercase Set for case-insensitive header matching\n const skipHeaderNamesSet = new Set(skipHeaderNames.map(name => name.toLowerCase()))\n\n // Convert to lowercase Set for case-insensitive header exclusion from deduplication key\n const excludeHeaderNamesSet = new Set(excludeHeaderNames.map(name => name.toLowerCase()))\n\n /**\n * Map of pending requests for deduplication\n * @type {Map<string, DeduplicationHandler>}\n */\n const pendingRequests = new Map()\n\n return dispatch => {\n return (opts, handler) => {\n if (!opts.origin || methods.includes(opts.method) === false) {\n return dispatch(opts, handler)\n }\n\n opts = {\n ...opts,\n headers: normalizeHeaders(opts)\n }\n\n // Skip deduplication if request contains any of the specified headers\n if (skipHeaderNamesSet.size > 0) {\n for (const headerName of Object.keys(opts.headers)) {\n if (skipHeaderNamesSet.has(headerName.toLowerCase())) {\n return dispatch(opts, handler)\n }\n }\n }\n\n const cacheKey = makeCacheKey(opts)\n const dedupeKey = makeDeduplicationKey(cacheKey, excludeHeaderNamesSet)\n\n // Check if there's already a pending request for this key\n const pendingHandler = pendingRequests.get(dedupeKey)\n if (pendingHandler) {\n // Add this handler to the waiting list when safe.\n // If body streaming has already started, this request must be sent independently.\n if (pendingHandler.addWaitingHandler(handler)) {\n return true\n }\n\n return dispatch(opts, handler)\n }\n\n // Create a new deduplication handler\n const deduplicationHandler = new DeduplicationHandler(\n handler,\n () => {\n // Clean up when request completes\n pendingRequests.delete(dedupeKey)\n if (pendingRequestsChannel.hasSubscribers) {\n pendingRequestsChannel.publish({ size: pendingRequests.size, key: dedupeKey, type: 'removed' })\n }\n },\n maxBufferSize\n )\n\n // Register the pending request\n pendingRequests.set(dedupeKey, deduplicationHandler)\n if (pendingRequestsChannel.hasSubscribers) {\n pendingRequestsChannel.publish({ size: pendingRequests.size, key: dedupeKey, type: 'added' })\n }\n\n return dispatch(opts, deduplicationHandler)\n }\n }\n}\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst { assertCacheKey, assertCacheValue } = require('../util/cache.js')\n\nlet DatabaseSync\n\nconst VERSION = 3\n\n// 2gb\nconst MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000\n\n/**\n * @typedef {import('../../types/cache-interceptor.d.ts').default.CacheStore} CacheStore\n * @implements {CacheStore}\n *\n * @typedef {{\n * id: Readonly<number>,\n * body?: Uint8Array\n * statusCode: number\n * statusMessage: string\n * headers?: string\n * vary?: string\n * etag?: string\n * cacheControlDirectives?: string\n * cachedAt: number\n * staleAt: number\n * deleteAt: number\n * }} SqliteStoreValue\n */\nmodule.exports = class SqliteCacheStore {\n #maxEntrySize = MAX_ENTRY_SIZE\n #maxCount = Infinity\n\n /**\n * @type {import('node:sqlite').DatabaseSync}\n */\n #db\n\n /**\n * @type {import('node:sqlite').StatementSync}\n */\n #getValuesQuery\n\n /**\n * @type {import('node:sqlite').StatementSync}\n */\n #updateValueQuery\n\n /**\n * @type {import('node:sqlite').StatementSync}\n */\n #insertValueQuery\n\n /**\n * @type {import('node:sqlite').StatementSync}\n */\n #deleteExpiredValuesQuery\n\n /**\n * @type {import('node:sqlite').StatementSync}\n */\n #deleteByUrlQuery\n\n /**\n * @type {import('node:sqlite').StatementSync}\n */\n #countEntriesQuery\n\n /**\n * @type {import('node:sqlite').StatementSync | null}\n */\n #deleteOldValuesQuery\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.SqliteCacheStoreOpts | undefined} opts\n */\n constructor (opts) {\n if (opts) {\n if (typeof opts !== 'object') {\n throw new TypeError('SqliteCacheStore options must be an object')\n }\n\n if (opts.maxEntrySize !== undefined) {\n if (\n typeof opts.maxEntrySize !== 'number' ||\n !Number.isInteger(opts.maxEntrySize) ||\n opts.maxEntrySize < 0\n ) {\n throw new TypeError('SqliteCacheStore options.maxEntrySize must be a non-negative integer')\n }\n\n if (opts.maxEntrySize > MAX_ENTRY_SIZE) {\n throw new TypeError('SqliteCacheStore options.maxEntrySize must be less than 2gb')\n }\n\n this.#maxEntrySize = opts.maxEntrySize\n }\n\n if (opts.maxCount !== undefined) {\n if (\n typeof opts.maxCount !== 'number' ||\n !Number.isInteger(opts.maxCount) ||\n opts.maxCount < 0\n ) {\n throw new TypeError('SqliteCacheStore options.maxCount must be a non-negative integer')\n }\n this.#maxCount = opts.maxCount\n }\n }\n\n if (!DatabaseSync) {\n DatabaseSync = require('node:sqlite').DatabaseSync\n }\n this.#db = new DatabaseSync(opts?.location ?? ':memory:')\n\n this.#db.exec(`\n PRAGMA journal_mode = WAL;\n PRAGMA synchronous = NORMAL;\n PRAGMA temp_store = memory;\n PRAGMA optimize;\n\n CREATE TABLE IF NOT EXISTS cacheInterceptorV${VERSION} (\n -- Data specific to us\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n url TEXT NOT NULL,\n method TEXT NOT NULL,\n\n -- Data returned to the interceptor\n body BUF NULL,\n deleteAt INTEGER NOT NULL,\n statusCode INTEGER NOT NULL,\n statusMessage TEXT NOT NULL,\n headers TEXT NULL,\n cacheControlDirectives TEXT NULL,\n etag TEXT NULL,\n vary TEXT NULL,\n cachedAt INTEGER NOT NULL,\n staleAt INTEGER NOT NULL\n );\n\n CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_getValuesQuery ON cacheInterceptorV${VERSION}(url, method, deleteAt);\n CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_deleteByUrlQuery ON cacheInterceptorV${VERSION}(deleteAt);\n `)\n\n this.#getValuesQuery = this.#db.prepare(`\n SELECT\n id,\n body,\n deleteAt,\n statusCode,\n statusMessage,\n headers,\n etag,\n cacheControlDirectives,\n vary,\n cachedAt,\n staleAt\n FROM cacheInterceptorV${VERSION}\n WHERE\n url = ?\n AND method = ?\n ORDER BY\n deleteAt ASC\n `)\n\n this.#updateValueQuery = this.#db.prepare(`\n UPDATE cacheInterceptorV${VERSION} SET\n body = ?,\n deleteAt = ?,\n statusCode = ?,\n statusMessage = ?,\n headers = ?,\n etag = ?,\n cacheControlDirectives = ?,\n cachedAt = ?,\n staleAt = ?\n WHERE\n id = ?\n `)\n\n this.#insertValueQuery = this.#db.prepare(`\n INSERT INTO cacheInterceptorV${VERSION} (\n url,\n method,\n body,\n deleteAt,\n statusCode,\n statusMessage,\n headers,\n etag,\n cacheControlDirectives,\n vary,\n cachedAt,\n staleAt\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n `)\n\n this.#deleteByUrlQuery = this.#db.prepare(\n `DELETE FROM cacheInterceptorV${VERSION} WHERE url = ?`\n )\n\n this.#countEntriesQuery = this.#db.prepare(\n `SELECT COUNT(*) AS total FROM cacheInterceptorV${VERSION}`\n )\n\n this.#deleteExpiredValuesQuery = this.#db.prepare(\n `DELETE FROM cacheInterceptorV${VERSION} WHERE deleteAt <= ?`\n )\n\n this.#deleteOldValuesQuery = this.#maxCount === Infinity\n ? null\n : this.#db.prepare(`\n DELETE FROM cacheInterceptorV${VERSION}\n WHERE id IN (\n SELECT\n id\n FROM cacheInterceptorV${VERSION}\n ORDER BY cachedAt ASC\n LIMIT ?\n )\n `)\n }\n\n close () {\n this.#db.close()\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n * @returns {(import('../../types/cache-interceptor.d.ts').default.GetResult & { body?: Buffer }) | undefined}\n */\n get (key) {\n assertCacheKey(key)\n\n const value = this.#findValue(key)\n return value\n ? {\n body: value.body ? Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength) : undefined,\n statusCode: value.statusCode,\n statusMessage: value.statusMessage,\n headers: value.headers ? JSON.parse(value.headers) : undefined,\n etag: value.etag ? value.etag : undefined,\n vary: value.vary ? JSON.parse(value.vary) : undefined,\n cacheControlDirectives: value.cacheControlDirectives\n ? JSON.parse(value.cacheControlDirectives)\n : undefined,\n cachedAt: value.cachedAt,\n staleAt: value.staleAt,\n deleteAt: value.deleteAt\n }\n : undefined\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue & { body: null | Buffer | Array<Buffer>}} value\n */\n set (key, value) {\n assertCacheKey(key)\n\n const url = this.#makeValueUrl(key)\n const body = Array.isArray(value.body) ? Buffer.concat(value.body) : value.body\n const size = body?.byteLength\n\n if (size && size > this.#maxEntrySize) {\n return\n }\n\n const existingValue = this.#findValue(key, true)\n if (existingValue) {\n // Updating an existing response, let's overwrite it\n this.#updateValueQuery.run(\n body,\n value.deleteAt,\n value.statusCode,\n value.statusMessage,\n value.headers ? JSON.stringify(value.headers) : null,\n value.etag ? value.etag : null,\n value.cacheControlDirectives ? JSON.stringify(value.cacheControlDirectives) : null,\n value.cachedAt,\n value.staleAt,\n existingValue.id\n )\n } else {\n // New response, let's insert it\n this.#insertValueQuery.run(\n url,\n key.method,\n body,\n value.deleteAt,\n value.statusCode,\n value.statusMessage,\n value.headers ? JSON.stringify(value.headers) : null,\n value.etag ? value.etag : null,\n value.cacheControlDirectives ? JSON.stringify(value.cacheControlDirectives) : null,\n value.vary ? JSON.stringify(value.vary) : null,\n value.cachedAt,\n value.staleAt\n )\n this.#prune()\n }\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue} value\n * @returns {Writable | undefined}\n */\n createWriteStream (key, value) {\n assertCacheKey(key)\n assertCacheValue(value)\n\n let size = 0\n /**\n * @type {Buffer[] | null}\n */\n const body = []\n const store = this\n\n return new Writable({\n decodeStrings: true,\n write (chunk, encoding, callback) {\n size += chunk.byteLength\n\n if (size < store.#maxEntrySize) {\n body.push(chunk)\n } else {\n this.destroy()\n }\n\n callback()\n },\n final (callback) {\n store.set(key, { ...value, body })\n callback()\n }\n })\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n */\n delete (key) {\n if (typeof key !== 'object') {\n throw new TypeError(`expected key to be object, got ${typeof key}`)\n }\n\n this.#deleteByUrlQuery.run(this.#makeValueUrl(key))\n }\n\n #prune () {\n if (Number.isFinite(this.#maxCount) && this.size <= this.#maxCount) {\n return 0\n }\n\n {\n const removed = this.#deleteExpiredValuesQuery.run(Date.now()).changes\n if (removed) {\n return removed\n }\n }\n\n {\n const removed = this.#deleteOldValuesQuery?.run(Math.max(Math.floor(this.#maxCount * 0.1), 1)).changes\n if (removed) {\n return removed\n }\n }\n\n return 0\n }\n\n /**\n * Counts the number of rows in the cache\n * @returns {Number}\n */\n get size () {\n const { total } = this.#countEntriesQuery.get()\n return total\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n * @returns {string}\n */\n #makeValueUrl (key) {\n return `${key.origin}/${key.path}`\n }\n\n /**\n * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key\n * @param {boolean} [canBeExpired=false]\n * @returns {SqliteStoreValue | undefined}\n */\n #findValue (key, canBeExpired = false) {\n const url = this.#makeValueUrl(key)\n const { headers, method } = key\n\n /**\n * @type {SqliteStoreValue[]}\n */\n const values = this.#getValuesQuery.all(url, method)\n\n if (values.length === 0) {\n return undefined\n }\n\n const now = Date.now()\n for (const value of values) {\n if (now >= value.deleteAt && !canBeExpired) {\n continue\n }\n\n let matches = true\n\n if (value.vary) {\n const vary = JSON.parse(value.vary)\n\n for (const header in vary) {\n if (!headerValueEquals(headers[header], vary[header])) {\n matches = false\n break\n }\n }\n }\n\n if (matches) {\n return value\n }\n }\n\n return undefined\n }\n}\n\n/**\n * @param {string|string[]|null|undefined} lhs\n * @param {string|string[]|null|undefined} rhs\n * @returns {boolean}\n */\nfunction headerValueEquals (lhs, rhs) {\n if (lhs == null && rhs == null) {\n return true\n }\n\n if ((lhs == null && rhs != null) ||\n (lhs != null && rhs == null)) {\n return false\n }\n\n if (Array.isArray(lhs) && Array.isArray(rhs)) {\n if (lhs.length !== rhs.length) {\n return false\n }\n\n for (let i = 0; i < lhs.length; i++) {\n if (lhs[i] !== rhs[i]) {\n return false\n }\n }\n\n return true\n }\n\n return lhs === rhs\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n iteratorMixin,\n isValidHeaderName,\n isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('../webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\n/**\n * @param {number} code\n * @returns {code is (0x0a | 0x0d | 0x09 | 0x20)}\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n return code === 0x0a || code === 0x0d || code === 0x09 || code === 0x20\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n * @returns {string}\n */\nfunction headerValueNormalize (potentialValue) {\n // To normalize a byte sequence potentialValue, remove\n // any leading and trailing HTTP whitespace bytes from\n // potentialValue.\n let i = 0; let j = potentialValue.length\n\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\n/**\n * @param {Headers} headers\n * @param {Array|Object} object\n */\nfunction fill (headers, object) {\n // To fill a Headers object headers with a given object object, run these steps:\n\n // 1. If object is a sequence, then for each header in object:\n // Note: webidl conversion to array has already been done.\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; ++i) {\n const header = object[i]\n // 1. If header does not contain exactly two items, then throw a TypeError.\n if (header.length !== 2) {\n throw webidl.errors.exception({\n header: 'Headers constructor',\n message: `expected name/value pair to be length 2, found ${header.length}.`\n })\n }\n\n // 2. Append (header’s first item, header’s second item) to headers.\n appendHeader(headers, header[0], header[1])\n }\n } else if (typeof object === 'object' && object !== null) {\n // Note: null should throw\n\n // 2. Otherwise, object is a record, then for each key → value in object,\n // append (key, value) to headers\n const keys = Object.keys(object)\n for (let i = 0; i < keys.length; ++i) {\n appendHeader(headers, keys[i], object[keys[i]])\n }\n } else {\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']\n })\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n * @param {Headers} headers\n * @param {string} name\n * @param {string} value\n */\nfunction appendHeader (headers, name, value) {\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value,\n type: 'header value'\n })\n }\n\n // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if headers’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n // TODO\n // Note: undici does not implement forbidden header names\n if (getHeadersGuard(headers) === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 6. Otherwise, if headers’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n\n // 7. Append (name, value) to headers’s header list.\n return getHeadersList(headers).append(name, value, false)\n\n // 8. If headers’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from headers\n}\n\n// https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n/**\n * @param {Headers} target\n */\nfunction headersListSortAndCombine (target) {\n const headersList = getHeadersList(target)\n\n if (!headersList) {\n return []\n }\n\n if (headersList.sortedMap) {\n return headersList.sortedMap\n }\n\n // 1. Let headers be an empty list of headers with the key being the name\n // and value the value.\n const headers = []\n\n // 2. Let names be the result of convert header names to a sorted-lowercase\n // set with all the names of the headers in list.\n const names = headersList.toSortedArray()\n\n const cookies = headersList.cookies\n\n // fast-path\n if (cookies === null || cookies.length === 1) {\n // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n return (headersList.sortedMap = names)\n }\n\n // 3. For each name of names:\n for (let i = 0; i < names.length; ++i) {\n const { 0: name, 1: value } = names[i]\n // 1. If name is `set-cookie`, then:\n if (name === 'set-cookie') {\n // 1. Let values be a list of all values of headers in list whose name\n // is a byte-case-insensitive match for name, in order.\n\n // 2. For each value of values:\n // 1. Append (name, value) to headers.\n for (let j = 0; j < cookies.length; ++j) {\n headers.push([name, cookies[j]])\n }\n } else {\n // 2. Otherwise:\n\n // 1. Let value be the result of getting name from list.\n\n // 2. Assert: value is non-null.\n // Note: This operation was done by `HeadersList#toSortedArray`.\n\n // 3. Append (name, value) to headers.\n headers.push([name, value])\n }\n }\n\n // 4. Return headers.\n return (headersList.sortedMap = headers)\n}\n\nfunction compareHeaderName (a, b) {\n return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n /** @type {[string, string][]|null} */\n cookies = null\n\n sortedMap\n headersMap\n\n constructor (init) {\n if (init instanceof HeadersList) {\n this.headersMap = new Map(init.headersMap)\n this.sortedMap = init.sortedMap\n this.cookies = init.cookies === null ? null : [...init.cookies]\n } else {\n this.headersMap = new Map(init)\n this.sortedMap = null\n }\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#header-list-contains\n * @param {string} name\n * @param {boolean} isLowerCase\n */\n contains (name, isLowerCase) {\n // A header list list contains a header name name if list\n // contains a header whose name is a byte-case-insensitive\n // match for name.\n\n return this.headersMap.has(isLowerCase ? name : name.toLowerCase())\n }\n\n clear () {\n this.headersMap.clear()\n this.sortedMap = null\n this.cookies = null\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n * @param {string} name\n * @param {string} value\n * @param {boolean} isLowerCase\n */\n append (name, value, isLowerCase) {\n this.sortedMap = null\n\n // 1. If list contains name, then set name to the first such\n // header’s name.\n const lowercaseName = isLowerCase ? name : name.toLowerCase()\n const exists = this.headersMap.get(lowercaseName)\n\n // 2. Append (name, value) to list.\n if (exists) {\n const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n this.headersMap.set(lowercaseName, {\n name: exists.name,\n value: `${exists.value}${delimiter}${value}`\n })\n } else {\n this.headersMap.set(lowercaseName, { name, value })\n }\n\n if (lowercaseName === 'set-cookie') {\n (this.cookies ??= []).push(value)\n }\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n * @param {string} name\n * @param {string} value\n * @param {boolean} isLowerCase\n */\n set (name, value, isLowerCase) {\n this.sortedMap = null\n const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n if (lowercaseName === 'set-cookie') {\n this.cookies = [value]\n }\n\n // 1. If list contains name, then set the value of\n // the first such header to value and remove the\n // others.\n // 2. Otherwise, append header (name, value) to list.\n this.headersMap.set(lowercaseName, { name, value })\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n * @param {string} name\n * @param {boolean} isLowerCase\n */\n delete (name, isLowerCase) {\n this.sortedMap = null\n if (!isLowerCase) name = name.toLowerCase()\n\n if (name === 'set-cookie') {\n this.cookies = null\n }\n\n this.headersMap.delete(name)\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n * @param {string} name\n * @param {boolean} isLowerCase\n * @returns {string | null}\n */\n get (name, isLowerCase) {\n // 1. If list does not contain name, then return null.\n // 2. Return the values of all headers in list whose name\n // is a byte-case-insensitive match for name,\n // separated from each other by 0x2C 0x20, in order.\n return this.headersMap.get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n }\n\n * [Symbol.iterator] () {\n // use the lowercased name\n for (const { 0: name, 1: { value } } of this.headersMap) {\n yield [name, value]\n }\n }\n\n get entries () {\n const headers = {}\n\n if (this.headersMap.size !== 0) {\n for (const { name, value } of this.headersMap.values()) {\n headers[name] = value\n }\n }\n\n return headers\n }\n\n rawValues () {\n return this.headersMap.values()\n }\n\n get entriesList () {\n const headers = []\n\n if (this.headersMap.size !== 0) {\n for (const { 0: lowerName, 1: { name, value } } of this.headersMap) {\n if (lowerName === 'set-cookie') {\n for (const cookie of this.cookies) {\n headers.push([name, cookie])\n }\n } else {\n headers.push([name, value])\n }\n }\n }\n\n return headers\n }\n\n // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n toSortedArray () {\n const size = this.headersMap.size\n const array = new Array(size)\n // In most cases, you will use the fast-path.\n // fast-path: Use binary insertion sort for small arrays.\n if (size <= 32) {\n if (size === 0) {\n // If empty, it is an empty array. To avoid the first index assignment.\n return array\n }\n // Improve performance by unrolling loop and avoiding double-loop.\n // Double-loop-less version of the binary insertion sort.\n const iterator = this.headersMap[Symbol.iterator]()\n const firstValue = iterator.next().value\n // set [name, value] to first index.\n array[0] = [firstValue[0], firstValue[1].value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(firstValue[1].value !== null)\n for (\n let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n i < size;\n ++i\n ) {\n // get next value\n value = iterator.next().value\n // set [name, value] to current index.\n x = array[i] = [value[0], value[1].value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(x[1] !== null)\n left = 0\n right = i\n // binary search\n while (left < right) {\n // middle index\n pivot = left + ((right - left) >> 1)\n // compare header name\n if (array[pivot][0] <= x[0]) {\n left = pivot + 1\n } else {\n right = pivot\n }\n }\n if (i !== pivot) {\n j = i\n while (j > left) {\n array[j] = array[--j]\n }\n array[left] = x\n }\n }\n /* c8 ignore next 4 */\n if (!iterator.next().done) {\n // This is for debugging and will never be called.\n throw new TypeError('Unreachable')\n }\n return array\n } else {\n // This case would be a rare occurrence.\n // slow-path: fallback\n let i = 0\n for (const { 0: name, 1: { value } } of this.headersMap) {\n array[i++] = [name, value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(value !== null)\n }\n return array.sort(compareHeaderName)\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n #guard\n /**\n * @type {HeadersList}\n */\n #headersList\n\n /**\n * @param {HeadersInit|Symbol} [init]\n * @returns\n */\n constructor (init = undefined) {\n webidl.util.markAsUncloneable(this)\n\n if (init === kConstruct) {\n return\n }\n\n this.#headersList = new HeadersList()\n\n // The new Headers(init) constructor steps are:\n\n // 1. Set this’s guard to \"none\".\n this.#guard = 'none'\n\n // 2. If init is given, then fill this with init.\n if (init !== undefined) {\n init = webidl.converters.HeadersInit(init, 'Headers constructor', 'init')\n fill(this, init)\n }\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-append\n append (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n const prefix = 'Headers.append'\n name = webidl.converters.ByteString(name, prefix, 'name')\n value = webidl.converters.ByteString(value, prefix, 'value')\n\n return appendHeader(this, name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-delete\n delete (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n const prefix = 'Headers.delete'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.delete',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. If this’s guard is \"immutable\", then throw a TypeError.\n // 3. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n // is not a no-CORS-safelisted request-header name, and\n // name is not a privileged no-CORS request-header name,\n // return.\n // 5. Otherwise, if this’s guard is \"response\" and name is\n // a forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this.#guard === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 6. If this’s header list does not contain name, then\n // return.\n if (!this.#headersList.contains(name, false)) {\n return\n }\n\n // 7. Delete name from this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this.\n this.#headersList.delete(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-get\n get (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n const prefix = 'Headers.get'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return the result of getting name from this’s header\n // list.\n return this.#headersList.get(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-has\n has (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n const prefix = 'Headers.has'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return true if this’s header list contains name;\n // otherwise false.\n return this.#headersList.contains(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-set\n set (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n const prefix = 'Headers.set'\n name = webidl.converters.ByteString(name, prefix, 'name')\n value = webidl.converters.ByteString(value, prefix, 'value')\n\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value,\n type: 'header value'\n })\n }\n\n // 3. If this’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n // name/value is not a no-CORS-safelisted request-header,\n // return.\n // 6. Otherwise, if this’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this.#guard === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 7. Set (name, value) in this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this\n this.#headersList.set(name, value, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n getSetCookie () {\n webidl.brandCheck(this, Headers)\n\n // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n // 2. Return the values of all headers in this’s header list whose name is\n // a byte-case-insensitive match for `Set-Cookie`, in order.\n\n const list = this.#headersList.cookies\n\n if (list) {\n return [...list]\n }\n\n return []\n }\n\n [util.inspect.custom] (depth, options) {\n options.depth ??= depth\n\n return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n }\n\n static getHeadersGuard (o) {\n return o.#guard\n }\n\n static setHeadersGuard (o, guard) {\n o.#guard = guard\n }\n\n /**\n * @param {Headers} o\n */\n static getHeadersList (o) {\n return o.#headersList\n }\n\n /**\n * @param {Headers} target\n * @param {HeadersList} list\n */\n static setHeadersList (target, list) {\n target.#headersList = list\n }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, headersListSortAndCombine, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n getSetCookie: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Headers',\n configurable: true\n },\n [util.inspect.custom]: {\n enumerable: false\n }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {\n const iterator = Reflect.get(V, Symbol.iterator)\n\n // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n try {\n return getHeadersList(V).entriesList\n } catch {\n // fall-through\n }\n }\n\n if (typeof iterator === 'function') {\n return webidl.converters['sequence<sequence<ByteString>>'](V, prefix, argument, iterator.bind(V))\n }\n\n return webidl.converters['record<ByteString, ByteString>'](V, prefix, argument)\n }\n\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']\n })\n}\n\nmodule.exports = {\n fill,\n // for test.\n compareHeaderName,\n Headers,\n HeadersList,\n getHeadersGuard,\n setHeadersGuard,\n setHeadersList,\n getHeadersList\n}\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n isValidReasonPhrase,\n isCancelled,\n isAborted,\n isErrorLike,\n environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n redirectStatusSet,\n nullBodyStatus\n} = require('./constants')\nconst { webidl } = require('../webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { isomorphicEncode, serializeJavascriptValueToJSONString } = require('../infra')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n /** @type {Headers} */\n #headers\n\n #state\n\n // Creates network error Response.\n static error () {\n // The static error() method steps are to return the result of creating a\n // Response object, given a new network error, \"immutable\", and this’s\n // relevant Realm.\n const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response-json\n static json (data, init = undefined) {\n webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n if (init !== null) {\n init = webidl.converters.ResponseInit(init)\n }\n\n // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n const bytes = textEncoder.encode(\n serializeJavascriptValueToJSONString(data)\n )\n\n // 2. Let body be the result of extracting bytes.\n const body = extractBody(bytes)\n\n // 3. Let responseObject be the result of creating a Response object, given a new response,\n // \"response\", and this’s relevant Realm.\n const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n // 5. Return responseObject.\n return responseObject\n }\n\n // Creates a redirect Response that redirects to url with status status.\n static redirect (url, status = 302) {\n webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n url = webidl.converters.USVString(url)\n status = webidl.converters['unsigned short'](status)\n\n // 1. Let parsedURL be the result of parsing url with current settings\n // object’s API base URL.\n // 2. If parsedURL is failure, then throw a TypeError.\n // TODO: base-URL?\n let parsedURL\n try {\n parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n } catch (err) {\n throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n }\n\n // 3. If status is not a redirect status, then throw a RangeError.\n if (!redirectStatusSet.has(status)) {\n throw new RangeError(`Invalid status code ${status}`)\n }\n\n // 4. Let responseObject be the result of creating a Response object,\n // given a new response, \"immutable\", and this’s relevant Realm.\n const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n // 5. Set responseObject’s response’s status to status.\n responseObject.#state.status = status\n\n // 6. Let value be parsedURL, serialized and isomorphic encoded.\n const value = isomorphicEncode(URLSerializer(parsedURL))\n\n // 7. Append `Location`/value to responseObject’s response’s header list.\n responseObject.#state.headersList.append('location', value, true)\n\n // 8. Return responseObject.\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response\n constructor (body = null, init = undefined) {\n webidl.util.markAsUncloneable(this)\n\n if (body === kConstruct) {\n return\n }\n\n if (body !== null) {\n body = webidl.converters.BodyInit(body, 'Response', 'body')\n }\n\n init = webidl.converters.ResponseInit(init)\n\n // 1. Set this’s response to a new response.\n this.#state = makeResponse({})\n\n // 2. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is this’s response’s header list and guard\n // is \"response\".\n this.#headers = new Headers(kConstruct)\n setHeadersGuard(this.#headers, 'response')\n setHeadersList(this.#headers, this.#state.headersList)\n\n // 3. Let bodyWithType be null.\n let bodyWithType = null\n\n // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n if (body != null) {\n const [extractedBody, type] = extractBody(body)\n bodyWithType = { body: extractedBody, type }\n }\n\n // 5. Perform initialize a response given this, init, and bodyWithType.\n initializeResponse(this, init, bodyWithType)\n }\n\n // Returns response’s type, e.g., \"cors\".\n get type () {\n webidl.brandCheck(this, Response)\n\n // The type getter steps are to return this’s response’s type.\n return this.#state.type\n }\n\n // Returns response’s URL, if it has one; otherwise the empty string.\n get url () {\n webidl.brandCheck(this, Response)\n\n const urlList = this.#state.urlList\n\n // The url getter steps are to return the empty string if this’s\n // response’s URL is null; otherwise this’s response’s URL,\n // serialized with exclude fragment set to true.\n const url = urlList[urlList.length - 1] ?? null\n\n if (url === null) {\n return ''\n }\n\n return URLSerializer(url, true)\n }\n\n // Returns whether response was obtained through a redirect.\n get redirected () {\n webidl.brandCheck(this, Response)\n\n // The redirected getter steps are to return true if this’s response’s URL\n // list has more than one item; otherwise false.\n return this.#state.urlList.length > 1\n }\n\n // Returns response’s status.\n get status () {\n webidl.brandCheck(this, Response)\n\n // The status getter steps are to return this’s response’s status.\n return this.#state.status\n }\n\n // Returns whether response’s status is an ok status.\n get ok () {\n webidl.brandCheck(this, Response)\n\n // The ok getter steps are to return true if this’s response’s status is an\n // ok status; otherwise false.\n return this.#state.status >= 200 && this.#state.status <= 299\n }\n\n // Returns response’s status message.\n get statusText () {\n webidl.brandCheck(this, Response)\n\n // The statusText getter steps are to return this’s response’s status\n // message.\n return this.#state.statusText\n }\n\n // Returns response’s headers as Headers.\n get headers () {\n webidl.brandCheck(this, Response)\n\n // The headers getter steps are to return this’s headers.\n return this.#headers\n }\n\n get body () {\n webidl.brandCheck(this, Response)\n\n return this.#state.body ? this.#state.body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Response)\n\n return !!this.#state.body && util.isDisturbed(this.#state.body.stream)\n }\n\n // Returns a clone of response.\n clone () {\n webidl.brandCheck(this, Response)\n\n // 1. If this is unusable, then throw a TypeError.\n if (bodyUnusable(this.#state)) {\n throw webidl.errors.exception({\n header: 'Response.clone',\n message: 'Body has already been consumed.'\n })\n }\n\n // 2. Let clonedResponse be the result of cloning this’s response.\n const clonedResponse = cloneResponse(this.#state)\n\n // Note: To re-register because of a new stream.\n // Don't set finalizers other than for fetch responses.\n if (this.#state.urlList.length !== 0 && this.#state.body?.stream) {\n streamRegistry.register(this, new WeakRef(this.#state.body.stream))\n }\n\n // 3. Return the result of creating a Response object, given\n // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n return fromInnerResponse(clonedResponse, getHeadersGuard(this.#headers))\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n if (options.depth === null) {\n options.depth = 2\n }\n\n options.colors ??= true\n\n const properties = {\n status: this.status,\n statusText: this.statusText,\n headers: this.headers,\n body: this.body,\n bodyUsed: this.bodyUsed,\n ok: this.ok,\n redirected: this.redirected,\n type: this.type,\n url: this.url\n }\n\n return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n }\n\n /**\n * @param {Response} response\n */\n static getResponseHeaders (response) {\n return response.#headers\n }\n\n /**\n * @param {Response} response\n * @param {Headers} newHeaders\n */\n static setResponseHeaders (response, newHeaders) {\n response.#headers = newHeaders\n }\n\n /**\n * @param {Response} response\n */\n static getResponseState (response) {\n return response.#state\n }\n\n /**\n * @param {Response} response\n * @param {any} newState\n */\n static setResponseState (response, newState) {\n response.#state = newState\n }\n}\n\nconst { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response\nReflect.deleteProperty(Response, 'getResponseHeaders')\nReflect.deleteProperty(Response, 'setResponseHeaders')\nReflect.deleteProperty(Response, 'getResponseState')\nReflect.deleteProperty(Response, 'setResponseState')\n\nmixinBody(Response, getResponseState)\n\nObject.defineProperties(Response.prototype, {\n type: kEnumerableProperty,\n url: kEnumerableProperty,\n status: kEnumerableProperty,\n ok: kEnumerableProperty,\n redirected: kEnumerableProperty,\n statusText: kEnumerableProperty,\n headers: kEnumerableProperty,\n clone: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Response',\n configurable: true\n }\n})\n\nObject.defineProperties(Response, {\n json: kEnumerableProperty,\n redirect: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n // To clone a response response, run these steps:\n\n // 1. If response is a filtered response, then return a new identical\n // filtered response whose internal response is a clone of response’s\n // internal response.\n if (response.internalResponse) {\n return filterResponse(\n cloneResponse(response.internalResponse),\n response.type\n )\n }\n\n // 2. Let newResponse be a copy of response, except for its body.\n const newResponse = makeResponse({ ...response, body: null })\n\n // 3. If response’s body is non-null, then set newResponse’s body to the\n // result of cloning response’s body.\n if (response.body != null) {\n newResponse.body = cloneBody(response.body)\n }\n\n // 4. Return newResponse.\n return newResponse\n}\n\nfunction makeResponse (init) {\n return {\n aborted: false,\n rangeRequested: false,\n timingAllowPassed: false,\n requestIncludesCredentials: false,\n type: 'default',\n status: 200,\n timingInfo: null,\n cacheState: '',\n statusText: '',\n ...init,\n headersList: init?.headersList\n ? new HeadersList(init?.headersList)\n : new HeadersList(),\n urlList: init?.urlList ? [...init.urlList] : []\n }\n}\n\nfunction makeNetworkError (reason) {\n const isError = isErrorLike(reason)\n return makeResponse({\n type: 'error',\n status: 0,\n error: isError\n ? reason\n : new Error(reason ? String(reason) : reason),\n aborted: reason && reason.name === 'AbortError'\n })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n return (\n // A network error is a response whose type is \"error\",\n response.type === 'error' &&\n // status is 0\n response.status === 0\n )\n}\n\nfunction makeFilteredResponse (response, state) {\n state = {\n internalResponse: response,\n ...state\n }\n\n return new Proxy(response, {\n get (target, p) {\n return p in state ? state[p] : target[p]\n },\n set (target, p, value) {\n assert(!(p in state))\n target[p] = value\n return true\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (type === 'basic') {\n // A basic filtered response is a filtered response whose type is \"basic\"\n // and header list excludes any headers in internal response’s header list\n // whose name is a forbidden response-header name.\n\n // Note: undici does not implement forbidden response-header names\n return makeFilteredResponse(response, {\n type: 'basic',\n headersList: response.headersList\n })\n } else if (type === 'cors') {\n // A CORS filtered response is a filtered response whose type is \"cors\"\n // and header list excludes any headers in internal response’s header\n // list whose name is not a CORS-safelisted response-header name, given\n // internal response’s CORS-exposed header-name list.\n\n // Note: undici does not implement CORS-safelisted response-header names\n return makeFilteredResponse(response, {\n type: 'cors',\n headersList: response.headersList\n })\n } else if (type === 'opaque') {\n // An opaque filtered response is a filtered response whose type is\n // \"opaque\", URL list is the empty list, status is 0, status message\n // is the empty byte sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaque',\n urlList: [],\n status: 0,\n statusText: '',\n body: null\n })\n } else if (type === 'opaqueredirect') {\n // An opaque-redirect filtered response is a filtered response whose type\n // is \"opaqueredirect\", status is 0, status message is the empty byte\n // sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaqueredirect',\n status: 0,\n statusText: '',\n headersList: [],\n body: null\n })\n } else {\n assert(false)\n }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n // 1. Assert: fetchParams is canceled.\n assert(isCancelled(fetchParams))\n\n // 2. Return an aborted network error if fetchParams is aborted;\n // otherwise return a network error.\n return isAborted(fetchParams)\n ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n // throw a RangeError.\n if (init.status !== null && (init.status < 200 || init.status > 599)) {\n throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n }\n\n // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n // then throw a TypeError.\n if ('statusText' in init && init.statusText != null) {\n // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n // reason-phrase = *( HTAB / SP / VCHAR / obs-text )\n if (!isValidReasonPhrase(String(init.statusText))) {\n throw new TypeError('Invalid statusText')\n }\n }\n\n // 3. Set response’s response’s status to init[\"status\"].\n if ('status' in init && init.status != null) {\n getResponseState(response).status = init.status\n }\n\n // 4. Set response’s response’s status message to init[\"statusText\"].\n if ('statusText' in init && init.statusText != null) {\n getResponseState(response).statusText = init.statusText\n }\n\n // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n if ('headers' in init && init.headers != null) {\n fill(getResponseHeaders(response), init.headers)\n }\n\n // 6. If body was given, then:\n if (body) {\n // 1. If response's status is a null body status, then throw a TypeError.\n if (nullBodyStatus.includes(response.status)) {\n throw webidl.errors.exception({\n header: 'Response constructor',\n message: `Invalid response status code ${response.status}`\n })\n }\n\n // 2. Set response's body to body's body.\n getResponseState(response).body = body.body\n\n // 3. If body's type is non-null and response's header list does not contain\n // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n if (body.type != null && !getResponseState(response).headersList.contains('content-type', true)) {\n getResponseState(response).headersList.append('content-type', body.type, true)\n }\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n const response = new Response(kConstruct)\n setResponseState(response, innerResponse)\n const headers = new Headers(kConstruct)\n setResponseHeaders(response, headers)\n setHeadersList(headers, innerResponse.headersList)\n setHeadersGuard(headers, guard)\n\n // Note: If innerResponse's urlList contains a URL, it is a fetch response.\n if (innerResponse.urlList.length !== 0 && innerResponse.body?.stream) {\n // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n }\n\n return response\n}\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V, prefix, name)\n }\n\n if (webidl.is.Blob(V)) {\n return V\n }\n\n if (webidl.is.BufferSource(V)) {\n return V\n }\n\n if (webidl.is.FormData(V)) {\n return V\n }\n\n if (webidl.is.URLSearchParams(V)) {\n return V\n }\n\n return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n if (webidl.is.ReadableStream(V)) {\n return V\n }\n\n // Note: the spec doesn't include async iterables,\n // this is an undici extension.\n if (V?.[Symbol.asyncIterator]) {\n return V\n }\n\n return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n {\n key: 'status',\n converter: webidl.converters['unsigned short'],\n defaultValue: () => 200\n },\n {\n key: 'statusText',\n converter: webidl.converters.ByteString,\n defaultValue: () => ''\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n }\n])\n\nwebidl.is.Response = webidl.util.MakeTypeAssertion(Response)\n\nmodule.exports = {\n isNetworkError,\n makeNetworkError,\n makeResponse,\n makeAppropriateNetworkError,\n filterResponse,\n Response,\n cloneResponse,\n fromInnerResponse,\n getResponseState\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n isValidHTTPToken,\n sameOrigin,\n environmentSettingsObject\n} = require('./util')\nconst {\n forbiddenMethodsSet,\n corsSafeListedMethodsSet,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { webidl } = require('../webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nlet abortSignalHasEventHandlerLeakWarning\n\ntry {\n abortSignalHasEventHandlerLeakWarning = getMaxListeners(new AbortController().signal) > 0\n} catch {\n abortSignalHasEventHandlerLeakWarning = false\n}\n\nfunction buildAbort (acRef) {\n return abort\n\n function abort () {\n const ac = acRef.deref()\n if (ac !== undefined) {\n // Currently, there is a problem with FinalizationRegistry.\n // https://github.com/nodejs/node/issues/49344\n // https://github.com/nodejs/node/issues/47748\n // In the case of abort, the first step is to unregister from it.\n // If the controller can refer to it, it is still registered.\n // It will be removed in the future.\n requestFinalizer.unregister(abort)\n\n // Unsubscribe a listener.\n // FinalizationRegistry will no longer be called, so this must be done.\n this.removeEventListener('abort', abort)\n\n ac.abort(this.reason)\n\n const controllerList = dependentControllerMap.get(ac.signal)\n\n if (controllerList !== undefined) {\n if (controllerList.size !== 0) {\n for (const ref of controllerList) {\n const ctrl = ref.deref()\n if (ctrl !== undefined) {\n ctrl.abort(this.reason)\n }\n }\n controllerList.clear()\n }\n dependentControllerMap.delete(ac.signal)\n }\n }\n }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n /** @type {AbortSignal} */\n #signal\n\n /** @type {import('../../dispatcher/dispatcher')} */\n #dispatcher\n\n /** @type {Headers} */\n #headers\n\n #state\n\n // https://fetch.spec.whatwg.org/#dom-request\n constructor (input, init = undefined) {\n webidl.util.markAsUncloneable(this)\n\n if (input === kConstruct) {\n return\n }\n\n const prefix = 'Request constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n input = webidl.converters.RequestInfo(input)\n init = webidl.converters.RequestInit(init)\n\n // 1. Let request be null.\n let request = null\n\n // 2. Let fallbackMode be null.\n let fallbackMode = null\n\n // 3. Let baseURL be this’s relevant settings object’s API base URL.\n const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n // 4. Let signal be null.\n let signal = null\n\n // 5. If input is a string, then:\n if (typeof input === 'string') {\n this.#dispatcher = init.dispatcher\n\n // 1. Let parsedURL be the result of parsing input with baseURL.\n // 2. If parsedURL is failure, then throw a TypeError.\n let parsedURL\n try {\n parsedURL = new URL(input, baseUrl)\n } catch (err) {\n throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n }\n\n // 3. If parsedURL includes credentials, then throw a TypeError.\n if (parsedURL.username || parsedURL.password) {\n throw new TypeError(\n 'Request cannot be constructed from a URL that includes credentials: ' +\n input\n )\n }\n\n // 4. Set request to a new request whose URL is parsedURL.\n request = makeRequest({ urlList: [parsedURL] })\n\n // 5. Set fallbackMode to \"cors\".\n fallbackMode = 'cors'\n } else {\n // 6. Otherwise:\n\n // 7. Assert: input is a Request object.\n assert(webidl.is.Request(input))\n\n // 8. Set request to input’s request.\n request = input.#state\n\n // 9. Set signal to input’s signal.\n signal = input.#signal\n\n this.#dispatcher = init.dispatcher || input.#dispatcher\n }\n\n // 7. Let origin be this’s relevant settings object’s origin.\n const origin = environmentSettingsObject.settingsObject.origin\n\n // 8. Let window be \"client\".\n let window = 'client'\n\n // 9. If request’s window is an environment settings object and its origin\n // is same origin with origin, then set window to request’s window.\n if (\n request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n sameOrigin(request.window, origin)\n ) {\n window = request.window\n }\n\n // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n if (init.window != null) {\n throw new TypeError(`'window' option '${window}' must be null`)\n }\n\n // 11. If init[\"window\"] exists, then set window to \"no-window\".\n if ('window' in init) {\n window = 'no-window'\n }\n\n // 12. Set request to a new request with the following properties:\n request = makeRequest({\n // URL request’s URL.\n // undici implementation note: this is set as the first item in request's urlList in makeRequest\n // method request’s method.\n method: request.method,\n // header list A copy of request’s header list.\n // undici implementation note: headersList is cloned in makeRequest\n headersList: request.headersList,\n // unsafe-request flag Set.\n unsafeRequest: request.unsafeRequest,\n // client This’s relevant settings object.\n client: environmentSettingsObject.settingsObject,\n // window window.\n window,\n // priority request’s priority.\n priority: request.priority,\n // origin request’s origin. The propagation of the origin is only significant for navigation requests\n // being handled by a service worker. In this scenario a request can have an origin that is different\n // from the current client.\n origin: request.origin,\n // referrer request’s referrer.\n referrer: request.referrer,\n // referrer policy request’s referrer policy.\n referrerPolicy: request.referrerPolicy,\n // mode request’s mode.\n mode: request.mode,\n // credentials mode request’s credentials mode.\n credentials: request.credentials,\n // cache mode request’s cache mode.\n cache: request.cache,\n // redirect mode request’s redirect mode.\n redirect: request.redirect,\n // integrity metadata request’s integrity metadata.\n integrity: request.integrity,\n // keepalive request’s keepalive.\n keepalive: request.keepalive,\n // reload-navigation flag request’s reload-navigation flag.\n reloadNavigation: request.reloadNavigation,\n // history-navigation flag request’s history-navigation flag.\n historyNavigation: request.historyNavigation,\n // URL list A clone of request’s URL list.\n urlList: [...request.urlList]\n })\n\n const initHasKey = Object.keys(init).length !== 0\n\n // 13. If init is not empty, then:\n if (initHasKey) {\n // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n if (request.mode === 'navigate') {\n request.mode = 'same-origin'\n }\n\n // 2. Unset request’s reload-navigation flag.\n request.reloadNavigation = false\n\n // 3. Unset request’s history-navigation flag.\n request.historyNavigation = false\n\n // 4. Set request’s origin to \"client\".\n request.origin = 'client'\n\n // 5. Set request’s referrer to \"client\"\n request.referrer = 'client'\n\n // 6. Set request’s referrer policy to the empty string.\n request.referrerPolicy = ''\n\n // 7. Set request’s URL to request’s current URL.\n request.url = request.urlList[request.urlList.length - 1]\n\n // 8. Set request’s URL list to « request’s URL ».\n request.urlList = [request.url]\n }\n\n // 14. If init[\"referrer\"] exists, then:\n if (init.referrer !== undefined) {\n // 1. Let referrer be init[\"referrer\"].\n const referrer = init.referrer\n\n // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n if (referrer === '') {\n request.referrer = 'no-referrer'\n } else {\n // 1. Let parsedReferrer be the result of parsing referrer with\n // baseURL.\n // 2. If parsedReferrer is failure, then throw a TypeError.\n let parsedReferrer\n try {\n parsedReferrer = new URL(referrer, baseUrl)\n } catch (err) {\n throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n }\n\n // 3. If one of the following is true\n // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n // - parsedReferrer’s origin is not same origin with origin\n // then set request’s referrer to \"client\".\n if (\n (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n ) {\n request.referrer = 'client'\n } else {\n // 4. Otherwise, set request’s referrer to parsedReferrer.\n request.referrer = parsedReferrer\n }\n }\n }\n\n // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n // to it.\n if (init.referrerPolicy !== undefined) {\n request.referrerPolicy = init.referrerPolicy\n }\n\n // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n let mode\n if (init.mode !== undefined) {\n mode = init.mode\n } else {\n mode = fallbackMode\n }\n\n // 17. If mode is \"navigate\", then throw a TypeError.\n if (mode === 'navigate') {\n throw webidl.errors.exception({\n header: 'Request constructor',\n message: 'invalid request mode navigate.'\n })\n }\n\n // 18. If mode is non-null, set request’s mode to mode.\n if (mode != null) {\n request.mode = mode\n }\n\n // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n // to it.\n if (init.credentials !== undefined) {\n request.credentials = init.credentials\n }\n\n // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n if (init.cache !== undefined) {\n request.cache = init.cache\n }\n\n // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n // not \"same-origin\", then throw a TypeError.\n if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n throw new TypeError(\n \"'only-if-cached' can be set only with 'same-origin' mode\"\n )\n }\n\n // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n if (init.redirect !== undefined) {\n request.redirect = init.redirect\n }\n\n // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n if (init.integrity != null) {\n request.integrity = String(init.integrity)\n }\n\n // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n if (init.keepalive !== undefined) {\n request.keepalive = Boolean(init.keepalive)\n }\n\n // 25. If init[\"method\"] exists, then:\n if (init.method !== undefined) {\n // 1. Let method be init[\"method\"].\n let method = init.method\n\n const mayBeNormalized = normalizedMethodRecords[method]\n\n if (mayBeNormalized !== undefined) {\n // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n request.method = mayBeNormalized\n } else {\n // 2. If method is not a method or method is a forbidden method, then\n // throw a TypeError.\n if (!isValidHTTPToken(method)) {\n throw new TypeError(`'${method}' is not a valid HTTP method.`)\n }\n\n const upperCase = method.toUpperCase()\n\n if (forbiddenMethodsSet.has(upperCase)) {\n throw new TypeError(`'${method}' HTTP method is unsupported.`)\n }\n\n // 3. Normalize method.\n // https://fetch.spec.whatwg.org/#concept-method-normalize\n // Note: must be in uppercase\n method = normalizedMethodRecordsBase[upperCase] ?? method\n\n // 4. Set request’s method to method.\n request.method = method\n }\n\n if (!patchMethodWarning && request.method === 'patch') {\n process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n code: 'UNDICI-FETCH-patch'\n })\n\n patchMethodWarning = true\n }\n }\n\n // 26. If init[\"signal\"] exists, then set signal to it.\n if (init.signal !== undefined) {\n signal = init.signal\n }\n\n // 27. Set this’s request to request.\n this.#state = request\n\n // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n // Realm.\n // TODO: could this be simplified with AbortSignal.any\n // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n const ac = new AbortController()\n this.#signal = ac.signal\n\n // 29. If signal is not null, then make this’s signal follow signal.\n if (signal != null) {\n if (signal.aborted) {\n ac.abort(signal.reason)\n } else {\n // Keep a strong ref to ac while request object\n // is alive. This is needed to prevent AbortController\n // from being prematurely garbage collected.\n // See, https://github.com/nodejs/undici/issues/1926.\n this[kAbortController] = ac\n\n const acRef = new WeakRef(ac)\n const abort = buildAbort(acRef)\n\n // If the max amount of listeners is equal to the default, increase it\n if (abortSignalHasEventHandlerLeakWarning && getMaxListeners(signal) === defaultMaxListeners) {\n setMaxListeners(1500, signal)\n }\n\n util.addAbortListener(signal, abort)\n // The third argument must be a registry key to be unregistered.\n // Without it, you cannot unregister.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n // abort is used as the unregister key. (because it is unique)\n requestFinalizer.register(ac, { signal, abort }, abort)\n }\n }\n\n // 30. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is request’s header list and guard is\n // \"request\".\n this.#headers = new Headers(kConstruct)\n setHeadersList(this.#headers, request.headersList)\n setHeadersGuard(this.#headers, 'request')\n\n // 31. If this’s request’s mode is \"no-cors\", then:\n if (mode === 'no-cors') {\n // 1. If this’s request’s method is not a CORS-safelisted method,\n // then throw a TypeError.\n if (!corsSafeListedMethodsSet.has(request.method)) {\n throw new TypeError(\n `'${request.method} is unsupported in no-cors mode.`\n )\n }\n\n // 2. Set this’s headers’s guard to \"request-no-cors\".\n setHeadersGuard(this.#headers, 'request-no-cors')\n }\n\n // 32. If init is not empty, then:\n if (initHasKey) {\n /** @type {HeadersList} */\n const headersList = getHeadersList(this.#headers)\n // 1. Let headers be a copy of this’s headers and its associated header\n // list.\n // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n // 3. Empty this’s headers’s header list.\n headersList.clear()\n\n // 4. If headers is a Headers object, then for each header in its header\n // list, append header’s name/header’s value to this’s headers.\n if (headers instanceof HeadersList) {\n for (const { name, value } of headers.rawValues()) {\n headersList.append(name, value, false)\n }\n // Note: Copy the `set-cookie` meta-data.\n headersList.cookies = headers.cookies\n } else {\n // 5. Otherwise, fill this’s headers with headers.\n fillHeaders(this.#headers, headers)\n }\n }\n\n // 33. Let inputBody be input’s request’s body if input is a Request\n // object; otherwise null.\n const inputBody = webidl.is.Request(input) ? input.#state.body : null\n\n // 34. If either init[\"body\"] exists and is non-null or inputBody is\n // non-null, and request’s method is `GET` or `HEAD`, then throw a\n // TypeError.\n if (\n (init.body != null || inputBody != null) &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n throw new TypeError('Request with GET/HEAD method cannot have body.')\n }\n\n // 35. Let initBody be null.\n let initBody = null\n\n // 36. If init[\"body\"] exists and is non-null, then:\n if (init.body != null) {\n // 1. Let Content-Type be null.\n // 2. Set initBody and Content-Type to the result of extracting\n // init[\"body\"], with keepalive set to request’s keepalive.\n const [extractedBody, contentType] = extractBody(\n init.body,\n request.keepalive\n )\n initBody = extractedBody\n\n // 3, If Content-Type is non-null and this’s headers’s header list does\n // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n // this’s headers.\n if (contentType && !getHeadersList(this.#headers).contains('content-type', true)) {\n this.#headers.append('content-type', contentType, true)\n }\n }\n\n // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n // inputBody.\n const inputOrInitBody = initBody ?? inputBody\n\n // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n // null, then:\n if (inputOrInitBody != null && inputOrInitBody.source == null) {\n // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n // then throw a TypeError.\n if (initBody != null && init.duplex == null) {\n throw new TypeError('RequestInit: duplex option is required when sending a body.')\n }\n\n // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n // then throw a TypeError.\n if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n throw new TypeError(\n 'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n )\n }\n\n // 3. Set this’s request’s use-CORS-preflight flag.\n request.useCORSPreflightFlag = true\n }\n\n // 39. Let finalBody be inputOrInitBody.\n let finalBody = inputOrInitBody\n\n // 40. If initBody is null and inputBody is non-null, then:\n if (initBody == null && inputBody != null) {\n // 1. If input is unusable, then throw a TypeError.\n if (bodyUnusable(input.#state)) {\n throw new TypeError(\n 'Cannot construct a Request with a Request object that has already been used.'\n )\n }\n\n // 2. Set finalBody to the result of creating a proxy for inputBody.\n // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n const identityTransform = new TransformStream()\n inputBody.stream.pipeThrough(identityTransform)\n finalBody = {\n source: inputBody.source,\n length: inputBody.length,\n stream: identityTransform.readable\n }\n }\n\n // 41. Set this’s request’s body to finalBody.\n this.#state.body = finalBody\n }\n\n // Returns request’s HTTP method, which is \"GET\" by default.\n get method () {\n webidl.brandCheck(this, Request)\n\n // The method getter steps are to return this’s request’s method.\n return this.#state.method\n }\n\n // Returns the URL of request as a string.\n get url () {\n webidl.brandCheck(this, Request)\n\n // The url getter steps are to return this’s request’s URL, serialized.\n return URLSerializer(this.#state.url)\n }\n\n // Returns a Headers object consisting of the headers associated with request.\n // Note that headers added in the network layer by the user agent will not\n // be accounted for in this object, e.g., the \"Host\" header.\n get headers () {\n webidl.brandCheck(this, Request)\n\n // The headers getter steps are to return this’s headers.\n return this.#headers\n }\n\n // Returns the kind of resource requested by request, e.g., \"document\"\n // or \"script\".\n get destination () {\n webidl.brandCheck(this, Request)\n\n // The destination getter are to return this’s request’s destination.\n return this.#state.destination\n }\n\n // Returns the referrer of request. Its value can be a same-origin URL if\n // explicitly set in init, the empty string to indicate no referrer, and\n // \"about:client\" when defaulting to the global’s default. This is used\n // during fetching to determine the value of the `Referer` header of the\n // request being made.\n get referrer () {\n webidl.brandCheck(this, Request)\n\n // 1. If this’s request’s referrer is \"no-referrer\", then return the\n // empty string.\n if (this.#state.referrer === 'no-referrer') {\n return ''\n }\n\n // 2. If this’s request’s referrer is \"client\", then return\n // \"about:client\".\n if (this.#state.referrer === 'client') {\n return 'about:client'\n }\n\n // Return this’s request’s referrer, serialized.\n return this.#state.referrer.toString()\n }\n\n // Returns the referrer policy associated with request.\n // This is used during fetching to compute the value of the request’s\n // referrer.\n get referrerPolicy () {\n webidl.brandCheck(this, Request)\n\n // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n return this.#state.referrerPolicy\n }\n\n // Returns the mode associated with request, which is a string indicating\n // whether the request will use CORS, or will be restricted to same-origin\n // URLs.\n get mode () {\n webidl.brandCheck(this, Request)\n\n // The mode getter steps are to return this’s request’s mode.\n return this.#state.mode\n }\n\n // Returns the credentials mode associated with request,\n // which is a string indicating whether credentials will be sent with the\n // request always, never, or only when sent to a same-origin URL.\n get credentials () {\n webidl.brandCheck(this, Request)\n\n // The credentials getter steps are to return this’s request’s credentials mode.\n return this.#state.credentials\n }\n\n // Returns the cache mode associated with request,\n // which is a string indicating how the request will\n // interact with the browser’s cache when fetching.\n get cache () {\n webidl.brandCheck(this, Request)\n\n // The cache getter steps are to return this’s request’s cache mode.\n return this.#state.cache\n }\n\n // Returns the redirect mode associated with request,\n // which is a string indicating how redirects for the\n // request will be handled during fetching. A request\n // will follow redirects by default.\n get redirect () {\n webidl.brandCheck(this, Request)\n\n // The redirect getter steps are to return this’s request’s redirect mode.\n return this.#state.redirect\n }\n\n // Returns request’s subresource integrity metadata, which is a\n // cryptographic hash of the resource being fetched. Its value\n // consists of multiple hashes separated by whitespace. [SRI]\n get integrity () {\n webidl.brandCheck(this, Request)\n\n // The integrity getter steps are to return this’s request’s integrity\n // metadata.\n return this.#state.integrity\n }\n\n // Returns a boolean indicating whether or not request can outlive the\n // global in which it was created.\n get keepalive () {\n webidl.brandCheck(this, Request)\n\n // The keepalive getter steps are to return this’s request’s keepalive.\n return this.#state.keepalive\n }\n\n // Returns a boolean indicating whether or not request is for a reload\n // navigation.\n get isReloadNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isReloadNavigation getter steps are to return true if this’s\n // request’s reload-navigation flag is set; otherwise false.\n return this.#state.reloadNavigation\n }\n\n // Returns a boolean indicating whether or not request is for a history\n // navigation (a.k.a. back-forward navigation).\n get isHistoryNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isHistoryNavigation getter steps are to return true if this’s request’s\n // history-navigation flag is set; otherwise false.\n return this.#state.historyNavigation\n }\n\n // Returns the signal associated with request, which is an AbortSignal\n // object indicating whether or not request has been aborted, and its\n // abort event handler.\n get signal () {\n webidl.brandCheck(this, Request)\n\n // The signal getter steps are to return this’s signal.\n return this.#signal\n }\n\n get body () {\n webidl.brandCheck(this, Request)\n\n return this.#state.body ? this.#state.body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Request)\n\n return !!this.#state.body && util.isDisturbed(this.#state.body.stream)\n }\n\n get duplex () {\n webidl.brandCheck(this, Request)\n\n return 'half'\n }\n\n // Returns a clone of request.\n clone () {\n webidl.brandCheck(this, Request)\n\n // 1. If this is unusable, then throw a TypeError.\n if (bodyUnusable(this.#state)) {\n throw new TypeError('unusable')\n }\n\n // 2. Let clonedRequest be the result of cloning this’s request.\n const clonedRequest = cloneRequest(this.#state)\n\n // 3. Let clonedRequestObject be the result of creating a Request object,\n // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n // 4. Make clonedRequestObject’s signal follow this’s signal.\n const ac = new AbortController()\n if (this.signal.aborted) {\n ac.abort(this.signal.reason)\n } else {\n let list = dependentControllerMap.get(this.signal)\n if (list === undefined) {\n list = new Set()\n dependentControllerMap.set(this.signal, list)\n }\n const acRef = new WeakRef(ac)\n list.add(acRef)\n util.addAbortListener(\n ac.signal,\n buildAbort(acRef)\n )\n }\n\n // 4. Return clonedRequestObject.\n return fromInnerRequest(clonedRequest, this.#dispatcher, ac.signal, getHeadersGuard(this.#headers))\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n if (options.depth === null) {\n options.depth = 2\n }\n\n options.colors ??= true\n\n const properties = {\n method: this.method,\n url: this.url,\n headers: this.headers,\n destination: this.destination,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n mode: this.mode,\n credentials: this.credentials,\n cache: this.cache,\n redirect: this.redirect,\n integrity: this.integrity,\n keepalive: this.keepalive,\n isReloadNavigation: this.isReloadNavigation,\n isHistoryNavigation: this.isHistoryNavigation,\n signal: this.signal\n }\n\n return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n }\n\n /**\n * @param {Request} request\n * @param {AbortSignal} newSignal\n */\n static setRequestSignal (request, newSignal) {\n request.#signal = newSignal\n return request\n }\n\n /**\n * @param {Request} request\n */\n static getRequestDispatcher (request) {\n return request.#dispatcher\n }\n\n /**\n * @param {Request} request\n * @param {import('../../dispatcher/dispatcher')} newDispatcher\n */\n static setRequestDispatcher (request, newDispatcher) {\n request.#dispatcher = newDispatcher\n }\n\n /**\n * @param {Request} request\n * @param {Headers} newHeaders\n */\n static setRequestHeaders (request, newHeaders) {\n request.#headers = newHeaders\n }\n\n /**\n * @param {Request} request\n */\n static getRequestState (request) {\n return request.#state\n }\n\n /**\n * @param {Request} request\n * @param {any} newState\n */\n static setRequestState (request, newState) {\n request.#state = newState\n }\n}\n\nconst { setRequestSignal, getRequestDispatcher, setRequestDispatcher, setRequestHeaders, getRequestState, setRequestState } = Request\nReflect.deleteProperty(Request, 'setRequestSignal')\nReflect.deleteProperty(Request, 'getRequestDispatcher')\nReflect.deleteProperty(Request, 'setRequestDispatcher')\nReflect.deleteProperty(Request, 'setRequestHeaders')\nReflect.deleteProperty(Request, 'getRequestState')\nReflect.deleteProperty(Request, 'setRequestState')\n\nmixinBody(Request, getRequestState)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n return {\n method: init.method ?? 'GET',\n localURLsOnly: init.localURLsOnly ?? false,\n unsafeRequest: init.unsafeRequest ?? false,\n body: init.body ?? null,\n client: init.client ?? null,\n reservedClient: init.reservedClient ?? null,\n replacesClientId: init.replacesClientId ?? '',\n window: init.window ?? 'client',\n keepalive: init.keepalive ?? false,\n serviceWorkers: init.serviceWorkers ?? 'all',\n initiator: init.initiator ?? '',\n destination: init.destination ?? '',\n priority: init.priority ?? null,\n origin: init.origin ?? 'client',\n policyContainer: init.policyContainer ?? 'client',\n referrer: init.referrer ?? 'client',\n referrerPolicy: init.referrerPolicy ?? '',\n mode: init.mode ?? 'no-cors',\n useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n credentials: init.credentials ?? 'same-origin',\n useCredentials: init.useCredentials ?? false,\n cache: init.cache ?? 'default',\n redirect: init.redirect ?? 'follow',\n integrity: init.integrity ?? '',\n cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n parserMetadata: init.parserMetadata ?? '',\n reloadNavigation: init.reloadNavigation ?? false,\n historyNavigation: init.historyNavigation ?? false,\n userActivation: init.userActivation ?? false,\n taintedOrigin: init.taintedOrigin ?? false,\n redirectCount: init.redirectCount ?? 0,\n responseTainting: init.responseTainting ?? 'basic',\n preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n done: init.done ?? false,\n timingAllowFailed: init.timingAllowFailed ?? false,\n useURLCredentials: init.useURLCredentials ?? undefined,\n traversableForUserPrompts: init.traversableForUserPrompts ?? 'client',\n urlList: init.urlList,\n url: init.urlList[0],\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList()\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n // To clone a request request, run these steps:\n\n // 1. Let newRequest be a copy of request, except for its body.\n const newRequest = makeRequest({ ...request, body: null })\n\n // 2. If request’s body is non-null, set newRequest’s body to the\n // result of cloning request’s body.\n if (request.body != null) {\n newRequest.body = cloneBody(request.body)\n }\n\n // 3. Return newRequest.\n return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {import('../../dispatcher/agent')} dispatcher\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, dispatcher, signal, guard) {\n const request = new Request(kConstruct)\n setRequestState(request, innerRequest)\n setRequestDispatcher(request, dispatcher)\n setRequestSignal(request, signal)\n const headers = new Headers(kConstruct)\n setRequestHeaders(request, headers)\n setHeadersList(headers, innerRequest.headersList)\n setHeadersGuard(headers, guard)\n return request\n}\n\nObject.defineProperties(Request.prototype, {\n method: kEnumerableProperty,\n url: kEnumerableProperty,\n headers: kEnumerableProperty,\n redirect: kEnumerableProperty,\n clone: kEnumerableProperty,\n signal: kEnumerableProperty,\n duplex: kEnumerableProperty,\n destination: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n isHistoryNavigation: kEnumerableProperty,\n isReloadNavigation: kEnumerableProperty,\n keepalive: kEnumerableProperty,\n integrity: kEnumerableProperty,\n cache: kEnumerableProperty,\n credentials: kEnumerableProperty,\n attribute: kEnumerableProperty,\n referrerPolicy: kEnumerableProperty,\n referrer: kEnumerableProperty,\n mode: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Request',\n configurable: true\n }\n})\n\nwebidl.is.Request = webidl.util.MakeTypeAssertion(Request)\n\n/**\n * @param {*} V\n * @returns {import('../../../types/fetch').Request|string}\n *\n * @see https://fetch.spec.whatwg.org/#requestinfo\n */\nwebidl.converters.RequestInfo = function (V) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V)\n }\n\n if (webidl.is.Request(V)) {\n return V\n }\n\n return webidl.converters.USVString(V)\n}\n\n/**\n * @param {*} V\n * @returns {import('../../../types/fetch').RequestInit}\n * @see https://fetch.spec.whatwg.org/#requestinit\n */\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n {\n key: 'method',\n converter: webidl.converters.ByteString\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n },\n {\n key: 'body',\n converter: webidl.nullableConverter(\n webidl.converters.BodyInit\n )\n },\n {\n key: 'referrer',\n converter: webidl.converters.USVString\n },\n {\n key: 'referrerPolicy',\n converter: webidl.converters.DOMString,\n // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n allowedValues: referrerPolicy\n },\n {\n key: 'mode',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#concept-request-mode\n allowedValues: requestMode\n },\n {\n key: 'credentials',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcredentials\n allowedValues: requestCredentials\n },\n {\n key: 'cache',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcache\n allowedValues: requestCache\n },\n {\n key: 'redirect',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestredirect\n allowedValues: requestRedirect\n },\n {\n key: 'integrity',\n converter: webidl.converters.DOMString\n },\n {\n key: 'keepalive',\n converter: webidl.converters.boolean\n },\n {\n key: 'signal',\n converter: webidl.nullableConverter(\n (signal) => webidl.converters.AbortSignal(\n signal,\n 'RequestInit',\n 'signal'\n )\n )\n },\n {\n key: 'window',\n converter: webidl.converters.any\n },\n {\n key: 'duplex',\n converter: webidl.converters.DOMString,\n allowedValues: requestDuplex\n },\n {\n key: 'dispatcher', // undici specific option\n converter: webidl.converters.any\n },\n {\n key: 'priority',\n converter: webidl.converters.DOMString,\n allowedValues: ['high', 'low', 'auto'],\n defaultValue: () => 'auto'\n }\n])\n\nmodule.exports = {\n Request,\n makeRequest,\n fromInnerRequest,\n cloneRequest,\n getRequestDispatcher,\n getRequestState\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { runtimeFeatures } = require('../../util/runtime-features.js')\n\n/**\n * @typedef {object} Metadata\n * @property {SRIHashAlgorithm} alg - The algorithm used for the hash.\n * @property {string} val - The base64-encoded hash value.\n */\n\n/**\n * @typedef {Metadata[]} MetadataList\n */\n\n/**\n * @typedef {('sha256' | 'sha384' | 'sha512')} SRIHashAlgorithm\n */\n\n/**\n * @type {Map<SRIHashAlgorithm, number>}\n *\n * The valid SRI hash algorithm token set is the ordered set « \"sha256\",\n * \"sha384\", \"sha512\" » (corresponding to SHA-256, SHA-384, and SHA-512\n * respectively). The ordering of this set is meaningful, with stronger\n * algorithms appearing later in the set.\n *\n * @see https://w3c.github.io/webappsec-subresource-integrity/#valid-sri-hash-algorithm-token-set\n */\nconst validSRIHashAlgorithmTokenSet = new Map([['sha256', 0], ['sha384', 1], ['sha512', 2]])\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('node:crypto')} */\nlet crypto\n\nif (runtimeFeatures.has('crypto')) {\n crypto = require('node:crypto')\n const cryptoHashes = crypto.getHashes()\n\n // If no hashes are available, we cannot support SRI.\n if (cryptoHashes.length === 0) {\n validSRIHashAlgorithmTokenSet.clear()\n }\n\n for (const algorithm of validSRIHashAlgorithmTokenSet.keys()) {\n // If the algorithm is not supported, remove it from the list.\n if (cryptoHashes.includes(algorithm) === false) {\n validSRIHashAlgorithmTokenSet.delete(algorithm)\n }\n }\n} else {\n // If crypto is not available, we cannot support SRI.\n validSRIHashAlgorithmTokenSet.clear()\n}\n\n/**\n * @typedef GetSRIHashAlgorithmIndex\n * @type {(algorithm: SRIHashAlgorithm) => number}\n * @param {SRIHashAlgorithm} algorithm\n * @returns {number} The index of the algorithm in the valid SRI hash algorithm\n * token set.\n */\n\nconst getSRIHashAlgorithmIndex = /** @type {GetSRIHashAlgorithmIndex} */ (Map.prototype.get.bind(\n validSRIHashAlgorithmTokenSet))\n\n/**\n * @typedef IsValidSRIHashAlgorithm\n * @type {(algorithm: string) => algorithm is SRIHashAlgorithm}\n * @param {*} algorithm\n * @returns {algorithm is SRIHashAlgorithm}\n */\n\nconst isValidSRIHashAlgorithm = /** @type {IsValidSRIHashAlgorithm} */ (\n Map.prototype.has.bind(validSRIHashAlgorithmTokenSet)\n)\n\n/**\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n * @returns {boolean}\n *\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n */\nconst bytesMatch = runtimeFeatures.has('crypto') === false || validSRIHashAlgorithmTokenSet.size === 0\n // If node is not built with OpenSSL support, we cannot check\n // a request's integrity, so allow it by default (the spec will\n // allow requests if an invalid hash is given, as precedence).\n ? () => true\n : (bytes, metadataList) => {\n // 1. Let parsedMetadata be the result of parsing metadataList.\n const parsedMetadata = parseMetadata(metadataList)\n\n // 2. If parsedMetadata is empty set, return true.\n if (parsedMetadata.length === 0) {\n return true\n }\n\n // 3. Let metadata be the result of getting the strongest\n // metadata from parsedMetadata.\n const metadata = getStrongestMetadata(parsedMetadata)\n\n // 4. For each item in metadata:\n for (const item of metadata) {\n // 1. Let algorithm be the item[\"alg\"].\n const algorithm = item.alg\n\n // 2. Let expectedValue be the item[\"val\"].\n const expectedValue = item.val\n\n // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n // 3. Let actualValue be the result of applying algorithm to bytes .\n const actualValue = applyAlgorithmToBytes(algorithm, bytes)\n\n // 4. If actualValue is a case-sensitive match for expectedValue,\n // return true.\n if (caseSensitiveMatch(actualValue, expectedValue)) {\n return true\n }\n }\n\n // 5. Return false.\n return false\n }\n\n/**\n * @param {MetadataList} metadataList\n * @returns {MetadataList} The strongest hash algorithm from the metadata list.\n */\nfunction getStrongestMetadata (metadataList) {\n // 1. Let result be the empty set and strongest be the empty string.\n const result = []\n /** @type {Metadata|null} */\n let strongest = null\n\n // 2. For each item in set:\n for (const item of metadataList) {\n // 1. Assert: item[\"alg\"] is a valid SRI hash algorithm token.\n assert(isValidSRIHashAlgorithm(item.alg), 'Invalid SRI hash algorithm token')\n\n // 2. If result is the empty set, then:\n if (result.length === 0) {\n // 1. Append item to result.\n result.push(item)\n\n // 2. Set strongest to item.\n strongest = item\n\n // 3. Continue.\n continue\n }\n\n // 3. Let currentAlgorithm be strongest[\"alg\"], and currentAlgorithmIndex be\n // the index of currentAlgorithm in the valid SRI hash algorithm token set.\n const currentAlgorithm = /** @type {Metadata} */ (strongest).alg\n const currentAlgorithmIndex = getSRIHashAlgorithmIndex(currentAlgorithm)\n\n // 4. Let newAlgorithm be the item[\"alg\"], and newAlgorithmIndex be the\n // index of newAlgorithm in the valid SRI hash algorithm token set.\n const newAlgorithm = item.alg\n const newAlgorithmIndex = getSRIHashAlgorithmIndex(newAlgorithm)\n\n // 5. If newAlgorithmIndex is less than currentAlgorithmIndex, then continue.\n if (newAlgorithmIndex < currentAlgorithmIndex) {\n continue\n\n // 6. Otherwise, if newAlgorithmIndex is greater than\n // currentAlgorithmIndex:\n } else if (newAlgorithmIndex > currentAlgorithmIndex) {\n // 1. Set strongest to item.\n strongest = item\n\n // 2. Set result to « item ».\n result[0] = item\n result.length = 1\n\n // 7. Otherwise, newAlgorithmIndex and currentAlgorithmIndex are the same\n // value. Append item to result.\n } else {\n result.push(item)\n }\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * @param {string} metadata\n * @returns {MetadataList}\n *\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n */\nfunction parseMetadata (metadata) {\n // 1. Let result be the empty set.\n /** @type {MetadataList} */\n const result = []\n\n // 2. For each item returned by splitting metadata on spaces:\n for (const item of metadata.split(' ')) {\n // 1. Let expression-and-options be the result of splitting item on U+003F (?).\n const expressionAndOptions = item.split('?', 1)\n\n // 2. Let algorithm-expression be expression-and-options[0].\n const algorithmExpression = expressionAndOptions[0]\n\n // 3. Let base64-value be the empty string.\n let base64Value = ''\n\n // 4. Let algorithm-and-value be the result of splitting algorithm-expression on U+002D (-).\n const algorithmAndValue = [algorithmExpression.slice(0, 6), algorithmExpression.slice(7)]\n\n // 5. Let algorithm be algorithm-and-value[0].\n const algorithm = algorithmAndValue[0]\n\n // 6. If algorithm is not a valid SRI hash algorithm token, then continue.\n if (!isValidSRIHashAlgorithm(algorithm)) {\n continue\n }\n\n // 7. If algorithm-and-value[1] exists, set base64-value to\n // algorithm-and-value[1].\n if (algorithmAndValue[1]) {\n base64Value = algorithmAndValue[1]\n }\n\n // 8. Let metadata be the ordered map\n // «[\"alg\" → algorithm, \"val\" → base64-value]».\n const metadata = {\n alg: algorithm,\n val: base64Value\n }\n\n // 9. Append metadata to result.\n result.push(metadata)\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * Applies the specified hash algorithm to the given bytes\n *\n * @typedef {(algorithm: SRIHashAlgorithm, bytes: Uint8Array) => string} ApplyAlgorithmToBytes\n * @param {SRIHashAlgorithm} algorithm\n * @param {Uint8Array} bytes\n * @returns {string}\n */\nconst applyAlgorithmToBytes = (algorithm, bytes) => {\n return crypto.hash(algorithm, bytes, 'base64')\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n * @param {string} actualValue base64 encoded string\n * @param {string} expectedValue base64 or base64url encoded string\n * @returns {boolean}\n */\nfunction caseSensitiveMatch (actualValue, expectedValue) {\n // Ignore padding characters from the end of the strings by\n // decreasing the length by 1 or 2 if the last characters are `=`.\n let actualValueLength = actualValue.length\n if (actualValueLength !== 0 && actualValue[actualValueLength - 1] === '=') {\n actualValueLength -= 1\n }\n if (actualValueLength !== 0 && actualValue[actualValueLength - 1] === '=') {\n actualValueLength -= 1\n }\n let expectedValueLength = expectedValue.length\n if (expectedValueLength !== 0 && expectedValue[expectedValueLength - 1] === '=') {\n expectedValueLength -= 1\n }\n if (expectedValueLength !== 0 && expectedValue[expectedValueLength - 1] === '=') {\n expectedValueLength -= 1\n }\n\n if (actualValueLength !== expectedValueLength) {\n return false\n }\n\n for (let i = 0; i < actualValueLength; ++i) {\n if (\n actualValue[i] === expectedValue[i] ||\n (actualValue[i] === '+' && expectedValue[i] === '-') ||\n (actualValue[i] === '/' && expectedValue[i] === '_')\n ) {\n continue\n }\n return false\n }\n\n return true\n}\n\nmodule.exports = {\n applyAlgorithmToBytes,\n bytesMatch,\n caseSensitiveMatch,\n isValidSRIHashAlgorithm,\n getStrongestMetadata,\n parseMetadata\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n makeNetworkError,\n makeAppropriateNetworkError,\n filterResponse,\n makeResponse,\n fromInnerResponse,\n getResponseState\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest, getRequestDispatcher, getRequestState } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n makePolicyContainer,\n clonePolicyContainer,\n requestBadPort,\n TAOCheck,\n appendRequestOriginHeader,\n responseLocationURL,\n requestCurrentURL,\n setRequestReferrerPolicyOnRedirect,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n createOpaqueTimingInfo,\n appendFetchMetadata,\n corsCheck,\n crossOriginResourcePolicyCheck,\n determineRequestsReferrer,\n coarsenedSharedCurrentTime,\n sameOrigin,\n isCancelled,\n isAborted,\n isErrorLike,\n fullyReadBody,\n readableStreamClose,\n urlIsLocal,\n urlIsHttpHttpsScheme,\n urlHasHttpsScheme,\n clampAndCoarsenConnectionTimingInfo,\n simpleRangeHeaderValue,\n buildContentRange,\n createInflate,\n extractMimeType,\n hasAuthenticationEntry,\n includesCredentials,\n isTraversableNavigable\n} = require('./util')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n safeMethodsSet,\n requestBodyHeader,\n subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished, isErrored, isReadable } = require('node:stream')\nconst { addAbortListener, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('../webidl')\nconst { STATUS_CODES } = require('node:http')\nconst { bytesMatch } = require('../subresource-integrity/subresource-integrity')\nconst { createDeferredPromise } = require('../../util/promise')\nconst { isomorphicEncode } = require('../infra')\nconst { runtimeFeatures } = require('../../util/runtime-features')\n\n// Node.js v23.8.0+ and v22.15.0+ supports Zstandard\nconst hasZstd = runtimeFeatures.has('zstd')\n\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n ? 'node'\n : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n constructor (dispatcher) {\n super()\n\n this.dispatcher = dispatcher\n this.connection = null\n this.dump = false\n this.state = 'ongoing'\n }\n\n terminate (reason) {\n if (this.state !== 'ongoing') {\n return\n }\n\n this.state = 'terminated'\n this.connection?.destroy(reason)\n this.emit('terminated', reason)\n }\n\n // https://fetch.spec.whatwg.org/#fetch-controller-abort\n abort (error) {\n if (this.state !== 'ongoing') {\n return\n }\n\n // 1. Set controller’s state to \"aborted\".\n this.state = 'aborted'\n\n // 2. Let fallbackError be an \"AbortError\" DOMException.\n // 3. Set error to fallbackError if it is not given.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 4. Let serializedError be StructuredSerialize(error).\n // If that threw an exception, catch it, and let\n // serializedError be StructuredSerialize(fallbackError).\n\n // 5. Set controller’s serialized abort reason to serializedError.\n this.serializedAbortReason = error\n\n this.connection?.destroy(error)\n this.emit('terminated', error)\n }\n}\n\nfunction handleFetchDone (response) {\n finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n // 1. Let p be a new promise.\n let p = createDeferredPromise()\n\n // 2. Let requestObject be the result of invoking the initial value of\n // Request as constructor with input and init as arguments. If this throws\n // an exception, reject p with it and return p.\n let requestObject\n\n try {\n requestObject = new Request(input, init)\n } catch (e) {\n p.reject(e)\n return p.promise\n }\n\n // 3. Let request be requestObject’s request.\n const request = getRequestState(requestObject)\n\n // 4. If requestObject’s signal’s aborted flag is set, then:\n if (requestObject.signal.aborted) {\n // 1. Abort the fetch() call with p, request, null, and\n // requestObject’s signal’s abort reason.\n abortFetch(p, request, null, requestObject.signal.reason, null)\n\n // 2. Return p.\n return p.promise\n }\n\n // 5. Let globalObject be request’s client’s global object.\n const globalObject = request.client.globalObject\n\n // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n // request’s service-workers mode to \"none\".\n if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n request.serviceWorkers = 'none'\n }\n\n // 7. Let responseObject be null.\n let responseObject = null\n\n // 8. Let relevantRealm be this’s relevant Realm.\n\n // 9. Let locallyAborted be false.\n let locallyAborted = false\n\n // 10. Let controller be null.\n let controller = null\n\n // 11. Add the following abort steps to requestObject’s signal:\n addAbortListener(\n requestObject.signal,\n () => {\n // 1. Set locallyAborted to true.\n locallyAborted = true\n\n // 2. Assert: controller is non-null.\n assert(controller != null)\n\n // 3. Abort controller with requestObject’s signal’s abort reason.\n controller.abort(requestObject.signal.reason)\n\n const realResponse = responseObject?.deref()\n\n // 4. Abort the fetch() call with p, request, responseObject,\n // and requestObject’s signal’s abort reason.\n abortFetch(p, request, realResponse, requestObject.signal.reason, controller.controller)\n }\n )\n\n // 12. Let handleFetchDone given response response be to finalize and\n // report timing with response, globalObject, and \"fetch\".\n // see function handleFetchDone\n\n // 13. Set controller to the result of calling fetch given request,\n // with processResponseEndOfBody set to handleFetchDone, and processResponse\n // given response being these substeps:\n\n const processResponse = (response) => {\n // 1. If locallyAborted is true, terminate these substeps.\n if (locallyAborted) {\n return\n }\n\n // 2. If response’s aborted flag is set, then:\n if (response.aborted) {\n // 1. Let deserializedError be the result of deserialize a serialized\n // abort reason given controller’s serialized abort reason and\n // relevantRealm.\n\n // 2. Abort the fetch() call with p, request, responseObject, and\n // deserializedError.\n\n abortFetch(p, request, responseObject, controller.serializedAbortReason, controller.controller)\n return\n }\n\n // 3. If response is a network error, then reject p with a TypeError\n // and terminate these substeps.\n if (response.type === 'error') {\n p.reject(new TypeError('fetch failed', { cause: response.error }))\n return\n }\n\n // 4. Set responseObject to the result of creating a Response object,\n // given response, \"immutable\", and relevantRealm.\n responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n // 5. Resolve p with responseObject.\n p.resolve(responseObject.deref())\n p = null\n }\n\n controller = fetching({\n request,\n processResponseEndOfBody: handleFetchDone,\n processResponse,\n dispatcher: getRequestDispatcher(requestObject), // undici\n // Keep requestObject alive to prevent its AbortController from being GC'd\n // See https://github.com/nodejs/undici/issues/4627\n requestObject\n })\n\n // 14. Return p.\n return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n // 1. If response is an aborted network error, then return.\n if (response.type === 'error' && response.aborted) {\n return\n }\n\n // 2. If response’s URL list is null or empty, then return.\n if (!response.urlList?.length) {\n return\n }\n\n // 3. Let originalURL be response’s URL list[0].\n const originalURL = response.urlList[0]\n\n // 4. Let timingInfo be response’s timing info.\n let timingInfo = response.timingInfo\n\n // 5. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n if (!urlIsHttpHttpsScheme(originalURL)) {\n return\n }\n\n // 7. If timingInfo is null, then return.\n if (timingInfo === null) {\n return\n }\n\n // 8. If response’s timing allow passed flag is not set, then:\n if (!response.timingAllowPassed) {\n // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n timingInfo = createOpaqueTimingInfo({\n startTime: timingInfo.startTime\n })\n\n // 2. Set cacheState to the empty string.\n cacheState = ''\n }\n\n // 9. Set timingInfo’s end time to the coarsened shared current time\n // given global’s relevant settings object’s cross-origin isolated\n // capability.\n // TODO: given global’s relevant settings object’s cross-origin isolated\n // capability?\n timingInfo.endTime = coarsenedSharedCurrentTime()\n\n // 10. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n // global, and cacheState.\n markResourceTiming(\n timingInfo,\n originalURL.href,\n initiatorType,\n globalThis,\n cacheState,\n '', // bodyType\n response.status\n )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error, controller /* undici-specific */) {\n // 1. Reject promise with error.\n if (p) {\n // We might have already resolved the promise at this stage\n p.reject(error)\n }\n\n // 2. If request’s body is not null and is readable, then cancel request’s\n // body with error.\n if (request.body?.stream != null && isReadable(request.body.stream)) {\n request.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n\n // 3. If responseObject is null, then return.\n if (responseObject == null) {\n return\n }\n\n // 4. Let response be responseObject’s response.\n const response = getResponseState(responseObject)\n\n // 5. If response’s body is not null and is readable, then error response’s\n // body with error.\n if (response.body?.stream != null && isReadable(response.body.stream)) {\n controller.error(error)\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n request,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseEndOfBody,\n processResponseConsumeBody,\n useParallelQueue = false,\n dispatcher = getGlobalDispatcher(), // undici\n requestObject = null // Keep alive to prevent AbortController GC, see #4627\n}) {\n // Ensure that the dispatcher is set accordingly\n assert(dispatcher)\n\n // 1. Let taskDestination be null.\n let taskDestination = null\n\n // 2. Let crossOriginIsolatedCapability be false.\n let crossOriginIsolatedCapability = false\n\n // 3. If request’s client is non-null, then:\n if (request.client != null) {\n // 1. Set taskDestination to request’s client’s global object.\n taskDestination = request.client.globalObject\n\n // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n // isolated capability.\n crossOriginIsolatedCapability =\n request.client.crossOriginIsolatedCapability\n }\n\n // 4. If useParallelQueue is true, then set taskDestination to the result of\n // starting a new parallel queue.\n // TODO\n\n // 5. Let timingInfo be a new fetch timing info whose start time and\n // post-redirect start time are the coarsened shared current time given\n // crossOriginIsolatedCapability.\n const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n const timingInfo = createOpaqueTimingInfo({\n startTime: currentTime\n })\n\n // 6. Let fetchParams be a new fetch params whose\n // request is request,\n // timing info is timingInfo,\n // process request body chunk length is processRequestBodyChunkLength,\n // process request end-of-body is processRequestEndOfBody,\n // process response is processResponse,\n // process response consume body is processResponseConsumeBody,\n // process response end-of-body is processResponseEndOfBody,\n // task destination is taskDestination,\n // and cross-origin isolated capability is crossOriginIsolatedCapability.\n const fetchParams = {\n controller: new Fetch(dispatcher),\n request,\n timingInfo,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseConsumeBody,\n processResponseEndOfBody,\n taskDestination,\n crossOriginIsolatedCapability,\n // Keep requestObject alive to prevent its AbortController from being GC'd\n requestObject\n }\n\n // 7. If request’s body is a byte sequence, then set request’s body to\n // request’s body as a body.\n // NOTE: Since fetching is only called from fetch, body should already be\n // extracted.\n assert(!request.body || request.body.stream)\n\n // 8. If request’s window is \"client\", then set request’s window to request’s\n // client, if request’s client’s global object is a Window object; otherwise\n // \"no-window\".\n if (request.window === 'client') {\n // TODO: What if request.client is null?\n request.window =\n request.client?.globalObject?.constructor?.name === 'Window'\n ? request.client\n : 'no-window'\n }\n\n // 9. If request’s origin is \"client\", then set request’s origin to request’s\n // client’s origin.\n if (request.origin === 'client') {\n request.origin = request.client.origin\n }\n\n // 10. If all of the following conditions are true:\n // TODO\n\n // 11. If request’s policy container is \"client\", then:\n if (request.policyContainer === 'client') {\n // 1. If request’s client is non-null, then set request’s policy\n // container to a clone of request’s client’s policy container. [HTML]\n if (request.client != null) {\n request.policyContainer = clonePolicyContainer(\n request.client.policyContainer\n )\n } else {\n // 2. Otherwise, set request’s policy container to a new policy\n // container.\n request.policyContainer = makePolicyContainer()\n }\n }\n\n // 12. If request’s header list does not contain `Accept`, then:\n if (!request.headersList.contains('accept', true)) {\n // 1. Let value be `*/*`.\n const value = '*/*'\n\n // 2. A user agent should set value to the first matching statement, if\n // any, switching on request’s destination:\n // \"document\"\n // \"frame\"\n // \"iframe\"\n // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n // \"image\"\n // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n // \"style\"\n // `text/css,*/*;q=0.1`\n // TODO\n\n // 3. Append `Accept`/value to request’s header list.\n request.headersList.append('accept', value, true)\n }\n\n // 13. If request’s header list does not contain `Accept-Language`, then\n // user agents should append `Accept-Language`/an appropriate value to\n // request’s header list.\n if (!request.headersList.contains('accept-language', true)) {\n request.headersList.append('accept-language', '*', true)\n }\n\n // 14. If request’s priority is null, then use request’s initiator and\n // destination appropriately in setting request’s priority to a\n // user-agent-defined object.\n if (request.priority === null) {\n // TODO\n }\n\n // 15. If request is a subresource request, then:\n if (subresourceSet.has(request.destination)) {\n // TODO\n }\n\n // 16. Run main fetch given fetchParams.\n mainFetch(fetchParams, false)\n\n // 17. Return fetchParam's controller\n return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive) {\n try {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. If request’s local-URLs-only flag is set and request’s current URL is\n // not local, then set response to a network error.\n if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n response = makeNetworkError('local URLs only')\n }\n\n // 4. Run report Content Security Policy violations for request.\n // TODO\n\n // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n // 6. If should request be blocked due to a bad port, should fetching request\n // be blocked as mixed content, or should request be blocked by Content\n // Security Policy returns blocked, then set response to a network error.\n if (requestBadPort(request) === 'blocked') {\n response = makeNetworkError('bad port')\n }\n // TODO: should fetching request be blocked as mixed content?\n // TODO: should request be blocked by Content Security Policy?\n\n // 7. If request’s referrer policy is the empty string, then set request’s\n // referrer policy to request’s policy container’s referrer policy.\n if (request.referrerPolicy === '') {\n request.referrerPolicy = request.policyContainer.referrerPolicy\n }\n\n // 8. If request’s referrer is not \"no-referrer\", then set request’s\n // referrer to the result of invoking determine request’s referrer.\n if (request.referrer !== 'no-referrer') {\n request.referrer = determineRequestsReferrer(request)\n }\n\n // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n // conditions are true:\n // - request’s current URL’s scheme is \"http\"\n // - request’s current URL’s host is a domain\n // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n // Matching results in either a superdomain match with an asserted\n // includeSubDomains directive or a congruent match (with or without an\n // asserted includeSubDomains directive). [HSTS]\n // TODO\n\n // 10. If recursive is false, then run the remaining steps in parallel.\n // TODO\n\n // 11. If response is null, then set response to the result of running\n // the steps corresponding to the first matching statement:\n if (response === null) {\n const currentURL = requestCurrentURL(request)\n if (\n // - request’s current URL’s origin is same origin with request’s origin,\n // and request’s response tainting is \"basic\"\n (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n // request’s current URL’s scheme is \"data\"\n (currentURL.protocol === 'data:') ||\n // - request’s mode is \"navigate\" or \"websocket\"\n (request.mode === 'navigate' || request.mode === 'websocket')\n ) {\n // 1. Set request’s response tainting to \"basic\".\n request.responseTainting = 'basic'\n\n // 2. Return the result of running scheme fetch given fetchParams.\n response = await schemeFetch(fetchParams)\n\n // request’s mode is \"same-origin\"\n } else if (request.mode === 'same-origin') {\n // 1. Return a network error.\n response = makeNetworkError('request mode cannot be \"same-origin\"')\n\n // request’s mode is \"no-cors\"\n } else if (request.mode === 'no-cors') {\n // 1. If request’s redirect mode is not \"follow\", then return a network\n // error.\n if (request.redirect !== 'follow') {\n response = makeNetworkError(\n 'redirect mode cannot be \"follow\" for \"no-cors\" request'\n )\n } else {\n // 2. Set request’s response tainting to \"opaque\".\n request.responseTainting = 'opaque'\n\n // 3. Return the result of running scheme fetch given fetchParams.\n response = await schemeFetch(fetchParams)\n }\n // request’s current URL’s scheme is not an HTTP(S) scheme\n } else if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n // Return a network error.\n response = makeNetworkError('URL scheme must be a HTTP(S) scheme')\n\n // - request’s use-CORS-preflight flag is set\n // - request’s unsafe-request flag is set and either request’s method is\n // not a CORS-safelisted method or CORS-unsafe request-header names with\n // request’s header list is not empty\n // 1. Set request’s response tainting to \"cors\".\n // 2. Let corsWithPreflightResponse be the result of running HTTP fetch\n // given fetchParams and true.\n // 3. If corsWithPreflightResponse is a network error, then clear cache\n // entries using request.\n // 4. Return corsWithPreflightResponse.\n // TODO\n\n // Otherwise\n } else {\n // 1. Set request’s response tainting to \"cors\".\n request.responseTainting = 'cors'\n\n // 2. Return the result of running HTTP fetch given fetchParams.\n response = await httpFetch(fetchParams)\n }\n }\n\n // 12. If recursive is true, then return response.\n if (recursive) {\n return response\n }\n\n // 13. If response is not a network error and response is not a filtered\n // response, then:\n if (response.status !== 0 && !response.internalResponse) {\n // If request’s response tainting is \"cors\", then:\n if (request.responseTainting === 'cors') {\n // 1. Let headerNames be the result of extracting header list values\n // given `Access-Control-Expose-Headers` and response’s header list.\n // TODO\n // 2. If request’s credentials mode is not \"include\" and headerNames\n // contains `*`, then set response’s CORS-exposed header-name list to\n // all unique header names in response’s header list.\n // TODO\n // 3. Otherwise, if headerNames is not null or failure, then set\n // response’s CORS-exposed header-name list to headerNames.\n // TODO\n }\n\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (request.responseTainting === 'basic') {\n response = filterResponse(response, 'basic')\n } else if (request.responseTainting === 'cors') {\n response = filterResponse(response, 'cors')\n } else if (request.responseTainting === 'opaque') {\n response = filterResponse(response, 'opaque')\n } else {\n assert(false)\n }\n }\n\n // 14. Let internalResponse be response, if response is a network error,\n // and response’s internal response otherwise.\n let internalResponse =\n response.status === 0 ? response : response.internalResponse\n\n // 15. If internalResponse’s URL list is empty, then set it to a clone of\n // request’s URL list.\n if (internalResponse.urlList.length === 0) {\n internalResponse.urlList.push(...request.urlList)\n }\n\n // 16. If request’s timing allow failed flag is unset, then set\n // internalResponse’s timing allow passed flag.\n if (!request.timingAllowFailed) {\n response.timingAllowPassed = true\n }\n\n // 17. If response is not a network error and any of the following returns\n // blocked\n // - should internalResponse to request be blocked as mixed content\n // - should internalResponse to request be blocked by Content Security Policy\n // - should internalResponse to request be blocked due to its MIME type\n // - should internalResponse to request be blocked due to nosniff\n // TODO\n\n // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n // internalResponse’s range-requested flag is set, and request’s header\n // list does not contain `Range`, then set response and internalResponse\n // to a network error.\n if (\n response.type === 'opaque' &&\n internalResponse.status === 206 &&\n internalResponse.rangeRequested &&\n !request.headers.contains('range', true)\n ) {\n response = internalResponse = makeNetworkError()\n }\n\n // 19. If response is not a network error and either request’s method is\n // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n // set internalResponse’s body to null and disregard any enqueuing toward\n // it (if any).\n if (\n response.status !== 0 &&\n (request.method === 'HEAD' ||\n request.method === 'CONNECT' ||\n nullBodyStatus.includes(internalResponse.status))\n ) {\n internalResponse.body = null\n fetchParams.controller.dump = true\n }\n\n // 20. If request’s integrity metadata is not the empty string, then:\n if (request.integrity) {\n // 1. Let processBodyError be this step: run fetch finale given fetchParams\n // and a network error.\n const processBodyError = (reason) =>\n fetchFinale(fetchParams, makeNetworkError(reason))\n\n // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n // then run processBodyError and abort these steps.\n if (request.responseTainting === 'opaque' || response.body == null) {\n processBodyError(response.error)\n return\n }\n\n // 3. Let processBody given bytes be these steps:\n const processBody = (bytes) => {\n // 1. If bytes do not match request’s integrity metadata,\n // then run processBodyError and abort these steps. [SRI]\n if (!bytesMatch(bytes, request.integrity)) {\n processBodyError('integrity mismatch')\n return\n }\n\n // 2. Set response’s body to bytes as a body.\n response.body = safelyExtractBody(bytes)[0]\n\n // 3. Run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n\n // 4. Fully read response’s body given processBody and processBodyError.\n fullyReadBody(response.body, processBody, processBodyError)\n } else {\n // 21. Otherwise, run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n } catch (err) {\n fetchParams.controller.terminate(err)\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n // cancelled state, we do not want this condition to trigger *unless* there have been\n // no redirects. See https://github.com/nodejs/undici/issues/1776\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n }\n\n // 2. Let request be fetchParams’s request.\n const { request } = fetchParams\n\n const { protocol: scheme } = requestCurrentURL(request)\n\n // 3. Switch on request’s current URL’s scheme and run the associated steps:\n switch (scheme) {\n case 'about:': {\n // If request’s current URL’s path is the string \"blank\", then return a new response\n // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n // and body is the empty byte sequence as a body.\n\n // Otherwise, return a network error.\n return Promise.resolve(makeNetworkError('about scheme is not supported'))\n }\n case 'blob:': {\n if (!resolveObjectURL) {\n resolveObjectURL = require('node:buffer').resolveObjectURL\n }\n\n // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n const blobURLEntry = requestCurrentURL(request)\n\n // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n // Buffer.resolveObjectURL does not ignore URL queries.\n if (blobURLEntry.search.length !== 0) {\n return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n }\n\n const blob = resolveObjectURL(blobURLEntry.toString())\n\n // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n // object is not a Blob object, then return a network error.\n if (request.method !== 'GET' || !webidl.is.Blob(blob)) {\n return Promise.resolve(makeNetworkError('invalid method'))\n }\n\n // 3. Let blob be blobURLEntry’s object.\n // Note: done above\n\n // 4. Let response be a new response.\n const response = makeResponse()\n\n // 5. Let fullLength be blob’s size.\n const fullLength = blob.size\n\n // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n // 7. Let type be blob’s type.\n const type = blob.type\n\n // 8. If request’s header list does not contain `Range`:\n // 9. Otherwise:\n if (!request.headersList.contains('range', true)) {\n // 1. Let bodyWithType be the result of safely extracting blob.\n // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n // In node, this can only ever be a Blob. Therefore we can safely\n // use extractBody directly.\n const bodyWithType = extractBody(blob)\n\n // 2. Set response’s status message to `OK`.\n response.statusText = 'OK'\n\n // 3. Set response’s body to bodyWithType’s body.\n response.body = bodyWithType[0]\n\n // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n response.headersList.set('content-length', serializedFullLength, true)\n response.headersList.set('content-type', type, true)\n } else {\n // 1. Set response’s range-requested flag.\n response.rangeRequested = true\n\n // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n const rangeHeader = request.headersList.get('range', true)\n\n // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n // 4. If rangeValue is failure, then return a network error.\n if (rangeValue === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 5. Let (rangeStart, rangeEnd) be rangeValue.\n let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n // 6. If rangeStart is null:\n // 7. Otherwise:\n if (rangeStart === null) {\n // 1. Set rangeStart to fullLength − rangeEnd.\n rangeStart = fullLength - rangeEnd\n\n // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n rangeEnd = rangeStart + rangeEnd - 1\n } else {\n // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n if (rangeStart >= fullLength) {\n return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n }\n\n // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n // rangeEnd to fullLength − 1.\n if (rangeEnd === null || rangeEnd >= fullLength) {\n rangeEnd = fullLength - 1\n }\n }\n\n // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n // rangeEnd + 1, and type.\n const slicedBlob = blob.slice(rangeStart, rangeEnd + 1, type)\n\n // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n // Note: same reason as mentioned above as to why we use extractBody\n const slicedBodyWithType = extractBody(slicedBlob)\n\n // 10. Set response’s body to slicedBodyWithType’s body.\n response.body = slicedBodyWithType[0]\n\n // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n // rangeEnd, and fullLength.\n const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n // 13. Set response’s status to 206.\n response.status = 206\n\n // 14. Set response’s status message to `Partial Content`.\n response.statusText = 'Partial Content'\n\n // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n // (`Content-Type`, type), (`Content-Range`, contentRange) ».\n response.headersList.set('content-length', serializedSlicedLength, true)\n response.headersList.set('content-type', type, true)\n response.headersList.set('content-range', contentRange, true)\n }\n\n // 10. Return response.\n return Promise.resolve(response)\n }\n case 'data:': {\n // 1. Let dataURLStruct be the result of running the\n // data: URL processor on request’s current URL.\n const currentURL = requestCurrentURL(request)\n const dataURLStruct = dataURLProcessor(currentURL)\n\n // 2. If dataURLStruct is failure, then return a\n // network error.\n if (dataURLStruct === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n // 4. Return a response whose status message is `OK`,\n // header list is « (`Content-Type`, mimeType) »,\n // and body is dataURLStruct’s body as a body.\n return Promise.resolve(makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-type', { name: 'Content-Type', value: mimeType }]\n ],\n body: safelyExtractBody(dataURLStruct.body)[0]\n }))\n }\n case 'file:': {\n // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n // When in doubt, return a network error.\n return Promise.resolve(makeNetworkError('not implemented... yet...'))\n }\n case 'http:':\n case 'https:': {\n // Return the result of running HTTP fetch given fetchParams.\n\n return httpFetch(fetchParams)\n .catch((err) => makeNetworkError(err))\n }\n default: {\n return Promise.resolve(makeNetworkError('unknown scheme'))\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2, If fetchParams’s process response done is not null, then queue a fetch\n // task to run fetchParams’s process response done given response, with\n // fetchParams’s task destination.\n if (fetchParams.processResponseDone != null) {\n queueMicrotask(() => fetchParams.processResponseDone(response))\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n // 1. Let timingInfo be fetchParams’s timing info.\n let timingInfo = fetchParams.timingInfo\n\n // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n // then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n // `Server-Timing` from response’s internal response’s header list.\n // TODO\n\n // 3. Let processResponseEndOfBody be the following steps:\n const processResponseEndOfBody = () => {\n // 1. Let unsafeEndTime be the unsafe shared current time.\n const unsafeEndTime = Date.now() // ?\n\n // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n // full timing info to fetchParams’s timing info.\n if (fetchParams.request.destination === 'document') {\n fetchParams.controller.fullTimingInfo = timingInfo\n }\n\n // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n fetchParams.controller.reportTimingSteps = () => {\n // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n if (!urlIsHttpHttpsScheme(fetchParams.request.url)) {\n return\n }\n\n // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n timingInfo.endTime = unsafeEndTime\n\n // 3. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 4. Let bodyInfo be response’s body info.\n const bodyInfo = response.bodyInfo\n\n // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n // opaque timing info for timingInfo and set cacheState to the empty string.\n if (!response.timingAllowPassed) {\n timingInfo = createOpaqueTimingInfo(timingInfo)\n\n cacheState = ''\n }\n\n // 6. Let responseStatus be 0.\n let responseStatus = 0\n\n // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n if (fetchParams.request.mode !== 'navigate' || !response.hasCrossOriginRedirects) {\n // 1. Set responseStatus to response’s status.\n responseStatus = response.status\n\n // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n const mimeType = extractMimeType(response.headersList)\n\n // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n if (mimeType !== 'failure') {\n bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n }\n }\n\n // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n // and responseStatus.\n if (fetchParams.request.initiatorType != null) {\n markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n }\n }\n\n // 4. Let processResponseEndOfBodyTask be the following steps:\n const processResponseEndOfBodyTask = () => {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n // response end-of-body given response.\n if (fetchParams.processResponseEndOfBody != null) {\n queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n }\n\n // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n // global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n // timing steps given fetchParams’s request’s client’s global object.\n if (fetchParams.request.initiatorType != null) {\n fetchParams.controller.reportTimingSteps()\n }\n }\n\n // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n queueMicrotask(() => processResponseEndOfBodyTask())\n }\n\n // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n // process response given response, with fetchParams’s task destination.\n if (fetchParams.processResponse != null) {\n queueMicrotask(() => {\n fetchParams.processResponse(response)\n fetchParams.processResponse = null\n })\n }\n\n // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n // 7. Otherwise:\n if (internalResponse.body == null) {\n processResponseEndOfBody()\n } else {\n // mcollina: all the following steps of the specs are skipped.\n // The internal transform stream is not needed.\n // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n // 1. Let transformStream be a new TransformStream.\n // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n // set to processResponseEndOfBody.\n // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n finished(internalResponse.body.stream, () => {\n processResponseEndOfBody()\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let actualResponse be null.\n let actualResponse = null\n\n // 4. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 5. If request’s service-workers mode is \"all\", then:\n if (request.serviceWorkers === 'all') {\n // TODO\n }\n\n // 6. If response is null, then:\n if (response === null) {\n // 1. If makeCORSPreflight is true and one of these conditions is true:\n // TODO\n\n // 2. If request’s redirect mode is \"follow\", then set request’s\n // service-workers mode to \"none\".\n if (request.redirect === 'follow') {\n request.serviceWorkers = 'none'\n }\n\n // 3. Set response and actualResponse to the result of running\n // HTTP-network-or-cache fetch given fetchParams.\n actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n // 4. If request’s response tainting is \"cors\" and a CORS check\n // for request and response returns failure, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n corsCheck(request, response) === 'failure'\n ) {\n return makeNetworkError('cors failure')\n }\n\n // 5. If the TAO check for request and response returns failure, then set\n // request’s timing allow failed flag.\n if (TAOCheck(request, response) === 'failure') {\n request.timingAllowFailed = true\n }\n }\n\n // 7. If either request’s response tainting or response’s type\n // is \"opaque\", and the cross-origin resource policy check with\n // request’s origin, request’s client, request’s destination,\n // and actualResponse returns blocked, then return a network error.\n if (\n (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n crossOriginResourcePolicyCheck(\n request.origin,\n request.client,\n request.destination,\n actualResponse\n ) === 'blocked'\n ) {\n return makeNetworkError('blocked')\n }\n\n // 8. If actualResponse’s status is a redirect status, then:\n if (redirectStatusSet.has(actualResponse.status)) {\n // 1. If actualResponse’s status is not 303, request’s body is not null,\n // and the connection uses HTTP/2, then user agents may, and are even\n // encouraged to, transmit an RST_STREAM frame.\n // See, https://github.com/whatwg/fetch/issues/1288\n if (request.redirect !== 'manual') {\n fetchParams.controller.connection.destroy(undefined, false)\n }\n\n // 2. Switch on request’s redirect mode:\n if (request.redirect === 'error') {\n // Set response to a network error.\n response = makeNetworkError('unexpected redirect')\n } else if (request.redirect === 'manual') {\n // Set response to an opaque-redirect filtered response whose internal\n // response is actualResponse.\n // NOTE(spec): On the web this would return an `opaqueredirect` response,\n // but that doesn't make sense server side.\n // See https://github.com/nodejs/undici/issues/1193.\n response = actualResponse\n } else if (request.redirect === 'follow') {\n // Set response to the result of running HTTP-redirect fetch given\n // fetchParams and response.\n response = await httpRedirectFetch(fetchParams, response)\n } else {\n assert(false)\n }\n }\n\n // 9. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 10. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let actualResponse be response, if response is not a filtered response,\n // and response’s internal response otherwise.\n const actualResponse = response.internalResponse\n ? response.internalResponse\n : response\n\n // 3. Let locationURL be actualResponse’s location URL given request’s current\n // URL’s fragment.\n let locationURL\n\n try {\n locationURL = responseLocationURL(\n actualResponse,\n requestCurrentURL(request).hash\n )\n\n // 4. If locationURL is null, then return response.\n if (locationURL == null) {\n return response\n }\n } catch (err) {\n // 5. If locationURL is failure, then return a network error.\n return Promise.resolve(makeNetworkError(err))\n }\n\n // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n // error.\n if (!urlIsHttpHttpsScheme(locationURL)) {\n return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n }\n\n // 7. If request’s redirect count is 20, then return a network error.\n if (request.redirectCount === 20) {\n return Promise.resolve(makeNetworkError('redirect count exceeded'))\n }\n\n // 8. Increase request’s redirect count by 1.\n request.redirectCount += 1\n\n // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n // request’s origin is not same origin with locationURL’s origin, then return\n // a network error.\n if (\n request.mode === 'cors' &&\n (locationURL.username || locationURL.password) &&\n !sameOrigin(request, locationURL)\n ) {\n return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n }\n\n // 10. If request’s response tainting is \"cors\" and locationURL includes\n // credentials, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n (locationURL.username || locationURL.password)\n ) {\n return Promise.resolve(makeNetworkError(\n 'URL cannot contain credentials for request mode \"cors\"'\n ))\n }\n\n // 11. If actualResponse’s status is not 303, request’s body is non-null,\n // and request’s body’s source is null, then return a network error.\n if (\n actualResponse.status !== 303 &&\n request.body != null &&\n request.body.source == null\n ) {\n return Promise.resolve(makeNetworkError())\n }\n\n // 12. If one of the following is true\n // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n if (\n ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n (actualResponse.status === 303 &&\n !GET_OR_HEAD.includes(request.method))\n ) {\n // then:\n // 1. Set request’s method to `GET` and request’s body to null.\n request.method = 'GET'\n request.body = null\n\n // 2. For each headerName of request-body-header name, delete headerName from\n // request’s header list.\n for (const headerName of requestBodyHeader) {\n request.headersList.delete(headerName)\n }\n }\n\n // 13. If request’s current URL’s origin is not same origin with locationURL’s\n // origin, then for each headerName of CORS non-wildcard request-header name,\n // delete headerName from request’s header list.\n if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n request.headersList.delete('authorization', true)\n\n // https://fetch.spec.whatwg.org/#authentication-entries\n request.headersList.delete('proxy-authorization', true)\n\n // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n request.headersList.delete('cookie', true)\n request.headersList.delete('host', true)\n }\n\n // 14. If request's body is non-null, then set request's body to the first return\n // value of safely extracting request's body's source.\n if (request.body != null) {\n assert(request.body.source != null)\n request.body = safelyExtractBody(request.body.source)[0]\n }\n\n // 15. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n // coarsened shared current time given fetchParams’s cross-origin isolated\n // capability.\n timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n // redirect start time to timingInfo’s start time.\n if (timingInfo.redirectStartTime === 0) {\n timingInfo.redirectStartTime = timingInfo.startTime\n }\n\n // 18. Append locationURL to request’s URL list.\n request.urlList.push(locationURL)\n\n // 19. Invoke set request’s referrer policy on redirect on request and\n // actualResponse.\n setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n // 20. Return the result of running main fetch given fetchParams and true.\n return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n fetchParams,\n isAuthenticationFetch = false,\n isNewConnectionFetch = false\n) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let httpFetchParams be null.\n let httpFetchParams = null\n\n // 3. Let httpRequest be null.\n let httpRequest = null\n\n // 4. Let response be null.\n let response = null\n\n // 5. Let storedResponse be null.\n // TODO: cache\n\n // 6. Let httpCache be null.\n const httpCache = null\n\n // 7. Let the revalidatingFlag be unset.\n const revalidatingFlag = false\n\n // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If request’s window is \"no-window\" and request’s redirect mode is\n // \"error\", then set httpFetchParams to fetchParams and httpRequest to\n // request.\n if (request.window === 'no-window' && request.redirect === 'error') {\n httpFetchParams = fetchParams\n httpRequest = request\n } else {\n // Otherwise:\n\n // 1. Set httpRequest to a clone of request.\n httpRequest = cloneRequest(request)\n\n // 2. Set httpFetchParams to a copy of fetchParams.\n httpFetchParams = { ...fetchParams }\n\n // 3. Set httpFetchParams’s request to httpRequest.\n httpFetchParams.request = httpRequest\n }\n\n // 3. Let includeCredentials be true if one of\n const includeCredentials =\n request.credentials === 'include' ||\n (request.credentials === 'same-origin' &&\n request.responseTainting === 'basic')\n\n // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n // body is non-null; otherwise null.\n const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n // 5. Let contentLengthHeaderValue be null.\n let contentLengthHeaderValue = null\n\n // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n // `PUT`, then set contentLengthHeaderValue to `0`.\n if (\n httpRequest.body == null &&\n ['POST', 'PUT'].includes(httpRequest.method)\n ) {\n contentLengthHeaderValue = '0'\n }\n\n // 7. If contentLength is non-null, then set contentLengthHeaderValue to\n // contentLength, serialized and isomorphic encoded.\n if (contentLength != null) {\n contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n }\n\n // 8. If contentLengthHeaderValue is non-null, then append\n // `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n // list.\n if (\n contentLengthHeaderValue != null &&\n !httpRequest.headersList.contains('content-length', true)\n ) {\n httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n }\n\n // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n // contentLengthHeaderValue) to httpRequest’s header list.\n\n // 10. If contentLength is non-null and httpRequest’s keepalive is true,\n // then:\n if (contentLength != null && httpRequest.keepalive) {\n // NOTE: keepalive is a noop outside of browser context.\n }\n\n // 11. If httpRequest’s referrer is a URL, then append\n // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n // to httpRequest’s header list.\n if (webidl.is.URL(httpRequest.referrer)) {\n httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n }\n\n // 12. Append a request `Origin` header for httpRequest.\n appendRequestOriginHeader(httpRequest)\n\n // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n appendFetchMetadata(httpRequest)\n\n // 14. If httpRequest’s header list does not contain `User-Agent`, then\n // user agents should append `User-Agent`/default `User-Agent` value to\n // httpRequest’s header list.\n if (!httpRequest.headersList.contains('user-agent', true)) {\n httpRequest.headersList.append('user-agent', defaultUserAgent, true)\n }\n\n // 15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n // list contains `If-Modified-Since`, `If-None-Match`,\n // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n // httpRequest’s cache mode to \"no-store\".\n if (\n httpRequest.cache === 'default' &&\n (httpRequest.headersList.contains('if-modified-since', true) ||\n httpRequest.headersList.contains('if-none-match', true) ||\n httpRequest.headersList.contains('if-unmodified-since', true) ||\n httpRequest.headersList.contains('if-match', true) ||\n httpRequest.headersList.contains('if-range', true))\n ) {\n httpRequest.cache = 'no-store'\n }\n\n // 16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n // no-cache cache-control header modification flag is unset, and\n // httpRequest’s header list does not contain `Cache-Control`, then append\n // `Cache-Control`/`max-age=0` to httpRequest’s header list.\n if (\n httpRequest.cache === 'no-cache' &&\n !httpRequest.preventNoCacheCacheControlHeaderModification &&\n !httpRequest.headersList.contains('cache-control', true)\n ) {\n httpRequest.headersList.append('cache-control', 'max-age=0', true)\n }\n\n // 17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n // 1. If httpRequest’s header list does not contain `Pragma`, then append\n // `Pragma`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('pragma', true)) {\n httpRequest.headersList.append('pragma', 'no-cache', true)\n }\n\n // 2. If httpRequest’s header list does not contain `Cache-Control`,\n // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('cache-control', true)) {\n httpRequest.headersList.append('cache-control', 'no-cache', true)\n }\n }\n\n // 18. If httpRequest’s header list contains `Range`, then append\n // `Accept-Encoding`/`identity` to httpRequest’s header list.\n if (httpRequest.headersList.contains('range', true)) {\n httpRequest.headersList.append('accept-encoding', 'identity', true)\n }\n\n // 19. Modify httpRequest’s header list per HTTP. Do not append a given\n // header if httpRequest’s header list contains that header’s name.\n // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n if (!httpRequest.headersList.contains('accept-encoding', true)) {\n if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n } else {\n httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n }\n }\n\n httpRequest.headersList.delete('host', true)\n\n // 21. If includeCredentials is true, then:\n if (includeCredentials) {\n // 1. If the user agent is not configured to block cookies for httpRequest\n // (see section 7 of [COOKIES]), then:\n // TODO: credentials\n\n // 2. If httpRequest’s header list does not contain `Authorization`, then:\n if (!httpRequest.headersList.contains('authorization', true)) {\n // 1. Let authorizationValue be null.\n let authorizationValue = null\n\n // 2. If there’s an authentication entry for httpRequest and either\n // httpRequest’s use-URL-credentials flag is unset or httpRequest’s\n // current URL does not include credentials, then set\n // authorizationValue to authentication entry.\n if (hasAuthenticationEntry(httpRequest) && (\n httpRequest.useURLCredentials === undefined || !includesCredentials(requestCurrentURL(httpRequest))\n )) {\n // TODO\n } else if (includesCredentials(requestCurrentURL(httpRequest)) && isAuthenticationFetch) {\n // 3. Otherwise, if httpRequest’s current URL does include credentials\n // and isAuthenticationFetch is true, set authorizationValue to\n // httpRequest’s current URL, converted to an `Authorization` value\n const { username, password } = requestCurrentURL(httpRequest)\n authorizationValue = `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`\n }\n\n // 4. If authorizationValue is non-null, then append (`Authorization`,\n // authorizationValue) to httpRequest’s header list.\n if (authorizationValue !== null) {\n httpRequest.headersList.append('Authorization', authorizationValue, false)\n }\n }\n }\n\n // 21. If there’s a proxy-authentication entry, use it as appropriate.\n // TODO: proxy-authentication\n\n // 22. Set httpCache to the result of determining the HTTP cache\n // partition, given httpRequest.\n // TODO: cache\n\n // 23. If httpCache is null, then set httpRequest’s cache mode to\n // \"no-store\".\n if (httpCache == null) {\n httpRequest.cache = 'no-store'\n }\n\n // 24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n // then:\n if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n // TODO: cache\n }\n\n // 9. If aborted, then return the appropriate network error for fetchParams.\n // TODO\n\n // 10. If response is null, then:\n if (response == null) {\n // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n // network error.\n if (httpRequest.cache === 'only-if-cached') {\n return makeNetworkError('only if cached')\n }\n\n // 2. Let forwardResponse be the result of running HTTP-network fetch\n // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n const forwardResponse = await httpNetworkFetch(\n httpFetchParams,\n includeCredentials,\n isNewConnectionFetch\n )\n\n // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n // in the range 200 to 399, inclusive, invalidate appropriate stored\n // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n // Caching, and set storedResponse to null. [HTTP-CACHING]\n if (\n !safeMethodsSet.has(httpRequest.method) &&\n forwardResponse.status >= 200 &&\n forwardResponse.status <= 399\n ) {\n // TODO: cache\n }\n\n // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n // then:\n if (revalidatingFlag && forwardResponse.status === 304) {\n // TODO: cache\n }\n\n // 5. If response is null, then:\n if (response == null) {\n // 1. Set response to forwardResponse.\n response = forwardResponse\n\n // 2. Store httpRequest and forwardResponse in httpCache, as per the\n // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n // TODO: cache\n }\n }\n\n // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n response.urlList = [...httpRequest.urlList]\n\n // 12. If httpRequest’s header list contains `Range`, then set response’s\n // range-requested flag.\n if (httpRequest.headersList.contains('range', true)) {\n response.rangeRequested = true\n }\n\n // 13. Set response’s request-includes-credentials to includeCredentials.\n response.requestIncludesCredentials = includeCredentials\n\n // 14. If response’s status is 401, httpRequest’s response tainting is not \"cors\",\n // includeCredentials is true, and request’s traversable for user prompts is\n // a traversable navigable:\n //\n // In Node.js there is no traversable navigable to prompt the user, but we\n // still need to handle URL-embedded credentials so authentication retries\n // for WebSocket handshakes continue to work.\n if (response.status === 401 && httpRequest.responseTainting !== 'cors' && includeCredentials && (\n request.useURLCredentials !== undefined ||\n isTraversableNavigable(request.traversableForUserPrompts)\n )) {\n // 2. If request’s body is non-null, then:\n if (request.body != null) {\n // 1. If request’s body’s source is null, then return a network error.\n if (request.body.source == null) {\n // Note: In Node.js, this code path should not be reached because\n // isTraversableNavigable() returns false for non-navigable contexts.\n // However, we handle it gracefully by returning the response instead of\n // a network error, as we won't actually retry the request.\n // This aligns with the Fetch spec discussion in whatwg/fetch#1132,\n // which allows implementations flexibility when credentials can't be obtained.\n return response\n }\n\n // 2. Set request’s body to the body of the result of safely extracting\n // request’s body’s source.\n request.body = safelyExtractBody(request.body.source)[0]\n }\n\n // 3. If request’s use-URL-credentials flag is unset or isAuthenticationFetch is\n // true, then:\n if (request.useURLCredentials === undefined || isAuthenticationFetch) {\n // 1. If fetchParams is canceled, then return the appropriate network error\n // for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 2. Let username and password be the result of prompting the end user for a\n // username and password, respectively, in request’s traversable for user prompts.\n // TODO\n\n // 3. Set the username given request’s current URL and username.\n // requestCurrentURL(request).username = TODO\n\n // 4. Set the password given request’s current URL and password.\n // requestCurrentURL(request).password = TODO\n\n // In browsers, the user will be prompted to enter a username/password before the request\n // is re-sent. To prevent an infinite 401 loop, return the response for now.\n // https://github.com/nodejs/undici/pull/4756\n return response\n }\n\n // 4. Set response to the result of running HTTP-network-or-cache fetch given\n // fetchParams and true.\n fetchParams.controller.connection.destroy()\n\n response = await httpNetworkOrCacheFetch(fetchParams, true)\n }\n\n // 15. If response’s status is 407, then:\n if (response.status === 407) {\n // 1. If request’s window is \"no-window\", then return a network error.\n if (request.window === 'no-window') {\n return makeNetworkError()\n }\n\n // 2. ???\n\n // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 4. Prompt the end user as appropriate in request’s window and store\n // the result as a proxy-authentication entry. [HTTP-AUTH]\n // TODO: Invoke some kind of callback?\n\n // 5. Set response to the result of running HTTP-network-or-cache fetch given\n // fetchParams.\n // TODO\n return makeNetworkError('proxy authentication required')\n }\n\n // 16. If all of the following are true\n if (\n // response’s status is 421\n response.status === 421 &&\n // isNewConnectionFetch is false\n !isNewConnectionFetch &&\n // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n (request.body == null || request.body.source != null)\n ) {\n // then:\n\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 2. Set response to the result of running HTTP-network-or-cache\n // fetch given fetchParams, isAuthenticationFetch, and true.\n\n // TODO (spec): The spec doesn't specify this but we need to cancel\n // the active response before we can start a new one.\n // https://github.com/whatwg/fetch/issues/1293\n fetchParams.controller.connection.destroy()\n\n response = await httpNetworkOrCacheFetch(\n fetchParams,\n isAuthenticationFetch,\n true\n )\n }\n\n // 17. If isAuthenticationFetch is true, then create an authentication entry\n if (isAuthenticationFetch) {\n // TODO\n }\n\n // 18. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n fetchParams,\n includeCredentials = false,\n forceNewConnection = false\n) {\n assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n fetchParams.controller.connection = {\n abort: null,\n destroyed: false,\n destroy (err, abort = true) {\n if (!this.destroyed) {\n this.destroyed = true\n if (abort) {\n this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n }\n }\n }\n }\n\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 4. Let httpCache be the result of determining the HTTP cache partition,\n // given request.\n // TODO: cache\n const httpCache = null\n\n // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n if (httpCache == null) {\n request.cache = 'no-store'\n }\n\n // 6. Let networkPartitionKey be the result of determining the network\n // partition key given request.\n // TODO\n\n // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n // \"no\".\n const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n // 8. Switch on request’s mode:\n if (request.mode === 'websocket') {\n // Let connection be the result of obtaining a WebSocket connection,\n // given request’s current URL.\n // TODO\n } else {\n // Let connection be the result of obtaining a connection, given\n // networkPartitionKey, request’s current URL’s origin,\n // includeCredentials, and forceNewConnection.\n // TODO\n }\n\n // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If connection is failure, then return a network error.\n\n // 2. Set timingInfo’s final connection timing info to the result of\n // calling clamp and coarsen connection timing info with connection’s\n // timing info, timingInfo’s post-redirect start time, and fetchParams’s\n // cross-origin isolated capability.\n\n // 3. If connection is not an HTTP/2 connection, request’s body is non-null,\n // and request’s body’s source is null, then append (`Transfer-Encoding`,\n // `chunked`) to request’s header list.\n\n // 4. Set timingInfo’s final network-request start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated\n // capability.\n\n // 5. Set response to the result of making an HTTP request over connection\n // using request with the following caveats:\n\n // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n // - If request’s body is non-null, and request’s body’s source is null,\n // then the user agent may have a buffer of up to 64 kibibytes and store\n // a part of request’s body in that buffer. If the user agent reads from\n // request’s body beyond that buffer’s size and the user agent needs to\n // resend request, then instead return a network error.\n\n // - Set timingInfo’s final network-response start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated capability,\n // immediately after the user agent’s HTTP parser receives the first byte\n // of the response (e.g., frame header bytes for HTTP/2 or response status\n // line for HTTP/1.x).\n\n // - Wait until all the headers are transmitted.\n\n // - Any responses whose status is in the range 100 to 199, inclusive,\n // and is not 101, are to be ignored, except for the purposes of setting\n // timingInfo’s final network-response start time above.\n\n // - If request’s header list contains `Transfer-Encoding`/`chunked` and\n // response is transferred via HTTP/1.0 or older, then return a network\n // error.\n\n // - If the HTTP request results in a TLS client certificate dialog, then:\n\n // 1. If request’s window is an environment settings object, make the\n // dialog available in request’s window.\n\n // 2. Otherwise, return a network error.\n\n // To transmit request’s body body, run these steps:\n let requestBody = null\n // 1. If body is null and fetchParams’s process request end-of-body is\n // non-null, then queue a fetch task given fetchParams’s process request\n // end-of-body and fetchParams’s task destination.\n if (request.body == null && fetchParams.processRequestEndOfBody) {\n queueMicrotask(() => fetchParams.processRequestEndOfBody())\n } else if (request.body != null) {\n // 2. Otherwise, if body is non-null:\n\n // 1. Let processBodyChunk given bytes be these steps:\n const processBodyChunk = async function * (bytes) {\n // 1. If the ongoing fetch is terminated, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. Run this step in parallel: transmit bytes.\n yield bytes\n\n // 3. If fetchParams’s process request body is non-null, then run\n // fetchParams’s process request body given bytes’s length.\n fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n }\n\n // 2. Let processEndOfBody be these steps:\n const processEndOfBody = () => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If fetchParams’s process request end-of-body is non-null,\n // then run fetchParams’s process request end-of-body.\n if (fetchParams.processRequestEndOfBody) {\n fetchParams.processRequestEndOfBody()\n }\n }\n\n // 3. Let processBodyError given e be these steps:\n const processBodyError = (e) => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n if (e.name === 'AbortError') {\n fetchParams.controller.abort()\n } else {\n fetchParams.controller.terminate(e)\n }\n }\n\n // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n // processBodyError, and fetchParams’s task destination.\n requestBody = (async function * () {\n try {\n for await (const bytes of request.body.stream) {\n yield * processBodyChunk(bytes)\n }\n processEndOfBody()\n } catch (err) {\n processBodyError(err)\n }\n })()\n }\n\n try {\n // socket is only provided for websockets\n const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n if (socket) {\n response = makeResponse({ status, statusText, headersList, socket })\n } else {\n const iterator = body[Symbol.asyncIterator]()\n fetchParams.controller.next = () => iterator.next()\n\n response = makeResponse({ status, statusText, headersList })\n }\n } catch (err) {\n // 10. If aborted, then:\n if (err.name === 'AbortError') {\n // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n fetchParams.controller.connection.destroy()\n\n // 2. Return the appropriate network error for fetchParams.\n return makeAppropriateNetworkError(fetchParams, err)\n }\n\n return makeNetworkError(err)\n }\n\n // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n // if it is suspended.\n const pullAlgorithm = () => {\n return fetchParams.controller.resume()\n }\n\n // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n // controller with reason, given reason.\n const cancelAlgorithm = (reason) => {\n // If the aborted fetch was already terminated, then we do not\n // need to do anything.\n if (!isCancelled(fetchParams)) {\n fetchParams.controller.abort(reason)\n }\n }\n\n // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n // the user agent.\n // TODO\n\n // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n // TODO\n\n // 15. Let stream be a new ReadableStream.\n // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n // cancelAlgorithm set to cancelAlgorithm.\n const stream = new ReadableStream(\n {\n start (controller) {\n fetchParams.controller.controller = controller\n },\n pull: pullAlgorithm,\n cancel: cancelAlgorithm,\n type: 'bytes'\n }\n )\n\n // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. Set response’s body to a new body whose stream is stream.\n response.body = { stream, source: null, length: null }\n\n // 2. If response is not a network error and request’s cache mode is\n // not \"no-store\", then update response in httpCache for request.\n // TODO\n\n // 3. If includeCredentials is true and the user agent is not configured\n // to block cookies for request (see section 7 of [COOKIES]), then run the\n // \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n // the value of each header whose name is a byte-case-insensitive match for\n // `Set-Cookie` in response’s header list, if any, and request’s current URL.\n // TODO\n\n // 18. If aborted, then:\n // TODO\n\n // 19. Run these steps in parallel:\n\n // 1. Run these steps, but abort when fetchParams is canceled:\n if (!fetchParams.controller.resume) {\n fetchParams.controller.on('terminated', onAborted)\n }\n\n fetchParams.controller.resume = async () => {\n // 1. While true\n while (true) {\n // 1-3. See onData...\n\n // 4. Set bytes to the result of handling content codings given\n // codings and bytes.\n let bytes\n let isFailure\n try {\n const { done, value } = await fetchParams.controller.next()\n\n if (isAborted(fetchParams)) {\n break\n }\n\n bytes = done ? undefined : value\n } catch (err) {\n if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n // zlib doesn't like empty streams.\n bytes = undefined\n } else {\n bytes = err\n\n // err may be propagated from the result of calling readablestream.cancel,\n // which might not be an error. https://github.com/nodejs/undici/issues/2009\n isFailure = true\n }\n }\n\n if (bytes === undefined) {\n // 2. Otherwise, if the bytes transmission for response’s message\n // body is done normally and stream is readable, then close\n // stream, finalize response for fetchParams and response, and\n // abort these in-parallel steps.\n readableStreamClose(fetchParams.controller.controller)\n\n finalizeResponse(fetchParams, response)\n\n return\n }\n\n // 5. Increase timingInfo’s decoded body size by bytes’s length.\n timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n // 6. If bytes is failure, then terminate fetchParams’s controller.\n if (isFailure) {\n fetchParams.controller.terminate(bytes)\n return\n }\n\n // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n // into stream.\n const buffer = new Uint8Array(bytes)\n if (buffer.byteLength) {\n fetchParams.controller.controller.enqueue(buffer)\n }\n\n // 8. If stream is errored, then terminate the ongoing fetch.\n if (isErrored(stream)) {\n fetchParams.controller.terminate()\n return\n }\n\n // 9. If stream doesn’t need more data ask the user agent to suspend\n // the ongoing fetch.\n if (fetchParams.controller.controller.desiredSize <= 0) {\n return\n }\n }\n }\n\n // 2. If aborted, then:\n function onAborted (reason) {\n // 2. If fetchParams is aborted, then:\n if (isAborted(fetchParams)) {\n // 1. Set response’s aborted flag.\n response.aborted = true\n\n // 2. If stream is readable, then error stream with the result of\n // deserialize a serialized abort reason given fetchParams’s\n // controller’s serialized abort reason and an\n // implementation-defined realm.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(\n fetchParams.controller.serializedAbortReason\n )\n }\n } else {\n // 3. Otherwise, if stream is readable, error stream with a TypeError.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(new TypeError('terminated', {\n cause: isErrorLike(reason) ? reason : undefined\n }))\n }\n }\n\n // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n fetchParams.controller.connection.destroy()\n }\n\n // 20. Return response.\n return response\n\n function dispatch ({ body }) {\n const url = requestCurrentURL(request)\n /** @type {import('../../..').Agent} */\n const agent = fetchParams.controller.dispatcher\n\n const path = url.pathname + url.search\n const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === '?'\n\n return new Promise((resolve, reject) => agent.dispatch(\n {\n path: hasTrailingQuestionMark ? `${path}?` : path,\n origin: url.origin,\n method: request.method,\n body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n headers: request.headersList.entries,\n maxRedirections: 0,\n upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n },\n {\n body: null,\n abort: null,\n\n onConnect (abort) {\n // TODO (fix): Do we need connection here?\n const { connection } = fetchParams.controller\n\n // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n // time, and fetchParams’s cross-origin isolated capability.\n // TODO: implement connection timing\n timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n if (connection.destroyed) {\n abort(new DOMException('The operation was aborted.', 'AbortError'))\n } else {\n fetchParams.controller.on('terminated', abort)\n this.abort = connection.abort = abort\n }\n\n // Set timingInfo’s final network-request start time to the coarsened shared current time given\n // fetchParams’s cross-origin isolated capability.\n timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n },\n\n onResponseStarted () {\n // Set timingInfo’s final network-response start time to the coarsened shared current\n // time given fetchParams’s cross-origin isolated capability, immediately after the\n // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n // bytes for HTTP/2 or response status line for HTTP/1.x).\n timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n },\n\n onHeaders (status, rawHeaders, resume, statusText) {\n if (status < 200) {\n return false\n }\n\n const headersList = new HeadersList()\n\n for (let i = 0; i < rawHeaders.length; i += 2) {\n const nameStr = bufferToLowerCasedHeaderName(rawHeaders[i])\n const value = rawHeaders[i + 1]\n if (Array.isArray(value) && !Buffer.isBuffer(rawHeaders[i + 1])) {\n for (const val of value) {\n headersList.append(nameStr, val.toString('latin1'), true)\n }\n } else {\n headersList.append(nameStr, value.toString('latin1'), true)\n }\n }\n const location = headersList.get('location', true)\n\n this.body = new Readable({ read: resume })\n\n const willFollow = location && request.redirect === 'follow' &&\n redirectStatusSet.has(status)\n\n const decoders = []\n\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n const contentEncoding = headersList.get('content-encoding', true)\n // \"All content-coding values are case-insensitive...\"\n /** @type {string[]} */\n const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n // Limit the number of content-encodings to prevent resource exhaustion.\n // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n const maxContentEncodings = 5\n if (codings.length > maxContentEncodings) {\n reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n return true\n }\n\n for (let i = codings.length - 1; i >= 0; --i) {\n const coding = codings[i].trim()\n // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n if (coding === 'x-gzip' || coding === 'gzip') {\n decoders.push(zlib.createGunzip({\n // Be less strict when decoding compressed responses, since sometimes\n // servers send slightly invalid responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'deflate') {\n decoders.push(createInflate({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'br') {\n decoders.push(zlib.createBrotliDecompress({\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n }))\n } else if (coding === 'zstd' && hasZstd) {\n decoders.push(zlib.createZstdDecompress({\n flush: zlib.constants.ZSTD_e_continue,\n finishFlush: zlib.constants.ZSTD_e_end\n }))\n } else {\n decoders.length = 0\n break\n }\n }\n }\n\n const onError = this.onError.bind(this)\n\n resolve({\n status,\n statusText,\n headersList,\n body: decoders.length\n ? pipeline(this.body, ...decoders, (err) => {\n if (err) {\n this.onError(err)\n }\n }).on('error', onError)\n : this.body.on('error', onError)\n })\n\n return true\n },\n\n onData (chunk) {\n if (fetchParams.controller.dump) {\n return\n }\n\n // 1. If one or more bytes have been transmitted from response’s\n // message body, then:\n\n // 1. Let bytes be the transmitted bytes.\n const bytes = chunk\n\n // 2. Let codings be the result of extracting header list values\n // given `Content-Encoding` and response’s header list.\n // See pullAlgorithm.\n\n // 3. Increase timingInfo’s encoded body size by bytes’s length.\n timingInfo.encodedBodySize += bytes.byteLength\n\n // 4. See pullAlgorithm...\n\n return this.body.push(bytes)\n },\n\n onComplete () {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n fetchParams.controller.ended = true\n\n this.body.push(null)\n },\n\n onError (error) {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n this.body?.destroy(error)\n\n fetchParams.controller.terminate(error)\n\n reject(error)\n },\n\n onRequestUpgrade (_controller, status, headers, socket) {\n // We need to support 200 for websocket over h2 as per RFC-8441\n // Absence of session means H1\n if ((socket.session != null && status !== 200) || (socket.session == null && status !== 101)) {\n return false\n }\n\n const headersList = new HeadersList()\n\n for (const [name, value] of Object.entries(headers)) {\n if (value == null) {\n continue\n }\n\n const headerName = name.toLowerCase()\n\n if (Array.isArray(value)) {\n for (const entry of value) {\n headersList.append(headerName, String(entry), true)\n }\n } else {\n headersList.append(headerName, String(value), true)\n }\n }\n\n resolve({\n status,\n statusText: STATUS_CODES[status],\n headersList,\n socket\n })\n\n return true\n },\n\n onUpgrade (status, rawHeaders, socket) {\n // We need to support 200 for websocket over h2 as per RFC-8441\n // Absence of session means H1\n if ((socket.session != null && status !== 200) || (socket.session == null && status !== 101)) {\n return false\n }\n\n const headersList = new HeadersList()\n\n for (let i = 0; i < rawHeaders.length; i += 2) {\n const nameStr = bufferToLowerCasedHeaderName(rawHeaders[i])\n const value = rawHeaders[i + 1]\n if (Array.isArray(value) && !Buffer.isBuffer(rawHeaders[i + 1])) {\n for (const val of value) {\n headersList.append(nameStr, val.toString('latin1'), true)\n }\n } else {\n headersList.append(nameStr, value.toString('latin1'), true)\n }\n }\n\n resolve({\n status,\n statusText: STATUS_CODES[status],\n headersList,\n socket\n })\n\n return true\n }\n }\n ))\n }\n}\n\nmodule.exports = {\n fetch,\n Fetch,\n fetching,\n finalizeAndReportTiming\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n const serializedA = URLSerializer(A, excludeFragment)\n\n const serializedB = URLSerializer(B, excludeFragment)\n\n return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n assert(header !== null)\n\n const values = []\n\n for (let value of header.split(',')) {\n value = value.trim()\n\n if (isValidHeaderName(value)) {\n values.push(value)\n }\n }\n\n return values\n}\n\nmodule.exports = {\n urlEquals,\n getFieldValues\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst { kConstruct } = require('../../core/symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../webidl')\nconst { cloneResponse, fromInnerResponse, getResponseState } = require('../fetch/response')\nconst { Request, fromInnerRequest, getRequestState } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, readAllBytes } = require('../fetch/util')\nconst { createDeferredPromise } = require('../../util/promise')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n * @type {requestResponseList}\n */\n #relevantRequestResponseList\n\n constructor () {\n if (arguments[0] !== kConstruct) {\n webidl.illegalConstructor()\n }\n\n webidl.util.markAsUncloneable(this)\n this.#relevantRequestResponseList = arguments[1]\n }\n\n async match (request, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.match'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n const p = this.#internalMatchAll(request, options, 1)\n\n if (p.length === 0) {\n return\n }\n\n return p[0]\n }\n\n async matchAll (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.matchAll'\n if (request !== undefined) request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n return this.#internalMatchAll(request, options)\n }\n\n async add (request) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.add'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request)\n\n // 1.\n const requests = [request]\n\n // 2.\n const responseArrayPromise = this.addAll(requests)\n\n // 3.\n return await responseArrayPromise\n }\n\n async addAll (requests) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.addAll'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n // 1.\n const responsePromises = []\n\n // 2.\n const requestList = []\n\n // 3.\n for (let request of requests) {\n if (request === undefined) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: 'Argument 1',\n types: ['undefined is not allowed']\n })\n }\n\n request = webidl.converters.RequestInfo(request)\n\n if (typeof request === 'string') {\n continue\n }\n\n // 3.1\n const r = getRequestState(request)\n\n // 3.2\n if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected http/s scheme when method is not GET.'\n })\n }\n }\n\n // 4.\n /** @type {ReturnType<typeof fetching>[]} */\n const fetchControllers = []\n\n // 5.\n for (const request of requests) {\n // 5.1\n const r = getRequestState(new Request(request))\n\n // 5.2\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected http/s scheme.'\n })\n }\n\n // 5.4\n r.initiator = 'fetch'\n r.destination = 'subresource'\n\n // 5.5\n requestList.push(r)\n\n // 5.6\n const responsePromise = createDeferredPromise()\n\n // 5.7\n fetchControllers.push(fetching({\n request: r,\n processResponse (response) {\n // 1.\n if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Received an invalid status code or the request failed.'\n }))\n } else if (response.headersList.contains('vary')) { // 2.\n // 2.1\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n // 2.2\n for (const fieldValue of fieldValues) {\n // 2.2.1\n if (fieldValue === '*') {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'invalid vary field value'\n }))\n\n for (const controller of fetchControllers) {\n controller.abort()\n }\n\n return\n }\n }\n }\n },\n processResponseEndOfBody (response) {\n // 1.\n if (response.aborted) {\n responsePromise.reject(new DOMException('aborted', 'AbortError'))\n return\n }\n\n // 2.\n responsePromise.resolve(response)\n }\n }))\n\n // 5.8\n responsePromises.push(responsePromise.promise)\n }\n\n // 6.\n const p = Promise.all(responsePromises)\n\n // 7.\n const responses = await p\n\n // 7.1\n const operations = []\n\n // 7.2\n let index = 0\n\n // 7.3\n for (const response of responses) {\n // 7.3.1\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 7.3.2\n request: requestList[index], // 7.3.3\n response // 7.3.4\n }\n\n operations.push(operation) // 7.3.5\n\n index++ // 7.3.6\n }\n\n // 7.5\n const cacheJobPromise = createDeferredPromise()\n\n // 7.6.1\n let errorData = null\n\n // 7.6.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 7.6.3\n queueMicrotask(() => {\n // 7.6.3.1\n if (errorData === null) {\n cacheJobPromise.resolve(undefined)\n } else {\n // 7.6.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n // 7.7\n return cacheJobPromise.promise\n }\n\n async put (request, response) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.put'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n request = webidl.converters.RequestInfo(request)\n response = webidl.converters.Response(response, prefix, 'response')\n\n // 1.\n let innerRequest = null\n\n // 2.\n if (webidl.is.Request(request)) {\n innerRequest = getRequestState(request)\n } else { // 3.\n innerRequest = getRequestState(new Request(request))\n }\n\n // 4.\n if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected an http/s scheme when method is not GET'\n })\n }\n\n // 5.\n const innerResponse = getResponseState(response)\n\n // 6.\n if (innerResponse.status === 206) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Got 206 status'\n })\n }\n\n // 7.\n if (innerResponse.headersList.contains('vary')) {\n // 7.1.\n const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n // 7.2.\n for (const fieldValue of fieldValues) {\n // 7.2.1\n if (fieldValue === '*') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Got * vary field value'\n })\n }\n }\n }\n\n // 8.\n if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Response body is locked or disturbed'\n })\n }\n\n // 9.\n const clonedResponse = cloneResponse(innerResponse)\n\n // 10.\n const bodyReadPromise = createDeferredPromise()\n\n // 11.\n if (innerResponse.body != null) {\n // 11.1\n const stream = innerResponse.body.stream\n\n // 11.2\n const reader = stream.getReader()\n\n // 11.3\n readAllBytes(reader, bodyReadPromise.resolve, bodyReadPromise.reject)\n } else {\n bodyReadPromise.resolve(undefined)\n }\n\n // 12.\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n // 13.\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 14.\n request: innerRequest, // 15.\n response: clonedResponse // 16.\n }\n\n // 17.\n operations.push(operation)\n\n // 19.\n const bytes = await bodyReadPromise.promise\n\n if (clonedResponse.body != null) {\n clonedResponse.body.source = bytes\n }\n\n // 19.1\n const cacheJobPromise = createDeferredPromise()\n\n // 19.2.1\n let errorData = null\n\n // 19.2.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 19.2.3\n queueMicrotask(() => {\n // 19.2.3.1\n if (errorData === null) {\n cacheJobPromise.resolve()\n } else { // 19.2.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n async delete (request, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n /**\n * @type {Request}\n */\n let r = null\n\n if (webidl.is.Request(request)) {\n r = getRequestState(request)\n\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return false\n }\n } else {\n assert(typeof request === 'string')\n\n r = getRequestState(new Request(request))\n }\n\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'delete',\n request: r,\n options\n }\n\n operations.push(operation)\n\n const cacheJobPromise = createDeferredPromise()\n\n let errorData = null\n let requestResponses\n\n try {\n requestResponses = this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n queueMicrotask(() => {\n if (errorData === null) {\n cacheJobPromise.resolve(!!requestResponses?.length)\n } else {\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n * @param {any} request\n * @param {import('../../../types/cache').CacheQueryOptions} options\n * @returns {Promise<readonly Request[]>}\n */\n async keys (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.keys'\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n // 2.1\n if (webidl.is.Request(request)) {\n // 2.1.1\n r = getRequestState(request)\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') { // 2.2\n r = getRequestState(new Request(request))\n }\n }\n\n // 4.\n const promise = createDeferredPromise()\n\n // 5.\n // 5.1\n const requests = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n // 5.2.1.1\n requests.push(requestResponse[0])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n // 5.3.2.1\n requests.push(requestResponse[0])\n }\n }\n\n // 5.4\n queueMicrotask(() => {\n // 5.4.1\n const requestList = []\n\n // 5.4.2\n for (const request of requests) {\n const requestObject = fromInnerRequest(\n request,\n undefined,\n new AbortController().signal,\n 'immutable'\n )\n // 5.4.2.1\n requestList.push(requestObject)\n }\n\n // 5.4.3\n promise.resolve(Object.freeze(requestList))\n })\n\n return promise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n * @param {CacheBatchOperation[]} operations\n * @returns {requestResponseList}\n */\n #batchCacheOperations (operations) {\n // 1.\n const cache = this.#relevantRequestResponseList\n\n // 2.\n const backupCache = [...cache]\n\n // 3.\n const addedItems = []\n\n // 4.1\n const resultList = []\n\n try {\n // 4.2\n for (const operation of operations) {\n // 4.2.1\n if (operation.type !== 'delete' && operation.type !== 'put') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'operation type does not match \"delete\" or \"put\"'\n })\n }\n\n // 4.2.2\n if (operation.type === 'delete' && operation.response != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'delete operation should not have an associated response'\n })\n }\n\n // 4.2.3\n if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n throw new DOMException('???', 'InvalidStateError')\n }\n\n // 4.2.4\n let requestResponses\n\n // 4.2.5\n if (operation.type === 'delete') {\n // 4.2.5.1\n requestResponses = this.#queryCache(operation.request, operation.options)\n\n // TODO: the spec is wrong, this is needed to pass WPTs\n if (requestResponses.length === 0) {\n return []\n }\n\n // 4.2.5.2\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.5.2.1\n cache.splice(idx, 1)\n }\n } else if (operation.type === 'put') { // 4.2.6\n // 4.2.6.1\n if (operation.response == null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'put operation should have an associated response'\n })\n }\n\n // 4.2.6.2\n const r = operation.request\n\n // 4.2.6.3\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'expected http or https scheme'\n })\n }\n\n // 4.2.6.4\n if (r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'not get method'\n })\n }\n\n // 4.2.6.5\n if (operation.options != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'options must not be defined'\n })\n }\n\n // 4.2.6.6\n requestResponses = this.#queryCache(operation.request)\n\n // 4.2.6.7\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.6.7.1\n cache.splice(idx, 1)\n }\n\n // 4.2.6.8\n cache.push([operation.request, operation.response])\n\n // 4.2.6.10\n addedItems.push([operation.request, operation.response])\n }\n\n // 4.2.7\n resultList.push([operation.request, operation.response])\n }\n\n // 4.3\n return resultList\n } catch (e) { // 5.\n // 5.1\n this.#relevantRequestResponseList.length = 0\n\n // 5.2\n this.#relevantRequestResponseList = backupCache\n\n // 5.3\n throw e\n }\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#query-cache\n * @param {any} requestQuery\n * @param {import('../../../types/cache').CacheQueryOptions} options\n * @param {requestResponseList} targetStorage\n * @returns {requestResponseList}\n */\n #queryCache (requestQuery, options, targetStorage) {\n /** @type {requestResponseList} */\n const resultList = []\n\n const storage = targetStorage ?? this.#relevantRequestResponseList\n\n for (const requestResponse of storage) {\n const [cachedRequest, cachedResponse] = requestResponse\n if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n resultList.push(requestResponse)\n }\n }\n\n return resultList\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n * @param {any} requestQuery\n * @param {any} request\n * @param {any | null} response\n * @param {import('../../../types/cache').CacheQueryOptions | undefined} options\n * @returns {boolean}\n */\n #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n // if (options?.ignoreMethod === false && request.method === 'GET') {\n // return false\n // }\n\n const queryURL = new URL(requestQuery.url)\n\n const cachedURL = new URL(request.url)\n\n if (options?.ignoreSearch) {\n cachedURL.search = ''\n\n queryURL.search = ''\n }\n\n if (!urlEquals(queryURL, cachedURL, true)) {\n return false\n }\n\n if (\n response == null ||\n options?.ignoreVary ||\n !response.headersList.contains('vary')\n ) {\n return true\n }\n\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n for (const fieldValue of fieldValues) {\n if (fieldValue === '*') {\n return false\n }\n\n const requestValue = request.headersList.get(fieldValue)\n const queryValue = requestQuery.headersList.get(fieldValue)\n\n // If one has the header and the other doesn't, or one has\n // a different value than the other, return false\n if (requestValue !== queryValue) {\n return false\n }\n }\n\n return true\n }\n\n #internalMatchAll (request, options, maxResponses = Infinity) {\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n if (webidl.is.Request(request)) {\n // 2.1.1\n r = getRequestState(request)\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') {\n // 2.2.1\n r = getRequestState(new Request(request))\n }\n }\n\n // 5.\n // 5.1\n const responses = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n responses.push(requestResponse[1])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n responses.push(requestResponse[1])\n }\n }\n\n // 5.4\n // We don't implement CORs so we don't need to loop over the responses, yay!\n\n // 5.5.1\n const responseList = []\n\n // 5.5.2\n for (const response of responses) {\n // 5.5.2.1\n const responseObject = fromInnerResponse(cloneResponse(response), 'immutable')\n\n responseList.push(responseObject)\n\n if (responseList.length >= maxResponses) {\n break\n }\n }\n\n // 6.\n return Object.freeze(responseList)\n }\n}\n\nObject.defineProperties(Cache.prototype, {\n [Symbol.toStringTag]: {\n value: 'Cache',\n configurable: true\n },\n match: kEnumerableProperty,\n matchAll: kEnumerableProperty,\n add: kEnumerableProperty,\n addAll: kEnumerableProperty,\n put: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n {\n key: 'ignoreSearch',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'ignoreMethod',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'ignoreVary',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n ...cacheQueryOptionConverters,\n {\n key: 'cacheName',\n converter: webidl.converters.DOMString\n }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(\n webidl.is.Response,\n 'Response'\n)\n\nwebidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(\n webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n Cache\n}\n","'use strict'\n\nconst { Cache } = require('./cache')\nconst { webidl } = require('../webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\n\nclass CacheStorage {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n * @type {Map<string, import('./cache').requestResponseList}\n */\n #caches = new Map()\n\n constructor () {\n if (arguments[0] !== kConstruct) {\n webidl.illegalConstructor()\n }\n\n webidl.util.markAsUncloneable(this)\n }\n\n async match (request, options = {}) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, 'CacheStorage.match')\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.MultiCacheQueryOptions(options)\n\n // 1.\n if (options.cacheName != null) {\n // 1.1.1.1\n if (this.#caches.has(options.cacheName)) {\n // 1.1.1.1.1\n const cacheList = this.#caches.get(options.cacheName)\n const cache = new Cache(kConstruct, cacheList)\n\n return await cache.match(request, options)\n }\n } else { // 2.\n // 2.2\n for (const cacheList of this.#caches.values()) {\n const cache = new Cache(kConstruct, cacheList)\n\n // 2.2.1.2\n const response = await cache.match(request, options)\n\n if (response !== undefined) {\n return response\n }\n }\n }\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-has\n * @param {string} cacheName\n * @returns {Promise<boolean>}\n */\n async has (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.has'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n // 2.1.1\n // 2.2\n return this.#caches.has(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n * @param {string} cacheName\n * @returns {Promise<Cache>}\n */\n async open (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.open'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n // 2.1\n if (this.#caches.has(cacheName)) {\n // await caches.open('v1') !== await caches.open('v1')\n\n // 2.1.1\n const cache = this.#caches.get(cacheName)\n\n // 2.1.1.1\n return new Cache(kConstruct, cache)\n }\n\n // 2.2\n const cache = []\n\n // 2.3\n this.#caches.set(cacheName, cache)\n\n // 2.4\n return new Cache(kConstruct, cache)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n * @param {string} cacheName\n * @returns {Promise<boolean>}\n */\n async delete (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n return this.#caches.delete(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n * @returns {Promise<string[]>}\n */\n async keys () {\n webidl.brandCheck(this, CacheStorage)\n\n // 2.1\n const keys = this.#caches.keys()\n\n // 2.2\n return [...keys]\n }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n [Symbol.toStringTag]: {\n value: 'CacheStorage',\n configurable: true\n },\n match: kEnumerableProperty,\n has: kEnumerableProperty,\n open: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nmodule.exports = {\n CacheStorage\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n maxAttributeValueSize,\n maxNameValuePairSize\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n for (let i = 0; i < value.length; ++i) {\n const code = value.charCodeAt(i)\n\n if (\n (code >= 0x00 && code <= 0x08) ||\n (code >= 0x0A && code <= 0x1F) ||\n code === 0x7F\n ) {\n return true\n }\n }\n return false\n}\n\n/**\n CHAR = <any US-ASCII character (octets 0 - 127)>\n token = 1*<any CHAR except CTLs or separators>\n separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n for (let i = 0; i < name.length; ++i) {\n const code = name.charCodeAt(i)\n\n if (\n code < 0x21 || // exclude CTLs (0-31), SP and HT\n code > 0x7E || // exclude non-ascii and DEL\n code === 0x22 || // \"\n code === 0x28 || // (\n code === 0x29 || // )\n code === 0x3C || // <\n code === 0x3E || // >\n code === 0x40 || // @\n code === 0x2C || // ,\n code === 0x3B || // ;\n code === 0x3A || // :\n code === 0x5C || // \\\n code === 0x2F || // /\n code === 0x5B || // [\n code === 0x5D || // ]\n code === 0x3F || // ?\n code === 0x3D || // =\n code === 0x7B || // {\n code === 0x7D // }\n ) {\n throw new Error('Invalid cookie name')\n }\n }\n}\n\n/**\n cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n ; US-ASCII characters excluding CTLs,\n ; whitespace DQUOTE, comma, semicolon,\n ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n let len = value.length\n let i = 0\n\n // if the value is wrapped in DQUOTE\n if (value[0] === '\"') {\n if (len === 1 || value[len - 1] !== '\"') {\n throw new Error('Invalid cookie value')\n }\n --len\n ++i\n }\n\n while (i < len) {\n const code = value.charCodeAt(i++)\n\n if (\n code < 0x21 || // exclude CTLs (0-31)\n code > 0x7E || // non-ascii and DEL (127)\n code === 0x22 || // \"\n code === 0x2C || // ,\n code === 0x3B || // ;\n code === 0x5C // \\\n ) {\n throw new Error('Invalid cookie value')\n }\n }\n}\n\n/**\n * path-value = <any CHAR except CTLs or \";\">\n * @param {string} path\n */\nfunction validateCookiePath (path) {\n for (let i = 0; i < path.length; ++i) {\n const code = path.charCodeAt(i)\n\n if (\n code < 0x20 || // exclude CTLs (0-31)\n code > 0x7E || // exclude DEL and non-ascii\n code === 0x3B // ;\n ) {\n throw new Error('Invalid cookie path')\n }\n }\n}\n\n/**\n * <let-dig> ::= <letter> | <digit>\n *\n * <letter> ::= any one of the 52 alphabetic characters A through Z in\n * upper case and a through z in lower case\n *\n * <digit> ::= any one of the ten digits 0 through 9r\n *\n * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5\n * @param {number} code\n */\nfunction isLetterOrDigit (code) {\n return (\n (code >= 0x30 && code <= 0x39) || // 0-9\n (code >= 0x41 && code <= 0x5A) || // A-Z\n (code >= 0x61 && code <= 0x7A) // a-z\n )\n}\n\n/**\n * Validates a cookie domain against the \"preferred name syntax\".\n *\n * <domain> ::= <subdomain> | \" \"\n * <subdomain> ::= <label> | <subdomain> \".\" <label>\n * <label> ::= <let-dig> [ [ <ldh-str> ] <let-dig> ]\n * <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n * <let-dig-hyp> ::= <let-dig> | \"-\"\n *\n * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5\n * @see https://www.rfc-editor.org/rfc/rfc1123#section-2.1\n * @see https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n // <domain> ::= <subdomain> | \" \"\n if (domain === ' ') {\n return\n }\n\n if (domain.length > 255) {\n throw new Error('Invalid cookie domain')\n }\n\n let labelLength = 0\n\n for (let i = 0; i < domain.length; ++i) {\n const code = domain.charCodeAt(i)\n\n if (code === 0x2E) {\n if (labelLength === 0) {\n throw new Error('Invalid cookie domain')\n }\n\n if (domain.charCodeAt(i - 1) === 0x2D) { // \"-\"\n throw new Error('Invalid cookie domain')\n }\n\n labelLength = 0\n continue\n }\n\n if (labelLength === 0 && !isLetterOrDigit(code)) {\n throw new Error('Invalid cookie domain')\n }\n\n if (!isLetterOrDigit(code) && code !== 0x2D) { // \"-\"\n throw new Error('Invalid cookie domain')\n }\n\n if (++labelLength > 63) {\n throw new Error('Invalid cookie domain')\n }\n }\n\n if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 0x2D) { // \"-\"\n throw new Error('Invalid cookie domain')\n }\n}\n\nconst IMFDays = [\n 'Sun', 'Mon', 'Tue', 'Wed',\n 'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n IMF-fixdate = day-name \",\" SP date1 SP time-of-day SP GMT\n ; fixed length/zone/capitalization subset of the format\n ; see Section 3.3 of [RFC5322]\n\n day-name = %x4D.6F.6E ; \"Mon\", case-sensitive\n / %x54.75.65 ; \"Tue\", case-sensitive\n / %x57.65.64 ; \"Wed\", case-sensitive\n / %x54.68.75 ; \"Thu\", case-sensitive\n / %x46.72.69 ; \"Fri\", case-sensitive\n / %x53.61.74 ; \"Sat\", case-sensitive\n / %x53.75.6E ; \"Sun\", case-sensitive\n date1 = day SP month SP year\n ; e.g., 02 Jun 1982\n\n day = 2DIGIT\n month = %x4A.61.6E ; \"Jan\", case-sensitive\n / %x46.65.62 ; \"Feb\", case-sensitive\n / %x4D.61.72 ; \"Mar\", case-sensitive\n / %x41.70.72 ; \"Apr\", case-sensitive\n / %x4D.61.79 ; \"May\", case-sensitive\n / %x4A.75.6E ; \"Jun\", case-sensitive\n / %x4A.75.6C ; \"Jul\", case-sensitive\n / %x41.75.67 ; \"Aug\", case-sensitive\n / %x53.65.70 ; \"Sep\", case-sensitive\n / %x4F.63.74 ; \"Oct\", case-sensitive\n / %x4E.6F.76 ; \"Nov\", case-sensitive\n / %x44.65.63 ; \"Dec\", case-sensitive\n year = 4DIGIT\n\n GMT = %x47.4D.54 ; \"GMT\", case-sensitive\n\n time-of-day = hour \":\" minute \":\" second\n ; 00:00:00 - 23:59:60 (leap second)\n\n hour = 2DIGIT\n minute = 2DIGIT\n second = 2DIGIT\n */\nfunction toIMFDate (date) {\n if (typeof date === 'number') {\n date = new Date(date)\n }\n\n return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av = \"Max-Age=\" non-zero-digit *DIGIT\n ; In practice, both expires-av and max-age-av\n ; are limited to dates representable by the\n ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n if (maxAge < 0) {\n throw new Error('Invalid cookie max-age')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n if (cookie.name.length === 0) {\n return null\n }\n\n validateCookieName(cookie.name)\n validateCookieValue(cookie.value)\n\n const out = [`${cookie.name}=${cookie.value}`]\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n if (cookie.name.startsWith('__Secure-')) {\n cookie.secure = true\n }\n\n if (cookie.name.startsWith('__Host-')) {\n cookie.secure = true\n cookie.domain = null\n cookie.path = '/'\n }\n\n if (cookie.secure) {\n out.push('Secure')\n }\n\n if (cookie.httpOnly) {\n out.push('HttpOnly')\n }\n\n if (typeof cookie.maxAge === 'number') {\n validateCookieMaxAge(cookie.maxAge)\n out.push(`Max-Age=${cookie.maxAge}`)\n }\n\n if (cookie.domain) {\n validateCookieDomain(cookie.domain)\n out.push(`Domain=${cookie.domain}`)\n }\n\n if (cookie.path) {\n validateCookiePath(cookie.path)\n out.push(`Path=${cookie.path}`)\n }\n\n if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n out.push(`Expires=${toIMFDate(cookie.expires)}`)\n }\n\n if (cookie.sameSite) {\n out.push(`SameSite=${cookie.sameSite}`)\n }\n\n for (const part of cookie.unparsed) {\n if (!part.includes('=')) {\n throw new Error('Invalid unparsed')\n }\n\n const [key, ...value] = part.split('=')\n\n const trimmedKey = key.trim()\n const joinedValue = value.join('=')\n\n validateCookieName(trimmedKey)\n validateCookieValue(joinedValue)\n\n out.push(`${trimmedKey}=${joinedValue}`)\n }\n\n return out.join('; ')\n}\n\nmodule.exports = {\n isCTLExcludingHtab,\n validateCookieName,\n validateCookiePath,\n validateCookieValue,\n toIMFDate,\n stringify\n}\n","'use strict'\n\nconst { collectASequenceOfCodePointsFast } = require('../infra')\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns {import('./index').Cookie|null} if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n // character (CTL characters excluding HTAB): Abort these steps and\n // ignore the set-cookie-string entirely.\n if (isCTLExcludingHtab(header)) {\n return null\n }\n\n let nameValuePair = ''\n let unparsedAttributes = ''\n let name = ''\n let value = ''\n\n // 2. If the set-cookie-string contains a %x3B (\";\") character:\n if (header.includes(';')) {\n // 1. The name-value-pair string consists of the characters up to,\n // but not including, the first %x3B (\";\"), and the unparsed-\n // attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\n const position = { position: 0 }\n\n nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n unparsedAttributes = header.slice(position.position)\n } else {\n // Otherwise:\n\n // 1. The name-value-pair string consists of all the characters\n // contained in the set-cookie-string, and the unparsed-\n // attributes is the empty string.\n nameValuePair = header\n }\n\n // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n // the name string is empty, and the value string is the value of\n // name-value-pair.\n if (!nameValuePair.includes('=')) {\n value = nameValuePair\n } else {\n // Otherwise, the name string consists of the characters up to, but\n // not including, the first %x3D (\"=\") character, and the (possibly\n // empty) value string consists of the characters after the first\n // %x3D (\"=\") character.\n const position = { position: 0 }\n name = collectASequenceOfCodePointsFast(\n '=',\n nameValuePair,\n position\n )\n value = nameValuePair.slice(position.position + 1)\n }\n\n // 4. Remove any leading or trailing WSP characters from the name\n // string and the value string.\n name = name.trim()\n value = value.trim()\n\n // 5. If the sum of the lengths of the name string and the value string\n // is more than 4096 octets, abort these steps and ignore the set-\n // cookie-string entirely.\n if (name.length + value.length > maxNameValuePairSize) {\n return null\n }\n\n // 6. The cookie-name is the name string, and the cookie-value is the\n // value string.\n // https://datatracker.ietf.org/doc/html/rfc6265\n // To maximize compatibility with user agents, servers that wish to\n // store arbitrary data in a cookie-value SHOULD encode that data, for\n // example, using Base64 [RFC4648].\n return {\n name, value, ...parseUnparsedAttributes(unparsedAttributes)\n }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {Object.<string, unknown>} [cookieAttributeList={}]\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n // 1. If the unparsed-attributes string is empty, skip the rest of\n // these steps.\n if (unparsedAttributes.length === 0) {\n return cookieAttributeList\n }\n\n // 2. Discard the first character of the unparsed-attributes (which\n // will be a %x3B (\";\") character).\n assert(unparsedAttributes[0] === ';')\n unparsedAttributes = unparsedAttributes.slice(1)\n\n let cookieAv = ''\n\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n if (unparsedAttributes.includes(';')) {\n // 1. Consume the characters of the unparsed-attributes up to, but\n // not including, the first %x3B (\";\") character.\n cookieAv = collectASequenceOfCodePointsFast(\n ';',\n unparsedAttributes,\n { position: 0 }\n )\n unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n } else {\n // Otherwise:\n\n // 1. Consume the remainder of the unparsed-attributes.\n cookieAv = unparsedAttributes\n unparsedAttributes = ''\n }\n\n // Let the cookie-av string be the characters consumed in this step.\n\n let attributeName = ''\n let attributeValue = ''\n\n // 4. If the cookie-av string contains a %x3D (\"=\") character:\n if (cookieAv.includes('=')) {\n // 1. The (possibly empty) attribute-name string consists of the\n // characters up to, but not including, the first %x3D (\"=\")\n // character, and the (possibly empty) attribute-value string\n // consists of the characters after the first %x3D (\"=\")\n // character.\n const position = { position: 0 }\n\n attributeName = collectASequenceOfCodePointsFast(\n '=',\n cookieAv,\n position\n )\n attributeValue = cookieAv.slice(position.position + 1)\n } else {\n // Otherwise:\n\n // 1. The attribute-name string consists of the entire cookie-av\n // string, and the attribute-value string is empty.\n attributeName = cookieAv\n }\n\n // 5. Remove any leading or trailing WSP characters from the attribute-\n // name string and the attribute-value string.\n attributeName = attributeName.trim()\n attributeValue = attributeValue.trim()\n\n // 6. If the attribute-value is longer than 1024 octets, ignore the\n // cookie-av string and return to Step 1 of this algorithm.\n if (attributeValue.length > maxAttributeValueSize) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 7. Process the attribute-name and attribute-value according to the\n // requirements in the following subsections. (Notice that\n // attributes with unrecognized attribute-names are ignored.)\n const attributeNameLowercase = attributeName.toLowerCase()\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n // If the attribute-name case-insensitively matches the string\n // \"Expires\", the user agent MUST process the cookie-av as follows.\n if (attributeNameLowercase === 'expires') {\n // 1. Let the expiry-time be the result of parsing the attribute-value\n // as cookie-date (see Section 5.1.1).\n const expiryTime = new Date(attributeValue)\n\n // 2. If the attribute-value failed to parse as a cookie date, ignore\n // the cookie-av.\n\n cookieAttributeList.expires = expiryTime\n } else if (attributeNameLowercase === 'max-age') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n // If the attribute-name case-insensitively matches the string \"Max-\n // Age\", the user agent MUST process the cookie-av as follows.\n\n // 1. If the first character of the attribute-value is not a DIGIT or a\n // \"-\" character, ignore the cookie-av.\n const charCode = attributeValue.charCodeAt(0)\n\n if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 2. If the remainder of attribute-value contains a non-DIGIT\n // character, ignore the cookie-av.\n if (!/^\\d+$/.test(attributeValue)) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 3. Let delta-seconds be the attribute-value converted to an integer.\n const deltaSeconds = Number(attributeValue)\n\n // 4. Let cookie-age-limit be the maximum age of the cookie (which\n // SHOULD be 400 days or less, see Section 4.1.2.2).\n\n // 5. Set delta-seconds to the smaller of its present value and cookie-\n // age-limit.\n // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n // time be the earliest representable date and time. Otherwise, let\n // the expiry-time be the current date and time plus delta-seconds\n // seconds.\n // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n // 7. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Max-Age and an attribute-value of expiry-time.\n cookieAttributeList.maxAge = deltaSeconds\n } else if (attributeNameLowercase === 'domain') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n // If the attribute-name case-insensitively matches the string \"Domain\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. Let cookie-domain be the attribute-value.\n let cookieDomain = attributeValue\n\n // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n // cookie-domain without its leading %x2E (\".\").\n if (cookieDomain[0] === '.') {\n cookieDomain = cookieDomain.slice(1)\n }\n\n // 3. Convert the cookie-domain to lower case.\n cookieDomain = cookieDomain.toLowerCase()\n\n // 4. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Domain and an attribute-value of cookie-domain.\n cookieAttributeList.domain = cookieDomain\n } else if (attributeNameLowercase === 'path') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n // If the attribute-name case-insensitively matches the string \"Path\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. If the attribute-value is empty or if the first character of the\n // attribute-value is not %x2F (\"/\"):\n let cookiePath = ''\n if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n // 1. Let cookie-path be the default-path.\n cookiePath = '/'\n } else {\n // Otherwise:\n\n // 1. Let cookie-path be the attribute-value.\n cookiePath = attributeValue\n }\n\n // 2. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Path and an attribute-value of cookie-path.\n cookieAttributeList.path = cookiePath\n } else if (attributeNameLowercase === 'secure') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n // If the attribute-name case-insensitively matches the string \"Secure\",\n // the user agent MUST append an attribute to the cookie-attribute-list\n // with an attribute-name of Secure and an empty attribute-value.\n\n cookieAttributeList.secure = true\n } else if (attributeNameLowercase === 'httponly') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n // If the attribute-name case-insensitively matches the string\n // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n // attribute-list with an attribute-name of HttpOnly and an empty\n // attribute-value.\n\n cookieAttributeList.httpOnly = true\n } else if (attributeNameLowercase === 'samesite') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n // If the attribute-name case-insensitively matches the string\n // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n const attributeValueLowercase = attributeValue.toLowerCase()\n\n // 1. If cookie-av's attribute-value is a case-insensitive match for\n // \"None\", append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of \"None\".\n if (attributeValueLowercase === 'none') {\n cookieAttributeList.sameSite = 'None'\n } else if (attributeValueLowercase === 'strict') {\n // 2. If cookie-av's attribute-value is a case-insensitive match for\n // \"Strict\", append an attribute to the cookie-attribute-list with\n // an attribute-name of \"SameSite\" and an attribute-value of\n // \"Strict\".\n cookieAttributeList.sameSite = 'Strict'\n } else if (attributeValueLowercase === 'lax') {\n // 3. If cookie-av's attribute-value is a case-insensitive match for\n // \"Lax\", append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n cookieAttributeList.sameSite = 'Lax'\n }\n } else {\n cookieAttributeList.unparsed ??= []\n\n cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n }\n\n // 8. Return to Step 1 of this algorithm.\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n parseSetCookie,\n parseUnparsedAttributes\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../webidl')\nconst { Headers } = require('../fetch/headers')\n\nconst brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filter(Boolean))\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number} [expires]\n * @property {number} [maxAge]\n * @property {string} [domain]\n * @property {string} [path]\n * @property {boolean} [secure]\n * @property {boolean} [httpOnly]\n * @property {'Strict'|'Lax'|'None'} [sameSite]\n * @property {string[]} [unparsed]\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record<string, string>}\n */\nfunction getCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n brandChecks(headers)\n\n const cookie = headers.get('cookie')\n\n /** @type {Record<string, string>} */\n const out = {}\n\n if (!cookie) {\n return out\n }\n\n for (const piece of cookie.split(';')) {\n const [name, ...value] = piece.split('=')\n\n out[name.trim()] = value.join('=')\n }\n\n return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n brandChecks(headers)\n\n const prefix = 'deleteCookie'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n name = webidl.converters.DOMString(name, prefix, 'name')\n attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n // Matches behavior of\n // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n setCookie(headers, {\n name,\n value: '',\n expires: new Date(0),\n ...attributes\n })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n brandChecks(headers)\n\n const cookies = headers.getSetCookie()\n\n if (!cookies) {\n return []\n }\n\n return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * Parses a cookie string\n * @param {string} cookie\n */\nfunction parseCookie (cookie) {\n cookie = webidl.converters.DOMString(cookie)\n\n return parseSetCookie(cookie)\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n brandChecks(headers)\n\n cookie = webidl.converters.Cookie(cookie)\n\n const str = stringify(cookie)\n\n if (str) {\n headers.append('set-cookie', str, true)\n }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: () => null\n }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n {\n converter: webidl.converters.DOMString,\n key: 'name'\n },\n {\n converter: webidl.converters.DOMString,\n key: 'value'\n },\n {\n converter: webidl.nullableConverter((value) => {\n if (typeof value === 'number') {\n return webidl.converters['unsigned long long'](value)\n }\n\n return new Date(value)\n }),\n key: 'expires',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters['long long']),\n key: 'maxAge',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'secure',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'httpOnly',\n defaultValue: () => null\n },\n {\n converter: webidl.converters.USVString,\n key: 'sameSite',\n allowedValues: ['Strict', 'Lax', 'None']\n },\n {\n converter: webidl.sequenceConverter(webidl.converters.DOMString),\n key: 'unparsed',\n defaultValue: () => []\n }\n])\n\nmodule.exports = {\n getCookies,\n deleteCookie,\n getSetCookies,\n setCookie,\n parseCookie\n}\n","'use strict'\n\nconst { webidl } = require('../webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n if (type === kConstruct) {\n super(arguments[1], arguments[2])\n webidl.util.markAsUncloneable(this)\n return\n }\n\n const prefix = 'MessageEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n webidl.util.markAsUncloneable(this)\n }\n\n get data () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.data\n }\n\n get origin () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.origin\n }\n\n get lastEventId () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.lastEventId\n }\n\n get source () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.source\n }\n\n get ports () {\n webidl.brandCheck(this, MessageEvent)\n\n if (!Object.isFrozen(this.#eventInit.ports)) {\n Object.freeze(this.#eventInit.ports)\n }\n\n return this.#eventInit.ports\n }\n\n initMessageEvent (\n type,\n bubbles = false,\n cancelable = false,\n data = null,\n origin = '',\n lastEventId = '',\n source = null,\n ports = []\n ) {\n webidl.brandCheck(this, MessageEvent)\n\n webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n return new MessageEvent(type, {\n bubbles, cancelable, data, origin, lastEventId, source, ports\n })\n }\n\n static createFastMessageEvent (type, init) {\n const messageEvent = new MessageEvent(kConstruct, type, init)\n messageEvent.#eventInit = init\n messageEvent.#eventInit.data ??= null\n messageEvent.#eventInit.origin ??= ''\n messageEvent.#eventInit.lastEventId ??= ''\n messageEvent.#eventInit.source ??= null\n messageEvent.#eventInit.ports ??= []\n return messageEvent\n }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n const prefix = 'CloseEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n webidl.util.markAsUncloneable(this)\n }\n\n get wasClean () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.wasClean\n }\n\n get code () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.code\n }\n\n get reason () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.reason\n }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict) {\n const prefix = 'ErrorEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n super(type, eventInitDict)\n webidl.util.markAsUncloneable(this)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n this.#eventInit = eventInitDict\n }\n\n get message () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.message\n }\n\n get filename () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.filename\n }\n\n get lineno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.lineno\n }\n\n get colno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.colno\n }\n\n get error () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.error\n }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'MessageEvent',\n configurable: true\n },\n data: kEnumerableProperty,\n origin: kEnumerableProperty,\n lastEventId: kEnumerableProperty,\n source: kEnumerableProperty,\n ports: kEnumerableProperty,\n initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'CloseEvent',\n configurable: true\n },\n reason: kEnumerableProperty,\n code: kEnumerableProperty,\n wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'ErrorEvent',\n configurable: true\n },\n message: kEnumerableProperty,\n filename: kEnumerableProperty,\n lineno: kEnumerableProperty,\n colno: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(\n webidl.is.MessagePort,\n 'MessagePort'\n)\n\nwebidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(\n webidl.converters.MessagePort\n)\n\nconst eventInit = [\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'data',\n converter: webidl.converters.any,\n defaultValue: () => null\n },\n {\n key: 'origin',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n },\n {\n key: 'lastEventId',\n converter: webidl.converters.DOMString,\n defaultValue: () => ''\n },\n {\n key: 'source',\n // Node doesn't implement WindowProxy or ServiceWorker, so the only\n // valid value for source is a MessagePort.\n converter: webidl.nullableConverter(webidl.converters.MessagePort),\n defaultValue: () => null\n },\n {\n key: 'ports',\n converter: webidl.converters['sequence<MessagePort>'],\n defaultValue: () => []\n }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'wasClean',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'code',\n converter: webidl.converters['unsigned short'],\n defaultValue: () => 0\n },\n {\n key: 'reason',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'message',\n converter: webidl.converters.DOMString,\n defaultValue: () => ''\n },\n {\n key: 'filename',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n },\n {\n key: 'lineno',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => 0\n },\n {\n key: 'colno',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => 0\n },\n {\n key: 'error',\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n MessageEvent,\n CloseEvent,\n ErrorEvent,\n createFastMessageEvent\n}\n","'use strict'\n\n/**\n * This is a Globally Unique Identifier unique used to validate that the\n * endpoint accepts websocket connections.\n * @see https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\n * @type {'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'}\n */\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/**\n * @type {PropertyDescriptor}\n */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\n/**\n * The states of the WebSocket connection.\n *\n * @readonly\n * @enum\n * @property {0} CONNECTING\n * @property {1} OPEN\n * @property {2} CLOSING\n * @property {3} CLOSED\n */\nconst states = {\n CONNECTING: 0,\n OPEN: 1,\n CLOSING: 2,\n CLOSED: 3\n}\n\n/**\n * @readonly\n * @enum\n * @property {0} NOT_SENT\n * @property {1} PROCESSING\n * @property {2} SENT\n */\nconst sentCloseFrameState = {\n SENT: 1,\n RECEIVED: 2\n}\n\n/**\n * The WebSocket opcodes.\n *\n * @readonly\n * @enum\n * @property {0x0} CONTINUATION\n * @property {0x1} TEXT\n * @property {0x2} BINARY\n * @property {0x8} CLOSE\n * @property {0x9} PING\n * @property {0xA} PONG\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n */\nconst opcodes = {\n CONTINUATION: 0x0,\n TEXT: 0x1,\n BINARY: 0x2,\n CLOSE: 0x8,\n PING: 0x9,\n PONG: 0xA\n}\n\n/**\n * The maximum value for an unsigned 16-bit integer.\n *\n * @type {65535} 2 ** 16 - 1\n */\nconst maxUnsigned16Bit = 65535\n\n/**\n * The states of the parser.\n *\n * @readonly\n * @enum\n * @property {0} INFO\n * @property {2} PAYLOADLENGTH_16\n * @property {3} PAYLOADLENGTH_64\n * @property {4} READ_DATA\n */\nconst parserStates = {\n INFO: 0,\n PAYLOADLENGTH_16: 2,\n PAYLOADLENGTH_64: 3,\n READ_DATA: 4\n}\n\n/**\n * An empty buffer.\n *\n * @type {Buffer}\n */\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\n/**\n * @readonly\n * @property {1} text\n * @property {2} typedArray\n * @property {3} arrayBuffer\n * @property {4} blob\n */\nconst sendHints = {\n text: 1,\n typedArray: 2,\n arrayBuffer: 3,\n blob: 4\n}\n\nmodule.exports = {\n uid,\n sentCloseFrameState,\n staticPropertyDescriptors,\n states,\n opcodes,\n maxUnsigned16Bit,\n parserStates,\n emptyBuffer,\n sendHints\n}\n","'use strict'\n\nconst { states, opcodes } = require('./constants')\nconst { isUtf8 } = require('node:buffer')\nconst { removeHTTPWhitespace } = require('../fetch/data-url')\nconst { collectASequenceOfCodePointsFast } = require('../infra')\n\n/**\n * @param {number} readyState\n * @returns {boolean}\n */\nfunction isConnecting (readyState) {\n // If the WebSocket connection is not yet established, and the connection\n // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n return readyState === states.CONNECTING\n}\n\n/**\n * @param {number} readyState\n * @returns {boolean}\n */\nfunction isEstablished (readyState) {\n // If the server's response is validated as provided for above, it is\n // said that _The WebSocket Connection is Established_ and that the\n // WebSocket Connection is in the OPEN state.\n return readyState === states.OPEN\n}\n\n/**\n * @param {number} readyState\n * @returns {boolean}\n */\nfunction isClosing (readyState) {\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n return readyState === states.CLOSING\n}\n\n/**\n * @param {number} readyState\n * @returns {boolean}\n */\nfunction isClosed (readyState) {\n return readyState === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters<typeof Event>) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n * @returns {void}\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n // 2. Let event be the result of creating an event given eventConstructor,\n // in the relevant realm of target.\n // 3. Initialize event’s type attribute to e.\n const event = eventFactory(e, eventInitDict)\n\n // 4. Initialize any other IDL attributes of event as described in the\n // invocation of this algorithm.\n\n // 5. Return the result of dispatching event at target, with legacy target\n // override flag set if set.\n target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').Handler} handler\n * @param {number} type Opcode\n * @param {Buffer} data application data\n * @returns {void}\n */\nfunction websocketMessageReceived (handler, type, data) {\n handler.onMessage(type, data)\n}\n\n/**\n * @param {Buffer} buffer\n * @returns {ArrayBuffer}\n */\nfunction toArrayBuffer (buffer) {\n if (buffer.byteLength === buffer.buffer.byteLength) {\n return buffer.buffer\n }\n return new Uint8Array(buffer).buffer\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n * @returns {boolean}\n */\nfunction isValidSubprotocol (protocol) {\n // If present, this value indicates one\n // or more comma-separated subprotocol the client wishes to speak,\n // ordered by preference. The elements that comprise this value\n // MUST be non-empty strings with characters in the range U+0021 to\n // U+007E not including separator characters as defined in\n // [RFC2616] and MUST all be unique strings.\n if (protocol.length === 0) {\n return false\n }\n\n for (let i = 0; i < protocol.length; ++i) {\n const code = protocol.charCodeAt(i)\n\n if (\n code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n code > 0x7E ||\n code === 0x22 || // \"\n code === 0x28 || // (\n code === 0x29 || // )\n code === 0x2C || // ,\n code === 0x2F || // /\n code === 0x3A || // :\n code === 0x3B || // ;\n code === 0x3C || // <\n code === 0x3D || // =\n code === 0x3E || // >\n code === 0x3F || // ?\n code === 0x40 || // @\n code === 0x5B || // [\n code === 0x5C || // \\\n code === 0x5D || // ]\n code === 0x7B || // {\n code === 0x7D // }\n ) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n * @returns {boolean}\n */\nfunction isValidStatusCode (code) {\n if (code >= 1000 && code < 1015) {\n return (\n code !== 1004 && // reserved\n code !== 1005 && // \"MUST NOT be set as a status code\"\n code !== 1006 // \"MUST NOT be set as a status code\"\n )\n }\n\n return code >= 3000 && code <= 4999\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n * @returns {boolean}\n */\nfunction isControlFrame (opcode) {\n return (\n opcode === opcodes.CLOSE ||\n opcode === opcodes.PING ||\n opcode === opcodes.PONG\n )\n}\n\n/**\n * @param {number} opcode\n * @returns {boolean}\n */\nfunction isContinuationFrame (opcode) {\n return opcode === opcodes.CONTINUATION\n}\n\n/**\n * @param {number} opcode\n * @returns {boolean}\n */\nfunction isTextBinaryFrame (opcode) {\n return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\n/**\n *\n * @param {number} opcode\n * @returns {boolean}\n */\nfunction isValidOpcode (opcode) {\n return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map<string, string>}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n const position = { position: 0 }\n const extensionList = new Map()\n\n while (position.position < extensions.length) {\n const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n const [name, value = ''] = pair.split('=', 2)\n\n extensionList.set(\n removeHTTPWhitespace(name, true, false),\n removeHTTPWhitespace(value, false, true)\n )\n\n position.position++\n }\n\n return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidClientWindowBits (value) {\n // Must have at least one character\n if (value.length === 0) {\n return false\n }\n\n // Check all characters are ASCII digits\n for (let i = 0; i < value.length; i++) {\n const byte = value.charCodeAt(i)\n\n if (byte < 0x30 || byte > 0x39) {\n return false\n }\n }\n\n // Check numeric range: zlib requires windowBits in range 8-15\n const num = Number.parseInt(value, 10)\n return num >= 8 && num <= 15\n}\n\n/**\n * @see https://whatpr.org/websockets/48/7b748d3...d5570f3.html#get-a-url-record\n * @param {string} url\n * @param {string} [baseURL]\n */\nfunction getURLRecord (url, baseURL) {\n // 1. Let urlRecord be the result of applying the URL parser to url with baseURL .\n // 2. If urlRecord is failure, then throw a \" SyntaxError \" DOMException .\n let urlRecord\n\n try {\n urlRecord = new URL(url, baseURL)\n } catch (e) {\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 3. If urlRecord ’s scheme is \" http \", then set urlRecord ’s scheme to \" ws \".\n // 4. Otherwise, if urlRecord ’s scheme is \" https \", set urlRecord ’s scheme to \" wss \".\n if (urlRecord.protocol === 'http:') {\n urlRecord.protocol = 'ws:'\n } else if (urlRecord.protocol === 'https:') {\n urlRecord.protocol = 'wss:'\n }\n\n // 5. If urlRecord ’s scheme is not \" ws \" or \" wss \", then throw a \" SyntaxError \" DOMException .\n if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n throw new DOMException('expected a ws: or wss: url', 'SyntaxError')\n }\n\n // If urlRecord ’s fragment is non-null, then throw a \" SyntaxError \" DOMException .\n if (urlRecord.hash.length || urlRecord.href.endsWith('#')) {\n throw new DOMException('hash', 'SyntaxError')\n }\n\n // Return urlRecord .\n return urlRecord\n}\n\n// https://whatpr.org/websockets/48.html#validate-close-code-and-reason\nfunction validateCloseCodeAndReason (code, reason) {\n // 1. If code is not null, but is neither an integer equal to\n // 1000 nor an integer in the range 3000 to 4999, inclusive,\n // throw an \"InvalidAccessError\" DOMException.\n if (code !== null) {\n if (code !== 1000 && (code < 3000 || code > 4999)) {\n throw new DOMException('invalid code', 'InvalidAccessError')\n }\n }\n\n // 2. If reason is not null, then:\n if (reason !== null) {\n // 2.1. Let reasonBytes be the result of UTF-8 encoding reason.\n // 2.2. If reasonBytes is longer than 123 bytes, then throw a\n // \"SyntaxError\" DOMException.\n const reasonBytesLength = Buffer.byteLength(reason)\n\n if (reasonBytesLength > 123) {\n throw new DOMException(`Reason must be less than 123 bytes; received ${reasonBytesLength}`, 'SyntaxError')\n }\n }\n}\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @type {(buffer: Buffer) => string}\n */\nconst utf8Decode = (() => {\n if (typeof process.versions.icu === 'string') {\n const fatalDecoder = new TextDecoder('utf-8', { fatal: true })\n return fatalDecoder.decode.bind(fatalDecoder)\n }\n return function (buffer) {\n if (isUtf8(buffer)) {\n return buffer.toString('utf-8')\n }\n throw new TypeError('Invalid utf-8 received.')\n }\n})()\n\nmodule.exports = {\n isConnecting,\n isEstablished,\n isClosing,\n isClosed,\n fireEvent,\n isValidSubprotocol,\n isValidStatusCode,\n websocketMessageReceived,\n utf8Decode,\n isControlFrame,\n isContinuationFrame,\n isTextBinaryFrame,\n isValidOpcode,\n parseExtensions,\n isValidClientWindowBits,\n toArrayBuffer,\n getURLRecord,\n validateCloseCodeAndReason\n}\n","'use strict'\n\nconst { runtimeFeatures } = require('../../util/runtime-features')\nconst { maxUnsigned16Bit, opcodes } = require('./constants')\n\nconst BUFFER_SIZE = 8 * 1024\n\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\nconst randomFillSync = runtimeFeatures.has('crypto')\n ? require('node:crypto').randomFillSync\n // not full compatibility, but minimum.\n : function randomFillSync (buffer, _offset, _size) {\n for (let i = 0; i < buffer.length; ++i) {\n buffer[i] = Math.random() * 255 | 0\n }\n return buffer\n }\n\nfunction generateMask () {\n if (bufIdx === BUFFER_SIZE) {\n bufIdx = 0\n randomFillSync((buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE)), 0, BUFFER_SIZE)\n }\n return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n /**\n * @param {Buffer|undefined} data\n */\n constructor (data) {\n this.frameData = data\n }\n\n createFrame (opcode) {\n const frameData = this.frameData\n const maskKey = generateMask()\n const bodyLength = frameData?.byteLength ?? 0\n\n /** @type {number} */\n let payloadLength = bodyLength // 0-125\n let offset = 6\n\n if (bodyLength > maxUnsigned16Bit) {\n offset += 8 // payload length is next 8 bytes\n payloadLength = 127\n } else if (bodyLength > 125) {\n offset += 2 // payload length is next 2 bytes\n payloadLength = 126\n }\n\n const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n // Clear first 2 bytes, everything else is overwritten\n buffer[0] = buffer[1] = 0\n buffer[0] |= 0x80 // FIN\n buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */\n buffer[offset - 4] = maskKey[0]\n buffer[offset - 3] = maskKey[1]\n buffer[offset - 2] = maskKey[2]\n buffer[offset - 1] = maskKey[3]\n\n buffer[1] = payloadLength\n\n if (payloadLength === 126) {\n buffer.writeUInt16BE(bodyLength, 2)\n } else if (payloadLength === 127) {\n // Clear extended payload length\n buffer[2] = buffer[3] = 0\n buffer.writeUIntBE(bodyLength, 4, 6)\n }\n\n buffer[1] |= 0x80 // MASK\n\n // mask body\n for (let i = 0; i < bodyLength; ++i) {\n buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n }\n\n return buffer\n }\n\n /**\n * @param {Uint8Array} buffer\n */\n static createFastTextFrame (buffer) {\n const maskKey = generateMask()\n\n const bodyLength = buffer.length\n\n // mask body\n for (let i = 0; i < bodyLength; ++i) {\n buffer[i] ^= maskKey[i & 3]\n }\n\n let payloadLength = bodyLength\n let offset = 6\n\n if (bodyLength > maxUnsigned16Bit) {\n offset += 8 // payload length is next 8 bytes\n payloadLength = 127\n } else if (bodyLength > 125) {\n offset += 2 // payload length is next 2 bytes\n payloadLength = 126\n }\n const head = Buffer.allocUnsafeSlow(offset)\n\n head[0] = 0x80 /* FIN */ | opcodes.TEXT /* opcode TEXT */\n head[1] = payloadLength | 0x80 /* MASK */\n head[offset - 4] = maskKey[0]\n head[offset - 3] = maskKey[1]\n head[offset - 2] = maskKey[2]\n head[offset - 1] = maskKey[3]\n\n if (payloadLength === 126) {\n head.writeUInt16BE(bodyLength, 2)\n } else if (payloadLength === 127) {\n head[2] = head[3] = 0\n head.writeUIntBE(bodyLength, 4, 6)\n }\n\n return [head, buffer]\n }\n}\n\nmodule.exports = {\n WebsocketFrameSend,\n generateMask // for benchmark\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst { parseExtensions, isClosed, isClosing, isEstablished, isConnecting, validateCloseCodeAndReason } = require('./util')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\nconst assert = require('node:assert')\nconst { runtimeFeatures } = require('../../util/runtime-features')\n\nconst crypto = runtimeFeatures.has('crypto')\n ? require('node:crypto')\n : null\n\nlet warningEmitted = false\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').Handler} handler\n * @param {Partial<import('../../../types/websocket').WebSocketInit>} options\n */\nfunction establishWebSocketConnection (url, protocols, client, handler, options) {\n // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n // scheme is \"ws\", and to \"https\" otherwise.\n const requestURL = url\n\n requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n // 2. Let request be a new request, whose URL is requestURL, client is client,\n // service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n // \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n // redirect mode is \"error\", and use-URL-credentials flag is set.\n const request = makeRequest({\n urlList: [requestURL],\n client,\n serviceWorkers: 'none',\n referrer: 'no-referrer',\n mode: 'websocket',\n credentials: 'include',\n cache: 'no-store',\n redirect: 'error',\n useURLCredentials: true\n })\n\n // Note: undici extension, allow setting custom headers.\n if (options.headers) {\n const headersList = getHeadersList(new Headers(options.headers))\n\n request.headersList = headersList\n }\n\n // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n // Note: both of these are handled by undici currently.\n // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n // 5. Let keyValue be a nonce consisting of a randomly selected\n // 16-byte value that has been forgiving-base64-encoded and\n // isomorphic encoded.\n const keyValue = crypto.randomBytes(16).toString('base64')\n\n // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n // header list.\n request.headersList.append('sec-websocket-key', keyValue, true)\n\n // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n // header list.\n request.headersList.append('sec-websocket-version', '13', true)\n\n // 8. For each protocol in protocols, combine\n // (`Sec-WebSocket-Protocol`, protocol) in request’s header\n // list.\n for (const protocol of protocols) {\n request.headersList.append('sec-websocket-protocol', protocol, true)\n }\n\n // 9. Let permessageDeflate be a user-agent defined\n // \"permessage-deflate\" extension header value.\n // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n // request’s header list.\n request.headersList.append('sec-websocket-extensions', permessageDeflate, true)\n\n // 11. Fetch request with useParallelQueue set to true, and\n // processResponse given response being these steps:\n const controller = fetching({\n request,\n useParallelQueue: true,\n dispatcher: options.dispatcher,\n processResponse (response) {\n // 1. If response is a network error or its status is not 101,\n // fail the WebSocket connection.\n // if (response.type === 'error' || ((response.socket?.session != null && response.status !== 200) && response.status !== 101)) {\n if (response.type === 'error' || response.status !== 101) {\n // The presence of a session property on the socket indicates HTTP2\n // HTTP1\n if (response.socket?.session == null) {\n failWebsocketConnection(handler, 1002, 'Received network error or non-101 status code.', response.error)\n return\n }\n\n // HTTP2\n if (response.status !== 200) {\n failWebsocketConnection(handler, 1002, 'Received network error or non-200 status code.', response.error)\n return\n }\n }\n\n if (warningEmitted === false && response.socket?.session != null) {\n process.emitWarning('WebSocket over HTTP2 is experimental, and subject to change.', 'ExperimentalWarning')\n warningEmitted = true\n }\n\n // 2. If protocols is not the empty list and extracting header\n // list values given `Sec-WebSocket-Protocol` and response’s\n // header list results in null, failure, or the empty byte\n // sequence, then fail the WebSocket connection.\n if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(handler, 1002, 'Server did not respond with sent protocols.')\n return\n }\n\n // 3. Follow the requirements stated step 2 to step 6, inclusive,\n // of the last set of steps in section 4.1 of The WebSocket\n // Protocol to validate response. This either results in fail\n // the WebSocket connection or the WebSocket connection is\n // established.\n\n // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n // header field contains a value that is not an ASCII case-\n // insensitive match for the value \"websocket\", the client MUST\n // _Fail the WebSocket Connection_.\n // For H2, no upgrade header is expected.\n if (response.socket.session == null && response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n failWebsocketConnection(handler, 1002, 'Server did not set Upgrade header to \"websocket\".')\n return\n }\n\n // 3. If the response lacks a |Connection| header field or the\n // |Connection| header field doesn't contain a token that is an\n // ASCII case-insensitive match for the value \"Upgrade\", the client\n // MUST _Fail the WebSocket Connection_.\n // For H2, no connection header is expected.\n if (response.socket.session == null && response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n failWebsocketConnection(handler, 1002, 'Server did not set Connection header to \"upgrade\".')\n return\n }\n\n // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n // the |Sec-WebSocket-Accept| contains a value other than the\n // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n // Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n // E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n // trailing whitespace, the client MUST _Fail the WebSocket\n // Connection_.\n const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n const digest = crypto.hash('sha1', keyValue + uid, 'base64')\n if (secWSAccept !== digest) {\n failWebsocketConnection(handler, 1002, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n return\n }\n\n // 5. If the response includes a |Sec-WebSocket-Extensions| header\n // field and this header field indicates the use of an extension\n // that was not present in the client's handshake (the server has\n // indicated an extension not requested by the client), the client\n // MUST _Fail the WebSocket Connection_. (The parsing of this\n // header field to determine which extensions are requested is\n // discussed in Section 9.1.)\n const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n let extensions\n\n if (secExtension !== null) {\n extensions = parseExtensions(secExtension)\n\n if (!extensions.has('permessage-deflate')) {\n failWebsocketConnection(handler, 1002, 'Sec-WebSocket-Extensions header does not match.')\n return\n }\n }\n\n // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n // and this header field indicates the use of a subprotocol that was\n // not present in the client's handshake (the server has indicated a\n // subprotocol not requested by the client), the client MUST _Fail\n // the WebSocket Connection_.\n const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n if (secProtocol !== null) {\n const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n // The client can request that the server use a specific subprotocol by\n // including the |Sec-WebSocket-Protocol| field in its handshake. If it\n // is specified, the server needs to include the same field and one of\n // the selected subprotocol values in its response for the connection to\n // be established.\n if (requestProtocols === null || !requestProtocols.includes(secProtocol)) {\n failWebsocketConnection(handler, 1002, 'Protocol was not set in the opening handshake.')\n return\n }\n }\n\n response.socket.on('data', handler.onSocketData)\n response.socket.on('close', handler.onSocketClose)\n response.socket.on('error', handler.onSocketError)\n\n handler.wasEverConnected = true\n handler.onConnectionEstablished(response, extensions)\n }\n })\n\n return controller\n}\n\n/**\n * @see https://whatpr.org/websockets/48.html#close-the-websocket\n * @param {import('./websocket').Handler} object\n * @param {number} [code=null]\n * @param {string} [reason='']\n */\nfunction closeWebSocketConnection (object, code, reason, validate = false) {\n // 1. If code was not supplied, let code be null.\n code ??= null\n\n // 2. If reason was not supplied, let reason be the empty string.\n reason ??= ''\n\n // 3. Validate close code and reason with code and reason.\n if (validate) validateCloseCodeAndReason(code, reason)\n\n // 4. Run the first matching steps from the following list:\n // - If object’s ready state is CLOSING (2) or CLOSED (3)\n // - If the WebSocket connection is not yet established [WSP]\n // - If the WebSocket closing handshake has not yet been started [WSP]\n // - Otherwise\n if (isClosed(object.readyState) || isClosing(object.readyState)) {\n // Do nothing.\n } else if (!isEstablished(object.readyState)) {\n // Fail the WebSocket connection and set object’s ready state to CLOSING (2). [WSP]\n failWebsocketConnection(object)\n object.readyState = states.CLOSING\n } else if (!object.closeState.has(sentCloseFrameState.SENT) && !object.closeState.has(sentCloseFrameState.RECEIVED)) {\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n\n const frame = new WebsocketFrameSend()\n\n // If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n\n // If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n // If code is null and reason is the empty string, the WebSocket Close frame must not have a body.\n // If reason is non-empty but code is null, then set code to 1000 (\"Normal Closure\").\n if (reason.length !== 0 && code === null) {\n code = 1000\n }\n\n // If code is set, then the status code to use in the WebSocket Close frame must be the integer given by code.\n assert(code === null || Number.isInteger(code))\n\n if (code === null && reason.length === 0) {\n frame.frameData = emptyBuffer\n } else if (code !== null && reason === null) {\n frame.frameData = Buffer.allocUnsafe(2)\n frame.frameData.writeUInt16BE(code, 0)\n } else if (code !== null && reason !== null) {\n // If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n frame.frameData = Buffer.allocUnsafe(2 + Buffer.byteLength(reason))\n frame.frameData.writeUInt16BE(code, 0)\n // the body MAY contain UTF-8-encoded data with value /reason/\n frame.frameData.write(reason, 2, 'utf-8')\n } else {\n frame.frameData = emptyBuffer\n }\n\n object.socket.write(frame.createFrame(opcodes.CLOSE))\n\n object.closeState.add(sentCloseFrameState.SENT)\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n object.readyState = states.CLOSING\n } else {\n // Set object’s ready state to CLOSING (2).\n object.readyState = states.CLOSING\n }\n}\n\n/**\n * @param {import('./websocket').Handler} handler\n * @param {number} code\n * @param {string|undefined} reason\n * @param {unknown} cause\n * @returns {void}\n */\nfunction failWebsocketConnection (handler, code, reason, cause) {\n // If _The WebSocket Connection is Established_ prior to the point where\n // the endpoint is required to _Fail the WebSocket Connection_, the\n // endpoint SHOULD send a Close frame with an appropriate status code\n // (Section 7.4) before proceeding to _Close the WebSocket Connection_.\n if (isEstablished(handler.readyState)) {\n closeWebSocketConnection(handler, code, reason, false)\n }\n\n handler.controller.abort()\n\n if (isConnecting(handler.readyState)) {\n // If the connection was not established, we must still emit an 'error' and 'close' events\n handler.onSocketClose()\n } else if (handler.socket?.destroyed === false) {\n handler.socket.destroy()\n }\n}\n\nmodule.exports = {\n establishWebSocketConnection,\n failWebsocketConnection,\n closeWebSocketConnection\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n /** @type {import('node:zlib').InflateRaw} */\n #inflate\n\n #options = {}\n\n #maxPayloadSize = 0\n\n /**\n * @param {Map<string, string>} extensions\n */\n constructor (extensions, options) {\n this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n this.#maxPayloadSize = options.maxPayloadSize\n }\n\n /**\n * Decompress a compressed payload.\n * @param {Buffer} chunk Compressed data\n * @param {boolean} fin Final fragment flag\n * @param {Function} callback Callback function\n */\n decompress (chunk, fin, callback) {\n // An endpoint uses the following algorithm to decompress a message.\n // 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n // payload of the message.\n // 2. Decompress the resulting data using DEFLATE.\n if (!this.#inflate) {\n let windowBits = Z_DEFAULT_WINDOWBITS\n\n if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n callback(new Error('Invalid server_max_window_bits'))\n return\n }\n\n windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n }\n\n try {\n this.#inflate = createInflateRaw({ windowBits })\n } catch (err) {\n callback(err)\n return\n }\n this.#inflate[kBuffer] = []\n this.#inflate[kLength] = 0\n\n this.#inflate.on('data', (data) => {\n this.#inflate[kLength] += data.length\n\n if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n callback(new MessageSizeExceededError())\n // The inflater may still hold buffered input that can emit a late\n // zlib error. Remove the data listener, then deterministically stop\n // the stream so a subsequent 'error' cannot fire without a listener\n // (which would terminate the process as an unhandled error event).\n this.#inflate.removeAllListeners()\n this.#inflate.destroy()\n this.#inflate = null\n return\n }\n\n this.#inflate[kBuffer].push(data)\n })\n\n this.#inflate.on('error', (err) => {\n this.#inflate = null\n callback(err)\n })\n }\n\n this.#inflate.write(chunk)\n if (fin) {\n this.#inflate.write(tail)\n }\n\n this.#inflate.flush(() => {\n if (!this.#inflate) {\n return\n }\n\n const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n this.#inflate[kBuffer].length = 0\n this.#inflate[kLength] = 0\n\n callback(null, full)\n })\n }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst {\n isValidStatusCode,\n isValidOpcode,\n websocketMessageReceived,\n utf8Decode,\n isControlFrame,\n isTextBinaryFrame,\n isContinuationFrame\n} = require('./util')\nconst { failWebsocketConnection } = require('./connection')\nconst { WebsocketFrameSend } = require('./frame')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>\n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n #buffers = []\n #fragmentsBytes = 0\n #byteOffset = 0\n #loop = false\n\n #state = parserStates.INFO\n\n #info = {}\n #fragments = []\n\n /** @type {Map<string, PerMessageDeflate>} */\n #extensions\n\n /** @type {import('./websocket').Handler} */\n #handler\n\n /** @type {number} */\n #maxFragments\n\n /** @type {number} */\n #maxPayloadSize\n\n /**\n * @param {import('./websocket').Handler} handler\n * @param {Map<string, string>|null} extensions\n * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n */\n constructor (handler, extensions, options = {}) {\n super()\n\n this.#handler = handler\n this.#extensions = extensions == null ? new Map() : extensions\n this.#maxFragments = options.maxFragments ?? 0\n this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n if (this.#extensions.has('permessage-deflate')) {\n this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n }\n }\n\n /**\n * @param {Buffer} chunk\n * @param {() => void} callback\n */\n _write (chunk, _, callback) {\n this.#buffers.push(chunk)\n this.#byteOffset += chunk.length\n this.#loop = true\n\n this.run(callback)\n }\n\n #validatePayloadLength () {\n if (\n this.#maxPayloadSize > 0 &&\n !isControlFrame(this.#info.opcode) &&\n this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n ) {\n failWebsocketConnection(this.#handler, 1009, 'Payload size exceeds maximum allowed size')\n return false\n }\n\n return true\n }\n\n /**\n * Runs whenever a new chunk is received.\n * Callback is called whenever there are no more chunks buffering,\n * or not enough bytes are buffered to parse.\n */\n run (callback) {\n while (this.#loop) {\n if (this.#state === parserStates.INFO) {\n // If there aren't enough bytes to parse the payload length, etc.\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n const fin = (buffer[0] & 0x80) !== 0\n const opcode = buffer[0] & 0x0F\n const masked = (buffer[1] & 0x80) === 0x80\n\n const fragmented = !fin && opcode !== opcodes.CONTINUATION\n const payloadLength = buffer[1] & 0x7F\n\n const rsv1 = buffer[0] & 0x40\n const rsv2 = buffer[0] & 0x20\n const rsv3 = buffer[0] & 0x10\n\n if (!isValidOpcode(opcode)) {\n failWebsocketConnection(this.#handler, 1002, 'Invalid opcode received')\n return callback()\n }\n\n if (masked) {\n failWebsocketConnection(this.#handler, 1002, 'Frame cannot be masked')\n return callback()\n }\n\n // MUST be 0 unless an extension is negotiated that defines meanings\n // for non-zero values. If a nonzero value is received and none of\n // the negotiated extensions defines the meaning of such a nonzero\n // value, the receiving endpoint MUST _Fail the WebSocket\n // Connection_.\n // This document allocates the RSV1 bit of the WebSocket header for\n // PMCEs and calls the bit the \"Per-Message Compressed\" bit. On a\n // WebSocket connection where a PMCE is in use, this bit indicates\n // whether a message is compressed or not.\n if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n failWebsocketConnection(this.#handler, 1002, 'Expected RSV1 to be clear.')\n return\n }\n\n if (rsv2 !== 0 || rsv3 !== 0) {\n failWebsocketConnection(this.#handler, 1002, 'RSV1, RSV2, RSV3 must be clear')\n return\n }\n\n if (fragmented && !isTextBinaryFrame(opcode)) {\n // Only text and binary frames can be fragmented\n failWebsocketConnection(this.#handler, 1002, 'Invalid frame type was fragmented.')\n return\n }\n\n // If we are already parsing a text/binary frame and do not receive either\n // a continuation frame or close frame, fail the connection.\n if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n failWebsocketConnection(this.#handler, 1002, 'Expected continuation frame')\n return\n }\n\n if (this.#info.fragmented && fragmented) {\n // A fragmented frame can't be fragmented itself\n failWebsocketConnection(this.#handler, 1002, 'Fragmented frame exceeded 125 bytes.')\n return\n }\n\n // \"All control frames MUST have a payload length of 125 bytes or less\n // and MUST NOT be fragmented.\"\n if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n failWebsocketConnection(this.#handler, 1002, 'Control frame either too large or fragmented')\n return\n }\n\n if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n failWebsocketConnection(this.#handler, 1002, 'Unexpected continuation frame')\n return\n }\n\n if (payloadLength <= 125) {\n this.#info.payloadLength = payloadLength\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (payloadLength === 126) {\n this.#state = parserStates.PAYLOADLENGTH_16\n } else if (payloadLength === 127) {\n this.#state = parserStates.PAYLOADLENGTH_64\n }\n\n if (isTextBinaryFrame(opcode)) {\n this.#info.binaryType = opcode\n this.#info.compressed = rsv1 !== 0\n }\n\n this.#info.opcode = opcode\n this.#info.masked = masked\n this.#info.fin = fin\n this.#info.fragmented = fragmented\n } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.payloadLength = buffer.readUInt16BE(0)\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n if (this.#byteOffset < 8) {\n return callback()\n }\n\n const buffer = this.consume(8)\n const upper = buffer.readUInt32BE(0)\n const lower = buffer.readUInt32BE(4)\n\n // 2^31 is the maximum bytes an arraybuffer can contain\n // on 32-bit systems. Although, on 64-bit systems, this is\n // 2^53-1 bytes.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n if (upper !== 0 || lower > 2 ** 31 - 1) {\n failWebsocketConnection(this.#handler, 1009, 'Received payload length > 2^31 bytes.')\n return\n }\n\n this.#info.payloadLength = lower\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (this.#state === parserStates.READ_DATA) {\n if (this.#byteOffset < this.#info.payloadLength) {\n return callback()\n }\n\n const body = this.consume(this.#info.payloadLength)\n\n if (isControlFrame(this.#info.opcode)) {\n this.#loop = this.parseControlFrame(body)\n this.#state = parserStates.INFO\n } else {\n if (!this.#info.compressed) {\n if (!this.writeFragments(body)) {\n return\n }\n\n // If the frame is not fragmented, a message has been received.\n // If the frame is fragmented, it will terminate with a fin bit set\n // and an opcode of 0 (continuation), therefore we handle that when\n // parsing continuation frames, not here.\n if (!this.#info.fragmented && this.#info.fin) {\n websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())\n }\n\n this.#state = parserStates.INFO\n } else {\n this.#extensions.get('permessage-deflate').decompress(\n body,\n this.#info.fin,\n (error, data) => {\n if (error) {\n const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n failWebsocketConnection(this.#handler, code, error.message)\n return\n }\n\n if (!this.writeFragments(data)) {\n return\n }\n\n // Check cumulative fragment size\n if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n failWebsocketConnection(this.#handler, 1009, new MessageSizeExceededError().message)\n return\n }\n\n if (!this.#info.fin) {\n this.#state = parserStates.INFO\n this.#loop = true\n this.run(callback)\n return\n }\n\n websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())\n\n this.#loop = true\n this.#state = parserStates.INFO\n this.run(callback)\n },\n this.#fragmentsBytes\n )\n\n this.#loop = false\n break\n }\n }\n }\n }\n }\n\n /**\n * Take n bytes from the buffered Buffers\n * @param {number} n\n * @returns {Buffer}\n */\n consume (n) {\n if (n > this.#byteOffset) {\n throw new Error('Called consume() before buffers satiated.')\n } else if (n === 0) {\n return emptyBuffer\n }\n\n this.#byteOffset -= n\n\n const first = this.#buffers[0]\n\n if (first.length > n) {\n // replace with remaining buffer\n this.#buffers[0] = first.subarray(n, first.length)\n return first.subarray(0, n)\n } else if (first.length === n) {\n // prefect match\n return this.#buffers.shift()\n } else {\n let offset = 0\n // If Buffer.allocUnsafe is used, extra copies will be made because the offset is non-zero.\n const buffer = Buffer.allocUnsafeSlow(n)\n while (offset !== n) {\n const next = this.#buffers[0]\n const length = next.length\n\n if (length + offset === n) {\n buffer.set(this.#buffers.shift(), offset)\n break\n } else if (length + offset > n) {\n buffer.set(next.subarray(0, n - offset), offset)\n this.#buffers[0] = next.subarray(n - offset)\n break\n } else {\n buffer.set(this.#buffers.shift(), offset)\n offset += length\n }\n }\n\n return buffer\n }\n }\n\n writeFragments (fragment) {\n if (\n this.#maxFragments > 0 &&\n this.#fragments.length === this.#maxFragments\n ) {\n failWebsocketConnection(this.#handler, 1008, 'Too many message fragments')\n return false\n }\n\n this.#fragmentsBytes += fragment.length\n this.#fragments.push(fragment)\n return true\n }\n\n consumeFragments () {\n const fragments = this.#fragments\n\n if (fragments.length === 1) {\n // single fragment\n this.#fragmentsBytes = 0\n return fragments.shift()\n }\n\n let offset = 0\n // If Buffer.allocUnsafe is used, extra copies will be made because the offset is non-zero.\n const output = Buffer.allocUnsafeSlow(this.#fragmentsBytes)\n\n for (let i = 0; i < fragments.length; ++i) {\n const buffer = fragments[i]\n output.set(buffer, offset)\n offset += buffer.length\n }\n\n this.#fragments = []\n this.#fragmentsBytes = 0\n\n return output\n }\n\n parseCloseBody (data) {\n assert(data.length !== 1)\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n /** @type {number|undefined} */\n let code\n\n if (data.length >= 2) {\n // _The WebSocket Connection Close Code_ is\n // defined as the status code (Section 7.4) contained in the first Close\n // control frame received by the application\n code = data.readUInt16BE(0)\n }\n\n if (code !== undefined && !isValidStatusCode(code)) {\n return { code: 1002, reason: 'Invalid status code', error: true }\n }\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n /** @type {Buffer} */\n let reason = data.subarray(2)\n\n // Remove BOM\n if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n reason = reason.subarray(3)\n }\n\n try {\n reason = utf8Decode(reason)\n } catch {\n return { code: 1007, reason: 'Invalid UTF-8', error: true }\n }\n\n return { code, reason, error: false }\n }\n\n /**\n * Parses control frames.\n * @param {Buffer} body\n */\n parseControlFrame (body) {\n const { opcode, payloadLength } = this.#info\n\n if (opcode === opcodes.CLOSE) {\n if (payloadLength === 1) {\n failWebsocketConnection(this.#handler, 1002, 'Received close frame with a 1-byte body.')\n return false\n }\n\n this.#info.closeInfo = this.parseCloseBody(body)\n\n if (this.#info.closeInfo.error) {\n const { code, reason } = this.#info.closeInfo\n\n failWebsocketConnection(this.#handler, code, reason)\n return false\n }\n\n // Upon receiving such a frame, the other peer sends a\n // Close frame in response, if it hasn't already sent one.\n if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {\n // If an endpoint receives a Close frame and did not previously send a\n // Close frame, the endpoint MUST send a Close frame in response. (When\n // sending a Close frame in response, the endpoint typically echos the\n // status code it received.)\n let body = emptyBuffer\n if (this.#info.closeInfo.code) {\n body = Buffer.allocUnsafe(2)\n body.writeUInt16BE(this.#info.closeInfo.code, 0)\n }\n const closeFrame = new WebsocketFrameSend(body)\n\n this.#handler.socket.write(closeFrame.createFrame(opcodes.CLOSE))\n this.#handler.closeState.add(sentCloseFrameState.SENT)\n }\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this.#handler.readyState = states.CLOSING\n this.#handler.closeState.add(sentCloseFrameState.RECEIVED)\n\n return false\n } else if (opcode === opcodes.PING) {\n // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n // response, unless it already received a Close frame.\n // A Pong frame sent in response to a Ping frame must have identical\n // \"Application data\"\n\n if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {\n const frame = new WebsocketFrameSend(body)\n\n this.#handler.socket.write(frame.createFrame(opcodes.PONG))\n\n this.#handler.onPing(body)\n }\n } else if (opcode === opcodes.PONG) {\n // A Pong frame MAY be sent unsolicited. This serves as a\n // unidirectional heartbeat. A response to an unsolicited Pong frame is\n // not expected.\n this.#handler.onPong(body)\n }\n\n return true\n }\n\n get closingInfo () {\n return this.#info.closeInfo\n }\n}\n\nmodule.exports = {\n ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise<void> | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n /**\n * @type {FixedQueue}\n */\n #queue = new FixedQueue()\n\n /**\n * @type {boolean}\n */\n #running = false\n\n /** @type {import('node:net').Socket} */\n #socket\n\n constructor (socket) {\n this.#socket = socket\n }\n\n add (item, cb, hint) {\n if (hint !== sendHints.blob) {\n if (!this.#running) {\n // TODO(@tsctx): support fast-path for string on running\n if (hint === sendHints.text) {\n // special fast-path for string\n const { 0: head, 1: body } = WebsocketFrameSend.createFastTextFrame(item)\n this.#socket.cork()\n this.#socket.write(head)\n this.#socket.write(body, cb)\n this.#socket.uncork()\n } else {\n // direct writing\n this.#socket.write(createFrame(item, hint), cb)\n }\n } else {\n /** @type {SendQueueNode} */\n const node = {\n promise: null,\n callback: cb,\n frame: createFrame(item, hint)\n }\n this.#queue.push(node)\n }\n return\n }\n\n /** @type {SendQueueNode} */\n const node = {\n promise: item.arrayBuffer().then((ab) => {\n node.promise = null\n node.frame = createFrame(ab, hint)\n }),\n callback: cb,\n frame: null\n }\n\n this.#queue.push(node)\n\n if (!this.#running) {\n this.#run()\n }\n }\n\n async #run () {\n this.#running = true\n const queue = this.#queue\n while (!queue.isEmpty()) {\n const node = queue.shift()\n // wait pending promise\n if (node.promise !== null) {\n await node.promise\n }\n // write\n this.#socket.write(node.frame, node.callback)\n // cleanup\n node.callback = node.frame = null\n }\n this.#running = false\n }\n}\n\nfunction createFrame (data, hint) {\n return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.text ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n switch (hint) {\n case sendHints.text:\n case sendHints.typedArray:\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n case sendHints.arrayBuffer:\n case sendHints.blob:\n return new Uint8Array(data)\n }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nconst { isArrayBuffer } = require('node:util/types')\nconst { webidl } = require('../webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints, opcodes } = require('./constants')\nconst {\n isConnecting,\n isEstablished,\n isClosing,\n isClosed,\n isValidSubprotocol,\n fireEvent,\n utf8Decode,\n toArrayBuffer,\n getURLRecord\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection, failWebsocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { ErrorEvent, CloseEvent, createFastMessageEvent } = require('./events')\nconst { SendQueue } = require('./sender')\nconst { WebsocketFrameSend } = require('./frame')\nconst { channels } = require('../../core/diagnostics')\n\nfunction getSocketAddress (socket) {\n if (typeof socket?.address === 'function') {\n return socket.address()\n }\n\n if (typeof socket?.session?.socket?.address === 'function') {\n return socket.session.socket.address()\n }\n\n return null\n}\n\n/**\n * @typedef {object} Handler\n * @property {(response: any, extensions?: string[]) => void} onConnectionEstablished\n * @property {(opcode: number, data: Buffer) => void} onMessage\n * @property {(error: Error) => void} onParserError\n * @property {() => void} onParserDrain\n * @property {(chunk: Buffer) => void} onSocketData\n * @property {(err: Error) => void} onSocketError\n * @property {() => void} onSocketClose\n * @property {(body: Buffer) => void} onPing\n * @property {(body: Buffer) => void} onPong\n *\n * @property {number} readyState\n * @property {import('stream').Duplex} socket\n * @property {Set<number>} closeState\n * @property {import('../fetch/index').Fetch} controller\n * @property {boolean} [wasEverConnected=false]\n */\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n #events = {\n open: null,\n error: null,\n close: null,\n message: null\n }\n\n #bufferedAmount = 0\n #protocol = ''\n #extensions = ''\n\n /** @type {SendQueue} */\n #sendQueue\n\n /** @type {Handler} */\n #handler = {\n onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions),\n onMessage: (opcode, data) => this.#onMessage(opcode, data),\n onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message),\n onParserDrain: () => this.#onParserDrain(),\n onSocketData: (chunk) => {\n if (!this.#parser.write(chunk)) {\n this.#handler.socket.pause()\n }\n },\n onSocketError: (err) => {\n this.#handler.readyState = states.CLOSING\n\n if (channels.socketError.hasSubscribers) {\n channels.socketError.publish(err)\n }\n\n this.#handler.socket.destroy()\n },\n onSocketClose: () => this.#onSocketClose(),\n onPing: (body) => {\n if (channels.ping.hasSubscribers) {\n channels.ping.publish({\n payload: body,\n websocket: this\n })\n }\n },\n onPong: (body) => {\n if (channels.pong.hasSubscribers) {\n channels.pong.publish({\n payload: body,\n websocket: this\n })\n }\n },\n\n readyState: states.CONNECTING,\n socket: null,\n closeState: new Set(),\n controller: null,\n wasEverConnected: false\n }\n\n #url\n #binaryType\n /** @type {import('./receiver').ByteParser} */\n #parser\n\n /**\n * @param {string} url\n * @param {string|string[]} protocols\n */\n constructor (url, protocols = []) {\n super()\n\n webidl.util.markAsUncloneable(this)\n\n const prefix = 'WebSocket constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols, prefix, 'options')\n\n url = webidl.converters.USVString(url)\n protocols = options.protocols\n\n // 1. Let baseURL be this's relevant settings object's API base URL.\n const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n // 2. Let urlRecord be the result of getting a URL record given url and baseURL.\n const urlRecord = getURLRecord(url, baseURL)\n\n // 3. If protocols is a string, set protocols to a sequence consisting\n // of just that string.\n if (typeof protocols === 'string') {\n protocols = [protocols]\n }\n\n // 4. If any of the values in protocols occur more than once or otherwise\n // fail to match the requirements for elements that comprise the value\n // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n // protocol, then throw a \"SyntaxError\" DOMException.\n if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n // 5. Set this's url to urlRecord.\n this.#url = new URL(urlRecord.href)\n\n // 6. Let client be this's relevant settings object.\n const client = environmentSettingsObject.settingsObject\n\n // 7. Run this step in parallel:\n // 7.1. Establish a WebSocket connection given urlRecord, protocols,\n // and client.\n this.#handler.controller = establishWebSocketConnection(\n urlRecord,\n protocols,\n client,\n this.#handler,\n options\n )\n\n // Each WebSocket object has an associated ready state, which is a\n // number representing the state of the connection. Initially it must\n // be CONNECTING (0).\n this.#handler.readyState = WebSocket.CONNECTING\n\n // The extensions attribute must initially return the empty string.\n\n // The protocol attribute must initially return the empty string.\n\n // Each WebSocket object has an associated binary type, which is a\n // BinaryType. Initially it must be \"blob\".\n this.#binaryType = 'blob'\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n * @param {number|undefined} code\n * @param {string|undefined} reason\n */\n close (code = undefined, reason = undefined) {\n webidl.brandCheck(this, WebSocket)\n\n const prefix = 'WebSocket.close'\n\n if (code !== undefined) {\n code = webidl.converters['unsigned short'](code, prefix, 'code', webidl.attributes.Clamp)\n }\n\n if (reason !== undefined) {\n reason = webidl.converters.USVString(reason)\n }\n\n // 1. If code is the special value \"missing\", then set code to null.\n code ??= null\n\n // 2. If reason is the special value \"missing\", then set reason to the empty string.\n reason ??= ''\n\n // 3. Close the WebSocket with this, code, and reason.\n closeWebSocketConnection(this.#handler, code, reason, true)\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n */\n send (data) {\n webidl.brandCheck(this, WebSocket)\n\n const prefix = 'WebSocket.send'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n // 1. If this's ready state is CONNECTING, then throw an\n // \"InvalidStateError\" DOMException.\n if (isConnecting(this.#handler.readyState)) {\n throw new DOMException('Sent before connected.', 'InvalidStateError')\n }\n\n // 2. Run the appropriate set of steps from the following list:\n // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n if (!isEstablished(this.#handler.readyState) || isClosing(this.#handler.readyState)) {\n return\n }\n\n // If data is a string\n if (typeof data === 'string') {\n // If the WebSocket connection is established and the WebSocket\n // closing handshake has not yet started, then the user agent\n // must send a WebSocket Message comprised of the data argument\n // using a text frame opcode; if the data cannot be sent, e.g.\n // because it would need to be buffered but the buffer is full,\n // the user agent must flag the WebSocket as full and then close\n // the WebSocket connection. Any invocation of this method with a\n // string argument that does not throw an exception must increase\n // the bufferedAmount attribute by the number of bytes needed to\n // express the argument as UTF-8.\n\n const buffer = Buffer.from(data)\n\n this.#bufferedAmount += buffer.byteLength\n this.#sendQueue.add(buffer, () => {\n this.#bufferedAmount -= buffer.byteLength\n }, sendHints.text)\n } else if (isArrayBuffer(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need\n // to be buffered but the buffer is full, the user agent must flag\n // the WebSocket as full and then close the WebSocket connection.\n // The data to be sent is the data stored in the buffer described\n // by the ArrayBuffer object. Any invocation of this method with an\n // ArrayBuffer argument that does not throw an exception must\n // increase the bufferedAmount attribute by the length of the\n // ArrayBuffer in bytes.\n\n this.#bufferedAmount += data.byteLength\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.byteLength\n }, sendHints.arrayBuffer)\n } else if (ArrayBuffer.isView(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The\n // data to be sent is the data stored in the section of the buffer\n // described by the ArrayBuffer object that data references. Any\n // invocation of this method with this kind of argument that does\n // not throw an exception must increase the bufferedAmount attribute\n // by the length of data’s buffer in bytes.\n\n this.#bufferedAmount += data.byteLength\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.byteLength\n }, sendHints.typedArray)\n } else if (webidl.is.Blob(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The data\n // to be sent is the raw data represented by the Blob object. Any\n // invocation of this method with a Blob argument that does not throw\n // an exception must increase the bufferedAmount attribute by the size\n // of the Blob object’s raw data, in bytes.\n\n this.#bufferedAmount += data.size\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.size\n }, sendHints.blob)\n }\n }\n\n get readyState () {\n webidl.brandCheck(this, WebSocket)\n\n // The readyState getter steps are to return this's ready state.\n return this.#handler.readyState\n }\n\n get bufferedAmount () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#bufferedAmount\n }\n\n get url () {\n webidl.brandCheck(this, WebSocket)\n\n // The url getter steps are to return this's url, serialized.\n return URLSerializer(this.#url)\n }\n\n get extensions () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#extensions\n }\n\n get protocol () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#protocol\n }\n\n get onopen () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.open\n }\n\n set onopen (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('open', listener)\n this.#events.open = fn\n } else {\n this.#events.open = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('error', listener)\n this.#events.error = fn\n } else {\n this.#events.error = null\n }\n }\n\n get onclose () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.close\n }\n\n set onclose (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.close) {\n this.removeEventListener('close', this.#events.close)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('close', listener)\n this.#events.close = fn\n } else {\n this.#events.close = null\n }\n }\n\n get onmessage () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.message\n }\n\n set onmessage (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('message', listener)\n this.#events.message = fn\n } else {\n this.#events.message = null\n }\n }\n\n get binaryType () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#binaryType\n }\n\n set binaryType (type) {\n webidl.brandCheck(this, WebSocket)\n\n if (type !== 'blob' && type !== 'arraybuffer') {\n this.#binaryType = 'blob'\n } else {\n this.#binaryType = type\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n */\n #onConnectionEstablished (response, parsedExtensions) {\n // processResponse is called when the \"response's header list has been received and initialized.\"\n // once this happens, the connection is open\n this.#handler.socket = response.socket\n\n const webSocketOptions = this.#handler.controller.dispatcher?.webSocketOptions\n const maxFragments = webSocketOptions?.maxFragments\n const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n const parser = new ByteParser(this.#handler, parsedExtensions, {\n maxFragments,\n maxPayloadSize\n })\n parser.on('drain', () => this.#handler.onParserDrain())\n parser.on('error', (err) => this.#handler.onParserError(err))\n\n this.#parser = parser\n this.#sendQueue = new SendQueue(response.socket)\n\n // 1. Change the ready state to OPEN (1).\n this.#handler.readyState = states.OPEN\n\n // 2. Change the extensions attribute’s value to the extensions in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n const extensions = response.headersList.get('sec-websocket-extensions')\n\n if (extensions !== null) {\n this.#extensions = extensions\n }\n\n // 3. Change the protocol attribute’s value to the subprotocol in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n const protocol = response.headersList.get('sec-websocket-protocol')\n\n if (protocol !== null) {\n this.#protocol = protocol\n }\n\n // 4. Fire an event named open at the WebSocket object.\n fireEvent('open', this)\n\n if (channels.open.hasSubscribers) {\n // Convert headers to a plain object for the event\n const headers = response.headersList.entries\n channels.open.publish({\n address: getSocketAddress(response.socket),\n protocol: this.#protocol,\n extensions: this.#extensions,\n websocket: this,\n handshakeResponse: {\n status: response.status,\n statusText: response.statusText,\n headers\n }\n })\n }\n }\n\n #onMessage (type, data) {\n // 1. If ready state is not OPEN (1), then return.\n if (this.#handler.readyState !== states.OPEN) {\n return\n }\n\n // 2. Let dataForEvent be determined by switching on type and binary type:\n let dataForEvent\n\n if (type === opcodes.TEXT) {\n // -> type indicates that the data is Text\n // a new DOMString containing data\n try {\n dataForEvent = utf8Decode(data)\n } catch {\n failWebsocketConnection(this.#handler, 1007, 'Received invalid UTF-8 in text frame.')\n return\n }\n } else if (type === opcodes.BINARY) {\n if (this.#binaryType === 'blob') {\n // -> type indicates that the data is Binary and binary type is \"blob\"\n // a new Blob object, created in the relevant Realm of the WebSocket\n // object, that represents data as its raw data\n dataForEvent = new Blob([data])\n } else {\n // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n // a new ArrayBuffer object, created in the relevant Realm of the\n // WebSocket object, whose contents are data\n dataForEvent = toArrayBuffer(data)\n }\n }\n\n // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n // with the origin attribute initialized to the serialization of the WebSocket\n // object’s url's origin, and the data attribute initialized to dataForEvent.\n fireEvent('message', this, createFastMessageEvent, {\n origin: this.#url.origin,\n data: dataForEvent\n })\n }\n\n #onParserDrain () {\n this.#handler.socket.resume()\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\n #onSocketClose () {\n // If the TCP connection was closed after the\n // WebSocket closing handshake was completed, the WebSocket connection\n // is said to have been closed _cleanly_.\n const wasClean =\n this.#handler.closeState.has(sentCloseFrameState.SENT) &&\n this.#handler.closeState.has(sentCloseFrameState.RECEIVED)\n\n let code = 1005\n let reason = ''\n\n const result = this.#parser?.closingInfo\n\n if (result && !result.error) {\n code = result.code ?? 1005\n reason = result.reason\n }\n\n // 1. Change the ready state to CLOSED (3).\n this.#handler.readyState = states.CLOSED\n\n // 2. If the user agent was required to fail the WebSocket\n // connection, or if the WebSocket connection was closed\n // after being flagged as full, fire an event named error\n // at the WebSocket object.\n if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {\n // If _The WebSocket\n // Connection is Closed_ and no Close control frame was received by the\n // endpoint (such as could occur if the underlying transport connection\n // is lost), _The WebSocket Connection Close Code_ is considered to be\n // 1006.\n code = 1006\n\n fireEvent('error', this, (type, init) => new ErrorEvent(type, init), {\n error: new TypeError(reason)\n })\n }\n\n // 3. Fire an event named close at the WebSocket object,\n // using CloseEvent, with the wasClean attribute\n // initialized to true if the connection closed cleanly\n // and false otherwise, the code attribute initialized to\n // the WebSocket connection close code, and the reason\n // attribute initialized to the result of applying UTF-8\n // decode without BOM to the WebSocket connection close\n // reason.\n // TODO: process.nextTick\n fireEvent('close', this, (type, init) => new CloseEvent(type, init), {\n wasClean, code, reason\n })\n\n if (channels.close.hasSubscribers) {\n channels.close.publish({\n websocket: this,\n code,\n reason\n })\n }\n }\n\n /**\n * @param {WebSocket} ws\n * @param {Buffer|undefined} buffer\n */\n static ping (ws, buffer) {\n if (Buffer.isBuffer(buffer)) {\n if (buffer.length > 125) {\n throw new TypeError('A PING frame cannot have a body larger than 125 bytes.')\n }\n } else if (buffer !== undefined) {\n throw new TypeError('Expected buffer payload')\n }\n\n // An endpoint MAY send a Ping frame any time after the connection is\n // established and before the connection is closed.\n const readyState = ws.#handler.readyState\n\n if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) {\n const frame = new WebsocketFrameSend(buffer)\n ws.#handler.socket.write(frame.createFrame(opcodes.PING))\n }\n }\n}\n\nconst { ping } = WebSocket\nReflect.deleteProperty(WebSocket, 'ping')\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors,\n url: kEnumerableProperty,\n readyState: kEnumerableProperty,\n bufferedAmount: kEnumerableProperty,\n onopen: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onclose: kEnumerableProperty,\n close: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n binaryType: kEnumerableProperty,\n send: kEnumerableProperty,\n extensions: kEnumerableProperty,\n protocol: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocket',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(WebSocket, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(\n webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence<DOMString>'] = function (V, prefix, argument) {\n if (webidl.util.Type(V) === webidl.util.Types.OBJECT && Symbol.iterator in V) {\n return webidl.converters['sequence<DOMString>'](V)\n }\n\n return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n {\n key: 'protocols',\n converter: webidl.converters['DOMString or sequence<DOMString>'],\n defaultValue: () => []\n },\n {\n key: 'dispatcher',\n converter: webidl.converters.any,\n defaultValue: () => getGlobalDispatcher()\n },\n {\n key: 'headers',\n converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n }\n])\n\nwebidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {\n if (webidl.util.Type(V) === webidl.util.Types.OBJECT && !(Symbol.iterator in V)) {\n return webidl.converters.WebSocketInit(V)\n }\n\n return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {\n if (webidl.is.Blob(V)) {\n return V\n }\n\n if (webidl.is.BufferSource(V)) {\n return V\n }\n }\n\n return webidl.converters.USVString(V)\n}\n\nmodule.exports = {\n WebSocket,\n ping\n}\n","'use strict'\n\nconst { webidl } = require('../../webidl')\nconst { validateCloseCodeAndReason } = require('../util')\nconst { kConstruct } = require('../../../core/symbols')\nconst { kEnumerableProperty } = require('../../../core/util')\n\nfunction createInheritableDOMException () {\n // https://github.com/nodejs/node/issues/59677\n class Test extends DOMException {\n get reason () {\n return ''\n }\n }\n\n if (new Test().reason !== undefined) {\n return DOMException\n }\n\n return new Proxy(DOMException, {\n construct (target, args, newTarget) {\n const instance = Reflect.construct(target, args, target)\n Object.setPrototypeOf(instance, newTarget.prototype)\n return instance\n }\n })\n}\n\nclass WebSocketError extends createInheritableDOMException() {\n #closeCode\n #reason\n\n constructor (message = '', init = undefined) {\n message = webidl.converters.DOMString(message, 'WebSocketError', 'message')\n\n // 1. Set this 's name to \" WebSocketError \".\n // 2. Set this 's message to message .\n super(message, 'WebSocketError')\n\n if (init === kConstruct) {\n return\n } else if (init !== null) {\n init = webidl.converters.WebSocketCloseInfo(init)\n }\n\n // 3. Let code be init [\" closeCode \"] if it exists , or null otherwise.\n let code = init.closeCode ?? null\n\n // 4. Let reason be init [\" reason \"] if it exists , or the empty string otherwise.\n const reason = init.reason ?? ''\n\n // 5. Validate close code and reason with code and reason .\n validateCloseCodeAndReason(code, reason)\n\n // 6. If reason is non-empty, but code is not set, then set code to 1000 (\"Normal Closure\").\n if (reason.length !== 0 && code === null) {\n code = 1000\n }\n\n // 7. Set this 's closeCode to code .\n this.#closeCode = code\n\n // 8. Set this 's reason to reason .\n this.#reason = reason\n }\n\n get closeCode () {\n return this.#closeCode\n }\n\n get reason () {\n return this.#reason\n }\n\n /**\n * @param {string} message\n * @param {number|null} code\n * @param {string} reason\n */\n static createUnvalidatedWebSocketError (message, code, reason) {\n const error = new WebSocketError(message, kConstruct)\n error.#closeCode = code\n error.#reason = reason\n return error\n }\n}\n\nconst { createUnvalidatedWebSocketError } = WebSocketError\ndelete WebSocketError.createUnvalidatedWebSocketError\n\nObject.defineProperties(WebSocketError.prototype, {\n closeCode: kEnumerableProperty,\n reason: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocketError',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nwebidl.is.WebSocketError = webidl.util.MakeTypeAssertion(WebSocketError)\n\nmodule.exports = { WebSocketError, createUnvalidatedWebSocketError }\n","'use strict'\n\nconst { createDeferredPromise } = require('../../../util/promise')\nconst { environmentSettingsObject } = require('../../fetch/util')\nconst { states, opcodes, sentCloseFrameState } = require('../constants')\nconst { webidl } = require('../../webidl')\nconst { getURLRecord, isValidSubprotocol, isEstablished, utf8Decode } = require('../util')\nconst { establishWebSocketConnection, failWebsocketConnection, closeWebSocketConnection } = require('../connection')\nconst { channels } = require('../../../core/diagnostics')\nconst { WebsocketFrameSend } = require('../frame')\nconst { ByteParser } = require('../receiver')\nconst { WebSocketError, createUnvalidatedWebSocketError } = require('./websocketerror')\nconst { kEnumerableProperty } = require('../../../core/util')\nconst { utf8DecodeBytes } = require('../../../encoding')\n\nlet emittedExperimentalWarning = false\n\nclass WebSocketStream {\n // Each WebSocketStream object has an associated url , which is a URL record .\n /** @type {URL} */\n #url\n\n // Each WebSocketStream object has an associated opened promise , which is a promise.\n /** @type {import('../../../util/promise').DeferredPromise} */\n #openedPromise\n\n // Each WebSocketStream object has an associated closed promise , which is a promise.\n /** @type {import('../../../util/promise').DeferredPromise} */\n #closedPromise\n\n // Each WebSocketStream object has an associated readable stream , which is a ReadableStream .\n /** @type {ReadableStream} */\n #readableStream\n /** @type {ReadableStreamDefaultController} */\n #readableStreamController\n\n // Retain the controller so the writable stream can be errored while locked.\n /** @type {WritableStreamDefaultController} */\n #writableStreamController\n\n // Each WebSocketStream object has an associated boolean handshake aborted , which is initially false.\n #handshakeAborted = false\n\n /** @type {import('../websocket').Handler} */\n #handler = {\n // https://whatpr.org/websockets/48/7b748d3...d5570f3.html#feedback-to-websocket-stream-from-the-protocol\n onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions),\n onMessage: (opcode, data) => this.#onMessage(opcode, data),\n onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message),\n onParserDrain: () => this.#handler.socket.resume(),\n onSocketData: (chunk) => {\n if (!this.#parser.write(chunk)) {\n this.#handler.socket.pause()\n }\n },\n onSocketError: (err) => {\n this.#handler.readyState = states.CLOSING\n\n if (channels.socketError.hasSubscribers) {\n channels.socketError.publish(err)\n }\n\n this.#handler.socket.destroy()\n },\n onSocketClose: () => this.#onSocketClose(),\n onPing: () => {},\n onPong: () => {},\n\n readyState: states.CONNECTING,\n socket: null,\n closeState: new Set(),\n controller: null,\n wasEverConnected: false\n }\n\n /** @type {import('../receiver').ByteParser} */\n #parser\n\n constructor (url, options = undefined) {\n if (!emittedExperimentalWarning) {\n process.emitWarning('WebSocketStream is experimental! Expect it to change at any time.', {\n code: 'UNDICI-WSS'\n })\n emittedExperimentalWarning = true\n }\n\n webidl.argumentLengthCheck(arguments, 1, 'WebSocket')\n\n url = webidl.converters.USVString(url)\n if (options !== null) {\n options = webidl.converters.WebSocketStreamOptions(options)\n }\n\n // 1. Let baseURL be this 's relevant settings object 's API base URL .\n const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n // 2. Let urlRecord be the result of getting a URL record given url and baseURL .\n const urlRecord = getURLRecord(url, baseURL)\n\n // 3. Let protocols be options [\" protocols \"] if it exists , otherwise an empty sequence.\n const protocols = options.protocols\n\n // 4. If any of the values in protocols occur more than once or otherwise fail to match the requirements for elements that comprise the value of ` Sec-WebSocket-Protocol ` fields as defined by The WebSocket Protocol , then throw a \" SyntaxError \" DOMException . [WSP]\n if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n // 5. Set this 's url to urlRecord .\n this.#url = urlRecord.toString()\n\n // 6. Set this 's opened promise and closed promise to new promises.\n this.#openedPromise = createDeferredPromise()\n this.#closedPromise = createDeferredPromise()\n\n // 7. Apply backpressure to the WebSocket.\n // TODO\n\n // 8. If options [\" signal \"] exists ,\n if (options.signal != null) {\n // 8.1. Let signal be options [\" signal \"].\n const signal = options.signal\n\n // 8.2. If signal is aborted , then reject this 's opened promise and closed promise with signal ’s abort reason\n // and return.\n if (signal.aborted) {\n this.#openedPromise.reject(signal.reason)\n this.#closedPromise.reject(signal.reason)\n return\n }\n\n // 8.3. Add the following abort steps to signal :\n signal.addEventListener('abort', () => {\n // 8.3.1. If the WebSocket connection is not yet established : [WSP]\n if (!isEstablished(this.#handler.readyState)) {\n // 8.3.1.1. Fail the WebSocket connection .\n failWebsocketConnection(this.#handler)\n\n // Set this 's ready state to CLOSING .\n this.#handler.readyState = states.CLOSING\n\n // Reject this 's opened promise and closed promise with signal ’s abort reason .\n this.#openedPromise.reject(signal.reason)\n this.#closedPromise.reject(signal.reason)\n\n // Set this 's handshake aborted to true.\n this.#handshakeAborted = true\n }\n }, { once: true })\n }\n\n // 9. Let client be this 's relevant settings object .\n const client = environmentSettingsObject.settingsObject\n\n // 10. Run this step in parallel :\n // 10.1. Establish a WebSocket connection given urlRecord , protocols , and client . [FETCH]\n this.#handler.controller = establishWebSocketConnection(\n urlRecord,\n protocols,\n client,\n this.#handler,\n options\n )\n }\n\n // The url getter steps are to return this 's url , serialized .\n get url () {\n return this.#url.toString()\n }\n\n // The opened getter steps are to return this 's opened promise .\n get opened () {\n return this.#openedPromise.promise\n }\n\n // The closed getter steps are to return this 's closed promise .\n get closed () {\n return this.#closedPromise.promise\n }\n\n // The close( closeInfo ) method steps are:\n close (closeInfo = undefined) {\n if (closeInfo !== null) {\n closeInfo = webidl.converters.WebSocketCloseInfo(closeInfo)\n }\n\n // 1. Let code be closeInfo [\" closeCode \"] if present, or null otherwise.\n const code = closeInfo.closeCode ?? null\n\n // 2. Let reason be closeInfo [\" reason \"].\n const reason = closeInfo.reason\n\n // 3. Close the WebSocket with this , code , and reason .\n closeWebSocketConnection(this.#handler, code, reason, true)\n }\n\n #write (chunk) {\n // See /websockets/stream/tentative/write.any.html\n chunk = webidl.converters.WebSocketStreamWrite(chunk)\n\n // 1. Let promise be a new promise created in stream ’s relevant realm .\n const promise = createDeferredPromise()\n\n // 2. Let data be null.\n let data = null\n\n // 3. Let opcode be null.\n let opcode = null\n\n // 4. If chunk is a BufferSource ,\n if (webidl.is.BufferSource(chunk)) {\n // 4.1. Set data to a copy of the bytes given chunk .\n data = new Uint8Array(ArrayBuffer.isView(chunk) ? new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength) : chunk.slice())\n\n // 4.2. Set opcode to a binary frame opcode.\n opcode = opcodes.BINARY\n } else {\n // 5. Otherwise,\n\n // 5.1. Let string be the result of converting chunk to an IDL USVString .\n // If this throws an exception, return a promise rejected with the exception.\n let string\n\n try {\n string = webidl.converters.DOMString(chunk)\n } catch (e) {\n promise.reject(e)\n return promise.promise\n }\n\n // 5.2. Set data to the result of UTF-8 encoding string .\n data = new TextEncoder().encode(string)\n\n // 5.3. Set opcode to a text frame opcode.\n opcode = opcodes.TEXT\n }\n\n // 6. In parallel,\n // 6.1. Wait until there is sufficient buffer space in stream to send the message.\n\n // 6.2. If the closing handshake has not yet started , Send a WebSocket Message to stream comprised of data using opcode .\n if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {\n const frame = new WebsocketFrameSend(data)\n\n this.#handler.socket.write(frame.createFrame(opcode), () => {\n promise.resolve(undefined)\n })\n }\n\n // 6.3. Queue a global task on the WebSocket task source given stream ’s relevant global object to resolve promise with undefined.\n return promise.promise\n }\n\n /** @type {import('../websocket').Handler['onConnectionEstablished']} */\n #onConnectionEstablished (response, parsedExtensions) {\n this.#handler.socket = response.socket\n\n // Get options from dispatcher options\n const maxFragments = this.#handler.controller.dispatcher?.webSocketOptions?.maxFragments\n const maxPayloadSize = this.#handler.controller.dispatcher?.webSocketOptions?.maxPayloadSize\n\n const parser = new ByteParser(this.#handler, parsedExtensions, {\n maxFragments,\n maxPayloadSize\n })\n parser.on('drain', () => this.#handler.onParserDrain())\n parser.on('error', (err) => this.#handler.onParserError(err))\n\n this.#parser = parser\n\n // 1. Change stream ’s ready state to OPEN (1).\n this.#handler.readyState = states.OPEN\n\n // 2. Set stream ’s was ever connected to true.\n // This is done in the opening handshake.\n\n // 3. Let extensions be the extensions in use .\n const extensions = parsedExtensions ?? ''\n\n // 4. Let protocol be the subprotocol in use .\n const protocol = response.headersList.get('sec-websocket-protocol') ?? ''\n\n // 5. Let pullAlgorithm be an action that pulls bytes from stream .\n // 6. Let cancelAlgorithm be an action that cancels stream with reason , given reason .\n // 7. Let readable be a new ReadableStream .\n // 8. Set up readable with pullAlgorithm and cancelAlgorithm .\n const readable = new ReadableStream({\n start: (controller) => {\n this.#readableStreamController = controller\n },\n cancel: (reason) => this.#cancel(reason)\n })\n\n // 9. Let writeAlgorithm be an action that writes chunk to stream , given chunk .\n // 10. Let closeAlgorithm be an action that closes stream .\n // 11. Let abortAlgorithm be an action that aborts stream with reason , given reason .\n // 12. Let writable be a new WritableStream .\n // 13. Set up writable with writeAlgorithm , closeAlgorithm , and abortAlgorithm .\n const writable = new WritableStream({\n start: (controller) => {\n this.#writableStreamController = controller\n },\n write: (chunk) => this.#write(chunk),\n close: () => closeWebSocketConnection(this.#handler, null, null),\n abort: (reason) => this.#closeUsingReason(reason)\n })\n\n // Set stream ’s readable stream to readable .\n this.#readableStream = readable\n\n // Resolve stream ’s opened promise with WebSocketOpenInfo «[ \" extensions \" → extensions , \" protocol \" → protocol , \" readable \" → readable , \" writable \" → writable ]».\n this.#openedPromise.resolve({\n extensions,\n protocol,\n readable,\n writable\n })\n }\n\n /** @type {import('../websocket').Handler['onMessage']} */\n #onMessage (type, data) {\n // 1. If stream’s ready state is not OPEN (1), then return.\n if (this.#handler.readyState !== states.OPEN) {\n return\n }\n\n // 2. Let chunk be determined by switching on type:\n // - type indicates that the data is Text\n // a new DOMString containing data\n // - type indicates that the data is Binary\n // a new Uint8Array object, created in the relevant Realm of the\n // WebSocketStream object, whose contents are data\n let chunk\n\n if (type === opcodes.TEXT) {\n try {\n chunk = utf8Decode(data)\n } catch {\n failWebsocketConnection(this.#handler, 1007, 'Received invalid UTF-8 in text frame.')\n return\n }\n } else if (type === opcodes.BINARY) {\n chunk = new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n }\n\n // 3. Enqueue chunk into stream’s readable stream.\n this.#readableStreamController.enqueue(chunk)\n\n // 4. Apply backpressure to the WebSocket.\n }\n\n /** @type {import('../websocket').Handler['onSocketClose']} */\n #onSocketClose () {\n const wasClean =\n this.#handler.closeState.has(sentCloseFrameState.SENT) &&\n this.#handler.closeState.has(sentCloseFrameState.RECEIVED)\n\n // 1. Change the ready state to CLOSED (3).\n this.#handler.readyState = states.CLOSED\n\n // 2. If stream ’s handshake aborted is true, then return.\n if (this.#handshakeAborted) {\n return\n }\n\n // 3. If stream ’s was ever connected is false, then reject stream ’s opened promise with a new WebSocketError.\n if (!this.#handler.wasEverConnected) {\n this.#openedPromise.reject(new WebSocketError('Socket never opened'))\n }\n\n const result = this.#parser?.closingInfo\n\n // 4. Let code be the WebSocket connection close code .\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n // If this Close control frame contains no status code, _The WebSocket\n // Connection Close Code_ is considered to be 1005. If _The WebSocket\n // Connection is Closed_ and no Close control frame was received by the\n // endpoint (such as could occur if the underlying transport connection\n // is lost), _The WebSocket Connection Close Code_ is considered to be\n // 1006.\n let code = result?.code ?? 1005\n\n if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {\n code = 1006\n }\n\n // 5. Let reason be the result of applying UTF-8 decode without BOM to the WebSocket connection close reason .\n const reason = result?.reason == null ? '' : utf8DecodeBytes(Buffer.from(result.reason))\n\n // 6. If the connection was closed cleanly ,\n if (wasClean) {\n // 6.1. Close stream ’s readable stream .\n this.#readableStreamController.close()\n\n // 6.2. Error stream ’s writable stream with an \" InvalidStateError \" DOMException indicating that a closed WebSocketStream cannot be written to.\n this.#writableStreamController.error(new DOMException('A closed WebSocketStream cannot be written to', 'InvalidStateError'))\n\n // 6.3. Resolve stream ’s closed promise with WebSocketCloseInfo «[ \" closeCode \" → code , \" reason \" → reason ]».\n this.#closedPromise.resolve({\n closeCode: code,\n reason\n })\n } else {\n // 7. Otherwise,\n\n // 7.1. Let error be a new WebSocketError whose closeCode is code and reason is reason .\n const error = createUnvalidatedWebSocketError('unclean close', code, reason)\n\n // 7.2. Error stream ’s readable stream with error .\n this.#readableStreamController?.error(error)\n\n // 7.3. Error stream ’s writable stream with error .\n this.#writableStreamController?.error(error)\n\n // 7.4. Reject stream ’s closed promise with error .\n this.#closedPromise.reject(error)\n }\n }\n\n #closeUsingReason (reason) {\n // 1. Let code be null.\n let code = null\n\n // 2. Let reasonString be the empty string.\n let reasonString = ''\n\n // 3. If reason implements WebSocketError ,\n if (webidl.is.WebSocketError(reason)) {\n // 3.1. Set code to reason ’s closeCode .\n code = reason.closeCode\n\n // 3.2. Set reasonString to reason ’s reason .\n reasonString = reason.reason\n }\n\n // 4. Close the WebSocket with stream , code , and reasonString . If this throws an exception,\n // discard code and reasonString and close the WebSocket with stream .\n closeWebSocketConnection(this.#handler, code, reasonString)\n }\n\n // To cancel a WebSocketStream stream given reason , close using reason giving stream and reason .\n #cancel (reason) {\n this.#closeUsingReason(reason)\n }\n}\n\nObject.defineProperties(WebSocketStream.prototype, {\n url: kEnumerableProperty,\n opened: kEnumerableProperty,\n closed: kEnumerableProperty,\n close: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocketStream',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nwebidl.converters.WebSocketStreamOptions = webidl.dictionaryConverter([\n {\n key: 'protocols',\n converter: webidl.sequenceConverter(webidl.converters.USVString),\n defaultValue: () => []\n },\n {\n key: 'signal',\n converter: webidl.nullableConverter(webidl.converters.AbortSignal),\n defaultValue: () => null\n }\n])\n\nwebidl.converters.WebSocketCloseInfo = webidl.dictionaryConverter([\n {\n key: 'closeCode',\n converter: (V) => webidl.converters['unsigned short'](V, webidl.attributes.EnforceRange)\n },\n {\n key: 'reason',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n }\n])\n\nwebidl.converters.WebSocketStreamWrite = function (V) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V)\n }\n\n return webidl.converters.BufferSource(V)\n}\n\nmodule.exports = { WebSocketStream }\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n // LastEventId should not contain U+0000 NULL\n return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n if (value.length === 0) return false\n for (let i = 0; i < value.length; i++) {\n if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n }\n return true\n}\n\nmodule.exports = {\n isValidLastEventId,\n isASCIINumber\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\nconst DATA = Buffer.from('data')\nconst EVENT = Buffer.from('event')\nconst ID = Buffer.from('id')\nconst RETRY = Buffer.from('retry')\n\nfunction isASCIINumberBytes (buffer, start) {\n if (start >= buffer.length) {\n return false\n }\n\n for (let i = start; i < buffer.length; i++) {\n if (buffer[i] < 0x30 || buffer[i] > 0x39) {\n return false\n }\n }\n\n return true\n}\n\nfunction isValidLastEventIdBytes (buffer, start) {\n for (let i = start; i < buffer.length; i++) {\n if (buffer[i] === 0x00) {\n return false\n }\n }\n\n return true\n}\n\nfunction isFieldName (line, length, field) {\n if (length !== field.length) {\n return false\n }\n\n for (let i = 0; i < length; i++) {\n if (line[i] !== field[i]) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} [lastEventId] The last event ID received from the server.\n * @property {string} [origin] The origin of the event source.\n * @property {number} [reconnectionTime] The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n /**\n * @type {eventSourceSettings}\n */\n state\n\n /**\n * Leading byte-order-mark check.\n * @type {boolean}\n */\n checkBOM = true\n\n /**\n * @type {boolean}\n */\n crlfCheck = false\n\n /**\n * @type {boolean}\n */\n eventEndCheck = false\n\n /**\n * @type {Buffer[]}\n */\n chunks = []\n\n chunkIndex = 0\n pos = 0\n lineChunkIndex = 0\n linePos = 0\n\n event = {\n data: undefined,\n event: undefined,\n id: undefined,\n retry: undefined\n }\n\n /**\n * @param {object} options\n * @param {boolean} [options.readableObjectMode]\n * @param {eventSourceSettings} [options.eventSourceSettings]\n * @param {(chunk: any, encoding?: BufferEncoding | undefined) => boolean} [options.push]\n */\n constructor (options = {}) {\n // Enable object mode as EventSourceStream emits objects of shape\n // EventSourceStreamEvent\n options.readableObjectMode = true\n\n super(options)\n\n this.state = options.eventSourceSettings || {}\n if (options.push) {\n this.push = options.push\n }\n }\n\n /**\n * @param {Buffer} chunk\n * @param {string} _encoding\n * @param {Function} callback\n * @returns {void}\n */\n _transform (chunk, _encoding, callback) {\n if (chunk.length === 0) {\n callback()\n return\n }\n\n this.chunks.push(chunk)\n\n // Strip leading byte-order-mark if we opened the stream and started\n // the processing of the incoming data\n if (this.checkBOM) {\n if (this.handleBOM()) {\n callback()\n return\n }\n }\n\n while (this.hasCurrentByte()) {\n const byte = this.currentByte()\n\n // If the previous line ended with an end-of-line, we need to check\n // if the next character is also an end-of-line.\n if (this.eventEndCheck) {\n // If the the current character is an end-of-line, then the event\n // is finished and we can process it\n\n // If the previous line ended with a carriage return, we need to\n // check if the current character is a line feed and remove it\n // from the buffer.\n if (this.crlfCheck) {\n // If the current character is a line feed, we can remove it\n // from the buffer and reset the crlfCheck flag\n if (byte === LF) {\n this.crlfCheck = false\n this.consumeCurrentByte()\n\n // It is possible that the line feed is not the end of the\n // event. We need to check if the next character is an\n // end-of-line character to determine if the event is\n // finished. We simply continue the loop to check the next\n // character.\n\n // As we removed the line feed from the buffer and set the\n // crlfCheck flag to false, we basically don't make any\n // distinction between a line feed and a carriage return.\n continue\n }\n this.crlfCheck = false\n }\n\n if (byte === LF || byte === CR) {\n // If the current character is a carriage return, we need to\n // set the crlfCheck flag to true, as we need to check if the\n // next character is a line feed so we can remove it from the\n // buffer\n if (byte === CR) {\n this.crlfCheck = true\n }\n\n this.consumeCurrentByte()\n if (this.hasPendingEvent()) {\n this.processEvent(this.event)\n }\n this.clearEvent()\n continue\n }\n // If the current character is not an end-of-line, then the event\n // is not finished and we have to reset the eventEndCheck flag\n this.eventEndCheck = false\n continue\n }\n\n // If the current character is an end-of-line, we can process the\n // line\n if (byte === LF || byte === CR) {\n // If the current character is a carriage return, we need to\n // set the crlfCheck flag to true, as we need to check if the\n // next character is a line feed\n if (byte === CR) {\n this.crlfCheck = true\n }\n\n // In any case, we can process the line as we reached an\n // end-of-line character\n this.parseLine(this.readLine(), this.event)\n this.consumeCurrentByte()\n // A line was processed and this could be the end of the event. We need\n // to check if the next line is empty to determine if the event is\n // finished.\n this.eventEndCheck = true\n continue\n }\n\n this.advanceCursor()\n }\n\n callback()\n }\n\n /**\n * @param {Buffer} line\n * @param {EventSourceStreamEvent} event\n */\n parseLine (line, event) {\n // If the line is empty (a blank line)\n // Dispatch the event, as defined below.\n // This will be handled in the _transform method\n if (line.length === 0) {\n return\n }\n\n // If the line starts with a U+003A COLON character (:)\n // Ignore the line.\n const colonPosition = line.indexOf(COLON)\n if (colonPosition === 0) {\n return\n }\n\n let fieldLength = line.length\n let valueStart = line.length\n\n // If the line contains a U+003A COLON character (:)\n if (colonPosition !== -1) {\n fieldLength = colonPosition\n\n // Collect the characters on the line after the first U+003A COLON\n // character (:), and let value be that string.\n // If value starts with a U+0020 SPACE character, remove it from value.\n valueStart = colonPosition + 1\n if (line[valueStart] === SPACE) {\n ++valueStart\n }\n }\n\n if (isFieldName(line, fieldLength, DATA)) {\n const value = line.toString('utf8', valueStart)\n\n if (event.data === undefined) {\n event.data = value\n } else {\n event.data += `\\n${value}`\n }\n return\n }\n\n if (isFieldName(line, fieldLength, RETRY)) {\n if (isASCIINumberBytes(line, valueStart)) {\n event.retry = line.toString('utf8', valueStart)\n }\n return\n }\n\n if (isFieldName(line, fieldLength, ID)) {\n if (isValidLastEventIdBytes(line, valueStart)) {\n event.id = line.toString('utf8', valueStart)\n }\n return\n }\n\n if (isFieldName(line, fieldLength, EVENT)) {\n const value = line.toString('utf8', valueStart)\n\n if (value.length > 0) {\n event.event = value\n }\n }\n }\n\n /**\n * @param {EventSourceStreamEvent} event\n */\n processEvent (event) {\n if (event.retry && isASCIINumber(event.retry)) {\n this.state.reconnectionTime = parseInt(event.retry, 10)\n }\n\n if (event.id !== undefined && isValidLastEventId(event.id)) {\n this.state.lastEventId = event.id\n }\n\n // only dispatch event, when data is provided\n if (event.data !== undefined) {\n this.push({\n type: event.event || 'message',\n options: {\n data: event.data,\n lastEventId: this.state.lastEventId,\n origin: this.state.origin\n }\n })\n }\n }\n\n clearEvent () {\n this.event.data = undefined\n this.event.event = undefined\n this.event.id = undefined\n this.event.retry = undefined\n }\n\n hasPendingEvent () {\n return this.event.data !== undefined ||\n this.event.event !== undefined ||\n this.event.id !== undefined ||\n this.event.retry !== undefined\n }\n\n hasCurrentByte () {\n return this.chunkIndex < this.chunks.length &&\n this.pos < this.chunks[this.chunkIndex].length\n }\n\n currentByte () {\n return this.chunks[this.chunkIndex][this.pos]\n }\n\n consumeCurrentByte () {\n this.advanceCursor()\n this.syncLineStartToCursor()\n }\n\n advanceCursor () {\n this.pos++\n\n while (this.chunkIndex < this.chunks.length && this.pos >= this.chunks[this.chunkIndex].length) {\n this.chunkIndex++\n this.pos = 0\n }\n }\n\n syncLineStartToCursor () {\n this.lineChunkIndex = this.chunkIndex\n this.linePos = this.pos\n this.dropConsumedChunks()\n }\n\n dropConsumedChunks () {\n while (this.lineChunkIndex > 0) {\n this.chunks.shift()\n this.lineChunkIndex--\n this.chunkIndex--\n }\n\n if (this.chunkIndex === this.chunks.length) {\n this.chunks.length = 0\n this.chunkIndex = 0\n this.pos = 0\n this.lineChunkIndex = 0\n this.linePos = 0\n }\n }\n\n readLine () {\n if (this.lineChunkIndex === this.chunkIndex) {\n return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos)\n }\n\n const chunks = []\n let length = 0\n\n for (let i = this.lineChunkIndex; i <= this.chunkIndex; i++) {\n const chunk = this.chunks[i]\n const start = i === this.lineChunkIndex ? this.linePos : 0\n const end = i === this.chunkIndex ? this.pos : chunk.length\n const slice = chunk.subarray(start, end)\n length += slice.length\n chunks.push(slice)\n }\n\n return Buffer.concat(chunks, length)\n }\n\n peekBufferedByte (offset) {\n let chunkIndex = this.lineChunkIndex\n let pos = this.linePos\n\n while (chunkIndex < this.chunks.length) {\n const chunk = this.chunks[chunkIndex]\n const remaining = chunk.length - pos\n\n if (offset < remaining) {\n return chunk[pos + offset]\n }\n\n offset -= remaining\n chunkIndex++\n pos = 0\n }\n }\n\n discardLeadingBytes (count) {\n while (count > 0 && this.lineChunkIndex < this.chunks.length) {\n const chunk = this.chunks[this.lineChunkIndex]\n const remaining = chunk.length - this.linePos\n\n if (count < remaining) {\n this.linePos += count\n count = 0\n } else {\n count -= remaining\n this.lineChunkIndex++\n this.linePos = 0\n }\n }\n\n this.chunkIndex = this.lineChunkIndex\n this.pos = this.linePos\n this.dropConsumedChunks()\n }\n\n handleBOM () {\n const first = this.peekBufferedByte(0)\n const second = this.peekBufferedByte(1)\n const third = this.peekBufferedByte(2)\n\n if (second === undefined) {\n if (first === BOM[0]) {\n return true\n }\n\n this.checkBOM = false\n return true\n }\n\n if (third === undefined) {\n if (first === BOM[0] && second === BOM[1]) {\n return true\n }\n\n this.checkBOM = false\n return false\n }\n\n if (first === BOM[0] && second === BOM[1] && third === BOM[2]) {\n this.discardLeadingBytes(3)\n }\n\n this.checkBOM = false\n return !this.hasCurrentByte()\n }\n}\n\nmodule.exports = {\n EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @typedef ReadyState\n * @type {0|1|2}\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n #events = {\n open: null,\n error: null,\n message: null\n }\n\n #url\n #withCredentials = false\n\n /**\n * @type {ReadyState}\n */\n #readyState = CONNECTING\n\n #request = null\n #controller = null\n\n #dispatcher\n\n /**\n * @type {import('./eventsource-stream').eventSourceSettings}\n */\n #state\n\n /**\n * Creates a new EventSource object.\n * @param {string} url\n * @param {EventSourceInit} [eventSourceInitDict={}]\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n */\n constructor (url, eventSourceInitDict = {}) {\n // 1. Let ev be a new EventSource object.\n super()\n\n webidl.util.markAsUncloneable(this)\n\n const prefix = 'EventSource constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n code: 'UNDICI-ES'\n })\n }\n\n url = webidl.converters.USVString(url)\n eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n this.#dispatcher = eventSourceInitDict.node.dispatcher || eventSourceInitDict.dispatcher\n this.#state = {\n lastEventId: '',\n reconnectionTime: eventSourceInitDict.node.reconnectionTime\n }\n\n // 2. Let settings be ev's relevant settings object.\n // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n const settings = environmentSettingsObject\n\n let urlRecord\n\n try {\n // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n urlRecord = new URL(url, settings.settingsObject.baseUrl)\n this.#state.origin = urlRecord.origin\n } catch (e) {\n // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 5. Set ev's url to urlRecord.\n this.#url = urlRecord.href\n\n // 6. Let corsAttributeState be Anonymous.\n let corsAttributeState = ANONYMOUS\n\n // 7. If the value of eventSourceInitDict's withCredentials member is true,\n // then set corsAttributeState to Use Credentials and set ev's\n // withCredentials attribute to true.\n if (eventSourceInitDict.withCredentials === true) {\n corsAttributeState = USE_CREDENTIALS\n this.#withCredentials = true\n }\n\n // 8. Let request be the result of creating a potential-CORS request given\n // urlRecord, the empty string, and corsAttributeState.\n const initRequest = {\n redirect: 'follow',\n keepalive: true,\n // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n mode: 'cors',\n credentials: corsAttributeState === 'anonymous'\n ? 'same-origin'\n : 'omit',\n referrer: 'no-referrer'\n }\n\n // 9. Set request's client to settings.\n initRequest.client = environmentSettingsObject.settingsObject\n\n // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n // 11. Set request's cache mode to \"no-store\".\n initRequest.cache = 'no-store'\n\n // 12. Set request's initiator type to \"other\".\n initRequest.initiator = 'other'\n\n initRequest.urlList = [new URL(this.#url)]\n\n // 13. Set ev's request to request.\n this.#request = makeRequest(initRequest)\n\n this.#connect()\n }\n\n /**\n * Returns the state of this EventSource object's connection. It can have the\n * values described below.\n * @returns {ReadyState}\n * @readonly\n */\n get readyState () {\n return this.#readyState\n }\n\n /**\n * Returns the URL providing the event stream.\n * @readonly\n * @returns {string}\n */\n get url () {\n return this.#url\n }\n\n /**\n * Returns a boolean indicating whether the EventSource object was\n * instantiated with CORS credentials set (true), or not (false, the default).\n */\n get withCredentials () {\n return this.#withCredentials\n }\n\n #connect () {\n if (this.#readyState === CLOSED) return\n\n this.#readyState = CONNECTING\n\n const fetchParams = {\n request: this.#request,\n dispatcher: this.#dispatcher\n }\n\n // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n const processEventSourceEndOfBody = (response) => {\n if (!isNetworkError(response)) {\n return this.#reconnect()\n }\n }\n\n // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n // and processResponse set to the following steps given response res:\n fetchParams.processResponse = (response) => {\n // 1. If res is an aborted network error, then fail the connection.\n\n if (isNetworkError(response)) {\n // 1. When a user agent is to fail the connection, the user agent\n // must queue a task which, if the readyState attribute is set to a\n // value other than CLOSED, sets the readyState attribute to CLOSED\n // and fires an event named error at the EventSource object. Once the\n // user agent has failed the connection, it does not attempt to\n // reconnect.\n if (response.aborted) {\n this.close()\n this.dispatchEvent(new Event('error'))\n return\n // 2. Otherwise, if res is a network error, then reestablish the\n // connection, unless the user agent knows that to be futile, in\n // which case the user agent may fail the connection.\n } else {\n this.#reconnect()\n return\n }\n }\n\n // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n // is not `text/event-stream`, then fail the connection.\n const contentType = response.headersList.get('content-type', true)\n const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n if (\n response.status !== 200 ||\n contentTypeValid === false\n ) {\n this.close()\n this.dispatchEvent(new Event('error'))\n return\n }\n\n // 4. Otherwise, announce the connection and interpret res's body\n // line by line.\n\n // When a user agent is to announce the connection, the user agent\n // must queue a task which, if the readyState attribute is set to a\n // value other than CLOSED, sets the readyState attribute to OPEN\n // and fires an event named open at the EventSource object.\n // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n this.#readyState = OPEN\n this.dispatchEvent(new Event('open'))\n\n // If redirected to a different origin, set the origin to the new origin.\n this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n const eventSourceStream = new EventSourceStream({\n eventSourceSettings: this.#state,\n push: (event) => {\n this.dispatchEvent(createFastMessageEvent(\n event.type,\n event.options\n ))\n }\n })\n\n pipeline(response.body.stream,\n eventSourceStream,\n (error) => {\n if (\n error?.aborted === false\n ) {\n this.close()\n this.dispatchEvent(new Event('error'))\n }\n })\n }\n\n this.#controller = fetching(fetchParams)\n }\n\n /**\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n * @returns {void}\n */\n #reconnect () {\n // When a user agent is to reestablish the connection, the user agent must\n // run the following steps. These steps are run in parallel, not as part of\n // a task. (The tasks that it queues, of course, are run like normal tasks\n // and not themselves in parallel.)\n\n // 1. Queue a task to run the following steps:\n\n // 1. If the readyState attribute is set to CLOSED, abort the task.\n if (this.#readyState === CLOSED) return\n\n // 2. Set the readyState attribute to CONNECTING.\n this.#readyState = CONNECTING\n\n // 3. Fire an event named error at the EventSource object.\n this.dispatchEvent(new Event('error'))\n\n // 2. Wait a delay equal to the reconnection time of the event source.\n setTimeout(() => {\n // 5. Queue a task to run the following steps:\n\n // 1. If the EventSource object's readyState attribute is not set to\n // CONNECTING, then return.\n if (this.#readyState !== CONNECTING) return\n\n // 2. Let request be the EventSource object's request.\n // 3. If the EventSource object's last event ID string is not the empty\n // string, then:\n // 1. Let lastEventIDValue be the EventSource object's last event ID\n // string, encoded as UTF-8.\n // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n // list.\n if (this.#state.lastEventId.length) {\n this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n }\n\n // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n this.#connect()\n }, this.#state.reconnectionTime)?.unref()\n }\n\n /**\n * Closes the connection, if any, and sets the readyState attribute to\n * CLOSED.\n */\n close () {\n webidl.brandCheck(this, EventSource)\n\n if (this.#readyState === CLOSED) return\n this.#readyState = CLOSED\n this.#controller.abort()\n this.#request = null\n }\n\n get onopen () {\n return this.#events.open\n }\n\n set onopen (fn) {\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('open', listener)\n this.#events.open = fn\n } else {\n this.#events.open = null\n }\n }\n\n get onmessage () {\n return this.#events.message\n }\n\n set onmessage (fn) {\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('message', listener)\n this.#events.message = fn\n } else {\n this.#events.message = null\n }\n }\n\n get onerror () {\n return this.#events.error\n }\n\n set onerror (fn) {\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n const listener = webidl.converters.EventHandlerNonNull(fn)\n\n if (listener !== null) {\n this.addEventListener('error', listener)\n this.#events.error = fn\n } else {\n this.#events.error = null\n }\n }\n}\n\nconst constantsPropertyDescriptors = {\n CONNECTING: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: CONNECTING,\n writable: false\n },\n OPEN: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: OPEN,\n writable: false\n },\n CLOSED: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: CLOSED,\n writable: false\n }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n close: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n onopen: kEnumerableProperty,\n readyState: kEnumerableProperty,\n url: kEnumerableProperty,\n withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n {\n key: 'withCredentials',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'dispatcher', // undici only\n converter: webidl.converters.any\n },\n {\n key: 'node', // undici only\n converter: webidl.dictionaryConverter([\n {\n key: 'reconnectionTime',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => defaultReconnectionTime\n },\n {\n key: 'dispatcher',\n converter: webidl.converters.any\n }\n ]),\n defaultValue: () => ({})\n }\n])\n\nmodule.exports = {\n EventSource,\n defaultReconnectionTime\n}\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst RoundRobinPool = require('./lib/dispatcher/round-robin-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst Socks5ProxyAgent = require('./lib/dispatcher/socks5-proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst H2CClient = require('./lib/dispatcher/h2c-client')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst { MockCallHistory, MockCallHistoryLog } = require('./lib/mock/mock-call-history')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst SnapshotAgent = require('./lib/mock/snapshot-agent')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.RoundRobinPool = RoundRobinPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.Socks5ProxyAgent = Socks5ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.H2CClient = H2CClient\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.interceptors = {\n redirect: require('./lib/interceptor/redirect'),\n responseError: require('./lib/interceptor/response-error'),\n retry: require('./lib/interceptor/retry'),\n dump: require('./lib/interceptor/dump'),\n dns: require('./lib/interceptor/dns'),\n cache: require('./lib/interceptor/cache'),\n decompress: require('./lib/interceptor/decompress'),\n deduplicate: require('./lib/interceptor/deduplicate')\n}\n\nmodule.exports.cacheStores = {\n MemoryCacheStore: require('./lib/cache/memory-cache-store')\n}\n\nconst SqliteCacheStore = require('./lib/cache/sqlite-cache-store')\nmodule.exports.cacheStores.SqliteCacheStore = SqliteCacheStore\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n parseHeaders: util.parseHeaders,\n headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n return (url, opts, handler) => {\n if (typeof opts === 'function') {\n handler = opts\n opts = null\n }\n\n if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n throw new InvalidArgumentError('invalid url')\n }\n\n if (opts != null && typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (opts && opts.path != null) {\n if (typeof opts.path !== 'string') {\n throw new InvalidArgumentError('invalid opts.path')\n }\n\n let path = opts.path\n if (!opts.path.startsWith('/')) {\n path = `/${path}`\n }\n\n url = new URL(util.parseOrigin(url).origin + path)\n } else {\n if (!opts) {\n opts = typeof url === 'object' ? url : {}\n }\n\n url = util.parseURL(url)\n }\n\n const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n if (agent) {\n throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n }\n\n return fn.call(dispatcher, {\n ...opts,\n origin: url.origin,\n path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n method: opts.method || (opts.body ? 'PUT' : 'GET')\n }, handler)\n }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\n\n// Capture __filename at module load time for stack trace augmentation.\n// This may be undefined when bundled in environments like Node.js internals.\nconst currentFilename = typeof __filename !== 'undefined' ? __filename : undefined\n\nfunction appendFetchStackTrace (err, filename) {\n if (!err || typeof err !== 'object') {\n return\n }\n\n const stack = typeof err.stack === 'string' ? err.stack : ''\n const normalizedFilename = filename.replace(/\\\\/g, '/')\n\n if (stack && (stack.includes(filename) || stack.includes(normalizedFilename))) {\n return\n }\n\n const capture = {}\n Error.captureStackTrace(capture, appendFetchStackTrace)\n\n if (!capture.stack) {\n return\n }\n\n const captureLines = capture.stack.split('\\n').slice(1).join('\\n')\n\n err.stack = stack ? `${stack}\\n${captureLines}` : capture.stack\n}\n\nmodule.exports.fetch = function fetch (init, options = undefined) {\n return fetchImpl(init, options).catch(err => {\n if (currentFilename) {\n appendFetchStackTrace(err, currentFilename)\n } else if (err && typeof err === 'object') {\n Error.captureStackTrace(err, module.exports.fetch)\n }\n throw err\n })\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/core/symbols')\n\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie, parseCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\nmodule.exports.parseCookie = parseCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nconst { WebSocket, ping } = require('./lib/web/websocket/websocket')\nmodule.exports.WebSocket = WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\nmodule.exports.ping = ping\n\nmodule.exports.WebSocketStream = require('./lib/web/websocket/stream/websocketstream').WebSocketStream\nmodule.exports.WebSocketError = require('./lib/web/websocket/stream/websocketerror').WebSocketError\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockCallHistory = MockCallHistory\nmodule.exports.MockCallHistoryLog = MockCallHistoryLog\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.SnapshotAgent = SnapshotAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n\nfunction install () {\n globalThis.fetch = module.exports.fetch\n globalThis.Headers = module.exports.Headers\n globalThis.Response = module.exports.Response\n globalThis.Request = module.exports.Request\n globalThis.FormData = module.exports.FormData\n globalThis.WebSocket = module.exports.WebSocket\n globalThis.CloseEvent = module.exports.CloseEvent\n globalThis.ErrorEvent = module.exports.ErrorEvent\n globalThis.MessageEvent = module.exports.MessageEvent\n globalThis.EventSource = module.exports.EventSource\n}\n\nmodule.exports.install = install\n","import{t as e}from\"./command-executor-D_UBZHxh.js\";import{t}from\"./http-executor-ADn4locH.js\";import{accessSync as n,chmodSync as r,constants as i,mkdirSync as a,realpathSync as o,renameSync as s,rmSync as c,statSync as l,unlinkSync as u,writeFileSync as d}from\"node:fs\";import{basename as f,dirname as p,isAbsolute as m,join as h,relative as g,resolve as _,sep as v}from\"node:path\";import{lookup as y}from\"node:dns/promises\";import{isIP as b}from\"node:net\";import{Agent as x,fetch as S}from\"undici/index.js\";function C(e){if(typeof e!=`string`)throw TypeError(`executionRoot must be a string`);if(e.trim().length===0)throw TypeError(`executionRoot must be a non-empty string`);if(!m(e))throw TypeError(`executionRoot must be an absolute path`);let t;try{t=o(e)}catch{throw TypeError(`executionRoot must name an existing accessible directory`)}if(!l(t).isDirectory())throw TypeError(`executionRoot must name a directory`);try{n(t,i.R_OK|i.X_OK)}catch{throw TypeError(`executionRoot directory must be readable and traversable`)}return t}function w(e){let t=[],n=_(e);for(;;)try{return h(o(n),...t)}catch{let r=p(n);if(r===n)return _(e);t.unshift(f(n)),n=r}}function T(e,t){let n=w(e),r=w(t);return r===n||r.startsWith(n+v)}const E=384,D=448;var O=class extends Error{constructor(e){super(e),this.name=`OwnerOnlyModeError`}};function k(e=process.platform){return e===`win32`?`windows-acl`:`posix-mode`}function A(e,t){let n=g(e,t);if(n.startsWith(`..`)||m(n))throw new O(`withinRoot ${e} is not an ancestor of ${t}, so this call cannot own the path between them.`);let r=n.split(v).filter(e=>e.length>0),i=[e],a=e;for(let e of r)a=h(a,e),i.push(a);return i}function j(e,t,n={}){if(k()!==`posix-mode`)return;let r=(n.readMode??(e=>l(e).mode&4095))(e);if(r&63)throw new O(`${t} ${e} is mode 0${r.toString(8)} after being set owner-only; group or other permissions survived, so its contents are readable by another account.`)}function M(e,t={}){let n=t.makeDirectory??((e,t)=>{a(e,{recursive:!0,mode:t})}),i=t.setMode??((e,t)=>r(e,t));n(e,448);let o=t.withinRoot===void 0?[e]:A(t.withinRoot,e);for(let e of o)k()===`posix-mode`&&i(e,448),j(e,`directory`,t)}function N(e,t){M(p(e));let n=`${e}.${process.pid}.tmp`;c(n,{force:!0}),d(n,t,{encoding:`utf8`,mode:384,flag:`wx`});try{j(n,`file`),s(n,e)}catch(e){try{u(n)}catch{}throw e}j(e,`file`)}function P(e){if(k()!==`posix-mode`)return;let t;try{t=l(e).mode&4095}catch{return}t&63&&(r(e,384),j(e,`file`))}function F(e){let t=b(e);return t===4?I(e.split(`.`).map(Number)):t!==6||L(e)}function I(e){let[t=0,n=0,r=0]=e;return t===0||t===10||t===127||t===100&&n>=64&&n<=127||t===169&&n===254||t===172&&n>=16&&n<=31||t===192&&n===0&&r===0||t===192&&n===168||t===198&&(n===18||n===19)||t>=224}function L(e){let t=z(e);if(t===void 0)return!0;let[n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0]=t;return n===0&&r===0&&i===0&&a===0&&o===0&&s===65535||n===100&&r===65435&&i===0&&a===0&&o===0&&s===0?I([c>>8,c&255,l>>8,l&255]):n===0&&r===0&&i===0&&a===0&&o===0&&s===0||(n&65024)==64512||(n&65472)==65152||(n&65472)==65216||(n&65280)==65280}function R(e){let t=e.lastIndexOf(`:`),n=e.slice(t+1);if(!n.includes(`.`))return e;if(t<0||b(n)!==4)return;let[r=0,i=0,a=0,o=0]=n.split(`.`).map(Number),s=(r<<8|i).toString(16),c=(a<<8|o).toString(16);return`${e.slice(0,t+1)}${s}:${c}`}function z(e){let t=R(e.split(`%`)[0]??e);if(t===void 0)return;let n=t.split(`::`);if(n.length>2)return;let r=e=>e.length===0?[]:e.split(`:`).map(e=>Number.parseInt(e,16)),i=r(n[0]??``),a=n.length===2?r(n[1]??``):[],o=8-i.length-a.length;if(o<0||n.length===1&&o!==0)return;let s=[...i,...Array(o).fill(0),...a];return s.some(e=>Number.isNaN(e)||e<0||e>65535)?void 0:s}const B=3e4,V=5e6,H=new Set([301,302,303,307,308]),U=new Set([`localhost`,`metadata`,`metadata.google.internal`,`metadata.goog`,`instance-data`,`instance-data.ec2.internal`]),W=async e=>(await y(e,{all:!0,verbatim:!0})).map(e=>e.address);async function G(e,t={},n=W){let r=e.href;if(e.protocol!==`http:`&&e.protocol!==`https:`)return{reason:`unsupported_scheme`,url:r,message:`Only http(s) URLs may be fetched.`};if(t.allowPrivateAddresses===!0)return;let i=e.hostname.replace(/^\\[|\\]$/g,``).toLowerCase();if(t.allowedHosts?.includes(i))return;if(U.has(i)||i.endsWith(`.localhost`))return{reason:`metadata_host`,url:r,message:`Destination \"${i}\" is a loopback or cloud-metadata host and is not reachable from tools.`};let a=b(i)?[i]:await K(i,n);if(a===void 0||a.length===0)return{reason:`unresolvable`,url:r,message:`Destination \"${i}\" did not resolve.`};let o=a.find(F);if(o!==void 0)return{reason:`private_destination`,url:r,message:`Destination \"${i}\" resolves to ${o}, a private, loopback or link-local address, and is not reachable from tools.`}}async function K(e,t){try{return await t(e)}catch{return}}async function q(e,t,n){n.throwIfAborted();let r;try{return await Promise.race([t(e),new Promise((e,t)=>{r=()=>t(n.reason),n.addEventListener(`abort`,r,{once:!0}),n.aborted&&r()})])}finally{r&&n.removeEventListener(`abort`,r)}}async function J(e,t,n,r,i){let a=e.hostname.replace(/^\\[|\\]$/g,``).toLowerCase(),o,s=async e=>{let t=await q(e,r.lookup??W,i);if(t.length===0||t.some(e=>b(e)===0))throw Error(`Invalid DNS answer`);return o=Object.freeze([...t]),o},c=await G(e,n,s);if(i.throwIfAborted(),c)return c;if(r.fetch){let n=await r.fetch(e.href,{...t,signal:i,redirect:`manual`});return{response:n,close:async()=>{n.body&&!n.body.locked&&await n.body.cancel().catch(()=>void 0)}}}if(o??=b(a)?[a]:await K(a,s),i.throwIfAborted(),!o||o.length===0)return{reason:`unresolvable`,url:e.href,message:`Destination did not resolve to valid IP addresses.`};let l=o.map(e=>({address:e,family:b(e)})),u=new x({connections:1,pipelining:0,connect:{lookup:(e,t,n)=>{if(e.toLowerCase()!==a||i.aborted){n(Error(`Connection authority unavailable`),``,4);return}let r=typeof t==`number`?t:t.family,o=l.filter(e=>!r||e.family===r);if(o.length===0){n(Error(`No validated address family`),``,4);return}typeof t==`object`&&t.all?n(null,o):n(null,o[0].address,o[0].family)}}});if(typeof u.dispatch!=`function`||typeof u.destroy!=`function`)throw Error(`Pinned HTTP transport is unavailable in this runtime`);try{return{response:await S(e.href,{...t,signal:i,redirect:`manual`,dispatcher:u}),close:async()=>{await u.destroy()}}}catch(e){throw await u.destroy(),e}}async function Y(e,t={},n={},r={}){let i=t.maxResponseBytes??V,a=n.maxRedirects??5,o=AbortSignal.timeout(t.timeoutMs??B),s=t.signal?AbortSignal.any([o,t.signal]):o,c=new URL(e),l={...t.headers??{}};for(let e=0;;e+=1){let t=await J(c,{headers:l,signal:s,redirect:`manual`},n,r,s);if(!(`response`in t))return{ok:!1,rejection:t};try{let n=t.response;if(!H.has(n.status))return await Q(n,c.href,i,s);let r=n.headers.get(`location`);if(r===null)return{ok:!1,rejection:{reason:`redirect_without_location`,url:c.href,message:`HTTP ${n.status} without a Location header.`}};if(e>=a)return{ok:!1,rejection:{reason:`redirect_limit`,url:c.href,message:`More than ${a} redirects.`}};let o=new URL(r,c);o.origin!==c.origin&&(l=Z(l)),c=o}finally{await t.close()}}}async function X(e,t,n={},r={}){let i=t.maxResponseBytes??V,a=AbortSignal.timeout(t.timeoutMs??B),o=t.signal?AbortSignal.any([a,t.signal]):a,s=new URL(e),c=await J(s,{method:`POST`,headers:{...t.headers??{}},body:t.body,signal:o,redirect:`manual`},n,r,o);if(!(`response`in c))return{ok:!1,rejection:c};try{let e=c.response;return e.status>=300&&e.status<400?(await e.body?.cancel().catch(()=>void 0),{ok:!1,rejection:{reason:`redirect_refused`,url:s.href,message:`HTTP ${e.status}: a POST is never redirected.`}}):await Q(e,s.href,i,o)}finally{await c.close()}}function Z(e){let t={};for(let[n,r]of Object.entries(e))n.toLowerCase()===`user-agent`&&(t[n]=r);return t}async function Q(e,t,n,r){let i=e=>({ok:!1,rejection:{reason:`response_too_large`,url:t,message:`Response exceeds ${n} bytes (${e} seen).`}}),a=Number(e.headers.get(`content-length`));if(Number.isFinite(a)&&a>n)return await e.body?.cancel(),i(a);let o=[],s=0;if(!e.body&&typeof e.arrayBuffer==`function`){let t=new Uint8Array(await e.arrayBuffer());if(t.byteLength>n)return i(t.byteLength);o.push(t),s=t.byteLength}else if(e.body){let t=e.body.getReader();for(;;){r.throwIfAborted();let{done:e,value:a}=await t.read();if(e)break;if(s+=a.byteLength,s>n)return await t.cancel(),i(s);o.push(a)}}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return{ok:!0,status:e.status,statusText:e.statusText,headers:e.headers,body:c,finalUrl:t}}export{U as BLOCKED_HOSTNAMES,e as CommandExecutor,t as HttpExecutor,D as OWNER_ONLY_DIRECTORY_MODE,E as OWNER_ONLY_FILE_MODE,O as OwnerOnlyModeError,w as canonicalizePath,M as ensureOwnerOnlyDirectory,Y as fetchWithEgressPolicy,T as isPathInside,F as isPrivateAddress,J as openEgressExchange,k as ownerOnlyGuarantee,X as postWithEgressPolicy,G as rejectDestination,C as resolveTrustedExecutionRoot,P as tightenExistingFile,N as writeOwnerOnlyFile};\n//# sourceMappingURL=node.js.map","import { chmod, mkdir, open, readFile, readdir, readlink, realpath, rename, rm, stat, writeFile } from \"node:fs/promises\";\nimport { basename, dirname, isAbsolute, join, posix, resolve, sep } from \"node:path\";\nimport { spawn, spawnSync } from \"node:child_process\";\nimport { randomBytes, randomUUID } from \"node:crypto\";\nimport { chmodSync, constants, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, writeFileSync } from \"node:fs\";\nimport { homedir, tmpdir } from \"node:os\";\nimport { FunctionTool, PROTECTED_DIRECTORY_NAMES, PROTECTED_FILE_NAMES, TOOL_SEARCH_TOOL_NAME, ToolExecutionError, ValidationError, createBoundedOutput, registerToolPermissionProfile, resolvePlatformShell, splitCommandSegments, subprocessTraceEnvironment, zodToJsonSchema } from \"@robota-sdk/agent-core\";\nimport { z } from \"zod\";\nimport { killProcessTree } from \"@robota-sdk/agent-process\";\nimport { fetchWithEgressPolicy, isPathInside } from \"@robota-sdk/agent-core/node\";\nimport fg from \"fast-glob\";\nimport pLimit from \"p-limit\";\nimport { EventEmitter } from \"node:events\";\nimport { Worker } from \"node:worker_threads\";\n//#region src/sandbox/e2b-sandbox-client.ts\nfunction reference(value) {\n\tif (typeof value !== \"string\" || value.trim().length === 0 || value.length > 1024 || [...value].some((character) => {\n\t\tconst code = character.codePointAt(0);\n\t\treturn code < 32 || code === 127 || code >= 55296 && code <= 57343;\n\t})) throw new Error(\"E2B resumable worker reference is invalid.\");\n\treturn value;\n}\nfunction validateAdapter(value) {\n\tif (value === null || typeof value !== \"object\" || typeof value.commands?.run !== \"function\" || typeof value.files?.read !== \"function\" || typeof value.files?.write !== \"function\") throw new Error(\"E2B worker adapter is invalid.\");\n}\nfunction completion(result) {\n\tif (result === null || typeof result !== \"object\") throw new Error(\"E2B command exit code is missing.\");\n\tconst exitCode = result.exitCode !== void 0 ? result.exitCode : result.exit_code;\n\tif (!Number.isSafeInteger(exitCode) || result.exitCode !== void 0 && result.exit_code !== void 0 && result.exitCode !== result.exit_code) throw new Error(\"E2B command exit code is missing, invalid or inconsistent.\");\n\tif (result.stdout !== void 0 && typeof result.stdout !== \"string\" || result.stderr !== void 0 && typeof result.stderr !== \"string\") throw new Error(\"E2B command output is invalid.\");\n\treturn {\n\t\tstdout: result.stdout ?? \"\",\n\t\tstderr: result.stderr ?? \"\",\n\t\texitCode\n\t};\n}\nvar E2BSandboxClient = class {\n\tsandbox;\n\tgeneration = 0;\n\trestoring = false;\n\tconnectSandbox;\n\tcreateSandboxFromSnapshot;\n\tconstructor(options) {\n\t\tvalidateAdapter(options.sandbox);\n\t\tthis.sandbox = options.sandbox;\n\t\tthis.connectSandbox = options.connectSandbox;\n\t\tthis.createSandboxFromSnapshot = options.createSandboxFromSnapshot;\n\t}\n\tasync run(command, options) {\n\t\treturn completion(await this.withWorker((sandbox) => sandbox.commands.run(command, {\n\t\t\tbackground: false,\n\t\t\ttimeoutMs: options?.timeoutMs,\n\t\t\tcwd: options?.workingDirectory\n\t\t})));\n\t}\n\tasync readFile(path) {\n\t\tconst content = await this.withWorker((sandbox) => sandbox.files.read(path));\n\t\tif (typeof content !== \"string\" && !(content instanceof Uint8Array)) throw new Error(\"E2B file response is invalid.\");\n\t\treturn typeof content === \"string\" ? content : Buffer.from(content).toString(\"utf8\");\n\t}\n\tasync writeFile(path, content) {\n\t\tawait this.withWorker((sandbox) => sandbox.files.write(path, content));\n\t}\n\tasync snapshot() {\n\t\treturn this.withWorker(async (sandbox) => {\n\t\t\tif (sandbox.createSnapshot) {\n\t\t\t\tconst snapshot = await sandbox.createSnapshot();\n\t\t\t\tif (snapshot === null || typeof snapshot !== \"object\" || snapshot.snapshotId !== void 0 && snapshot.id !== void 0 && snapshot.snapshotId !== snapshot.id) throw new Error(\"E2B snapshot identity is invalid or inconsistent.\");\n\t\t\t\treturn reference(snapshot.snapshotId ?? snapshot.id);\n\t\t\t}\n\t\t\tconst sandboxId = reference(sandbox.sandboxId);\n\t\t\tif (!sandbox.pause) throw new Error(\"E2B sandbox adapter does not expose pause().\");\n\t\t\tawait sandbox.pause();\n\t\t\treturn sandboxId;\n\t\t});\n\t}\n\tasync restore(snapshotId) {\n\t\tif (this.restoring) throw new Error(\"E2B worker restore is already in progress.\");\n\t\tconst previous = this.sandbox;\n\t\tthis.sandbox = void 0;\n\t\tthis.generation++;\n\t\tthis.restoring = true;\n\t\ttry {\n\t\t\treference(snapshotId);\n\t\t\tlet restored;\n\t\t\tif (this.createSandboxFromSnapshot) restored = await this.createSandboxFromSnapshot(snapshotId);\n\t\t\telse if (this.connectSandbox) restored = await this.connectSandbox(snapshotId);\n\t\t\telse if (previous?.sandboxId === snapshotId && previous.connect) restored = await previous.connect();\n\t\t\telse throw new Error(\"E2B sandbox restore requires connectSandbox(snapshotId) or sandbox.connect().\");\n\t\t\tvalidateAdapter(restored);\n\t\t\tif (!this.createSandboxFromSnapshot && restored.sandboxId !== snapshotId) throw new Error(\"E2B restored worker identity does not match the requested reference.\");\n\t\t\tthis.sandbox = restored;\n\t\t} finally {\n\t\t\tthis.restoring = false;\n\t\t}\n\t}\n\tasync withWorker(operation) {\n\t\tconst sandbox = this.sandbox;\n\t\tconst generation = this.generation;\n\t\tif (sandbox === void 0 || this.restoring) throw new Error(\"E2B worker is not available; a successful restore is required.\");\n\t\tconst result = await operation(sandbox);\n\t\tif (generation !== this.generation || sandbox !== this.sandbox) throw new Error(\"E2B worker changed during the operation; the previous worker result is refused.\");\n\t\treturn result;\n\t}\n};\n//#endregion\n//#region src/sandbox/in-memory-sandbox-client.ts\nvar InMemorySandboxClient = class {\n\tfiles = /* @__PURE__ */ new Map();\n\tsnapshots = /* @__PURE__ */ new Map();\n\trunHandler;\n\tsnapshotSequence = 0;\n\tconstructor(options = {}) {\n\t\tfor (const [path, content] of Object.entries(options.files ?? {})) this.files.set(path, content);\n\t\tthis.runHandler = options.runHandler;\n\t}\n\tasync run(command, options) {\n\t\tif (this.runHandler) return this.runHandler(command, options, this.files);\n\t\treturn {\n\t\t\tstdout: \"\",\n\t\t\tstderr: \"\",\n\t\t\texitCode: 0\n\t\t};\n\t}\n\tasync readFile(path) {\n\t\tconst content = this.files.get(path);\n\t\tif (content === void 0) throw new Error(`Sandbox file not found: ${path}`);\n\t\treturn content;\n\t}\n\tasync writeFile(path, content) {\n\t\tthis.files.set(path, content);\n\t}\n\tasync snapshot() {\n\t\tconst snapshotId = `snapshot-${++this.snapshotSequence}`;\n\t\tthis.snapshots.set(snapshotId, new Map(this.files));\n\t\treturn snapshotId;\n\t}\n\tasync restore(snapshotId) {\n\t\tconst snapshot = this.snapshots.get(snapshotId);\n\t\tif (!snapshot) throw new Error(`Sandbox snapshot not found: ${snapshotId}`);\n\t\tthis.files.clear();\n\t\tfor (const [path, content] of snapshot.entries()) this.files.set(path, content);\n\t}\n\tgetFile(path) {\n\t\treturn this.files.get(path);\n\t}\n};\n//#endregion\n//#region src/sandbox/containment.ts\nfunction describeExecutionContainment(client) {\n\tif (client === void 0) return \"host\";\n\treturn `sandbox-${client.filesystem ?? \"separate\"}`;\n}\n/** Whether file tools must read and write through the sandbox rather than the host filesystem. */\nfunction routesFilesThroughSandbox(client) {\n\treturn describeExecutionContainment(client) === \"sandbox-separate\";\n}\n//#endregion\n//#region src/sandbox/manifest-enforceability.ts\n/**\n* Refuse a manifest whose security-bearing fields the built-in applicator cannot enforce.\n*\n* Emptiness is what is checked, not presence: `environment: {}` and `permissions: {}` request\n* nothing, so refusing them would fail a caller that asked for no controls at all. `permissions`\n* counts as empty when neither list has an entry — `{ read: [] }` is a declared-but-empty policy,\n* not a policy.\n*/\nfunction refuseUnenforceableManifestControls(manifest) {\n\tconst unenforceable = [];\n\tif (manifest.environment && Object.keys(manifest.environment).length > 0) unenforceable.push(\"environment\");\n\tconst permissions = manifest.permissions;\n\tconst requestsSomething = (value) => Array.isArray(value) ? value.length > 0 : value !== void 0;\n\tif (permissions && Object.values(permissions).some(requestsSomething)) unenforceable.push(\"permissions\");\n\tif (unenforceable.length === 0) return;\n\tthrow new Error(`workspace manifest requests ${unenforceable.join(\" and \")}, which this sandbox client cannot enforce. The built-in applicator applies entries only. Supply a sandbox client that implements applyManifest and honours these fields, or remove them from the manifest — they were previously accepted and silently ignored, which reported a sandbox policy that was never applied (issue #2027).`);\n}\n//#endregion\n//#region src/sandbox/workspace-manifest.ts\nconst DEFAULT_TARGET_ROOT = \"/workspace\";\nconst WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\\\/]/;\nconst SHELL_QUOTE_PATTERN = /'/g;\nasync function applyWorkspaceManifest(sandboxClient, manifest, options = {}) {\n\tif (sandboxClient.applyManifest) return sandboxClient.applyManifest(manifest, options);\n\trefuseUnenforceableManifestControls(manifest);\n\tconst targetRoot = normalizeSandboxRoot(options.targetRoot ?? DEFAULT_TARGET_ROOT);\n\tconst appliedEntries = [];\n\tfor (const [rawPath, entry] of Object.entries(manifest.entries)) {\n\t\tconst path = validateWorkspaceManifestPath(rawPath);\n\t\tconst targetPath = joinSandboxPath(targetRoot, path);\n\t\tappliedEntries.push(await applyManifestEntry(sandboxClient, path, targetPath, targetRoot, entry, options));\n\t}\n\treturn { entries: appliedEntries };\n}\nfunction validateWorkspaceManifestPath(path) {\n\tif (path.length === 0) throw new Error(\"workspace manifest path must not be empty\");\n\tif (path.includes(\"\\0\")) throw new Error(\"workspace manifest path must not contain NUL bytes\");\n\tif (path.startsWith(\"/\") || path.startsWith(\"\\\\\") || WINDOWS_ABSOLUTE_PATH_PATTERN.test(path)) throw new Error(\"workspace manifest path must be workspace-relative\");\n\tconst parts = path.replace(/\\\\/g, \"/\").split(\"/\").filter(Boolean);\n\tif (parts.length === 0) throw new Error(\"workspace manifest path must not resolve to the workspace root\");\n\tif (parts.some((part) => part === \"..\")) throw new Error(\"workspace manifest path cannot contain traversal segments\");\n\tconst normalizedParts = parts.filter((part) => part !== \".\");\n\tif (normalizedParts.length === 0) throw new Error(\"workspace manifest path must not resolve to the workspace root\");\n\treturn normalizedParts.join(\"/\");\n}\nasync function applyManifestEntry(sandboxClient, path, targetPath, targetRoot, entry, options) {\n\tswitch (entry.type) {\n\t\tcase \"file\":\n\t\t\tawait writeSandboxFile(sandboxClient, targetPath, targetRoot, entry.content);\n\t\t\treturn createAppliedEntry(path, entry.type);\n\t\tcase \"dir\":\n\t\t\tawait createSandboxDirectory(sandboxClient, targetPath);\n\t\t\treturn createAppliedEntry(path, entry.type);\n\t\tcase \"localFile\":\n\t\t\tawait copyLocalFile(sandboxClient, entry.src, targetPath, targetRoot, options);\n\t\t\treturn createAppliedEntry(path, entry.type);\n\t\tcase \"localDir\":\n\t\t\tawait copyLocalDirectory(sandboxClient, entry.src, targetPath, options);\n\t\t\treturn createAppliedEntry(path, entry.type);\n\t\tcase \"gitRepo\":\n\t\t\tawait cloneGitRepository(sandboxClient, entry, targetPath);\n\t\t\treturn createAppliedEntry(path, entry.type);\n\t\tcase \"s3Mount\":\n\t\tcase \"gcsMount\":\n\t\tcase \"r2Mount\":\n\t\tcase \"azureBlobMount\": return {\n\t\t\tpath,\n\t\t\ttype: entry.type,\n\t\t\tstatus: \"unsupported\",\n\t\t\tmessage: `${entry.type} requires a provider-specific sandbox adapter.`\n\t\t};\n\t\tdefault: return assertUnreachable(entry);\n\t}\n}\nfunction createAppliedEntry(path, type) {\n\treturn {\n\t\tpath,\n\t\ttype,\n\t\tstatus: \"applied\"\n\t};\n}\nasync function copyLocalFile(sandboxClient, source, targetPath, targetRoot, options) {\n\tawait writeSandboxFile(sandboxClient, targetPath, targetRoot, await readFile(resolveHostSourcePath(source, options.hostRoot), \"utf8\"));\n}\nasync function copyLocalDirectory(sandboxClient, source, targetPath, options) {\n\tawait copyLocalDirectoryRecursive(sandboxClient, resolveHostSourcePath(source, options.hostRoot), targetPath);\n}\nasync function copyLocalDirectoryRecursive(sandboxClient, sourcePath, targetPath) {\n\tawait createSandboxDirectory(sandboxClient, targetPath);\n\tconst entries = await readdir(sourcePath, { withFileTypes: true });\n\tfor (const entry of entries) {\n\t\tconst childSourcePath = join(sourcePath, entry.name);\n\t\tconst childTargetPath = joinSandboxPath(targetPath, entry.name);\n\t\tif (entry.isDirectory()) {\n\t\t\tawait copyLocalDirectoryRecursive(sandboxClient, childSourcePath, childTargetPath);\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.isFile()) {\n\t\t\tconst content = await readFile(childSourcePath, \"utf8\");\n\t\t\tawait sandboxClient.writeFile(childTargetPath, content);\n\t\t}\n\t}\n}\nasync function cloneGitRepository(sandboxClient, entry, targetPath) {\n\tawait runSandboxCommand(sandboxClient, `git clone${entry.shallow === false ? \"\" : \" --depth 1\"}${entry.ref ? ` --branch ${quoteShellArg(entry.ref)}` : \"\"} ${quoteShellArg(entry.url)} ${quoteShellArg(targetPath)}`);\n}\nasync function writeSandboxFile(sandboxClient, targetPath, targetRoot, content) {\n\tconst parentPath = posix.dirname(targetPath);\n\tif (parentPath !== targetRoot) await createSandboxDirectory(sandboxClient, parentPath);\n\tawait sandboxClient.writeFile(targetPath, content);\n}\nasync function createSandboxDirectory(sandboxClient, targetPath) {\n\tawait runSandboxCommand(sandboxClient, `mkdir -p ${quoteShellArg(targetPath)}`);\n}\nasync function runSandboxCommand(sandboxClient, command) {\n\tconst result = await sandboxClient.run(command);\n\tif (result.exitCode !== 0) throw new Error(`workspace manifest command failed: ${command}\\n${result.stderr ?? result.stdout}`);\n}\nfunction resolveHostSourcePath(source, hostRoot) {\n\treturn isAbsolute(source) ? resolve(source) : resolve(hostRoot ?? process.cwd(), source);\n}\n/**\n* Remove every trailing `/`, by index scan.\n*\n* Not `replace(/\\/+$/, '')`: that run has no start anchor, so the engine retries it from every offset inside the\n* run and each retry re-scans to the end — 3.0 s on a 100 K run (`js/polynomial-redos`, SEC-003). The backslash\n* conversion in {@link normalizeSandboxRoot} manufactures such a run from a Windows-style path.\n*/\nfunction trimTrailingSlashes(value) {\n\tlet end = value.length;\n\twhile (end > 0 && value[end - 1] === \"/\") end -= 1;\n\treturn value.slice(0, end);\n}\nfunction normalizeSandboxRoot(root) {\n\tconst normalized = trimTrailingSlashes(root.replace(/\\\\/g, \"/\"));\n\tif (!normalized.startsWith(\"/\")) throw new Error(\"workspace manifest targetRoot must be an absolute sandbox path\");\n\treturn normalized.length === 0 ? \"/\" : normalized;\n}\nfunction joinSandboxPath(root, path) {\n\tconst normalizedRoot = normalizeSandboxRoot(root);\n\tif (normalizedRoot === \"/\") return `/${path}`;\n\treturn `${normalizedRoot}/${path}`;\n}\nfunction quoteShellArg(value) {\n\treturn `'${value.replace(SHELL_QUOTE_PATTERN, \"'\\\\''\")}'`;\n}\nfunction assertUnreachable(value) {\n\tthrow new Error(`unsupported workspace manifest entry: ${JSON.stringify(value)}`);\n}\n//#endregion\n//#region src/sandbox/os-sandbox-policy.ts\n/**\n* What an OS-level sandbox lets a command touch, written once per backend (issue #3082).\n*\n* The same policy becomes bubblewrap arguments on Linux and a Seatbelt profile on macOS:\n* - the whole filesystem is readable except the `denyRead` paths;\n* - writes are allowed only inside the workspace, the temporary directories and `allowWrite`;\n* - inside the workspace, the files that configure git, the agent, MCP servers and shells stay\n* read-only, so a confined command cannot change what the next session trusts;\n* - the network is either reachable or not. There is no per-domain allowlist: that needs a proxy\n* process the OS cannot enforce, and a boundary here is only worth what the OS enforces.\n*/\n/** An isolated worktree's files are ordinary workspace files. */\nfunction writableContainers(policy) {\n\treturn [.../* @__PURE__ */ new Set([\".claude/worktrees\", ...policy?.writableWorktreeContainers ?? []])];\n}\nfunction join$1(root, relative) {\n\tlet end = root.length;\n\twhile (end > 0 && root[end - 1] === \"/\") end -= 1;\n\treturn `${root.slice(0, end)}/${relative}`;\n}\n/**\n* Workspace entries a confined command must not write, relative to the root. `.git` is read-only\n* as a whole: the files that make git run something (config, hooks, `commondir`, per-worktree\n* config) are too many and too easy to add to for a list inside it to stay complete, so git\n* commands that write run unconfined, through the ordinary permission path.\n*/\nfunction protectedWorkspaceEntries(policy) {\n\treturn [.../* @__PURE__ */ new Set([\n\t\t...PROTECTED_DIRECTORY_NAMES,\n\t\t...policy?.protectedDirectoryNames ?? [],\n\t\t...PROTECTED_FILE_NAMES\n\t])];\n}\n/** The `bwrap` argument vector that runs `command args` under the policy. */\nfunction bubblewrapArguments(input) {\n\tconst { policy } = input;\n\tconst args = [\n\t\t\"--ro-bind\",\n\t\t\"/\",\n\t\t\"/\",\n\t\t\"--dev\",\n\t\t\"/dev\",\n\t\t\"--proc\",\n\t\t\"/proc\"\n\t];\n\tfor (const path of [\n\t\tpolicy.root,\n\t\t...policy.tempDirectories,\n\t\t...policy.allowWrite\n\t]) args.push(\"--bind-try\", path, path);\n\tfor (const entry of protectedWorkspaceEntries(policy.pathProtection)) {\n\t\tconst path = join$1(policy.root, entry);\n\t\tif (input.exists(path)) args.push(\"--ro-bind\", path, path);\n\t}\n\tfor (const entry of writableContainers(policy.pathProtection)) {\n\t\tconst path = join$1(policy.root, entry);\n\t\tif (!input.exists(path)) continue;\n\t\targs.push(\"--bind\", path, path);\n\t\tfor (const name of input.listDirectory(path)) {\n\t\t\tconst gitFile = join$1(path, `${name}/.git`);\n\t\t\tif (input.exists(gitFile)) args.push(\"--ro-bind\", gitFile, gitFile);\n\t\t}\n\t}\n\tfor (const path of policy.pathProtection?.protectedPaths ?? []) if (input.exists(path)) args.push(\"--ro-bind\", path, path);\n\tfor (const hidden of policy.denyRead) {\n\t\tif (!input.exists(hidden.path)) continue;\n\t\tif (hidden.directory) args.push(\"--tmpfs\", hidden.path);\n\t\telse args.push(\"--ro-bind\", \"/dev/null\", hidden.path);\n\t}\n\tif (!policy.network) {\n\t\tif (input.seccompDescriptor === void 0) throw new Error(\"A sandbox without network needs the Unix-socket seccomp filter.\");\n\t\targs.push(\"--unshare-net\", \"--seccomp\", String(input.seccompDescriptor));\n\t}\n\targs.push(\"--unshare-pid\", \"--die-with-parent\", \"--new-session\", \"--chdir\", input.cwd);\n\targs.push(\"--\", input.command);\n\treturn [...args, ...input.args];\n}\nfunction regexEscape(path) {\n\treturn path.replace(/[\\\\^$.*+?()[\\]{}|\"]/g, (char) => `\\\\${char}`);\n}\nfunction quote(path) {\n\treturn `\"${path.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\")}\"`;\n}\n/**\n* The Seatbelt profile for `sandbox-exec -p`. Later rules win, so the order below is the policy:\n* deny writes, allow the writable places, deny the protected entries again, reopen worktrees.\n*/\nfunction seatbeltProfile(policy) {\n\tconst writable = [\n\t\tpolicy.root,\n\t\t...policy.tempDirectories,\n\t\t...policy.allowWrite\n\t].map((path) => `(subpath ${quote(path)})`).join(\" \");\n\tconst protectedEntries = protectedWorkspaceEntries(policy.pathProtection).map((entry) => {\n\t\tconst path = join$1(policy.root, entry);\n\t\treturn PROTECTED_FILE_NAMES.includes(entry) ? `(literal ${quote(path)})` : `(subpath ${quote(path)})`;\n\t});\n\tconst worktrees = writableContainers(policy.pathProtection).map((entry) => `(subpath ${quote(join$1(policy.root, entry))})`);\n\tconst pinned = [`(literal ${quote(join$1(policy.root, \".git\"))})`, ...writableContainers(policy.pathProtection).map((entry) => `(regex #\"^${regexEscape(join$1(policy.root, entry))}/[^/]+/\\\\.git$\")`)];\n\tconst lines = [\n\t\t\"(version 1)\",\n\t\t\"(allow default)\",\n\t\t\"(deny file-write*)\",\n\t\t`(allow file-write* ${writable} (literal \"/dev/null\") (regex #\"^/dev/tty\") (regex #\"^/dev/fd/\"))`,\n\t\t`(deny file-write* ${protectedEntries.join(\" \")})`,\n\t\t`(allow file-write* ${worktrees.join(\" \")})`,\n\t\t`(deny file-write* ${pinned.join(\" \")})`,\n\t\t...(policy.pathProtection?.protectedPaths.length ?? 0) > 0 ? [`(deny file-write* ${policy.pathProtection.protectedPaths.map((path) => `(subpath ${quote(path)})`).join(\" \")})`] : []\n\t];\n\tif (policy.denyRead.length > 0) {\n\t\tconst hidden = policy.denyRead.map((entry) => entry.directory ? `(subpath ${quote(entry.path)})` : `(literal ${quote(entry.path)})`);\n\t\tlines.push(`(deny file-read* ${hidden.join(\" \")})`);\n\t}\n\tif (!policy.network) lines.push(\"(deny network*)\");\n\treturn lines.join(\"\\n\");\n}\n//#endregion\n//#region src/sandbox/os-sandbox-seccomp.ts\n/**\n* The seccomp filter bubblewrap loads when a confined command has no network (issue #3082).\n*\n* `--unshare-net` removes every network interface, but a Unix socket is a file: a daemon listening\n* on one outside the sandbox (a container engine, the session bus, an ssh agent) is still reachable\n* through the read-only filesystem, and is a way to run anything on the host. The filter refuses\n* creating an `AF_UNIX` socket, and refuses `io_uring_setup`, which could create one without the\n* `socket` system call. A system call from another ABI (x32, 32-bit compat) is refused whole, since\n* its numbers differ and the checks below would not see it. macOS's Seatbelt `(deny network*)`\n* already covers Unix sockets.\n*/\nconst BPF_LD_W_ABS = 32;\nconst BPF_JMP_JEQ_K = 21;\nconst BPF_JMP_JSET_K = 69;\nconst BPF_RET_K = 6;\nconst SECCOMP_RET_ALLOW = 2147418112;\nconst SECCOMP_RET_ERRNO = 327680;\nconst EPERM = 1;\nconst EAFNOSUPPORT = 97;\nconst AF_UNIX = 1;\nconst X32_SYSCALL_BIT = 1073741824;\n/** `struct seccomp_data` offsets. */\nconst OFFSET_NR = 0;\nconst OFFSET_ARCH = 4;\nconst OFFSET_ARG0_LOW = 16;\nconst ARCHITECTURES = {\n\tx64: {\n\t\taudit: 3221225534,\n\t\tsocket: 41,\n\t\tioUringSetup: 425\n\t},\n\tarm64: {\n\t\taudit: 3221225655,\n\t\tsocket: 198,\n\t\tioUringSetup: 425\n\t}\n};\nfunction instruction(code, jt, jf, k) {\n\treturn [\n\t\tcode,\n\t\tjt,\n\t\tjf,\n\t\tk\n\t];\n}\n/**\n* The filter as bytes `bwrap --seccomp` reads, or `undefined` for a processor architecture it has\n* no system call numbers for — the caller then refuses to confine rather than confine with a gap.\n*/\nfunction unixSocketSeccompFilter(arch = process.arch) {\n\tconst target = ARCHITECTURES[arch];\n\tif (target === void 0) return void 0;\n\tconst errno = (code) => SECCOMP_RET_ERRNO | code;\n\tconst program = [\n\t\tinstruction(BPF_LD_W_ABS, 0, 0, OFFSET_ARCH),\n\t\tinstruction(BPF_JMP_JEQ_K, 1, 0, target.audit),\n\t\tinstruction(BPF_RET_K, 0, 0, errno(EPERM)),\n\t\tinstruction(BPF_LD_W_ABS, 0, 0, OFFSET_NR),\n\t\tinstruction(BPF_JMP_JSET_K, 0, 1, X32_SYSCALL_BIT),\n\t\tinstruction(BPF_RET_K, 0, 0, errno(EPERM)),\n\t\tinstruction(BPF_JMP_JEQ_K, 0, 1, target.ioUringSetup),\n\t\tinstruction(BPF_RET_K, 0, 0, errno(EPERM)),\n\t\tinstruction(BPF_JMP_JEQ_K, 0, 3, target.socket),\n\t\tinstruction(BPF_LD_W_ABS, 0, 0, OFFSET_ARG0_LOW),\n\t\tinstruction(BPF_JMP_JEQ_K, 0, 1, AF_UNIX),\n\t\tinstruction(BPF_RET_K, 0, 0, errno(EAFNOSUPPORT)),\n\t\tinstruction(BPF_RET_K, 0, 0, SECCOMP_RET_ALLOW)\n\t];\n\tconst bytes = new Uint8Array(program.length * 8);\n\tconst view = new DataView(bytes.buffer);\n\tprogram.forEach(([code, jt, jf, k], index) => {\n\t\tview.setUint16(index * 8, code, true);\n\t\tview.setUint8(index * 8 + 2, jt);\n\t\tview.setUint8(index * 8 + 3, jf);\n\t\tview.setUint32(index * 8 + 4, k >>> 0, true);\n\t});\n\treturn bytes;\n}\n//#endregion\n//#region src/sandbox/os-sandbox-client.ts\n/**\n* OS-level confinement of shell commands over the host filesystem (issue #3082): bubblewrap on\n* Linux and WSL2, Seatbelt (`sandbox-exec`) on macOS. Other platforms have no backend; the client\n* reports that instead of pretending.\n*\n* It is a `shared` sandbox client: file tools stay on the host under the path guard, and the shell\n* tool starts the wrapped invocation itself. Settings are live — `/sandbox` changes them for the\n* next command without rebuilding the session.\n*/\nconst DEFAULT_OS_SANDBOX_SETTINGS = Object.freeze({\n\tenabled: false,\n\tautoAllowBashIfSandboxed: true,\n\texcludedCommands: [],\n\tallowWrite: [],\n\tdenyRead: [],\n\tnetwork: false\n});\nconst SEATBELT_EXECUTABLE = \"/usr/bin/sandbox-exec\";\nfunction defaultProbe(command, args) {\n\tconst result = spawnSync(command, [...args], {\n\t\ttimeout: 5e3,\n\t\tencoding: \"utf8\"\n\t});\n\tif (result.error !== void 0) return {\n\t\tok: false,\n\t\tdetail: result.error.message\n\t};\n\tconst detail = (result.stderr ?? \"\").trim().split(\"\\n\")[0];\n\treturn result.status === 0 ? { ok: true } : {\n\t\tok: false,\n\t\t...detail ? { detail } : {}\n\t};\n}\n/** Find the platform's backend and check it can actually start a sandbox here. */\nfunction detectOsSandbox(options = {}) {\n\tconst platform = options.platform ?? process.platform;\n\tconst probe = options.probe ?? defaultProbe;\n\tif (platform === \"linux\") {\n\t\tif (unixSocketSeccompFilter(options.arch ?? process.arch) === void 0) return {\n\t\t\tbackend: \"bubblewrap\",\n\t\t\tmissing: [`a seccomp filter for ${options.arch ?? process.arch} (x64 and arm64 are supported)`]\n\t\t};\n\t\tconst check = probe(\"bwrap\", [\n\t\t\t\"--ro-bind\",\n\t\t\t\"/\",\n\t\t\t\"/\",\n\t\t\t\"--dev\",\n\t\t\t\"/dev\",\n\t\t\t\"--proc\",\n\t\t\t\"/proc\",\n\t\t\t\"--unshare-pid\",\n\t\t\t\"true\"\n\t\t]);\n\t\tif (check.ok) return {\n\t\t\tbackend: \"bubblewrap\",\n\t\t\texecutable: \"bwrap\",\n\t\t\tmissing: []\n\t\t};\n\t\treturn {\n\t\t\tbackend: \"bubblewrap\",\n\t\t\tmissing: [check.detail?.includes(\"ENOENT\") ? \"bubblewrap (install the `bubblewrap` package)\" : `bubblewrap cannot create a sandbox here${check.detail ? `: ${check.detail}` : \"\"}`]\n\t\t};\n\t}\n\tif (platform === \"darwin\") {\n\t\tconst check = probe(SEATBELT_EXECUTABLE, [\n\t\t\t\"-p\",\n\t\t\t\"(version 1)(allow default)\",\n\t\t\t\"/usr/bin/true\"\n\t\t]);\n\t\tif (check.ok) return {\n\t\t\tbackend: \"seatbelt\",\n\t\t\texecutable: SEATBELT_EXECUTABLE,\n\t\t\tmissing: []\n\t\t};\n\t\treturn {\n\t\t\tbackend: \"seatbelt\",\n\t\t\tmissing: [`sandbox-exec cannot run${check.detail ? `: ${check.detail}` : \"\"}`]\n\t\t};\n\t}\n\treturn {\n\t\tmissing: [],\n\t\tunsupportedPlatform: platform\n\t};\n}\nfunction realPathOrSelf(path) {\n\ttry {\n\t\treturn realpathSync(path);\n\t} catch {\n\t\treturn path;\n\t}\n}\nfunction isDirectory(path) {\n\ttry {\n\t\treturn statSync(path).isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n/** Give the owner read, write and search permission throughout an entry, never following links. */\nfunction grantOwnerAccess(path) {\n\tconst stat = lstatSync(path);\n\tif (stat.isSymbolicLink()) return;\n\tchmodSync(path, stat.mode | 448);\n\tif (!stat.isDirectory()) return;\n\tfor (const name of readdirSync(path)) grantOwnerAccess(`${path}/${name}`);\n}\nfunction isSymbolicLink(path) {\n\ttry {\n\t\treturn lstatSync(path).isSymbolicLink();\n\t} catch {\n\t\treturn false;\n\t}\n}\n/** The program a shell line starts first — what `excludedCommands` names. */\nfunction firstProgram(shellCommand) {\n\treturn shellCommand.trim().split(/\\s+/)[0];\n}\nvar OsSandboxClient = class {\n\tfilesystem = \"shared\";\n\troot;\n\tpathProtection;\n\tprojectStateDirectory;\n\tuserQuarantineDirectory;\n\tavailability;\n\thomeDirectory;\n\tcurrent;\n\tinFlight = 0;\n\tbaseline = [];\n\t/** Entries a clean-up could not restore, with the state they must return to. */\n\tunresolved = /* @__PURE__ */ new Map();\n\twatchers = /* @__PURE__ */ new Set();\n\tconstructor(options) {\n\t\tif (!/^[a-zA-Z0-9._-]+$/.test(options.projectStateDirectory) || [\".\", \"..\"].includes(options.projectStateDirectory)) throw new Error(\"A safe project state directory is required\");\n\t\tif (!isAbsolute(options.userQuarantineDirectory)) throw new Error(\"An absolute quarantine directory is required\");\n\t\tthis.projectStateDirectory = options.projectStateDirectory;\n\t\tthis.userQuarantineDirectory = options.userQuarantineDirectory;\n\t\tthis.pathProtection = Object.freeze({\n\t\t\tprotectedDirectoryNames: Object.freeze([.../* @__PURE__ */ new Set([options.projectStateDirectory, ...options.pathProtection?.protectedDirectoryNames ?? []])]),\n\t\t\tprotectedPaths: Object.freeze([...options.pathProtection?.protectedPaths ?? []]),\n\t\t\twritableWorktreeContainers: Object.freeze([...options.pathProtection?.writableWorktreeContainers ?? []])\n\t\t});\n\t\tthis.root = realPathOrSelf(options.root);\n\t\tthis.availability = options.availability;\n\t\tthis.homeDirectory = options.homeDirectory ?? homedir();\n\t\tthis.current = {\n\t\t\t...DEFAULT_OS_SANDBOX_SETTINGS,\n\t\t\t...options.settings\n\t\t};\n\t}\n\tstatus() {\n\t\treturn {\n\t\t\tsettings: this.current,\n\t\t\tavailability: this.availability,\n\t\t\tactive: this.current.enabled && this.availability.executable !== void 0\n\t\t};\n\t}\n\t/** Change the settings for the next command, and tell whoever watches them. */\n\tconfigure(settings) {\n\t\tthis.current = {\n\t\t\t...this.current,\n\t\t\t...settings\n\t\t};\n\t\tfor (const watcher of this.watchers) watcher(this.current);\n\t}\n\t/**\n\t* Be told the settings after each change, for as long as the returned function is not called. A\n\t* copy of this sandbox in another process (a subagent's) follows the user's change this way.\n\t*/\n\twatchSettings(watcher) {\n\t\tthis.watchers.add(watcher);\n\t\treturn () => {\n\t\t\tthis.watchers.delete(watcher);\n\t\t};\n\t}\n\t/** Whether `shellCommand` would run confined. */\n\tconfines(shellCommand) {\n\t\tif (!this.status().active) return false;\n\t\tif (splitCommandSegments(shellCommand).length !== 1) return true;\n\t\tconst program = firstProgram(shellCommand);\n\t\treturn program === void 0 || !this.current.excludedCommands.includes(program);\n\t}\n\tautoApproves(shellCommand) {\n\t\tif (!this.current.autoAllowBashIfSandboxed || !this.confines(shellCommand)) return false;\n\t\tif (this.unresolved.size > 0) return false;\n\t\treturn !this.protectedEntryStates().some((state) => state.kind === \"symlink\" && !this.resolvesOutsideWritableWorkspace(state.path));\n\t}\n\twrapCommand(invocation, shellCommand) {\n\t\tif (!this.confines(shellCommand)) return invocation;\n\t\tconst policy = this.policy();\n\t\tconst executable = this.availability.executable;\n\t\tif (this.availability.backend === \"seatbelt\") return {\n\t\t\tcommand: executable,\n\t\t\targs: [\n\t\t\t\t\"-p\",\n\t\t\t\tseatbeltProfile(policy),\n\t\t\t\tinvocation.command,\n\t\t\t\t...invocation.args\n\t\t\t],\n\t\t\tcwd: invocation.cwd\n\t\t};\n\t\tconst filter = policy.network ? void 0 : unixSocketSeccompFilter();\n\t\tif (!this.protectedEntryStates().some((state) => state.path === `${this.root}/${this.projectStateDirectory}` && state.kind === \"symlink\")) mkdirSync(`${this.root}/${this.projectStateDirectory}`, { recursive: true });\n\t\tconst args = bubblewrapArguments({\n\t\t\tpolicy,\n\t\t\texists: (path) => existsSync(path) && !isSymbolicLink(path),\n\t\t\tlistDirectory: (path) => readdirSync(path),\n\t\t\tcwd: invocation.cwd,\n\t\t\tcommand: invocation.command,\n\t\t\targs: invocation.args,\n\t\t\t...filter !== void 0 ? { seccompDescriptor: 3 } : {}\n\t\t});\n\t\tif (this.inFlight === 0) this.baseline = this.protectedEntryStates().map((state) => this.unresolved.get(state.path) ?? state);\n\t\tthis.inFlight += 1;\n\t\tlet finished = false;\n\t\treturn {\n\t\t\tcommand: executable,\n\t\t\targs,\n\t\t\tcwd: invocation.cwd,\n\t\t\t...filter !== void 0 ? { inputDescriptors: [filter] } : {},\n\t\t\tafterExit: () => {\n\t\t\t\tif (finished) return void 0;\n\t\t\t\tfinished = true;\n\t\t\t\tthis.inFlight -= 1;\n\t\t\t\treturn this.restoreProtectedEntries(this.baseline);\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* How each protected entry stands before a command: bubblewrap can mount an existing entry\n\t* read-only, but not one that does not exist yet, and a symlink it mounts through to its target\n\t* while the link itself stays replaceable. Read with `lstat`, so a dangling link is not \"missing\".\n\t*/\n\tprotectedEntryStates() {\n\t\treturn protectedWorkspaceEntries(this.pathProtection).map((entry) => {\n\t\t\tconst path = `${this.root}/${entry}`;\n\t\t\ttry {\n\t\t\t\treturn lstatSync(path).isSymbolicLink() ? {\n\t\t\t\t\tpath,\n\t\t\t\t\tkind: \"symlink\",\n\t\t\t\t\ttarget: readlinkSync(path)\n\t\t\t\t} : {\n\t\t\t\t\tpath,\n\t\t\t\t\tkind: \"present\"\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\treturn {\n\t\t\t\t\tpath,\n\t\t\t\t\tkind: \"missing\"\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Undo what the command did to protected entries it could reach: one it created where none\n\t* existed is moved into the selected quarantine directory, and a symlink it replaced is restored. Moved,\n\t* not deleted, so nothing the host wrote meanwhile is lost.\n\t*/\n\t/** Whether a path's real location is under the read-only mounts: not the workspace, temp or `allowWrite`. */\n\tresolvesOutsideWritableWorkspace(path) {\n\t\tlet real;\n\t\ttry {\n\t\t\treal = realpathSync(path);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t\tconst policy = this.policy();\n\t\treturn ![\n\t\t\tpolicy.root,\n\t\t\t...policy.tempDirectories,\n\t\t\t...policy.allowWrite\n\t\t].some((area) => real === area || real.startsWith(`${area}/`));\n\t}\n\t/**\n\t* Never throws: this runs as the command's process closes, and an exception there would take the\n\t* host down and leave the entry in place. The quarantine is outside the workspace, under the\n\t* configured user state directory, where the command cannot reach it; what cannot be moved there is removed.\n\t*/\n\trestoreProtectedEntries(before) {\n\t\tconst quarantine = `${this.quarantineRoot(before)}/${Date.now()}-${randomUUID()}`;\n\t\tconst notes = [];\n\t\tfor (const state of before) {\n\t\t\tif (state.kind === \"present\") continue;\n\t\t\ttry {\n\t\t\t\tconst now = this.protectedEntryStates().find((entry) => entry.path === state.path);\n\t\t\t\tif (state.kind === \"missing\" && now.kind === \"missing\") {\n\t\t\t\t\tthis.unresolved.delete(state.path);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (state.kind === \"symlink\" && now.kind === \"symlink\" && now.target === state.target) {\n\t\t\t\t\tthis.unresolved.delete(state.path);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (now.kind !== \"missing\") notes.push(this.setAside(state.path, quarantine));\n\t\t\t\tif (state.kind === \"symlink\") symlinkSync(state.target, state.path);\n\t\t\t\tthis.unresolved.delete(state.path);\n\t\t\t} catch (error) {\n\t\t\t\tthis.unresolved.set(state.path, state);\n\t\t\t\tnotes.push(`could not restore ${state.path} (${error instanceof Error ? error.message : String(error)}); commands will ask until it is removed`);\n\t\t\t}\n\t\t}\n\t\tif (notes.length === 0) return void 0;\n\t\treturn `[sandbox] A confined command may not create or replace git, agent, MCP or shell configuration: ${notes.join(\"; \")}.`;\n\t}\n\t/**\n\t* Where set-aside entries go: the configured workspace state directory, when it was a real directory before\n\t* the command — then it was mounted read-only, so the command could not reach it, and a rename\n\t* within one filesystem needs no permission inside the entry. Otherwise the configured user quarantine directory.\n\t* Decided from the baseline: what is there now may be the command's own replacement.\n\t*/\n\tquarantineRoot(before) {\n\t\tconst stateRoot = `${this.root}/${this.projectStateDirectory}`;\n\t\treturn before.some((state) => state.path === stateRoot && state.kind === \"present\") ? `${stateRoot}/sandbox-quarantine` : this.userQuarantineDirectory;\n\t}\n\tsetAside(path, quarantine) {\n\t\tconst destination = `${quarantine}/${basename(path)}`;\n\t\tmkdirSync(quarantine, { recursive: true });\n\t\ttry {\n\t\t\trenameSync(path, destination);\n\t\t} catch (error) {\n\t\t\tif (this.inFlight > 0) throw error;\n\t\t\tgrantOwnerAccess(path);\n\t\t\tif (error.code === \"EXDEV\") {\n\t\t\t\tcpSync(path, destination, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\tverbatimSymlinks: true\n\t\t\t\t});\n\t\t\t\trmSync(path, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\tforce: true\n\t\t\t\t});\n\t\t\t} else renameSync(path, destination);\n\t\t}\n\t\treturn `moved ${path} to ${destination}`;\n\t}\n\t/** The policy for the current settings, with every path made absolute and real. */\n\tpolicy() {\n\t\tconst absolute = (path) => {\n\t\t\tconst expanded = path === \"~\" || path.startsWith(\"~/\") ? `${this.homeDirectory}${path.slice(1)}` : path;\n\t\t\treturn realPathOrSelf(isAbsolute(expanded) ? expanded : resolve(this.root, expanded));\n\t\t};\n\t\tconst temp = [...new Set([tmpdir(), \"/tmp\"].filter(existsSync).map(realPathOrSelf))];\n\t\treturn {\n\t\t\troot: this.root,\n\t\t\tpathProtection: this.pathProtection,\n\t\t\ttempDirectories: temp,\n\t\t\tallowWrite: this.current.allowWrite.map(absolute),\n\t\t\tdenyRead: this.current.denyRead.map((path) => {\n\t\t\t\tconst resolved = absolute(path);\n\t\t\t\treturn {\n\t\t\t\t\tpath: resolved,\n\t\t\t\t\tdirectory: isDirectory(resolved)\n\t\t\t\t};\n\t\t\t}),\n\t\t\tnetwork: this.current.network\n\t\t};\n\t}\n\trun(command, options = {}) {\n\t\tconst shell = resolvePlatformShell();\n\t\tconst cwd = options.workingDirectory ?? this.root;\n\t\tconst invocation = this.wrapCommand({\n\t\t\tcommand: shell.command,\n\t\t\targs: shell.commandArgs(command),\n\t\t\tcwd\n\t\t}, command);\n\t\treturn new Promise((resolveRun, reject) => {\n\t\t\tconst extra = invocation.inputDescriptors ?? [];\n\t\t\tlet child;\n\t\t\ttry {\n\t\t\t\tchild = spawn(invocation.command, [...invocation.args], {\n\t\t\t\t\tcwd: invocation.cwd,\n\t\t\t\t\tstdio: [\n\t\t\t\t\t\t\"ignore\",\n\t\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\t...extra.map(() => \"pipe\")\n\t\t\t\t\t],\n\t\t\t\t\t...options.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {}\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tinvocation.afterExit?.();\n\t\t\t\treject(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\textra.forEach((data, index) => {\n\t\t\t\tconst stream = child.stdio[index + 3];\n\t\t\t\tstream?.on(\"error\", () => void 0);\n\t\t\t\tstream?.end(Buffer.from(data));\n\t\t\t});\n\t\t\tlet stdout = \"\";\n\t\t\tlet stderr = \"\";\n\t\t\tchild.stdout?.on(\"data\", (chunk) => stdout += chunk.toString());\n\t\t\tchild.stderr?.on(\"data\", (chunk) => stderr += chunk.toString());\n\t\t\tchild.on(\"error\", (error) => {\n\t\t\t\tinvocation.afterExit?.();\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tchild.on(\"close\", (code) => {\n\t\t\t\tconst note = invocation.afterExit?.();\n\t\t\t\tresolveRun({\n\t\t\t\t\tstdout: note === void 0 ? stdout : `${stdout}\\n${note}`,\n\t\t\t\t\t...stderr ? { stderr } : {},\n\t\t\t\t\texitCode: code ?? 1\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\treadFile(path) {\n\t\treturn Promise.resolve(readFileSync(path, \"utf8\"));\n\t}\n\twriteFile(path, content) {\n\t\twriteFileSync(path, content, \"utf8\");\n\t\treturn Promise.resolve();\n\t}\n};\n//#endregion\n//#region src/retrieval/repo-map-index.ts\n/** Persisted-schema version — bump when `IRepoMapIndex`'s serialized shape changes incompatibly. */\nconst REPO_MAP_INDEX_VERSION = 1;\n/** Parse one corpus file into an index entry. */\nfunction parseEntry(parser, file) {\n\tconst parsed = parser.parse(file.path, file.content);\n\treturn {\n\t\tpath: file.path,\n\t\tdefinitions: parsed.definitions,\n\t\treferences: parsed.references\n\t};\n}\n/** Parse the whole corpus once into a serializable repo-map index. */\nfunction buildRepoMapIndex(options) {\n\treturn {\n\t\tversion: 1,\n\t\tentries: options.corpus.map((file) => parseEntry(options.parser, file))\n\t};\n}\n/**\n* Apply corpus changes to a built index INCREMENTALLY (SELFHOST-003 P3): re-parse only the `upserted`\n* files and drop `removed` paths, reusing every unchanged entry. Returns a new index (the input is not\n* mutated). A file present in both `removed` and `upserted` is upserted (re-parse wins); a path repeated\n* within `upserted` is de-duplicated last-wins, so the result always has one entry per path — matching a\n* full rebuild (entry order does not affect ranking). Unchanged entries are REUSED BY REFERENCE; index\n* entries are treated as immutable, so callers must not mutate an entry in place.\n*/\nfunction updateRepoMapIndex(index, changes, parser) {\n\tconst upsertedByPath = new Map((changes.upserted ?? []).map((file) => [file.path, file]));\n\tconst touched = /* @__PURE__ */ new Set([...changes.removed ?? [], ...upsertedByPath.keys()]);\n\tconst kept = index.entries.filter((entry) => !touched.has(entry.path));\n\tconst upserted = [...upsertedByPath.values()].map((file) => parseEntry(parser, file));\n\treturn {\n\t\tversion: index.version,\n\t\tentries: [...kept, ...upserted]\n\t};\n}\n/** Serialize a built index to a neutral JSON string for persistence by the surface. */\nfunction serializeRepoMapIndex(index) {\n\treturn JSON.stringify(index);\n}\n/**\n* Restore a built index from its serialized form. Throws on malformed JSON or an unsupported\n* `version` — a stale/incompatible persisted index must be rebuilt, never silently mis-ranked.\n*/\nfunction deserializeRepoMapIndex(serialized) {\n\tconst parsed = JSON.parse(serialized);\n\tif (parsed.version !== 1) throw new Error(`Unsupported repo-map index version ${String(parsed.version)} (expected 1); rebuild the index.`);\n\tif (!Array.isArray(parsed.entries)) throw new Error(\"Malformed repo-map index: missing `entries`.\");\n\tfor (const entry of parsed.entries) if (typeof entry?.path !== \"string\" || !Array.isArray(entry?.definitions) || !Array.isArray(entry?.references)) throw new Error(\"Malformed repo-map index: a corrupt entry — rebuild the index.\");\n\treturn {\n\t\tversion: parsed.version,\n\t\tentries: parsed.entries\n\t};\n}\n//#endregion\n//#region src/retrieval/repo-map-adapter.ts\n/**\n* SELFHOST-003: neutral repo-map ranking adapter — mirrors `InMemorySandboxClient`.\n*\n* Ranks a corpus of source files by graph centrality relative to the active files / mentioned\n* identifiers, within a token budget. It is a NEUTRAL mechanism: it works on ANY repo given a corpus\n* and an injected source parser — it carries no repo paths and no domain content. The heavy parser is\n* injected as the duck-typed `IRetrievalSourceParser` (like `E2BSandboxClient` duck-types the E2B SDK),\n* and the corpus is supplied from the surface.\n*\n* P2 (index build + persistence): the corpus is parsed ONCE into an `IRepoMapIndex` at construction\n* (or supplied prebuilt/persisted via `{ index }`), so `retrieve()` ranks without re-parsing.\n*\n* Ranking model (aider repo-map style): a definition's score is the weighted number of references to it\n* across the corpus, references FROM an active file weighted higher (personalization), plus a boost for\n* a directly-mentioned identifier. Entries are emitted most-relevant-first, truncated to the budget.\n*/\n/** References from an active file weigh more (personalization toward the current focus). */\nconst ACTIVE_FILE_WEIGHT = 3;\n/** A directly-mentioned identifier is a strong relevance signal. */\nconst MENTION_BOOST = 5;\n/**\n* Estimate the token cost of one repo-map entry (neutral chars/4 heuristic). Uses the same rendering\n* shape the tool prints (`file:line kind name`) so the budgeted estimate matches the emitted output.\n*/\nfunction estimateTokens(symbol) {\n\tconst line = `${symbol.file}:${symbol.line} ${symbol.kind} ${symbol.name}`;\n\treturn Math.max(1, Math.ceil(line.length / 4));\n}\nconst symbolKey = (s) => `${s.file}::${s.name}::${s.line}`;\nvar RepoMapRetrievalAdapter = class {\n\tindex;\n\tconstructor(options) {\n\t\tif (options.index) this.index = options.index;\n\t\telse if (options.parser && options.corpus) this.index = buildRepoMapIndex({\n\t\t\tparser: options.parser,\n\t\t\tcorpus: options.corpus\n\t\t});\n\t\telse throw new Error(\"RepoMapRetrievalAdapter requires either { index } or { parser, corpus }.\");\n\t}\n\tasync retrieve(request) {\n\t\treturn selectWithinBudget(rankSymbols(this.index.entries.map((entry) => ({\n\t\t\tfile: entry.path,\n\t\t\tparsed: {\n\t\t\t\tdefinitions: entry.definitions,\n\t\t\t\treferences: entry.references\n\t\t\t}\n\t\t})), request), request.tokenBudget);\n\t}\n};\n/** Index every definition in the corpus by its name (a name may be defined in several files). */\nfunction indexDefinitions(parsed) {\n\tconst defsByName = /* @__PURE__ */ new Map();\n\tfor (const { parsed: file } of parsed) for (const def of file.definitions) {\n\t\tconst list = defsByName.get(def.name) ?? [];\n\t\tlist.push(def);\n\t\tdefsByName.set(def.name, list);\n\t}\n\treturn defsByName;\n}\n/** Score each definition by weighted reference count + personalization + mention boost. */\nfunction rankSymbols(parsed, request) {\n\tconst activeFiles = new Set(request.activeFiles ?? []);\n\tconst mentioned = new Set(request.mentionedIdentifiers ?? []);\n\tconst defsByName = indexDefinitions(parsed);\n\tconst scoreByKey = /* @__PURE__ */ new Map();\n\tconst bump = (s, delta) => {\n\t\tscoreByKey.set(symbolKey(s), (scoreByKey.get(symbolKey(s)) ?? 0) + delta);\n\t};\n\tfor (const { file, parsed: source } of parsed) {\n\t\tconst weight = activeFiles.has(file) ? ACTIVE_FILE_WEIGHT : 1;\n\t\tfor (const ref of source.references) for (const def of defsByName.get(ref) ?? []) if (def.file !== file) bump(def, weight);\n\t}\n\tfor (const name of mentioned) for (const def of defsByName.get(name) ?? []) bump(def, MENTION_BOOST);\n\tconst ranked = [];\n\tfor (const defs of defsByName.values()) for (const def of defs) ranked.push({\n\t\t...def,\n\t\tscore: scoreByKey.get(symbolKey(def)) ?? 0,\n\t\ttokens: estimateTokens(def)\n\t});\n\tranked.sort((a, b) => b.score - a.score || a.file.localeCompare(b.file) || a.line - b.line || a.name.localeCompare(b.name));\n\treturn ranked;\n}\n/** Take the most-relevant-first prefix whose cumulative tokens fit the budget. */\nfunction selectWithinBudget(ranked, tokenBudget) {\n\tconst symbols = [];\n\tlet totalTokens = 0;\n\tfor (const entry of ranked) {\n\t\tif (totalTokens + entry.tokens > tokenBudget) break;\n\t\tsymbols.push(entry);\n\t\ttotalTokens += entry.tokens;\n\t}\n\treturn {\n\t\tsymbols,\n\t\ttotalTokens\n\t};\n}\n//#endregion\n//#region src/implementations/function-tool.ts\n/**\n* Helper function to create a function tool from a simple function\n*/\nfunction createFunctionTool(name, description, parameters, fn) {\n\treturn new FunctionTool({\n\t\tname,\n\t\tdescription,\n\t\tparameters\n\t}, fn);\n}\n/**\n* Helper function to create a function tool from Zod schema\n*/\nfunction createZodFunctionTool(name, description, zodSchema, fn, residency = {}) {\n\tconst schema = {\n\t\tname,\n\t\tdescription,\n\t\tparameters: zodToJsonSchema(zodSchema),\n\t\t...residency.deferLoading !== void 0 && { deferLoading: residency.deferLoading }\n\t};\n\tconst wrappedFn = async (parameters, context) => {\n\t\tconst parseResult = zodSchema.safeParse(parameters);\n\t\tif (!parseResult.success) throw new ValidationError(`Zod validation failed: ${parseResult.error}`);\n\t\tconst result = await fn(parseResult.data, context);\n\t\treturn typeof result === \"string\" ? result : JSON.stringify(result);\n\t};\n\treturn new FunctionTool(schema, wrappedFn);\n}\n//#endregion\n//#region src/tool-permission-profiles.ts\n/**\n* What the permission system is told about the tools THIS package defines. CORE-030.\n*\n* The classification used to live in `@robota-sdk/agent-core`'s `permission-mode.ts`, as a matrix\n* keyed on a closed union of product tool names — a vendor-neutral foundation holding a product's\n* tool inventory, two layers below the code that defines it, with nothing coupling the two lists.\n* They drifted: `CodebaseRetrieval` is defined here and the matrix had never heard of it, so a\n* read-only retrieval prompted on every call and was refused outright in plan mode.\n*\n* A tool's own package declares what it does. The foundation decides what each MODE does about that\n* kind of action, and neither restates the other's half.\n*\n* `packages/agent-tools/src/__tests__/tool-permission-profiles.test.ts` asserts that every tool this\n* package produces appears here, so adding a tool without classifying it fails rather than silently\n* inheriting the prompt-on-every-call fallback.\n*/\n/**\n* Every tool this package defines, and what the permission system needs to know about it.\n*\n* `argument.key` is which argument a pattern like `Read(/src/**)` is matched against, and\n* `argument.kind` how (CORE-049: a URL is parsed, a path is segment-wise, a command is a glob). A tool without\n* one cannot be narrowed by an argument pattern at all — the gate treats such a pattern as\n* unevaluable and prompts rather than proceeding, which is why the ones that CAN be narrowed say so.\n*/\nconst AGENT_TOOL_PERMISSION_PROFILES = {\n\tRead: {\n\t\targument: {\n\t\t\tkey: \"filePath\",\n\t\t\tkind: \"path\"\n\t\t},\n\t\triskClass: \"inspect\"\n\t},\n\tGlob: {\n\t\targument: {\n\t\t\tkey: \"pattern\",\n\t\t\tkind: \"text\"\n\t\t},\n\t\triskClass: \"inspect\"\n\t},\n\tGrep: {\n\t\targument: {\n\t\t\tkey: \"pattern\",\n\t\t\tkind: \"text\"\n\t\t},\n\t\triskClass: \"inspect\"\n\t},\n\tWebFetch: {\n\t\targument: {\n\t\t\tkey: \"url\",\n\t\t\tkind: \"url\"\n\t\t},\n\t\triskClass: \"inspect\"\n\t},\n\tWebSearch: {\n\t\targument: {\n\t\t\tkey: \"query\",\n\t\t\tkind: \"text\"\n\t\t},\n\t\triskClass: \"inspect\"\n\t},\n\tCodebaseRetrieval: { riskClass: \"inspect\" },\n\tAskUserQuestion: { riskClass: \"inspect\" },\n\tToolSearch: {\n\t\targument: {\n\t\t\tkey: \"query\",\n\t\t\tkind: \"text\"\n\t\t},\n\t\triskClass: \"inspect\"\n\t},\n\tComputerView: { riskClass: \"inspect\" },\n\tWrite: {\n\t\targument: {\n\t\t\tkey: \"filePath\",\n\t\t\tkind: \"path\"\n\t\t},\n\t\triskClass: \"modify\"\n\t},\n\tEdit: {\n\t\targument: {\n\t\t\tkey: \"filePath\",\n\t\t\tkind: \"path\"\n\t\t},\n\t\triskClass: \"modify\"\n\t},\n\tShell: {\n\t\targument: {\n\t\t\tkey: \"command\",\n\t\t\tkind: \"command\"\n\t\t},\n\t\triskClass: \"execute\",\n\t\taliases: [\"Bash\"]\n\t},\n\tBash: {\n\t\targument: {\n\t\t\tkey: \"command\",\n\t\t\tkind: \"command\"\n\t\t},\n\t\triskClass: \"execute\",\n\t\taliases: [\"Shell\"]\n\t},\n\tComputer: { riskClass: \"execute\" }\n};\n/**\n* Tell the permission system about every tool this package defines. Idempotent.\n*\n* Not exported: the one caller is the line below. A registration a consumer could choose to skip is\n* a registration that might not happen, which is the state this change exists to leave behind.\n*/\nfunction registerAgentToolPermissionProfiles() {\n\tfor (const [toolName, profile] of Object.entries(AGENT_TOOL_PERMISSION_PROFILES)) registerToolPermissionProfile(toolName, profile);\n}\nregisterAgentToolPermissionProfiles();\n//#endregion\n//#region src/retrieval/retrieval-tool.ts\n/**\n* SELFHOST-003: the `CodebaseRetrieval` tool — mirrors the `create*Tool(options)` pattern.\n*\n* Composes over the injected `IRetrievalAdapter` (via `IRetrievalToolOptions`). It carries NO corpus and\n* NO domain content itself — the adapter (built from a surface-supplied parser + corpus) does the\n* ranking. With no adapter the tool reports unavailability (it is added to the default set only when an\n* adapter is present — see `createDefaultTools`).\n*/\n/** Default token budget when the caller does not specify one. */\nconst DEFAULT_TOKEN_BUDGET = 1e3;\nconst RetrievalSchema = z.object({\n\tactiveFiles: z.array(z.string()).optional().describe(\"Repo-relative files currently in focus; the map is ranked toward what they reference.\"),\n\tmentionedIdentifiers: z.array(z.string()).optional().describe(\"Symbol names to bias the map toward (e.g. identifiers named in the task).\"),\n\ttokenBudget: z.number().int().positive().optional().describe(`Maximum tokens for the returned map (default ${DEFAULT_TOKEN_BUDGET}).`)\n});\n/** Render the ranked symbols as a compact, deterministic repo map. */\nfunction formatRepoMap(symbols) {\n\treturn symbols.map((symbol) => `${symbol.file}:${symbol.line} ${symbol.kind} ${symbol.name}`).join(\"\\n\");\n}\nasync function retrievalTool(args, options = {}) {\n\tif (!options.adapter) return \"Codebase retrieval is not available in this session.\";\n\tconst result = await options.adapter.retrieve({\n\t\t...args.activeFiles ? { activeFiles: args.activeFiles } : {},\n\t\t...args.mentionedIdentifiers ? { mentionedIdentifiers: args.mentionedIdentifiers } : {},\n\t\ttokenBudget: args.tokenBudget ?? DEFAULT_TOKEN_BUDGET\n\t});\n\tif (result.symbols.length === 0) return \"No relevant symbols found within the token budget.\";\n\treturn `Most relevant symbols (~${result.totalTokens} tokens):\\n${formatRepoMap(result.symbols)}`;\n}\nfunction createRetrievalTool(options = {}) {\n\treturn createZodFunctionTool(\"CodebaseRetrieval\", \"Retrieve the most relevant slice of the codebase (a ranked repo map of symbols) for the current task, within a token budget. Provide the files you are focused on and/or identifiers named in the task; returns the highest-centrality definitions first.\", RetrievalSchema, async (params) => retrievalTool(params, options));\n}\n//#endregion\n//#region src/computer-use/computer-tool.ts\n/**\n* SELFHOST-010: the `ComputerView` (perceive) + `Computer` (act) tools — mirror the `create*Tool(options)`\n* pattern, split along the permission boundary.\n*\n* `createComputerTool({ driver })` registers BOTH tool names over one injected `IComputerDriver`. The split\n* is purely the permission-bearing boundary (the repo's own `Read`(auto)-vs-`Shell`(approve) precedent):\n* - `ComputerView` calls `driver.screenshot()` — a perceive with no action argument (gated `auto` like `Read`).\n* - `Computer` takes a single typed mutating `action`, executes it via `driver.act()`, and returns the\n* resulting screenshot so the model re-perceives (gated `approve`/`deny` like `Shell`).\n*\n* The typed action union stays WHOLE in the driver contract (`./types.ts`); this file only maps the\n* tool-boundary argument onto it. With no driver the tools report unavailability — they are added to the\n* default set ONLY when a driver is present (adapter-gated; there is NO host fallback — see\n* `createDefaultTools`).\n*/\nconst UNAVAILABLE_MESSAGE = \"Computer use is not available in this session (no driver injected).\";\nconst MouseButtonSchema = z.enum([\n\t\"left\",\n\t\"right\",\n\t\"middle\"\n]);\nconst PointSchema = z.object({\n\tx: z.number(),\n\ty: z.number()\n});\n/**\n* The `Computer` action argument. A flat object (not a discriminated union) so it converts to JSON schema\n* — `type` selects the action and the remaining fields are validated per type in {@link buildAction}. The\n* strongly-typed discriminated union lives in the driver contract (`TComputerAction`).\n*/\nconst ActionSchema = z.object({\n\ttype: z.enum([\n\t\t\"click\",\n\t\t\"double_click\",\n\t\t\"type\",\n\t\t\"keypress\",\n\t\t\"scroll\",\n\t\t\"drag\",\n\t\t\"wait\",\n\t\t\"takeover\"\n\t]).describe(\"Which action to perform.\"),\n\tx: z.number().optional().describe(\"X coordinate (click/double_click/scroll).\"),\n\ty: z.number().optional().describe(\"Y coordinate (click/double_click/scroll).\"),\n\tbutton: MouseButtonSchema.optional().describe(\"Mouse button (click/double_click/drag).\"),\n\ttext: z.string().optional().describe(\"Text to type (type).\"),\n\tkeys: z.array(z.string()).optional().describe(\"Keys to press as a chord (keypress).\"),\n\tdeltaX: z.number().optional().describe(\"Horizontal wheel delta (scroll).\"),\n\tdeltaY: z.number().optional().describe(\"Vertical wheel delta (scroll).\"),\n\tpath: z.array(PointSchema).optional().describe(\"Points to drag through (drag).\"),\n\tms: z.number().optional().describe(\"Milliseconds to wait (wait).\"),\n\treason: z.string().optional().describe(\"Human-readable reason surfaced to the user (takeover).\")\n});\nconst ComputerSchema = z.object({ action: ActionSchema.describe(\"The single mutating action to perform.\") });\nconst ComputerViewSchema = z.object({});\n/** Raised when the tool-boundary action argument is missing fields the action type requires. */\nvar InvalidComputerActionError = class extends Error {};\nfunction requireNumber(value, field, type) {\n\tif (typeof value !== \"number\") throw new InvalidComputerActionError(`Action '${type}' requires numeric '${field}'.`);\n\treturn value;\n}\n/** Map the flat tool-boundary argument onto the strongly-typed driver action union. */\nfunction buildAction(args) {\n\tconst button = args.button;\n\tswitch (args.type) {\n\t\tcase \"click\": return {\n\t\t\ttype: \"click\",\n\t\t\tx: requireNumber(args.x, \"x\", \"click\"),\n\t\t\ty: requireNumber(args.y, \"y\", \"click\"),\n\t\t\t...button ? { button } : {}\n\t\t};\n\t\tcase \"double_click\": return {\n\t\t\ttype: \"double_click\",\n\t\t\tx: requireNumber(args.x, \"x\", \"double_click\"),\n\t\t\ty: requireNumber(args.y, \"y\", \"double_click\"),\n\t\t\t...button ? { button } : {}\n\t\t};\n\t\tcase \"type\":\n\t\t\tif (typeof args.text !== \"string\") throw new InvalidComputerActionError(\"Action 'type' requires 'text'.\");\n\t\t\treturn {\n\t\t\t\ttype: \"type\",\n\t\t\t\ttext: args.text\n\t\t\t};\n\t\tcase \"keypress\":\n\t\t\tif (!args.keys || args.keys.length === 0) throw new InvalidComputerActionError(\"Action 'keypress' requires non-empty 'keys'.\");\n\t\t\treturn {\n\t\t\t\ttype: \"keypress\",\n\t\t\t\tkeys: args.keys\n\t\t\t};\n\t\tcase \"scroll\": return {\n\t\t\ttype: \"scroll\",\n\t\t\tx: requireNumber(args.x, \"x\", \"scroll\"),\n\t\t\ty: requireNumber(args.y, \"y\", \"scroll\"),\n\t\t\tdeltaX: requireNumber(args.deltaX, \"deltaX\", \"scroll\"),\n\t\t\tdeltaY: requireNumber(args.deltaY, \"deltaY\", \"scroll\")\n\t\t};\n\t\tcase \"drag\":\n\t\t\tif (!args.path || args.path.length < 2) throw new InvalidComputerActionError(\"Action 'drag' requires a 'path' of at least two points.\");\n\t\t\treturn {\n\t\t\t\ttype: \"drag\",\n\t\t\t\tpath: args.path,\n\t\t\t\t...button ? { button } : {}\n\t\t\t};\n\t\tcase \"wait\": return {\n\t\t\ttype: \"wait\",\n\t\t\t...typeof args.ms === \"number\" ? { ms: args.ms } : {}\n\t\t};\n\t\tcase \"takeover\": return {\n\t\t\ttype: \"takeover\",\n\t\t\t...args.reason ? { reason: args.reason } : {}\n\t\t};\n\t\tdefault: {\n\t\t\tconst exhaustive = args.type;\n\t\t\tthrow new InvalidComputerActionError(`Unknown action type: ${String(exhaustive)}`);\n\t\t}\n\t}\n}\n/** `ComputerView` — perceive the current surface (returns a screenshot). Gated `auto` like `Read`. */\nasync function perceive(options) {\n\tif (!options.driver) return JSON.stringify({\n\t\tsuccess: false,\n\t\terror: UNAVAILABLE_MESSAGE\n\t});\n\tconst screenshot = await options.driver.screenshot();\n\treturn JSON.stringify(screenshot ? {\n\t\tsuccess: true,\n\t\tscreenshot\n\t} : {\n\t\tsuccess: true,\n\t\ttakeover: true\n\t});\n}\n/** `Computer` — execute one typed mutating action and return the resulting screenshot. Gated like `Shell`. */\nasync function act(args, options) {\n\tif (!options.driver) return JSON.stringify({\n\t\tsuccess: false,\n\t\terror: UNAVAILABLE_MESSAGE\n\t});\n\tlet action;\n\ttry {\n\t\taction = buildAction(args.action);\n\t} catch (err) {\n\t\treturn JSON.stringify({\n\t\t\tsuccess: false,\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t});\n\t}\n\tconst outcome = await options.driver.act(action);\n\tconst result = {\n\t\tsuccess: true,\n\t\t...outcome.screenshot ? { screenshot: outcome.screenshot } : {},\n\t\t...outcome.takeover ? { takeover: true } : {}\n\t};\n\treturn JSON.stringify(result);\n}\n/** Build the `ComputerView` perceive tool over the injected driver. */\nfunction createComputerViewTool(options = {}) {\n\treturn createZodFunctionTool(\"ComputerView\", \"Perceive the computer/browser surface: capture and return a screenshot of the current screen so you can reason about what to do next. Read-only — it never changes anything.\", ComputerViewSchema, async () => perceive(options));\n}\n/** Build the `Computer` act tool over the injected driver. */\nfunction createComputerActTool(options = {}) {\n\treturn createZodFunctionTool(\"Computer\", \"Perform one mutating action on the computer/browser surface (click, double_click, type, keypress, scroll, drag, wait, or takeover) and return the resulting screenshot. Use `takeover` to hand control to the human for sensitive input (credentials/payment); perception is paused during a takeover.\", ComputerSchema, async (params) => act(params, options));\n}\n/**\n* Create BOTH computer-use tools — `ComputerView` (perceive) and `Computer` (act) — over one injected\n* driver. Mirrors `create*Tool(options)`; returns the pair so the assembly layer can spread them into the\n* default set adapter-gated (see `createDefaultTools`).\n*/\nfunction createComputerTool(options = {}) {\n\treturn [createComputerViewTool(options), createComputerActTool(options)];\n}\n//#endregion\n//#region src/computer-use/page-computer-driver.ts\nconst DEFAULT_MEDIA_TYPE = \"image/png\";\nconst DEFAULT_WAIT_MS = 500;\n/** Encode raw screenshot bytes to base64 (accepts the page's `Uint8Array` or an already-encoded string). */\nfunction encodeScreenshot(bytes) {\n\tif (typeof bytes === \"string\") return bytes;\n\treturn Buffer.from(bytes).toString(\"base64\");\n}\nvar PageComputerDriver = class {\n\tpage;\n\tmediaType;\n\tdefaultWaitMs;\n\tsuspended = false;\n\tconstructor(options) {\n\t\tthis.page = options.page;\n\t\tthis.mediaType = options.mediaType ?? DEFAULT_MEDIA_TYPE;\n\t\tthis.defaultWaitMs = options.defaultWaitMs ?? DEFAULT_WAIT_MS;\n\t}\n\tasync capture() {\n\t\tconst type = this.mediaType === \"image/jpeg\" ? \"jpeg\" : \"png\";\n\t\treturn {\n\t\t\tdata: encodeScreenshot(await this.page.screenshot({ type })),\n\t\t\tmediaType: this.mediaType\n\t\t};\n\t}\n\tasync wait(ms) {\n\t\tif (this.page.waitForTimeout) {\n\t\t\tawait this.page.waitForTimeout(ms);\n\t\t\treturn;\n\t\t}\n\t\tawait new Promise((resolve) => setTimeout(resolve, ms));\n\t}\n\tasync screenshot() {\n\t\tif (this.suspended) return;\n\t\treturn this.capture();\n\t}\n\tasync act(action) {\n\t\tif (action.type === \"takeover\") {\n\t\t\tawait this.beginTakeover(action.reason);\n\t\t\treturn { takeover: true };\n\t\t}\n\t\tif (this.suspended) return { takeover: true };\n\t\tconst { mouse, keyboard } = this.page;\n\t\tswitch (action.type) {\n\t\t\tcase \"click\":\n\t\t\t\tawait mouse.click(action.x, action.y, action.button ? { button: action.button } : void 0);\n\t\t\t\tbreak;\n\t\t\tcase \"double_click\":\n\t\t\t\tawait mouse.click(action.x, action.y, {\n\t\t\t\t\tclickCount: 2,\n\t\t\t\t\t...action.button ? { button: action.button } : {}\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"type\":\n\t\t\t\tawait keyboard.type(action.text);\n\t\t\t\tbreak;\n\t\t\tcase \"keypress\":\n\t\t\t\tawait keyboard.press(action.keys.join(\"+\"));\n\t\t\t\tbreak;\n\t\t\tcase \"scroll\":\n\t\t\t\tawait mouse.move(action.x, action.y);\n\t\t\t\tawait mouse.wheel(action.deltaX, action.deltaY);\n\t\t\t\tbreak;\n\t\t\tcase \"drag\":\n\t\t\t\tawait this.performDrag(action);\n\t\t\t\tbreak;\n\t\t\tcase \"wait\":\n\t\t\t\tawait this.wait(action.ms ?? this.defaultWaitMs);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn { screenshot: await this.capture() };\n\t}\n\t/** Move the pointer along a multi-point path with the button held (mouse down → moves → up). */\n\tasync performDrag(action) {\n\t\tif (action.path.length < 2) throw new Error(\"computer drag requires a path of at least 2 points (start + end)\");\n\t\tconst { mouse } = this.page;\n\t\tconst [first, ...rest] = action.path;\n\t\tconst button = action.button ? { button: action.button } : void 0;\n\t\tawait mouse.move(first.x, first.y);\n\t\tawait mouse.down(button);\n\t\tfor (const point of rest) await mouse.move(point.x, point.y);\n\t\tawait mouse.up(button);\n\t}\n\tasync beginTakeover(_reason) {\n\t\tthis.suspended = true;\n\t}\n\tasync endTakeover() {\n\t\tthis.suspended = false;\n\t}\n};\n//#endregion\n//#region src/builtins/shell-tool-description.ts\n/**\n* Dedicated-tool routing hints, keyed by the sibling tool's registered name. A hint is only\n* emitted when that sibling is actually part of the registered tool set (NEUT-002) — the\n* description must not route the model to tools that do not exist in a given assembly.\n*/\nconst SIBLING_ROUTING_HINTS = [\n\t{\n\t\ttoolName: \"Glob\",\n\t\thint: \" - File search: Use Glob (NOT find or ls)\"\n\t},\n\t{\n\t\ttoolName: \"Grep\",\n\t\thint: \" - Content search: Use Grep (NOT grep or rg)\"\n\t},\n\t{\n\t\ttoolName: \"Read\",\n\t\thint: \" - Read files: Use Read (NOT cat/head/tail)\"\n\t},\n\t{\n\t\ttoolName: \"Edit\",\n\t\thint: \" - Edit files: Use Edit (NOT sed/awk)\"\n\t}\n];\n/**\n* Build the OS-aware tool description so the model writes syntax the host shell can run.\n* When `availableTools` is provided, sibling routing hints are restricted to tools in that set;\n* when omitted, the full default hint set is included (default assembly registers all siblings).\n*/\nfunction buildShellToolDescription(shell, availableTools) {\n\tconst hints = availableTools ? SIBLING_ROUTING_HINTS.filter((entry) => availableTools.includes(entry.toolName)) : SIBLING_ROUTING_HINTS;\n\tconst routingBlock = hints.length > 0 ? [`IMPORTANT: Avoid using this tool to run \\`find\\`, \\`grep\\`, \\`cat\\`, \\`head\\`, \\`tail\\`, \\`sed\\`, \\`awk\\`, or \\`echo\\` commands. Instead, use the appropriate dedicated tool:`, ...hints.map((entry) => entry.hint)] : [];\n\treturn [\n\t\t`Executes a command in the host shell and returns its output.`,\n\t\t``,\n\t\t`Active shell: ${shell.label}. ${shell.syntaxHint}`,\n\t\t``,\n\t\t`Each command runs in a fresh shell in workingDirectory (default: the configured working directory); no shell state carries over between calls.`,\n\t\t``,\n\t\t...routingBlock\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/builtins/shell-tool.ts\n/**\n* ShellTool — execute a host shell command via child_process.spawn (TERM-008).\n*\n* Cross-platform: the shell is resolved per OS through `resolvePlatformShell()` (POSIX `sh`/`bash`,\n* Windows PowerShell). The tool name is `Shell` and its description is built dynamically from the\n* resolved shell so the model is told the active shell/OS and writes the right syntax.\n*\n* Returns an IToolInvocationResult JSON string. A non-zero exit is returned as success:true with\n* exitCode set (the command ran, it just exited non-zero — the LLM decides what to do with that).\n*\n* ## SEC-007 — why `workingDirectory` is NOT path-contained (a deliberate decision, not an omission)\n*\n* `Read`/`Write`/`Edit` are contained by `checkPathWithinCwd`, and SEC-007 extended that to `Glob`\n* and `Grep`. This tool is deliberately excluded, and the reason is what the tool IS: it runs an\n* arbitrary command in a shell. A guard on `cwd` is undone by the first `cd ..` — or by an absolute\n* path in the command itself — so it would constrain nothing an attacker-controlled command cannot\n* trivially step around, while LOOKING like a boundary in the code and in review.\n*\n* That appearance is the actual hazard. SEC-006's R9 lesson was \"'the guard is still there' is not a\n* verdict\": a check that reads as containment but is not one is worse than no check, because the next\n* reviewer stops asking. The real boundary for this tool is the permission layer (every invocation is\n* permission-gated at call time) and the sandbox seam below — which is why SEC-006 already recorded\n* `js/indirect-command-line-injection` at the spawn site as a false positive on those same grounds.\n*\n* What the containment root DOES do here: it supplies the DEFAULT working directory. Binding a tool\n* to a session root and then silently running its commands in `process.cwd()` was a real defect — an\n* assembly that scoped its file tools to a workspace still ran `Shell` wherever the host process\n* happened to be started.\n*/\n/** POSIX children are spawned detached so a process-group kill reaps grandchildren (CORE-023). */\nconst SPAWN_DETACHED = process.platform !== \"win32\";\nconst DEFAULT_TIMEOUT_MS$2 = 12e4;\n/** ARCH-056: most bytes retained per stream while the child runs (head); the rest is dropped. */\nconst MAX_CAPTURED_OUTPUT_BYTES = 2e6;\nconst ShellSchema = z.object({\n\tcommand: z.string().describe(\"The shell command to execute\"),\n\ttimeout: z.number().optional().describe(\"Optional timeout in milliseconds (max 600000). Default is 120000 (2 minutes)\"),\n\tworkingDirectory: z.string().optional().describe(\"Working directory for the command. Defaults to the current working directory\")\n});\n/** Run a shell command through the sandbox client, surfacing failures as a structured result. */\nasync function runInSandbox(command, timeout, workingDirectory, options) {\n\ttry {\n\t\tconst sandboxResult = await options.sandboxClient.run(command, {\n\t\t\ttimeoutMs: timeout,\n\t\t\tworkingDirectory\n\t\t});\n\t\tconst result = {\n\t\t\tsuccess: true,\n\t\t\toutput: sandboxResult.stderr ? `${sandboxResult.stdout}\\nstderr:\\n${sandboxResult.stderr}` : sandboxResult.stdout,\n\t\t\texitCode: sandboxResult.exitCode\n\t\t};\n\t\treturn JSON.stringify(result);\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n}\n/**\n* Run a shell command and return stdout + stderr.\n* Resolves with the IToolInvocationResult JSON string.\n*/\nasync function runShell(args, options, shell, signal, traceEnv) {\n\tconst { command, timeout: rawTimeout = DEFAULT_TIMEOUT_MS$2, workingDirectory } = args;\n\tconst timeout = Math.min(rawTimeout, 6e5);\n\tconst effectiveCwd = workingDirectory ?? options.cwd;\n\tif (effectiveCwd === void 0) return JSON.stringify({\n\t\tsuccess: false,\n\t\toutput: \"\",\n\t\terror: \"Shell tool has no working directory: it was constructed without a `cwd` (ARCH-010). This is an assembly bug — the tool would otherwise run in whatever directory the host process was started in.\"\n\t});\n\tif (options.sandboxClient && options.sandboxClient.wrapCommand === void 0) return runInSandbox(command, timeout, workingDirectory ?? options.cwd, options);\n\tconst hostInvocation = {\n\t\tcommand: shell.command,\n\t\targs: shell.commandArgs(command),\n\t\tcwd: effectiveCwd\n\t};\n\tconst invocation = options.sandboxClient?.wrapCommand?.(hostInvocation, command) ?? hostInvocation;\n\tlet released = false;\n\tconst release = () => {\n\t\tif (released) return void 0;\n\t\treleased = true;\n\t\ttry {\n\t\t\treturn invocation.afterExit?.();\n\t\t} catch (error) {\n\t\t\treturn `[sandbox] clean-up failed: ${error instanceof Error ? error.message : String(error)}`;\n\t\t}\n\t};\n\tif (signal?.aborted) {\n\t\trelease();\n\t\treturn JSON.stringify({\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: \"Aborted before start\"\n\t\t});\n\t}\n\treturn new Promise((resolve) => {\n\t\tconst stdoutOutput = createBoundedOutput({ maxBytes: MAX_CAPTURED_OUTPUT_BYTES });\n\t\tconst stderrOutput = createBoundedOutput({ maxBytes: MAX_CAPTURED_OUTPUT_BYTES });\n\t\tlet timedOut = false;\n\t\tlet settled = false;\n\t\tlet child;\n\t\ttry {\n\t\t\tchild = spawn(invocation.command, [...invocation.args], {\n\t\t\t\tcwd: invocation.cwd,\n\t\t\t\tenv: traceEnv === void 0 ? process.env : subprocessTraceEnvironment(process.env, traceEnv),\n\t\t\t\tstdio: [\n\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\"pipe\",\n\t\t\t\t\t...(invocation.inputDescriptors ?? []).map(() => \"pipe\")\n\t\t\t\t],\n\t\t\t\tdetached: SPAWN_DETACHED\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst note = release();\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tresolve(JSON.stringify({\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: note ?? \"\",\n\t\t\t\terror: message\n\t\t\t}));\n\t\t\treturn;\n\t\t}\n\t\t(invocation.inputDescriptors ?? []).forEach((data, index) => {\n\t\t\tconst stream = child.stdio[index + 3];\n\t\t\tstream?.on(\"error\", () => void 0);\n\t\t\tstream?.end(Buffer.from(data));\n\t\t});\n\t\tchild.stdin?.end();\n\t\tchild.stdout?.on(\"data\", (chunk) => {\n\t\t\tstdoutOutput.append(chunk);\n\t\t});\n\t\tchild.stderr?.on(\"data\", (chunk) => {\n\t\t\tstderrOutput.append(chunk);\n\t\t});\n\t\tconst timer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tkillProcessTree(child, { processGroup: SPAWN_DETACHED });\n\t\t\tsettle({\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: stdoutOutput.toString(),\n\t\t\t\terror: `Command timed out after ${timeout}ms`\n\t\t\t});\n\t\t}, timeout);\n\t\tfunction settle(result) {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tclearTimeout(timer);\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\tresolve(JSON.stringify(result));\n\t\t}\n\t\tfunction onAbort() {\n\t\t\tkillProcessTree(child, { processGroup: SPAWN_DETACHED });\n\t\t\tsettle({\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: stdoutOutput.toString(),\n\t\t\t\terror: \"Aborted\"\n\t\t\t});\n\t\t}\n\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\t\tchild.on(\"error\", (err) => {\n\t\t\tif (child.pid === void 0) release();\n\t\t\tsettle({\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: \"\",\n\t\t\t\terror: err.message\n\t\t\t});\n\t\t});\n\t\tchild.on(\"close\", (code) => {\n\t\t\tconst note = release();\n\t\t\tif (timedOut) {\n\t\t\t\tsettle({\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\toutput: stdoutOutput.toString(),\n\t\t\t\t\terror: `Command timed out after ${timeout}ms`,\n\t\t\t\t\texitCode: code ?? void 0\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst stdout = stdoutOutput.toString();\n\t\t\tconst stderr = stderrOutput.toString();\n\t\t\tconst exitCode = code ?? 0;\n\t\t\tconst combined = stderr ? `${stdout}\\nstderr:\\n${stderr}` : stdout;\n\t\t\tsettle({\n\t\t\t\tsuccess: true,\n\t\t\t\toutput: note === void 0 ? combined : `${combined}\\n${note}`,\n\t\t\t\texitCode\n\t\t\t});\n\t\t});\n\t});\n}\n/**\n* Build a host-shell command tool under a given registered name. Both `Shell` and the\n* model-familiar `Bash` are registered as aliases of this one OS-aware implementation\n* (TERM-008): the shell is resolved per OS and the description names the active shell so the\n* model writes the right syntax regardless of which alias it calls.\n*/\nfunction createHostShellTool(name, options) {\n\tconst shell = resolvePlatformShell({ executable: options.shellExecutable });\n\treturn createZodFunctionTool(name, options.description ?? buildShellToolDescription(shell, options.availableTools), ShellSchema, async (params, context) => {\n\t\treturn runShell(params, options, shell, context?.signal, context?.shellTraceEnv);\n\t});\n}\n/**\n* Create a `Shell` tool instance — register with the agent tools registry.\n* The description is resolved at creation time for the host's active shell.\n*/\nfunction createShellTool(options) {\n\treturn createHostShellTool(\"Shell\", options);\n}\n/**\n* Create a `Bash` tool instance — the model-familiar alias of the same OS-aware shell tool.\n*/\nfunction createBashTool(options) {\n\treturn createHostShellTool(\"Bash\", options);\n}\n//#endregion\n//#region src/builtins/path-guard.ts\n/**\n* Returns a JSON-serialized IToolInvocationResult error when filePath is outside cwd, or when NO\n* containment root is configured. Returns undefined only when the path is inside a configured root.\n*\n* This sentence used to end \"or cwd is not set\" — the fail-open default ARCH-010 removed. It sat\n* directly above the two functions that implement the distinction, which is the worst place for a\n* comment to say the opposite of the code.\n*\n* SEC-006: containment is decided on the CANONICAL (symlink-resolved) paths, via the shared\n* `isPathInside` SSOT in agent-core. A purely lexical `resolve()` + `startsWith` comparison let\n* `<cwd>/link/secret` through when `link -> /etc`, because `resolve` does not consult the filesystem\n* and so cannot see a symlink — while the subsequent `readFile`/`writeFile` followed the link out of\n* the sandbox. For `Write`/`Edit` that meant creating files anywhere the process could reach, and\n* since symlinks are ordinary committed git content, pointing the agent at an untrusted clone was\n* enough to arm it.\n*\n* The same defect existed in the CLI's monitor asset server; both now share one implementation,\n* because two containment checks that can disagree are their own defect.\n*/\n/**\n* Whether a host path is inside the tool's containment root — the single predicate every builtin\n* asks, whatever it does with the answer.\n*\n* `checkPathWithinCwd` turns a `false` into the tool-result error a tool RETURNS; the enumerating\n* tools (`Glob`, `Grep`) instead SKIP the entry mid-walk and must not fabricate an error per file.\n* Both ask this one question, which asks agent-core's `isPathInside` SSOT — so there is no second\n* containment rule that could disagree with the first (SEC-006's stated defect, SEC-007 keeping it\n* true as the guard's reach widens).\n*\n* `cwd === undefined` means no containment root is configured, and the answer is NO — ARCH-010.\n*\n* This used to return `true` there: with no root, everything was inside it. A guard whose default is\n* \"allow\" is not a guard, it is a guard that has to be remembered, and the architecture audit found\n* three independent layers that had forgotten. `pack-coding` had already written the consequence into\n* its own source — \"file tools constructed with no options carry a DISARMED working-directory guard:\n* their `Read` will happily return `/etc/hostname`\" — and the child-process subagent worker called\n* `createDefaultTools()` with no argument, so a subagent got exactly that. Measured, not inferred:\n* before this change a rootless `Read` of `/etc/hostname` returned the file.\n*\n* Refusing instead means a construction site that forgets the root fails loudly on its first file\n* access rather than silently running unconfined. The root is also required by the tool factories now,\n* so reaching this branch at all is an assembly bug — which is why the error says so specifically\n* rather than reporting an ordinary out-of-root path.\n*/\nfunction isWithinCwd(filePath, cwd) {\n\tif (cwd === void 0) return false;\n\treturn isPathInside(cwd, filePath);\n}\n/**\n* Where a RELATIVE host path the model supplied is anchored: the containment root, never\n* `process.cwd()` (issue #2429). `Read`/`Write`/`Edit` declare `filePath` absolute, but nothing\n* makes the model comply, and `isPathInside` canonicalises a relative candidate against the PROCESS\n* directory — so a relative path was confined to one root and judged against another. Same rule as\n* `resolveSearchRoot` for the enumerating tools. With no root there is nothing to anchor to; the path\n* is returned as written and `checkPathWithinCwd` refuses it (ARCH-010).\n*/\nfunction resolveHostPath(filePath, cwd) {\n\tif (cwd === void 0) return filePath;\n\treturn resolve(cwd, filePath);\n}\nfunction checkPathWithinCwd(filePath, cwd) {\n\tif (cwd === void 0) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Access denied: \"${filePath}\" cannot be checked because no containment root is configured for this tool. This is an assembly bug, not a path problem — the tool was constructed without a \\`cwd\\`, so it has no boundary to enforce (ARCH-010).`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tif (!isWithinCwd(filePath, cwd)) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Access denied: \"${filePath}\" is outside the working directory`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n}\n/** The opened file is not confirmed inside the containment root; the message words why. */\nvar ContainmentEscapeError = class extends Error {};\n/** macOS `O_NOFOLLOW_ANY`: the open fails with `ELOOP` if ANY component of the path is a symlink. */\nconst DARWIN_O_NOFOLLOW_ANY = 536870912;\n/** Whether canonical `candidate` is canonical `root` or beneath it, compared as text only. */\nfunction isCanonicalInside(root, candidate) {\n\treturn candidate === root || candidate.startsWith(root + sep);\n}\n/**\n* Open a host file so that containment is decided on the file actually opened, not on a path checked\n* before the open — a path swapped for a link between the two would otherwise be followed out of the\n* root (issue #3252).\n*\n* - macOS opens the canonical path with `O_NOFOLLOW_ANY`: a canonical path contains no links, so a\n* link appearing anywhere along it after canonicalisation makes the open fail instead of follow.\n* - Linux reads the kernel's path for the opened descriptor (`/proc/self/fd/N`); re-canonicalising it\n* would consult the filesystem again. Without procfs the answer cannot be confirmed, so the open is\n* refused.\n* - Elsewhere the containment check before the open is the only check.\n*\n* Both sides of the comparison come from the native `realpath`, which spells a path as it is on disk;\n* a root typed in another letter case or Unicode normalization still names the same directory.\n*\n* Throws {@link ContainmentEscapeError} on an escape; any other open error propagates as thrown.\n*/\nasync function openWithinCwd(filePath, cwd, flags) {\n\tconst outside = () => new ContainmentEscapeError(`Access denied: \"${filePath}\" is outside the working directory`);\n\tif (cwd === void 0) throw outside();\n\tconst root = await realpath(cwd);\n\tif (process.platform === \"darwin\") {\n\t\tconst canonical = await realpath(filePath);\n\t\tif (!isCanonicalInside(root, canonical)) throw outside();\n\t\ttry {\n\t\t\treturn await open(canonical, flags | DARWIN_O_NOFOLLOW_ANY, 384);\n\t\t} catch (err) {\n\t\t\tif (err.code === \"ELOOP\") throw outside();\n\t\t\tthrow err;\n\t\t}\n\t}\n\tconst handle = await open(filePath, flags, 384);\n\tif (process.platform !== \"linux\") return handle;\n\tlet opened;\n\ttry {\n\t\topened = await readlink(`/proc/self/fd/${handle.fd}`);\n\t} catch {\n\t\tawait handle.close();\n\t\tthrow new ContainmentEscapeError(`Access denied: \"${filePath}\" cannot be confirmed inside the working directory without /proc`);\n\t}\n\tif (isCanonicalInside(root, opened)) return handle;\n\tawait handle.close();\n\tthrow outside();\n}\n/**\n* Resolve an LLM-supplied search root for an ENUMERATING tool, and refuse one that escapes (SEC-007).\n*\n* A relative `requested` anchors to the CONTAINMENT ROOT, not to `process.cwd()`: anchoring them to\n* two different directories is how a \"contained\" search silently starts somewhere else. `error`\n* carries the tool-result JSON to return, or is `undefined` when the root is allowed.\n*\n* With no root there is nothing to anchor to, so this refuses rather than reaching for the process\n* directory (ARCH-010). The previous `cwd ?? process.cwd()` was that reach: harmless once the guard\n* below refuses anyway, but it read as a supported fallback, which is the pattern being removed.\n*/\nfunction resolveSearchRoot(requested, cwd) {\n\tif (cwd === void 0) return {\n\t\troot: \"\",\n\t\terror: checkPathWithinCwd(requested ?? \"\", void 0)\n\t};\n\tconst root = requested ? resolve(cwd, requested) : cwd;\n\treturn {\n\t\troot,\n\t\terror: checkPathWithinCwd(root, cwd)\n\t};\n}\n//#endregion\n//#region src/builtins/read-tool.ts\n/**\n* ReadTool — read a file and return its contents with line numbers (cat -n style).\n*\n* Supports offset/limit for partial reads. Detects binary files and refuses to\n* return their raw bytes. Default limit is 2000 lines.\n*/\nconst DEFAULT_READ_DESCRIPTION = \"Reads a file from the local filesystem.\\n\\nBy default, reads up to 2000 lines from the beginning of the file. You can optionally specify offset and limit for partial reads.\\n\\nResults are returned using cat -n format, with line numbers starting at 1.\\n\\nThe filePath parameter must be an absolute path, not a relative path.\";\nconst DEFAULT_LIMIT$1 = 2e3;\nconst MAX_READ_BYTES = 4 * 1024 * 1024;\nconst READ_CHUNK_BYTES$2 = 64 * 1024;\n/** A budget refusal is a hard failure so a workflow cannot treat it as file content. */\nvar ReadByteLimitError = class extends ToolExecutionError {\n\tboundary;\n\tconstructor(boundary) {\n\t\tsuper(`Read ${boundary} exceeds its UTF-8 byte limit`, \"Read\");\n\t\tthis.boundary = boundary;\n\t}\n};\n/** Abort is a hard failure; the workflow must not accept a partial read. */\nvar ReadCancelledError = class extends ToolExecutionError {\n\tconstructor() {\n\t\tsuper(\"Read cancelled\", \"Read\");\n\t}\n};\nconst ReadSchema = z.object({\n\tfilePath: z.string().describe(\"The absolute path to the file to read\"),\n\toffset: z.number().optional().describe(\"The line number to start reading from (1-based). Only provide if the file is too large to read at once\"),\n\tlimit: z.number().optional().describe(`The number of lines to read (default: ${DEFAULT_LIMIT$1}). Only provide if the file is too large to read at once`)\n});\n/**\n* Heuristic binary detection: scan the first 8 KB for null bytes.\n*/\nfunction isBinary(buffer) {\n\tconst checkLength = Math.min(buffer.length, 8192);\n\tfor (let i = 0; i < checkLength; i++) if (buffer[i] === 0) return true;\n\treturn false;\n}\n/**\n* Format lines with 1-based line numbers in cat -n style.\n* Pads line number to the width of the highest line number.\n*/\nfunction formatWithLineNumbers(lines, startLine) {\n\tconst lastLineNum = startLine + lines.length - 1;\n\tconst width = String(lastLineNum).length;\n\treturn lines.map((line, idx) => {\n\t\treturn `${String(startLine + idx).padStart(width, \" \")}\\t${line}`;\n\t}).join(\"\\n\");\n}\nfunction formatReadResult(filePath, content, startLine, limit) {\n\tconst selectedLines = [];\n\tlet selectedMinimumBytes = 0;\n\tlet totalLines = 0;\n\tlet lineStart = 0;\n\tconst selectedStart = Math.trunc(startLine - 1);\n\tconst selectedEnd = Math.trunc(startLine - 1 + limit);\n\twhile (lineStart < content.length) {\n\t\tconst newline = content.indexOf(\"\\n\", lineStart);\n\t\tconst lineEnd = newline === -1 ? content.length : newline;\n\t\ttotalLines++;\n\t\tif (totalLines > selectedStart && totalLines <= selectedEnd) {\n\t\t\tconst line = content.slice(lineStart, lineEnd);\n\t\t\tselectedMinimumBytes += Buffer.byteLength(line, \"utf8\") + String(startLine + selectedLines.length).length + 1;\n\t\t\tif (selectedMinimumBytes > MAX_READ_BYTES) throw new ReadByteLimitError(\"output\");\n\t\t\tselectedLines.push(line);\n\t\t}\n\t\tif (newline === -1) break;\n\t\tlineStart = newline + 1;\n\t}\n\tconst returnedLines = selectedLines.length;\n\tconst header = returnedLines < totalLines ? `[File: ${filePath} (lines ${startLine}-${startLine + returnedLines - 1} of ${totalLines})]\\n` : `[File: ${filePath} (${totalLines} lines)]\\n`;\n\tconst width = String(startLine + returnedLines - 1).length;\n\tlet outputBytes = Buffer.byteLength(header, \"utf8\") + Math.max(0, returnedLines - 1);\n\tfor (const line of selectedLines) outputBytes += width + 1 + Buffer.byteLength(line, \"utf8\");\n\tif (outputBytes > MAX_READ_BYTES) throw new ReadByteLimitError(\"output\");\n\tconst result = {\n\t\tsuccess: true,\n\t\toutput: header + formatWithLineNumbers(selectedLines, startLine)\n\t};\n\treturn JSON.stringify(result);\n}\nasync function readFileTool(args, options) {\n\tif (options.signal?.aborted) throw new ReadCancelledError();\n\tconst { offset, limit = DEFAULT_LIMIT$1 } = args;\n\tconst filePath = options.sandboxClient ? args.filePath : resolveHostPath(args.filePath, options.cwd);\n\tconst startLine = offset !== void 0 && offset > 0 ? offset : 1;\n\tif (options.sandboxClient) try {\n\t\tconst content = await options.sandboxClient.readFile(filePath);\n\t\tif (options.signal?.aborted) throw new ReadCancelledError();\n\t\tif (Buffer.byteLength(content, \"utf8\") > MAX_READ_BYTES) throw new ReadByteLimitError(\"input\");\n\t\treturn formatReadResult(filePath, content, startLine, limit);\n\t} catch (err) {\n\t\tif (err instanceof ReadByteLimitError || err instanceof ReadCancelledError) throw err;\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tconst pathError = checkPathWithinCwd(filePath, options.cwd);\n\tif (pathError !== void 0) return pathError;\n\tconst failure = (error) => JSON.stringify({\n\t\tsuccess: false,\n\t\toutput: \"\",\n\t\terror\n\t});\n\tlet handle;\n\ttry {\n\t\thandle = await openWithinCwd(filePath, options.cwd, constants.O_RDONLY | constants.O_NONBLOCK);\n\t} catch (err) {\n\t\tif (err instanceof ContainmentEscapeError) return failure(err.message);\n\t\tconst found = await stat(filePath).catch(() => void 0);\n\t\tif (found === void 0) return failure(`File not found: ${filePath}`);\n\t\tif (!found.isFile()) return failure(`Path is not a file: ${filePath}`);\n\t\treturn failure(err instanceof Error ? err.message : String(err));\n\t}\n\tlet buffer = Buffer.alloc(0);\n\tlet binaryFile = false;\n\ttry {\n\t\tif (!(await handle.stat()).isFile()) return failure(`Path is not a file: ${filePath}`);\n\t\tconst chunks = [];\n\t\tconst chunk = Buffer.allocUnsafe(READ_CHUNK_BYTES$2);\n\t\tlet bytes = 0;\n\t\tlet binaryCheckedBytes = 0;\n\t\twhile (bytes <= MAX_READ_BYTES) {\n\t\t\tif (options.signal?.aborted) throw new ReadCancelledError();\n\t\t\tconst { bytesRead } = await handle.read(chunk, 0, Math.min(chunk.length, 4194305 - bytes), null);\n\t\t\tif (bytesRead === 0) break;\n\t\t\tconst binaryCheckLength = Math.min(bytesRead, 8192 - binaryCheckedBytes);\n\t\t\tif (binaryCheckLength > 0 && isBinary(chunk.subarray(0, binaryCheckLength))) {\n\t\t\t\tbinaryFile = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbinaryCheckedBytes += binaryCheckLength;\n\t\t\tbytes += bytesRead;\n\t\t\tif (bytes > MAX_READ_BYTES) throw new ReadByteLimitError(\"input\");\n\t\t\tchunks.push(Buffer.from(chunk.subarray(0, bytesRead)));\n\t\t}\n\t\tif (!binaryFile) buffer = Buffer.concat(chunks, bytes);\n\t} catch (err) {\n\t\tif (err instanceof ReadByteLimitError || err instanceof ReadCancelledError) throw err;\n\t\treturn failure(err instanceof Error ? err.message : String(err));\n\t} finally {\n\t\tawait handle.close();\n\t}\n\tif (options.signal?.aborted) throw new ReadCancelledError();\n\tif (binaryFile) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Binary file not supported: ${filePath}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\treturn formatReadResult(filePath, buffer.toString(\"utf8\"), startLine, limit);\n}\n/**\n* Create a ReadTool instance — register with agent tools registry.\n*/\nfunction createReadTool(options) {\n\treturn createZodFunctionTool(\"Read\", options.description ?? DEFAULT_READ_DESCRIPTION, ReadSchema, async (params) => {\n\t\treturn readFileTool(params, options);\n\t});\n}\n//#endregion\n//#region src/builtins/atomic-file-write.ts\nconst TEMP_RANDOM_BYTES = 6;\nconst PRESERVED_MODE_BITS = 4095;\nconst MISSING_FILE_ERROR_CODE = \"ENOENT\";\n/**\n* NEUT-009: this marker used to carry the consumer's product name, so a neutral tool library wrote\n* that name onto every temporary file it created — inherited by any other product built on it. The\n* marker now says what the file IS, which is all it was ever for.\n*\n* The product name is not quoted here either: the ratchet counts prose, deliberately, because a\n* library whose comments teach the product's layout is coupled to it just as firmly.\n*/\nconst TEMP_MARKER = \".atomic-tmp-\";\nfunction createTempFilePath(filePath) {\n\tconst dir = dirname(filePath);\n\tconst name = basename(filePath);\n\tconst suffix = randomBytes(TEMP_RANDOM_BYTES).toString(\"hex\");\n\treturn join(dir, `.${name}${TEMP_MARKER}${process.pid}-${Date.now()}-${suffix}`);\n}\nasync function readExistingMode(filePath) {\n\ttry {\n\t\treturn (await stat(filePath)).mode & PRESERVED_MODE_BITS;\n\t} catch (error) {\n\t\tif (error instanceof Error && hasErrorCode(error, MISSING_FILE_ERROR_CODE)) return void 0;\n\t\tthrow error;\n\t}\n}\nfunction hasErrorCode(error, code) {\n\treturn \"code\" in error && error.code === code;\n}\nasync function atomicWriteUtf8File(filePath, content) {\n\tawait mkdir(dirname(filePath), { recursive: true });\n\tconst existingMode = await readExistingMode(filePath);\n\tconst tempFilePath = createTempFilePath(filePath);\n\ttry {\n\t\tawait writeFile(tempFilePath, content, \"utf8\");\n\t\tif (existingMode !== void 0) await chmod(tempFilePath, existingMode);\n\t\tawait rename(tempFilePath, filePath);\n\t} catch (error) {\n\t\tawait rm(tempFilePath, { force: true }).catch(() => void 0);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/builtins/write-tool.ts\n/**\n* WriteTool — write content to a file, auto-creating parent directories.\n*/\nconst DEFAULT_WRITE_DESCRIPTION = \"Writes a file to the local filesystem. This will overwrite an existing file if one exists.\\n\\nPrefer the Edit tool for modifying existing files — it only sends the changed text. Use this tool to create new files or for complete rewrites.\\n\\nParent directories are created automatically when missing.\";\nconst WriteSchema = z.object({\n\tfilePath: z.string().describe(\"The absolute path to the file to write\"),\n\tcontent: z.string().describe(\"The content to write to the file\")\n});\nasync function writeFileTool(args, options) {\n\tconst { content } = args;\n\tconst filePath = options.sandboxClient ? args.filePath : resolveHostPath(args.filePath, options.cwd);\n\tif (!options.sandboxClient) {\n\t\tconst pathError = checkPathWithinCwd(filePath, options.cwd);\n\t\tif (pathError !== void 0) return pathError;\n\t}\n\ttry {\n\t\tif (options.sandboxClient) await options.sandboxClient.writeFile(filePath, content);\n\t\telse await atomicWriteUtf8File(filePath, content);\n\t\tconst result = {\n\t\t\tsuccess: true,\n\t\t\toutput: `Written ${Buffer.byteLength(content, \"utf8\")} bytes to ${filePath}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n}\n/**\n* Create a WriteTool instance — register with agent tools registry.\n*/\nfunction createWriteTool(options) {\n\treturn createZodFunctionTool(\"Write\", options.description ?? DEFAULT_WRITE_DESCRIPTION, WriteSchema, async (params) => {\n\t\treturn writeFileTool(params, options);\n\t});\n}\n//#endregion\n//#region src/builtins/edit-tool.ts\n/**\n* EditTool — perform string-replace edits on a file.\n*\n* By default, requires the oldString to appear exactly once in the file\n* (ensuring surgical edits). Pass replaceAll:true to replace all occurrences.\n*/\nconst DEFAULT_EDIT_DESCRIPTION = \"Performs exact string replacements in files.\\n\\noldString must exactly match the file's current content, including whitespace and indentation — reading the file first (e.g. with a file-read tool) is the reliable way to copy exact text.\\n\\nThe edit will FAIL if oldString is not unique in the file. Either provide more surrounding context to make it unique, or set replaceAll to change every instance.\";\nconst EditSchema = z.object({\n\tfilePath: z.string().describe(\"The absolute path to the file to modify\"),\n\toldString: z.string().describe(\"The text to replace (must be an exact match of existing content)\"),\n\tnewString: z.string().describe(\"The text to replace it with (must be different from oldString)\"),\n\treplaceAll: z.boolean().optional().describe(\"Replace all occurrences of oldString (default: false). Useful for renaming variables\")\n});\nconst MAX_EDIT_FILE_BYTES = 4 * 1024 * 1024;\nconst READ_CHUNK_BYTES$1 = 64 * 1024;\n/** Marks a refusal that must not surface a partial or crashed read to the caller. */\nvar EditByteLimitError = class extends Error {\n\tboundary;\n\tconstructor(boundary) {\n\t\tsuper(`Edit ${boundary} exceeds its ${MAX_EDIT_FILE_BYTES}-byte limit`);\n\t\tthis.boundary = boundary;\n\t}\n};\n/**\n* Read a file as UTF-8 while rejecting as soon as more than `maxBytes` bytes have arrived —\n* before the whole content is materialized. Reading actual bytes off the stream (rather than\n* trusting stat() size) also catches a file that grows after being stat'd, or has no stable\n* size at all (a named pipe).\n*/\nasync function readBoundedUtf8File(filePath, maxBytes) {\n\tconst stream = createReadStream(filePath, { highWaterMark: READ_CHUNK_BYTES$1 });\n\tconst chunks = [];\n\tlet bytes = 0;\n\ttry {\n\t\tfor await (const chunk of stream) {\n\t\t\tconst buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);\n\t\t\tbytes += buffer.length;\n\t\t\tif (bytes > maxBytes) throw new EditByteLimitError(\"input\");\n\t\t\tchunks.push(buffer);\n\t\t}\n\t} finally {\n\t\tstream.destroy();\n\t}\n\treturn Buffer.concat(chunks, bytes).toString(\"utf8\");\n}\nasync function editFileTool(args, options) {\n\tconst { oldString, newString, replaceAll = false } = args;\n\tconst filePath = options.sandboxClient ? args.filePath : resolveHostPath(args.filePath, options.cwd);\n\tif (!options.sandboxClient) {\n\t\tconst pathError = checkPathWithinCwd(filePath, options.cwd);\n\t\tif (pathError !== void 0) return pathError;\n\t}\n\tlet content;\n\ttry {\n\t\tif (options.sandboxClient) {\n\t\t\tcontent = await options.sandboxClient.readFile(filePath);\n\t\t\tif (Buffer.byteLength(content, \"utf8\") > MAX_EDIT_FILE_BYTES) throw new EditByteLimitError(\"input\");\n\t\t} else content = await readBoundedUtf8File(filePath, MAX_EDIT_FILE_BYTES);\n\t} catch (err) {\n\t\tif (err instanceof EditByteLimitError) {\n\t\t\tconst result = {\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: \"\",\n\t\t\t\terror: `${err.message}: ${filePath}`\n\t\t\t};\n\t\t\treturn JSON.stringify(result);\n\t\t}\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `File not found: ${filePath}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tif (!content.includes(oldString)) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `oldString not found in file: ${filePath}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tlet parts = [];\n\tif (replaceAll) parts = content.split(oldString);\n\telse if (content.indexOf(oldString) !== content.lastIndexOf(oldString)) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `oldString is not unique in file (found ${content.split(oldString).length - 1} occurrences). Provide more context to make it unique, or use replaceAll:true.`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tconst count = replaceAll ? parts.length - 1 : 1;\n\tconst oldBytes = Buffer.byteLength(oldString, \"utf8\");\n\tconst newBytes = Buffer.byteLength(newString, \"utf8\");\n\tif (Buffer.byteLength(content, \"utf8\") - count * oldBytes + count * newBytes > MAX_EDIT_FILE_BYTES) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Edit output exceeds its ${MAX_EDIT_FILE_BYTES}-byte limit: ${filePath}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tconst updated = replaceAll ? parts.join(newString) : content.slice(0, content.indexOf(oldString)) + newString + content.slice(content.indexOf(oldString) + oldString.length);\n\ttry {\n\t\tif (options.sandboxClient) await options.sandboxClient.writeFile(filePath, updated);\n\t\telse await atomicWriteUtf8File(filePath, updated);\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tconst matchIdx = content.indexOf(oldString);\n\tconst startLine = matchIdx >= 0 ? content.substring(0, matchIdx).split(\"\\n\").length : 1;\n\tconst result = {\n\t\tsuccess: true,\n\t\toutput: `Replaced ${count} occurrence(s) in ${filePath}`,\n\t\tstartLine\n\t};\n\treturn JSON.stringify(result);\n}\n/**\n* Create an EditTool instance — register with agent tools registry.\n*/\nfunction createEditTool(options) {\n\treturn createZodFunctionTool(\"Edit\", options.description ?? DEFAULT_EDIT_DESCRIPTION, EditSchema, async (params) => {\n\t\treturn editFileTool(params, options);\n\t});\n}\n//#endregion\n//#region src/builtins/glob-tool.ts\n/**\n* GlobTool — fast file pattern search using fast-glob.\n*\n* Excludes node_modules and .git by default.\n* Results are sorted by modification time (most recently modified first) among the candidates\n* enumerated before any candidate ceiling was hit (see DEFAULT_MAX_GLOB_CANDIDATES) — ordering is\n* not guaranteed across the full match set when the search tree is larger than that ceiling.\n*\n* SEC-007: when a containment root is configured the enumeration is confined to it. Listing the\n* filesystem is a disclosure in its own right — a sandbox that stops the model reading a file but\n* lets it map everything around that file is not a sandbox.\n*/\nconst DEFAULT_MAX_RESULTS = 1e3;\n/**\n* Ceiling on how many raw glob matches are pulled off `fast-glob`'s match STREAM before enumeration\n* stops, independent of `limit`/`DEFAULT_MAX_RESULTS`.\n*\n* `fg(pattern)` (the promise form) materializes every match into memory and only then stats and\n* slices to `limit` — a pattern like `**\\/*` under a huge tree allocates and stats the whole match\n* set no matter how small `limit` is. Streaming lets the walk stop as soon as this many CANDIDATES\n* have been seen, so memory and stat fan-out scale with this ceiling, not with the tree.\n*/\nconst DEFAULT_MAX_GLOB_CANDIDATES = 5e4;\nconst GlobSchema = z.object({\n\tpattern: z.string().describe(\"The glob pattern to match files against (e.g. \\\"**/*.ts\\\", \\\"src/**/*.tsx\\\")\"),\n\tpath: z.string().optional().describe(\"The directory to search in. Defaults to the current working directory. Must be a valid directory path if provided\"),\n\tlimit: z.number().optional().describe(\"Maximum number of results to return (default: 1000). Use a smaller limit to save context space\")\n});\n/** Cap on concurrent `stat` calls during the mtime sort, so a large match set cannot storm the FS. */\nconst STAT_CONCURRENCY_LIMIT = 100;\n/**\n* Drop every match whose CANONICAL path escapes the containment root, then stat the survivors for the\n* mtime sort, newest first.\n*\n* Containment is decided per RESULT as well as per root (SEC-007): a `..` in the pattern, or an\n* absolute pattern, produces a match the search root never vouched for. Decided canonically through\n* the shared guard — a symlink named `escape` is a plain segment, so no amount of segment validation\n* would catch it.\n*/\nasync function containedMatchesByMtime(matches, cwd, containmentRoot) {\n\tconst limit = pLimit(STAT_CONCURRENCY_LIMIT);\n\treturn (await Promise.all(matches.map((p) => limit(async () => {\n\t\tconst absPath = resolve(cwd, p);\n\t\tif (!isWithinCwd(absPath, containmentRoot)) return void 0;\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tpath: p,\n\t\t\t\tmtime: (await stat(absPath)).mtimeMs\n\t\t\t};\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\tpath: p,\n\t\t\t\tmtime: 0\n\t\t\t};\n\t\t}\n\t})))).filter((entry) => entry !== void 0).sort((a, b) => b.mtime - a.mtime);\n}\n/**\n* Pull matches off `fast-glob`'s streaming API one at a time, stopping at `maxCandidates` instead of\n* materializing the whole match set (see {@link DEFAULT_MAX_GLOB_CANDIDATES}). Exported for tests that\n* need a smaller ceiling than the real default.\n*/\nasync function collectGlobMatches(pattern, options, maxCandidates) {\n\tconst matches = [];\n\tlet truncated = false;\n\tconst stream = fg.stream(pattern, options);\n\tfor await (const entry of stream) {\n\t\tif (matches.length >= maxCandidates) {\n\t\t\ttruncated = true;\n\t\t\tbreak;\n\t\t}\n\t\tmatches.push(entry);\n\t}\n\treturn {\n\t\tmatches,\n\t\ttruncated\n\t};\n}\n/**\n* Exported (rather than module-private) so tests can drive it with a `maxCandidates` far smaller than\n* {@link DEFAULT_MAX_GLOB_CANDIDATES} — the real default is too large to exercise cheaply — without\n* adding any test-only knob to the public `createGlobTool` factory or its schema.\n*/\nasync function globFileTool(args, options, maxCandidates = DEFAULT_MAX_GLOB_CANDIDATES) {\n\tconst { pattern, path: basePath } = args;\n\tconst containmentRoot = options.cwd;\n\tconst { root: cwd, error: rootError } = resolveSearchRoot(basePath, containmentRoot);\n\tif (rootError) return rootError;\n\tlet candidates;\n\ttry {\n\t\tcandidates = await collectGlobMatches(pattern, {\n\t\t\tcwd,\n\t\t\tignore: [\"**/node_modules/**\", \"**/.git/**\"],\n\t\t\tdot: true,\n\t\t\tabsolute: false,\n\t\t\tfollowSymbolicLinks: false\n\t\t}, maxCandidates);\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tconst { matches, truncated: candidatesTruncated } = candidates;\n\tconst withMtime = await containedMatchesByMtime(matches, cwd, containmentRoot);\n\tconst maxResults = args.limit ?? DEFAULT_MAX_RESULTS;\n\tconst totalMatches = withMtime.length;\n\tconst truncated = totalMatches > maxResults;\n\tconst sorted = (truncated ? withMtime.slice(0, maxResults) : withMtime).map((f) => f.path);\n\tlet output = sorted.length > 0 ? sorted.join(\"\\n\") : \"(no matches)\";\n\tif (truncated) output += `\\n\\n[Showing ${maxResults} of ${totalMatches} matches. Use limit parameter to see more.]`;\n\tif (candidatesTruncated) output += `\\n\\n[Candidate search stopped early; the search tree has more matches than this tool scans in one call. Results are ordered among the scanned candidates only — narrow the pattern or path to see the rest.]`;\n\treturn JSON.stringify({\n\t\tsuccess: true,\n\t\toutput\n\t});\n}\nconst DEFAULT_GLOB_DESCRIPTION = \"Fast file pattern matching tool that works with any codebase size.\\n\\nSupports glob patterns like '**/*.js' or 'src/**/*.ts'. Returns matching file paths sorted by modification time.\\n\\nUse this tool when you need to find files by name patterns.\\n\\nDefault limit is 1000 results. Use the limit parameter if you need fewer results to save context space.\";\n/**\n* Create a GlobTool instance — register with agent tools registry.\n*/\nfunction createGlobTool(options) {\n\treturn createZodFunctionTool(\"Glob\", options.description ?? DEFAULT_GLOB_DESCRIPTION, GlobSchema, async (params) => {\n\t\treturn globFileTool(params, options);\n\t});\n}\n//#endregion\n//#region src/builtins/grep-search.ts\n/**\n* The `Grep` tool's search internals — file enumeration and per-file matching.\n*\n* Split out of `grep-tool.ts` (SEC-007) when adding containment pushed that file past the\n* anti-monolith limit. The split is by responsibility, not by line count: this module is HOW the\n* search is performed, while `grep-tool.ts` is the tool SURFACE — schema, model-facing description,\n* factory, and the result envelope. Neither half needs to know the other's concerns.\n*/\n/** Convert a simple glob to a RegExp for file name filtering. */\nfunction globToRegex(glob) {\n\tconst escaped = glob.replace(/[.+^${}()|[\\]\\\\]/g, \"\\\\$&\").replace(/\\*\\*/g, \".+\").replace(/\\*/g, \"[^/]*\");\n\treturn new RegExp(`^${escaped}$`);\n}\n/** Check if a file name matches an optional glob filter. */\nfunction matchesGlob(filename, glob) {\n\tif (glob === void 0) return true;\n\treturn globToRegex(glob).test(filename);\n}\n/**\n* Ceiling on how many directory entries `collectFiles` will `stat` before it stops walking.\n*\n* Without a cap, enumeration and stat fan-out scale with the whole tree under the search root,\n* not with any result limit — a directory with millions of files makes every `Grep` call walk and\n* stat millions of entries before `headLimit` ever gets a chance to truncate the OUTPUT. This bounds\n* the WALK itself.\n*/\nconst DEFAULT_MAX_COLLECTED_FILES = 5e4;\n/**\n* Gather files under a directory recursively, excluding node_modules/.git, stopping once `maxFiles`\n* entries have been visited.\n*\n* `containmentRoot` (SEC-007) drops any entry whose CANONICAL path escapes the root, before it is\n* descended into or read. `stat` follows symlinks, so without this a link inside the root pointing\n* out of it made the whole target tree readable — including, for a symlinked FILE, its contents.\n*/\nasync function collectFiles(dirPath, glob, containmentRoot, maxFiles = DEFAULT_MAX_COLLECTED_FILES) {\n\tconst results = [];\n\tlet visited = 0;\n\tlet truncated = false;\n\tasync function walk(current) {\n\t\tif (truncated) return;\n\t\tlet entryNames;\n\t\ttry {\n\t\t\tentryNames = await readdir(current);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tfor (const name of entryNames) {\n\t\t\tif (truncated) return;\n\t\t\tif (name === \"node_modules\" || name === \".git\") continue;\n\t\t\tconst fullPath = join(current, name);\n\t\t\tif (!isWithinCwd(fullPath, containmentRoot)) continue;\n\t\t\tif (visited >= maxFiles) {\n\t\t\t\ttruncated = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvisited++;\n\t\t\tlet fileStat;\n\t\t\ttry {\n\t\t\t\tfileStat = await stat(fullPath);\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (fileStat.isDirectory()) await walk(fullPath);\n\t\t\telse if (fileStat.isFile()) {\n\t\t\t\tif (matchesGlob(name, glob)) results.push(fullPath);\n\t\t\t}\n\t\t}\n\t}\n\tawait walk(dirPath);\n\treturn {\n\t\tfiles: results,\n\t\ttruncated\n\t};\n}\n/** Search a single file for lines matching the regex. */\nfunction searchFile(content, filePath, regex, contextLines, outputMode, maxOutputBytes) {\n\tconst lines = content.split(\"\\n\");\n\tconst matchingIndices = [];\n\tfor (let i = 0; i < lines.length; i++) if (regex.test(lines[i])) matchingIndices.push(i);\n\tif (matchingIndices.length === 0) return [];\n\tif (outputMode === \"files_with_matches\") return [filePath];\n\tif (outputMode === \"count\") return [`${filePath}:${matchingIndices.length}`];\n\tconst includedIndices = /* @__PURE__ */ new Set();\n\tfor (const idx of matchingIndices) for (let c = Math.max(0, idx - contextLines); c <= Math.min(lines.length - 1, idx + contextLines); c++) includedIndices.add(c);\n\tconst outputLines = [];\n\tlet outputBytes = 0;\n\tconst sortedIndices = Array.from(includedIndices).sort((a, b) => a - b);\n\tlet prevIdx;\n\tlet matchingCursor = 0;\n\tfor (const idx of sortedIndices) {\n\t\tif (prevIdx !== void 0 && idx > prevIdx + 1) outputLines.push(\"--\");\n\t\tconst lineNum = idx + 1;\n\t\twhile (matchingIndices[matchingCursor] < idx) matchingCursor++;\n\t\tconst row = `${filePath}:${lineNum}${matchingIndices[matchingCursor] === idx ? \":\" : \"-\"}${lines[idx]}`;\n\t\toutputBytes += Buffer.byteLength(row, \"utf8\") + 1;\n\t\tif (maxOutputBytes !== void 0 && outputBytes > maxOutputBytes) throw new Error(\"byte limit\");\n\t\toutputLines.push(row);\n\t\tprevIdx = idx;\n\t}\n\treturn outputLines;\n}\n//#endregion\n//#region src/builtins/isolated-grep-search.ts\nconst BOOTSTRAP = `\nconst { parentPort } = require('node:worker_threads');\nconst searchFile = ${searchFile.toString()};\nlet outputBytes = 0;\nparentPort.on('message', (request) => {\n try {\n const regex = new RegExp(request.pattern);\n const matches = searchFile(request.content, request.filePath, regex, request.contextLines, request.outputMode, 4 * 1024 * 1024);\n let bytes = 0;\n for (const match of matches) { bytes += Buffer.byteLength(match, 'utf8') + 1; if (outputBytes + bytes > 4 * 1024 * 1024) throw new Error('byte limit'); }\n outputBytes += bytes;\n parentPort.postMessage({ id: request.id, matches });\n } catch (error) { parentPort.postMessage({ id: request.id, error: error?.message === 'byte limit' ? 'Grep search exceeded its byte limit' : 'Invalid grep regex execution' }); }\n});\n`;\nvar GrepProcessWorker = class extends EventEmitter {\n\tchild = spawn(process.execPath, [\"-e\", `\nconst searchFile = ${searchFile.toString()};\nconst readline = require('node:readline');\nlet outputBytes = 0;\nreadline.createInterface({ input: process.stdin }).on('line', line => {\n const request = JSON.parse(line);\n try {\n const regex = new RegExp(request.pattern);\n const matches = searchFile(request.content, request.filePath, regex, request.contextLines, request.outputMode, 4 * 1024 * 1024);\n let bytes = 0;\n for (const match of matches) { bytes += Buffer.byteLength(match, 'utf8') + 1; if (outputBytes + bytes > 4 * 1024 * 1024) throw new Error('byte limit'); }\n outputBytes += bytes;\n process.stdout.write(JSON.stringify({ id: request.id, matches }) + String.fromCharCode(10));\n } catch (error) { process.stdout.write(JSON.stringify({ id: request.id, error: error?.message === 'byte limit' ? 'Grep search exceeded its byte limit' : 'Invalid grep regex execution' }) + String.fromCharCode(10)); }\n});\n`], {\n\t\tenv: {\n\t\t\tBUN_BE_BUN: \"1\",\n\t\t\t...process.env.SystemRoot ? { SystemRoot: process.env.SystemRoot } : {}\n\t\t},\n\t\tcwd: tmpdir(),\n\t\tstdio: \"pipe\"\n\t});\n\tclosed;\n\tconstructor() {\n\t\tsuper();\n\t\tlet pending = \"\";\n\t\tthis.child.stdout.setEncoding(\"utf8\");\n\t\tthis.child.stdout.on(\"data\", (chunk) => {\n\t\t\tpending += chunk;\n\t\t\tif (Buffer.byteLength(pending, \"utf8\") > 25166848) {\n\t\t\t\tthis.emit(\"error\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet newline;\n\t\t\twhile ((newline = pending.indexOf(\"\\n\")) >= 0) {\n\t\t\t\tconst line = pending.slice(0, newline);\n\t\t\t\tpending = pending.slice(newline + 1);\n\t\t\t\ttry {\n\t\t\t\t\tthis.emit(\"message\", JSON.parse(line));\n\t\t\t\t} catch {\n\t\t\t\t\tthis.emit(\"error\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.child.stderr.resume();\n\t\tthis.child.on(\"error\", () => this.emit(\"error\"));\n\t\tthis.child.stdin.on(\"error\", () => this.emit(\"error\"));\n\t\tthis.closed = new Promise((resolve) => {\n\t\t\tthis.child.once(\"close\", () => {\n\t\t\t\tthis.emit(\"exit\");\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\tpostMessage(request) {\n\t\tthis.child.stdin.write(JSON.stringify(request) + \"\\n\");\n\t}\n\tasync terminate() {\n\t\tif (this.child.exitCode === null && this.child.signalCode === null) this.child.kill(\"SIGKILL\");\n\t\tawait this.closed;\n\t}\n};\n/** One worker per grep invocation; a deadline or abort terminates it before the failure is exposed. */\nvar IsolatedGrepSearch = class {\n\tpattern;\n\tsignal;\n\tworker = process.versions.bun ? new GrepProcessWorker() : new Worker(BOOTSTRAP, {\n\t\teval: true,\n\t\texecArgv: [],\n\t\tresourceLimits: {\n\t\t\tmaxOldGenerationSizeMb: 128,\n\t\t\tmaxYoungGenerationSizeMb: 32\n\t\t}\n\t});\n\tpending = /* @__PURE__ */ new Map();\n\tnextId = 0;\n\tstopped = false;\n\ttermination;\n\ttimer;\n\tabort = () => {\n\t\tthis.stop(/* @__PURE__ */ new Error(\"Grep search cancelled\"));\n\t};\n\tconstructor(pattern, signal) {\n\t\tthis.pattern = pattern;\n\t\tthis.signal = signal;\n\t\tthis.worker.on(\"message\", (message) => {\n\t\t\tconst pending = this.pending.get(message.id);\n\t\t\tif (!pending || this.stopped) return;\n\t\t\tthis.pending.delete(message.id);\n\t\t\tif (Array.isArray(message.matches) && message.matches.every((m) => typeof m === \"string\")) pending.resolve(message.matches);\n\t\t\telse pending.reject(new Error(message.error ?? \"Invalid grep worker response\"));\n\t\t});\n\t\tthis.worker.on(\"error\", () => {\n\t\t\tthis.stop(/* @__PURE__ */ new Error(\"Grep search worker failed\"));\n\t\t});\n\t\tthis.worker.once(\"exit\", () => {\n\t\t\tthis.stop(/* @__PURE__ */ new Error(\"Grep search worker exited\"));\n\t\t});\n\t\tthis.timer = setTimeout(() => {\n\t\t\tthis.stop(/* @__PURE__ */ new Error(\"Grep search timed out\"));\n\t\t}, 2e3);\n\t\tsignal?.addEventListener(\"abort\", this.abort, { once: true });\n\t\tif (signal?.aborted) this.abort();\n\t}\n\tsearch(content, filePath, contextLines, outputMode) {\n\t\tif (this.stopped) return Promise.reject(/* @__PURE__ */ new Error(this.signal?.aborted ? \"Grep search cancelled\" : \"Grep search timed out\"));\n\t\tconst id = this.nextId++;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.pending.set(id, {\n\t\t\t\tresolve,\n\t\t\t\treject\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tthis.worker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\tcontent,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tpattern: this.pattern,\n\t\t\t\t\tcontextLines,\n\t\t\t\t\toutputMode\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tthis.stop(/* @__PURE__ */ new Error(\"Grep search worker failed\"));\n\t\t\t}\n\t\t});\n\t}\n\tasync stop(error) {\n\t\tif (this.termination) return this.termination;\n\t\tthis.stopped = true;\n\t\tclearTimeout(this.timer);\n\t\tthis.signal?.removeEventListener(\"abort\", this.abort);\n\t\tthis.termination = (async () => {\n\t\t\ttry {\n\t\t\t\tawait this.worker.terminate();\n\t\t\t} catch {}\n\t\t\tfor (const pending of this.pending.values()) pending.reject(error ?? /* @__PURE__ */ new Error(\"Grep search stopped\"));\n\t\t\tthis.pending.clear();\n\t\t})();\n\t\treturn this.termination;\n\t}\n};\n//#endregion\n//#region src/builtins/grep-tool.ts\n/**\n* GrepTool — recursive regex content search.\n*\n* Supports three output modes:\n* - files_with_matches (default): return only file paths that contain a match\n* - content: return matching lines with optional context lines\n* - count: return per-file match counts as \"path:count\" rows\n*\n* headLimit caps the number of result lines; excess is truncated with a marker.\n*\n* SEC-007: when a containment root is configured the search is confined to it. Grep is the most\n* disclosing of the file tools — `content` mode returns the matching LINES — so it must be contained\n* at least as strictly as `Read`, which it could otherwise stand in for.\n*/\nconst GrepSchema = z.object({\n\tpattern: z.string().describe(\"The regular expression pattern to search for in file contents\"),\n\tpath: z.string().optional().describe(\"File or directory to search in. Defaults to the current working directory\"),\n\tglob: z.string().optional().describe(\"Glob pattern to filter files (e.g. \\\"*.ts\\\", \\\"*.{ts,tsx}\\\"). Only files matching this pattern will be searched\"),\n\tcontextLines: z.number().optional().describe(\"Number of context lines to show before and after each match. Only applies when outputMode is \\\"content\\\". Default: 0\"),\n\toutputMode: z.enum([\n\t\t\"files_with_matches\",\n\t\t\"content\",\n\t\t\"count\"\n\t]).optional().describe(\"Output mode: \\\"files_with_matches\\\" shows only file paths (default), \\\"content\\\" shows matching lines with context, \\\"count\\\" shows per-file match counts\"),\n\theadLimit: z.number().int().positive().optional().describe(\"Maximum number of result lines (file paths, content lines, or count rows) to return. Excess results are truncated with a marker line\")\n});\n/** The matcher consumes one file at a time; keep only a few reads outstanding. */\nconst READ_CONCURRENCY_LIMIT = 8;\nconst MAX_GREP_FILE_BYTES = 4 * 1024 * 1024;\nconst READ_CHUNK_BYTES = 64 * 1024;\n/** A grep isolation failure is a hard tool failure, distinct from ordinary no-match/invalid-input results. */\nvar GrepIsolationError = class extends ToolExecutionError {\n\treason;\n\tconstructor(reason) {\n\t\tsuper(`Grep search ${reason === \"timeout\" ? \"timed out\" : reason === \"cancelled\" ? \"cancelled\" : reason === \"limit\" ? \"exceeded its byte limit\" : \"worker failed\"}`, \"Grep\");\n\t\tthis.reason = reason;\n\t}\n};\nasync function grepFileTool(args, options) {\n\tconst { pattern, path: searchPath, glob, contextLines = 0, outputMode = \"files_with_matches\", headLimit } = args;\n\tconst containmentRoot = options.cwd;\n\tconst { root: targetPath, error: rootError } = resolveSearchRoot(searchPath, containmentRoot);\n\tif (rootError) return rootError;\n\ttry {\n\t\tnew RegExp(pattern);\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Invalid regex pattern: ${pattern}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tlet targetStat;\n\ttry {\n\t\ttargetStat = await stat(targetPath);\n\t} catch {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Path not found: ${targetPath}`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\tlet files;\n\tlet filesTruncated = false;\n\tif (targetStat.isFile()) files = [targetPath];\n\telse {\n\t\tconst collected = await collectFiles(targetPath, glob, containmentRoot);\n\t\tfiles = collected.files;\n\t\tfilesTruncated = collected.truncated;\n\t}\n\tconst search = new IsolatedGrepSearch(pattern, options.signal);\n\tconst readAbort = new AbortController();\n\tconst abortReads = () => readAbort.abort();\n\toptions.signal?.addEventListener(\"abort\", abortReads, { once: true });\n\tif (options.signal?.aborted) abortReads();\n\tlet perFileMatches;\n\ttry {\n\t\tif (readAbort.signal.aborted) throw new GrepIsolationError(\"cancelled\");\n\t\tconst orderedMatches = new Array(files.length);\n\t\tlet nextFile = 0;\n\t\tlet failure;\n\t\tconst readAndSearch = async (filePath) => {\n\t\t\tlet content;\n\t\t\ttry {\n\t\t\t\tif ((await stat(filePath)).size > MAX_GREP_FILE_BYTES) throw new GrepIsolationError(\"limit\");\n\t\t\t\tconst stream = createReadStream(filePath, {\n\t\t\t\t\thighWaterMark: READ_CHUNK_BYTES,\n\t\t\t\t\tsignal: readAbort.signal\n\t\t\t\t});\n\t\t\t\tconst chunks = [];\n\t\t\t\tlet bytes = 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor await (const chunk of stream) {\n\t\t\t\t\t\tif (readAbort.signal.aborted) throw new GrepIsolationError(\"cancelled\");\n\t\t\t\t\t\tconst buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);\n\t\t\t\t\t\tbytes += buffer.length;\n\t\t\t\t\t\tif (bytes > MAX_GREP_FILE_BYTES) throw new GrepIsolationError(\"limit\");\n\t\t\t\t\t\tchunks.push(buffer);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tstream.destroy();\n\t\t\t\t}\n\t\t\t\tconst buffer = Buffer.concat(chunks, bytes);\n\t\t\t\tconst checkLen = Math.min(buffer.length, 8192);\n\t\t\t\tlet hasBinary = false;\n\t\t\t\tfor (let i = 0; i < checkLen; i++) if (buffer[i] === 0) {\n\t\t\t\t\thasBinary = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (hasBinary) return [];\n\t\t\t\tcontent = buffer.toString(\"utf8\");\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof GrepIsolationError) throw error;\n\t\t\t\tif (readAbort.signal.aborted) throw new GrepIsolationError(\"cancelled\");\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn search.search(content, filePath, contextLines, outputMode);\n\t\t};\n\t\tconst worker = async () => {\n\t\t\twhile (failure === void 0 && nextFile < files.length) {\n\t\t\t\tconst index = nextFile++;\n\t\t\t\ttry {\n\t\t\t\t\torderedMatches[index] = await readAndSearch(files[index]);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (failure === void 0) {\n\t\t\t\t\t\tfailure = error;\n\t\t\t\t\t\treadAbort.abort();\n\t\t\t\t\t\tsearch.stop(error instanceof Error ? error : /* @__PURE__ */ new Error(\"Grep search failed\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tawait Promise.all(Array.from({ length: Math.min(READ_CONCURRENCY_LIMIT, files.length) }, worker));\n\t\tif (failure !== void 0) throw failure;\n\t\tperFileMatches = orderedMatches;\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"\";\n\t\tthrow error instanceof GrepIsolationError ? error : new GrepIsolationError(message.includes(\"timed out\") ? \"timeout\" : message.includes(\"cancelled\") ? \"cancelled\" : message.includes(\"byte limit\") ? \"limit\" : \"failed\");\n\t} finally {\n\t\toptions.signal?.removeEventListener(\"abort\", abortReads);\n\t\tawait search.stop();\n\t}\n\tlet outputBytes = 0;\n\tfor (const matches of perFileMatches) for (const match of matches) {\n\t\toutputBytes += Buffer.byteLength(match, \"utf8\") + 1;\n\t\tif (outputBytes > 4 * 1024 * 1024) throw new GrepIsolationError(\"limit\");\n\t}\n\tlet outputLines = perFileMatches.flat();\n\tif (headLimit !== void 0 && outputLines.length > headLimit) {\n\t\tconst truncatedCount = outputLines.length - headLimit;\n\t\toutputLines = [...outputLines.slice(0, headLimit), `(+${truncatedCount} more results truncated by headLimit)`];\n\t}\n\tif (filesTruncated) outputLines = [...outputLines, `[File enumeration stopped early; the search tree has more files than this tool scans in one call. Results may be incomplete — narrow the path or glob.]`];\n\tconst result = {\n\t\tsuccess: true,\n\t\toutput: outputLines.length > 0 ? outputLines.join(\"\\n\") : \"(no matches)\"\n\t};\n\treturn JSON.stringify(result);\n}\n/** The registered name of the shell tool this package's default assembly ships (NEUT-002). */\nconst DEFAULT_SHELL_TOOL_NAME = \"Shell\";\n/** Build the default description, referencing the actually-registered shell tool by name. */\nfunction buildGrepDescription(shellToolName) {\n\treturn `A powerful search tool built on regex matching.\\n\\nSupports full regex syntax (e.g., 'log.*Error', 'function\\\\\\\\s+\\\\\\\\w+'). Filter files with glob parameter (e.g., '*.js', '**/*.tsx').\\n\\nOutput modes: 'content' shows matching lines with context, 'files_with_matches' shows only file paths (default), 'count' shows per-file match counts.\\n\\nPrefer this tool over running grep or rg through the ${shellToolName} tool — it returns structured results directly.\\n\\nUse headLimit to control result size and save context space.`;\n}\n/**\n* Create a GrepTool instance — register with agent tools registry.\n*/\nfunction createGrepTool(options) {\n\treturn createZodFunctionTool(\"Grep\", options.description ?? buildGrepDescription(options.shellToolName ?? DEFAULT_SHELL_TOOL_NAME), GrepSchema, async (params) => {\n\t\treturn grepFileTool(params, options);\n\t});\n}\n//#endregion\n//#region src/builtins/web-fetch-tool.ts\n/**\n* WebFetchTool — fetch a URL and return its content as text.\n*\n* HTML is stripped to plain text for readability. Fetches through the shared egress boundary\n* (`fetchWithEgressPolicy`, #2026): loopback / private / link-local / metadata destinations are\n* refused, redirects are re-validated, and the response is capped while streaming.\n*/\nconst DEFAULT_TIMEOUT_MS$1 = 3e4;\nconst MAX_RESPONSE_BYTES = 5e6;\nconst WebFetchSchema = z.object({\n\turl: z.string().describe(\"The URL to fetch\"),\n\theaders: z.record(z.string()).optional().describe(\"Optional HTTP headers as key-value pairs\")\n});\n/**\n* Remove every `<tag>…</tag>` element — the linear equivalent of `replace(/<tag[\\s\\S]*?<\\/tag>/gi, '')`.\n*\n* The regex form is quadratic: every `<tag` with no closing tag after it rescans to end of input, and the scan\n* then restarts at the next one. `htmlToText`'s input is a **response body from an arbitrary URL**, capped only\n* at {@link MAX_RESPONSE_BYTES} (5 MB) — 5 MB of `<script` would have taken minutes. Because the closing tag is\n* searched forward, its absence at one opener means no later opener can have one either, so the scan stops.\n*\n* Case folding is `[A-Z]`-only, not `toLowerCase()`: `toLowerCase()` can change a string's LENGTH (U+0130\n* lowercases to two code units), which would desynchronise the indices from the original text.\n*/\nfunction stripElement(html, tag) {\n\tconst openTag = `<${tag}`;\n\tconst closeTag = `</${tag}>`;\n\tconst haystack = html.replace(/[A-Z]/g, (c) => c.toLowerCase());\n\tconst parts = [];\n\tlet cursor = 0;\n\tfor (;;) {\n\t\tconst open = haystack.indexOf(openTag, cursor);\n\t\tif (open < 0) break;\n\t\tconst close = haystack.indexOf(closeTag, open + openTag.length);\n\t\tif (close < 0) break;\n\t\tparts.push(html.slice(cursor, open));\n\t\tcursor = close + closeTag.length;\n\t}\n\tparts.push(html.slice(cursor));\n\treturn parts.join(\"\");\n}\n/**\n* Replace every `<…>` tag with a space — the linear equivalent of `replace(/<[^>]+>/g, ' ')`.\n*\n* Same defect, same input: `[^>]+` cannot cross a `>`, so a `<` with no `>` after it consumed the rest of the\n* document and then backtracked over it, once per `<`. A page of 200 K `<` characters took 12.6 s; the 5 MB the\n* fetch allows would have taken hours. `close === open + 1` reproduces the regex's `+` (a tag body must be at\n* least one character), so a literal `<>` is left in the text exactly as before.\n*/\nfunction stripTags(html) {\n\tconst parts = [];\n\tlet cursor = 0;\n\tfor (;;) {\n\t\tconst open = html.indexOf(\"<\", cursor);\n\t\tif (open < 0) break;\n\t\tconst close = html.indexOf(\">\", open + 1);\n\t\tif (close < 0) break;\n\t\tif (close === open + 1) {\n\t\t\tparts.push(html.slice(cursor, open + 1));\n\t\t\tcursor = open + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tparts.push(html.slice(cursor, open), \" \");\n\t\tcursor = close + 1;\n\t}\n\tparts.push(html.slice(cursor));\n\treturn parts.join(\"\");\n}\n/**\n* The character entities {@link htmlToText} decodes, and the single alternation that matches them.\n*\n* SEC-004 (`js/double-escaping`): decoding these by CHAINED `.replace()` calls with `&amp;` first\n* decodes twice. `&amp;lt;` — how a page encodes the literal text `&lt;` so a browser DISPLAYS it —\n* became `&lt;` after the `&amp;` pass and then `<` after the `&lt;` pass, so a page reading\n* `&amp;lt;script&amp;gt;` came back out of a tag-stripping converter as `<script>`. One pass over\n* one alternation decodes each entity exactly once and never rescans its own output, so the decoder\n* is the inverse of the encoder for every input rather than only for singly-encoded ones.\n*/\nconst HTML_ENTITIES = {\n\t\"&amp;\": \"&\",\n\t\"&lt;\": \"<\",\n\t\"&gt;\": \">\",\n\t\"&quot;\": \"\\\"\",\n\t\"&#39;\": \"'\",\n\t\"&nbsp;\": \" \"\n};\nconst HTML_ENTITY_PATTERN = /&(?:amp|lt|gt|quot|nbsp|#39);/g;\n/** Strip HTML tags and decode common entities to produce readable text. */\nfunction htmlToText(html) {\n\treturn stripTags(stripElement(stripElement(html, \"script\"), \"style\")).replace(HTML_ENTITY_PATTERN, (entity) => HTML_ENTITIES[entity]).replace(/\\s+/g, \" \").trim();\n}\nfunction classifyFetchError(err) {\n\tif (!(err instanceof Error)) return String(err);\n\tif (err.name === \"AbortError\") return `Request timed out after ${DEFAULT_TIMEOUT_MS$1 / 1e3}s. The server did not respond in time.`;\n\tconst code = err.code;\n\tif (code === \"ENOTFOUND\" || code === \"EAI_AGAIN\") return `Network error: DNS resolution failed for this host. The URL may be incorrect or the host does not exist. Do not retry with the same URL.`;\n\tif (code === \"ECONNREFUSED\") return `Network error: Connection refused. The server is not accepting connections at this address. Do not retry with the same URL.`;\n\tif (code === \"ECONNRESET\") return `Network error: Connection was reset by the server. The server may be temporarily unavailable.`;\n\tif (code === \"ETIMEDOUT\") return `Network error: Connection timed out. The server is not reachable within the expected time.`;\n\tif (code === \"CERT_HAS_EXPIRED\" || code === \"UNABLE_TO_VERIFY_LEAF_SIGNATURE\") return `Network error: SSL certificate error (${code}). The server's certificate is invalid. Do not retry with the same URL.`;\n\treturn `Network error: ${err.message} Check that the URL is correct and the server is reachable.`;\n}\nasync function runWebFetch(args, egress, userAgent, signal) {\n\tconst { url, headers } = args;\n\ttry {\n\t\tnew URL(url);\n\t} catch {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: `Invalid URL: \"${url}\". Fix the URL format before retrying.`\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n\ttry {\n\t\tconst response = await fetchWithEgressPolicy(url, {\n\t\t\theaders: {\n\t\t\t\t...userAgent === void 0 ? {} : { \"User-Agent\": userAgent },\n\t\t\t\t...headers ?? {}\n\t\t\t},\n\t\t\tsignal,\n\t\t\ttimeoutMs: DEFAULT_TIMEOUT_MS$1,\n\t\t\tmaxResponseBytes: MAX_RESPONSE_BYTES\n\t\t}, egress.policy, egress.deps);\n\t\tif (!response.ok) {\n\t\t\tconst { rejection } = response;\n\t\t\tconst result = {\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: \"\",\n\t\t\t\terror: rejection.reason === \"response_too_large\" ? `Response too large (max ${MAX_RESPONSE_BYTES} bytes). Consider fetching a more specific URL or a paginated endpoint.` : `Blocked by egress policy: ${rejection.message} Do not retry with the same URL.`\n\t\t\t};\n\t\t\treturn JSON.stringify(result);\n\t\t}\n\t\tif (response.status < 200 || response.status >= 300) {\n\t\t\tconst retryHint = response.status >= 500 ? \" The server is temporarily unavailable — retrying may help.\" : \" Do not retry with the same URL.\";\n\t\t\tconst result = {\n\t\t\t\tsuccess: false,\n\t\t\t\toutput: \"\",\n\t\t\t\terror: `HTTP ${response.status} ${response.statusText}.${retryHint}`\n\t\t\t};\n\t\t\treturn JSON.stringify(result);\n\t\t}\n\t\tconst contentType = response.headers.get(\"content-type\") ?? \"\";\n\t\tlet text = new TextDecoder().decode(response.body);\n\t\tif (contentType.includes(\"html\")) text = htmlToText(text);\n\t\treturn JSON.stringify({\n\t\t\tsuccess: true,\n\t\t\toutput: text\n\t\t});\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: classifyFetchError(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n}\nconst DEFAULT_WEB_FETCH_DESCRIPTION = \"Fetch a URL and return its content as text. HTML pages are converted to plain text.\";\n/**\n* Create a WebFetchTool instance — register with agent tools registry.\n*/\nfunction createWebFetchTool(options = {}) {\n\tconst egress = options.egress ?? {};\n\treturn createZodFunctionTool(\"WebFetch\", options.description ?? DEFAULT_WEB_FETCH_DESCRIPTION, WebFetchSchema, async (params, context) => runWebFetch(params, egress, options.userAgent, context?.signal));\n}\n/**\n* WebFetchTool instance — register with agent tools registry.\n*/\nconst webFetchTool = createWebFetchTool();\n//#endregion\n//#region src/builtins/brave-search-provider.ts\nconst BRAVE_SEARCH_ENDPOINT = \"https://api.search.brave.com/res/v1/web/search\";\n/** Brave caps `count` at 20 per request. */\nconst BRAVE_MAX_COUNT = 20;\n/**\n* Create the Brave Search provider. Throws from `search()` when `BRAVE_API_KEY` is not set or\n* the API responds with an error — the tool layer surfaces the message as a structured result.\n*/\nfunction createBraveSearchProvider() {\n\treturn { async search({ query, limit }, signal) {\n\t\tconst apiKey = process.env[\"BRAVE_API_KEY\"];\n\t\tif (!apiKey) throw new Error(\"Web search requires BRAVE_API_KEY environment variable for the default Brave Search provider, or inject a custom search provider at the composition root.\");\n\t\tconst params = new URLSearchParams({\n\t\t\tq: query,\n\t\t\tcount: String(Math.min(limit, BRAVE_MAX_COUNT))\n\t\t});\n\t\tconst response = await fetch(`${BRAVE_SEARCH_ENDPOINT}?${params}`, {\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Accept-Encoding\": \"gzip\",\n\t\t\t\t\"X-Subscription-Token\": apiKey\n\t\t\t},\n\t\t\t...signal ? { signal } : {}\n\t\t});\n\t\tif (!response.ok) throw new Error(`Brave Search API error: HTTP ${response.status} ${response.statusText}`);\n\t\treturn ((await response.json()).web?.results ?? []).map((r) => ({\n\t\t\ttitle: r.title,\n\t\t\turl: r.url,\n\t\t\tsnippet: r.description\n\t\t}));\n\t} };\n}\n//#endregion\n//#region src/builtins/web-search-tool.ts\n/**\n* WebSearchTool — search the web and return results.\n*\n* Vendor-free tool layer (NEUT-008): composes over the duck-typed `IWebSearchProvider` port.\n* The default provider is the vendor-specific default adapter wired at creation time; a custom\n* provider is injected via `createWebSearchTool({ provider })`. Provider failures (missing\n* configuration, HTTP/network errors) are thrown by the provider and surfaced here as\n* structured error results.\n*/\nconst DEFAULT_LIMIT = 10;\nconst DEFAULT_TIMEOUT_MS = 15e3;\nconst DEFAULT_WEB_SEARCH_DESCRIPTION = \"Search the web and return results with title, URL, and snippet.\";\nconst WebSearchSchema = z.object({\n\tquery: z.string().describe(\"The search query\"),\n\tlimit: z.number().optional().describe(`Maximum number of results to return (default: ${DEFAULT_LIMIT})`)\n});\nasync function runWebSearch(args, provider, signal) {\n\tconst { query, limit = DEFAULT_LIMIT } = args;\n\ttry {\n\t\tconst controller = new AbortController();\n\t\tconst timeout = setTimeout(() => controller.abort(), DEFAULT_TIMEOUT_MS);\n\t\tconst searchSignal = signal ? AbortSignal.any([controller.signal, signal]) : controller.signal;\n\t\ttry {\n\t\t\tconst results = await provider.search({\n\t\t\t\tquery,\n\t\t\t\tlimit\n\t\t\t}, searchSignal);\n\t\t\tconst result = {\n\t\t\t\tsuccess: true,\n\t\t\t\toutput: JSON.stringify(results, null, 2)\n\t\t\t};\n\t\t\treturn JSON.stringify(result);\n\t\t} finally {\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t} catch (err) {\n\t\tconst result = {\n\t\t\tsuccess: false,\n\t\t\toutput: \"\",\n\t\t\terror: err instanceof Error ? err.message : String(err)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t}\n}\n/**\n* Create a WebSearchTool instance — register with agent tools registry.\n*/\nfunction createWebSearchTool(options = {}) {\n\tconst provider = options.provider ?? createBraveSearchProvider();\n\treturn createZodFunctionTool(\"WebSearch\", options.description ?? DEFAULT_WEB_SEARCH_DESCRIPTION, WebSearchSchema, async (params, context) => runWebSearch(params, provider, context?.signal));\n}\n/**\n* WebSearchTool instance — register with agent tools registry.\n*/\nconst webSearchTool = createWebSearchTool();\n//#endregion\n//#region src/builtins/ask-user-question-tool.ts\n/**\n* AskUserQuestionTool — let the model ask the user structured questions mid-turn (CMD-005).\n*\n* Built on the CMD-004 ask seam: each question maps onto the `IActionRequest` SSOT and is issued\n* through the injected `IToolExecutionContext.ask` port; the attached environment renders it (Ink\n* dialog, web modal, programmatic pre-answer) and the answers return as the tool result.\n*\n* Contract points (spec CMD-005):\n* - 1–4 questions per call, asked sequentially (the channel's ask queue renders one at a time).\n* - Cancellation is data, not an exception: a dismissed question yields `{ cancelled: true }` and the\n* remaining unasked questions of the same call are marked cancelled too (no per-item re-prompt).\n* - No `context.ask` (headless/automation): returns `{ unavailable: true, reason }` — never a silent\n* guess, never a thrown error, so the model can continue autonomously.\n*/\nconst MAX_QUESTIONS = 4;\nconst QuestionSchema = z.object({\n\tquestion: z.string().min(1).describe(\"The complete question to ask the user.\"),\n\theader: z.string().optional().describe(\"Very short topic label for the question (e.g. \\\"Auth method\\\").\"),\n\toptions: z.array(z.union([z.string().min(1).describe(\"Display text of this choice.\"), z.object({\n\t\tlabel: z.string().min(1).describe(\"Display text of this choice.\"),\n\t\tdescription: z.string().optional().describe(\"What choosing this option means.\")\n\t})])).optional().describe(\"Predefined choices (strings or {label, description}). Omit for pure free text.\"),\n\tmultiSelect: z.boolean().optional().describe(\"Allow selecting multiple options (default: single select).\"),\n\tallowFreeText: z.boolean().optional().describe(\"Allow a typed custom answer besides the options (default: true).\")\n});\nconst AskUserQuestionSchema = z.object({ questions: z.array(QuestionSchema).min(1).max(MAX_QUESTIONS).describe(`Questions to ask the user (1-${MAX_QUESTIONS}), rendered one at a time.`) });\nconst ASK_USER_QUESTION_DESCRIPTION = [\n\t\"Ask the user one or more structured questions and wait for their answers.\",\n\t\"\",\n\t\"Use this when you are blocked on a decision only the user can make — ambiguous requirements,\",\n\t\"mutually exclusive approaches, or choices with real trade-offs. Do not use it for decisions with\",\n\t\"a conventional default or facts you can verify yourself.\",\n\t\"\",\n\t`Provide 1-${MAX_QUESTIONS} questions. Each question offers predefined options and/or free text:`,\n\t\" - options + default: user picks one option (or types a custom answer unless allowFreeText: false)\",\n\t\" - multiSelect: true: user may pick several options\",\n\t\" - no options: pure free-text entry\",\n\t\"\",\n\t\"The result is a JSON array with one entry per question: the selected option labels in `values`\",\n\t\"and/or the typed answer in `text`, or `cancelled: true` if the user dismissed the question.\",\n\t\"If no interactive user is attached (headless run), the result is `{ unavailable: true }` —\",\n\t\"continue autonomously with your best judgment and say what you assumed.\"\n].join(\"\\n\");\nfunction toActionRequest(question) {\n\tconst options = (question.options ?? []).map((option) => typeof option === \"string\" ? { label: option } : option);\n\tconst multi = question.multiSelect === true && options.length > 1;\n\treturn {\n\t\tid: `ask_${randomUUID()}`,\n\t\ttitle: question.question,\n\t\t...question.header !== void 0 ? { description: question.header } : {},\n\t\t...options.length > 0 ? { options: options.map((o) => ({\n\t\t\tvalue: o.label,\n\t\t\tlabel: o.label,\n\t\t\t...o.description !== void 0 ? { description: o.description } : {}\n\t\t})) } : {},\n\t\tminSelect: options.length > 0 ? 1 : 0,\n\t\tmaxSelect: multi ? options.length : 1,\n\t\tallowFreeText: question.allowFreeText !== false || options.length === 0\n\t};\n}\nasync function askQuestions(args, ask) {\n\tconst answers = [];\n\tlet dismissed = false;\n\tfor (const question of args.questions) {\n\t\tif (dismissed) {\n\t\t\tanswers.push({\n\t\t\t\tquestion: question.question,\n\t\t\t\tcancelled: true\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst response = await ask(toActionRequest(question));\n\t\tif (response.type === \"cancelled\") {\n\t\t\tdismissed = true;\n\t\t\tanswers.push({\n\t\t\t\tquestion: question.question,\n\t\t\t\tcancelled: true\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tanswers.push({\n\t\t\tquestion: question.question,\n\t\t\tvalues: [...response.values],\n\t\t\t...response.text !== void 0 ? { text: response.text } : {}\n\t\t});\n\t}\n\treturn { answers };\n}\n/**\n* Create an `AskUserQuestion` tool instance — register with the agent tools registry.\n*/\nfunction createAskUserQuestionTool(options = {}) {\n\treturn createZodFunctionTool(\"AskUserQuestion\", options.description ?? ASK_USER_QUESTION_DESCRIPTION, AskUserQuestionSchema, async (params, context) => {\n\t\tconst args = params;\n\t\tconst ask = context?.ask;\n\t\tconst output = ask ? await askQuestions(args, ask) : {\n\t\t\tunavailable: true,\n\t\t\treason: \"no interactive user attached\"\n\t\t};\n\t\tconst result = {\n\t\t\tsuccess: true,\n\t\t\toutput: JSON.stringify(output)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t});\n}\n/** `AskUserQuestion` tool instance — register with the agent tools registry. */\nconst askUserQuestionTool = createAskUserQuestionTool();\n//#endregion\n//#region src/builtins/tool-search-matching.ts\n/** Both vendors default a tool search to five results; so does this one. */\nconst DEFAULT_TOOL_SEARCH_LIMIT = 5;\n/**\n* Where a query matched, lowest first — the primary sort key.\n*\n* A tool whose NAME the query names is a better answer than one that merely mentions it in a\n* parameter description, and saying so is what makes \"the top five\" meaningful once a catalog is\n* large enough for the limit to bite.\n*/\nconst RANK_EXACT_NAME = 0;\nconst RANK_NAME = 1;\nconst RANK_DESCRIPTION = 2;\nconst RANK_PARAMETER = 3;\n/** Not a match at all — filtered out rather than ranked last. */\nconst RANK_NONE = Number.POSITIVE_INFINITY;\n/** Every parameter name and description in a schema, including nested nodes. */\nfunction collectParameterText(node, into) {\n\tif (node.description !== void 0) into.push(node.description);\n\tfor (const [name, child] of Object.entries(node.properties ?? {})) {\n\t\tinto.push(name);\n\t\tcollectParameterText(child, into);\n\t}\n\tif (node.items !== void 0) collectParameterText(node.items, into);\n\tfor (const branch of node.anyOf ?? []) collectParameterText(branch, into);\n}\nfunction rankMatch(schema, query) {\n\tconst name = schema.name.toLowerCase();\n\tif (name === query) return RANK_EXACT_NAME;\n\tif (name.includes(query)) return RANK_NAME;\n\tif (schema.description.toLowerCase().includes(query)) return RANK_DESCRIPTION;\n\tconst parameterText = [];\n\tcollectParameterText(schema.parameters, parameterText);\n\tif (parameterText.some((text) => text.toLowerCase().includes(query))) return RANK_PARAMETER;\n\treturn RANK_NONE;\n}\n/**\n* The tools a query selects, best match first and capped at `limit`.\n*\n* Ordering is total and deterministic: rank first, then name, so two tools that matched the same way\n* never trade places between calls. An empty query string matches nothing rather than everything —\n* \"search for nothing\" is a question with an empty answer, not a request for the whole catalog.\n*/\nfunction matchDeferredTools(schemas, query, limit) {\n\tconst needle = query.trim().toLowerCase();\n\tif (needle.length === 0) return [];\n\treturn schemas.map((schema) => ({\n\t\tschema,\n\t\trank: rankMatch(schema, needle)\n\t})).filter((entry) => entry.rank !== RANK_NONE).sort((a, b) => a.rank - b.rank || (a.schema.name < b.schema.name ? -1 : 1)).slice(0, limit).map((entry) => entry.schema);\n}\n//#endregion\n//#region src/builtins/tool-search-tool.ts\n/**\n* ToolSearch — the model-facing half of client-side tool deferral (CLI-1990 § Solution 4).\n*\n* A tool that declares `deferLoading` is withheld from the request entirely while the tool-search\n* policy is engaged, so the model never sees its schema. This tool is how the model gets it back:\n* it searches the withheld catalog by query, or loads an exact list by name, and the runtime marks\n* the matches loaded — so the NEXT round's `tools` array carries their full definitions and they\n* stay callable for the rest of the session.\n*\n* Deliberately an ordinary function tool rather than a vendor block. Anthropic and OpenAI each ship\n* a server-side tool search, but neither reduces the request payload (the API needs every definition\n* to run the search), Gemini has no equivalent at all, and both vendors document a client-executed\n* search as the portable form. One shape therefore runs everywhere and saves both wire bytes and\n* context tokens.\n*\n* Two results are NOT errors, and the distinction is the contract:\n* - a query that matches nothing returns `{ loaded: [], unavailableSources: [] }` — a normal empty\n* answer, mirroring the vendor's own empty `tool_references` array;\n* - an unknown entry in `names` throws, naming the entry, and loads nothing — asking for a tool that\n* does not exist is a mistake to correct, not an empty search.\n*\n* `unavailableSources` is present and empty from day one. MCP-003 (the connection and capability\n* supervisor) fills it with servers that failed or need auth, so a model told \"nothing matched\" can\n* tell that apart from \"the server holding it is down\" — without a contract change here.\n*/\n/**\n* The registered name — agent-core's own constant, re-exported under this package's name so the\n* execution layer's unknown-tool remedy and this tool can never name two different things.\n*/\nconst TOOL_SEARCH_NAME = TOOL_SEARCH_TOOL_NAME;\nconst ToolSearchSchema = z.object({\n\tquery: z.string().optional().describe(\"Text matched case-insensitively against each withheld tool's name, description, and its parameters' names and descriptions. An exact tool name is a valid query.\"),\n\tnames: z.array(z.string().min(1)).optional().describe(\"Exact tool names to load, skipping the search. An unknown name is an error naming it.\"),\n\tlimit: z.number().int().positive().optional().describe(`Maximum tools to load from a query match (default 5).`)\n});\nconst TOOL_SEARCH_DESCRIPTION = [\n\t\"Load tools whose definitions are withheld from your tool list, so you can call them.\",\n\t\"\",\n\t\"Some tools are deferred: they exist and are callable, but their schemas are not sent to you until\",\n\t\"you load them here. If a capability you need is not in your tool list, search for it before\",\n\t\"concluding it is unavailable — and if a tool call fails as \\\"deferred and not yet loaded\\\", load it\",\n\t\"with this tool and call it again.\",\n\t\"\",\n\t\" - query: what you are trying to do (e.g. \\\"read a spreadsheet\\\", \\\"postgres\\\"). Matched against tool\",\n\t\" names, descriptions, and parameter names and descriptions. An exact tool name works too.\",\n\t` - names: load exactly these tools, skipping the search. Unknown names are an error.`,\n\t` - limit: how many matches to load (default 5).`,\n\t\"\",\n\t\"The result lists what is now loaded; those tools appear in your tool list from your next turn and\",\n\t\"stay available. A query that matches nothing returns an empty list — that is a normal answer, not\",\n\t\"a failure. `unavailableSources` names any tool source that could not be consulted.\"\n].join(\"\\n\");\n/**\n* The catalog the runtime injects, or a thrown wiring error.\n*\n* Its absence is not a runtime condition to degrade around: `ToolExecutionService` attaches this\n* port to every tool call it issues, so a missing one means this tool was invoked outside the\n* execution loop. Guessing an empty catalog there would report \"nothing matched\" for a search that\n* was never actually run.\n*/\nfunction requireCatalog(context) {\n\tconst catalog = context?.deferredTools;\n\tif (!catalog) throw new Error(`${TOOL_SEARCH_NAME} requires the deferred-tool catalog, which the execution runtime injects; it was not present, so this tool was called outside the agent execution loop.`);\n\treturn catalog;\n}\n/** Which schemas this call loads: the exact `names`, else the query's ranked matches. */\nfunction selectTools(args, catalog) {\n\tif (args.names !== void 0) return catalog.loadDeferredTools(args.names);\n\tif (args.query === void 0) throw new Error(`${TOOL_SEARCH_NAME} needs either \"query\" to search for tools or \"names\" to load exact ones.`);\n\tconst matches = matchDeferredTools(catalog.listDeferredTools(), args.query, args.limit ?? 5);\n\treturn catalog.loadDeferredTools(matches.map((schema) => schema.name));\n}\n/**\n* Create a `ToolSearch` tool instance — register it RESIDENT with the agent's tool registry.\n*\n* It must never itself be deferred: a search tool the model cannot see is a catalog with no way in,\n* which is the state the vendor's own \"at least one tool must stay resident\" invariant forbids.\n*/\nfunction createToolSearchTool(options = {}) {\n\treturn createZodFunctionTool(TOOL_SEARCH_NAME, options.description ?? TOOL_SEARCH_DESCRIPTION, ToolSearchSchema, async (params, context) => {\n\t\tconst output = {\n\t\t\tloaded: selectTools(params, requireCatalog(context)).map(({ name, description }) => ({\n\t\t\t\tname,\n\t\t\t\tdescription\n\t\t\t})),\n\t\t\tunavailableSources: []\n\t\t};\n\t\tconst result = {\n\t\t\tsuccess: true,\n\t\t\toutput: JSON.stringify(output)\n\t\t};\n\t\treturn JSON.stringify(result);\n\t});\n}\n/** `ToolSearch` tool instance — register with the agent tools registry. */\nconst toolSearchTool = createToolSearchTool();\n//#endregion\nexport { DEFAULT_OS_SANDBOX_SETTINGS, DEFAULT_TOOL_SEARCH_LIMIT, E2BSandboxClient, GrepIsolationError, InMemorySandboxClient, OsSandboxClient, PageComputerDriver, REPO_MAP_INDEX_VERSION, ReadByteLimitError, ReadCancelledError, RepoMapRetrievalAdapter, TOOL_SEARCH_NAME, applyWorkspaceManifest, askUserQuestionTool, bubblewrapArguments, buildRepoMapIndex, createAskUserQuestionTool, createBashTool, createBraveSearchProvider, createComputerActTool, createComputerTool, createComputerViewTool, createEditTool, createFunctionTool, createGlobTool, createGrepTool, createReadTool, createRetrievalTool, createShellTool, createToolSearchTool, createWebFetchTool, createWebSearchTool, createWriteTool, createZodFunctionTool, describeExecutionContainment, deserializeRepoMapIndex, detectOsSandbox, matchDeferredTools, protectedWorkspaceEntries, routesFilesThroughSandbox, seatbeltProfile, serializeRepoMapIndex, toolSearchTool, updateRepoMapIndex, validateWorkspaceManifestPath, webFetchTool, webSearchTool };\n\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],"mappings":"2yCAA+C,MAAM,GAAE,IAAI,GAAE,QAAQ,WAAW,QAAQ,SAAS,GAAE,EAAE,CAAC,OAAO,EAAE,WAAW,MAAM,EAAE,aAAa,IAAI,CAAC,SAAS,GAAE,EAAE,EAA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