{"version":3,"file":"websocket.mjs","sources":["../../../../lib/web/websocket/websocket.js"],"sourcesContent":["'use strict'\n\nconst { isArrayBuffer } = require('node:util/types')\nconst { webidl } = require('../webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints, opcodes } = require('./constants')\nconst {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isClosed,\n  isValidSubprotocol,\n  fireEvent,\n  utf8Decode,\n  toArrayBuffer,\n  getURLRecord\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection, failWebsocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { ErrorEvent, CloseEvent, createFastMessageEvent } = require('./events')\nconst { SendQueue } = require('./sender')\nconst { WebsocketFrameSend } = require('./frame')\nconst { channels } = require('../../core/diagnostics')\n\nconst kRef = Symbol.for('nodejs.ref')\nconst kUnref = Symbol.for('nodejs.unref')\n\nfunction getSocketAddress (socket) {\n  if (typeof socket?.address === 'function') {\n    return socket.address()\n  }\n\n  if (typeof socket?.session?.socket?.address === 'function') {\n    return socket.session.socket.address()\n  }\n\n  return null\n}\n\n/**\n * @typedef {object} Handler\n * @property {(response: any, extensions?: string[]) => void} onConnectionEstablished\n * @property {(opcode: number, data: Buffer) => void} onMessage\n * @property {(error: Error) => void} onParserError\n * @property {() => void} onParserDrain\n * @property {(chunk: Buffer) => void} onSocketData\n * @property {(err: Error) => void} onSocketError\n * @property {() => void} onSocketClose\n * @property {(body: Buffer) => void} onPing\n * @property {(body: Buffer) => void} onPong\n *\n * @property {number} readyState\n * @property {import('stream').Duplex} socket\n * @property {Set<number>} closeState\n * @property {import('../fetch/index').Fetch} controller\n * @property {boolean} [wasEverConnected=false]\n */\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    close: null,\n    message: null\n  }\n\n  #bufferedAmount = 0\n  #protocol = ''\n  #extensions = ''\n  #refed = true\n\n  /** @type {SendQueue} */\n  #sendQueue\n\n  /** @type {Handler} */\n  #handler = {\n    onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions),\n    onMessage: (opcode, data) => this.#onMessage(opcode, data),\n    onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message),\n    onParserDrain: () => this.#onParserDrain(),\n    onSocketData: (chunk) => {\n      if (!this.#parser.write(chunk)) {\n        this.#handler.socket.pause()\n      }\n    },\n    onSocketError: (err) => {\n      this.#handler.readyState = states.CLOSING\n\n      if (channels.socketError.hasSubscribers) {\n        channels.socketError.publish(err)\n      }\n\n      this.#handler.socket.destroy()\n    },\n    onSocketClose: () => this.#onSocketClose(),\n    onPing: (body) => {\n      if (channels.ping.hasSubscribers) {\n        channels.ping.publish({\n          payload: body,\n          websocket: this\n        })\n      }\n    },\n    onPong: (body) => {\n      if (channels.pong.hasSubscribers) {\n        channels.pong.publish({\n          payload: body,\n          websocket: this\n        })\n      }\n    },\n\n    readyState: states.CONNECTING,\n    socket: null,\n    closeState: new Set(),\n    controller: null,\n    wasEverConnected: false\n  }\n\n  #url\n  #binaryType\n  /** @type {import('./receiver').ByteParser} */\n  #parser\n\n  /**\n   * @param {string} url\n   * @param {string|string[]} protocols\n   */\n  constructor (url, protocols = []) {\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'WebSocket constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols, prefix, 'options')\n\n    url = webidl.converters.USVString(url)\n    protocols = options.protocols\n\n    // 1. Let baseURL be this's relevant settings object's API base URL.\n    const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n    // 2. Let urlRecord be the result of getting a URL record given url and baseURL.\n    const urlRecord = getURLRecord(url, baseURL)\n\n    // 3. If protocols is a string, set protocols to a sequence consisting\n    //    of just that string.\n    if (typeof protocols === 'string') {\n      protocols = [protocols]\n    }\n\n    // 4. If any of the values in protocols occur more than once or otherwise\n    //    fail to match the requirements for elements that comprise the value\n    //    of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n    //    protocol, then throw a \"SyntaxError\" DOMException.\n    if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    // 5. Set this's url to urlRecord.\n    this.#url = new URL(urlRecord.href)\n\n    // 6. Let client be this's relevant settings object.\n    const client = environmentSettingsObject.settingsObject\n\n    // 7. Run this step in parallel:\n    // 7.1. Establish a WebSocket connection given urlRecord, protocols,\n    //      and client.\n    this.#handler.controller = establishWebSocketConnection(\n      urlRecord,\n      protocols,\n      client,\n      this.#handler,\n      options\n    )\n\n    // Each WebSocket object has an associated ready state, which is a\n    // number representing the state of the connection. Initially it must\n    // be CONNECTING (0).\n    this.#handler.readyState = WebSocket.CONNECTING\n\n    // The extensions attribute must initially return the empty string.\n\n    // The protocol attribute must initially return the empty string.\n\n    // Each WebSocket object has an associated binary type, which is a\n    // BinaryType. Initially it must be \"blob\".\n    this.#binaryType = 'blob'\n  }\n\n  [kRef] () {\n    webidl.brandCheck(this, WebSocket)\n\n    this.#refed = true\n    this.#handler.socket?.ref?.()\n  }\n\n  [kUnref] () {\n    webidl.brandCheck(this, WebSocket)\n\n    this.#refed = false\n    this.#handler.socket?.unref?.()\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n   * @param {number|undefined} code\n   * @param {string|undefined} reason\n   */\n  close (code = undefined, reason = undefined) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.close'\n\n    if (code !== undefined) {\n      code = webidl.converters['unsigned short'](code, prefix, 'code', webidl.attributes.Clamp)\n    }\n\n    if (reason !== undefined) {\n      reason = webidl.converters.USVString(reason)\n    }\n\n    // 1. If code is the special value \"missing\", then set code to null.\n    code ??= null\n\n    // 2. If reason is the special value \"missing\", then set reason to the empty string.\n    reason ??= ''\n\n    // 3. Close the WebSocket with this, code, and reason.\n    closeWebSocketConnection(this.#handler, code, reason, true)\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n   * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n   */\n  send (data) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.send'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n    // 1. If this's ready state is CONNECTING, then throw an\n    //    \"InvalidStateError\" DOMException.\n    if (isConnecting(this.#handler.readyState)) {\n      throw new DOMException('Sent before connected.', 'InvalidStateError')\n    }\n\n    // 2. Run the appropriate set of steps from the following list:\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n    if (!isEstablished(this.#handler.readyState) || isClosing(this.#handler.readyState)) {\n      return\n    }\n\n    // If data is a string\n    if (typeof data === 'string') {\n      // If the WebSocket connection is established and the WebSocket\n      // closing handshake has not yet started, then the user agent\n      // must send a WebSocket Message comprised of the data argument\n      // using a text frame opcode; if the data cannot be sent, e.g.\n      // because it would need to be buffered but the buffer is full,\n      // the user agent must flag the WebSocket as full and then close\n      // the WebSocket connection. Any invocation of this method with a\n      // string argument that does not throw an exception must increase\n      // the bufferedAmount attribute by the number of bytes needed to\n      // express the argument as UTF-8.\n\n      const buffer = Buffer.from(data)\n\n      this.#bufferedAmount += buffer.byteLength\n      this.#sendQueue.add(buffer, () => {\n        this.#bufferedAmount -= buffer.byteLength\n      }, sendHints.text)\n    } else if (isArrayBuffer(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need\n      // to be buffered but the buffer is full, the user agent must flag\n      // the WebSocket as full and then close the WebSocket connection.\n      // The data to be sent is the data stored in the buffer described\n      // by the ArrayBuffer object. Any invocation of this method with an\n      // ArrayBuffer argument that does not throw an exception must\n      // increase the bufferedAmount attribute by the length of the\n      // ArrayBuffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.arrayBuffer)\n    } else if (ArrayBuffer.isView(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The\n      // data to be sent is the data stored in the section of the buffer\n      // described by the ArrayBuffer object that data references. Any\n      // invocation of this method with this kind of argument that does\n      // not throw an exception must increase the bufferedAmount attribute\n      // by the length of data’s buffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.typedArray)\n    } else if (webidl.is.Blob(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The data\n      // to be sent is the raw data represented by the Blob object. Any\n      // invocation of this method with a Blob argument that does not throw\n      // an exception must increase the bufferedAmount attribute by the size\n      // of the Blob object’s raw data, in bytes.\n\n      this.#bufferedAmount += data.size\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.size\n      }, sendHints.blob)\n    }\n  }\n\n  get readyState () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The readyState getter steps are to return this's ready state.\n    return this.#handler.readyState\n  }\n\n  get bufferedAmount () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#bufferedAmount\n  }\n\n  get url () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The url getter steps are to return this's url, serialized.\n    return URLSerializer(this.#url)\n  }\n\n  get extensions () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#extensions\n  }\n\n  get protocol () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#protocol\n  }\n\n  get onopen () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    const listener = webidl.converters.EventHandlerNonNull(fn)\n\n    if (listener !== null) {\n      this.addEventListener('open', listener)\n      this.#events.open = fn\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    const listener = webidl.converters.EventHandlerNonNull(fn)\n\n    if (listener !== null) {\n      this.addEventListener('error', listener)\n      this.#events.error = fn\n    } else {\n      this.#events.error = null\n    }\n  }\n\n  get onclose () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.close\n  }\n\n  set onclose (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.close) {\n      this.removeEventListener('close', this.#events.close)\n    }\n\n    const listener = webidl.converters.EventHandlerNonNull(fn)\n\n    if (listener !== null) {\n      this.addEventListener('close', listener)\n      this.#events.close = fn\n    } else {\n      this.#events.close = null\n    }\n  }\n\n  get onmessage () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    const listener = webidl.converters.EventHandlerNonNull(fn)\n\n    if (listener !== null) {\n      this.addEventListener('message', listener)\n      this.#events.message = fn\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get binaryType () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#binaryType\n  }\n\n  set binaryType (type) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (type !== 'blob' && type !== 'arraybuffer') {\n      this.#binaryType = 'blob'\n    } else {\n      this.#binaryType = type\n    }\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   */\n  #onConnectionEstablished (response, parsedExtensions) {\n    // processResponse is called when the \"response's header list has been received and initialized.\"\n    // once this happens, the connection is open\n    this.#handler.socket = response.socket\n\n    if (!this.#refed) {\n      this.#handler.socket.unref?.()\n    }\n\n    // Get options from dispatcher options\n    const maxFragments = this.#handler.controller.dispatcher?.webSocketOptions?.maxFragments\n    const maxPayloadSize = this.#handler.controller.dispatcher?.webSocketOptions?.maxPayloadSize\n\n    const parser = new ByteParser(this.#handler, parsedExtensions, {\n      maxFragments,\n      maxPayloadSize\n    })\n    parser.on('drain', () => this.#handler.onParserDrain())\n    parser.on('error', (err) => this.#handler.onParserError(err))\n\n    this.#parser = parser\n    this.#sendQueue = new SendQueue(response.socket)\n\n    // 1. Change the ready state to OPEN (1).\n    this.#handler.readyState = states.OPEN\n\n    // 2. Change the extensions attribute’s value to the extensions in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n    const extensions = response.headersList.get('sec-websocket-extensions')\n\n    if (extensions !== null) {\n      this.#extensions = extensions\n    }\n\n    // 3. Change the protocol attribute’s value to the subprotocol in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n    const protocol = response.headersList.get('sec-websocket-protocol')\n\n    if (protocol !== null) {\n      this.#protocol = protocol\n    }\n\n    // 4. Fire an event named open at the WebSocket object.\n    fireEvent('open', this)\n\n    if (channels.open.hasSubscribers) {\n      // Convert headers to a plain object for the event\n      const headers = response.headersList.entries\n      channels.open.publish({\n        address: getSocketAddress(response.socket),\n        protocol: this.#protocol,\n        extensions: this.#extensions,\n        websocket: this,\n        handshakeResponse: {\n          status: response.status,\n          statusText: response.statusText,\n          headers\n        }\n      })\n    }\n  }\n\n  #onMessage (type, data) {\n    // 1. If ready state is not OPEN (1), then return.\n    if (this.#handler.readyState !== states.OPEN) {\n      return\n    }\n\n    // 2. Let dataForEvent be determined by switching on type and binary type:\n    let dataForEvent\n\n    if (type === opcodes.TEXT) {\n      // -> type indicates that the data is Text\n      //      a new DOMString containing data\n      try {\n        dataForEvent = utf8Decode(data)\n      } catch {\n        failWebsocketConnection(this.#handler, 1007, 'Received invalid UTF-8 in text frame.')\n        return\n      }\n    } else if (type === opcodes.BINARY) {\n      if (this.#binaryType === 'blob') {\n        // -> type indicates that the data is Binary and binary type is \"blob\"\n        //      a new Blob object, created in the relevant Realm of the WebSocket\n        //      object, that represents data as its raw data\n        dataForEvent = new Blob([data])\n      } else {\n        // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n        //      a new ArrayBuffer object, created in the relevant Realm of the\n        //      WebSocket object, whose contents are data\n        dataForEvent = toArrayBuffer(data)\n      }\n    }\n\n    // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n    //    with the origin attribute initialized to the serialization of the WebSocket\n    //    object’s url's origin, and the data attribute initialized to dataForEvent.\n    fireEvent('message', this, createFastMessageEvent, {\n      origin: this.#url.origin,\n      data: dataForEvent\n    })\n  }\n\n  #onParserDrain () {\n    this.#handler.socket.resume()\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n   */\n  #onSocketClose () {\n    // If the TCP connection was closed after the\n    // WebSocket closing handshake was completed, the WebSocket connection\n    // is said to have been closed _cleanly_.\n    const wasClean =\n      this.#handler.closeState.has(sentCloseFrameState.SENT) &&\n      this.#handler.closeState.has(sentCloseFrameState.RECEIVED)\n\n    let code = 1005\n    let reason = ''\n\n    const result = this.#parser?.closingInfo\n\n    if (result && !result.error) {\n      code = result.code ?? 1005\n      reason = result.reason\n    }\n\n    // 1. Change the ready state to CLOSED (3).\n    this.#handler.readyState = states.CLOSED\n\n    // 2. If the user agent was required to fail the WebSocket\n    //    connection, or if the WebSocket connection was closed\n    //    after being flagged as full, fire an event named error\n    //    at the WebSocket object.\n    if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {\n      // If _The WebSocket\n      // Connection is Closed_ and no Close control frame was received by the\n      // endpoint (such as could occur if the underlying transport connection\n      // is lost), _The WebSocket Connection Close Code_ is considered to be\n      // 1006.\n      code = 1006\n\n      fireEvent('error', this, (type, init) => new ErrorEvent(type, init), {\n        error: new TypeError(reason)\n      })\n    }\n\n    // 3. Fire an event named close at the WebSocket object,\n    //    using CloseEvent, with the wasClean attribute\n    //    initialized to true if the connection closed cleanly\n    //    and false otherwise, the code attribute initialized to\n    //    the WebSocket connection close code, and the reason\n    //    attribute initialized to the result of applying UTF-8\n    //    decode without BOM to the WebSocket connection close\n    //    reason.\n    // TODO: process.nextTick\n    fireEvent('close', this, (type, init) => new CloseEvent(type, init), {\n      wasClean, code, reason\n    })\n\n    if (channels.close.hasSubscribers) {\n      channels.close.publish({\n        websocket: this,\n        code,\n        reason\n      })\n    }\n  }\n\n  /**\n   * @param {WebSocket} ws\n   * @param {Buffer|undefined} buffer\n   */\n  static ping (ws, buffer) {\n    if (Buffer.isBuffer(buffer)) {\n      if (buffer.length > 125) {\n        throw new TypeError('A PING frame cannot have a body larger than 125 bytes.')\n      }\n    } else if (buffer !== undefined) {\n      throw new TypeError('Expected buffer payload')\n    }\n\n    // An endpoint MAY send a Ping frame any time after the connection is\n    // established and before the connection is closed.\n    const readyState = ws.#handler.readyState\n\n    if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) {\n      const frame = new WebsocketFrameSend(buffer)\n      ws.#handler.socket.write(frame.createFrame(opcodes.PING))\n    }\n  }\n}\n\nconst { ping } = WebSocket\nReflect.deleteProperty(WebSocket, 'ping')\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors,\n  url: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  bufferedAmount: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onclose: kEnumerableProperty,\n  close: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  binaryType: kEnumerableProperty,\n  send: kEnumerableProperty,\n  extensions: kEnumerableProperty,\n  protocol: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'WebSocket',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(WebSocket, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(\n  webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence<DOMString>'] = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === webidl.util.Types.OBJECT && Symbol.iterator in V) {\n    return webidl.converters['sequence<DOMString>'](V)\n  }\n\n  return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n  {\n    key: 'protocols',\n    converter: webidl.converters['DOMString or sequence<DOMString>'],\n    defaultValue: () => []\n  },\n  {\n    key: 'dispatcher',\n    converter: webidl.converters.any,\n    defaultValue: () => getGlobalDispatcher()\n  },\n  {\n    key: 'headers',\n    converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n  }\n])\n\nwebidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {\n  if (webidl.util.Type(V) === webidl.util.Types.OBJECT && !(Symbol.iterator in V)) {\n    return webidl.converters.WebSocketInit(V)\n  }\n\n  return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n  if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {\n    if (webidl.is.Blob(V)) {\n      return V\n    }\n\n    if (webidl.is.BufferSource(V)) {\n      return V\n    }\n  }\n\n  return webidl.converters.USVString(V)\n}\n\nmodule.exports = {\n  WebSocket,\n  ping\n}\n"],"names":["isArrayBuffer","require$$0","webidl","require$$1","URLSerializer","require$$2","environmentSettingsObject","require$$3","staticPropertyDescriptors","states","sentCloseFrameState","sendHints","opcodes","require$$4","isConnecting","isEstablished","isClosing","isClosed","isValidSubprotocol","fireEvent","utf8Decode","toArrayBuffer","getURLRecord","require$$5","establishWebSocketConnection","closeWebSocketConnection","failWebsocketConnection","require$$6","ByteParser","require$$7","kEnumerableProperty","require$$8","getGlobalDispatcher","require$$9","ErrorEvent","CloseEvent","createFastMessageEvent","require$$10","SendQueue","require$$11","WebsocketFrameSend","require$$12","channels","require$$13","kRef","Symbol","for","kUnref","WebSocket","EventTarget","events","open","error","close","message","bufferedAmount","protocol","extensions","refed","sendQueue","handler","onConnectionEstablished","response","this","onMessage","opcode","data","onParserError","err","onParserDrain","onSocketData","chunk","parser","write","socket","pause","onSocketError","readyState","CLOSING","socketError","hasSubscribers","publish","destroy","onSocketClose","onPing","body","ping","payload","websocket","onPong","pong","CONNECTING","closeState","Set","controller","wasEverConnected","url","binaryType","constructor","protocols","super","util","markAsUncloneable","prefix","argumentLengthCheck","arguments","options","converters","USVString","baseURL","settingsObject","baseUrl","urlRecord","length","map","p","toLowerCase","size","DOMException","every","URL","href","client","brandCheck","ref","unref","code","undefined","reason","attributes","Clamp","send","WebSocketSendData","buffer","Buffer","from","byteLength","add","text","arrayBuffer","ArrayBuffer","isView","typedArray","is","Blob","blob","onopen","fn","removeEventListener","listener","EventHandlerNonNull","addEventListener","onerror","onclose","onmessage","type","parsedExtensions","maxFragments","dispatcher","webSocketOptions","maxPayloadSize","on","OPEN","headersList","get","headers","entries","address","session","handshakeResponse","status","statusText","dataForEvent","TEXT","BINARY","origin","resume","wasClean","has","SENT","RECEIVED","result","closingInfo","CLOSED","init","TypeError","ws","isBuffer","frame","createFrame","PING","Reflect","deleteProperty","prototype","Object","defineProperties","toStringTag","value","writable","enumerable","configurable","sequenceConverter","DOMString","V","argument","Type","Types","OBJECT","iterator","WebSocketInit","dictionaryConverter","key","converter","defaultValue","any","nullableConverter","HeadersInit","BufferSource"],"mappings":"u5BAEA,MAAMA,eAAoBC,YACpBC,QAAaC,iBACbC,eAAoBC,kBACpBC,2BAAgCC,eAChCC,0BAA2BC,OAAQC,oBAAqBC,UAAWC,SAAcC,oBACjFC,aACQC,cACCC,UACJC,SACDC,mBACUC,UACTC,WACCC,cACGC,cAEXC,iBACEC,6BAA8BC,yBAA0BC,yBAA8BC,qBACtFC,YAAiBC,mBACjBC,qBAA0BC,MAC1BC,qBAA0BC,QAC1BC,WAAYC,WAAYC,wBAA6BC,iBACrDC,WAAgBC,iBAChBC,oBAAyBC,gBACzBC,UAAeC,YAEfC,KAAOC,OAAOC,IAAI,cAClBC,OAASF,OAAOC,IAAI;;;;;;;;;;;;;;;;;;;;AAkC1B,MAAME,kBAAkBC,YACtBC,QAAU,CACRC,KAAM,KACNC,MAAO,K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