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CAAC,CAAC;AACxD,aAAO,QAAQ,CAAC;KACjB;;;SApDG,QAAQ;GAAS,IAAI;;AAwD3B,MAAM,CAAC,OAAO,GAAG;AACf,SAAO,EAAP,OAAO;AACP,UAAQ,EAAR,QAAQ;AACR,SAAO,EAAP,OAAO;AACP,UAAQ,EAAR,QAAQ;CACT,CAAC","file":"fetch.js","sourcesContent":["const _       = require('lodash');\nconst HTTP    = require('http');\nconst Stream  = require('stream');\nconst URL     = require('url');\nconst Zlib    = require('zlib');\n\n\n// Decompress stream based on content and transfer encoding headers.\nfunction decompressStream(stream, headers) {\n  const transferEncoding  = headers.get('Transfer-Encoding');\n  const contentEncoding   = headers.get('Content-Encoding');\n  if (contentEncoding === 'deflate' || transferEncoding === 'deflate')\n    return stream.pipe( Zlib.createInflate() );\n  if (contentEncoding === 'gzip' || transferEncoding === 'gzip')\n    return stream.pipe( Zlib.createGunzip() );\n  return stream;\n}\n\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n\n  constructor(init) {\n    this._headers = [];\n    if (init instanceof Headers || init instanceof Array)\n      for (let [name, value] of init)\n        this.append(name, value);\n    else if (typeof init === \"object\")\n      _.each(init, (value, name)=> {\n        this.append(name, value);\n      });\n  }\n\n  append(name, value) {\n    const caseInsensitive = name.toLowerCase();\n    const castValue       = String(value).replace(/\\r\\n/g, '');\n    this._headers.push([caseInsensitive, castValue]);\n  }\n\n  delete(name) {\n    const caseInsensitive = name.toLowerCase();\n    this._headers = this._headers.filter(header => header[0] !== caseInsensitive);\n  }\n\n  get(name) {\n    const caseInsensitive = name.toLowerCase();\n    const namedHeader = _.find(this._headers, header => header[0] === caseInsensitive);\n    return namedHeader ? namedHeader[1] : null;\n  }\n\n  getAll(name) {\n    const caseInsensitive = name.toLowerCase();\n    return this._headers\n      .filter(header => header[0] === caseInsensitive)\n      .map(header => header[1]);\n  }\n\n  has(name) {\n    const caseInsensitive = name.toLowerCase();\n    const namedHeader = _.find(this._headers, header => header[0] === caseInsensitive);\n    return !!namedHeader;\n  }\n\n  set(name, value) {\n    const caseInsensitive = name.toLowerCase();\n    const castValue       = String(value).replace(/\\r\\n/g, '');\n    let   replaced        = false;\n    this._headers = this._headers.reduce(function(memo, header) {\n      if (header[0] !== caseInsensitive)\n        memo.push(header);\n      else if (!replaced) {\n        memo.push([header[0], castValue]);\n        replaced = true;\n      }\n      return memo;\n    }, []);\n\n    if (!replaced)\n      this.append(name, value);\n  }\n\n  [Symbol.iterator]() {\n    return this._headers[Symbol.iterator]();\n  }\n\n  valueOf() {\n    return this._headers.map(([name, value])=> `${name}: ${value}`);\n  }\n\n  toString() {\n    return this.valueOf().join('\\n');\n  }\n\n  toObject() {\n    const object = Object.create(null);\n    for (let [name, value] of this._headers)\n      object[name] = value;\n    return object;\n  }\n\n}\n\n\nclass FormData {\n\n  constructor() {\n    this._entries = [];\n  }\n\n  append(name, value /*, filename*/) {\n    // TODO add support for files\n    this._entries.push([name, value]);\n  }\n\n  set(name, value, filename) {\n    this.delete(name);\n    this.append(name, value, filename);\n  }\n\n  delete(name) {\n    this._entries = this._entries.filter(entry => entry[0] !== name);\n  }\n\n  get(name) {\n    const namedEntry = _.find(this._entries, entry => entry[0] === name);\n    return namedEntry ? namedEntry[1] : null;\n  }\n\n  getAll(name) {\n    return this._entries\n      .filter(entry => entry[0] === name)\n      .map(entry => entry[1]);\n  }\n\n  has(name) {\n    const namedEntry = _.find(this._entries, entry => entry[0] === name);\n    return !!namedEntry;\n  }\n\n  [Symbol.iterator]() {\n    return this._entries[Symbol.iterator]();\n  }\n\n  get length() {\n    return this._entries.length;\n  }\n\n  _asStream(boundary) {\n    const iterator  = this._entries[Symbol.iterator]();\n    const stream    = new Stream.Readable();\n    stream._read = function() {\n      const next = iterator.next();\n      if (next.value) {\n        const [name, value] = next.value;\n        this.push(`--${boundary}\\r\\n`);\n        if (value.read) {\n          const buffer = value.read();\n          this.push(`Content-Disposition: form-data; name=\\\"${name}\\\"; filename=\\\"${value}\\\"\\r\\n`);\n          this.push(`Content-Type: ${value.mime || 'application/octet-stream'}\\r\\n`);\n          this.push(`Content-Length: ${buffer.length}\\r\\n`);\n          this.push(`\\r\\n`);\n          this.push(buffer);\n        } else {\n          const text = value.toString('utf-8');\n          this.push(`Content-Disposition: form-data; name=\\\"${name}\\\"\\r\\n`);\n          this.push(`Content-Type: text/plain; charset=utf8\\r\\n`);\n          this.push(`Content-Length: ${text.length}\\r\\n`);\n          this.push(`\\r\\n`);\n          this.push(text);\n        }\n        this.push('\\r\\n');\n      }\n      if (next.done) {\n        this.push(`--${boundary}--`);\n        this.push(null);\n      }\n    };\n    return stream;\n  }\n}\n\n\nclass Body {\n\n  constructor(bodyInit) {\n    if (bodyInit instanceof Body) {\n      this._stream = bodyInit._stream;\n      this._contentType = bodyInit.headers.get('Content-Type');\n    } else if (bodyInit instanceof Stream.Readable) {\n      // Request + Replay start streaming immediately, so we need this trick to\n      // buffer HTTP responses; this is likely a bug in Replay\n      this._stream = new Stream.PassThrough();\n      this._stream.pause();\n      bodyInit.pipe(this._stream);\n    } else if (typeof bodyInit === 'string' || bodyInit instanceof String) {\n      this._stream = new Stream.Readable();\n      this._stream._read = function() {\n        this.push(bodyInit);\n        this.push(null);\n      };\n      this._contentType = 'text/plain;charset=UTF-8';\n    } else if (bodyInit instanceof FormData && bodyInit.length) {\n      const boundary = `${new Date().getTime()}.${Math.random()}`;\n      this._contentType = `multipart/form-data;boundary=${boundary}`;\n      this._stream   = bodyInit._asStream(boundary);\n    } else if (bodyInit instanceof FormData)\n      this._contentType = 'text/plain;charset=UTF-8';\n    else if (bodyInit)\n      throw new TypeError('This body type not yet supported');\n\n    this._bodyUsed  = false;\n    this.body       = null;\n  }\n\n  get bodyUsed() {\n    return this._bodyUsed;\n  }\n\n  arrayBuffer() {\n    return this\n      ._consume()\n      .then((buffer)=> {\n        this.body = buffer;\n      })\n      .then(()=> {\n        const arrayBuffer = new Uint8Array(this.body.length);\n        for (let i = 0; i < this.body.length; ++i)\n          arrayBuffer[i] = this.body[i];\n        return arrayBuffer;\n      });\n  }\n\n  blob() {\n    throw new Error('Not implemented yet');\n  }\n\n  formData() {\n    return this\n      ._consume()\n      .then((buffer)=> {\n        this.body = buffer;\n      })\n      .then(()=> {\n\n        const contentType = this.headers.get('Content-Type') || '';\n        const mimeType    = contentType.split(';')[0];\n        switch (mimeType) {\n          case 'multipart/form-data': {\n            throw new Error('Not implemented yet');\n          }\n          case 'application/x-www-form-urlencoded': {\n            throw new Error('Not implemented yet');\n          }\n          default: {\n            throw new TypeError(`formData does not support MIME type ${mimeType}`);\n          }\n        }\n\n      });\n  }\n\n  json() {\n    return this\n      ._consume()\n      .then((buffer)=> {\n        this.body = buffer.toString('utf-8');\n      })\n      .then(()=> {\n        return JSON.parse(this.body);\n      });\n  }\n\n  text() {\n    return this\n      ._consume()\n      .then((buffer)=> {\n        this.body = buffer.toString();\n      })\n      .then(()=> {\n        return this.body;\n      });\n  }\n\n\n  // -- Implementation details --\n\n  _consume() {\n    if (this._bodyUsed)\n      throw new TypeError('Body already consumed');\n    this._bodyUsed = true;\n\n    // When Request has no body, _stream is typically null\n    if (!this._stream)\n      return null;\n    // When Response has no body, we get stream that's no longer readable\n    if (!this._stream.readable)\n      return new Buffer('');\n\n    const decompressed = decompressStream(this._stream, this.headers);\n\n    return new Promise(function(resolve, reject) {\n      const buffers = [];\n      decompressed\n        .on('data', function(buffer) {\n          buffers.push(buffer);\n        })\n        .on('end', function() {\n          resolve(Buffer.concat(buffers));\n        })\n        .on('error', reject)\n        .resume();\n    });\n  }\n\n}\n\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request extends Body {\n\n  constructor(input, init) {\n    const method = ((init ? init.method : input.method) || 'GET').toUpperCase();\n    let bodyInit = null;\n\n    if (input instanceof Request && input._stream) {\n      if (input._bodyUsed)\n        throw new TypeError('Request body already used');\n      bodyInit        = input;\n      input._bodyUsed = true;\n    }\n\n    if (init && init.body) {\n      if (method === 'GET' || method === 'HEAD')\n        throw new TypeError('Cannot include body with GET/HEAD request');\n      bodyInit = init.body;\n    }\n    super(bodyInit);\n\n    if (typeof input === 'string' || input instanceof String)\n      this.url = URL.format(input);\n    else if (input instanceof Request)\n      this.url = input.url;\n    if (!this.url)\n      throw new TypeError('Input must be string or another Request');\n\n    this.method   = method;\n    this.headers  = new Headers(init ? init.headers : input.headers);\n    if (this._contentType && !this.headers.has('Content-Type'))\n      this.headers.set('Content-Type', this._contentType);\n\n    // Default redirect is follow, also treat manual as follow\n    this.redirect = init && init.redirect;\n    if (this.redirect !== 'error')\n      this.redirect = 'follow';\n    this._redirectCount = 0;\n  }\n\n  // -- From Request interface --\n\n  clone() {\n    if (this._bodyUsed)\n      throw new TypeError('This Request body has already been used');\n    throw new Error('Not implemented yet');\n  }\n\n\n  // -- From Body interface --\n\n}\n\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response extends Body {\n\n  constructor(bodyInit, responseInit) {\n    super(bodyInit);\n    if (responseInit) {\n      if (responseInit.status < 200 || responseInit.status > 599)\n        throw new RangeError(`Status code ${responseInit.status} not in range`);\n      const statusText = responseInit.statusText || HTTP.STATUS_CODES[responseInit.status] || 'Unknown';\n      if (!/^[^\\n\\r]+$/.test(statusText))\n        throw new TypeError(`Status text ${responseInit.statusText} not valid format`);\n\n      this._url       = URL.format(responseInit.url || '');\n      this.type       = 'default';\n      this.status     = responseInit.status;\n      this.statusText = statusText;\n      this.headers    = new Headers(responseInit.headers);\n    } else {\n      this.type       = 'error';\n      this.status     = 0;\n      this.statusText = '';\n      this.headers    = new Headers();\n    }\n    if (this._contentType && !this.headers.has('Content-Type'))\n      this.headers.set('Content-Type', this._contentType);\n  }\n\n  get url() {\n    return (this._url || '').split('#')[0];\n  }\n\n  get ok() {\n    return (this.status >= 200 && this.status <= 299);\n  }\n\n  clone() {\n    if (this._bodyUsed)\n      throw new TypeError('This Response body has already been used');\n    throw new Error('Not implemented yet');\n  }\n\n  static error() {\n    return new Response();\n  }\n\n  static redirect(url, status = 302) {\n    const parsedURL = URL.parse(url);\n    if ([301, 302, 303, 307, 308].indexOf(status) < 0)\n      throw new RangeError(`Status code ${status} not valid redirect code`);\n    const statusText = HTTP.STATUS_CODES[status];\n    const response = new Response(null, { status, statusText });\n    response.headers.set('Location', URL.format(parsedURL));\n    return response;\n  }\n}\n\n\nmodule.exports = {\n  Headers,\n  FormData,\n  Request,\n  Response\n};\n"]}