@vypdev/copilot 3.10.1 → 3.10.3

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.
@@ -2140,7 +2140,7 @@ exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
2140
2140
  exports.getProxyFetch = getProxyFetch;
2141
2141
  exports.getApiBaseUrl = getApiBaseUrl;
2142
2142
  const httpClient = __importStar(__nccwpck_require__(75784));
2143
- const undici_1 = __nccwpck_require__(18381);
2143
+ const undici_1 = __nccwpck_require__(31241);
2144
2144
  function getAuthString(token, options) {
2145
2145
  if (!token && !options.auth) {
2146
2146
  throw new Error('Parameter token or opts.auth is required');
@@ -2392,7 +2392,7 @@ const http = __importStar(__nccwpck_require__(13685));
2392
2392
  const https = __importStar(__nccwpck_require__(95687));
2393
2393
  const pm = __importStar(__nccwpck_require__(34583));
2394
2394
  const tunnel = __importStar(__nccwpck_require__(64249));
2395
- const undici_1 = __nccwpck_require__(18381);
2395
+ const undici_1 = __nccwpck_require__(31241);
2396
2396
  var HttpCodes;
2397
2397
  (function (HttpCodes) {
2398
2398
  HttpCodes[HttpCodes["OK"] = 200] = "OK";
@@ -8504,34 +8504,34 @@ exports.debug = debug; // for test
8504
8504
 
8505
8505
  /***/ }),
8506
8506
 
8507
- /***/ 18381:
8507
+ /***/ 31241:
8508
8508
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
8509
8509
 
8510
8510
  "use strict";
8511
8511
 
8512
8512
 
8513
- const Client = __nccwpck_require__(85849)
8514
- const Dispatcher = __nccwpck_require__(66071)
8515
- const Pool = __nccwpck_require__(80229)
8516
- const BalancedPool = __nccwpck_require__(68255)
8517
- const Agent = __nccwpck_require__(73274)
8518
- const ProxyAgent = __nccwpck_require__(87187)
8519
- const EnvHttpProxyAgent = __nccwpck_require__(29941)
8520
- const RetryAgent = __nccwpck_require__(55184)
8521
- const errors = __nccwpck_require__(35990)
8522
- const util = __nccwpck_require__(50011)
8513
+ const Client = __nccwpck_require__(6237)
8514
+ const Dispatcher = __nccwpck_require__(32171)
8515
+ const Pool = __nccwpck_require__(49771)
8516
+ const BalancedPool = __nccwpck_require__(88214)
8517
+ const Agent = __nccwpck_require__(1880)
8518
+ const ProxyAgent = __nccwpck_require__(57912)
8519
+ const EnvHttpProxyAgent = __nccwpck_require__(42547)
8520
+ const RetryAgent = __nccwpck_require__(42626)
8521
+ const errors = __nccwpck_require__(47926)
8522
+ const util = __nccwpck_require__(31014)
8523
8523
  const { InvalidArgumentError } = errors
8524
- const api = __nccwpck_require__(20617)
8525
- const buildConnector = __nccwpck_require__(41429)
8526
- const MockClient = __nccwpck_require__(4227)
8527
- const MockAgent = __nccwpck_require__(46432)
8528
- const MockPool = __nccwpck_require__(36575)
8529
- const mockErrors = __nccwpck_require__(19329)
8530
- const RetryHandler = __nccwpck_require__(64524)
8531
- const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(19405)
8532
- const DecoratorHandler = __nccwpck_require__(41738)
8533
- const RedirectHandler = __nccwpck_require__(64014)
8534
- const createRedirectInterceptor = __nccwpck_require__(40928)
8524
+ const api = __nccwpck_require__(39663)
8525
+ const buildConnector = __nccwpck_require__(63447)
8526
+ const MockClient = __nccwpck_require__(69636)
8527
+ const MockAgent = __nccwpck_require__(89937)
8528
+ const MockPool = __nccwpck_require__(40660)
8529
+ const mockErrors = __nccwpck_require__(33519)
8530
+ const RetryHandler = __nccwpck_require__(12671)
8531
+ const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(53139)
8532
+ const DecoratorHandler = __nccwpck_require__(59280)
8533
+ const RedirectHandler = __nccwpck_require__(90008)
8534
+ const createRedirectInterceptor = __nccwpck_require__(91467)
8535
8535
 
8536
8536
  Object.assign(Dispatcher.prototype, api)
8537
8537
 
@@ -8549,10 +8549,10 @@ module.exports.DecoratorHandler = DecoratorHandler
8549
8549
  module.exports.RedirectHandler = RedirectHandler
8550
8550
  module.exports.createRedirectInterceptor = createRedirectInterceptor
8551
8551
  module.exports.interceptors = {
8552
- redirect: __nccwpck_require__(74872),
8553
- retry: __nccwpck_require__(79637),
8554
- dump: __nccwpck_require__(12493),
8555
- dns: __nccwpck_require__(20346)
8552
+ redirect: __nccwpck_require__(42182),
8553
+ retry: __nccwpck_require__(17389),
8554
+ dump: __nccwpck_require__(9408),
8555
+ dns: __nccwpck_require__(26290)
8556
8556
  }
8557
8557
 
8558
8558
  module.exports.buildConnector = buildConnector
@@ -8614,7 +8614,7 @@ function makeDispatcher (fn) {
8614
8614
  module.exports.setGlobalDispatcher = setGlobalDispatcher
8615
8615
  module.exports.getGlobalDispatcher = getGlobalDispatcher
8616
8616
 
8617
- const fetchImpl = (__nccwpck_require__(78329).fetch)
8617
+ const fetchImpl = (__nccwpck_require__(87321).fetch)
8618
8618
  module.exports.fetch = async function fetch (init, options = undefined) {
8619
8619
  try {
8620
8620
  return await fetchImpl(init, options)
@@ -8626,39 +8626,39 @@ module.exports.fetch = async function fetch (init, options = undefined) {
8626
8626
  throw err
8627
8627
  }
8628
8628
  }
8629
- module.exports.Headers = __nccwpck_require__(10561).Headers
8630
- module.exports.Response = __nccwpck_require__(51132).Response
8631
- module.exports.Request = __nccwpck_require__(83211).Request
8632
- module.exports.FormData = __nccwpck_require__(62598).FormData
8629
+ module.exports.Headers = __nccwpck_require__(33924).Headers
8630
+ module.exports.Response = __nccwpck_require__(63042).Response
8631
+ module.exports.Request = __nccwpck_require__(11192).Request
8632
+ module.exports.FormData = __nccwpck_require__(59550).FormData
8633
8633
  module.exports.File = globalThis.File ?? (__nccwpck_require__(72254).File)
8634
- module.exports.FileReader = __nccwpck_require__(65153).FileReader
8634
+ module.exports.FileReader = __nccwpck_require__(62596).FileReader
8635
8635
 
8636
- const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(13924)
8636
+ const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(22407)
8637
8637
 
8638
8638
  module.exports.setGlobalOrigin = setGlobalOrigin
8639
8639
  module.exports.getGlobalOrigin = getGlobalOrigin
8640
8640
 
8641
- const { CacheStorage } = __nccwpck_require__(11069)
8642
- const { kConstruct } = __nccwpck_require__(50591)
8641
+ const { CacheStorage } = __nccwpck_require__(13256)
8642
+ const { kConstruct } = __nccwpck_require__(275)
8643
8643
 
8644
8644
  // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
8645
8645
  // in an older version of Node, it doesn't have any use without fetch.
8646
8646
  module.exports.caches = new CacheStorage(kConstruct)
8647
8647
 
8648
- const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(15855)
8648
+ const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(84245)
8649
8649
 
8650
8650
  module.exports.deleteCookie = deleteCookie
8651
8651
  module.exports.getCookies = getCookies
8652
8652
  module.exports.getSetCookies = getSetCookies
8653
8653
  module.exports.setCookie = setCookie
8654
8654
 
8655
- const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(96730)
8655
+ const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(68889)
8656
8656
 
8657
8657
  module.exports.parseMIMEType = parseMIMEType
8658
8658
  module.exports.serializeAMimeType = serializeAMimeType
8659
8659
 
8660
- const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(69459)
8661
- module.exports.WebSocket = __nccwpck_require__(16416).WebSocket
8660
+ const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(85021)
8661
+ module.exports.WebSocket = __nccwpck_require__(43590).WebSocket
8662
8662
  module.exports.CloseEvent = CloseEvent
8663
8663
  module.exports.ErrorEvent = ErrorEvent
8664
8664
  module.exports.MessageEvent = MessageEvent
@@ -8674,18 +8674,18 @@ module.exports.MockPool = MockPool
8674
8674
  module.exports.MockAgent = MockAgent
8675
8675
  module.exports.mockErrors = mockErrors
8676
8676
 
8677
- const { EventSource } = __nccwpck_require__(6731)
8677
+ const { EventSource } = __nccwpck_require__(74292)
8678
8678
 
8679
8679
  module.exports.EventSource = EventSource
8680
8680
 
8681
8681
 
8682
8682
  /***/ }),
8683
8683
 
8684
- /***/ 97433:
8684
+ /***/ 44378:
8685
8685
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
8686
8686
 
8687
- const { addAbortListener } = __nccwpck_require__(50011)
8688
- const { RequestAbortedError } = __nccwpck_require__(35990)
8687
+ const { addAbortListener } = __nccwpck_require__(31014)
8688
+ const { RequestAbortedError } = __nccwpck_require__(47926)
8689
8689
 
8690
8690
  const kListener = Symbol('kListener')
8691
8691
  const kSignal = Symbol('kSignal')
@@ -8745,7 +8745,7 @@ module.exports = {
8745
8745
 
8746
8746
  /***/ }),
8747
8747
 
8748
- /***/ 93671:
8748
+ /***/ 48105:
8749
8749
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
8750
8750
 
8751
8751
  "use strict";
@@ -8753,9 +8753,9 @@ module.exports = {
8753
8753
 
8754
8754
  const assert = __nccwpck_require__(98061)
8755
8755
  const { AsyncResource } = __nccwpck_require__(92761)
8756
- const { InvalidArgumentError, SocketError } = __nccwpck_require__(35990)
8757
- const util = __nccwpck_require__(50011)
8758
- const { addSignal, removeSignal } = __nccwpck_require__(97433)
8756
+ const { InvalidArgumentError, SocketError } = __nccwpck_require__(47926)
8757
+ const util = __nccwpck_require__(31014)
8758
+ const { addSignal, removeSignal } = __nccwpck_require__(44378)
8759
8759
 
8760
8760
  class ConnectHandler extends AsyncResource {
8761
8761
  constructor (opts, callback) {
@@ -8861,7 +8861,7 @@ module.exports = connect
8861
8861
 
8862
8862
  /***/ }),
8863
8863
 
8864
- /***/ 281:
8864
+ /***/ 25050:
8865
8865
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
8866
8866
 
8867
8867
  "use strict";
@@ -8876,10 +8876,10 @@ const {
8876
8876
  InvalidArgumentError,
8877
8877
  InvalidReturnValueError,
8878
8878
  RequestAbortedError
8879
- } = __nccwpck_require__(35990)
8880
- const util = __nccwpck_require__(50011)
8879
+ } = __nccwpck_require__(47926)
8880
+ const util = __nccwpck_require__(31014)
8881
8881
  const { AsyncResource } = __nccwpck_require__(92761)
8882
- const { addSignal, removeSignal } = __nccwpck_require__(97433)
8882
+ const { addSignal, removeSignal } = __nccwpck_require__(44378)
8883
8883
  const assert = __nccwpck_require__(98061)
8884
8884
 
8885
8885
  const kResume = Symbol('resume')
@@ -9120,17 +9120,17 @@ module.exports = pipeline
9120
9120
 
9121
9121
  /***/ }),
9122
9122
 
9123
- /***/ 26562:
9123
+ /***/ 53067:
9124
9124
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
9125
9125
 
9126
9126
  "use strict";
9127
9127
 
9128
9128
 
9129
9129
  const assert = __nccwpck_require__(98061)
9130
- const { Readable } = __nccwpck_require__(93401)
9131
- const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(35990)
9132
- const util = __nccwpck_require__(50011)
9133
- const { getResolveErrorBodyCallback } = __nccwpck_require__(80710)
9130
+ const { Readable } = __nccwpck_require__(67646)
9131
+ const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(47926)
9132
+ const util = __nccwpck_require__(31014)
9133
+ const { getResolveErrorBodyCallback } = __nccwpck_require__(78393)
9134
9134
  const { AsyncResource } = __nccwpck_require__(92761)
9135
9135
 
9136
9136
  class RequestHandler extends AsyncResource {
@@ -9342,7 +9342,7 @@ module.exports.RequestHandler = RequestHandler
9342
9342
 
9343
9343
  /***/ }),
9344
9344
 
9345
- /***/ 75059:
9345
+ /***/ 21890:
9346
9346
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
9347
9347
 
9348
9348
  "use strict";
@@ -9350,11 +9350,11 @@ module.exports.RequestHandler = RequestHandler
9350
9350
 
9351
9351
  const assert = __nccwpck_require__(98061)
9352
9352
  const { finished, PassThrough } = __nccwpck_require__(84492)
9353
- const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(35990)
9354
- const util = __nccwpck_require__(50011)
9355
- const { getResolveErrorBodyCallback } = __nccwpck_require__(80710)
9353
+ const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(47926)
9354
+ const util = __nccwpck_require__(31014)
9355
+ const { getResolveErrorBodyCallback } = __nccwpck_require__(78393)
9356
9356
  const { AsyncResource } = __nccwpck_require__(92761)
9357
- const { addSignal, removeSignal } = __nccwpck_require__(97433)
9357
+ const { addSignal, removeSignal } = __nccwpck_require__(44378)
9358
9358
 
9359
9359
  class StreamHandler extends AsyncResource {
9360
9360
  constructor (opts, factory, callback) {
@@ -9570,16 +9570,16 @@ module.exports = stream
9570
9570
 
9571
9571
  /***/ }),
9572
9572
 
9573
- /***/ 23792:
9573
+ /***/ 94422:
9574
9574
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
9575
9575
 
9576
9576
  "use strict";
9577
9577
 
9578
9578
 
9579
- const { InvalidArgumentError, SocketError } = __nccwpck_require__(35990)
9579
+ const { InvalidArgumentError, SocketError } = __nccwpck_require__(47926)
9580
9580
  const { AsyncResource } = __nccwpck_require__(92761)
9581
- const util = __nccwpck_require__(50011)
9582
- const { addSignal, removeSignal } = __nccwpck_require__(97433)
9581
+ const util = __nccwpck_require__(31014)
9582
+ const { addSignal, removeSignal } = __nccwpck_require__(44378)
9583
9583
  const assert = __nccwpck_require__(98061)
9584
9584
 
9585
9585
  class UpgradeHandler extends AsyncResource {
@@ -9686,22 +9686,22 @@ module.exports = upgrade
9686
9686
 
9687
9687
  /***/ }),
9688
9688
 
9689
- /***/ 20617:
9689
+ /***/ 39663:
9690
9690
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
9691
9691
 
9692
9692
  "use strict";
9693
9693
 
9694
9694
 
9695
- module.exports.request = __nccwpck_require__(26562)
9696
- module.exports.stream = __nccwpck_require__(75059)
9697
- module.exports.pipeline = __nccwpck_require__(281)
9698
- module.exports.upgrade = __nccwpck_require__(23792)
9699
- module.exports.connect = __nccwpck_require__(93671)
9695
+ module.exports.request = __nccwpck_require__(53067)
9696
+ module.exports.stream = __nccwpck_require__(21890)
9697
+ module.exports.pipeline = __nccwpck_require__(25050)
9698
+ module.exports.upgrade = __nccwpck_require__(94422)
9699
+ module.exports.connect = __nccwpck_require__(48105)
9700
9700
 
9701
9701
 
9702
9702
  /***/ }),
9703
9703
 
9704
- /***/ 93401:
9704
+ /***/ 67646:
9705
9705
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
9706
9706
 
9707
9707
  "use strict";
@@ -9711,9 +9711,9 @@ module.exports.connect = __nccwpck_require__(93671)
9711
9711
 
9712
9712
  const assert = __nccwpck_require__(98061)
9713
9713
  const { Readable } = __nccwpck_require__(84492)
9714
- const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(35990)
9715
- const util = __nccwpck_require__(50011)
9716
- const { ReadableStreamFrom } = __nccwpck_require__(50011)
9714
+ const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(47926)
9715
+ const util = __nccwpck_require__(31014)
9716
+ const { ReadableStreamFrom } = __nccwpck_require__(31014)
9717
9717
 
9718
9718
  const kConsume = Symbol('kConsume')
9719
9719
  const kReading = Symbol('kReading')
@@ -10094,15 +10094,15 @@ module.exports = { Readable: BodyReadable, chunksDecode }
10094
10094
 
10095
10095
  /***/ }),
10096
10096
 
10097
- /***/ 80710:
10097
+ /***/ 78393:
10098
10098
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
10099
10099
 
10100
10100
  const assert = __nccwpck_require__(98061)
10101
10101
  const {
10102
10102
  ResponseStatusCodeError
10103
- } = __nccwpck_require__(35990)
10103
+ } = __nccwpck_require__(47926)
10104
10104
 
10105
- const { chunksDecode } = __nccwpck_require__(93401)
10105
+ const { chunksDecode } = __nccwpck_require__(67646)
10106
10106
  const CHUNK_LIMIT = 128 * 1024
10107
10107
 
10108
10108
  async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
@@ -10194,7 +10194,7 @@ module.exports = {
10194
10194
 
10195
10195
  /***/ }),
10196
10196
 
10197
- /***/ 41429:
10197
+ /***/ 63447:
10198
10198
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
10199
10199
 
10200
10200
  "use strict";
@@ -10202,9 +10202,9 @@ module.exports = {
10202
10202
 
10203
10203
  const net = __nccwpck_require__(87503)
10204
10204
  const assert = __nccwpck_require__(98061)
10205
- const util = __nccwpck_require__(50011)
10206
- const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(35990)
10207
- const timers = __nccwpck_require__(77512)
10205
+ const util = __nccwpck_require__(31014)
10206
+ const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(47926)
10207
+ const timers = __nccwpck_require__(63125)
10208
10208
 
10209
10209
  function noop () {}
10210
10210
 
@@ -10442,7 +10442,7 @@ module.exports = buildConnector
10442
10442
 
10443
10443
  /***/ }),
10444
10444
 
10445
- /***/ 53451:
10445
+ /***/ 91362:
10446
10446
  /***/ ((module) => {
10447
10447
 
10448
10448
  "use strict";
@@ -10568,7 +10568,7 @@ module.exports = {
10568
10568
 
10569
10569
  /***/ }),
10570
10570
 
10571
- /***/ 65543:
10571
+ /***/ 96005:
10572
10572
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
10573
10573
 
10574
10574
  "use strict";
@@ -10778,7 +10778,7 @@ module.exports = {
10778
10778
 
10779
10779
  /***/ }),
10780
10780
 
10781
- /***/ 35990:
10781
+ /***/ 47926:
10782
10782
  /***/ ((module) => {
10783
10783
 
10784
10784
  "use strict";
@@ -11211,7 +11211,7 @@ module.exports = {
11211
11211
 
11212
11212
  /***/ }),
11213
11213
 
11214
- /***/ 13484:
11214
+ /***/ 82075:
11215
11215
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11216
11216
 
11217
11217
  "use strict";
@@ -11220,7 +11220,7 @@ module.exports = {
11220
11220
  const {
11221
11221
  InvalidArgumentError,
11222
11222
  NotSupportedError
11223
- } = __nccwpck_require__(35990)
11223
+ } = __nccwpck_require__(47926)
11224
11224
  const assert = __nccwpck_require__(98061)
11225
11225
  const {
11226
11226
  isValidHTTPToken,
@@ -11235,9 +11235,9 @@ const {
11235
11235
  validateHandler,
11236
11236
  getServerName,
11237
11237
  normalizedMethodRecords
11238
- } = __nccwpck_require__(50011)
11239
- const { channels } = __nccwpck_require__(65543)
11240
- const { headerNameLowerCasedRecord } = __nccwpck_require__(53451)
11238
+ } = __nccwpck_require__(31014)
11239
+ const { channels } = __nccwpck_require__(96005)
11240
+ const { headerNameLowerCasedRecord } = __nccwpck_require__(91362)
11241
11241
 
11242
11242
  // Verifies that a given path is valid does not contain control chars \x00 to \x20
11243
11243
  const invalidPathRegex = /[^\u0021-\u00ff]/
@@ -11480,11 +11480,77 @@ class Request {
11480
11480
  }
11481
11481
  }
11482
11482
 
11483
- onUpgrade (statusCode, headers, socket) {
11483
+ /**
11484
+ * @param {number|null} statusCode
11485
+ * @param {Buffer[]|null} headers
11486
+ * @param {import('node:stream').Duplex} socket
11487
+ * @param {string} [statusText]
11488
+ */
11489
+ onUpgrade (statusCode, headers, socket, statusText = '') {
11490
+ this.onFinally()
11491
+
11484
11492
  assert(!this.aborted)
11485
11493
  assert(!this.completed)
11486
11494
 
11487
- return this[kHandler].onUpgrade(statusCode, headers, socket)
11495
+ if (statusCode !== null) {
11496
+ this.#publishUpgradeHeaders(statusCode, headers, statusText)
11497
+ }
11498
+
11499
+ const result = this[kHandler].onUpgrade(statusCode, headers, socket)
11500
+
11501
+ if (!this.aborted) {
11502
+ this.completed = true
11503
+ if (statusCode !== null) {
11504
+ this.#publishUpgradeTrailers()
11505
+ }
11506
+ }
11507
+
11508
+ return result
11509
+ }
11510
+
11511
+ /**
11512
+ * @param {number} statusCode
11513
+ * @param {import('node:http2').IncomingHttpHeaders} headers
11514
+ * @param {(headers: import('node:http2').IncomingHttpHeaders) => Buffer[]} parseHeaders
11515
+ * @param {string} [statusText]
11516
+ */
11517
+ onUpgradeResponse (statusCode, headers, parseHeaders, statusText = '') {
11518
+ assert(!this.aborted)
11519
+ assert(this.completed)
11520
+
11521
+ if (channels.headers.hasSubscribers) {
11522
+ this.#publishUpgradeHeaders(statusCode, parseHeaders(headers), statusText)
11523
+ }
11524
+ this.#publishUpgradeTrailers()
11525
+ }
11526
+
11527
+ /**
11528
+ * @param {Error} error
11529
+ */
11530
+ onUpgradeError (error) {
11531
+ assert(!this.aborted)
11532
+ assert(this.completed)
11533
+
11534
+ if (channels.error.hasSubscribers) {
11535
+ channels.error.publish({ request: this, error })
11536
+ }
11537
+ }
11538
+
11539
+ /**
11540
+ * @param {number} statusCode
11541
+ * @param {Buffer[]} headers
11542
+ * @param {string} statusText
11543
+ */
11544
+ #publishUpgradeHeaders (statusCode, headers, statusText) {
11545
+ if (channels.headers.hasSubscribers) {
11546
+ channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
11547
+ }
11548
+ }
11549
+
11550
+ #publishUpgradeTrailers () {
11551
+ if (channels.trailers.hasSubscribers) {
11552
+ channels.trailers.publish({ request: this, trailers: [] })
11553
+ }
11488
11554
  }
11489
11555
 
11490
11556
  onComplete (trailers) {
@@ -11635,7 +11701,7 @@ module.exports = Request
11635
11701
 
11636
11702
  /***/ }),
11637
11703
 
11638
- /***/ 13638:
11704
+ /***/ 94822:
11639
11705
  /***/ ((module) => {
11640
11706
 
11641
11707
  module.exports = {
@@ -11709,7 +11775,7 @@ module.exports = {
11709
11775
 
11710
11776
  /***/ }),
11711
11777
 
11712
- /***/ 30723:
11778
+ /***/ 52731:
11713
11779
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11714
11780
 
11715
11781
  "use strict";
@@ -11718,7 +11784,7 @@ module.exports = {
11718
11784
  const {
11719
11785
  wellknownHeaderNames,
11720
11786
  headerNameLowerCasedRecord
11721
- } = __nccwpck_require__(53451)
11787
+ } = __nccwpck_require__(91362)
11722
11788
 
11723
11789
  class TstNode {
11724
11790
  /** @type {any} */
@@ -11869,14 +11935,14 @@ module.exports = {
11869
11935
 
11870
11936
  /***/ }),
11871
11937
 
11872
- /***/ 50011:
11938
+ /***/ 31014:
11873
11939
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11874
11940
 
11875
11941
  "use strict";
11876
11942
 
11877
11943
 
11878
11944
  const assert = __nccwpck_require__(98061)
11879
- const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(13638)
11945
+ const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(94822)
11880
11946
  const { IncomingMessage } = __nccwpck_require__(88849)
11881
11947
  const stream = __nccwpck_require__(84492)
11882
11948
  const net = __nccwpck_require__(87503)
@@ -11884,9 +11950,9 @@ const { Blob } = __nccwpck_require__(72254)
11884
11950
  const nodeUtil = __nccwpck_require__(47261)
11885
11951
  const { stringify } = __nccwpck_require__(39630)
11886
11952
  const { EventEmitter: EE } = __nccwpck_require__(15673)
11887
- const { InvalidArgumentError } = __nccwpck_require__(35990)
11888
- const { headerNameLowerCasedRecord } = __nccwpck_require__(53451)
11889
- const { tree } = __nccwpck_require__(30723)
11953
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
11954
+ const { headerNameLowerCasedRecord } = __nccwpck_require__(91362)
11955
+ const { tree } = __nccwpck_require__(52731)
11890
11956
 
11891
11957
  const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
11892
11958
 
@@ -12596,19 +12662,19 @@ module.exports = {
12596
12662
 
12597
12663
  /***/ }),
12598
12664
 
12599
- /***/ 73274:
12665
+ /***/ 1880:
12600
12666
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
12601
12667
 
12602
12668
  "use strict";
12603
12669
 
12604
12670
 
12605
- const { InvalidArgumentError } = __nccwpck_require__(35990)
12606
- const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(13638)
12607
- const DispatcherBase = __nccwpck_require__(39504)
12608
- const Pool = __nccwpck_require__(80229)
12609
- const Client = __nccwpck_require__(85849)
12610
- const util = __nccwpck_require__(50011)
12611
- const createRedirectInterceptor = __nccwpck_require__(40928)
12671
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
12672
+ const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(94822)
12673
+ const DispatcherBase = __nccwpck_require__(26844)
12674
+ const Pool = __nccwpck_require__(49771)
12675
+ const Client = __nccwpck_require__(6237)
12676
+ const util = __nccwpck_require__(31014)
12677
+ const createRedirectInterceptor = __nccwpck_require__(91467)
12612
12678
 
12613
12679
  const kOnConnect = Symbol('onConnect')
12614
12680
  const kOnDisconnect = Symbol('onDisconnect')
@@ -12625,7 +12691,7 @@ function defaultFactory (origin, opts) {
12625
12691
  }
12626
12692
 
12627
12693
  class Agent extends DispatcherBase {
12628
- constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
12694
+ constructor ({ factory = defaultFactory, maxRedirections = 0, connect, tls, ...options } = {}) {
12629
12695
  if (typeof factory !== 'function') {
12630
12696
  throw new InvalidArgumentError('factory must be a function.')
12631
12697
  }
@@ -12644,11 +12710,15 @@ class Agent extends DispatcherBase {
12644
12710
  connect = { ...connect }
12645
12711
  }
12646
12712
 
12713
+ if (tls && typeof tls !== 'function') {
12714
+ tls = { ...tls }
12715
+ }
12716
+
12647
12717
  this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)
12648
12718
  ? options.interceptors.Agent
12649
12719
  : [createRedirectInterceptor({ maxRedirections })]
12650
12720
 
12651
- this[kOptions] = { ...util.deepClone(options), connect }
12721
+ this[kOptions] = { ...util.deepClone(options), connect, tls }
12652
12722
  this[kOptions].interceptors = options.interceptors
12653
12723
  ? { ...options.interceptors }
12654
12724
  : undefined
@@ -12733,7 +12803,7 @@ module.exports = Agent
12733
12803
 
12734
12804
  /***/ }),
12735
12805
 
12736
- /***/ 68255:
12806
+ /***/ 88214:
12737
12807
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
12738
12808
 
12739
12809
  "use strict";
@@ -12742,7 +12812,7 @@ module.exports = Agent
12742
12812
  const {
12743
12813
  BalancedPoolMissingUpstreamError,
12744
12814
  InvalidArgumentError
12745
- } = __nccwpck_require__(35990)
12815
+ } = __nccwpck_require__(47926)
12746
12816
  const {
12747
12817
  PoolBase,
12748
12818
  kClients,
@@ -12750,10 +12820,10 @@ const {
12750
12820
  kAddClient,
12751
12821
  kRemoveClient,
12752
12822
  kGetDispatcher
12753
- } = __nccwpck_require__(1467)
12754
- const Pool = __nccwpck_require__(80229)
12755
- const { kUrl, kInterceptors } = __nccwpck_require__(13638)
12756
- const { parseOrigin } = __nccwpck_require__(50011)
12823
+ } = __nccwpck_require__(97367)
12824
+ const Pool = __nccwpck_require__(49771)
12825
+ const { kUrl, kInterceptors } = __nccwpck_require__(94822)
12826
+ const { parseOrigin } = __nccwpck_require__(31014)
12757
12827
  const kFactory = Symbol('factory')
12758
12828
 
12759
12829
  const kOptions = Symbol('options')
@@ -12950,7 +13020,7 @@ module.exports = BalancedPool
12950
13020
 
12951
13021
  /***/ }),
12952
13022
 
12953
- /***/ 14429:
13023
+ /***/ 78365:
12954
13024
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
12955
13025
 
12956
13026
  "use strict";
@@ -12959,9 +13029,9 @@ module.exports = BalancedPool
12959
13029
  /* global WebAssembly */
12960
13030
 
12961
13031
  const assert = __nccwpck_require__(98061)
12962
- const util = __nccwpck_require__(50011)
12963
- const { channels } = __nccwpck_require__(65543)
12964
- const timers = __nccwpck_require__(77512)
13032
+ const util = __nccwpck_require__(31014)
13033
+ const { channels } = __nccwpck_require__(96005)
13034
+ const timers = __nccwpck_require__(63125)
12965
13035
  const {
12966
13036
  RequestContentLengthMismatchError,
12967
13037
  ResponseContentLengthMismatchError,
@@ -12974,7 +13044,7 @@ const {
12974
13044
  BodyTimeoutError,
12975
13045
  HTTPParserError,
12976
13046
  ResponseExceededMaxSizeError
12977
- } = __nccwpck_require__(35990)
13047
+ } = __nccwpck_require__(47926)
12978
13048
  const {
12979
13049
  kUrl,
12980
13050
  kReset,
@@ -13007,9 +13077,9 @@ const {
13007
13077
  kOnError,
13008
13078
  kResume,
13009
13079
  kHTTPContext
13010
- } = __nccwpck_require__(13638)
13080
+ } = __nccwpck_require__(94822)
13011
13081
 
13012
- const constants = __nccwpck_require__(41721)
13082
+ const constants = __nccwpck_require__(27692)
13013
13083
  const EMPTY_BUF = Buffer.alloc(0)
13014
13084
  const FastBuffer = Buffer[Symbol.species]
13015
13085
  const addListener = util.addListener
@@ -13021,11 +13091,11 @@ const kSocketUsed = Symbol('kSocketUsed')
13021
13091
  let extractBody
13022
13092
 
13023
13093
  async function lazyllhttp () {
13024
- const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(46081) : undefined
13094
+ const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(84888) : undefined
13025
13095
 
13026
13096
  let mod
13027
13097
  try {
13028
- mod = await WebAssembly.compile(__nccwpck_require__(97877))
13098
+ mod = await WebAssembly.compile(__nccwpck_require__(31445))
13029
13099
  } catch (e) {
13030
13100
  /* istanbul ignore next */
13031
13101
 
@@ -13033,7 +13103,7 @@ async function lazyllhttp () {
13033
13103
  // being enabled, but the occurring of this other error
13034
13104
  // * https://github.com/emscripten-core/emscripten/issues/11495
13035
13105
  // got me to remove that check to avoid breaking Node 12.
13036
- mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(46081))
13106
+ mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(84888))
13037
13107
  }
13038
13108
 
13039
13109
  return await WebAssembly.instantiate(mod, {
@@ -13388,7 +13458,7 @@ class Parser {
13388
13458
  }
13389
13459
 
13390
13460
  onUpgrade (head) {
13391
- const { upgrade, client, socket, headers, statusCode } = this
13461
+ const { upgrade, client, socket, headers, statusCode, statusText } = this
13392
13462
 
13393
13463
  assert(upgrade)
13394
13464
  assert(client[kSocket] === socket)
@@ -13423,9 +13493,10 @@ class Parser {
13423
13493
  client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
13424
13494
 
13425
13495
  try {
13426
- request.onUpgrade(statusCode, headers, socket)
13427
- } catch (err) {
13428
- util.destroy(socket, err)
13496
+ request.onUpgrade(statusCode, headers, socket, statusText)
13497
+ } catch (error) {
13498
+ util.errorRequest(client, request, error)
13499
+ util.destroy(socket, error)
13429
13500
  }
13430
13501
 
13431
13502
  client[kResume]()
@@ -13682,8 +13753,6 @@ async function connectH1 (client, socket) {
13682
13753
  socket[kParser] = new Parser(client, socket, llhttpInstance)
13683
13754
 
13684
13755
  addListener(socket, 'error', function (err) {
13685
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
13686
-
13687
13756
  const parser = this[kParser]
13688
13757
 
13689
13758
  // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
@@ -13949,7 +14018,7 @@ function writeH1 (client, request) {
13949
14018
 
13950
14019
  if (util.isFormDataLike(body)) {
13951
14020
  if (!extractBody) {
13952
- extractBody = (__nccwpck_require__(12749).extractBody)
14021
+ extractBody = (__nccwpck_require__(48203).extractBody)
13953
14022
  }
13954
14023
 
13955
14024
  const [bodyStream, contentType] = extractBody(body)
@@ -14006,12 +14075,22 @@ function writeH1 (client, request) {
14006
14075
  const socket = client[kSocket]
14007
14076
  clearIdleSocketValidation(socket)
14008
14077
 
14009
- const abort = (err) => {
14010
- if (request.aborted || request.completed) {
14078
+ /**
14079
+ * @param {Error} [error]
14080
+ */
14081
+ const abort = (error) => {
14082
+ if (request.aborted) {
14083
+ return
14084
+ }
14085
+
14086
+ if (request.completed) {
14087
+ if (request.upgrade || request.method === 'CONNECT') {
14088
+ util.destroy(socket, new InformationalError('aborted'))
14089
+ }
14011
14090
  return
14012
14091
  }
14013
14092
 
14014
- util.errorRequest(client, request, err || new RequestAbortedError())
14093
+ util.errorRequest(client, request, error || new RequestAbortedError())
14015
14094
 
14016
14095
  util.destroy(body)
14017
14096
  util.destroy(socket, new InformationalError('aborted'))
@@ -14462,21 +14541,22 @@ module.exports = connectH1
14462
14541
 
14463
14542
  /***/ }),
14464
14543
 
14465
- /***/ 34879:
14544
+ /***/ 55267:
14466
14545
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
14467
14546
 
14468
14547
  "use strict";
14469
14548
 
14470
14549
 
14471
14550
  const assert = __nccwpck_require__(98061)
14551
+ const { errorMonitor } = __nccwpck_require__(15673)
14472
14552
  const { pipeline } = __nccwpck_require__(84492)
14473
- const util = __nccwpck_require__(50011)
14553
+ const util = __nccwpck_require__(31014)
14474
14554
  const {
14475
14555
  RequestContentLengthMismatchError,
14476
14556
  RequestAbortedError,
14477
14557
  SocketError,
14478
14558
  InformationalError
14479
- } = __nccwpck_require__(35990)
14559
+ } = __nccwpck_require__(47926)
14480
14560
  const {
14481
14561
  kUrl,
14482
14562
  kReset,
@@ -14495,7 +14575,7 @@ const {
14495
14575
  kResume,
14496
14576
  kSize,
14497
14577
  kHTTPContext
14498
- } = __nccwpck_require__(13638)
14578
+ } = __nccwpck_require__(94822)
14499
14579
 
14500
14580
  const kOpenStreams = Symbol('open streams')
14501
14581
 
@@ -14545,6 +14625,15 @@ function parseH2Headers (headers) {
14545
14625
  return result
14546
14626
  }
14547
14627
 
14628
+ /**
14629
+ * @param {import('node:http2').IncomingHttpHeaders} headers
14630
+ * @returns {Buffer[]}
14631
+ */
14632
+ function parseH2ResponseHeaders (headers) {
14633
+ const { [HTTP2_HEADER_STATUS]: _statusCode, ...realHeaders } = headers
14634
+ return parseH2Headers(realHeaders)
14635
+ }
14636
+
14548
14637
  async function connectH2 (client, socket) {
14549
14638
  client[kSocket] = socket
14550
14639
 
@@ -14594,8 +14683,6 @@ async function connectH2 (client, socket) {
14594
14683
  socket[kHTTP2Session] = session
14595
14684
 
14596
14685
  util.addListener(socket, 'error', function (err) {
14597
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
14598
-
14599
14686
  this[kError] = err
14600
14687
 
14601
14688
  this[kClient][kOnError](err)
@@ -14669,8 +14756,6 @@ function resumeH2 (client) {
14669
14756
  }
14670
14757
 
14671
14758
  function onHttp2SessionError (err) {
14672
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
14673
-
14674
14759
  this[kSocket][kError] = err
14675
14760
  this[kClient][kOnError](err)
14676
14761
  }
@@ -14765,22 +14850,32 @@ function writeH2 (client, request) {
14765
14850
  headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
14766
14851
  headers[HTTP2_HEADER_METHOD] = method
14767
14852
 
14768
- const abort = (err) => {
14769
- if (request.aborted || request.completed) {
14853
+ /**
14854
+ * @param {Error} [error]
14855
+ */
14856
+ const abort = (error) => {
14857
+ if (request.aborted) {
14858
+ return
14859
+ }
14860
+
14861
+ if (request.completed) {
14862
+ if (method === 'CONNECT' && stream != null) {
14863
+ util.destroy(stream, error || new RequestAbortedError())
14864
+ }
14770
14865
  return
14771
14866
  }
14772
14867
 
14773
- err = err || new RequestAbortedError()
14868
+ error = error || new RequestAbortedError()
14774
14869
 
14775
- util.errorRequest(client, request, err)
14870
+ util.errorRequest(client, request, error)
14776
14871
 
14777
14872
  if (stream != null) {
14778
- util.destroy(stream, err)
14873
+ util.destroy(stream, error)
14779
14874
  }
14780
14875
 
14781
14876
  // We do not destroy the socket as we can continue using the session
14782
14877
  // the stream get's destroyed and the session remains to create new streams
14783
- util.destroy(body, err)
14878
+ util.destroy(body, error)
14784
14879
  client[kQueue][client[kRunningIdx]++] = null
14785
14880
  client[kResume]()
14786
14881
  }
@@ -14799,25 +14894,57 @@ function writeH2 (client, request) {
14799
14894
 
14800
14895
  if (method === 'CONNECT') {
14801
14896
  session.ref()
14802
- // We are already connected, streams are pending, first request
14803
- // will create a new stream. We trigger a request to create the stream and wait until
14804
- // `ready` event is triggered
14805
14897
  // We disabled endStream to allow the user to write to the stream
14806
14898
  stream = session.request(headers, { endStream: false, signal })
14899
+ let upgradeResponseFinished = false
14807
14900
 
14808
- if (stream.id && !stream.pending) {
14809
- request.onUpgrade(null, null, stream)
14810
- ++session[kOpenStreams]
14811
- client[kQueue][client[kRunningIdx]++] = null
14812
- } else {
14813
- stream.once('ready', () => {
14901
+ /**
14902
+ * @param {import('node:http2').IncomingHttpHeaders} headers
14903
+ */
14904
+ const onResponse = (headers) => {
14905
+ upgradeResponseFinished = true
14906
+ stream.off(errorMonitor, onUpgradeError)
14907
+ request.onUpgradeResponse(Number(headers[HTTP2_HEADER_STATUS]), headers, parseH2ResponseHeaders)
14908
+ }
14909
+
14910
+ /**
14911
+ * @param {Error} error
14912
+ */
14913
+ const onUpgradeError = (error) => {
14914
+ upgradeResponseFinished = true
14915
+ stream.off('response', onResponse)
14916
+ request.onUpgradeError(error)
14917
+ }
14918
+
14919
+ const onReady = () => {
14920
+ try {
14814
14921
  request.onUpgrade(null, null, stream)
14815
- ++session[kOpenStreams]
14816
- client[kQueue][client[kRunningIdx]++] = null
14817
- })
14922
+ } catch (error) {
14923
+ stream.off('response', onResponse)
14924
+ abort(error)
14925
+ return
14926
+ }
14927
+
14928
+ if (request.aborted) {
14929
+ return
14930
+ }
14931
+
14932
+ stream.off('error', abort)
14933
+ stream.once(errorMonitor, onUpgradeError)
14934
+ client[kQueue][client[kRunningIdx]++] = null
14818
14935
  }
14819
14936
 
14937
+ stream.once('response', onResponse)
14938
+ stream.once('error', abort)
14939
+ ++session[kOpenStreams]
14940
+ onReady()
14941
+
14820
14942
  stream.once('close', () => {
14943
+ if (!upgradeResponseFinished && request.completed) {
14944
+ stream.off('response', onResponse)
14945
+ stream.off(errorMonitor, onUpgradeError)
14946
+ request.onUpgradeError(new InformationalError(`HTTP/2: "stream error" received - code ${stream.rstCode}`))
14947
+ }
14821
14948
  session[kOpenStreams] -= 1
14822
14949
  if (session[kOpenStreams] === 0) session.unref()
14823
14950
  })
@@ -14854,7 +14981,7 @@ function writeH2 (client, request) {
14854
14981
  let contentLength = util.bodyLength(body)
14855
14982
 
14856
14983
  if (util.isFormDataLike(body)) {
14857
- extractBody ??= (__nccwpck_require__(12749).extractBody)
14984
+ extractBody ??= (__nccwpck_require__(48203).extractBody)
14858
14985
 
14859
14986
  const [bodyStream, contentType] = extractBody(body)
14860
14987
  headers['content-type'] = contentType
@@ -15214,7 +15341,7 @@ module.exports = connectH2
15214
15341
 
15215
15342
  /***/ }),
15216
15343
 
15217
- /***/ 85849:
15344
+ /***/ 6237:
15218
15345
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
15219
15346
 
15220
15347
  "use strict";
@@ -15225,16 +15352,16 @@ module.exports = connectH2
15225
15352
  const assert = __nccwpck_require__(98061)
15226
15353
  const net = __nccwpck_require__(87503)
15227
15354
  const http = __nccwpck_require__(88849)
15228
- const util = __nccwpck_require__(50011)
15229
- const { channels } = __nccwpck_require__(65543)
15230
- const Request = __nccwpck_require__(13484)
15231
- const DispatcherBase = __nccwpck_require__(39504)
15355
+ const util = __nccwpck_require__(31014)
15356
+ const { channels } = __nccwpck_require__(96005)
15357
+ const Request = __nccwpck_require__(82075)
15358
+ const DispatcherBase = __nccwpck_require__(26844)
15232
15359
  const {
15233
15360
  InvalidArgumentError,
15234
15361
  InformationalError,
15235
15362
  ClientDestroyedError
15236
- } = __nccwpck_require__(35990)
15237
- const buildConnector = __nccwpck_require__(41429)
15363
+ } = __nccwpck_require__(47926)
15364
+ const buildConnector = __nccwpck_require__(63447)
15238
15365
  const {
15239
15366
  kUrl,
15240
15367
  kServerName,
@@ -15276,9 +15403,9 @@ const {
15276
15403
  kHTTPContext,
15277
15404
  kMaxConcurrentStreams,
15278
15405
  kResume
15279
- } = __nccwpck_require__(13638)
15280
- const connectH1 = __nccwpck_require__(14429)
15281
- const connectH2 = __nccwpck_require__(34879)
15406
+ } = __nccwpck_require__(94822)
15407
+ const connectH1 = __nccwpck_require__(78365)
15408
+ const connectH2 = __nccwpck_require__(55267)
15282
15409
  let deprecatedInterceptorWarned = false
15283
15410
 
15284
15411
  const kClosedResolve = Symbol('kClosedResolve')
@@ -15327,9 +15454,10 @@ class Client extends DispatcherBase {
15327
15454
  // h2
15328
15455
  maxConcurrentStreams,
15329
15456
  allowH2,
15330
- webSocket
15457
+ webSocket,
15458
+ eventSource
15331
15459
  } = {}) {
15332
- super({ webSocket })
15460
+ super({ webSocket, eventSource })
15333
15461
 
15334
15462
  if (keepAlive !== undefined) {
15335
15463
  throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
@@ -15585,7 +15713,7 @@ class Client extends DispatcherBase {
15585
15713
  }
15586
15714
  }
15587
15715
 
15588
- const createRedirectInterceptor = __nccwpck_require__(40928)
15716
+ const createRedirectInterceptor = __nccwpck_require__(91467)
15589
15717
 
15590
15718
  function onError (client, err) {
15591
15719
  if (
@@ -15845,24 +15973,26 @@ module.exports = Client
15845
15973
 
15846
15974
  /***/ }),
15847
15975
 
15848
- /***/ 39504:
15976
+ /***/ 26844:
15849
15977
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
15850
15978
 
15851
15979
  "use strict";
15852
15980
 
15853
15981
 
15854
- const Dispatcher = __nccwpck_require__(66071)
15982
+ const buffer = __nccwpck_require__(72254)
15983
+ const Dispatcher = __nccwpck_require__(32171)
15855
15984
  const {
15856
15985
  ClientDestroyedError,
15857
15986
  ClientClosedError,
15858
15987
  InvalidArgumentError
15859
- } = __nccwpck_require__(35990)
15860
- const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(13638)
15988
+ } = __nccwpck_require__(47926)
15989
+ const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(94822)
15861
15990
 
15862
15991
  const kOnDestroyed = Symbol('onDestroyed')
15863
15992
  const kOnClosed = Symbol('onClosed')
15864
15993
  const kInterceptedDispatch = Symbol('Intercepted Dispatch')
15865
15994
  const kWebSocketOptions = Symbol('webSocketOptions')
15995
+ const kEventSourceOptions = Symbol('eventSourceOptions')
15866
15996
 
15867
15997
  class DispatcherBase extends Dispatcher {
15868
15998
  constructor (opts) {
@@ -15873,6 +16003,7 @@ class DispatcherBase extends Dispatcher {
15873
16003
  this[kClosed] = false
15874
16004
  this[kOnClosed] = []
15875
16005
  this[kWebSocketOptions] = opts?.webSocket ?? {}
16006
+ this[kEventSourceOptions] = opts?.eventSource ?? {}
15876
16007
  }
15877
16008
 
15878
16009
  get webSocketOptions () {
@@ -15882,6 +16013,12 @@ class DispatcherBase extends Dispatcher {
15882
16013
  }
15883
16014
  }
15884
16015
 
16016
+ get eventSourceOptions () {
16017
+ return {
16018
+ maxEventSize: this[kEventSourceOptions].maxEventSize ?? buffer.kStringMaxLength
16019
+ }
16020
+ }
16021
+
15885
16022
  get destroyed () {
15886
16023
  return this[kDestroyed]
15887
16024
  }
@@ -16052,7 +16189,7 @@ module.exports = DispatcherBase
16052
16189
 
16053
16190
  /***/ }),
16054
16191
 
16055
- /***/ 66071:
16192
+ /***/ 32171:
16056
16193
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
16057
16194
 
16058
16195
  "use strict";
@@ -16125,16 +16262,16 @@ module.exports = Dispatcher
16125
16262
 
16126
16263
  /***/ }),
16127
16264
 
16128
- /***/ 29941:
16265
+ /***/ 42547:
16129
16266
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
16130
16267
 
16131
16268
  "use strict";
16132
16269
 
16133
16270
 
16134
- const DispatcherBase = __nccwpck_require__(39504)
16135
- const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(13638)
16136
- const ProxyAgent = __nccwpck_require__(87187)
16137
- const Agent = __nccwpck_require__(73274)
16271
+ const DispatcherBase = __nccwpck_require__(26844)
16272
+ const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(94822)
16273
+ const ProxyAgent = __nccwpck_require__(57912)
16274
+ const Agent = __nccwpck_require__(1880)
16138
16275
 
16139
16276
  const DEFAULT_PORTS = {
16140
16277
  'http:': 80,
@@ -16293,7 +16430,7 @@ module.exports = EnvHttpProxyAgent
16293
16430
 
16294
16431
  /***/ }),
16295
16432
 
16296
- /***/ 27092:
16433
+ /***/ 94856:
16297
16434
  /***/ ((module) => {
16298
16435
 
16299
16436
  "use strict";
@@ -16418,16 +16555,16 @@ module.exports = class FixedQueue {
16418
16555
 
16419
16556
  /***/ }),
16420
16557
 
16421
- /***/ 1467:
16558
+ /***/ 97367:
16422
16559
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
16423
16560
 
16424
16561
  "use strict";
16425
16562
 
16426
16563
 
16427
- const DispatcherBase = __nccwpck_require__(39504)
16428
- const FixedQueue = __nccwpck_require__(27092)
16429
- const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(13638)
16430
- const PoolStats = __nccwpck_require__(48309)
16564
+ const DispatcherBase = __nccwpck_require__(26844)
16565
+ const FixedQueue = __nccwpck_require__(94856)
16566
+ const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(94822)
16567
+ const PoolStats = __nccwpck_require__(61279)
16431
16568
 
16432
16569
  const kClients = Symbol('clients')
16433
16570
  const kNeedDrain = Symbol('needDrain')
@@ -16620,10 +16757,10 @@ module.exports = {
16620
16757
 
16621
16758
  /***/ }),
16622
16759
 
16623
- /***/ 48309:
16760
+ /***/ 61279:
16624
16761
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
16625
16762
 
16626
- const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(13638)
16763
+ const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(94822)
16627
16764
  const kPool = Symbol('pool')
16628
16765
 
16629
16766
  class PoolStats {
@@ -16661,7 +16798,7 @@ module.exports = PoolStats
16661
16798
 
16662
16799
  /***/ }),
16663
16800
 
16664
- /***/ 80229:
16801
+ /***/ 49771:
16665
16802
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
16666
16803
 
16667
16804
  "use strict";
@@ -16673,14 +16810,14 @@ const {
16673
16810
  kNeedDrain,
16674
16811
  kAddClient,
16675
16812
  kGetDispatcher
16676
- } = __nccwpck_require__(1467)
16677
- const Client = __nccwpck_require__(85849)
16813
+ } = __nccwpck_require__(97367)
16814
+ const Client = __nccwpck_require__(6237)
16678
16815
  const {
16679
16816
  InvalidArgumentError
16680
- } = __nccwpck_require__(35990)
16681
- const util = __nccwpck_require__(50011)
16682
- const { kUrl, kInterceptors } = __nccwpck_require__(13638)
16683
- const buildConnector = __nccwpck_require__(41429)
16817
+ } = __nccwpck_require__(47926)
16818
+ const util = __nccwpck_require__(31014)
16819
+ const { kUrl, kInterceptors } = __nccwpck_require__(94822)
16820
+ const buildConnector = __nccwpck_require__(63447)
16684
16821
 
16685
16822
  const kOptions = Symbol('options')
16686
16823
  const kConnections = Symbol('connections')
@@ -16776,20 +16913,20 @@ module.exports = Pool
16776
16913
 
16777
16914
  /***/ }),
16778
16915
 
16779
- /***/ 87187:
16916
+ /***/ 57912:
16780
16917
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
16781
16918
 
16782
16919
  "use strict";
16783
16920
 
16784
16921
 
16785
- const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(13638)
16922
+ const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(94822)
16786
16923
  const { URL } = __nccwpck_require__(41041)
16787
- const Agent = __nccwpck_require__(73274)
16788
- const Pool = __nccwpck_require__(80229)
16789
- const DispatcherBase = __nccwpck_require__(39504)
16790
- const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(35990)
16791
- const buildConnector = __nccwpck_require__(41429)
16792
- const Client = __nccwpck_require__(85849)
16924
+ const Agent = __nccwpck_require__(1880)
16925
+ const Pool = __nccwpck_require__(49771)
16926
+ const DispatcherBase = __nccwpck_require__(26844)
16927
+ const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(47926)
16928
+ const buildConnector = __nccwpck_require__(63447)
16929
+ const Client = __nccwpck_require__(6237)
16793
16930
 
16794
16931
  const kAgent = Symbol('proxy agent')
16795
16932
  const kClient = Symbol('proxy client')
@@ -17058,14 +17195,14 @@ module.exports = ProxyAgent
17058
17195
 
17059
17196
  /***/ }),
17060
17197
 
17061
- /***/ 55184:
17198
+ /***/ 42626:
17062
17199
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
17063
17200
 
17064
17201
  "use strict";
17065
17202
 
17066
17203
 
17067
- const Dispatcher = __nccwpck_require__(66071)
17068
- const RetryHandler = __nccwpck_require__(64524)
17204
+ const Dispatcher = __nccwpck_require__(32171)
17205
+ const RetryHandler = __nccwpck_require__(12671)
17069
17206
 
17070
17207
  class RetryAgent extends Dispatcher {
17071
17208
  #agent = null
@@ -17101,7 +17238,7 @@ module.exports = RetryAgent
17101
17238
 
17102
17239
  /***/ }),
17103
17240
 
17104
- /***/ 19405:
17241
+ /***/ 53139:
17105
17242
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
17106
17243
 
17107
17244
  "use strict";
@@ -17110,8 +17247,8 @@ module.exports = RetryAgent
17110
17247
  // We include a version number for the Dispatcher API. In case of breaking changes,
17111
17248
  // this version number must be increased to avoid conflicts.
17112
17249
  const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
17113
- const { InvalidArgumentError } = __nccwpck_require__(35990)
17114
- const Agent = __nccwpck_require__(73274)
17250
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
17251
+ const Agent = __nccwpck_require__(1880)
17115
17252
 
17116
17253
  if (getGlobalDispatcher() === undefined) {
17117
17254
  setGlobalDispatcher(new Agent())
@@ -17141,7 +17278,7 @@ module.exports = {
17141
17278
 
17142
17279
  /***/ }),
17143
17280
 
17144
- /***/ 41738:
17281
+ /***/ 59280:
17145
17282
  /***/ ((module) => {
17146
17283
 
17147
17284
  "use strict";
@@ -17193,16 +17330,16 @@ module.exports = class DecoratorHandler {
17193
17330
 
17194
17331
  /***/ }),
17195
17332
 
17196
- /***/ 64014:
17333
+ /***/ 90008:
17197
17334
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
17198
17335
 
17199
17336
  "use strict";
17200
17337
 
17201
17338
 
17202
- const util = __nccwpck_require__(50011)
17203
- const { kBodyUsed } = __nccwpck_require__(13638)
17339
+ const util = __nccwpck_require__(31014)
17340
+ const { kBodyUsed } = __nccwpck_require__(94822)
17204
17341
  const assert = __nccwpck_require__(98061)
17205
- const { InvalidArgumentError } = __nccwpck_require__(35990)
17342
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
17206
17343
  const EE = __nccwpck_require__(15673)
17207
17344
 
17208
17345
  const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
@@ -17433,21 +17570,21 @@ module.exports = RedirectHandler
17433
17570
 
17434
17571
  /***/ }),
17435
17572
 
17436
- /***/ 64524:
17573
+ /***/ 12671:
17437
17574
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
17438
17575
 
17439
17576
  "use strict";
17440
17577
 
17441
17578
  const assert = __nccwpck_require__(98061)
17442
17579
 
17443
- const { kRetryHandlerDefaultRetry } = __nccwpck_require__(13638)
17444
- const { RequestRetryError } = __nccwpck_require__(35990)
17580
+ const { kRetryHandlerDefaultRetry } = __nccwpck_require__(94822)
17581
+ const { RequestRetryError } = __nccwpck_require__(47926)
17445
17582
  const {
17446
17583
  isDisturbed,
17447
17584
  parseHeaders,
17448
17585
  parseRangeHeader,
17449
17586
  wrapRequestBody
17450
- } = __nccwpck_require__(50011)
17587
+ } = __nccwpck_require__(31014)
17451
17588
 
17452
17589
  function calculateRetryAfterHeader (retryAfter) {
17453
17590
  const current = Date.now()
@@ -17644,7 +17781,10 @@ class RetryHandler {
17644
17781
  this.retryCount += 1
17645
17782
 
17646
17783
  if (statusCode >= 300) {
17647
- if (this.retryOpts.statusCodes.includes(statusCode) === false) {
17784
+ // Only expose a response if no earlier attempt has reached the caller.
17785
+ // Otherwise abort this attempt so the error settles the existing body
17786
+ // instead of replacing it with a new response.
17787
+ if (!this.headersSent && this.retryOpts.statusCodes.includes(statusCode) === false) {
17648
17788
  this.headersSent = true
17649
17789
  this.checkpointResponseEnd(headers, resume)
17650
17790
  return this.handler.onHeaders(
@@ -17875,15 +18015,15 @@ module.exports = RetryHandler
17875
18015
 
17876
18016
  /***/ }),
17877
18017
 
17878
- /***/ 20346:
18018
+ /***/ 26290:
17879
18019
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
17880
18020
 
17881
18021
  "use strict";
17882
18022
 
17883
18023
  const { isIP } = __nccwpck_require__(87503)
17884
18024
  const { lookup } = __nccwpck_require__(30604)
17885
- const DecoratorHandler = __nccwpck_require__(41738)
17886
- const { InvalidArgumentError, InformationalError } = __nccwpck_require__(35990)
18025
+ const DecoratorHandler = __nccwpck_require__(59280)
18026
+ const { InvalidArgumentError, InformationalError } = __nccwpck_require__(47926)
17887
18027
  const maxInt = Math.pow(2, 31) - 1
17888
18028
 
17889
18029
  class DNSInstance {
@@ -18258,15 +18398,15 @@ module.exports = interceptorOpts => {
18258
18398
 
18259
18399
  /***/ }),
18260
18400
 
18261
- /***/ 12493:
18401
+ /***/ 9408:
18262
18402
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18263
18403
 
18264
18404
  "use strict";
18265
18405
 
18266
18406
 
18267
- const util = __nccwpck_require__(50011)
18268
- const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(35990)
18269
- const DecoratorHandler = __nccwpck_require__(41738)
18407
+ const util = __nccwpck_require__(31014)
18408
+ const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(47926)
18409
+ const DecoratorHandler = __nccwpck_require__(59280)
18270
18410
 
18271
18411
  class DumpHandler extends DecoratorHandler {
18272
18412
  #maxSize = 1024 * 1024
@@ -18389,13 +18529,13 @@ module.exports = createDumpInterceptor
18389
18529
 
18390
18530
  /***/ }),
18391
18531
 
18392
- /***/ 40928:
18532
+ /***/ 91467:
18393
18533
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18394
18534
 
18395
18535
  "use strict";
18396
18536
 
18397
18537
 
18398
- const RedirectHandler = __nccwpck_require__(64014)
18538
+ const RedirectHandler = __nccwpck_require__(90008)
18399
18539
 
18400
18540
  function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
18401
18541
  return (dispatch) => {
@@ -18418,12 +18558,12 @@ module.exports = createRedirectInterceptor
18418
18558
 
18419
18559
  /***/ }),
18420
18560
 
18421
- /***/ 74872:
18561
+ /***/ 42182:
18422
18562
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18423
18563
 
18424
18564
  "use strict";
18425
18565
 
18426
- const RedirectHandler = __nccwpck_require__(64014)
18566
+ const RedirectHandler = __nccwpck_require__(90008)
18427
18567
 
18428
18568
  module.exports = opts => {
18429
18569
  const globalMaxRedirections = opts?.maxRedirections
@@ -18450,12 +18590,12 @@ module.exports = opts => {
18450
18590
 
18451
18591
  /***/ }),
18452
18592
 
18453
- /***/ 79637:
18593
+ /***/ 17389:
18454
18594
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18455
18595
 
18456
18596
  "use strict";
18457
18597
 
18458
- const RetryHandler = __nccwpck_require__(64524)
18598
+ const RetryHandler = __nccwpck_require__(12671)
18459
18599
 
18460
18600
  module.exports = globalOpts => {
18461
18601
  return dispatch => {
@@ -18477,14 +18617,14 @@ module.exports = globalOpts => {
18477
18617
 
18478
18618
  /***/ }),
18479
18619
 
18480
- /***/ 41721:
18620
+ /***/ 27692:
18481
18621
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
18482
18622
 
18483
18623
  "use strict";
18484
18624
 
18485
18625
  Object.defineProperty(exports, "__esModule", ({ value: true }));
18486
18626
  exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
18487
- const utils_1 = __nccwpck_require__(69573);
18627
+ const utils_1 = __nccwpck_require__(5608);
18488
18628
  // C headers
18489
18629
  var ERROR;
18490
18630
  (function (ERROR) {
@@ -18762,7 +18902,7 @@ exports.SPECIAL_HEADERS = {
18762
18902
 
18763
18903
  /***/ }),
18764
18904
 
18765
- /***/ 46081:
18905
+ /***/ 84888:
18766
18906
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18767
18907
 
18768
18908
  "use strict";
@@ -18775,7 +18915,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3
18775
18915
 
18776
18916
  /***/ }),
18777
18917
 
18778
- /***/ 97877:
18918
+ /***/ 31445:
18779
18919
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18780
18920
 
18781
18921
  "use strict";
@@ -18788,7 +18928,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3
18788
18928
 
18789
18929
  /***/ }),
18790
18930
 
18791
- /***/ 69573:
18931
+ /***/ 5608:
18792
18932
  /***/ ((__unused_webpack_module, exports) => {
18793
18933
 
18794
18934
  "use strict";
@@ -18810,14 +18950,14 @@ exports.enumToMap = enumToMap;
18810
18950
 
18811
18951
  /***/ }),
18812
18952
 
18813
- /***/ 46432:
18953
+ /***/ 89937:
18814
18954
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18815
18955
 
18816
18956
  "use strict";
18817
18957
 
18818
18958
 
18819
- const { kClients } = __nccwpck_require__(13638)
18820
- const Agent = __nccwpck_require__(73274)
18959
+ const { kClients } = __nccwpck_require__(94822)
18960
+ const Agent = __nccwpck_require__(1880)
18821
18961
  const {
18822
18962
  kAgent,
18823
18963
  kMockAgentSet,
@@ -18828,14 +18968,14 @@ const {
18828
18968
  kGetNetConnect,
18829
18969
  kOptions,
18830
18970
  kFactory
18831
- } = __nccwpck_require__(63822)
18832
- const MockClient = __nccwpck_require__(4227)
18833
- const MockPool = __nccwpck_require__(36575)
18834
- const { matchValue, buildMockOptions } = __nccwpck_require__(38053)
18835
- const { InvalidArgumentError, UndiciError } = __nccwpck_require__(35990)
18836
- const Dispatcher = __nccwpck_require__(66071)
18837
- const Pluralizer = __nccwpck_require__(97472)
18838
- const PendingInterceptorsFormatter = __nccwpck_require__(56155)
18971
+ } = __nccwpck_require__(89083)
18972
+ const MockClient = __nccwpck_require__(69636)
18973
+ const MockPool = __nccwpck_require__(40660)
18974
+ const { matchValue, buildMockOptions } = __nccwpck_require__(16826)
18975
+ const { InvalidArgumentError, UndiciError } = __nccwpck_require__(47926)
18976
+ const Dispatcher = __nccwpck_require__(32171)
18977
+ const Pluralizer = __nccwpck_require__(69437)
18978
+ const PendingInterceptorsFormatter = __nccwpck_require__(9965)
18839
18979
 
18840
18980
  class MockAgent extends Dispatcher {
18841
18981
  constructor (opts) {
@@ -18978,15 +19118,15 @@ module.exports = MockAgent
18978
19118
 
18979
19119
  /***/ }),
18980
19120
 
18981
- /***/ 4227:
19121
+ /***/ 69636:
18982
19122
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18983
19123
 
18984
19124
  "use strict";
18985
19125
 
18986
19126
 
18987
19127
  const { promisify } = __nccwpck_require__(47261)
18988
- const Client = __nccwpck_require__(85849)
18989
- const { buildMockDispatch } = __nccwpck_require__(38053)
19128
+ const Client = __nccwpck_require__(6237)
19129
+ const { buildMockDispatch } = __nccwpck_require__(16826)
18990
19130
  const {
18991
19131
  kDispatches,
18992
19132
  kMockAgent,
@@ -18995,10 +19135,10 @@ const {
18995
19135
  kOrigin,
18996
19136
  kOriginalDispatch,
18997
19137
  kConnected
18998
- } = __nccwpck_require__(63822)
18999
- const { MockInterceptor } = __nccwpck_require__(9238)
19000
- const Symbols = __nccwpck_require__(13638)
19001
- const { InvalidArgumentError } = __nccwpck_require__(35990)
19138
+ } = __nccwpck_require__(89083)
19139
+ const { MockInterceptor } = __nccwpck_require__(73387)
19140
+ const Symbols = __nccwpck_require__(94822)
19141
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
19002
19142
 
19003
19143
  /**
19004
19144
  * MockClient provides an API that extends the Client to influence the mockDispatches.
@@ -19045,13 +19185,13 @@ module.exports = MockClient
19045
19185
 
19046
19186
  /***/ }),
19047
19187
 
19048
- /***/ 19329:
19188
+ /***/ 33519:
19049
19189
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
19050
19190
 
19051
19191
  "use strict";
19052
19192
 
19053
19193
 
19054
- const { UndiciError } = __nccwpck_require__(35990)
19194
+ const { UndiciError } = __nccwpck_require__(47926)
19055
19195
 
19056
19196
  const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')
19057
19197
 
@@ -19081,13 +19221,13 @@ module.exports = {
19081
19221
 
19082
19222
  /***/ }),
19083
19223
 
19084
- /***/ 9238:
19224
+ /***/ 73387:
19085
19225
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
19086
19226
 
19087
19227
  "use strict";
19088
19228
 
19089
19229
 
19090
- const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(38053)
19230
+ const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(16826)
19091
19231
  const {
19092
19232
  kDispatches,
19093
19233
  kDispatchKey,
@@ -19095,9 +19235,9 @@ const {
19095
19235
  kDefaultTrailers,
19096
19236
  kContentLength,
19097
19237
  kMockDispatch
19098
- } = __nccwpck_require__(63822)
19099
- const { InvalidArgumentError } = __nccwpck_require__(35990)
19100
- const { buildURL } = __nccwpck_require__(50011)
19238
+ } = __nccwpck_require__(89083)
19239
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
19240
+ const { buildURL } = __nccwpck_require__(31014)
19101
19241
 
19102
19242
  /**
19103
19243
  * Defines the scope API for an interceptor reply
@@ -19296,15 +19436,15 @@ module.exports.MockScope = MockScope
19296
19436
 
19297
19437
  /***/ }),
19298
19438
 
19299
- /***/ 36575:
19439
+ /***/ 40660:
19300
19440
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
19301
19441
 
19302
19442
  "use strict";
19303
19443
 
19304
19444
 
19305
19445
  const { promisify } = __nccwpck_require__(47261)
19306
- const Pool = __nccwpck_require__(80229)
19307
- const { buildMockDispatch } = __nccwpck_require__(38053)
19446
+ const Pool = __nccwpck_require__(49771)
19447
+ const { buildMockDispatch } = __nccwpck_require__(16826)
19308
19448
  const {
19309
19449
  kDispatches,
19310
19450
  kMockAgent,
@@ -19313,10 +19453,10 @@ const {
19313
19453
  kOrigin,
19314
19454
  kOriginalDispatch,
19315
19455
  kConnected
19316
- } = __nccwpck_require__(63822)
19317
- const { MockInterceptor } = __nccwpck_require__(9238)
19318
- const Symbols = __nccwpck_require__(13638)
19319
- const { InvalidArgumentError } = __nccwpck_require__(35990)
19456
+ } = __nccwpck_require__(89083)
19457
+ const { MockInterceptor } = __nccwpck_require__(73387)
19458
+ const Symbols = __nccwpck_require__(94822)
19459
+ const { InvalidArgumentError } = __nccwpck_require__(47926)
19320
19460
 
19321
19461
  /**
19322
19462
  * MockPool provides an API that extends the Pool to influence the mockDispatches.
@@ -19363,7 +19503,7 @@ module.exports = MockPool
19363
19503
 
19364
19504
  /***/ }),
19365
19505
 
19366
- /***/ 63822:
19506
+ /***/ 89083:
19367
19507
  /***/ ((module) => {
19368
19508
 
19369
19509
  "use strict";
@@ -19394,21 +19534,21 @@ module.exports = {
19394
19534
 
19395
19535
  /***/ }),
19396
19536
 
19397
- /***/ 38053:
19537
+ /***/ 16826:
19398
19538
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
19399
19539
 
19400
19540
  "use strict";
19401
19541
 
19402
19542
 
19403
- const { MockNotMatchedError } = __nccwpck_require__(19329)
19543
+ const { MockNotMatchedError } = __nccwpck_require__(33519)
19404
19544
  const {
19405
19545
  kDispatches,
19406
19546
  kMockAgent,
19407
19547
  kOriginalDispatch,
19408
19548
  kOrigin,
19409
19549
  kGetNetConnect
19410
- } = __nccwpck_require__(63822)
19411
- const { buildURL } = __nccwpck_require__(50011)
19550
+ } = __nccwpck_require__(89083)
19551
+ const { buildURL } = __nccwpck_require__(31014)
19412
19552
  const { STATUS_CODES } = __nccwpck_require__(88849)
19413
19553
  const {
19414
19554
  types: {
@@ -19769,7 +19909,7 @@ module.exports = {
19769
19909
 
19770
19910
  /***/ }),
19771
19911
 
19772
- /***/ 56155:
19912
+ /***/ 9965:
19773
19913
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
19774
19914
 
19775
19915
  "use strict";
@@ -19820,7 +19960,7 @@ module.exports = class PendingInterceptorsFormatter {
19820
19960
 
19821
19961
  /***/ }),
19822
19962
 
19823
- /***/ 97472:
19963
+ /***/ 69437:
19824
19964
  /***/ ((module) => {
19825
19965
 
19826
19966
  "use strict";
@@ -19857,7 +19997,7 @@ module.exports = class Pluralizer {
19857
19997
 
19858
19998
  /***/ }),
19859
19999
 
19860
- /***/ 77512:
20000
+ /***/ 63125:
19861
20001
  /***/ ((module) => {
19862
20002
 
19863
20003
  "use strict";
@@ -20288,21 +20428,21 @@ module.exports = {
20288
20428
 
20289
20429
  /***/ }),
20290
20430
 
20291
- /***/ 12714:
20431
+ /***/ 37917:
20292
20432
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
20293
20433
 
20294
20434
  "use strict";
20295
20435
 
20296
20436
 
20297
- const { kConstruct } = __nccwpck_require__(50591)
20298
- const { urlEquals, getFieldValues } = __nccwpck_require__(99205)
20299
- const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(50011)
20300
- const { webidl } = __nccwpck_require__(2227)
20301
- const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(51132)
20302
- const { Request, fromInnerRequest } = __nccwpck_require__(83211)
20303
- const { kState } = __nccwpck_require__(14935)
20304
- const { fetching } = __nccwpck_require__(78329)
20305
- const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(98730)
20437
+ const { kConstruct } = __nccwpck_require__(275)
20438
+ const { urlEquals, getFieldValues } = __nccwpck_require__(40424)
20439
+ const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(31014)
20440
+ const { webidl } = __nccwpck_require__(96163)
20441
+ const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(63042)
20442
+ const { Request, fromInnerRequest } = __nccwpck_require__(11192)
20443
+ const { kState } = __nccwpck_require__(23200)
20444
+ const { fetching } = __nccwpck_require__(87321)
20445
+ const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(40667)
20306
20446
  const assert = __nccwpck_require__(98061)
20307
20447
 
20308
20448
  /**
@@ -21155,16 +21295,16 @@ module.exports = {
21155
21295
 
21156
21296
  /***/ }),
21157
21297
 
21158
- /***/ 11069:
21298
+ /***/ 13256:
21159
21299
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
21160
21300
 
21161
21301
  "use strict";
21162
21302
 
21163
21303
 
21164
- const { kConstruct } = __nccwpck_require__(50591)
21165
- const { Cache } = __nccwpck_require__(12714)
21166
- const { webidl } = __nccwpck_require__(2227)
21167
- const { kEnumerableProperty } = __nccwpck_require__(50011)
21304
+ const { kConstruct } = __nccwpck_require__(275)
21305
+ const { Cache } = __nccwpck_require__(37917)
21306
+ const { webidl } = __nccwpck_require__(96163)
21307
+ const { kEnumerableProperty } = __nccwpck_require__(31014)
21168
21308
 
21169
21309
  class CacheStorage {
21170
21310
  /**
@@ -21315,28 +21455,28 @@ module.exports = {
21315
21455
 
21316
21456
  /***/ }),
21317
21457
 
21318
- /***/ 50591:
21458
+ /***/ 275:
21319
21459
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
21320
21460
 
21321
21461
  "use strict";
21322
21462
 
21323
21463
 
21324
21464
  module.exports = {
21325
- kConstruct: (__nccwpck_require__(13638).kConstruct)
21465
+ kConstruct: (__nccwpck_require__(94822).kConstruct)
21326
21466
  }
21327
21467
 
21328
21468
 
21329
21469
  /***/ }),
21330
21470
 
21331
- /***/ 99205:
21471
+ /***/ 40424:
21332
21472
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
21333
21473
 
21334
21474
  "use strict";
21335
21475
 
21336
21476
 
21337
21477
  const assert = __nccwpck_require__(98061)
21338
- const { URLSerializer } = __nccwpck_require__(96730)
21339
- const { isValidHeaderName } = __nccwpck_require__(98730)
21478
+ const { URLSerializer } = __nccwpck_require__(68889)
21479
+ const { isValidHeaderName } = __nccwpck_require__(40667)
21340
21480
 
21341
21481
  /**
21342
21482
  * @see https://url.spec.whatwg.org/#concept-url-equals
@@ -21381,7 +21521,7 @@ module.exports = {
21381
21521
 
21382
21522
  /***/ }),
21383
21523
 
21384
- /***/ 16155:
21524
+ /***/ 40503:
21385
21525
  /***/ ((module) => {
21386
21526
 
21387
21527
  "use strict";
@@ -21401,16 +21541,16 @@ module.exports = {
21401
21541
 
21402
21542
  /***/ }),
21403
21543
 
21404
- /***/ 15855:
21544
+ /***/ 84245:
21405
21545
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
21406
21546
 
21407
21547
  "use strict";
21408
21548
 
21409
21549
 
21410
- const { parseSetCookie } = __nccwpck_require__(80742)
21411
- const { stringify } = __nccwpck_require__(93989)
21412
- const { webidl } = __nccwpck_require__(2227)
21413
- const { Headers } = __nccwpck_require__(10561)
21550
+ const { parseSetCookie } = __nccwpck_require__(89386)
21551
+ const { stringify } = __nccwpck_require__(74600)
21552
+ const { webidl } = __nccwpck_require__(96163)
21553
+ const { Headers } = __nccwpck_require__(33924)
21414
21554
 
21415
21555
  /**
21416
21556
  * @typedef {Object} Cookie
@@ -21593,15 +21733,15 @@ module.exports = {
21593
21733
 
21594
21734
  /***/ }),
21595
21735
 
21596
- /***/ 80742:
21736
+ /***/ 89386:
21597
21737
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
21598
21738
 
21599
21739
  "use strict";
21600
21740
 
21601
21741
 
21602
- const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(16155)
21603
- const { isCTLExcludingHtab } = __nccwpck_require__(93989)
21604
- const { collectASequenceOfCodePointsFast } = __nccwpck_require__(96730)
21742
+ const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(40503)
21743
+ const { isCTLExcludingHtab } = __nccwpck_require__(74600)
21744
+ const { collectASequenceOfCodePointsFast } = __nccwpck_require__(68889)
21605
21745
  const assert = __nccwpck_require__(98061)
21606
21746
 
21607
21747
  /**
@@ -21911,7 +22051,7 @@ module.exports = {
21911
22051
 
21912
22052
  /***/ }),
21913
22053
 
21914
- /***/ 93989:
22054
+ /***/ 74600:
21915
22055
  /***/ ((module) => {
21916
22056
 
21917
22057
  "use strict";
@@ -22271,13 +22411,14 @@ module.exports = {
22271
22411
 
22272
22412
  /***/ }),
22273
22413
 
22274
- /***/ 41408:
22414
+ /***/ 71054:
22275
22415
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
22276
22416
 
22277
22417
  "use strict";
22278
22418
 
22419
+ const buffer = __nccwpck_require__(72254)
22279
22420
  const { Transform } = __nccwpck_require__(84492)
22280
- const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(19079)
22421
+ const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(97409)
22281
22422
 
22282
22423
  /**
22283
22424
  * @type {number[]} BOM
@@ -22300,11 +22441,19 @@ const COLON = 0x3A
22300
22441
  */
22301
22442
  const SPACE = 0x20
22302
22443
 
22444
+ const defaultMaxEventSize = buffer.kStringMaxLength
22445
+
22303
22446
  const DATA = Buffer.from('data')
22304
22447
  const EVENT = Buffer.from('event')
22305
22448
  const ID = Buffer.from('id')
22306
22449
  const RETRY = Buffer.from('retry')
22307
22450
 
22451
+ // Each data field creates a string node, and each unconsumed input chunk keeps
22452
+ // a Buffer wrapper. The absolute ceiling protects the large default byte limit.
22453
+ const minParserItems = 1024
22454
+ const maxParserItems = 131072
22455
+ const bytesPerParserItem = 128
22456
+
22308
22457
  function isASCIINumberBytes (buffer, start) {
22309
22458
  if (start >= buffer.length) {
22310
22459
  return false
@@ -22343,6 +22492,12 @@ function isFieldName (line, length, field) {
22343
22492
  return true
22344
22493
  }
22345
22494
 
22495
+ function createMaxEventSizeExceededError () {
22496
+ const error = new Error('EventSource message size exceeded')
22497
+ error.aborted = false
22498
+ return error
22499
+ }
22500
+
22346
22501
  /**
22347
22502
  * @typedef {object} EventSourceStreamEvent
22348
22503
  * @type {object}
@@ -22391,6 +22546,13 @@ class EventSourceStream extends Transform {
22391
22546
  pos = 0
22392
22547
  lineChunkIndex = 0
22393
22548
  linePos = 0
22549
+ lineLength = 0
22550
+ eventSize = 0
22551
+ eventFieldSizes = { data: 0, event: 0, id: 0, retry: 0 }
22552
+ dataLineCount = 0
22553
+ maxEventSize
22554
+ maxDataLines
22555
+ maxBufferedChunks
22394
22556
 
22395
22557
  event = {
22396
22558
  data: undefined,
@@ -22401,6 +22563,7 @@ class EventSourceStream extends Transform {
22401
22563
 
22402
22564
  /**
22403
22565
  * @param {object} options
22566
+ * @param {number} [options.maxEventSize]
22404
22567
  * @param {eventSourceSettings} options.eventSourceSettings
22405
22568
  * @param {Function} [options.push]
22406
22569
  */
@@ -22412,6 +22575,12 @@ class EventSourceStream extends Transform {
22412
22575
  super(options)
22413
22576
 
22414
22577
  this.state = options.eventSourceSettings || {}
22578
+ this.maxEventSize = options.maxEventSize ?? defaultMaxEventSize
22579
+ const parserItemLimit = this.maxEventSize > 0
22580
+ ? Math.min(maxParserItems, Math.max(minParserItems, Math.floor(this.maxEventSize / bytesPerParserItem)))
22581
+ : 0
22582
+ this.maxDataLines = parserItemLimit
22583
+ this.maxBufferedChunks = parserItemLimit
22415
22584
  if (options.push) {
22416
22585
  this.push = options.push
22417
22586
  }
@@ -22429,6 +22598,14 @@ class EventSourceStream extends Transform {
22429
22598
  return
22430
22599
  }
22431
22600
 
22601
+ // A leading line ending can immediately release the currently buffered
22602
+ // line, even when it uses the final allowed chunk slot.
22603
+ if (this.maxEventSize > 0 &&
22604
+ this.chunks.length >= this.maxBufferedChunks &&
22605
+ chunk[0] !== LF && chunk[0] !== CR) {
22606
+ callback(createMaxEventSizeExceededError())
22607
+ return
22608
+ }
22432
22609
  this.chunks.push(chunk)
22433
22610
 
22434
22611
  // Strip leading byte-order-mark if we opened the stream and started
@@ -22507,7 +22684,12 @@ class EventSourceStream extends Transform {
22507
22684
 
22508
22685
  // In any case, we can process the line as we reached an
22509
22686
  // end-of-line character
22510
- this.parseLine(this.readLine(), this.event)
22687
+ try {
22688
+ this.parseLine(this.readLine(), this.event)
22689
+ } catch (error) {
22690
+ callback(error)
22691
+ return
22692
+ }
22511
22693
  this.consumeCurrentByte()
22512
22694
  // A line was processed and this could be the end of the event. We need
22513
22695
  // to check if the next line is empty to determine if the event is
@@ -22516,15 +22698,28 @@ class EventSourceStream extends Transform {
22516
22698
  continue
22517
22699
  }
22518
22700
 
22701
+ // readLine() is only called after CR or LF. Reject an unfinished line
22702
+ // before it can retain an unbounded number of decoded chunks. The seven
22703
+ // extra bytes allow the longest field prefix ("event: " or "retry: ").
22704
+ if (this.maxEventSize > 0 && ++this.lineLength > this.maxEventSize + 7) {
22705
+ callback(createMaxEventSizeExceededError())
22706
+ return
22707
+ }
22519
22708
  this.advanceCursor()
22520
22709
  }
22521
22710
 
22522
22711
  callback()
22523
22712
  }
22524
22713
 
22714
+ _destroy (error, callback) {
22715
+ this.chunks.length = 0
22716
+ this.clearEvent()
22717
+ super._destroy(error, callback)
22718
+ }
22719
+
22525
22720
  /**
22526
22721
  * @param {Buffer} line
22527
- * @param {EventStreamEvent} event
22722
+ * @param {EventSourceStreamEvent} event
22528
22723
  */
22529
22724
  parseLine (line, event) {
22530
22725
  // If the line is empty (a blank line)
@@ -22558,6 +22753,13 @@ class EventSourceStream extends Transform {
22558
22753
  }
22559
22754
 
22560
22755
  if (isFieldName(line, fieldLength, DATA)) {
22756
+ if (this.maxEventSize > 0 && this.dataLineCount >= this.maxDataLines) {
22757
+ throw createMaxEventSizeExceededError()
22758
+ }
22759
+ const valueBytes = line.length - valueStart
22760
+ const dataSize = this.eventFieldSizes.data + (event.data === undefined ? 0 : 1) + valueBytes
22761
+ this.setEventFieldSize('data', dataSize)
22762
+
22561
22763
  const value = line.toString('utf8', valueStart)
22562
22764
 
22563
22765
  if (event.data === undefined) {
@@ -22565,11 +22767,13 @@ class EventSourceStream extends Transform {
22565
22767
  } else {
22566
22768
  event.data += `\n${value}`
22567
22769
  }
22770
+ this.dataLineCount++
22568
22771
  return
22569
22772
  }
22570
22773
 
22571
22774
  if (isFieldName(line, fieldLength, RETRY)) {
22572
22775
  if (isASCIINumberBytes(line, valueStart)) {
22776
+ this.setEventFieldSize('retry', line.length - valueStart)
22573
22777
  event.retry = line.toString('utf8', valueStart)
22574
22778
  }
22575
22779
  return
@@ -22577,20 +22781,29 @@ class EventSourceStream extends Transform {
22577
22781
 
22578
22782
  if (isFieldName(line, fieldLength, ID)) {
22579
22783
  if (isValidLastEventIdBytes(line, valueStart)) {
22784
+ this.setEventFieldSize('id', line.length - valueStart)
22580
22785
  event.id = line.toString('utf8', valueStart)
22581
22786
  }
22582
22787
  return
22583
22788
  }
22584
22789
 
22585
22790
  if (isFieldName(line, fieldLength, EVENT)) {
22586
- const value = line.toString('utf8', valueStart)
22587
-
22588
- if (value.length > 0) {
22589
- event.event = value
22791
+ if (valueStart < line.length) {
22792
+ this.setEventFieldSize('event', line.length - valueStart)
22793
+ event.event = line.toString('utf8', valueStart)
22590
22794
  }
22591
22795
  }
22592
22796
  }
22593
22797
 
22798
+ setEventFieldSize (field, size) {
22799
+ const eventSize = this.eventSize - this.eventFieldSizes[field] + size
22800
+ if (this.maxEventSize > 0 && eventSize > this.maxEventSize) {
22801
+ throw createMaxEventSizeExceededError()
22802
+ }
22803
+ this.eventSize = eventSize
22804
+ this.eventFieldSizes[field] = size
22805
+ }
22806
+
22594
22807
  /**
22595
22808
  * @param {EventSourceStreamEvent} event
22596
22809
  */
@@ -22621,6 +22834,12 @@ class EventSourceStream extends Transform {
22621
22834
  this.event.event = undefined
22622
22835
  this.event.id = undefined
22623
22836
  this.event.retry = undefined
22837
+ this.eventSize = 0
22838
+ this.dataLineCount = 0
22839
+ this.eventFieldSizes.data = 0
22840
+ this.eventFieldSizes.event = 0
22841
+ this.eventFieldSizes.id = 0
22842
+ this.eventFieldSizes.retry = 0
22624
22843
  }
22625
22844
 
22626
22845
  hasPendingEvent () {
@@ -22656,14 +22875,16 @@ class EventSourceStream extends Transform {
22656
22875
  syncLineStartToCursor () {
22657
22876
  this.lineChunkIndex = this.chunkIndex
22658
22877
  this.linePos = this.pos
22878
+ this.lineLength = 0
22659
22879
  this.dropConsumedChunks()
22660
22880
  }
22661
22881
 
22662
22882
  dropConsumedChunks () {
22663
- while (this.lineChunkIndex > 0) {
22664
- this.chunks.shift()
22665
- this.lineChunkIndex--
22666
- this.chunkIndex--
22883
+ if (this.lineChunkIndex > 0) {
22884
+ const consumed = this.lineChunkIndex
22885
+ this.chunks.splice(0, consumed)
22886
+ this.lineChunkIndex = 0
22887
+ this.chunkIndex -= consumed
22667
22888
  }
22668
22889
 
22669
22890
  if (this.chunkIndex === this.chunks.length) {
@@ -22772,23 +22993,24 @@ module.exports = {
22772
22993
 
22773
22994
  /***/ }),
22774
22995
 
22775
- /***/ 6731:
22996
+ /***/ 74292:
22776
22997
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
22777
22998
 
22778
22999
  "use strict";
22779
23000
 
22780
23001
 
22781
23002
  const { pipeline } = __nccwpck_require__(84492)
22782
- const { fetching } = __nccwpck_require__(78329)
22783
- const { makeRequest } = __nccwpck_require__(83211)
22784
- const { webidl } = __nccwpck_require__(2227)
22785
- const { EventSourceStream } = __nccwpck_require__(41408)
22786
- const { parseMIMEType } = __nccwpck_require__(96730)
22787
- const { createFastMessageEvent } = __nccwpck_require__(69459)
22788
- const { isNetworkError } = __nccwpck_require__(51132)
22789
- const { delay } = __nccwpck_require__(19079)
22790
- const { kEnumerableProperty } = __nccwpck_require__(50011)
22791
- const { environmentSettingsObject } = __nccwpck_require__(98730)
23003
+ const { fetching } = __nccwpck_require__(87321)
23004
+ const { makeRequest } = __nccwpck_require__(11192)
23005
+ const { webidl } = __nccwpck_require__(96163)
23006
+ const { EventSourceStream } = __nccwpck_require__(71054)
23007
+ const { parseMIMEType } = __nccwpck_require__(68889)
23008
+ const { createFastMessageEvent } = __nccwpck_require__(85021)
23009
+ const { isNetworkError } = __nccwpck_require__(63042)
23010
+ const { delay } = __nccwpck_require__(97409)
23011
+ const { kEnumerableProperty } = __nccwpck_require__(31014)
23012
+ const { environmentSettingsObject } = __nccwpck_require__(40667)
23013
+ const { getGlobalDispatcher } = __nccwpck_require__(53139)
22792
23014
 
22793
23015
  let experimentalWarned = false
22794
23016
 
@@ -23070,6 +23292,7 @@ class EventSource extends EventTarget {
23070
23292
 
23071
23293
  const eventSourceStream = new EventSourceStream({
23072
23294
  eventSourceSettings: this.#state,
23295
+ maxEventSize: this.#dispatcher.eventSourceOptions?.maxEventSize,
23073
23296
  push: (event) => {
23074
23297
  this.dispatchEvent(createFastMessageEvent(
23075
23298
  event.type,
@@ -23248,7 +23471,8 @@ webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
23248
23471
  },
23249
23472
  {
23250
23473
  key: 'dispatcher', // undici only
23251
- converter: webidl.converters.any
23474
+ converter: webidl.converters.any,
23475
+ defaultValue: () => getGlobalDispatcher()
23252
23476
  }
23253
23477
  ])
23254
23478
 
@@ -23260,7 +23484,7 @@ module.exports = {
23260
23484
 
23261
23485
  /***/ }),
23262
23486
 
23263
- /***/ 19079:
23487
+ /***/ 97409:
23264
23488
  /***/ ((module) => {
23265
23489
 
23266
23490
  "use strict";
@@ -23305,13 +23529,13 @@ module.exports = {
23305
23529
 
23306
23530
  /***/ }),
23307
23531
 
23308
- /***/ 12749:
23532
+ /***/ 48203:
23309
23533
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
23310
23534
 
23311
23535
  "use strict";
23312
23536
 
23313
23537
 
23314
- const util = __nccwpck_require__(50011)
23538
+ const util = __nccwpck_require__(31014)
23315
23539
  const {
23316
23540
  ReadableStreamFrom,
23317
23541
  isBlobLike,
@@ -23321,16 +23545,16 @@ const {
23321
23545
  fullyReadBody,
23322
23546
  extractMimeType,
23323
23547
  utf8DecodeBytes
23324
- } = __nccwpck_require__(98730)
23325
- const { FormData } = __nccwpck_require__(62598)
23326
- const { kState } = __nccwpck_require__(14935)
23327
- const { webidl } = __nccwpck_require__(2227)
23548
+ } = __nccwpck_require__(40667)
23549
+ const { FormData } = __nccwpck_require__(59550)
23550
+ const { kState } = __nccwpck_require__(23200)
23551
+ const { webidl } = __nccwpck_require__(96163)
23328
23552
  const { Blob } = __nccwpck_require__(72254)
23329
23553
  const assert = __nccwpck_require__(98061)
23330
23554
  const { isErrored, isDisturbed } = __nccwpck_require__(84492)
23331
23555
  const { isArrayBuffer } = __nccwpck_require__(93746)
23332
- const { serializeAMimeType } = __nccwpck_require__(96730)
23333
- const { multipartFormDataParser } = __nccwpck_require__(25152)
23556
+ const { serializeAMimeType } = __nccwpck_require__(68889)
23557
+ const { multipartFormDataParser } = __nccwpck_require__(95600)
23334
23558
  let random
23335
23559
 
23336
23560
  try {
@@ -23842,7 +24066,7 @@ module.exports = {
23842
24066
 
23843
24067
  /***/ }),
23844
24068
 
23845
- /***/ 54823:
24069
+ /***/ 49316:
23846
24070
  /***/ ((module) => {
23847
24071
 
23848
24072
  "use strict";
@@ -23974,7 +24198,7 @@ module.exports = {
23974
24198
 
23975
24199
  /***/ }),
23976
24200
 
23977
- /***/ 96730:
24201
+ /***/ 68889:
23978
24202
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
23979
24203
 
23980
24204
  "use strict";
@@ -24726,13 +24950,13 @@ module.exports = {
24726
24950
 
24727
24951
  /***/ }),
24728
24952
 
24729
- /***/ 61451:
24953
+ /***/ 65895:
24730
24954
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
24731
24955
 
24732
24956
  "use strict";
24733
24957
 
24734
24958
 
24735
- const { kConnected, kSize } = __nccwpck_require__(13638)
24959
+ const { kConnected, kSize } = __nccwpck_require__(94822)
24736
24960
 
24737
24961
  class CompatWeakRef {
24738
24962
  constructor (value) {
@@ -24780,15 +25004,15 @@ module.exports = function () {
24780
25004
 
24781
25005
  /***/ }),
24782
25006
 
24783
- /***/ 60027:
25007
+ /***/ 5583:
24784
25008
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
24785
25009
 
24786
25010
  "use strict";
24787
25011
 
24788
25012
 
24789
25013
  const { Blob, File } = __nccwpck_require__(72254)
24790
- const { kState } = __nccwpck_require__(14935)
24791
- const { webidl } = __nccwpck_require__(2227)
25014
+ const { kState } = __nccwpck_require__(23200)
25015
+ const { webidl } = __nccwpck_require__(96163)
24792
25016
 
24793
25017
  // TODO(@KhafraDev): remove
24794
25018
  class FileLike {
@@ -24914,17 +25138,17 @@ module.exports = { FileLike, isFileLike }
24914
25138
 
24915
25139
  /***/ }),
24916
25140
 
24917
- /***/ 25152:
25141
+ /***/ 95600:
24918
25142
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
24919
25143
 
24920
25144
  "use strict";
24921
25145
 
24922
25146
 
24923
- const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(50011)
24924
- const { utf8DecodeBytes } = __nccwpck_require__(98730)
24925
- const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(96730)
24926
- const { isFileLike } = __nccwpck_require__(60027)
24927
- const { makeEntry } = __nccwpck_require__(62598)
25147
+ const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(31014)
25148
+ const { utf8DecodeBytes } = __nccwpck_require__(40667)
25149
+ const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(68889)
25150
+ const { isFileLike } = __nccwpck_require__(5583)
25151
+ const { makeEntry } = __nccwpck_require__(59550)
24928
25152
  const assert = __nccwpck_require__(98061)
24929
25153
  const { File: NodeFile } = __nccwpck_require__(72254)
24930
25154
 
@@ -25396,17 +25620,17 @@ module.exports = {
25396
25620
 
25397
25621
  /***/ }),
25398
25622
 
25399
- /***/ 62598:
25623
+ /***/ 59550:
25400
25624
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
25401
25625
 
25402
25626
  "use strict";
25403
25627
 
25404
25628
 
25405
- const { isBlobLike, iteratorMixin } = __nccwpck_require__(98730)
25406
- const { kState } = __nccwpck_require__(14935)
25407
- const { kEnumerableProperty } = __nccwpck_require__(50011)
25408
- const { FileLike, isFileLike } = __nccwpck_require__(60027)
25409
- const { webidl } = __nccwpck_require__(2227)
25629
+ const { isBlobLike, iteratorMixin } = __nccwpck_require__(40667)
25630
+ const { kState } = __nccwpck_require__(23200)
25631
+ const { kEnumerableProperty } = __nccwpck_require__(31014)
25632
+ const { FileLike, isFileLike } = __nccwpck_require__(5583)
25633
+ const { webidl } = __nccwpck_require__(96163)
25410
25634
  const { File: NativeFile } = __nccwpck_require__(72254)
25411
25635
  const nodeUtil = __nccwpck_require__(47261)
25412
25636
 
@@ -25656,7 +25880,7 @@ module.exports = { FormData, makeEntry }
25656
25880
 
25657
25881
  /***/ }),
25658
25882
 
25659
- /***/ 13924:
25883
+ /***/ 22407:
25660
25884
  /***/ ((module) => {
25661
25885
 
25662
25886
  "use strict";
@@ -25704,7 +25928,7 @@ module.exports = {
25704
25928
 
25705
25929
  /***/ }),
25706
25930
 
25707
- /***/ 10561:
25931
+ /***/ 33924:
25708
25932
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
25709
25933
 
25710
25934
  "use strict";
@@ -25712,14 +25936,14 @@ module.exports = {
25712
25936
 
25713
25937
 
25714
25938
 
25715
- const { kConstruct } = __nccwpck_require__(13638)
25716
- const { kEnumerableProperty } = __nccwpck_require__(50011)
25939
+ const { kConstruct } = __nccwpck_require__(94822)
25940
+ const { kEnumerableProperty } = __nccwpck_require__(31014)
25717
25941
  const {
25718
25942
  iteratorMixin,
25719
25943
  isValidHeaderName,
25720
25944
  isValidHeaderValue
25721
- } = __nccwpck_require__(98730)
25722
- const { webidl } = __nccwpck_require__(2227)
25945
+ } = __nccwpck_require__(40667)
25946
+ const { webidl } = __nccwpck_require__(96163)
25723
25947
  const assert = __nccwpck_require__(98061)
25724
25948
  const util = __nccwpck_require__(47261)
25725
25949
 
@@ -26399,7 +26623,7 @@ module.exports = {
26399
26623
 
26400
26624
  /***/ }),
26401
26625
 
26402
- /***/ 78329:
26626
+ /***/ 87321:
26403
26627
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
26404
26628
 
26405
26629
  "use strict";
@@ -26413,9 +26637,9 @@ const {
26413
26637
  filterResponse,
26414
26638
  makeResponse,
26415
26639
  fromInnerResponse
26416
- } = __nccwpck_require__(51132)
26417
- const { HeadersList } = __nccwpck_require__(10561)
26418
- const { Request, cloneRequest } = __nccwpck_require__(83211)
26640
+ } = __nccwpck_require__(63042)
26641
+ const { HeadersList } = __nccwpck_require__(33924)
26642
+ const { Request, cloneRequest } = __nccwpck_require__(11192)
26419
26643
  const zlib = __nccwpck_require__(65628)
26420
26644
  const {
26421
26645
  bytesMatch,
@@ -26451,23 +26675,23 @@ const {
26451
26675
  buildContentRange,
26452
26676
  createInflate,
26453
26677
  extractMimeType
26454
- } = __nccwpck_require__(98730)
26455
- const { kState, kDispatcher } = __nccwpck_require__(14935)
26678
+ } = __nccwpck_require__(40667)
26679
+ const { kState, kDispatcher } = __nccwpck_require__(23200)
26456
26680
  const assert = __nccwpck_require__(98061)
26457
- const { safelyExtractBody, extractBody } = __nccwpck_require__(12749)
26681
+ const { safelyExtractBody, extractBody } = __nccwpck_require__(48203)
26458
26682
  const {
26459
26683
  redirectStatusSet,
26460
26684
  nullBodyStatus,
26461
26685
  safeMethodsSet,
26462
26686
  requestBodyHeader,
26463
26687
  subresourceSet
26464
- } = __nccwpck_require__(54823)
26688
+ } = __nccwpck_require__(49316)
26465
26689
  const EE = __nccwpck_require__(15673)
26466
26690
  const { Readable, pipeline, finished } = __nccwpck_require__(84492)
26467
- const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(50011)
26468
- const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(96730)
26469
- const { getGlobalDispatcher } = __nccwpck_require__(19405)
26470
- const { webidl } = __nccwpck_require__(2227)
26691
+ const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(31014)
26692
+ const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(68889)
26693
+ const { getGlobalDispatcher } = __nccwpck_require__(53139)
26694
+ const { webidl } = __nccwpck_require__(96163)
26471
26695
  const { STATUS_CODES } = __nccwpck_require__(88849)
26472
26696
  const GET_OR_HEAD = ['GET', 'HEAD']
26473
26697
 
@@ -28355,8 +28579,10 @@ async function httpNetworkFetch (
28355
28579
  // 19. Run these steps in parallel:
28356
28580
 
28357
28581
  // 1. Run these steps, but abort when fetchParams is canceled:
28358
- fetchParams.controller.onAborted = onAborted
28359
- fetchParams.controller.on('terminated', onAborted)
28582
+ if (!fetchParams.controller.resume) {
28583
+ fetchParams.controller.on('terminated', onAborted)
28584
+ }
28585
+
28360
28586
  fetchParams.controller.resume = async () => {
28361
28587
  // 1. While true
28362
28588
  while (true) {
@@ -28525,8 +28751,6 @@ async function httpNetworkFetch (
28525
28751
  }
28526
28752
  location = headersList.get('location', true)
28527
28753
 
28528
- this.body = new Readable({ read: resume })
28529
-
28530
28754
  const decoders = []
28531
28755
 
28532
28756
  const willFollow = location && request.redirect === 'follow' &&
@@ -28544,7 +28768,7 @@ async function httpNetworkFetch (
28544
28768
  // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
28545
28769
  const maxContentEncodings = 5
28546
28770
  if (codings.length > maxContentEncodings) {
28547
- reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
28771
+ this.abort(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
28548
28772
  return true
28549
28773
  }
28550
28774
 
@@ -28577,6 +28801,8 @@ async function httpNetworkFetch (
28577
28801
  }
28578
28802
  }
28579
28803
 
28804
+ this.body = new Readable({ read: resume })
28805
+
28580
28806
  const onError = this.onError.bind(this)
28581
28807
 
28582
28808
  resolve({
@@ -28623,10 +28849,6 @@ async function httpNetworkFetch (
28623
28849
  fetchParams.controller.off('terminated', this.abort)
28624
28850
  }
28625
28851
 
28626
- if (fetchParams.controller.onAborted) {
28627
- fetchParams.controller.off('terminated', fetchParams.controller.onAborted)
28628
- }
28629
-
28630
28852
  fetchParams.controller.ended = true
28631
28853
 
28632
28854
  this.body.push(null)
@@ -28679,7 +28901,7 @@ module.exports = {
28679
28901
 
28680
28902
  /***/ }),
28681
28903
 
28682
- /***/ 83211:
28904
+ /***/ 11192:
28683
28905
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
28684
28906
 
28685
28907
  "use strict";
@@ -28687,16 +28909,16 @@ module.exports = {
28687
28909
 
28688
28910
 
28689
28911
 
28690
- const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(12749)
28691
- const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(10561)
28692
- const { FinalizationRegistry } = __nccwpck_require__(61451)()
28693
- const util = __nccwpck_require__(50011)
28912
+ const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(48203)
28913
+ const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(33924)
28914
+ const { FinalizationRegistry } = __nccwpck_require__(65895)()
28915
+ const util = __nccwpck_require__(31014)
28694
28916
  const nodeUtil = __nccwpck_require__(47261)
28695
28917
  const {
28696
28918
  isValidHTTPToken,
28697
28919
  sameOrigin,
28698
28920
  environmentSettingsObject
28699
- } = __nccwpck_require__(98730)
28921
+ } = __nccwpck_require__(40667)
28700
28922
  const {
28701
28923
  forbiddenMethodsSet,
28702
28924
  corsSafeListedMethodsSet,
@@ -28706,12 +28928,12 @@ const {
28706
28928
  requestCredentials,
28707
28929
  requestCache,
28708
28930
  requestDuplex
28709
- } = __nccwpck_require__(54823)
28931
+ } = __nccwpck_require__(49316)
28710
28932
  const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util
28711
- const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(14935)
28712
- const { webidl } = __nccwpck_require__(2227)
28713
- const { URLSerializer } = __nccwpck_require__(96730)
28714
- const { kConstruct } = __nccwpck_require__(13638)
28933
+ const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(23200)
28934
+ const { webidl } = __nccwpck_require__(96163)
28935
+ const { URLSerializer } = __nccwpck_require__(68889)
28936
+ const { kConstruct } = __nccwpck_require__(94822)
28715
28937
  const assert = __nccwpck_require__(98061)
28716
28938
  const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(15673)
28717
28939
 
@@ -29724,15 +29946,15 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }
29724
29946
 
29725
29947
  /***/ }),
29726
29948
 
29727
- /***/ 51132:
29949
+ /***/ 63042:
29728
29950
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
29729
29951
 
29730
29952
  "use strict";
29731
29953
 
29732
29954
 
29733
- const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(10561)
29734
- const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(12749)
29735
- const util = __nccwpck_require__(50011)
29955
+ const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(33924)
29956
+ const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(48203)
29957
+ const util = __nccwpck_require__(31014)
29736
29958
  const nodeUtil = __nccwpck_require__(47261)
29737
29959
  const { kEnumerableProperty } = util
29738
29960
  const {
@@ -29744,16 +29966,16 @@ const {
29744
29966
  isErrorLike,
29745
29967
  isomorphicEncode,
29746
29968
  environmentSettingsObject: relevantRealm
29747
- } = __nccwpck_require__(98730)
29969
+ } = __nccwpck_require__(40667)
29748
29970
  const {
29749
29971
  redirectStatusSet,
29750
29972
  nullBodyStatus
29751
- } = __nccwpck_require__(54823)
29752
- const { kState, kHeaders } = __nccwpck_require__(14935)
29753
- const { webidl } = __nccwpck_require__(2227)
29754
- const { FormData } = __nccwpck_require__(62598)
29755
- const { URLSerializer } = __nccwpck_require__(96730)
29756
- const { kConstruct } = __nccwpck_require__(13638)
29973
+ } = __nccwpck_require__(49316)
29974
+ const { kState, kHeaders } = __nccwpck_require__(23200)
29975
+ const { webidl } = __nccwpck_require__(96163)
29976
+ const { FormData } = __nccwpck_require__(59550)
29977
+ const { URLSerializer } = __nccwpck_require__(68889)
29978
+ const { kConstruct } = __nccwpck_require__(94822)
29757
29979
  const assert = __nccwpck_require__(98061)
29758
29980
  const { types } = __nccwpck_require__(47261)
29759
29981
 
@@ -30342,7 +30564,7 @@ module.exports = {
30342
30564
 
30343
30565
  /***/ }),
30344
30566
 
30345
- /***/ 14935:
30567
+ /***/ 23200:
30346
30568
  /***/ ((module) => {
30347
30569
 
30348
30570
  "use strict";
@@ -30359,7 +30581,7 @@ module.exports = {
30359
30581
 
30360
30582
  /***/ }),
30361
30583
 
30362
- /***/ 98730:
30584
+ /***/ 40667:
30363
30585
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
30364
30586
 
30365
30587
  "use strict";
@@ -30367,14 +30589,14 @@ module.exports = {
30367
30589
 
30368
30590
  const { Transform } = __nccwpck_require__(84492)
30369
30591
  const zlib = __nccwpck_require__(65628)
30370
- const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(54823)
30371
- const { getGlobalOrigin } = __nccwpck_require__(13924)
30372
- const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(96730)
30592
+ const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(49316)
30593
+ const { getGlobalOrigin } = __nccwpck_require__(22407)
30594
+ const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(68889)
30373
30595
  const { performance } = __nccwpck_require__(38846)
30374
- const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(50011)
30596
+ const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(31014)
30375
30597
  const assert = __nccwpck_require__(98061)
30376
30598
  const { isUint8Array } = __nccwpck_require__(93746)
30377
- const { webidl } = __nccwpck_require__(2227)
30599
+ const { webidl } = __nccwpck_require__(96163)
30378
30600
 
30379
30601
  let supportedHashes = []
30380
30602
 
@@ -31999,7 +32221,7 @@ module.exports = {
31999
32221
 
32000
32222
  /***/ }),
32001
32223
 
32002
- /***/ 2227:
32224
+ /***/ 96163:
32003
32225
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
32004
32226
 
32005
32227
  "use strict";
@@ -32007,7 +32229,7 @@ module.exports = {
32007
32229
 
32008
32230
  const { types, inspect } = __nccwpck_require__(47261)
32009
32231
  const { markAsUncloneable } = __nccwpck_require__(24086)
32010
- const { toUSVString } = __nccwpck_require__(50011)
32232
+ const { toUSVString } = __nccwpck_require__(31014)
32011
32233
 
32012
32234
  /** @type {import('../../../types/webidl').Webidl} */
32013
32235
  const webidl = {}
@@ -32702,7 +32924,7 @@ module.exports = {
32702
32924
 
32703
32925
  /***/ }),
32704
32926
 
32705
- /***/ 74973:
32927
+ /***/ 73760:
32706
32928
  /***/ ((module) => {
32707
32929
 
32708
32930
  "use strict";
@@ -33000,7 +33222,7 @@ module.exports = {
33000
33222
 
33001
33223
  /***/ }),
33002
33224
 
33003
- /***/ 65153:
33225
+ /***/ 62596:
33004
33226
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
33005
33227
 
33006
33228
  "use strict";
@@ -33010,16 +33232,16 @@ const {
33010
33232
  staticPropertyDescriptors,
33011
33233
  readOperation,
33012
33234
  fireAProgressEvent
33013
- } = __nccwpck_require__(24277)
33235
+ } = __nccwpck_require__(86751)
33014
33236
  const {
33015
33237
  kState,
33016
33238
  kError,
33017
33239
  kResult,
33018
33240
  kEvents,
33019
33241
  kAborted
33020
- } = __nccwpck_require__(30010)
33021
- const { webidl } = __nccwpck_require__(2227)
33022
- const { kEnumerableProperty } = __nccwpck_require__(50011)
33242
+ } = __nccwpck_require__(42047)
33243
+ const { webidl } = __nccwpck_require__(96163)
33244
+ const { kEnumerableProperty } = __nccwpck_require__(31014)
33023
33245
 
33024
33246
  class FileReader extends EventTarget {
33025
33247
  constructor () {
@@ -33352,13 +33574,13 @@ module.exports = {
33352
33574
 
33353
33575
  /***/ }),
33354
33576
 
33355
- /***/ 53788:
33577
+ /***/ 30183:
33356
33578
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
33357
33579
 
33358
33580
  "use strict";
33359
33581
 
33360
33582
 
33361
- const { webidl } = __nccwpck_require__(2227)
33583
+ const { webidl } = __nccwpck_require__(96163)
33362
33584
 
33363
33585
  const kState = Symbol('ProgressEvent state')
33364
33586
 
@@ -33438,7 +33660,7 @@ module.exports = {
33438
33660
 
33439
33661
  /***/ }),
33440
33662
 
33441
- /***/ 30010:
33663
+ /***/ 42047:
33442
33664
  /***/ ((module) => {
33443
33665
 
33444
33666
  "use strict";
@@ -33456,7 +33678,7 @@ module.exports = {
33456
33678
 
33457
33679
  /***/ }),
33458
33680
 
33459
- /***/ 24277:
33681
+ /***/ 86751:
33460
33682
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
33461
33683
 
33462
33684
  "use strict";
@@ -33468,10 +33690,10 @@ const {
33468
33690
  kResult,
33469
33691
  kAborted,
33470
33692
  kLastProgressEventFired
33471
- } = __nccwpck_require__(30010)
33472
- const { ProgressEvent } = __nccwpck_require__(53788)
33473
- const { getEncoding } = __nccwpck_require__(74973)
33474
- const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(96730)
33693
+ } = __nccwpck_require__(42047)
33694
+ const { ProgressEvent } = __nccwpck_require__(30183)
33695
+ const { getEncoding } = __nccwpck_require__(73760)
33696
+ const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(68889)
33475
33697
  const { types } = __nccwpck_require__(47261)
33476
33698
  const { StringDecoder } = __nccwpck_require__(71576)
33477
33699
  const { btoa } = __nccwpck_require__(72254)
@@ -33855,28 +34077,28 @@ module.exports = {
33855
34077
 
33856
34078
  /***/ }),
33857
34079
 
33858
- /***/ 17299:
34080
+ /***/ 47524:
33859
34081
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
33860
34082
 
33861
34083
  "use strict";
33862
34084
 
33863
34085
 
33864
- const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(44285)
34086
+ const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(56004)
33865
34087
  const {
33866
34088
  kReadyState,
33867
34089
  kSentClose,
33868
34090
  kByteParser,
33869
34091
  kReceivedClose,
33870
34092
  kResponse
33871
- } = __nccwpck_require__(34939)
33872
- const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(93194)
33873
- const { channels } = __nccwpck_require__(65543)
33874
- const { CloseEvent } = __nccwpck_require__(69459)
33875
- const { makeRequest } = __nccwpck_require__(83211)
33876
- const { fetching } = __nccwpck_require__(78329)
33877
- const { Headers, getHeadersList } = __nccwpck_require__(10561)
33878
- const { getDecodeSplit } = __nccwpck_require__(98730)
33879
- const { WebsocketFrameSend } = __nccwpck_require__(84618)
34093
+ } = __nccwpck_require__(23992)
34094
+ const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(82487)
34095
+ const { channels } = __nccwpck_require__(96005)
34096
+ const { CloseEvent } = __nccwpck_require__(85021)
34097
+ const { makeRequest } = __nccwpck_require__(11192)
34098
+ const { fetching } = __nccwpck_require__(87321)
34099
+ const { Headers, getHeadersList } = __nccwpck_require__(33924)
34100
+ const { getDecodeSplit } = __nccwpck_require__(40667)
34101
+ const { WebsocketFrameSend } = __nccwpck_require__(4712)
33880
34102
 
33881
34103
  /** @type {import('crypto')} */
33882
34104
  let crypto
@@ -34234,7 +34456,7 @@ module.exports = {
34234
34456
 
34235
34457
  /***/ }),
34236
34458
 
34237
- /***/ 44285:
34459
+ /***/ 56004:
34238
34460
  /***/ ((module) => {
34239
34461
 
34240
34462
  "use strict";
@@ -34308,15 +34530,15 @@ module.exports = {
34308
34530
 
34309
34531
  /***/ }),
34310
34532
 
34311
- /***/ 69459:
34533
+ /***/ 85021:
34312
34534
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
34313
34535
 
34314
34536
  "use strict";
34315
34537
 
34316
34538
 
34317
- const { webidl } = __nccwpck_require__(2227)
34318
- const { kEnumerableProperty } = __nccwpck_require__(50011)
34319
- const { kConstruct } = __nccwpck_require__(13638)
34539
+ const { webidl } = __nccwpck_require__(96163)
34540
+ const { kEnumerableProperty } = __nccwpck_require__(31014)
34541
+ const { kConstruct } = __nccwpck_require__(94822)
34320
34542
  const { MessagePort } = __nccwpck_require__(24086)
34321
34543
 
34322
34544
  /**
@@ -34645,13 +34867,13 @@ module.exports = {
34645
34867
 
34646
34868
  /***/ }),
34647
34869
 
34648
- /***/ 84618:
34870
+ /***/ 4712:
34649
34871
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
34650
34872
 
34651
34873
  "use strict";
34652
34874
 
34653
34875
 
34654
- const { maxUnsigned16Bit } = __nccwpck_require__(44285)
34876
+ const { maxUnsigned16Bit } = __nccwpck_require__(56004)
34655
34877
 
34656
34878
  const BUFFER_SIZE = 16386
34657
34879
 
@@ -34749,15 +34971,15 @@ module.exports = {
34749
34971
 
34750
34972
  /***/ }),
34751
34973
 
34752
- /***/ 7133:
34974
+ /***/ 93711:
34753
34975
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
34754
34976
 
34755
34977
  "use strict";
34756
34978
 
34757
34979
 
34758
34980
  const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(65628)
34759
- const { isValidClientWindowBits } = __nccwpck_require__(93194)
34760
- const { MessageSizeExceededError } = __nccwpck_require__(35990)
34981
+ const { isValidClientWindowBits } = __nccwpck_require__(82487)
34982
+ const { MessageSizeExceededError } = __nccwpck_require__(47926)
34761
34983
 
34762
34984
  const tail = Buffer.from([0x00, 0x00, 0xff, 0xff])
34763
34985
  const kBuffer = Symbol('kBuffer')
@@ -34862,7 +35084,7 @@ module.exports = { PerMessageDeflate }
34862
35084
 
34863
35085
  /***/ }),
34864
35086
 
34865
- /***/ 46080:
35087
+ /***/ 44894:
34866
35088
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
34867
35089
 
34868
35090
  "use strict";
@@ -34870,9 +35092,9 @@ module.exports = { PerMessageDeflate }
34870
35092
 
34871
35093
  const { Writable } = __nccwpck_require__(84492)
34872
35094
  const assert = __nccwpck_require__(98061)
34873
- const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(44285)
34874
- const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(34939)
34875
- const { channels } = __nccwpck_require__(65543)
35095
+ const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(56004)
35096
+ const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(23992)
35097
+ const { channels } = __nccwpck_require__(96005)
34876
35098
  const {
34877
35099
  isValidStatusCode,
34878
35100
  isValidOpcode,
@@ -34882,11 +35104,11 @@ const {
34882
35104
  isControlFrame,
34883
35105
  isTextBinaryFrame,
34884
35106
  isContinuationFrame
34885
- } = __nccwpck_require__(93194)
34886
- const { WebsocketFrameSend } = __nccwpck_require__(84618)
34887
- const { closeWebSocketConnection } = __nccwpck_require__(17299)
34888
- const { PerMessageDeflate } = __nccwpck_require__(7133)
34889
- const { MessageSizeExceededError } = __nccwpck_require__(35990)
35107
+ } = __nccwpck_require__(82487)
35108
+ const { WebsocketFrameSend } = __nccwpck_require__(4712)
35109
+ const { closeWebSocketConnection } = __nccwpck_require__(47524)
35110
+ const { PerMessageDeflate } = __nccwpck_require__(93711)
35111
+ const { MessageSizeExceededError } = __nccwpck_require__(47926)
34890
35112
 
34891
35113
  function failWebsocketConnectionWithCode (ws, code, reason) {
34892
35114
  closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))
@@ -35117,6 +35339,20 @@ class ByteParser extends Writable {
35117
35339
  if (isControlFrame(this.#info.opcode)) {
35118
35340
  this.#loop = this.parseControlFrame(body)
35119
35341
  this.#state = parserStates.INFO
35342
+
35343
+ // If the automatic PONG/CLOSE reply filled the socket's write buffer,
35344
+ // stop parsing and resume on drain so a PING flood cannot grow the
35345
+ // outbound queue without bound.
35346
+ const socket = this.ws[kResponse].socket
35347
+ if (this.#loop && socket.writableNeedDrain) {
35348
+ this.#loop = false
35349
+ socket.once('drain', () => {
35350
+ if (this.destroyed) return
35351
+ this.#loop = true
35352
+ this.run(callback)
35353
+ })
35354
+ return
35355
+ }
35120
35356
  } else {
35121
35357
  if (!this.#info.compressed) {
35122
35358
  if (!this.writeFragments(body)) {
@@ -35383,15 +35619,15 @@ module.exports = {
35383
35619
 
35384
35620
  /***/ }),
35385
35621
 
35386
- /***/ 26515:
35622
+ /***/ 10243:
35387
35623
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
35388
35624
 
35389
35625
  "use strict";
35390
35626
 
35391
35627
 
35392
- const { WebsocketFrameSend } = __nccwpck_require__(84618)
35393
- const { opcodes, sendHints } = __nccwpck_require__(44285)
35394
- const FixedQueue = __nccwpck_require__(27092)
35628
+ const { WebsocketFrameSend } = __nccwpck_require__(4712)
35629
+ const { opcodes, sendHints } = __nccwpck_require__(56004)
35630
+ const FixedQueue = __nccwpck_require__(94856)
35395
35631
 
35396
35632
  /** @type {typeof Uint8Array} */
35397
35633
  const FastBuffer = Buffer[Symbol.species]
@@ -35495,7 +35731,7 @@ module.exports = { SendQueue }
35495
35731
 
35496
35732
  /***/ }),
35497
35733
 
35498
- /***/ 34939:
35734
+ /***/ 23992:
35499
35735
  /***/ ((module) => {
35500
35736
 
35501
35737
  "use strict";
@@ -35515,17 +35751,17 @@ module.exports = {
35515
35751
 
35516
35752
  /***/ }),
35517
35753
 
35518
- /***/ 93194:
35754
+ /***/ 82487:
35519
35755
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
35520
35756
 
35521
35757
  "use strict";
35522
35758
 
35523
35759
 
35524
- const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(34939)
35525
- const { states, opcodes } = __nccwpck_require__(44285)
35526
- const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(69459)
35760
+ const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(23992)
35761
+ const { states, opcodes } = __nccwpck_require__(56004)
35762
+ const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(85021)
35527
35763
  const { isUtf8 } = __nccwpck_require__(72254)
35528
- const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(96730)
35764
+ const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(68889)
35529
35765
 
35530
35766
  /* globals Blob */
35531
35767
 
@@ -35845,16 +36081,16 @@ module.exports = {
35845
36081
 
35846
36082
  /***/ }),
35847
36083
 
35848
- /***/ 16416:
36084
+ /***/ 43590:
35849
36085
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
35850
36086
 
35851
36087
  "use strict";
35852
36088
 
35853
36089
 
35854
- const { webidl } = __nccwpck_require__(2227)
35855
- const { URLSerializer } = __nccwpck_require__(96730)
35856
- const { environmentSettingsObject } = __nccwpck_require__(98730)
35857
- const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(44285)
36090
+ const { webidl } = __nccwpck_require__(96163)
36091
+ const { URLSerializer } = __nccwpck_require__(68889)
36092
+ const { environmentSettingsObject } = __nccwpck_require__(40667)
36093
+ const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(56004)
35858
36094
  const {
35859
36095
  kWebSocketURL,
35860
36096
  kReadyState,
@@ -35863,21 +36099,21 @@ const {
35863
36099
  kResponse,
35864
36100
  kSentClose,
35865
36101
  kByteParser
35866
- } = __nccwpck_require__(34939)
36102
+ } = __nccwpck_require__(23992)
35867
36103
  const {
35868
36104
  isConnecting,
35869
36105
  isEstablished,
35870
36106
  isClosing,
35871
36107
  isValidSubprotocol,
35872
36108
  fireEvent
35873
- } = __nccwpck_require__(93194)
35874
- const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(17299)
35875
- const { ByteParser } = __nccwpck_require__(46080)
35876
- const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(50011)
35877
- const { getGlobalDispatcher } = __nccwpck_require__(19405)
36109
+ } = __nccwpck_require__(82487)
36110
+ const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(47524)
36111
+ const { ByteParser } = __nccwpck_require__(44894)
36112
+ const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(31014)
36113
+ const { getGlobalDispatcher } = __nccwpck_require__(53139)
35878
36114
  const { types } = __nccwpck_require__(47261)
35879
- const { ErrorEvent, CloseEvent } = __nccwpck_require__(69459)
35880
- const { SendQueue } = __nccwpck_require__(26515)
36115
+ const { ErrorEvent, CloseEvent } = __nccwpck_require__(85021)
36116
+ const { SendQueue } = __nccwpck_require__(10243)
35881
36117
 
35882
36118
  // https://websockets.spec.whatwg.org/#interface-definition
35883
36119
  class WebSocket extends EventTarget {
@@ -66824,7 +67060,7 @@ async function resolveParentCommentBody(param, contextPorts) {
66824
67060
 
66825
67061
  /***/ }),
66826
67062
 
66827
- /***/ 37685:
67063
+ /***/ 281:
66828
67064
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
66829
67065
 
66830
67066
  "use strict";
@@ -82402,7 +82638,7 @@ exports.BranchNameRepository = BranchNameRepository;
82402
82638
 
82403
82639
  /***/ }),
82404
82640
 
82405
- /***/ 54874:
82641
+ /***/ 80742:
82406
82642
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
82407
82643
 
82408
82644
  "use strict";
@@ -82492,7 +82728,7 @@ function uniqueValidDependencies(candidates) {
82492
82728
 
82493
82729
  Object.defineProperty(exports, "__esModule", ({ value: true }));
82494
82730
  exports.BranchDependencyRepository = void 0;
82495
- const branch_dependency_policy_1 = __nccwpck_require__(54874);
82731
+ const branch_dependency_policy_1 = __nccwpck_require__(80742);
82496
82732
  const OPEN_DEPENDENCIES_QUERY = `
82497
82733
  query BranchSyncDependencies($owner: String!, $repo: String!, $issuesCursor: String, $pullsCursor: String) {
82498
82734
  repository(owner: $owner, name: $repo) {
@@ -96479,7 +96715,7 @@ const check_changes_issue_size_use_case_1 = __nccwpck_require__(28356);
96479
96715
  const change_size_project_membership_composition_root_1 = __nccwpck_require__(99375);
96480
96716
  const bugbot_autofix_use_case_1 = __nccwpck_require__(45446);
96481
96717
  const detect_bugbot_fix_intent_use_case_1 = __nccwpck_require__(76234);
96482
- const dismiss_bugbot_findings_use_case_1 = __nccwpck_require__(37685);
96718
+ const dismiss_bugbot_findings_use_case_1 = __nccwpck_require__(281);
96483
96719
  const remember_bugbot_rule_use_case_1 = __nccwpck_require__(17437);
96484
96720
  const detect_potential_problems_use_case_1 = __nccwpck_require__(6287);
96485
96721
  const notify_new_commit_on_issue_use_case_1 = __nccwpck_require__(33276);
@@ -100677,7 +100913,7 @@ const MAX_WORKFLOW_PAGES = 5;
100677
100913
  const MAX_WORKFLOW_FILE_CHECKS = 64;
100678
100914
  // Hash of the packaged credential-health workflow: every job is guarded by a
100679
100915
  // false-by-default input. A different remote file is never dispatched directly.
100680
- const TRUSTED_HEALTH_WORKFLOW_SHA256 = '7fa36bf72d144df6fe2ccc45b805ad442187aa6979dfda71446a54f607b18d61';
100916
+ const TRUSTED_HEALTH_WORKFLOW_SHA256 = '5f093b2c03bef389ccea68ef43bec3577cb1bfddc038da1884a146088f39a4ec';
100681
100917
  /** Dispatches a disabled-job branch override of a workflow already registered on default. */
100682
100918
  async function probeActions(context) {
100683
100919
  const preparationHttp = context.operatorHttp ?? context.http;
@@ -119109,7 +119345,7 @@ module.exports = JSON.parse('{"single":{"topLeft":"┌","top":"─","topRight":"
119109
119345
  /***/ ((module) => {
119110
119346
 
119111
119347
  "use strict";
119112
- module.exports = JSON.parse('{"revision":"2026-10-02.standalone.1","providers":{"codex":{"executable":"codex","reviewedVersion":"codex-cli 0.156.1","legacyNpmPackage":"@openai/codex","installation":{"unixScript":"https://chatgpt.com/codex/install.sh","windowsScript":"https://chatgpt.com/codex/install.ps1"}},"opencode":{"executable":"opencode","reviewedVersion":"1.18.3","legacyNpmPackage":"opencode-ai","installation":{"unixScript":"https://opencode.ai/install","windowsReleaseApi":"https://api.github.com/repos/anomalyco/opencode/releases/latest"}},"cursor":{"executable":"agent","reviewedVersion":"2026.09.10-fd3934a","installation":{"unixScript":"https://cursor.com/install","windowsScript":"https://cursor.com/install?win32=true"}}}}');
119348
+ module.exports = JSON.parse('{"revision":"2026-10-24.standalone.2","providers":{"codex":{"executable":"codex","reviewedVersion":"codex-cli 0.156.1","legacyNpmPackage":"@openai/codex","installation":{"unixScript":"https://chatgpt.com/codex/install.sh","windowsScript":"https://chatgpt.com/codex/install.ps1","scriptRecovery":{"unix":{"url":"https://raw.githubusercontent.com/openai/codex/b412ff32c417f855c2b2d1581b77058eed87c84b/scripts/install/install.sh","sha256":"150e3cf675682efeaac115aa3747add3f27887896d04ce6d0b56478d8b428bf6"},"windows":{"url":"https://raw.githubusercontent.com/openai/codex/b412ff32c417f855c2b2d1581b77058eed87c84b/scripts/install/install.ps1","sha256":"3522b77d4485eac014e70fa946787c95fad3874a4e9047557c1e044eb268d13e"}}}},"opencode":{"executable":"opencode","reviewedVersion":"1.18.3","legacyNpmPackage":"opencode-ai","installation":{"unixScript":"https://opencode.ai/install","windowsReleaseApi":"https://api.github.com/repos/anomalyco/opencode/releases/latest"}},"cursor":{"executable":"agent","reviewedVersion":"2026.09.10-fd3934a","installation":{"unixScript":"https://cursor.com/install","windowsScript":"https://cursor.com/install?win32=true"}}}}');
119113
119349
 
119114
119350
  /***/ }),
119115
119351