diff options
Diffstat (limited to 'together/node_modules/superagent')
20 files changed, 8443 insertions, 0 deletions
diff --git a/together/node_modules/superagent/LICENSE b/together/node_modules/superagent/LICENSE new file mode 100644 index 0000000..1b188ba --- /dev/null +++ b/together/node_modules/superagent/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/together/node_modules/superagent/README.md b/together/node_modules/superagent/README.md new file mode 100644 index 0000000..d2305a4 --- /dev/null +++ b/together/node_modules/superagent/README.md @@ -0,0 +1,271 @@ +# superagent + +[![build status](https://img.shields.io/travis/visionmedia/superagent.svg)](https://travis-ci.org/visionmedia/superagent) +[![code coverage](https://img.shields.io/codecov/c/github/visionmedia/superagent.svg)](https://codecov.io/gh/visionmedia/superagent) +[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) +[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) +[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org) +[![license](https://img.shields.io/github/license/visionmedia/superagent.svg)](LICENSE) + +> Small progressive client-side HTTP request library, and Node.js module with the same API, supporting many high-level HTTP client features + + +## Table of Contents + +* [Install](#install) +* [Usage](#usage) + * [Node](#node) + * [Browser](#browser) +* [Supported Platforms](#supported-platforms) + * [Required Browser Features](#required-browser-features) +* [Plugins](#plugins) +* [Upgrading from previous versions](#upgrading-from-previous-versions) +* [Contributors](#contributors) +* [License](#license) + + +## Install + +[npm][]: + +```sh +npm install superagent +``` + +[yarn][]: + +```sh +yarn add superagent +``` + + +## Usage + +### Node + +```js +const superagent = require('superagent'); + +// callback +superagent + .post('/api/pet') + .send({ name: 'Manny', species: 'cat' }) // sends a JSON post body + .set('X-API-Key', 'foobar') + .set('accept', 'json') + .end((err, res) => { + // Calling the end function will send the request + }); + +// promise with then/catch +superagent.post('/api/pet').then(console.log).catch(console.error); + +// promise with async/await +(async () => { + try { + const res = await superagent.post('/api/pet'); + console.log(res); + } catch (err) { + console.error(err); + } +})(); +``` + +### Browser + +**The browser-ready, minified version of `superagent` is only 50 KB (minified and gzipped).** + +Browser-ready versions of this module are available via [jsdelivr][], [unpkg][], and also in the `node_modules/superagent/dist` folder in downloads of the `superagent` package. + +> Note that we also provide unminified versions with `.js` instead of `.min.js` file extensions. + +#### VanillaJS + +This is the solution for you if you're just using `<script>` tags everywhere! + +```html +<script src="https://polyfill.io/v3/polyfill.min.js?features=WeakRef,BigInt"></script> +<script src="https://cdn.jsdelivr.net/npm/superagent"></script> +<!-- if you wish to use unpkg.com instead: --> +<!-- <script src="https://unpkg.com/superagent"></script> --> +<script type="text/javascript"> + (function() { + // superagent is exposed as `window.superagent` + // if you wish to use "request" instead please + // uncomment the following line of code: + // `window.request = superagent;` + superagent + .post('/api/pet') + .send({ name: 'Manny', species: 'cat' }) // sends a JSON post body + .set('X-API-Key', 'foobar') + .set('accept', 'json') + .end(function (err, res) { + // Calling the end function will send the request + }); + })(); +</script> +``` + +#### Bundler + +If you are using [browserify][], [webpack][], [rollup][], or another bundler, then you can follow the same usage as [Node](#node) above. + + +## Supported Platforms + +* Node: v6.x+ +* Browsers (see [.browserslistrc](.browserslistrc)): + + ```sh + npx browserslist + ``` + + ```sh + and_chr 102 + and_ff 101 + and_qq 10.4 + and_uc 12.12 + android 101 + chrome 103 + chrome 102 + chrome 101 + chrome 100 + edge 103 + edge 102 + edge 101 + firefox 101 + firefox 100 + firefox 91 + ios_saf 15.5 + ios_saf 15.4 + ios_saf 15.2-15.3 + ios_saf 15.0-15.1 + ios_saf 14.5-14.8 + ios_saf 14.0-14.4 + ios_saf 12.2-12.5 + kaios 2.5 + op_mini all + op_mob 64 + opera 86 + opera 85 + safari 15.5 + safari 15.4 + samsung 17.0 + samsung 16.0 + ``` + +### Required Browser Features + +We recommend using <https://polyfill.io> (specifically with the bundle mentioned in [VanillaJS](#vanillajs) above): + +```html +<script src="https://polyfill.io/v3/polyfill.min.js?features=WeakRef,BigInt"></script> +``` + +* WeakRef is not supported in Opera 85, iOS Safari 12.2-12.5 +* BigInt is not supported in iOS Safari 12.2-12.5 + + +## Plugins + +SuperAgent is easily extended via plugins. + +```js +const nocache = require('superagent-no-cache'); +const superagent = require('superagent'); +const prefix = require('superagent-prefix')('/static'); + +superagent + .get('/some-url') + .query({ action: 'edit', city: 'London' }) // query string + .use(prefix) // Prefixes *only* this request + .use(nocache) // Prevents caching of *only* this request + .end((err, res) => { + // Do something + }); +``` + +Existing plugins: + +* [superagent-no-cache](https://github.com/johntron/superagent-no-cache) - prevents caching by including Cache-Control header +* [superagent-prefix](https://github.com/johntron/superagent-prefix) - prefixes absolute URLs (useful in test environment) +* [superagent-suffix](https://github.com/timneutkens1/superagent-suffix) - suffix URLs with a given path +* [superagent-mock](https://github.com/M6Web/superagent-mock) - simulate HTTP calls by returning data fixtures based on the requested URL +* [superagent-mocker](https://github.com/shuvalov-anton/superagent-mocker) — simulate REST API +* [superagent-cache](https://github.com/jpodwys/superagent-cache) - A global SuperAgent patch with built-in, flexible caching +* [superagent-cache-plugin](https://github.com/jpodwys/superagent-cache-plugin) - A SuperAgent plugin with built-in, flexible caching +* [superagent-jsonapify](https://github.com/alex94puchades/superagent-jsonapify) - A lightweight [json-api](http://jsonapi.org/format/) client addon for superagent +* [superagent-serializer](https://github.com/zzarcon/superagent-serializer) - Converts server payload into different cases +* [superagent-httpbackend](https://www.npmjs.com/package/superagent-httpbackend) - stub out requests using AngularJS' $httpBackend syntax +* [superagent-throttle](https://github.com/leviwheatcroft/superagent-throttle) - queues and intelligently throttles requests +* [superagent-charset](https://github.com/magicdawn/superagent-charset) - add charset support for node's SuperAgent +* [superagent-verbose-errors](https://github.com/jcoreio/superagent-verbose-errors) - include response body in error messages for failed requests +* [superagent-declare](https://github.com/damoclark/superagent-declare) - A simple [declarative](https://en.wikipedia.org/wiki/Declarative_programming) API for SuperAgent +* [superagent-node-http-timings](https://github.com/webuniverseio/superagent-node-http-timings) - measure http timings in node.js + +Please prefix your plugin with `superagent-*` so that it can easily be found by others. + +For SuperAgent extensions such as couchdb and oauth visit the [wiki](https://github.com/visionmedia/superagent/wiki). + + +## Upgrading from previous versions + +Please see [GitHub releases page](https://github.com/visionmedia/superagent/releases) for the current changelog. + +Our breaking changes are mostly in rarely used functionality and from stricter error handling. + +* [6.0 to 6.1](https://github.com/visionmedia/superagent/releases/tag/v6.1.0) + * Browser behaviour changed to match Node when serializing `application/x-www-form-urlencoded`, using `arrayFormat: 'indices'` semantics of `qs` library. (See: <https://www.npmjs.com/package/qs#stringifying>) +* [5.x to 6.x](https://github.com/visionmedia/superagent/releases/tag/v6.0.0): + * Retry behavior is still opt-in, however we now have a more fine-grained list of status codes and error codes that we retry against (see updated docs) + * A specific issue with Content-Type matching not being case-insensitive is fixed + * Set is now required for IE 9, see [Required Browser Features](#required-browser-features) for more insight +* [4.x to 5.x](https://github.com/visionmedia/superagent/releases/tag/v5.0.0): + * We've implemented the build setup of [Lass](https://lass.js.org) to simplify our stack and linting + * Unminified browserified build size has been reduced from 48KB to 20KB (via `tinyify` and the latest version of Babel using `@babel/preset-env` and `.browserslistrc`) + * Linting support has been added using `caniuse-lite` and `eslint-plugin-compat` + * We can now target what versions of Node we wish to support more easily using `.babelrc` +* [3.x to 4.x](https://github.com/visionmedia/superagent/releases/tag/v4.0.0-alpha.1): + * Ensure you're running Node 6 or later. We've dropped support for Node 4. + * We've started using ES6 and for compatibility with Internet Explorer you may need to use Babel. + * We suggest migrating from `.end()` callbacks to `.then()` or `await`. +* [2.x to 3.x](https://github.com/visionmedia/superagent/releases/tag/v3.0.0): + * Ensure you're running Node 4 or later. We've dropped support for Node 0.x. + * Test code that calls `.send()` multiple times. Invalid calls to `.send()` will now throw instead of sending garbage. +* [1.x to 2.x](https://github.com/visionmedia/superagent/releases/tag/v2.0.0): + * If you use `.parse()` in the *browser* version, rename it to `.serialize()`. + * If you rely on `undefined` in query-string values being sent literally as the text "undefined", switch to checking for missing value instead. `?key=undefined` is now `?key` (without a value). + * If you use `.then()` in Internet Explorer, ensure that you have a polyfill that adds a global `Promise` object. +* 0.x to 1.x: + * Instead of 1-argument callback `.end(function(res){})` use `.then(res => {})`. + + +## Contributors + +| Name | +| ------------------- | +| **Kornel Lesiński** | +| **Peter Lyons** | +| **Hunter Loftis** | +| **Nick Baugh** | + + +## License + +[MIT](LICENSE) © TJ Holowaychuk + + +## + +[npm]: https://www.npmjs.com/ + +[yarn]: https://yarnpkg.com/ + +[jsdelivr]: https://www.jsdelivr.com/ + +[unpkg]: https://unpkg.com/ + +[browserify]: https://github.com/browserify/browserify + +[webpack]: https://github.com/webpack/webpack + +[rollup]: https://github.com/rollup/rollup diff --git a/together/node_modules/superagent/dist/superagent.js b/together/node_modules/superagent/dist/superagent.js new file mode 100644 index 0000000..5e62aac --- /dev/null +++ b/together/node_modules/superagent/dist/superagent.js @@ -0,0 +1,3867 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.superagent = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ +"use strict"; + +},{}],2:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + + return intrinsic; +}; + +},{"./":3,"get-intrinsic":8}],3:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('get-intrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $max = GetIntrinsic('%Math.max%'); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { + value: 1 + }); + } catch (e) { + $defineProperty = null; + } +} + +module.exports = function callBind(originalFunction) { + var func = $reflectApply(bind, $call, arguments); + + if ($gOPD && $defineProperty) { + var desc = $gOPD(func, 'length'); + + if (desc.configurable) { + $defineProperty(func, 'length', { + value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) + }); + } + } + + return func; +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { + value: applyBind + }); +} else { + module.exports.apply = applyBind; +} + +},{"function-bind":7,"get-intrinsic":8}],4:[function(require,module,exports){ +"use strict"; + +if (typeof module !== 'undefined') { + module.exports = Emitter; +} + +function Emitter(obj) { + if (obj) return mixin(obj); +} + +; + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + + return obj; +} + +Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) { + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn); + return this; +}; + +Emitter.prototype.once = function (event, fn) { + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) { + this._callbacks = this._callbacks || {}; + + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + var cb; + + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + + if (callbacks.length === 0) { + delete this._callbacks['$' + event]; + } + + return this; +}; + +Emitter.prototype.emit = function (event) { + this._callbacks = this._callbacks || {}; + var args = new Array(arguments.length - 1), + callbacks = this._callbacks['$' + event]; + + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + + if (callbacks) { + callbacks = callbacks.slice(0); + + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +Emitter.prototype.listeners = function (event) { + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; + +Emitter.prototype.hasListeners = function (event) { + return !!this.listeners(event).length; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; + +module.exports = stringify; +stringify.default = stringify; +stringify.stable = deterministicStringify; +stringify.stableStringify = deterministicStringify; +var LIMIT_REPLACE_NODE = '[...]'; +var CIRCULAR_REPLACE_NODE = '[Circular]'; +var arr = []; +var replacerStack = []; + +function defaultOptions() { + return { + depthLimit: Number.MAX_SAFE_INTEGER, + edgesLimit: Number.MAX_SAFE_INTEGER + }; +} + +function stringify(obj, replacer, spacer, options) { + if (typeof options === 'undefined') { + options = defaultOptions(); + } + + decirc(obj, '', 0, [], undefined, 0, options); + var res; + + try { + if (replacerStack.length === 0) { + res = JSON.stringify(obj, replacer, spacer); + } else { + res = JSON.stringify(obj, replaceGetterValues(replacer), spacer); + } + } catch (_) { + return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]'); + } finally { + while (arr.length !== 0) { + var part = arr.pop(); + + if (part.length === 4) { + Object.defineProperty(part[0], part[1], part[3]); + } else { + part[0][part[1]] = part[2]; + } + } + } + + return res; +} + +function setReplace(replace, val, k, parent) { + var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k); + + if (propertyDescriptor.get !== undefined) { + if (propertyDescriptor.configurable) { + Object.defineProperty(parent, k, { + value: replace + }); + arr.push([parent, k, val, propertyDescriptor]); + } else { + replacerStack.push([val, k, replace]); + } + } else { + parent[k] = replace; + arr.push([parent, k, val]); + } +} + +function decirc(val, k, edgeIndex, stack, parent, depth, options) { + depth += 1; + var i; + + if (typeof val === 'object' && val !== null) { + for (i = 0; i < stack.length; i++) { + if (stack[i] === val) { + setReplace(CIRCULAR_REPLACE_NODE, val, k, parent); + return; + } + } + + if (typeof options.depthLimit !== 'undefined' && depth > options.depthLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + + if (typeof options.edgesLimit !== 'undefined' && edgeIndex + 1 > options.edgesLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + + stack.push(val); + + if (Array.isArray(val)) { + for (i = 0; i < val.length; i++) { + decirc(val[i], i, i, stack, val, depth, options); + } + } else { + var keys = Object.keys(val); + + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + decirc(val[key], key, i, stack, val, depth, options); + } + } + + stack.pop(); + } +} + +function compareFunction(a, b) { + if (a < b) { + return -1; + } + + if (a > b) { + return 1; + } + + return 0; +} + +function deterministicStringify(obj, replacer, spacer, options) { + if (typeof options === 'undefined') { + options = defaultOptions(); + } + + var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj; + var res; + + try { + if (replacerStack.length === 0) { + res = JSON.stringify(tmp, replacer, spacer); + } else { + res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer); + } + } catch (_) { + return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]'); + } finally { + while (arr.length !== 0) { + var part = arr.pop(); + + if (part.length === 4) { + Object.defineProperty(part[0], part[1], part[3]); + } else { + part[0][part[1]] = part[2]; + } + } + } + + return res; +} + +function deterministicDecirc(val, k, edgeIndex, stack, parent, depth, options) { + depth += 1; + var i; + + if (typeof val === 'object' && val !== null) { + for (i = 0; i < stack.length; i++) { + if (stack[i] === val) { + setReplace(CIRCULAR_REPLACE_NODE, val, k, parent); + return; + } + } + + try { + if (typeof val.toJSON === 'function') { + return; + } + } catch (_) { + return; + } + + if (typeof options.depthLimit !== 'undefined' && depth > options.depthLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + + if (typeof options.edgesLimit !== 'undefined' && edgeIndex + 1 > options.edgesLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + + stack.push(val); + + if (Array.isArray(val)) { + for (i = 0; i < val.length; i++) { + deterministicDecirc(val[i], i, i, stack, val, depth, options); + } + } else { + var tmp = {}; + var keys = Object.keys(val).sort(compareFunction); + + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + deterministicDecirc(val[key], key, i, stack, val, depth, options); + tmp[key] = val[key]; + } + + if (typeof parent !== 'undefined') { + arr.push([parent, k, val]); + parent[k] = tmp; + } else { + return tmp; + } + } + + stack.pop(); + } +} + +function replaceGetterValues(replacer) { + replacer = typeof replacer !== 'undefined' ? replacer : function (k, v) { + return v; + }; + return function (key, val) { + if (replacerStack.length > 0) { + for (var i = 0; i < replacerStack.length; i++) { + var part = replacerStack[i]; + + if (part[1] === key && part[0] === val) { + val = part[2]; + replacerStack.splice(i, 1); + break; + } + } + } + + return replacer.call(this, key, val); + }; +} + +},{}],6:[function(require,module,exports){ +'use strict'; + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + + var args = slice.call(arguments, 1); + var bound; + + var binder = function () { + if (this instanceof bound) { + var result = target.apply(this, args.concat(slice.call(arguments))); + + if (Object(result) === result) { + return result; + } + + return this; + } else { + return target.apply(that, args.concat(slice.call(arguments))); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + +},{}],7:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; + +},{"./implementation":6}],8:[function(require,module,exports){ +'use strict'; + +var undefined; +var $SyntaxError = SyntaxError; +var $Function = Function; +var $TypeError = TypeError; + +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = Object.getOwnPropertyDescriptor; + +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; + } +} + +var throwTypeError = function () { + throw new $TypeError(); +}; + +var ThrowTypeError = $gOPD ? function () { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } +}() : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { + return x.__proto__; +}; + +var needsEval = {}; +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); +var INTRINSICS = { + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%eval%': eval, + '%EvalError%': EvalError, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': Object, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%ReferenceError%': ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet +}; + +var doEval = function doEval(name) { + var value; + + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + + if (gen) { + value = getProto(gen.prototype); + } + } + + INTRINSICS[name] = value; + return value; +}; + +var LEGACY_ALIASES = { + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = require('function-bind'); + +var hasOwn = require('has'); + +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); +var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; + +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + + if (value === needsEval) { + value = doEval(intrinsicName); + } + + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + if ($exec(/^%?[^%]*%?$/g, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + + if ((first === '"' || first === "'" || first === '`' || last === '"' || last === "'" || last === '`') && first !== last) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + + return void undefined; + } + + if ($gOPD && i + 1 >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + + return value; +}; + +},{"function-bind":7,"has":11,"has-symbols":9}],9:[function(require,module,exports){ +'use strict'; + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; + +var hasSymbolSham = require('./shams'); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { + return false; + } + + if (typeof Symbol !== 'function') { + return false; + } + + if (typeof origSymbol('foo') !== 'symbol') { + return false; + } + + if (typeof Symbol('bar') !== 'symbol') { + return false; + } + + return hasSymbolSham(); +}; + +},{"./shams":10}],10:[function(require,module,exports){ +'use strict'; + +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { + return false; + } + + if (typeof Symbol.iterator === 'symbol') { + return true; + } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + + if (typeof sym === 'string') { + return false; + } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { + return false; + } + + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { + return false; + } + + var symVal = 42; + obj[sym] = symVal; + + for (sym in obj) { + return false; + } + + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { + return false; + } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + + var syms = Object.getOwnPropertySymbols(obj); + + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + + return true; +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); + +},{"function-bind":7}],12:[function(require,module,exports){ +"use strict"; + +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') ? Symbol.toStringTag : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function (O) { + return O.__proto__; +} : null); + +function addNumericSeparator(num, str) { + if (num === Infinity || num === -Infinity || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) { + return str; + } + + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); + + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + + return $replace.call(str, sepRegex, '$&_'); +} + +var utilInspect = require('./util.inspect'); + +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double') { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } + + if (has(opts, 'indent') && opts.indent !== null && opts.indent !== '\t' && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + + var numericSeparator = opts.numericSeparator; + + if (typeof obj === 'undefined') { + return 'undefined'; + } + + if (obj === null) { + return 'null'; + } + + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + + if (typeof depth === 'undefined') { + depth = 0; + } + + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + + var indent = getIndent(opts, depth); + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + + return inspect_(value, newOpts, depth + 1, seen); + } + + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function' && !isRegExp(obj)) { + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + + s += '>'; + + if (obj.childNodes && obj.childNodes.length) { + s += '...'; + } + + s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>'; + return s; + } + + if (isArray(obj)) { + if (obj.length === 0) { + return '[]'; + } + + var xs = arrObjKeys(obj, inspect); + + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + + if (parts.length === 0) { + return '[' + String(obj) + ']'; + } + + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { + depth: maxDepth - depth + }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + + if (isMap(obj)) { + var mapParts = []; + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + + if (isSet(obj)) { + var setParts = []; + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + + if (ys.length === 0) { + return tag + '{}'; + } + + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} + +function isArray(obj) { + return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isDate(obj) { + return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isRegExp(obj) { + return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isError(obj) { + return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isString(obj) { + return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isNumber(obj) { + return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isBoolean(obj) { + return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); +} + +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + + if (typeof obj === 'symbol') { + return true; + } + + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + + try { + symToString.call(obj); + return true; + } catch (e) {} + + return false; +} + +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + + return false; +} + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { + return key in this; +}; + +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { + return f.name; + } + + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + + if (m) { + return m[1]; + } + + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { + return xs.indexOf(x); + } + + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { + return i; + } + } + + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + + try { + mapSize.call(x); + + try { + setSize.call(x); + } catch (s) { + return true; + } + + return x instanceof Map; + } catch (e) {} + + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + + try { + weakMapHas.call(x, weakMapHas); + + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + + return x instanceof WeakMap; + } catch (e) {} + + return false; +} + +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + + try { + setSize.call(x); + + try { + mapSize.call(x); + } catch (m) { + return true; + } + + return x instanceof Set; + } catch (e) {} + + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + + try { + weakSetHas.call(x, weakSetHas); + + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + + return x instanceof WeakSet; + } catch (e) {} + + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { + return false; + } + + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + + var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + + if (x) { + return '\\' + x; + } + + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} + +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + + return true; +} + +function getIndent(opts, depth) { + var baseIndent; + + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; +} + +function indentedJoin(xs, indent) { + if (xs.length === 0) { + return ''; + } + + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + + if (isArr) { + xs.length = obj.length; + + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + + if (hasShammedSymbols) { + symMap = {}; + + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + + for (var key in obj) { + if (!has(obj, key)) { + continue; + } + + if (isArr && String(Number(key)) === key && key < obj.length) { + continue; + } + + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + continue; + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + + return xs; +} + +},{"./util.inspect":1}],13:[function(require,module,exports){ +"use strict"; + +var process = module.exports = {}; +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} + +function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); +} + +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +})(); + +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } +} + +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } +} + +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + + draining = false; + + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + + while (len) { + currentQueue = queue; + queue = []; + + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + + queueIndex = -1; + len = queue.length; + } + + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + + queue.push(new Item(fun, args)); + + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +function Item(fun, array) { + this.fun = fun; + this.array = array; +} + +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { + return []; +}; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { + return '/'; +}; + +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +process.umask = function () { + return 0; +}; + +},{}],14:[function(require,module,exports){ +'use strict'; + +var replace = String.prototype.replace; +var percentTwenties = /%20/g; +var Format = { + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' +}; +module.exports = { + 'default': Format.RFC3986, + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return String(value); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 +}; + +},{}],15:[function(require,module,exports){ +'use strict'; + +var stringify = require('./stringify'); + +var parse = require('./parse'); + +var formats = require('./formats'); + +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; + +},{"./formats":14,"./parse":16,"./stringify":17}],16:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; +var defaults = { + allowDots: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: 'utf-8', + charsetSentinel: false, + comma: false, + decoder: utils.decode, + delimiter: '&', + depth: 5, + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1000, + parseArrays: true, + plainObjects: false, + strictNullHandling: false +}; + +var interpretNumericEntities = function (str) { + return str.replace(/&#(\d+);/g, function ($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); +}; + +var parseArrayValue = function (val, options) { + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { + return val.split(','); + } + + return val; +}; + +var isoSentinel = 'utf8=%26%2310003%3B'; +var charsetSentinel = 'utf8=%E2%9C%93'; + +var parseValues = function parseQueryStringValues(str, options) { + var obj = {}; + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; + var i; + var charset = options.charset; + + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + + skipIndex = i; + i = parts.length; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + + var part = parts[i]; + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + var key, val; + + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options), function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + }); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(val); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + if (has.call(obj, key)) { + obj[key] = utils.combine(obj[key], val); + } else { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var leaf = valuesParsed ? val : parseArrayValue(val, options); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = [].concat(leaf); + } else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var index = parseInt(cleanRoot, 10); + + if (!options.parseArrays && cleanRoot === '') { + obj = { + 0: leaf + }; + } else if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) { + obj = []; + obj[index] = leaf; + } else if (cleanRoot !== '__proto__') { + obj[cleanRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + var keys = []; + + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + var i = 0; + + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(segment[1]); + } + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + return { + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + depth: typeof opts.depth === 'number' || opts.depth === false ? +opts.depth : defaults.depth, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + var keys = Object.keys(tempObj); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; + +},{"./utils":18}],17:[function(require,module,exports){ +'use strict'; + +var getSideChannel = require('side-channel'); + +var utils = require('./utils'); + +var formats = require('./formats'); + +var has = Object.prototype.hasOwnProperty; +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; +var isArray = Array.isArray; +var split = String.prototype.split; +var push = Array.prototype.push; + +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + charset: 'utf-8', + charsetSentinel: false, + delimiter: '&', + encode: true, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || typeof v === 'symbol' || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + var obj = object; + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + var pos = tmpSc.get(object); + step += 1; + + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; + } + } + + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + + if (generateArrayPrefix === 'comma' && encodeValuesOnly) { + var valuesArray = split.call(String(obj), ','); + var valuesJoined = ''; + + for (var i = 0; i < valuesArray.length; ++i) { + valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format)); + } + + return [formatter(keyValue) + (isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined]; + } + + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + + if (generateArrayPrefix === 'comma' && isArray(obj)) { + objKeys = [{ + value: obj.length > 0 ? obj.join(',') || null : void undefined + }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var adjustedPrefix = generateArrayPrefix === 'comma' && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix; + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']'); + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel)); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + + format = opts.format; + } + + var formatter = formats.formatters[format]; + var filter = defaults.filter; + + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + + if (opts && opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if (opts && 'indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (options.skipNulls && obj[key] === null) { + continue; + } + + pushToArray(keys, stringify(obj[key], key, generateArrayPrefix, options.strictNullHandling, options.skipNulls, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel)); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + prefix += 'utf8=%26%2310003%3B&'; + } else { + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; + +},{"./formats":14,"./utils":18,"side-channel":19}],18:[function(require,module,exports){ +'use strict'; + +var formats = require('./formats'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var hexTable = function () { + var array = []; + + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}(); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var merge = function merge(target, source, options) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; + +var decode = function (str, decoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + + if (charset === 'iso-8859-1') { + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + if (str.length === 0) { + return str; + } + + var string = str; + + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + if (c === 0x2D || c === 0x2E || c === 0x5F || c === 0x7E || c >= 0x30 && c <= 0x39 || c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A || format === formats.RFC1738 && (c === 0x28 || c === 0x29)) { + out += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | c >> 6] + hexTable[0x80 | c & 0x3F]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | c >> 12] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]); + continue; + } + + i += 1; + c = 0x10000 + ((c & 0x3FF) << 10 | string.charCodeAt(i) & 0x3FF); + out += hexTable[0xF0 | c >> 18] + hexTable[0x80 | c >> 12 & 0x3F] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]; + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ + obj: { + o: value + }, + prop: 'o' + }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + var keys = Object.keys(obj); + + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ + obj: obj, + prop: key + }); + refs.push(val); + } + } + } + + compactQueue(queue); + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + + return mapped; + } + + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; + +},{"./formats":14}],19:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBound = require('call-bind/callBound'); + +var inspect = require('object-inspect'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $WeakMap = GetIntrinsic('%WeakMap%', true); +var $Map = GetIntrinsic('%Map%', true); +var $weakMapGet = callBound('WeakMap.prototype.get', true); +var $weakMapSet = callBound('WeakMap.prototype.set', true); +var $weakMapHas = callBound('WeakMap.prototype.has', true); +var $mapGet = callBound('Map.prototype.get', true); +var $mapSet = callBound('Map.prototype.set', true); +var $mapHas = callBound('Map.prototype.has', true); + +var listGetNode = function (list, key) { + for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + curr.next = list.next; + list.next = curr; + return curr; + } + } +}; + +var listGet = function (objects, key) { + var node = listGetNode(objects, key); + return node && node.value; +}; + +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + + if (node) { + node.value = value; + } else { + objects.next = { + key: key, + next: objects.next, + value: value + }; + } +}; + +var listHas = function (objects, key) { + return !!listGetNode(objects, key); +}; + +module.exports = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + get: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { + return listGet($o, key); + } + } + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapHas($m, key); + } + } else { + if ($o) { + return listHas($o, key); + } + } + + return false; + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + + $weakMapSet($wm, key, value); + } else if ($Map) { + if (!$m) { + $m = new $Map(); + } + + $mapSet($m, key, value); + } else { + if (!$o) { + $o = { + key: {}, + next: null + }; + } + + listSet($o, key, value); + } + } + }; + return channel; +}; + +},{"call-bind/callBound":2,"get-intrinsic":8,"object-inspect":12}],20:[function(require,module,exports){ +"use strict"; + +function Agent() { + this._defaults = []; +} + +for (const fn of ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts']) { + Agent.prototype[fn] = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this._defaults.push({ + fn, + args + }); + + return this; + }; +} + +Agent.prototype._setDefaults = function (request) { + for (const def of this._defaults) { + request[def.fn](...def.args); + } +}; + +module.exports = Agent; + +},{}],21:[function(require,module,exports){ +"use strict"; + +let root; + +if (typeof window !== 'undefined') { + root = window; +} else if (typeof self === 'undefined') { + console.warn('Using browser-only version of superagent in non-browser environment'); + root = void 0; +} else { + root = self; +} + +const Emitter = require('component-emitter'); + +const safeStringify = require('fast-safe-stringify'); + +const qs = require('qs'); + +const RequestBase = require('./request-base'); + +const { + isObject, + mixin, + hasOwn +} = require('./utils'); + +const ResponseBase = require('./response-base'); + +const Agent = require('./agent-base'); + +function noop() {} + +module.exports = function (method, url) { + if (typeof url === 'function') { + return new exports.Request('GET', method).end(url); + } + + if (arguments.length === 1) { + return new exports.Request('GET', method); + } + + return new exports.Request(method, url); +}; + +exports = module.exports; +const request = exports; +exports.Request = Request; + +request.getXHR = () => { + if (root.XMLHttpRequest) { + return new root.XMLHttpRequest(); + } + + throw new Error('Browser-only version of superagent could not find XHR'); +}; + +const trim = ''.trim ? s => s.trim() : s => s.replace(/(^\s*|\s*$)/g, ''); + +function serialize(object) { + if (!isObject(object)) return object; + const pairs = []; + + for (const key in object) { + if (hasOwn(object, key)) pushEncodedKeyValuePair(pairs, key, object[key]); + } + + return pairs.join('&'); +} + +function pushEncodedKeyValuePair(pairs, key, value) { + if (value === undefined) return; + + if (value === null) { + pairs.push(encodeURI(key)); + return; + } + + if (Array.isArray(value)) { + for (const v of value) { + pushEncodedKeyValuePair(pairs, key, v); + } + } else if (isObject(value)) { + for (const subkey in value) { + if (hasOwn(value, subkey)) pushEncodedKeyValuePair(pairs, "".concat(key, "[").concat(subkey, "]"), value[subkey]); + } + } else { + pairs.push(encodeURI(key) + '=' + encodeURIComponent(value)); + } +} + +request.serializeObject = serialize; + +function parseString(string_) { + const object = {}; + const pairs = string_.split('&'); + let pair; + let pos; + + for (let i = 0, length_ = pairs.length; i < length_; ++i) { + pair = pairs[i]; + pos = pair.indexOf('='); + + if (pos === -1) { + object[decodeURIComponent(pair)] = ''; + } else { + object[decodeURIComponent(pair.slice(0, pos))] = decodeURIComponent(pair.slice(pos + 1)); + } + } + + return object; +} + +request.parseString = parseString; +request.types = { + html: 'text/html', + json: 'application/json', + xml: 'text/xml', + urlencoded: 'application/x-www-form-urlencoded', + form: 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' +}; +request.serialize = { + 'application/x-www-form-urlencoded': qs.stringify, + 'application/json': safeStringify +}; +request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse +}; + +function parseHeader(string_) { + const lines = string_.split(/\r?\n/); + const fields = {}; + let index; + let line; + let field; + let value; + + for (let i = 0, length_ = lines.length; i < length_; ++i) { + line = lines[i]; + index = line.indexOf(':'); + + if (index === -1) { + continue; + } + + field = line.slice(0, index).toLowerCase(); + value = trim(line.slice(index + 1)); + fields[field] = value; + } + + return fields; +} + +function isJSON(mime) { + return /[/+]json($|[^-\w])/i.test(mime); +} + +function Response(request_) { + this.req = request_; + this.xhr = this.req.xhr; + this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null; + this.statusText = this.req.xhr.statusText; + let { + status + } = this.xhr; + + if (status === 1223) { + status = 204; + } + + this._setStatusProperties(status); + + this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + this.header = this.headers; + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + + this._setHeaderProperties(this.header); + + if (this.text === null && request_._responseType) { + this.body = this.xhr.response; + } else { + this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response); + } +} + +mixin(Response.prototype, ResponseBase.prototype); + +Response.prototype._parseBody = function (string_) { + let parse = request.parse[this.type]; + + if (this.req._parser) { + return this.req._parser(this, string_); + } + + if (!parse && isJSON(this.type)) { + parse = request.parse['application/json']; + } + + return parse && string_ && (string_.length > 0 || string_ instanceof Object) ? parse(string_) : null; +}; + +Response.prototype.toError = function () { + const { + req + } = this; + const { + method + } = req; + const { + url + } = req; + const message = "cannot ".concat(method, " ").concat(url, " (").concat(this.status, ")"); + const error = new Error(message); + error.status = this.status; + error.method = method; + error.url = url; + return error; +}; + +request.Response = Response; + +function Request(method, url) { + const self = this; + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; + this._header = {}; + this.on('end', () => { + let error = null; + let res = null; + + try { + res = new Response(self); + } catch (err) { + error = new Error('Parser is unable to parse the response'); + error.parse = true; + error.original = err; + + if (self.xhr) { + error.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response; + error.status = self.xhr.status ? self.xhr.status : null; + error.statusCode = error.status; + } else { + error.rawResponse = null; + error.status = null; + } + + return self.callback(error); + } + + self.emit('response', res); + let new_error; + + try { + if (!self._isResponseOK(res)) { + new_error = new Error(res.statusText || res.text || 'Unsuccessful HTTP response'); + } + } catch (err) { + new_error = err; + } + + if (new_error) { + new_error.original = error; + new_error.response = res; + new_error.status = new_error.status || res.status; + self.callback(new_error, res); + } else { + self.callback(null, res); + } + }); +} + +Emitter(Request.prototype); +mixin(Request.prototype, RequestBase.prototype); + +Request.prototype.type = function (type) { + this.set('Content-Type', request.types[type] || type); + return this; +}; + +Request.prototype.accept = function (type) { + this.set('Accept', request.types[type] || type); + return this; +}; + +Request.prototype.auth = function (user, pass, options) { + if (arguments.length === 1) pass = ''; + + if (typeof pass === 'object' && pass !== null) { + options = pass; + pass = ''; + } + + if (!options) { + options = { + type: typeof btoa === 'function' ? 'basic' : 'auto' + }; + } + + const encoder = options.encoder ? options.encoder : string => { + if (typeof btoa === 'function') { + return btoa(string); + } + + throw new Error('Cannot use basic auth, btoa is not a function'); + }; + return this._auth(user, pass, options, encoder); +}; + +Request.prototype.query = function (value) { + if (typeof value !== 'string') value = serialize(value); + if (value) this._query.push(value); + return this; +}; + +Request.prototype.attach = function (field, file, options) { + if (file) { + if (this._data) { + throw new Error("superagent can't mix .send() and .attach()"); + } + + this._getFormData().append(field, file, options || file.name); + } + + return this; +}; + +Request.prototype._getFormData = function () { + if (!this._formData) { + this._formData = new root.FormData(); + } + + return this._formData; +}; + +Request.prototype.callback = function (error, res) { + if (this._shouldRetry(error, res)) { + return this._retry(); + } + + const fn = this._callback; + this.clearTimeout(); + + if (error) { + if (this._maxRetries) error.retries = this._retries - 1; + this.emit('error', error); + } + + fn(error, res); +}; + +Request.prototype.crossDomainError = function () { + const error = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); + error.crossDomain = true; + error.status = this.status; + error.method = this.method; + error.url = this.url; + this.callback(error); +}; + +Request.prototype.agent = function () { + console.warn('This is not supported in browser version of superagent'); + return this; +}; + +Request.prototype.ca = Request.prototype.agent; +Request.prototype.buffer = Request.prototype.ca; + +Request.prototype.write = () => { + throw new Error('Streaming is not supported in browser version of superagent'); +}; + +Request.prototype.pipe = Request.prototype.write; + +Request.prototype._isHost = function (object) { + return object && typeof object === 'object' && !Array.isArray(object) && Object.prototype.toString.call(object) !== '[object Object]'; +}; + +Request.prototype.end = function (fn) { + if (this._endCalled) { + console.warn('Warning: .end() was called twice. This is not supported in superagent'); + } + + this._endCalled = true; + this._callback = fn || noop; + + this._finalizeQueryString(); + + this._end(); +}; + +Request.prototype._setUploadTimeout = function () { + const self = this; + + if (this._uploadTimeout && !this._uploadTimeoutTimer) { + this._uploadTimeoutTimer = setTimeout(() => { + self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT'); + }, this._uploadTimeout); + } +}; + +Request.prototype._end = function () { + if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called')); + const self = this; + this.xhr = request.getXHR(); + const { + xhr + } = this; + let data = this._formData || this._data; + + this._setTimeouts(); + + xhr.addEventListener('readystatechange', () => { + const { + readyState + } = xhr; + + if (readyState >= 2 && self._responseTimeoutTimer) { + clearTimeout(self._responseTimeoutTimer); + } + + if (readyState !== 4) { + return; + } + + let status; + + try { + status = xhr.status; + } catch (err) { + status = 0; + } + + if (!status) { + if (self.timedout || self._aborted) return; + return self.crossDomainError(); + } + + self.emit('end'); + }); + + const handleProgress = (direction, e) => { + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + + if (e.percent === 100) { + clearTimeout(self._uploadTimeoutTimer); + } + } + + e.direction = direction; + self.emit('progress', e); + }; + + if (this.hasListeners('progress')) { + try { + xhr.addEventListener('progress', handleProgress.bind(null, 'download')); + + if (xhr.upload) { + xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload')); + } + } catch (err) {} + } + + if (xhr.upload) { + this._setUploadTimeout(); + } + + try { + if (this.username && this.password) { + xhr.open(this.method, this.url, true, this.username, this.password); + } else { + xhr.open(this.method, this.url, true); + } + } catch (err) { + return this.callback(err); + } + + if (this._withCredentials) xhr.withCredentials = true; + + if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) { + const contentType = this._header['content-type']; + let serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : '']; + + if (!serialize && isJSON(contentType)) { + serialize = request.serialize['application/json']; + } + + if (serialize) data = serialize(data); + } + + for (const field in this.header) { + if (this.header[field] === null) continue; + if (hasOwn(this.header, field)) xhr.setRequestHeader(field, this.header[field]); + } + + if (this._responseType) { + xhr.responseType = this._responseType; + } + + this.emit('request', this); + xhr.send(typeof data === 'undefined' ? null : data); +}; + +request.agent = () => new Agent(); + +for (const method of ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE']) { + Agent.prototype[method.toLowerCase()] = function (url, fn) { + const request_ = new request.Request(method, url); + + this._setDefaults(request_); + + if (fn) { + request_.end(fn); + } + + return request_; + }; +} + +Agent.prototype.del = Agent.prototype.delete; + +request.get = (url, data, fn) => { + const request_ = request('GET', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; + +request.head = (url, data, fn) => { + const request_ = request('HEAD', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; + +request.options = (url, data, fn) => { + const request_ = request('OPTIONS', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +function del(url, data, fn) { + const request_ = request('DELETE', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +} + +request.del = del; +request.delete = del; + +request.patch = (url, data, fn) => { + const request_ = request('PATCH', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +request.post = (url, data, fn) => { + const request_ = request('POST', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +request.put = (url, data, fn) => { + const request_ = request('PUT', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +},{"./agent-base":20,"./request-base":22,"./response-base":23,"./utils":24,"component-emitter":4,"fast-safe-stringify":5,"qs":15}],22:[function(require,module,exports){ +(function (process){(function (){ +"use strict"; + +const semver = require('semver'); + +const { + isObject, + hasOwn +} = require('./utils'); + +module.exports = RequestBase; + +function RequestBase() {} + +RequestBase.prototype.clearTimeout = function () { + clearTimeout(this._timer); + clearTimeout(this._responseTimeoutTimer); + clearTimeout(this._uploadTimeoutTimer); + delete this._timer; + delete this._responseTimeoutTimer; + delete this._uploadTimeoutTimer; + return this; +}; + +RequestBase.prototype.parse = function (fn) { + this._parser = fn; + return this; +}; + +RequestBase.prototype.responseType = function (value) { + this._responseType = value; + return this; +}; + +RequestBase.prototype.serialize = function (fn) { + this._serializer = fn; + return this; +}; + +RequestBase.prototype.timeout = function (options) { + if (!options || typeof options !== 'object') { + this._timeout = options; + this._responseTimeout = 0; + this._uploadTimeout = 0; + return this; + } + + for (const option in options) { + if (hasOwn(options, option)) { + switch (option) { + case 'deadline': + this._timeout = options.deadline; + break; + + case 'response': + this._responseTimeout = options.response; + break; + + case 'upload': + this._uploadTimeout = options.upload; + break; + + default: + console.warn('Unknown timeout option', option); + } + } + } + + return this; +}; + +RequestBase.prototype.retry = function (count, fn) { + if (arguments.length === 0 || count === true) count = 1; + if (count <= 0) count = 0; + this._maxRetries = count; + this._retries = 0; + this._retryCallback = fn; + return this; +}; + +const ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN']); +const STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524]); + +RequestBase.prototype._shouldRetry = function (error, res) { + if (!this._maxRetries || this._retries++ >= this._maxRetries) { + return false; + } + + if (this._retryCallback) { + try { + const override = this._retryCallback(error, res); + + if (override === true) return true; + if (override === false) return false; + } catch (err) { + console.error(err); + } + } + + if (res && res.status && STATUS_CODES.has(res.status)) return true; + + if (error) { + if (error.code && ERROR_CODES.has(error.code)) return true; + if (error.timeout && error.code === 'ECONNABORTED') return true; + if (error.crossDomain) return true; + } + + return false; +}; + +RequestBase.prototype._retry = function () { + this.clearTimeout(); + + if (this.req) { + this.req = null; + this.req = this.request(); + } + + this._aborted = false; + this.timedout = false; + this.timedoutError = null; + return this._end(); +}; + +RequestBase.prototype.then = function (resolve, reject) { + if (!this._fullfilledPromise) { + const self = this; + + if (this._endCalled) { + console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises'); + } + + this._fullfilledPromise = new Promise((resolve, reject) => { + self.on('abort', () => { + if (this._maxRetries && this._maxRetries > this._retries) { + return; + } + + if (this.timedout && this.timedoutError) { + reject(this.timedoutError); + return; + } + + const error = new Error('Aborted'); + error.code = 'ABORTED'; + error.status = this.status; + error.method = this.method; + error.url = this.url; + reject(error); + }); + self.end((error, res) => { + if (error) reject(error);else resolve(res); + }); + }); + } + + return this._fullfilledPromise.then(resolve, reject); +}; + +RequestBase.prototype.catch = function (callback) { + return this.then(undefined, callback); +}; + +RequestBase.prototype.use = function (fn) { + fn(this); + return this; +}; + +RequestBase.prototype.ok = function (callback) { + if (typeof callback !== 'function') throw new Error('Callback required'); + this._okCallback = callback; + return this; +}; + +RequestBase.prototype._isResponseOK = function (res) { + if (!res) { + return false; + } + + if (this._okCallback) { + return this._okCallback(res); + } + + return res.status >= 200 && res.status < 300; +}; + +RequestBase.prototype.get = function (field) { + return this._header[field.toLowerCase()]; +}; + +RequestBase.prototype.getHeader = RequestBase.prototype.get; + +RequestBase.prototype.set = function (field, value) { + if (isObject(field)) { + for (const key in field) { + if (hasOwn(field, key)) this.set(key, field[key]); + } + + return this; + } + + this._header[field.toLowerCase()] = value; + this.header[field] = value; + return this; +}; + +RequestBase.prototype.unset = function (field) { + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; +}; + +RequestBase.prototype.field = function (name, value, options) { + if (name === null || undefined === name) { + throw new Error('.field(name, val) name can not be empty'); + } + + if (this._data) { + throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"); + } + + if (isObject(name)) { + for (const key in name) { + if (hasOwn(name, key)) this.field(key, name[key]); + } + + return this; + } + + if (Array.isArray(value)) { + for (const i in value) { + if (hasOwn(value, i)) this.field(name, value[i]); + } + + return this; + } + + if (value === null || undefined === value) { + throw new Error('.field(name, val) val can not be empty'); + } + + if (typeof value === 'boolean') { + value = String(value); + } + + if (options) this._getFormData().append(name, value, options);else this._getFormData().append(name, value); + return this; +}; + +RequestBase.prototype.abort = function () { + if (this._aborted) { + return this; + } + + this._aborted = true; + if (this.xhr) this.xhr.abort(); + + if (this.req) { + if (semver.gte(process.version, 'v13.0.0') && semver.lt(process.version, 'v14.0.0')) { + throw new Error('Superagent does not work in v13 properly with abort() due to Node.js core changes'); + } else if (semver.gte(process.version, 'v14.0.0')) { + this.req.destroyed = true; + } + + this.req.abort(); + } + + this.clearTimeout(); + this.emit('abort'); + return this; +}; + +RequestBase.prototype._auth = function (user, pass, options, base64Encoder) { + switch (options.type) { + case 'basic': + this.set('Authorization', "Basic ".concat(base64Encoder("".concat(user, ":").concat(pass)))); + break; + + case 'auto': + this.username = user; + this.password = pass; + break; + + case 'bearer': + this.set('Authorization', "Bearer ".concat(user)); + break; + + default: + break; + } + + return this; +}; + +RequestBase.prototype.withCredentials = function (on) { + if (on === undefined) on = true; + this._withCredentials = on; + return this; +}; + +RequestBase.prototype.redirects = function (n) { + this._maxRedirects = n; + return this; +}; + +RequestBase.prototype.maxResponseSize = function (n) { + if (typeof n !== 'number') { + throw new TypeError('Invalid argument'); + } + + this._maxResponseSize = n; + return this; +}; + +RequestBase.prototype.toJSON = function () { + return { + method: this.method, + url: this.url, + data: this._data, + headers: this._header + }; +}; + +RequestBase.prototype.send = function (data) { + const isObject_ = isObject(data); + let type = this._header['content-type']; + + if (this._formData) { + throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"); + } + + if (isObject_ && !this._data) { + if (Array.isArray(data)) { + this._data = []; + } else if (!this._isHost(data)) { + this._data = {}; + } + } else if (data && this._data && this._isHost(this._data)) { + throw new Error("Can't merge these send calls"); + } + + if (isObject_ && isObject(this._data)) { + for (const key in data) { + if (hasOwn(data, key)) this._data[key] = data[key]; + } + } else if (typeof data === 'string') { + if (!type) this.type('form'); + type = this._header['content-type']; + if (type) type = type.toLowerCase().trim(); + + if (type === 'application/x-www-form-urlencoded') { + this._data = this._data ? "".concat(this._data, "&").concat(data) : data; + } else { + this._data = (this._data || '') + data; + } + } else { + this._data = data; + } + + if (!isObject_ || this._isHost(data)) { + return this; + } + + if (!type) this.type('json'); + return this; +}; + +RequestBase.prototype.sortQuery = function (sort) { + this._sort = typeof sort === 'undefined' ? true : sort; + return this; +}; + +RequestBase.prototype._finalizeQueryString = function () { + const query = this._query.join('&'); + + if (query) { + this.url += (this.url.includes('?') ? '&' : '?') + query; + } + + this._query.length = 0; + + if (this._sort) { + const index = this.url.indexOf('?'); + + if (index >= 0) { + const queryArray = this.url.slice(index + 1).split('&'); + + if (typeof this._sort === 'function') { + queryArray.sort(this._sort); + } else { + queryArray.sort(); + } + + this.url = this.url.slice(0, index) + '?' + queryArray.join('&'); + } + } +}; + +RequestBase.prototype._appendQueryString = () => { + console.warn('Unsupported'); +}; + +RequestBase.prototype._timeoutError = function (reason, timeout, errno) { + if (this._aborted) { + return; + } + + const error = new Error("".concat(reason + timeout, "ms exceeded")); + error.timeout = timeout; + error.code = 'ECONNABORTED'; + error.errno = errno; + this.timedout = true; + this.timedoutError = error; + this.abort(); + this.callback(error); +}; + +RequestBase.prototype._setTimeouts = function () { + const self = this; + + if (this._timeout && !this._timer) { + this._timer = setTimeout(() => { + self._timeoutError('Timeout of ', self._timeout, 'ETIME'); + }, this._timeout); + } + + if (this._responseTimeout && !this._responseTimeoutTimer) { + this._responseTimeoutTimer = setTimeout(() => { + self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT'); + }, this._responseTimeout); + } +}; + +}).call(this)}).call(this,require('_process')) +},{"./utils":24,"_process":13,"semver":1}],23:[function(require,module,exports){ +"use strict"; + +const utils = require('./utils'); + +module.exports = ResponseBase; + +function ResponseBase() {} + +ResponseBase.prototype.get = function (field) { + return this.header[field.toLowerCase()]; +}; + +ResponseBase.prototype._setHeaderProperties = function (header) { + const ct = header['content-type'] || ''; + this.type = utils.type(ct); + const parameters = utils.params(ct); + + for (const key in parameters) { + if (Object.prototype.hasOwnProperty.call(parameters, key)) this[key] = parameters[key]; + } + + this.links = {}; + + try { + if (header.link) { + this.links = utils.parseLinks(header.link); + } + } catch (err) {} +}; + +ResponseBase.prototype._setStatusProperties = function (status) { + const type = Math.trunc(status / 100); + this.statusCode = status; + this.status = this.statusCode; + this.statusType = type; + this.info = type === 1; + this.ok = type === 2; + this.redirect = type === 3; + this.clientError = type === 4; + this.serverError = type === 5; + this.error = type === 4 || type === 5 ? this.toError() : false; + this.created = status === 201; + this.accepted = status === 202; + this.noContent = status === 204; + this.badRequest = status === 400; + this.unauthorized = status === 401; + this.notAcceptable = status === 406; + this.forbidden = status === 403; + this.notFound = status === 404; + this.unprocessableEntity = status === 422; +}; + +},{"./utils":24}],24:[function(require,module,exports){ +"use strict"; + +exports.type = string_ => string_.split(/ *; */).shift(); + +exports.params = value => { + const object = {}; + + for (const string_ of value.split(/ *; */)) { + const parts = string_.split(/ *= */); + const key = parts.shift(); + const value = parts.shift(); + if (key && value) object[key] = value; + } + + return object; +}; + +exports.parseLinks = value => { + const object = {}; + + for (const string_ of value.split(/ *, */)) { + const parts = string_.split(/ *; */); + const url = parts[0].slice(1, -1); + const rel = parts[1].split(/ *= */)[1].slice(1, -1); + object[rel] = url; + } + + return object; +}; + +exports.cleanHeader = (header, changesOrigin) => { + delete header['content-type']; + delete header['content-length']; + delete header['transfer-encoding']; + delete header.host; + + if (changesOrigin) { + delete header.authorization; + delete header.cookie; + } + + return header; +}; + +exports.isObject = object => { + return object !== null && typeof object === 'object'; +}; + +exports.hasOwn = Object.hasOwn || function (object, property) { + if (object == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + return Object.prototype.hasOwnProperty.call(new Object(object), property); +}; + +exports.mixin = (target, source) => { + for (const key in source) { + if (exports.hasOwn(source, key)) { + target[key] = source[key]; + } + } +}; + +},{}]},{},[21])(21) +}); diff --git a/together/node_modules/superagent/dist/superagent.min.js b/together/node_modules/superagent/dist/superagent.min.js new file mode 100644 index 0000000..adf6802 --- /dev/null +++ b/together/node_modules/superagent/dist/superagent.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).superagent=t()}}((function(){var t={exports:{}};function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,o=this._callbacks["$"+t];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n=0;n<o.length;n++)if((r=o[n])===e||r.fn===e){o.splice(n,1);break}return 0===o.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],o=1;o<arguments.length;o++)e[o-1]=arguments[o];if(r){o=0;for(var n=(r=r.slice(0)).length;o<n;++o)r[o].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length},t=t.exports;var r;r=a,a.default=a,a.stable=c,a.stableStringify=c;var o=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(t,e,r,a){var u;void 0===a&&(a=i()),function t(e,r,o,n,i,a,u){var c;if(a+=1,"object"==typeof e&&null!==e){for(c=0;c<n.length;c++)if(n[c]===e)return void s("[Circular]",e,r,i);if(void 0!==u.depthLimit&&a>u.depthLimit)return void s("[...]",e,r,i);if(void 0!==u.edgesLimit&&o+1>u.edgesLimit)return void s("[...]",e,r,i);if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)t(e[c],c,c,n,e,a,u);else{var p=Object.keys(e);for(c=0;c<p.length;c++){var l=p[c];t(e[l],l,c,n,e,a,u)}}n.pop()}}(t,"",0,[],void 0,0,a);try{u=0===n.length?JSON.stringify(t,e,r):JSON.stringify(t,p(e),r)}catch(l){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var c=o.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return u}function s(t,e,r,i){var a=Object.getOwnPropertyDescriptor(i,r);void 0!==a.get?a.configurable?(Object.defineProperty(i,r,{value:t}),o.push([i,r,e,a])):n.push([e,r,t]):(i[r]=t,o.push([i,r,e]))}function u(t,e){return t<e?-1:t>e?1:0}function c(t,e,r,a){void 0===a&&(a=i());var c,l=function t(e,r,n,i,a,c,p){var l;if(c+=1,"object"==typeof e&&null!==e){for(l=0;l<i.length;l++)if(i[l]===e)return void s("[Circular]",e,r,a);try{if("function"==typeof e.toJSON)return}catch(d){return}if(void 0!==p.depthLimit&&c>p.depthLimit)return void s("[...]",e,r,a);if(void 0!==p.edgesLimit&&n+1>p.edgesLimit)return void s("[...]",e,r,a);if(i.push(e),Array.isArray(e))for(l=0;l<e.length;l++)t(e[l],l,l,i,e,c,p);else{var f={},y=Object.keys(e).sort(u);for(l=0;l<y.length;l++){var h=y[l];t(e[h],h,l,i,e,c,p),f[h]=e[h]}if(void 0===a)return f;o.push([a,r,e]),a[r]=f}i.pop()}}(t,"",0,[],void 0,0,a)||t;try{c=0===n.length?JSON.stringify(l,e,r):JSON.stringify(l,p(e),r)}catch(y){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var f=o.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return c}function p(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===e&&i[0]===r){r=i[2],n.splice(o,1);break}}return t.call(this,e,r)}}var l="undefined"!=typeof Symbol&&Symbol,f=Array.prototype.slice,y=Object.prototype.toString,h=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==y.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,o=f.call(arguments,1),n=Math.max(0,e.length-o.length),i=[],a=0;a<n;a++)i.push("$"+a);if(r=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var n=e.apply(this,o.concat(f.call(arguments)));return Object(n)===n?n:this}return e.apply(t,o.concat(f.call(arguments)))})),e.prototype){var s=function(){};s.prototype=e.prototype,r.prototype=new s,s.prototype=null}return r},d=h.call(Function.call,Object.prototype.hasOwnProperty),m=SyntaxError,b=Function,g=TypeError,v=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(e){}},w=Object.getOwnPropertyDescriptor;if(w)try{w({},"")}catch(rr){w=null}var _,S=function(){throw new g},A=w?function(){try{return S}catch(t){try{return w(arguments,"callee").get}catch(e){return S}}}():S,E="function"==typeof l&&"function"==typeof Symbol&&"symbol"==typeof l("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}(),O=Object.getPrototypeOf||function(t){return t.__proto__},j={},T="undefined"==typeof Uint8Array?void 0:O(Uint8Array),P={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":E?O([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":j,"%AsyncGenerator%":j,"%AsyncGeneratorFunction%":j,"%AsyncIteratorPrototype%":j,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":j,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E?O(O([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E?O((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E?O((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E?O(""[Symbol.iterator]()):void 0,"%Symbol%":E?Symbol:void 0,"%SyntaxError%":m,"%ThrowTypeError%":A,"%TypedArray%":T,"%TypeError%":g,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},x={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=h.call(Function.call,Array.prototype.concat),R=h.call(Function.apply,Array.prototype.splice),C=h.call(Function.call,String.prototype.replace),I=h.call(Function.call,String.prototype.slice),F=h.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,D=/\\(\\)?/g,U=function(t,e){var r,o=t;if(d(x,o)&&(o="%"+(r=x[o])[0]+"%"),d(P,o)){var n=P[o];if(n===j&&(n=function t(e){var r;if("%AsyncFunction%"===e)r=v("async function () {}");else if("%GeneratorFunction%"===e)r=v("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=v("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(r=O(n.prototype))}return P[e]=r,r}(o)),void 0===n&&!e)throw new g("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:n}}throw new m("intrinsic "+t+" does not exist!")},M=function(t,e){if("string"!=typeof t||0===t.length)throw new g("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new g('"allowMissing" argument must be a boolean');if(null===F(/^%?[^%]*%?$/g,t))throw new m("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=I(t,0,1),r=I(t,-1);if("%"===e&&"%"!==r)throw new m("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new m("invalid intrinsic syntax, expected opening `%`");var o=[];return C(t,N,(function(t,e,r,n){o[o.length]=r?C(n,D,"$1"):e||t})),o}(t),o=r.length>0?r[0]:"",n=U("%"+o+"%",e),i=n.name,a=n.value,s=!1,u=n.alias;u&&(o=u[0],R(r,k([0,1],u)));for(var c=1,p=!0;c<r.length;c+=1){var l=r[c],f=I(l,0,1),y=I(l,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new m("property names with quotes must have matching quotes");if("constructor"!==l&&p||(s=!0),d(P,i="%"+(o+="."+l)+"%"))a=P[i];else if(null!=a){if(!(l in a)){if(!e)throw new g("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&c+1>=r.length){var h=w(a,l);a=(p=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:a[l]}else p=d(a,l),a=a[l];p&&!s&&(P[i]=a)}}return a},L=M("%Function.prototype.apply%"),q=M("%Function.prototype.call%"),B=M("%Reflect.apply%",!0)||h.call(q,L),W=M("%Object.getOwnPropertyDescriptor%",!0),H=M("%Object.defineProperty%",!0),z=M("%Math.max%");if(H)try{H({},"a",{value:1})}catch(rr){H=null}_=function(t){var e=B(h,q,arguments);return W&&H&&W(e,"length").configurable&&H(e,"length",{value:1+z(0,t.length-(arguments.length-1))}),e};var G=function(){return B(h,L,arguments)};H?H(_,"apply",{value:G}):_.apply=G;var $=_(M("String.prototype.indexOf")),J=function(t,e){var r=M(t,!!e);return"function"==typeof r&&$(t,".prototype.")>-1?_(r):r},V={},Q="function"==typeof Map&&Map.prototype,X=Object.getOwnPropertyDescriptor&&Q?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,K=Q&&X&&"function"==typeof X.get?X.get:null,Y=Q&&Map.prototype.forEach,Z="function"==typeof Set&&Set.prototype,tt=Object.getOwnPropertyDescriptor&&Z?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,et=Z&&tt&&"function"==typeof tt.get?tt.get:null,rt=Z&&Set.prototype.forEach,ot="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,nt="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,it="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,at=Boolean.prototype.valueOf,st=Object.prototype.toString,ut=Function.prototype.toString,ct=String.prototype.match,pt=String.prototype.slice,lt=String.prototype.replace,ft=String.prototype.toUpperCase,yt=String.prototype.toLowerCase,ht=RegExp.prototype.test,dt=Array.prototype.concat,mt=Array.prototype.join,bt=Array.prototype.slice,gt=Math.floor,vt="function"==typeof BigInt?BigInt.prototype.valueOf:null,wt=Object.getOwnPropertySymbols,_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,St="function"==typeof Symbol&&"object"==typeof Symbol.iterator,At="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,Et=Object.prototype.propertyIsEnumerable,Ot=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function jt(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||ht.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-gt(-t):gt(t);if(o!==t){var n=String(o),i=pt.call(e,n.length+1);return lt.call(n,r,"$&_")+"."+lt.call(lt.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return lt.call(e,r,"$&_")}var Tt=V.custom,Pt=It(Tt)?Tt:null;function xt(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function kt(t){return lt.call(String(t),/"/g,""")}function Rt(t){return!("[object Array]"!==Dt(t)||At&&"object"==typeof t&&At in t)}function Ct(t){return!("[object RegExp]"!==Dt(t)||At&&"object"==typeof t&&At in t)}function It(t){if(St)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!_t)return!1;try{return _t.call(t),!0}catch(rr){}return!1}var Ft=Object.prototype.hasOwnProperty||function(t){return t in this};function Nt(t,e){return Ft.call(t,e)}function Dt(t){return st.call(t)}function Ut(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function Mt(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+ft.call(e.toString(16))}function Lt(t){return"Object("+t+")"}function qt(t){return t+" { ? }"}function Bt(t,e,r,o){return t+" ("+e+") {"+(o?Wt(r,o):mt.call(r,", "))+"}"}function Wt(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+mt.call(t,","+r)+"\n"+e.prev}function Ht(t,e){var r=Rt(t),o=[];if(r){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=Nt(t,n)?e(t[n],t):""}var i,a="function"==typeof wt?wt(t):[];if(St){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var u in t)Nt(t,u)&&(r&&String(Number(u))===u&&u<t.length||St&&i["$"+u]instanceof Symbol||(ht.call(/[^\w$]/,u)?o.push(e(u,t)+": "+e(t[u],t)):o.push(u+": "+e(t[u],t))));if("function"==typeof wt)for(var c=0;c<a.length;c++)Et.call(t,a[c])&&o.push("["+e(a[c])+"]: "+e(t[a[c]],t));return o}var zt=M("%TypeError%"),Gt=M("%WeakMap%",!0),$t=M("%Map%",!0),Jt=J("WeakMap.prototype.get",!0),Vt=J("WeakMap.prototype.set",!0),Qt=J("WeakMap.prototype.has",!0),Xt=J("Map.prototype.get",!0),Kt=J("Map.prototype.set",!0),Yt=J("Map.prototype.has",!0),Zt=function(t,e){for(var r,o=t;null!==(r=o.next);o=r)if(r.key===e)return o.next=r.next,r.next=t.next,t.next=r,r},te=function(){var t,e,r,o={assert:function(t){if(!o.has(t))throw new zt("Side channel does not contain "+function t(e,r,o,n){var i=r||{};if(Nt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Nt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!Nt(i,"customInspect")||i.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Nt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Nt(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=i.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return function t(e,r){if(e.length>r.maxStringLength){var o=e.length-r.maxStringLength,n="... "+o+" more character"+(o>1?"s":"");return t(pt.call(e,0,r.maxStringLength),r)+n}return xt(lt.call(lt.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Mt),"single",r)}(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var u=String(e);return s?jt(e,u):u}if("bigint"==typeof e){var c=String(e)+"n";return s?jt(e,c):c}var p=void 0===i.depth?5:i.depth;if(void 0===o&&(o=0),o>=p&&p>0&&"object"==typeof e)return Rt(e)?"[Array]":"[Object]";var l,f=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=mt.call(Array(t.indent+1)," ")}return{base:r,prev:mt.call(Array(e+1),r)}}(i,o);if(void 0===n)n=[];else if(Ut(n,e)>=0)return"[Circular]";function y(e,r,a){if(r&&(n=bt.call(n)).push(r),a){var s={depth:i.depth};return Nt(i,"quoteStyle")&&(s.quoteStyle=i.quoteStyle),t(e,s,o+1,n)}return t(e,i,o+1,n)}if("function"==typeof e&&!Ct(e)){var h=function(t){if(t.name)return t.name;var e=ct.call(ut.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),d=Ht(e,y);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(d.length>0?" { "+mt.call(d,", ")+" }":"")}if(It(e)){var m=St?lt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):_t.call(e);return"object"!=typeof e||St?m:Lt(m)}if((l=e)&&"object"==typeof l&&("undefined"!=typeof HTMLElement&&l instanceof HTMLElement||"string"==typeof l.nodeName&&"function"==typeof l.getAttribute)){for(var b="<"+yt.call(String(e.nodeName)),g=e.attributes||[],v=0;v<g.length;v++)b+=" "+g[v].name+"="+xt(kt(g[v].value),"double",i);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+"</"+yt.call(String(e.nodeName))+">"}if(Rt(e)){if(0===e.length)return"[]";var w=Ht(e,y);return f&&!function(t){for(var e=0;e<t.length;e++)if(Ut(t[e],"\n")>=0)return!1;return!0}(w)?"["+Wt(w,f)+"]":"[ "+mt.call(w,", ")+" ]"}if(function(t){return!("[object Error]"!==Dt(t)||At&&"object"==typeof t&&At in t)}(e)){var _=Ht(e,y);return"cause"in Error.prototype||!("cause"in e)||Et.call(e,"cause")?0===_.length?"["+String(e)+"]":"{ ["+String(e)+"] "+mt.call(_,", ")+" }":"{ ["+String(e)+"] "+mt.call(dt.call("[cause]: "+y(e.cause),_),", ")+" }"}if("object"==typeof e&&a){if(Pt&&"function"==typeof e[Pt]&&V)return V(e,{depth:p-o});if("symbol"!==a&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!K||!t||"object"!=typeof t)return!1;try{K.call(t);try{et.call(t)}catch(b){return!0}return t instanceof Map}catch(rr){}return!1}(e)){var S=[];return Y.call(e,(function(t,r){S.push(y(r,e,!0)+" => "+y(t,e))})),Bt("Map",K.call(e),S,f)}if(function(t){if(!et||!t||"object"!=typeof t)return!1;try{et.call(t);try{K.call(t)}catch(e){return!0}return t instanceof Set}catch(rr){}return!1}(e)){var A=[];return rt.call(e,(function(t){A.push(y(t,e))})),Bt("Set",et.call(e),A,f)}if(function(t){if(!ot||!t||"object"!=typeof t)return!1;try{ot.call(t,ot);try{nt.call(t,nt)}catch(b){return!0}return t instanceof WeakMap}catch(rr){}return!1}(e))return qt("WeakMap");if(function(t){if(!nt||!t||"object"!=typeof t)return!1;try{nt.call(t,nt);try{ot.call(t,ot)}catch(b){return!0}return t instanceof WeakSet}catch(rr){}return!1}(e))return qt("WeakSet");if(function(t){if(!it||!t||"object"!=typeof t)return!1;try{return it.call(t),!0}catch(rr){}return!1}(e))return qt("WeakRef");if(function(t){return!("[object Number]"!==Dt(t)||At&&"object"==typeof t&&At in t)}(e))return Lt(y(Number(e)));if(function(t){if(!t||"object"!=typeof t||!vt)return!1;try{return vt.call(t),!0}catch(rr){}return!1}(e))return Lt(y(vt.call(e)));if(function(t){return!("[object Boolean]"!==Dt(t)||At&&"object"==typeof t&&At in t)}(e))return Lt(at.call(e));if(function(t){return!("[object String]"!==Dt(t)||At&&"object"==typeof t&&At in t)}(e))return Lt(y(String(e)));if(!function(t){return!("[object Date]"!==Dt(t)||At&&"object"==typeof t&&At in t)}(e)&&!Ct(e)){var E=Ht(e,y),O=Ot?Ot(e)===Object.prototype:e instanceof Object||e.constructor===Object,j=e instanceof Object?"":"null prototype",T=!O&&At&&Object(e)===e&&At in e?pt.call(Dt(e),8,-1):j?"Object":"",P=(O||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(T||j?"["+mt.call(dt.call([],T||[],j||[]),": ")+"] ":"");return 0===E.length?P+"{}":f?P+"{"+Wt(E,f)+"}":P+"{ "+mt.call(E,", ")+" }"}return String(e)}(t))},get:function(o){if(Gt&&o&&("object"==typeof o||"function"==typeof o)){if(t)return Jt(t,o)}else if($t){if(e)return Xt(e,o)}else if(r)return function(t,e){var r=Zt(t,e);return r&&r.value}(r,o)},has:function(o){if(Gt&&o&&("object"==typeof o||"function"==typeof o)){if(t)return Qt(t,o)}else if($t){if(e)return Yt(e,o)}else if(r)return function(t,e){return!!Zt(t,e)}(r,o);return!1},set:function(o,n){Gt&&o&&("object"==typeof o||"function"==typeof o)?(t||(t=new Gt),Vt(t,o,n)):$t?(e||(e=new $t),Kt(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=Zt(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o},ee=String.prototype.replace,re=/%20/g,oe={default:"RFC3986",formatters:{RFC1738:function(t){return ee.call(t,re,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:"RFC3986"},ne=Object.prototype.hasOwnProperty,ie=Array.isArray,ae=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),se={combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o<e.length;++o)for(var n=e[o],i=n.obj[n.prop],a=Object.keys(i),s=0;s<a.length;++s){var u=a[s],c=i[u];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(e.push({obj:i,prop:u}),r.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(ie(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,r){var o=t.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(rr){return o}},encode:function(t,e,r,o,n){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",s=0;s<i.length;++s){var u=i.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||n===oe.RFC1738&&(40===u||41===u)?a+=i.charAt(s):u<128?a+=ae[u]:u<2048?a+=ae[192|u>>6]+ae[128|63&u]:u<55296||u>=57344?a+=ae[224|u>>12]+ae[128|u>>6&63]+ae[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&i.charCodeAt(s)),a+=ae[240|u>>18]+ae[128|u>>12&63]+ae[128|u>>6&63]+ae[128|63&u])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(ie(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(e(t[o]));return r}return e(t)},merge:function t(e,r,o){if(!r)return e;if("object"!=typeof r){if(ie(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(o&&(o.plainObjects||o.allowPrototypes)||!ne.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var n=e;return ie(e)&&!ie(r)&&(n=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)void 0!==t[o]&&(r[o]=t[o]);return r}(e,o)),ie(e)&&ie(r)?(r.forEach((function(r,n){if(ne.call(e,n)){var i=e[n];i&&"object"==typeof i&&r&&"object"==typeof r?e[n]=t(i,r,o):e.push(r)}else e[n]=r})),e):Object.keys(r).reduce((function(e,n){var i=r[n];return ne.call(e,n)?e[n]=t(e[n],i,o):e[n]=i,e}),n)}},ue=Object.prototype.hasOwnProperty,ce={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},pe=Array.isArray,le=String.prototype.split,fe=Array.prototype.push,ye=function(t,e){fe.apply(t,pe(e)?e:[e])},he=Date.prototype.toISOString,de=oe.default,me={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:se.encode,encodeValuesOnly:!1,format:de,formatter:oe.formatters[de],indices:!1,serializeDate:function(t){return he.call(t)},skipNulls:!1,strictNullHandling:!1},be={},ge=function t(e,r,o,n,i,a,s,u,c,p,l,f,y,h,d){for(var m,b=e,g=d,v=0,w=!1;void 0!==(g=g.get(be))&&!w;){var _=g.get(e);if(v+=1,void 0!==_){if(_===v)throw new RangeError("Cyclic object value");w=!0}void 0===g.get(be)&&(v=0)}if("function"==typeof s?b=s(r,b):b instanceof Date?b=p(b):"comma"===o&&pe(b)&&(b=se.maybeMap(b,(function(t){return t instanceof Date?p(t):t}))),null===b){if(n)return a&&!y?a(r,me.encoder,h,"key",l):r;b=""}if("string"==typeof(m=b)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||se.isBuffer(b)){if(a){var S=y?r:a(r,me.encoder,h,"key",l);if("comma"===o&&y){for(var A=le.call(String(b),","),E="",O=0;O<A.length;++O)E+=(0===O?"":",")+f(a(A[O],me.encoder,h,"value",l));return[f(S)+(pe(b)&&1===A.length?"[]":"")+"="+E]}return[f(S)+"="+f(a(b,me.encoder,h,"value",l))]}return[f(r)+"="+f(String(b))]}var j,T=[];if(void 0===b)return T;if("comma"===o&&pe(b))j=[{value:b.length>0?b.join(",")||null:void 0}];else if(pe(s))j=s;else{var P=Object.keys(b);j=u?P.sort(u):P}for(var x="comma"===o&&pe(b)&&1===b.length?r+"[]":r,k=0;k<j.length;++k){var R=j[k],C="object"==typeof R&&void 0!==R.value?R.value:b[R];if(!i||null!==C){var I=pe(b)?"function"==typeof o?o(x,R):x:x+(c?"."+R:"["+R+"]");d.set(e,v);var F=te();F.set(be,d),ye(T,t(C,I,o,n,i,a,s,u,c,p,l,f,y,h,F))}}return T},ve=(Object.prototype.hasOwnProperty,Array.isArray,{stringify:function(t,e){var r,o=t,n=function(t){if(!t)return me;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||me.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=oe.default;if(void 0!==t.format){if(!ue.call(oe.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=oe.formatters[r],n=me.filter;return("function"==typeof t.filter||pe(t.filter))&&(n=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:me.addQueryPrefix,allowDots:void 0===t.allowDots?me.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:me.charsetSentinel,delimiter:void 0===t.delimiter?me.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:me.encode,encoder:"function"==typeof t.encoder?t.encoder:me.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:me.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:me.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:me.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:me.strictNullHandling}}(e);"function"==typeof n.filter?o=(0,n.filter)("",o):pe(n.filter)&&(r=n.filter);var i,a=[];if("object"!=typeof o||null===o)return"";i=e&&e.arrayFormat in ce?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=ce[i];r||(r=Object.keys(o)),n.sort&&r.sort(n.sort);for(var u=te(),c=0;c<r.length;++c){var p=r[c];n.skipNulls&&null===o[p]||ye(a,ge(o[p],p,s,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,u))}var l=a.join(n.delimiter),f=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),l.length>0?f+l:""}}),we={type:t=>t.split(/ *; */).shift(),params:t=>{const e={};for(const r of t.split(/ *; */)){const t=r.split(/ *= */),o=t.shift(),n=t.shift();o&&n&&(e[o]=n)}return e},parseLinks:t=>{const e={};for(const r of t.split(/ *, */)){const t=r.split(/ *; */),o=t[0].slice(1,-1);e[t[1].split(/ *= */)[1].slice(1,-1)]=o}return e},isObject:t=>null!==t&&"object"==typeof t};we.hasOwn=Object.hasOwn||function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(t),e)},we.mixin=(t,e)=>{for(const r in e)we.hasOwn(e,r)&&(t[r]=e[r])};var _e,Se,Ae,Ee=_e={};function Oe(){throw new Error("setTimeout has not been defined")}function je(){throw new Error("clearTimeout has not been defined")}function Te(t){if(Se===setTimeout)return setTimeout(t,0);if((Se===Oe||!Se)&&setTimeout)return Se=setTimeout,setTimeout(t,0);try{return Se(t,0)}catch(rr){try{return Se.call(null,t,0)}catch(rr){return Se.call(this,t,0)}}}!function(){try{Se="function"==typeof setTimeout?setTimeout:Oe}catch(rr){Se=Oe}try{Ae="function"==typeof clearTimeout?clearTimeout:je}catch(rr){Ae=je}}();var Pe,xe=[],ke=!1,Re=-1;function Ce(){ke&&Pe&&(ke=!1,Pe.length?xe=Pe.concat(xe):Re=-1,xe.length&&Ie())}function Ie(){if(!ke){var t=Te(Ce);ke=!0;for(var e=xe.length;e;){for(Pe=xe,xe=[];++Re<e;)Pe&&Pe[Re].run();Re=-1,e=xe.length}Pe=null,ke=!1,function(t){if(Ae===clearTimeout)return clearTimeout(t);if((Ae===je||!Ae)&&clearTimeout)return Ae=clearTimeout,clearTimeout(t);try{Ae(t)}catch(rr){try{return Ae.call(null,t)}catch(rr){return Ae.call(this,t)}}}(t)}}function Fe(t,e){this.fun=t,this.array=e}function Ne(){}Ee.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];xe.push(new Fe(t,e)),1!==xe.length||ke||Te(Ie)},Fe.prototype.run=function(){this.fun.apply(null,this.array)},Ee.title="browser",Ee.browser=!0,Ee.env={},Ee.argv=[],Ee.version="",Ee.versions={},Ee.on=Ne,Ee.addListener=Ne,Ee.once=Ne,Ee.off=Ne,Ee.removeListener=Ne,Ee.removeAllListeners=Ne,Ee.emit=Ne,Ee.prependListener=Ne,Ee.prependOnceListener=Ne,Ee.listeners=function(t){return[]},Ee.binding=function(t){throw new Error("process.binding is not supported")},Ee.cwd=function(){return"/"},Ee.chdir=function(t){throw new Error("process.chdir is not supported")},Ee.umask=function(){return 0};var De={};(function(t){(function(){"use strict";const{isObject:e,hasOwn:r}=we;function o(){}De=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},o.prototype.parse=function(t){return this._parser=t,this},o.prototype.responseType=function(t){return this._responseType=t,this},o.prototype.serialize=function(t){return this._serializer=t,this},o.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(const e in t)if(r(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},o.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};const n=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),i=new Set([408,413,429,500,502,503,504,521,522,524]);o.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(r){console.error(r)}if(e&&e.status&&i.has(e.status))return!0;if(t){if(t.code&&n.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},o.prototype.then=function(t,e){if(!this._fullfilledPromise){const t=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((e,r)=>{t.on("abort",()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void r(this.timedoutError);const t=new Error("Aborted");t.code="ABORTED",t.status=this.status,t.method=this.method,t.url=this.url,r(t)}),t.end((t,o)=>{t?r(t):e(o)})})}return this._fullfilledPromise.then(t,e)},o.prototype.catch=function(t){return this.then(void 0,t)},o.prototype.use=function(t){return t(this),this},o.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},o.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},o.prototype.get=function(t){return this._header[t.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(t,o){if(e(t)){for(const e in t)r(t,e)&&this.set(e,t[e]);return this}return this._header[t.toLowerCase()]=o,this.header[t]=o,this},o.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},o.prototype.field=function(t,o,n){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(e(t)){for(const e in t)r(t,e)&&this.field(e,t[e]);return this}if(Array.isArray(o)){for(const e in o)r(o,e)&&this.field(t,o[e]);return this}if(null==o)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof o&&(o=String(o)),n?this._getFormData().append(t,o,n):this._getFormData().append(t,o),this},o.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(V.gte(t.version,"v13.0.0")&&V.lt(t.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");V.gte(t.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},o.prototype._auth=function(t,e,r,o){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(o("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},o.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},o.prototype.redirects=function(t){return this._maxRedirects=t,this},o.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(t){const o=e(t);let n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(o&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(o&&e(this._data))for(const e in t)r(t,e)&&(this._data[e]=t[e]);else"string"==typeof t?(n||this.type("form"),(n=this._header["content-type"])&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!o||this._isHost(t)||n||this.type("json"),this},o.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},o.prototype._finalizeQueryString=function(){const t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){const t=this.url.indexOf("?");if(t>=0){const e=this.url.slice(t+1).split("&");"function"==typeof this._sort?e.sort(this._sort):e.sort(),this.url=this.url.slice(0,t)+"?"+e.join("&")}}},o.prototype._appendQueryString=()=>{console.warn("Unsupported")},o.prototype._timeoutError=function(t,e,r){if(this._aborted)return;const o=new Error("".concat(t+e,"ms exceeded"));o.timeout=e,o.code="ECONNABORTED",o.errno=r,this.timedout=!0,this.timedoutError=o,this.abort(),this.callback(o)},o.prototype._setTimeouts=function(){const t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(()=>{t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(()=>{t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}}).call(this)}).call(this,_e);var Ue;function Me(){}Ue=Me,Me.prototype.get=function(t){return this.header[t.toLowerCase()]},Me.prototype._setHeaderProperties=function(t){const e=t["content-type"]||"";this.type=we.type(e);const r=we.params(e);for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(this[n]=r[n]);this.links={};try{t.link&&(this.links=we.parseLinks(t.link))}catch(o){}},Me.prototype._setStatusProperties=function(t){const e=Math.trunc(t/100);this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t};var Le={};function qe(){this._defaults=[]}for(const or of["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"])qe.prototype[or]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this._defaults.push({fn:or,args:e}),this};qe.prototype._setDefaults=function(t){for(const e of this._defaults)t[e.fn](...e.args)},Le=qe;var Be={};let We;"undefined"!=typeof window?We=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),We=void 0):We=self;const{isObject:He,mixin:ze,hasOwn:Ge}=we;function $e(){}const Je=Be=Be=function(t,e){return"function"==typeof e?new Be.Request("GET",t).end(e):1===arguments.length?new Be.Request("GET",t):new Be.Request(t,e)};Be.Request=tr,Je.getXHR=()=>{if(We.XMLHttpRequest)return new We.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const Ve="".trim?t=>t.trim():t=>t.replace(/(^\s*|\s*$)/g,"");function Qe(t){if(!He(t))return t;const e=[];for(const r in t)Ge(t,r)&&Xe(e,r,t[r]);return e.join("&")}function Xe(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))for(const o of r)Xe(t,e,o);else if(He(r))for(const o in r)Ge(r,o)&&Xe(t,"".concat(e,"[").concat(o,"]"),r[o]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function Ke(t){const e={},r=t.split("&");let o,n;for(let i=0,a=r.length;i<a;++i)-1===(n=(o=r[i]).indexOf("="))?e[decodeURIComponent(o)]="":e[decodeURIComponent(o.slice(0,n))]=decodeURIComponent(o.slice(n+1));return e}function Ye(t){return/[/+]json($|[^-\w])/i.test(t)}function Ze(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let{status:e}=this.xhr;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){const e=t.split(/\r?\n/),r={};let o,n,i,a;for(let s=0,u=e.length;s<u;++s)-1!==(o=(n=e[s]).indexOf(":"))&&(i=n.slice(0,o).toLowerCase(),a=Ve(n.slice(o+1)),r[i]=a);return r}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function tr(t,e){const r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",()=>{let t,e=null,o=null;try{o=new Ze(r)}catch(n){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=n,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",o);try{r._isResponseOK(o)||(t=new Error(o.statusText||o.text||"Unsuccessful HTTP response"))}catch(n){t=n}t?(t.original=e,t.response=o,t.status=t.status||o.status,r.callback(t,o)):r.callback(null,o)})}Je.serializeObject=Qe,Je.parseString=Ke,Je.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},Je.serialize={"application/x-www-form-urlencoded":ve.stringify,"application/json":r},Je.parse={"application/x-www-form-urlencoded":Ke,"application/json":JSON.parse},ze(Ze.prototype,Ue.prototype),Ze.prototype._parseBody=function(t){let e=Je.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&Ye(this.type)&&(e=Je.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},Ze.prototype.toError=function(){const{req:t}=this,{method:e}=t,{url:r}=t,o="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),n=new Error(o);return n.status=this.status,n.method=e,n.url=r,n},Je.Response=Ze,t(tr.prototype),ze(tr.prototype,De.prototype),tr.prototype.type=function(t){return this.set("Content-Type",Je.types[t]||t),this},tr.prototype.accept=function(t){return this.set("Accept",Je.types[t]||t),this},tr.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"==typeof e&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});const o=r.encoder?r.encoder:t=>{if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,o)},tr.prototype.query=function(t){return"string"!=typeof t&&(t=Qe(t)),t&&this._query.push(t),this},tr.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},tr.prototype._getFormData=function(){return this._formData||(this._formData=new We.FormData),this._formData},tr.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();const r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},tr.prototype.crossDomainError=function(){const t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},tr.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},tr.prototype.ca=tr.prototype.agent,tr.prototype.buffer=tr.prototype.ca,tr.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},tr.prototype.pipe=tr.prototype.write,tr.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},tr.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||$e,this._finalizeQueryString(),this._end()},tr.prototype._setUploadTimeout=function(){const t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(()=>{t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},tr.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const t=this;this.xhr=Je.getXHR();const{xhr:e}=this;let r=this._formData||this._data;this._setTimeouts(),e.addEventListener("readystatechange",()=>{const{readyState:r}=e;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4!==r)return;let o;try{o=e.status}catch(n){o=0}if(!o){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")});const o=(e,r)=>{r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",o.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",o.bind(null,"upload"))}catch(n){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(n){return this.callback(n)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){const t=this._header["content-type"];let e=this._serializer||Je.serialize[t?t.split(";")[0]:""];!e&&Ye(t)&&(e=Je.serialize["application/json"]),e&&(r=e(r))}for(const i in this.header)null!==this.header[i]&&Ge(this.header,i)&&e.setRequestHeader(i,this.header[i]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},Je.agent=()=>new Le;for(const or of["GET","POST","OPTIONS","PATCH","PUT","DELETE"])Le.prototype[or.toLowerCase()]=function(t,e){const r=new Je.Request(or,t);return this._setDefaults(r),e&&r.end(e),r};function er(t,e,r){const o=Je("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o}return Le.prototype.del=Le.prototype.delete,Je.get=(t,e,r)=>{const o=Je("GET",t);return"function"==typeof e&&(r=e,e=null),e&&o.query(e),r&&o.end(r),o},Je.head=(t,e,r)=>{const o=Je("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&o.query(e),r&&o.end(r),o},Je.options=(t,e,r)=>{const o=Je("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},Je.del=er,Je.delete=er,Je.patch=(t,e,r)=>{const o=Je("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},Je.post=(t,e,r)=>{const o=Je("POST",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},Je.put=(t,e,r)=>{const o=Je("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},Be}));
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/agent-base.js b/together/node_modules/superagent/lib/agent-base.js new file mode 100644 index 0000000..648de4d --- /dev/null +++ b/together/node_modules/superagent/lib/agent-base.js @@ -0,0 +1,48 @@ +"use strict"; + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + +function Agent() { + this._defaults = []; +} + +for (var _i = 0, _arr = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts']; _i < _arr.length; _i++) { + const fn = _arr[_i]; + + // Default setting for all requests from this agent + Agent.prototype[fn] = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this._defaults.push({ + fn, + args + }); + + return this; + }; +} + +Agent.prototype._setDefaults = function (request) { + var _iterator = _createForOfIteratorHelper(this._defaults), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + const def = _step.value; + request[def.fn](...def.args); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } +}; + +module.exports = Agent; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJBZ2VudCIsIl9kZWZhdWx0cyIsImZuIiwicHJvdG90eXBlIiwiYXJncyIsInB1c2giLCJfc2V0RGVmYXVsdHMiLCJyZXF1ZXN0IiwiZGVmIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJzb3VyY2VzIjpbIi4uL3NyYy9hZ2VudC1iYXNlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIEFnZW50KCkge1xuICB0aGlzLl9kZWZhdWx0cyA9IFtdO1xufVxuXG5mb3IgKGNvbnN0IGZuIG9mIFtcbiAgJ3VzZScsXG4gICdvbicsXG4gICdvbmNlJyxcbiAgJ3NldCcsXG4gICdxdWVyeScsXG4gICd0eXBlJyxcbiAgJ2FjY2VwdCcsXG4gICdhdXRoJyxcbiAgJ3dpdGhDcmVkZW50aWFscycsXG4gICdzb3J0UXVlcnknLFxuICAncmV0cnknLFxuICAnb2snLFxuICAncmVkaXJlY3RzJyxcbiAgJ3RpbWVvdXQnLFxuICAnYnVmZmVyJyxcbiAgJ3NlcmlhbGl6ZScsXG4gICdwYXJzZScsXG4gICdjYScsXG4gICdrZXknLFxuICAncGZ4JyxcbiAgJ2NlcnQnLFxuICAnZGlzYWJsZVRMU0NlcnRzJ1xuXSkge1xuICAvLyBEZWZhdWx0IHNldHRpbmcgZm9yIGFsbCByZXF1ZXN0cyBmcm9tIHRoaXMgYWdlbnRcbiAgQWdlbnQucHJvdG90eXBlW2ZuXSA9IGZ1bmN0aW9uICguLi5hcmdzKSB7XG4gICAgdGhpcy5fZGVmYXVsdHMucHVzaCh7IGZuLCBhcmdzIH0pO1xuICAgIHJldHVybiB0aGlzO1xuICB9O1xufVxuXG5BZ2VudC5wcm90b3R5cGUuX3NldERlZmF1bHRzID0gZnVuY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1QjtNQUNoQ0QsT0FBTyxDQUFDQyxHQUFHLENBQUNOLEVBQUwsQ0FBUCxDQUFnQixHQUFHTSxHQUFHLENBQUNKLElBQXZCO0lBQ0Q7RUFIK0M7SUFBQTtFQUFBO0lBQUE7RUFBQTtBQUlqRCxDQUpEOztBQU1BSyxNQUFNLENBQUNDLE9BQVAsR0FBaUJWLEtBQWpCIn0=
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/client.js b/together/node_modules/superagent/lib/client.js new file mode 100644 index 0000000..462ab1a --- /dev/null +++ b/together/node_modules/superagent/lib/client.js @@ -0,0 +1,1015 @@ +"use strict"; + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + +/** + * Root reference for iframes. + */ +let root; + +if (typeof window !== 'undefined') { + // Browser window + root = window; +} else if (typeof self === 'undefined') { + // Other environments + console.warn('Using browser-only version of superagent in non-browser environment'); + root = void 0; +} else { + // Web Worker + root = self; +} + +const Emitter = require('component-emitter'); + +const safeStringify = require('fast-safe-stringify'); + +const qs = require('qs'); + +const RequestBase = require('./request-base'); + +const _require = require('./utils'), + isObject = _require.isObject, + mixin = _require.mixin, + hasOwn = _require.hasOwn; + +const ResponseBase = require('./response-base'); + +const Agent = require('./agent-base'); +/** + * Noop. + */ + + +function noop() {} +/** + * Expose `request`. + */ + + +module.exports = function (method, url) { + // callback + if (typeof url === 'function') { + return new exports.Request('GET', method).end(url); + } // url first + + + if (arguments.length === 1) { + return new exports.Request('GET', method); + } + + return new exports.Request(method, url); +}; + +exports = module.exports; +const request = exports; +exports.Request = Request; +/** + * Determine XHR. + */ + +request.getXHR = () => { + if (root.XMLHttpRequest) { + return new root.XMLHttpRequest(); + } + + throw new Error('Browser-only version of superagent could not find XHR'); +}; +/** + * Removes leading and trailing whitespace, added to support IE. + * + * @param {String} s + * @return {String} + * @api private + */ + + +const trim = ''.trim ? s => s.trim() : s => s.replace(/(^\s*|\s*$)/g, ''); +/** + * Serialize the given `obj`. + * + * @param {Object} obj + * @return {String} + * @api private + */ + +function serialize(object) { + if (!isObject(object)) return object; + const pairs = []; + + for (const key in object) { + if (hasOwn(object, key)) pushEncodedKeyValuePair(pairs, key, object[key]); + } + + return pairs.join('&'); +} +/** + * Helps 'serialize' with serializing arrays. + * Mutates the pairs array. + * + * @param {Array} pairs + * @param {String} key + * @param {Mixed} val + */ + + +function pushEncodedKeyValuePair(pairs, key, value) { + if (value === undefined) return; + + if (value === null) { + pairs.push(encodeURI(key)); + return; + } + + if (Array.isArray(value)) { + var _iterator = _createForOfIteratorHelper(value), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + const v = _step.value; + pushEncodedKeyValuePair(pairs, key, v); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } else if (isObject(value)) { + for (const subkey in value) { + if (hasOwn(value, subkey)) pushEncodedKeyValuePair(pairs, "".concat(key, "[").concat(subkey, "]"), value[subkey]); + } + } else { + pairs.push(encodeURI(key) + '=' + encodeURIComponent(value)); + } +} +/** + * Expose serialization method. + */ + + +request.serializeObject = serialize; +/** + * Parse the given x-www-form-urlencoded `str`. + * + * @param {String} str + * @return {Object} + * @api private + */ + +function parseString(string_) { + const object = {}; + const pairs = string_.split('&'); + let pair; + let pos; + + for (let i = 0, length_ = pairs.length; i < length_; ++i) { + pair = pairs[i]; + pos = pair.indexOf('='); + + if (pos === -1) { + object[decodeURIComponent(pair)] = ''; + } else { + object[decodeURIComponent(pair.slice(0, pos))] = decodeURIComponent(pair.slice(pos + 1)); + } + } + + return object; +} +/** + * Expose parser. + */ + + +request.parseString = parseString; +/** + * Default MIME type map. + * + * superagent.types.xml = 'application/xml'; + * + */ + +request.types = { + html: 'text/html', + json: 'application/json', + xml: 'text/xml', + urlencoded: 'application/x-www-form-urlencoded', + form: 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' +}; +/** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ + +request.serialize = { + 'application/x-www-form-urlencoded': qs.stringify, + 'application/json': safeStringify +}; +/** + * Default parsers. + * + * superagent.parse['application/xml'] = function(str){ + * return { object parsed from str }; + * }; + * + */ + +request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse +}; +/** + * Parse the given header `str` into + * an object containing the mapped fields. + * + * @param {String} str + * @return {Object} + * @api private + */ + +function parseHeader(string_) { + const lines = string_.split(/\r?\n/); + const fields = {}; + let index; + let line; + let field; + let value; + + for (let i = 0, length_ = lines.length; i < length_; ++i) { + line = lines[i]; + index = line.indexOf(':'); + + if (index === -1) { + // could be empty line, just skip it + continue; + } + + field = line.slice(0, index).toLowerCase(); + value = trim(line.slice(index + 1)); + fields[field] = value; + } + + return fields; +} +/** + * Check if `mime` is json or has +json structured syntax suffix. + * + * @param {String} mime + * @return {Boolean} + * @api private + */ + + +function isJSON(mime) { + // should match /json or +json + // but not /json-seq + return /[/+]json($|[^-\w])/i.test(mime); +} +/** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * Examples: + * + * Aliasing `superagent` as `request` is nice: + * + * request = superagent; + * + * We can use the promise-like API, or pass callbacks: + * + * request.get('/').end(function(res){}); + * request.get('/', function(res){}); + * + * Sending data can be chained: + * + * request + * .post('/user') + * .send({ name: 'tj' }) + * .end(function(res){}); + * + * Or passed to `.send()`: + * + * request + * .post('/user') + * .send({ name: 'tj' }, function(res){}); + * + * Or passed to `.post()`: + * + * request + * .post('/user', { name: 'tj' }) + * .end(function(res){}); + * + * Or further reduced to a single call for simple cases: + * + * request + * .post('/user', { name: 'tj' }, function(res){}); + * + * @param {XMLHTTPRequest} xhr + * @param {Object} options + * @api private + */ + + +function Response(request_) { + this.req = request_; + this.xhr = this.req.xhr; // responseText is accessible only if responseType is '' or 'text' and on older browsers + + this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null; + this.statusText = this.req.xhr.statusText; + let status = this.xhr.status; // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + + if (status === 1223) { + status = 204; + } + + this._setStatusProperties(status); + + this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + this.header = this.headers; // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but + // getResponseHeader still works. so we get content-type even if getting + // other headers fails. + + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + + this._setHeaderProperties(this.header); + + if (this.text === null && request_._responseType) { + this.body = this.xhr.response; + } else { + this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response); + } +} + +mixin(Response.prototype, ResponseBase.prototype); +/** + * Parse the given body `str`. + * + * Used for auto-parsing of bodies. Parsers + * are defined on the `superagent.parse` object. + * + * @param {String} str + * @return {Mixed} + * @api private + */ + +Response.prototype._parseBody = function (string_) { + let parse = request.parse[this.type]; + + if (this.req._parser) { + return this.req._parser(this, string_); + } + + if (!parse && isJSON(this.type)) { + parse = request.parse['application/json']; + } + + return parse && string_ && (string_.length > 0 || string_ instanceof Object) ? parse(string_) : null; +}; +/** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ + + +Response.prototype.toError = function () { + const req = this.req; + const method = req.method; + const url = req.url; + const message = "cannot ".concat(method, " ").concat(url, " (").concat(this.status, ")"); + const error = new Error(message); + error.status = this.status; + error.method = method; + error.url = url; + return error; +}; +/** + * Expose `Response`. + */ + + +request.Response = Response; +/** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String} url + * @api public + */ + +function Request(method, url) { + const self = this; + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; // preserves header name case + + this._header = {}; // coerces header names to lowercase + + this.on('end', () => { + let error = null; + let res = null; + + try { + res = new Response(self); + } catch (err) { + error = new Error('Parser is unable to parse the response'); + error.parse = true; + error.original = err; // issue #675: return the raw response if the response parsing fails + + if (self.xhr) { + // ie9 doesn't have 'response' property + error.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response; // issue #876: return the http status code if the response parsing fails + + error.status = self.xhr.status ? self.xhr.status : null; + error.statusCode = error.status; // backwards-compat only + } else { + error.rawResponse = null; + error.status = null; + } + + return self.callback(error); + } + + self.emit('response', res); + let new_error; + + try { + if (!self._isResponseOK(res)) { + new_error = new Error(res.statusText || res.text || 'Unsuccessful HTTP response'); + } + } catch (err) { + new_error = err; // ok() callback can throw + } // #1000 don't catch errors from the callback to avoid double calling it + + + if (new_error) { + new_error.original = error; + new_error.response = res; + new_error.status = new_error.status || res.status; + self.callback(new_error, res); + } else { + self.callback(null, res); + } + }); +} +/** + * Mixin `Emitter` and `RequestBase`. + */ +// eslint-disable-next-line new-cap + + +Emitter(Request.prototype); +mixin(Request.prototype, RequestBase.prototype); +/** + * Set Content-Type to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.xml = 'application/xml'; + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('application/xml') + * .send(xmlstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ + +Request.prototype.type = function (type) { + this.set('Content-Type', request.types[type] || type); + return this; +}; +/** + * Set Accept to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.accept = function (type) { + this.set('Accept', request.types[type] || type); + return this; +}; +/** + * Set Authorization field value with `user` and `pass`. + * + * @param {String} user + * @param {String} [pass] optional in case of using 'bearer' as type + * @param {Object} options with 'type' property 'auto', 'basic' or 'bearer' (default 'basic') + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.auth = function (user, pass, options) { + if (arguments.length === 1) pass = ''; + + if (typeof pass === 'object' && pass !== null) { + // pass is optional and can be replaced with options + options = pass; + pass = ''; + } + + if (!options) { + options = { + type: typeof btoa === 'function' ? 'basic' : 'auto' + }; + } + + const encoder = options.encoder ? options.encoder : string => { + if (typeof btoa === 'function') { + return btoa(string); + } + + throw new Error('Cannot use basic auth, btoa is not a function'); + }; + return this._auth(user, pass, options, encoder); +}; +/** + * Add query-string `val`. + * + * Examples: + * + * request.get('/shoes') + * .query('size=10') + * .query({ color: 'blue' }) + * + * @param {Object|String} val + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.query = function (value) { + if (typeof value !== 'string') value = serialize(value); + if (value) this._query.push(value); + return this; +}; +/** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `options` (or filename). + * + * ``` js + * request.post('/upload') + * .attach('content', new Blob(['<a id="a"><b id="b">hey!</b></a>'], { type: "text/html"})) + * .end(callback); + * ``` + * + * @param {String} field + * @param {Blob|File} file + * @param {String|Object} options + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.attach = function (field, file, options) { + if (file) { + if (this._data) { + throw new Error("superagent can't mix .send() and .attach()"); + } + + this._getFormData().append(field, file, options || file.name); + } + + return this; +}; + +Request.prototype._getFormData = function () { + if (!this._formData) { + this._formData = new root.FormData(); + } + + return this._formData; +}; +/** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ + + +Request.prototype.callback = function (error, res) { + if (this._shouldRetry(error, res)) { + return this._retry(); + } + + const fn = this._callback; + this.clearTimeout(); + + if (error) { + if (this._maxRetries) error.retries = this._retries - 1; + this.emit('error', error); + } + + fn(error, res); +}; +/** + * Invoke callback with x-domain error. + * + * @api private + */ + + +Request.prototype.crossDomainError = function () { + const error = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); + error.crossDomain = true; + error.status = this.status; + error.method = this.method; + error.url = this.url; + this.callback(error); +}; // This only warns, because the request is still likely to work + + +Request.prototype.agent = function () { + console.warn('This is not supported in browser version of superagent'); + return this; +}; + +Request.prototype.ca = Request.prototype.agent; +Request.prototype.buffer = Request.prototype.ca; // This throws, because it can't send/receive data as expected + +Request.prototype.write = () => { + throw new Error('Streaming is not supported in browser version of superagent'); +}; + +Request.prototype.pipe = Request.prototype.write; +/** + * Check if `obj` is a host object, + * we don't want to serialize these :) + * + * @param {Object} obj host object + * @return {Boolean} is a host object + * @api private + */ + +Request.prototype._isHost = function (object) { + // Native objects stringify to [object File], [object Blob], [object FormData], etc. + return object && typeof object === 'object' && !Array.isArray(object) && Object.prototype.toString.call(object) !== '[object Object]'; +}; +/** + * Initiate request, invoking callback `fn(res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.end = function (fn) { + if (this._endCalled) { + console.warn('Warning: .end() was called twice. This is not supported in superagent'); + } + + this._endCalled = true; // store callback + + this._callback = fn || noop; // querystring + + this._finalizeQueryString(); + + this._end(); +}; + +Request.prototype._setUploadTimeout = function () { + const self = this; // upload timeout it's wokrs only if deadline timeout is off + + if (this._uploadTimeout && !this._uploadTimeoutTimer) { + this._uploadTimeoutTimer = setTimeout(() => { + self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT'); + }, this._uploadTimeout); + } +}; // eslint-disable-next-line complexity + + +Request.prototype._end = function () { + if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called')); + const self = this; + this.xhr = request.getXHR(); + const xhr = this.xhr; + let data = this._formData || this._data; + + this._setTimeouts(); // state change + + + xhr.addEventListener('readystatechange', () => { + const readyState = xhr.readyState; + + if (readyState >= 2 && self._responseTimeoutTimer) { + clearTimeout(self._responseTimeoutTimer); + } + + if (readyState !== 4) { + return; + } // In IE9, reads to any property (e.g. status) off of an aborted XHR will + // result in the error "Could not complete the operation due to error c00c023f" + + + let status; + + try { + status = xhr.status; + } catch (err) { + status = 0; + } + + if (!status) { + if (self.timedout || self._aborted) return; + return self.crossDomainError(); + } + + self.emit('end'); + }); // progress + + const handleProgress = (direction, e) => { + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + + if (e.percent === 100) { + clearTimeout(self._uploadTimeoutTimer); + } + } + + e.direction = direction; + self.emit('progress', e); + }; + + if (this.hasListeners('progress')) { + try { + xhr.addEventListener('progress', handleProgress.bind(null, 'download')); + + if (xhr.upload) { + xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload')); + } + } catch (err) {// Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. + // Reported here: + // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context + } + } + + if (xhr.upload) { + this._setUploadTimeout(); + } // initiate request + + + try { + if (this.username && this.password) { + xhr.open(this.method, this.url, true, this.username, this.password); + } else { + xhr.open(this.method, this.url, true); + } + } catch (err) { + // see #1149 + return this.callback(err); + } // CORS + + + if (this._withCredentials) xhr.withCredentials = true; // body + + if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) { + // serialize stuff + const contentType = this._header['content-type']; + let serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : '']; + + if (!serialize && isJSON(contentType)) { + serialize = request.serialize['application/json']; + } + + if (serialize) data = serialize(data); + } // set header fields + + + for (const field in this.header) { + if (this.header[field] === null) continue; + if (hasOwn(this.header, field)) xhr.setRequestHeader(field, this.header[field]); + } + + if (this._responseType) { + xhr.responseType = this._responseType; + } // send stuff + + + this.emit('request', this); // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing) + // We need null here if data is undefined + + xhr.send(typeof data === 'undefined' ? null : data); +}; + +request.agent = () => new Agent(); + +for (var _i = 0, _arr = ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE']; _i < _arr.length; _i++) { + const method = _arr[_i]; + + Agent.prototype[method.toLowerCase()] = function (url, fn) { + const request_ = new request.Request(method, url); + + this._setDefaults(request_); + + if (fn) { + request_.end(fn); + } + + return request_; + }; +} + +Agent.prototype.del = Agent.prototype.delete; +/** + * GET `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.get = (url, data, fn) => { + const request_ = request('GET', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; +/** + * HEAD `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + +request.head = (url, data, fn) => { + const request_ = request('HEAD', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; +/** + * OPTIONS query to `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + +request.options = (url, data, fn) => { + const request_ = request('OPTIONS', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +/** + * DELETE `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + +function del(url, data, fn) { + const request_ = request('DELETE', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +} + +request.del = del; +request.delete = del; +/** + * PATCH `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.patch = (url, data, fn) => { + const request_ = request('PATCH', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +/** + * POST `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + +request.post = (url, data, fn) => { + const request_ = request('POST', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +/** + * PUT `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + +request.put = (url, data, fn) => { + const request_ = request('PUT', url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyb290Iiwid2luZG93Iiwic2VsZiIsImNvbnNvbGUiLCJ3YXJuIiwiRW1pdHRlciIsInJlcXVpcmUiLCJzYWZ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BQUosRUFBVW5GLFFBQVEsQ0FBQzBHLElBQVQsQ0FBY3ZCLElBQWQ7RUFDVixJQUFJekIsRUFBSixFQUFRMUQsUUFBUSxDQUFDeEQsR0FBVCxDQUFha0gsRUFBYjtFQUNSLE9BQU8xRCxRQUFQO0FBQ0QsQ0FWRDtBQVlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUFyRCxPQUFPLENBQUN1SyxHQUFSLEdBQWMsQ0FBQzVLLEdBQUQsRUFBTTZJLElBQU4sRUFBWXpCLEVBQVosS0FBbUI7RUFDL0IsTUFBTTFELFFBQVEsR0FBR3JELE9BQU8sQ0FBQyxLQUFELEVBQVFMLEdBQVIsQ0FBeEI7O0VBQ0EsSUFBSSxPQUFPNkksSUFBUCxLQUFnQixVQUFwQixFQUFnQztJQUM5QnpCLEVBQUUsR0FBR3lCLElBQUw7SUFDQUEsSUFBSSxHQUFHLElBQVA7RUFDRDs7RUFFRCxJQUFJQSxJQUFKLEVBQVVuRixRQUFRLENBQUMwRyxJQUFULENBQWN2QixJQUFkO0VBQ1YsSUFBSXpCLEVBQUosRUFBUTFELFFBQVEsQ0FBQ3hELEdBQVQsQ0FBYWtILEVBQWI7RUFDUixPQUFPMUQsUUFBUDtBQUNELENBVkQifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/agent.js b/together/node_modules/superagent/lib/node/agent.js new file mode 100644 index 0000000..30a4c1a --- /dev/null +++ b/together/node_modules/superagent/lib/node/agent.js @@ -0,0 +1,130 @@ +"use strict"; + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + +/** + * Module dependencies. + */ +// eslint-disable-next-line node/no-deprecated-api +const _require = require('url'), + parse = _require.parse; + +const _require2 = require('cookiejar'), + CookieJar = _require2.CookieJar; + +const _require3 = require('cookiejar'), + CookieAccessInfo = _require3.CookieAccessInfo; + +const methods = require('methods'); + +const request = require('../..'); + +const AgentBase = require('../agent-base'); +/** + * Expose `Agent`. + */ + + +module.exports = Agent; +/** + * Initialize a new `Agent`. + * + * @api public + */ + +function Agent(options) { + if (!(this instanceof Agent)) { + return new Agent(options); + } + + AgentBase.call(this); + this.jar = new CookieJar(); + + if (options) { + if (options.ca) { + this.ca(options.ca); + } + + if (options.key) { + this.key(options.key); + } + + if (options.pfx) { + this.pfx(options.pfx); + } + + if (options.cert) { + this.cert(options.cert); + } + + if (options.rejectUnauthorized === false) { + this.disableTLSCerts(); + } + } +} + +Agent.prototype = Object.create(AgentBase.prototype); +/** + * Save the cookies in the given `res` to + * the agent's cookie jar for persistence. + * + * @param {Response} res + * @api private + */ + +Agent.prototype._saveCookies = function (res) { + const cookies = res.headers['set-cookie']; + if (cookies) this.jar.setCookies(cookies); +}; +/** + * Attach cookies when available to the given `req`. + * + * @param {Request} req + * @api private + */ + + +Agent.prototype._attachCookies = function (request_) { + const url = parse(request_.url); + const access = new CookieAccessInfo(url.hostname, url.pathname, url.protocol === 'https:'); + const cookies = this.jar.getCookies(access).toValueString(); + request_.cookies = cookies; +}; + +var _iterator = _createForOfIteratorHelper(methods), + _step; + +try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + const name = _step.value; + const method = name.toUpperCase(); + + Agent.prototype[name] = function (url, fn) { + const request_ = new request.Request(method, url); + request_.on('response', this._saveCookies.bind(this)); + request_.on('redirect', this._saveCookies.bind(this)); + request_.on('redirect', this._attachCookies.bind(this, request_)); + + this._setDefaults(request_); + + this._attachCookies(request_); + + if (fn) { + request_.end(fn); + } + + return request_; + }; + } +} catch (err) { + _iterator.e(err); +} finally { + _iterator.f(); +} + +Agent.prototype.del = Agent.prototype.delete; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyZXF1aXJlIiwicGFyc2UiLCJDb29raWVKYXIiLCJDb29raWVBY2Nlc3NJbmZvIiwibWV0aG9kcyIsInJlcXVlc3QiLCJBZ2VudEJhc2UiLCJtb2R1bGUiLCJleHBvcnRzIiwiQWdlbnQiLCJvcHRpb25zIiwiY2FsbCIsImphciIsImNhIiwia2V5IiwicGZ4IiwiY2VydCIsInJlamVjdFVuYXV0aG9yaXplZCIsImRpc2FibGVUTFNDZXJ0cyIsInByb3RvdHlwZSIsIk9iamVjdCIsImNyZWF0ZSIsIl9zYXZlQ29va2llcyIsInJlcyIsImNvb2tpZXMiLCJoZWFkZXJzIiwic2V0Q29va2llcyIsIl9hdHRhY2hDb29raWVzIiwicmVxdWVzdF8iLCJ1cmwiLCJhY2Nlc3MiLCJob3N0bmFtZSIsInBhdGhuYW1lIiwicHJvdG9jb2wiLCJnZXRDb29raWVzIiwidG9WYWx1ZV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FBYUwsRUFBYjtNQUNEOztNQUVELE9BQU9YLFFBQVA7SUFDRCxDQWREO0VBZUQ7Ozs7Ozs7QUFFRG5CLEtBQUssQ0FBQ1UsU0FBTixDQUFnQjBCLEdBQWhCLEdBQXNCcEMsS0FBSyxDQUFDVSxTQUFOLENBQWdCMkIsTUFBdEMifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/http2wrapper.js b/together/node_modules/superagent/lib/node/http2wrapper.js new file mode 100644 index 0000000..52d0b11 --- /dev/null +++ b/together/node_modules/superagent/lib/node/http2wrapper.js @@ -0,0 +1,210 @@ +"use strict"; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +const Stream = require('stream'); + +const util = require('util'); + +const net = require('net'); + +const tls = require('tls'); // eslint-disable-next-line node/no-deprecated-api + + +const _require = require('url'), + parse = _require.parse; + +const process = require('process'); + +const semverGte = require('semver/functions/gte'); + +let http2; +if (semverGte(process.version, 'v10.10.0')) http2 = require('http2');else throw new Error('superagent: this version of Node.js does not support http2'); +const _http2$constants = http2.constants, + HTTP2_HEADER_PATH = _http2$constants.HTTP2_HEADER_PATH, + HTTP2_HEADER_STATUS = _http2$constants.HTTP2_HEADER_STATUS, + HTTP2_HEADER_METHOD = _http2$constants.HTTP2_HEADER_METHOD, + HTTP2_HEADER_AUTHORITY = _http2$constants.HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_HOST = _http2$constants.HTTP2_HEADER_HOST, + HTTP2_HEADER_SET_COOKIE = _http2$constants.HTTP2_HEADER_SET_COOKIE, + NGHTTP2_CANCEL = _http2$constants.NGHTTP2_CANCEL; + +function setProtocol(protocol) { + return { + request(options) { + return new Request(protocol, options); + } + + }; +} + +function Request(protocol, options) { + Stream.call(this); + const defaultPort = protocol === 'https:' ? 443 : 80; + const defaultHost = 'localhost'; + const port = options.port || defaultPort; + const host = options.host || defaultHost; + delete options.port; + delete options.host; + this.method = options.method; + this.path = options.path; + this.protocol = protocol; + this.host = host; + delete options.method; + delete options.path; + + const sessionOptions = _objectSpread({}, options); + + if (options.socketPath) { + sessionOptions.socketPath = options.socketPath; + sessionOptions.createConnection = this.createUnixConnection.bind(this); + } + + this._headers = {}; + const session = http2.connect("".concat(protocol, "//").concat(host, ":").concat(port), sessionOptions); + this.setHeader('host', "".concat(host, ":").concat(port)); + session.on('error', error => this.emit('error', error)); + this.session = session; +} +/** + * Inherit from `Stream` (which inherits from `EventEmitter`). + */ + + +util.inherits(Request, Stream); + +Request.prototype.createUnixConnection = function (authority, options) { + switch (this.protocol) { + case 'http:': + return net.connect(options.socketPath); + + case 'https:': + options.ALPNProtocols = ['h2']; + options.servername = this.host; + options.allowHalfOpen = true; + return tls.connect(options.socketPath, options); + + default: + throw new Error('Unsupported protocol', this.protocol); + } +}; // eslint-disable-next-line no-unused-vars + + +Request.prototype.setNoDelay = function (bool) {// We can not use setNoDelay with HTTP/2. + // Node 10 limits http2session.socket methods to ones safe to use with HTTP/2. + // See also https://nodejs.org/api/http2.html#http2_http2session_socket +}; + +Request.prototype.getFrame = function () { + if (this.frame) { + return this.frame; + } + + const method = { + [HTTP2_HEADER_PATH]: this.path, + [HTTP2_HEADER_METHOD]: this.method + }; + let headers = this.mapToHttp2Header(this._headers); + headers = Object.assign(headers, method); + const frame = this.session.request(headers); // eslint-disable-next-line no-unused-vars + + frame.once('response', (headers, flags) => { + headers = this.mapToHttpHeader(headers); + frame.headers = headers; + frame.statusCode = headers[HTTP2_HEADER_STATUS]; + frame.status = frame.statusCode; + this.emit('response', frame); + }); + this._headerSent = true; + frame.once('drain', () => this.emit('drain')); + frame.on('error', error => this.emit('error', error)); + frame.on('close', () => this.session.close()); + this.frame = frame; + return frame; +}; + +Request.prototype.mapToHttpHeader = function (headers) { + const keys = Object.keys(headers); + const http2Headers = {}; + + for (var _i = 0, _keys = keys; _i < _keys.length; _i++) { + let key = _keys[_i]; + let value = headers[key]; + key = key.toLowerCase(); + + switch (key) { + case HTTP2_HEADER_SET_COOKIE: + value = Array.isArray(value) ? value : [value]; + break; + + default: + break; + } + + http2Headers[key] = value; + } + + return http2Headers; +}; + +Request.prototype.mapToHttp2Header = function (headers) { + const keys = Object.keys(headers); + const http2Headers = {}; + + for (var _i2 = 0, _keys2 = keys; _i2 < _keys2.length; _i2++) { + let key = _keys2[_i2]; + let value = headers[key]; + key = key.toLowerCase(); + + switch (key) { + case HTTP2_HEADER_HOST: + key = HTTP2_HEADER_AUTHORITY; + value = /^http:\/\/|^https:\/\//.test(value) ? parse(value).host : value; + break; + + default: + break; + } + + http2Headers[key] = value; + } + + return http2Headers; +}; + +Request.prototype.setHeader = function (name, value) { + this._headers[name.toLowerCase()] = value; +}; + +Request.prototype.getHeader = function (name) { + return this._headers[name.toLowerCase()]; +}; + +Request.prototype.write = function (data, encoding) { + const frame = this.getFrame(); + return frame.write(data, encoding); +}; + +Request.prototype.pipe = function (stream, options) { + const frame = this.getFrame(); + return frame.pipe(stream, options); +}; + +Request.prototype.end = function (data) { + const frame = this.getFrame(); + frame.end(data); +}; // eslint-disable-next-line no-unused-vars + + +Request.prototype.abort = function (data) { + const frame = this.getFrame(); + frame.close(NGHTTP2_CANCEL); + this.session.destroy(); +}; + +exports.setProt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QixHQUEwQixVQUFVQyxJQUFWLEVBQWdCQyxRQUFoQixFQUEwQjtFQUNsRCxNQUFNeEIsS0FBSyxHQUFHLEtBQUtELFFBQUwsRUFBZDtFQUNBLE9BQU9DLEtBQUssQ0FBQ3NCLEtBQU4sQ0FBWUMsSUFBWixFQUFrQkMsUUFBbEIsQ0FBUDtBQUNELENBSEQ7O0FBS0FyRCxPQUFPLENBQUNxQixTQUFSLENBQWtCaUMsSUFBbEIsR0FBeUIsVUFBVUMsTUFBVixFQUFrQnhELE9BQWxCLEVBQTJCO0VBQ2xELE1BQU04QixLQUFLLEdBQUcsS0FBS0QsUUFBTCxFQUFkO0VBQ0EsT0FBT0MsS0FBSyxDQUFDeUIsSUFBTixDQUFXQyxNQUFYLEVBQW1CeEQsT0FBbkIsQ0FBUDtBQUNELENBSEQ7O0FBS0FDLE9BQU8sQ0FBQ3FCLFNBQVIsQ0FBa0JtQyxHQUFsQixHQUF3QixVQUFVSixJQUFWLEVBQWdCO0VBQ3RDLE1BQU12QixLQUFLLEdBQUcsS0FBS0QsUUFBTCxFQUFkO0VBQ0FDLEtBQUssQ0FBQzJCLEdBQU4sQ0FBVUosSUFBVjtBQUNELENBSEQsQyxDQUtBOzs7QUFDQXBELE9BQU8sQ0FBQ3FCLFNBQVIsQ0FBa0JvQyxLQUFsQixHQUEwQixVQUFVTCxJQUFWLEVBQWdCO0VBQ3hDLE1BQU12QixLQUFLLEdBQUcsS0FBS0QsUUFBTCxFQUFkO0VBQ0FDLEtBQUssQ0FBQ1csS0FBTixDQUFZN0MsY0FBWjtFQUNBLEtBQUttQixPQUFMLENBQWE0QyxPQUFiO0FBQ0QsQ0FKRDs7QUFNQUMsT0FBTyxDQUFDL0QsV0FBUixHQUFzQkEsV0FBdEIifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/index.js b/together/node_modules/superagent/lib/node/index.js new file mode 100644 index 0000000..bb6da12 --- /dev/null +++ b/together/node_modules/superagent/lib/node/index.js @@ -0,0 +1,1409 @@ +"use strict"; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + +/** + * Module dependencies. + */ +// eslint-disable-next-line node/no-deprecated-api +const _require = require('url'), + parse = _require.parse, + format = _require.format, + resolve = _require.resolve; + +const Stream = require('stream'); + +const https = require('https'); + +const http = require('http'); + +const fs = require('fs'); + +const zlib = require('zlib'); + +const util = require('util'); + +const qs = require('qs'); + +const mime = require('mime'); + +let methods = require('methods'); + +const FormData = require('form-data'); + +const formidable = require('formidable'); + +const debug = require('debug')('superagent'); + +const CookieJar = require('cookiejar'); + +const semverGte = require('semver/functions/gte'); + +const safeStringify = require('fast-safe-stringify'); + +const utils = require('../utils'); + +const RequestBase = require('../request-base'); + +const _require2 = require('./unzip'), + unzip = _require2.unzip; + +const Response = require('./response'); + +const mixin = utils.mixin, + hasOwn = utils.hasOwn; +let http2; +if (semverGte(process.version, 'v10.10.0')) http2 = require('./http2wrapper'); + +function request(method, url) { + // callback + if (typeof url === 'function') { + return new exports.Request('GET', method).end(url); + } // url first + + + if (arguments.length === 1) { + return new exports.Request('GET', method); + } + + return new exports.Request(method, url); +} + +module.exports = request; +exports = module.exports; +/** + * Expose `Request`. + */ + +exports.Request = Request; +/** + * Expose the agent function + */ + +exports.agent = require('./agent'); +/** + * Noop. + */ + +function noop() {} +/** + * Expose `Response`. + */ + + +exports.Response = Response; +/** + * Define "form" mime type. + */ + +mime.define({ + 'application/x-www-form-urlencoded': ['form', 'urlencoded', 'form-data'] +}, true); +/** + * Protocol map. + */ + +exports.protocols = { + 'http:': http, + 'https:': https, + 'http2:': http2 +}; +/** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ + +exports.serialize = { + 'application/x-www-form-urlencoded': qs.stringify, + 'application/json': safeStringify +}; +/** + * Default parsers. + * + * superagent.parse['application/xml'] = function(res, fn){ + * fn(null, res); + * }; + * + */ + +exports.parse = require('./parsers'); +/** + * Default buffering map. Can be used to set certain + * response types to buffer/not buffer. + * + * superagent.buffer['application/xml'] = true; + */ + +exports.buffer = {}; +/** + * Initialize internal header tracking properties on a request instance. + * + * @param {Object} req the instance + * @api private + */ + +function _initHeaders(request_) { + request_._header = {// coerces header names to lowercase + }; + request_.header = {// preserves header name case + }; +} +/** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String|Object} url + * @api public + */ + + +function Request(method, url) { + Stream.call(this); + if (typeof url !== 'string') url = format(url); + this._enableHttp2 = Boolean(process.env.HTTP2_TEST); // internal only + + this._agent = false; + this._formData = null; + this.method = method; + this.url = url; + + _initHeaders(this); + + this.writable = true; + this._redirects = 0; + this.redirects(method === 'HEAD' ? 0 : 5); + this.cookies = ''; + this.qs = {}; + this._query = []; + this.qsRaw = this._query; // Unused, for backwards compatibility only + + this._redirectList = []; + this._streamRequest = false; + this._lookup = undefined; + this.once('end', this.clearTimeout.bind(this)); +} +/** + * Inherit from `Stream` (which inherits from `EventEmitter`). + * Mixin `RequestBase`. + */ + + +util.inherits(Request, Stream); +mixin(Request.prototype, RequestBase.prototype); +/** + * Enable or Disable http2. + * + * Enable http2. + * + * ``` js + * request.get('http://localhost/') + * .http2() + * .end(callback); + * + * request.get('http://localhost/') + * .http2(true) + * .end(callback); + * ``` + * + * Disable http2. + * + * ``` js + * request = request.http2(); + * request.get('http://localhost/') + * .http2(false) + * .end(callback); + * ``` + * + * @param {Boolean} enable + * @return {Request} for chaining + * @api public + */ + +Request.prototype.http2 = function (bool) { + if (exports.protocols['http2:'] === undefined) { + throw new Error('superagent: this version of Node.js does not support http2'); + } + + this._enableHttp2 = bool === undefined ? true : bool; + return this; +}; +/** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `options` (or filename). + * + * ``` js + * request.post('http://localhost/upload') + * .attach('field', Buffer.from('<b>Hello world</b>'), 'hello.html') + * .end(callback); + * ``` + * + * A filename may also be used: + * + * ``` js + * request.post('http://localhost/upload') + * .attach('files', 'image.jpg') + * .end(callback); + * ``` + * + * @param {String} field + * @param {String|fs.ReadStream|Buffer} file + * @param {String|Object} options + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.attach = function (field, file, options) { + if (file) { + if (this._data) { + throw new Error("superagent can't mix .send() and .attach()"); + } + + let o = options || {}; + + if (typeof options === 'string') { + o = { + filename: options + }; + } + + if (typeof file === 'string') { + if (!o.filename) o.filename = file; + debug('creating `fs.ReadStream` instance for file: %s', file); + file = fs.createReadStream(file); + file.on('error', error => { + const formData = this._getFormData(); + + formData.emit('error', error); + }); + } else if (!o.filename && file.path) { + o.filename = file.path; + } + + this._getFormData().append(field, file, o); + } + + return this; +}; + +Request.prototype._getFormData = function () { + if (!this._formData) { + this._formData = new FormData(); + + this._formData.on('error', error => { + debug('FormData error', error); + + if (this.called) { + // The request has already finished and the callback was called. + // Silently ignore the error. + return; + } + + this.callback(error); + this.abort(); + }); + } + + return this._formData; +}; +/** + * Gets/sets the `Agent` to use for this HTTP request. The default (if this + * function is not called) is to opt out of connection pooling (`agent: false`). + * + * @param {http.Agent} agent + * @return {http.Agent} + * @api public + */ + + +Request.prototype.agent = function (agent) { + if (arguments.length === 0) return this._agent; + this._agent = agent; + return this; +}; +/** + * Gets/sets the `lookup` function to use custom DNS resolver. + * + * @param {Function} lookup + * @return {Function} + * @api public + */ + + +Request.prototype.lookup = function (lookup) { + if (arguments.length === 0) return this._lookup; + this._lookup = lookup; + return this; +}; +/** + * Set _Content-Type_ response header passed through `mime.getType()`. + * + * Examples: + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('json') + * .send(jsonstring) + * .end(callback); + * + * request.post('/') + * .type('application/json') + * .send(jsonstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.type = function (type) { + return this.set('Content-Type', type.includes('/') ? type : mime.getType(type)); +}; +/** + * Set _Accept_ response header passed through `mime.getType()`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.accept = function (type) { + return this.set('Accept', type.includes('/') ? type : mime.getType(type)); +}; +/** + * Add query-string `val`. + * + * Examples: + * + * request.get('/shoes') + * .query('size=10') + * .query({ color: 'blue' }) + * + * @param {Object|String} val + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.query = function (value) { + if (typeof value === 'string') { + this._query.push(value); + } else { + Object.assign(this.qs, value); + } + + return this; +}; +/** + * Write raw `data` / `encoding` to the socket. + * + * @param {Buffer|String} data + * @param {String} encoding + * @return {Boolean} + * @api public + */ + + +Request.prototype.write = function (data, encoding) { + const request_ = this.request(); + + if (!this._streamRequest) { + this._streamRequest = true; + } + + return request_.write(data, encoding); +}; +/** + * Pipe the request body to `stream`. + * + * @param {Stream} stream + * @param {Object} options + * @return {Stream} + * @api public + */ + + +Request.prototype.pipe = function (stream, options) { + this.piped = true; // HACK... + + this.buffer(false); + this.end(); + return this._pipeContinue(stream, options); +}; + +Request.prototype._pipeContinue = function (stream, options) { + this.req.once('response', res => { + // redirect + if (isRedirect(res.statusCode) && this._redirects++ !== this._maxRedirects) { + return this._redirect(res) === this ? this._pipeContinue(stream, options) : undefined; + } + + this.res = res; + + this._emitResponse(); + + if (this._aborted) return; + + if (this._shouldUnzip(res)) { + const unzipObject = zlib.createUnzip(); + unzipObject.on('error', error => { + if (error && error.code === 'Z_BUF_ERROR') { + // unexpected end of file is ignored by browsers and curl + stream.emit('end'); + return; + } + + stream.emit('error', error); + }); + res.pipe(unzipObject).pipe(stream, options); + } else { + res.pipe(stream, options); + } + + res.once('end', () => { + this.emit('end'); + }); + }); + return stream; +}; +/** + * Enable / disable buffering. + * + * @return {Boolean} [val] + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.buffer = function (value) { + this._buffer = value !== false; + return this; +}; +/** + * Redirect to `url + * + * @param {IncomingMessage} res + * @return {Request} for chaining + * @api private + */ + + +Request.prototype._redirect = function (res) { + let url = res.headers.location; + + if (!url) { + return this.callback(new Error('No location header for redirect'), res); + } + + debug('redirect %s -> %s', this.url, url); // location + + url = resolve(this.url, url); // ensure the response is being consumed + // this is required for Node v0.10+ + + res.resume(); + let headers = this.req.getHeaders ? this.req.getHeaders() : this.req._headers; + const changesOrigin = parse(url).host !== parse(this.url).host; // implementation of 302 following defacto standard + + if (res.statusCode === 301 || res.statusCode === 302) { + // strip Content-* related fields + // in case of POST etc + headers = utils.cleanHeader(headers, changesOrigin); // force GET + + this.method = this.method === 'HEAD' ? 'HEAD' : 'GET'; // clear data + + this._data = null; + } // 303 is always GET + + + if (res.statusCode === 303) { + // strip Content-* related fields + // in case of POST etc + headers = utils.cleanHeader(headers, changesOrigin); // force method + + this.method = 'GET'; // clear data + + this._data = null; + } // 307 preserves method + // 308 preserves method + + + delete headers.host; + delete this.req; + delete this._formData; // remove all add header except User-Agent + + _initHeaders(this); // redirect + + + this._endCalled = false; + this.url = url; + this.qs = {}; + this._query.length = 0; + this.set(headers); + this.emit('redirect', res); + + this._redirectList.push(this.url); + + this.end(this._callback); + return this; +}; +/** + * Set Authorization field value with `user` and `pass`. + * + * Examples: + * + * .auth('tobi', 'learnboost') + * .auth('tobi:learnboost') + * .auth('tobi') + * .auth(accessToken, { type: 'bearer' }) + * + * @param {String} user + * @param {String} [pass] + * @param {Object} [options] options with authorization type 'basic' or 'bearer' ('basic' is default) + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.auth = function (user, pass, options) { + if (arguments.length === 1) pass = ''; + + if (typeof pass === 'object' && pass !== null) { + // pass is optional and can be replaced with options + options = pass; + pass = ''; + } + + if (!options) { + options = { + type: 'basic' + }; + } + + const encoder = string => Buffer.from(string).toString('base64'); + + return this._auth(user, pass, options, encoder); +}; +/** + * Set the certificate authority option for https request. + * + * @param {Buffer | Array} cert + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.ca = function (cert) { + this._ca = cert; + return this; +}; +/** + * Set the client certificate key option for https request. + * + * @param {Buffer | String} cert + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.key = function (cert) { + this._key = cert; + return this; +}; +/** + * Set the key, certificate, and CA certs of the client in PFX or PKCS12 format. + * + * @param {Buffer | String} cert + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.pfx = function (cert) { + if (typeof cert === 'object' && !Buffer.isBuffer(cert)) { + this._pfx = cert.pfx; + this._passphrase = cert.passphrase; + } else { + this._pfx = cert; + } + + return this; +}; +/** + * Set the client certificate option for https request. + * + * @param {Buffer | String} cert + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.cert = function (cert) { + this._cert = cert; + return this; +}; +/** + * Do not reject expired or invalid TLS certs. + * sets `rejectUnauthorized=true`. Be warned that this allows MITM attacks. + * + * @return {Request} for chaining + * @api public + */ + + +Request.prototype.disableTLSCerts = function () { + this._disableTLSCerts = true; + return this; +}; +/** + * Return an http[s] request. + * + * @return {OutgoingMessage} + * @api private + */ +// eslint-disable-next-line complexity + + +Request.prototype.request = function () { + if (this.req) return this.req; + const options = {}; + + try { + const query = qs.stringify(this.qs, { + indices: false, + strictNullHandling: true + }); + + if (query) { + this.qs = {}; + + this._query.push(query); + } + + this._finalizeQueryString(); + } catch (err) { + return this.emit('error', err); + } + + let url = this.url; + const retries = this._retries; // Capture backticks as-is from the final query string built above. + // Note: this'll only find backticks entered in req.query(String) + // calls, because qs.stringify unconditionally encodes backticks. + + let queryStringBackticks; + + if (url.includes('`')) { + const queryStartIndex = url.indexOf('?'); + + if (queryStartIndex !== -1) { + const queryString = url.slice(queryStartIndex + 1); + queryStringBackticks = queryString.match(/`|%60/g); + } + } // default to http:// + + + if (url.indexOf('http') !== 0) url = "http://".concat(url); + url = parse(url); // See https://github.com/visionmedia/superagent/issues/1367 + + if (queryStringBackticks) { + let i = 0; + url.query = url.query.replace(/%60/g, () => queryStringBackticks[i++]); + url.search = "?".concat(url.query); + url.path = url.pathname + url.search; + } // support unix sockets + + + if (/^https?\+unix:/.test(url.protocol) === true) { + // get the protocol + url.protocol = "".concat(url.protocol.split('+')[0], ":"); // get the socket, path + + const unixParts = url.path.match(/^([^/]+)(.+)$/); + options.socketPath = unixParts[1].replace(/%2F/g, '/'); + url.path = unixParts[2]; + } // Override IP address of a hostname + + + if (this._connectOverride) { + const _url = url, + hostname = _url.hostname; + const match = hostname in this._connectOverride ? this._connectOverride[hostname] : this._connectOverride['*']; + + if (match) { + // backup the real host + if (!this._header.host) { + this.set('host', url.host); + } + + let newHost; + let newPort; + + if (typeof match === 'object') { + newHost = match.host; + newPort = match.port; + } else { + newHost = match; + newPort = url.port; + } // wrap [ipv6] + + + url.host = /:/.test(newHost) ? "[".concat(newHost, "]") : newHost; + + if (newPort) { + url.host += ":".concat(newPort); + url.port = newPort; + } + + url.hostname = newHost; + } + } // options + + + options.method = this.method; + options.port = url.port; + options.path = url.path; + options.host = url.hostname; + options.ca = this._ca; + options.key = this._key; + options.pfx = this._pfx; + options.cert = this._cert; + options.passphrase = this._passphrase; + options.agent = this._agent; + options.lookup = this._lookup; + options.rejectUnauthorized = typeof this._disableTLSCerts === 'boolean' ? !this._disableTLSCerts : process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0'; // Allows request.get('https://1.2.3.4/').set('Host', 'example.com') + + if (this._header.host) { + options.servername = this._header.host.replace(/:\d+$/, ''); + } + + if (this._trustLocalhost && /^(?:localhost|127\.0\.0\.\d+|(0*:)+:0*1)$/.test(url.hostname)) { + options.rejectUnauthorized = false; + } // initiate request + + + const module_ = this._enableHttp2 ? exports.protocols['http2:'].setProtocol(url.protocol) : exports.protocols[url.protocol]; // request + + this.req = module_.request(options); + const req = this.req; // set tcp no delay + + req.setNoDelay(true); + + if (options.method !== 'HEAD') { + req.setHeader('Accept-Encoding', 'gzip, deflate'); + } + + this.protocol = url.protocol; + this.host = url.host; // expose events + + req.once('drain', () => { + this.emit('drain'); + }); + req.on('error', error => { + // flag abortion here for out timeouts + // because node will emit a faux-error "socket hang up" + // when request is aborted before a connection is made + if (this._aborted) return; // if not the same, we are in the **old** (cancelled) request, + // so need to continue (same as for above) + + if (this._retries !== retries) return; // if we've received a response then we don't want to let + // an error in the request blow up the response + + if (this.response) return; + this.callback(error); + }); // auth + + if (url.auth) { + const auth = url.auth.split(':'); + this.auth(auth[0], auth[1]); + } + + if (this.username && this.password) { + this.auth(this.username, this.password); + } + + for (const key in this.header) { + if (hasOwn(this.header, key)) req.setHeader(key, this.header[key]); + } // add cookies + + + if (this.cookies) { + if (hasOwn(this._header, 'cookie')) { + // merge + const temporaryJar = new CookieJar.CookieJar(); + temporaryJar.setCookies(this._header.cookie.split(';')); + temporaryJar.setCookies(this.cookies.split(';')); + req.setHeader('Cookie', temporaryJar.getCookies(CookieJar.CookieAccessInfo.All).toValueString()); + } else { + req.setHeader('Cookie', this.cookies); + } + } + + return req; +}; +/** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ + + +Request.prototype.callback = function (error, res) { + if (this._shouldRetry(error, res)) { + return this._retry(); + } // Avoid the error which is emitted from 'socket hang up' to cause the fn undefined error on JS runtime. + + + const fn = this._callback || noop; + this.clearTimeout(); + if (this.called) return console.warn('superagent: double callback bug'); + this.called = true; + + if (!error) { + try { + if (!this._isResponseOK(res)) { + let message = 'Unsuccessful HTTP response'; + + if (res) { + message = http.STATUS_CODES[res.status] || message; + } + + error = new Error(message); + error.status = res ? res.status : undefined; + } + } catch (err) { + error = err; + error.status = error.status || (res ? res.status : undefined); + } + } // It's important that the callback is called outside try/catch + // to avoid double callback + + + if (!error) { + return fn(null, res); + } + + error.response = res; + if (this._maxRetries) error.retries = this._retries - 1; // only emit error event if there is a listener + // otherwise we assume the callback to `.end()` will get the error + + if (error && this.listeners('error').length > 0) { + this.emit('error', error); + } + + fn(error, res); +}; +/** + * Check if `obj` is a host object, + * + * @param {Object} obj host object + * @return {Boolean} is a host object + * @api private + */ + + +Request.prototype._isHost = function (object) { + return Buffer.isBuffer(object) || object instanceof Stream || object instanceof FormData; +}; +/** + * Initiate request, invoking callback `fn(err, res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ + + +Request.prototype._emitResponse = function (body, files) { + const response = new Response(this); + this.response = response; + response.redirects = this._redirectList; + + if (undefined !== body) { + response.body = body; + } + + response.files = files; + + if (this._endCalled) { + response.pipe = function () { + throw new Error("end() has already been called, so it's too late to start piping"); + }; + } + + this.emit('response', response); + return response; +}; + +Request.prototype.end = function (fn) { + this.request(); + debug('%s %s', this.method, this.url); + + if (this._endCalled) { + throw new Error('.end() was called twice. This is not supported in superagent'); + } + + this._endCalled = true; // store callback + + this._callback = fn || noop; + + this._end(); +}; + +Request.prototype._end = function () { + if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called')); + let data = this._data; + const req = this.req; + const method = this.method; + + this._setTimeouts(); // body + + + if (method !== 'HEAD' && !req._headerSent) { + // serialize stuff + if (typeof data !== 'string') { + let contentType = req.getHeader('Content-Type'); // Parse out just the content type from the header (ignore the charset) + + if (contentType) contentType = contentType.split(';')[0]; + let serialize = this._serializer || exports.serialize[contentType]; + + if (!serialize && isJSON(contentType)) { + serialize = exports.serialize['application/json']; + } + + if (serialize) data = serialize(data); + } // content-length + + + if (data && !req.getHeader('Content-Length')) { + req.setHeader('Content-Length', Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)); + } + } // response + // eslint-disable-next-line complexity + + + req.once('response', res => { + debug('%s %s -> %s', this.method, this.url, res.statusCode); + + if (this._responseTimeoutTimer) { + clearTimeout(this._responseTimeoutTimer); + } + + if (this.piped) { + return; + } + + const max = this._maxRedirects; + const mime = utils.type(res.headers['content-type'] || '') || 'text/plain'; + let type = mime.split('/')[0]; + if (type) type = type.toLowerCase().trim(); + const multipart = type === 'multipart'; + const redirect = isRedirect(res.statusCode); + const responseType = this._responseType; + this.res = res; // redirect + + if (redirect && this._redirects++ !== max) { + return this._redirect(res); + } + + if (this.method === 'HEAD') { + this.emit('end'); + this.callback(null, this._emitResponse()); + return; + } // zlib support + + + if (this._shouldUnzip(res)) { + unzip(req, res); + } + + let buffer = this._buffer; + + if (buffer === undefined && mime in exports.buffer) { + buffer = Boolean(exports.buffer[mime]); + } + + let parser = this._parser; + + if (undefined === buffer && parser) { + console.warn("A custom superagent parser has been set, but buffering strategy for the parser hasn't been configured. Call `req.buffer(true or false)` or set `superagent.buffer[mime] = true or false`"); + buffer = true; + } + + if (!parser) { + if (responseType) { + parser = exports.parse.image; // It's actually a generic Buffer + + buffer = true; + } else if (multipart) { + const form = formidable(); + parser = form.parse.bind(form); + buffer = true; + } else if (isBinary(mime)) { + parser = exports.parse.image; + buffer = true; // For backwards-compatibility buffering default is ad-hoc MIME-dependent + } else if (exports.parse[mime]) { + parser = exports.parse[mime]; + } else if (type === 'text') { + parser = exports.parse.text; + buffer = buffer !== false; // everyone wants their own white-labeled json + } else if (isJSON(mime)) { + parser = exports.parse['application/json']; + buffer = buffer !== false; + } else if (buffer) { + parser = exports.parse.text; + } else if (undefined === buffer) { + parser = exports.parse.image; // It's actually a generic Buffer + + buffer = true; + } + } // by default only buffer text/*, json and messed up thing from hell + + + if (undefined === buffer && isText(mime) || isJSON(mime)) { + buffer = true; + } + + this._resBuffered = buffer; + let parserHandlesEnd = false; + + if (buffer) { + // Protectiona against zip bombs and other nuisance + let responseBytesLeft = this._maxResponseSize || 200000000; + res.on('data', buf => { + responseBytesLeft -= buf.byteLength || buf.length > 0 ? buf.length : 0; + + if (responseBytesLeft < 0) { + // This will propagate through error event + const error = new Error('Maximum response size reached'); + error.code = 'ETOOLARGE'; // Parsers aren't required to observe error event, + // so would incorrectly report success + + parserHandlesEnd = false; // Will not emit error event + + res.destroy(error); // so we do callback now + + this.callback(error, null); + } + }); + } + + if (parser) { + try { + // Unbuffered parsers are supposed to emit response early, + // which is weird BTW, because response.body won't be there. + parserHandlesEnd = buffer; + parser(res, (error, object, files) => { + if (this.timedout) { + // Timeout has already handled all callbacks + return; + } // Intentional (non-timeout) abort is supposed to preserve partial response, + // even if it doesn't parse. + + + if (error && !this._aborted) { + return this.callback(error); + } + + if (parserHandlesEnd) { + this.emit('end'); + this.callback(null, this._emitResponse(object, files)); + } + }); + } catch (err) { + this.callback(err); + return; + } + } + + this.res = res; // unbuffered + + if (!buffer) { + debug('unbuffered %s %s', this.method, this.url); + this.callback(null, this._emitResponse()); + if (multipart) return; // allow multipart to handle end event + + res.once('end', () => { + debug('end %s %s', this.method, this.url); + this.emit('end'); + }); + return; + } // terminating events + + + res.once('error', error => { + parserHandlesEnd = false; + this.callback(error, null); + }); + if (!parserHandlesEnd) res.once('end', () => { + debug('end %s %s', this.method, this.url); // TODO: unless buffering emit earlier to stream + + this.emit('end'); + this.callback(null, this._emitResponse()); + }); + }); + this.emit('request', this); + + const getProgressMonitor = () => { + const lengthComputable = true; + const total = req.getHeader('Content-Length'); + let loaded = 0; + const progress = new Stream.Transform(); + + progress._transform = (chunk, encoding, callback) => { + loaded += chunk.length; + this.emit('progress', { + direction: 'upload', + lengthComputable, + loaded, + total + }); + callback(null, chunk); + }; + + return progress; + }; + + const bufferToChunks = buffer => { + const chunkSize = 16 * 1024; // default highWaterMark value + + const chunking = new Stream.Readable(); + const totalLength = buffer.length; + const remainder = totalLength % chunkSize; + const cutoff = totalLength - remainder; + + for (let i = 0; i < cutoff; i += chunkSize) { + const chunk = buffer.slice(i, i + chunkSize); + chunking.push(chunk); + } + + if (remainder > 0) { + const remainderBuffer = buffer.slice(-remainder); + chunking.push(remainderBuffer); + } + + chunking.push(null); // no more data + + return chunking; + }; // if a FormData instance got created, then we send that as the request body + + + const formData = this._formData; + + if (formData) { + // set headers + const headers = formData.getHeaders(); + + for (const i in headers) { + if (hasOwn(headers, i)) { + debug('setting FormData header: "%s: %s"', i, headers[i]); + req.setHeader(i, headers[i]); + } + } // attempt to get "Content-Length" header + + + formData.getLength((error, length) => { + // TODO: Add chunked encoding when no length (if err) + if (error) debug('formData.getLength had error', error, length); + debug('got FormData Content-Length: %s', length); + + if (typeof length === 'number') { + req.setHeader('Content-Length', length); + } + + formData.pipe(getProgressMonitor()).pipe(req); + }); + } else if (Buffer.isBuffer(data)) { + bufferToChunks(data).pipe(getProgressMonitor()).pipe(req); + } else { + req.end(data); + } +}; // Check whether response has a non-0-sized gzip-encoded body + + +Request.prototype._shouldUnzip = res => { + if (res.statusCode === 204 || res.statusCode === 304) { + // These aren't supposed to have any body + return false; + } // header content is a string, and distinction between 0 and no information is crucial + + + if (res.headers['content-length'] === '0') { + // We know that the body is empty (unfortunately, this check does not cover chunked encoding) + return false; + } // console.log(res); + + + return /^\s*(?:deflate|gzip)\s*$/.test(res.headers['content-encoding']); +}; +/** + * Overrides DNS for selected hostnames. Takes object mapping hostnames to IP addresses. + * + * When making a request to a URL with a hostname exactly matching a key in the object, + * use the given IP address to connect, instead of using DNS to resolve the hostname. + * + * A special host `*` matches every hostname (keep redirects in mind!) + * + * request.connect({ + * 'test.example.com': '127.0.0.1', + * 'ipv6.example.com': '::1', + * }) + */ + + +Request.prototype.connect = function (connectOverride) { + if (typeof connectOverride === 'string') { + this._connectOverride = { + '*': connectOverride + }; + } else if (typeof connectOverride === 'object') { + this._connectOverride = connectOverride; + } else { + this._connectOverride = undefined; + } + + return this; +}; + +Request.prototype.trustLocalhost = function (toggle) { + this._trustLocalhost = toggle === undefined ? true : toggle; + return this; +}; // generate HTTP verb methods + + +if (!methods.includes('del')) { + // create a copy so we don't cause conflicts with + // other packages using the methods package and + // npm 3.x + methods = [...methods]; + methods.push('del'); +} + +var _iterator = _createForOfIteratorHelper(methods), + _step; + +try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + let method = _step.value; + const name = method; + method = method === 'del' ? 'delete' : method; + method = method.toUpperCase(); + + request[name] = (url, data, fn) => { + const request_ = request(method, url); + + if (typeof data === 'function') { + fn = data; + data = null; + } + + if (data) { + if (method === 'GET' || method === 'HEAD') { + request_.query(data); + } else { + request_.send(data); + } + } + + if (fn) request_.end(fn); + return request_; + }; + } + /** + * Check if `mime` is text and should be buffered. + * + * @param {String} mime + * @return {Boolean} + * @api public + */ + +} catch (err) { + _iterator.e(err); +} finally { + _iterator.f(); +} + +function isText(mime) { + const parts = mime.split('/'); + let type = parts[0]; + if (type) type = type.toLowerCase().trim(); + let subtype = parts[1]; + if (subtype) subtype = subtype.toLowerCase().trim(); + return type === 'text' || subtype === 'x-www-form-urlencoded'; +} // This is not a catchall, but a start. It might be useful +// in the long run to have file that includes all binary +// content types from https://www.iana.org/assignments/media-types/media-types.xhtml + + +function isBinary(mime) { + let _mime$split = mime.split('/'), + _mime$split2 = _slicedToArray(_mime$split, 2), + registry = _mime$split2[0], + name = _mime$split2[1]; + + if (registry) registry = registry.toLowerCase().trim(); + if (name) name = name.toLowerCase().trim(); + return ['audio', 'font', 'image', 'video'].includes(registry) || ['gz', 'gzip'].includes(name); +} +/** + * Check if `mime` is json or has +json structured syntax suffix. + * + * @param {String} mime + * @return {Boolean} + * @api private + */ + + +function isJSON(mime) { + // should match /json or +json + // but not /json-seq + return /[/+]json($|[^-\w])/i.test(mime); +} +/** + * Check if we should follow the redirect `code`. + * + * @param {Number} code + * @return {Boolean} + * @api private + */ + + +function isRedirect(code) { + return [301, 302, 303, 305, 307, 308].includes(code); +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyZXF1aXJlIiwicGFyc2UiLCJmb3JtYXQiLCJyZXNvbHZlIiwiU3RyZWFtIiwiaHR0cHMiLCJodHRwIiwiZnMiLCJ6bGliIiwidXRpbCIsInFzIiwibWltZSIsIm1ldGhvZHMiLCJGb3JtRGF0YSIsImZvcm1pZGFibGUiLCJkZWJ1ZyIsIkNvb2tpZUphciIsInNlbXZlckd0ZSIsInNhZmVTdHJpbmdpZnkiLCJ1dGlscyIsIlJlcXVlc3RCYXNlIiwidW56aX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BZUwsSUFBZjs7RUFDQSxJQUFJSyxRQUFKLEVBQWNBLFFBQVEsR0FBR0EsUUFBUSxDQUFDL0MsV0FBVCxHQUF1QkMsSUFBdkIsRUFBWDtFQUNkLElBQUl5QyxJQUFKLEVBQVVBLElBQUksR0FBR0EsSUFBSSxDQUFDMUMsV0FBTCxHQUFtQkMsSUFBbkIsRUFBUDtFQUNWLE9BQ0UsQ0FBQyxPQUFELEVBQVUsTUFBVixFQUFrQixPQUFsQixFQUEyQixPQUEzQixFQUFvQ2xJLFFBQXBDLENBQTZDZ0wsUUFBN0MsS0FDQSxDQUFDLElBQUQsRUFBTyxNQUFQLEVBQWVoTCxRQUFmLENBQXdCMkssSUFBeEIsQ0FGRjtBQUlEO0FBRUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBLFNBQVM5QyxNQUFULENBQWdCL00sSUFBaEIsRUFBc0I7RUFDcEI7RUFDQTtFQUNBLE9BQU8sc0JBQXNCOEosSUFBdEIsQ0FBMkI5SixJQUEzQixDQUFQO0FBQ0Q7QUFFRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUEsU0FBU21HLFVBQVQsQ0FBb0JTLElBQXBCLEVBQTBCO0VBQ3hCLE9BQU8sQ0FBQyxHQUFELEVBQU0sR0FBTixFQUFXLEdBQVgsRUFBZ0IsR0FBaEIsRUFBcUIsR0FBckIsRUFBMEIsR0FBMUIsRUFBK0IxQixRQUEvQixDQUF3QzBCLElBQXhDLENBQVA7QUFDRCJ9
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/parsers/image.js b/together/node_modules/superagent/lib/node/parsers/image.js new file mode 100644 index 0000000..504f1f3 --- /dev/null +++ b/together/node_modules/superagent/lib/node/parsers/image.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = (res, fn) => { + const data = []; // Binary data needs binary storage + + res.on('data', chunk => { + data.push(chunk); + }); + res.on('end', () => { + fn(null, Buffer.concat(data)); + }); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJkYXRhIiwib24iLCJjaHVuayIsInB1c2giLCJCdWZmZXIiLCJjb25jYXQiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL2ltYWdlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgY29uc3QgZGF0YSA9IFtdOyAvLyBCaW5hcnkgZGF0YSBuZWVkcyBiaW5hcnkgc3RvcmFnZVxuXG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIGRhdGEucHVzaChjaHVuayk7XG4gIH0pO1xuICByZXMub24oJ2VuZCcsICgpID0+IHtcbiAgICBmbihudWxsLCBCdWZmZXIuY29uY2F0KGRhdGEpKTtcbiAgfSk7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQVAsR0FBaUIsQ0FBQ0MsR0FBRCxFQUFNQyxFQUFOLEtBQWE7RUFDNUIsTUFBTUMsSUFBSSxHQUFHLEVBQWIsQ0FENEIsQ0FDWDs7RUFFakJGLEdBQUcsQ0FBQ0csRUFBSixDQUFPLE1BQVAsRUFBZ0JDLEtBQUQsSUFBVztJQUN4QkYsSUFBSSxDQUFDRyxJQUFMLENBQVVELEtBQVY7RUFDRCxDQUZEO0VBR0FKLEdBQUcsQ0FBQ0csRUFBSixDQUFPLEtBQVAsRUFBYyxNQUFNO0lBQ2xCRixFQUFFLENBQUMsSUFBRCxFQUFPSyxNQUFNLENBQUNDLE1BQVAsQ0FBY0wsSUFBZCxDQUFQLENBQUY7RUFDRCxDQUZEO0FBR0QsQ0FURCJ9
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/parsers/index.js b/together/node_modules/superagent/lib/node/parsers/index.js new file mode 100644 index 0000000..a0afdf1 --- /dev/null +++ b/together/node_modules/superagent/lib/node/parsers/index.js @@ -0,0 +1,13 @@ +"use strict"; + +exports['application/x-www-form-urlencoded'] = require('./urlencoded'); +exports['application/json'] = require('./json'); +exports.text = require('./text'); +exports['application/json-seq'] = exports.text; + +const binary = require('./image'); + +exports['application/octet-stream'] = binary; +exports['application/pdf'] = binary; +exports.image = binary; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwicmVxdWlyZSIsInRleHQiLCJiaW5hcnkiLCJpbWFnZSJdLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ub2RlL3BhcnNlcnMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0c1snYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJ10gPSByZXF1aXJlKCcuL3VybGVuY29kZWQnKTtcbmV4cG9ydHNbJ2FwcGxpY2F0aW9uL2pzb24nXSA9IHJlcXVpcmUoJy4vanNvbicpO1xuZXhwb3J0cy50ZXh0ID0gcmVxdWlyZSgnLi90ZXh0Jyk7XG5cbmV4cG9ydHNbJ2FwcGxpY2F0aW9uL2pzb24tc2VxJ10gPSBleHBvcnRzLnRleHQ7XG5cbmNvbnN0IGJpbmFyeSA9IHJlcXVpcmUoJy4vaW1hZ2UnKTtcblxuZXhwb3J0c1snYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtJ10gPSBiaW5hcnk7XG5leHBvcnRzWydhcHBsaWNhdGlvbi9wZGYnXSA9IGJpbmFyeTtcbmV4cG9ydHMuaW1hZ2UgPSBiaW5hcnk7XG4iXSwibWFwcGluZ3MiOiI7O0FBQUFBLE9BQU8sQ0FBQyxtQ0FBRCxDQUFQLEdBQStDQyxPQUFPLENBQUMsY0FBRCxDQUF0RDtBQUNBRCxPQUFPLENBQUMsa0JBQUQsQ0FBUCxHQUE4QkMsT0FBTyxDQUFDLFFBQUQsQ0FBckM7QUFDQUQsT0FBTyxDQUFDRSxJQUFSLEdBQWVELE9BQU8sQ0FBQyxRQUFELENBQXRCO0FBRUFELE9BQU8sQ0FBQyxzQkFBRCxDQUFQLEdBQWtDQSxPQUFPLENBQUNFLElBQTFDOztBQUVBLE1BQU1DLE1BQU0sR0FBR0YsT0FBTyxDQUFDLFNBQUQsQ0FBdEI7O0FBRUFELE9BQU8sQ0FBQywwQkFBRCxDQUFQLEdBQXNDRyxNQUF0QztBQUNBSCxPQUFPLENBQUMsaUJBQUQsQ0FBUCxHQUE2QkcsTUFBN0I7QUFDQUgsT0FBTyxDQUFDSSxLQUFSLEdBQWdCRCxNQUFoQiJ9
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/parsers/json.js b/together/node_modules/superagent/lib/node/parsers/json.js new file mode 100644 index 0000000..ccf6d35 --- /dev/null +++ b/together/node_modules/superagent/lib/node/parsers/json.js @@ -0,0 +1,26 @@ +"use strict"; + +module.exports = function (res, fn) { + res.text = ''; + res.setEncoding('utf8'); + res.on('data', chunk => { + res.text += chunk; + }); + res.on('end', () => { + let body; + let error; + + try { + body = res.text && JSON.parse(res.text); + } catch (err) { + error = err; // issue #675: return the raw response if the response parsing fails + + error.rawResponse = res.text || null; // issue #876: return the http status code if the response parsing fails + + error.statusCode = res.statusCode; + } finally { + fn(error, body); + } + }); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwiYm9keSIsImVycm9yIiwiSlNPTiIsInBhcnNlIiwiZXJyIiwicmF3UmVzcG9uc2UiLCJzdGF0dXNDb2RlIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy9qc29uLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm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SUFBSixJQUFZRyxLQUFaO0VBQ0QsQ0FGRDtFQUdBTCxHQUFHLENBQUNJLEVBQUosQ0FBTyxLQUFQLEVBQWMsTUFBTTtJQUNsQixJQUFJRSxJQUFKO0lBQ0EsSUFBSUMsS0FBSjs7SUFDQSxJQUFJO01BQ0ZELElBQUksR0FBR04sR0FBRyxDQUFDRSxJQUFKLElBQVlNLElBQUksQ0FBQ0MsS0FBTCxDQUFXVCxHQUFHLENBQUNFLElBQWYsQ0FBbkI7SUFDRCxDQUZELENBRUUsT0FBT1EsR0FBUCxFQUFZO01BQ1pILEtBQUssR0FBR0csR0FBUixDQURZLENBRVo7O01BQ0FILEtBQUssQ0FBQ0ksV0FBTixHQUFvQlgsR0FBRyxDQUFDRSxJQUFKLElBQVksSUFBaEMsQ0FIWSxDQUlaOztNQUNBSyxLQUFLLENBQUNLLFVBQU4sR0FBbUJaLEdBQUcsQ0FBQ1ksVUFBdkI7SUFDRCxDQVJELFNBUVU7TUFDUlgsRUFBRSxDQUFDTSxLQUFELEVBQVFELElBQVIsQ0FBRjtJQUNEO0VBQ0YsQ0FkRDtBQWVELENBckJEIn0=
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/parsers/text.js b/together/node_modules/superagent/lib/node/parsers/text.js new file mode 100644 index 0000000..c8c3e16 --- /dev/null +++ b/together/node_modules/superagent/lib/node/parsers/text.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = (res, fn) => { + res.text = ''; + res.setEncoding('utf8'); + res.on('data', chunk => { + res.text += chunk; + }); + res.on('end', fn); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy90ZXh0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO1xuICB9KTtcbiAgcmVzLm9uKCdlbmQnLCBmbik7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQVAsR0FBaUIsQ0FBQ0MsR0FBRCxFQUFNQyxFQUFOLEtBQWE7RUFDNUJELEdBQUcsQ0FBQ0UsSUFBSixHQUFXLEVBQVg7RUFDQUYsR0FBRyxDQUFDRyxXQUFKLENBQWdCLE1BQWhCO0VBQ0FILEdBQUcsQ0FBQ0ksRUFBSixDQUFPLE1BQVAsRUFBZ0JDLEtBQUQsSUFBVztJQUN4QkwsR0FBRyxDQUFDRSxJQUFKLElBQVlHLEtBQVo7RUFDRCxDQUZEO0VBR0FMLEdBQUcsQ0FBQ0ksRUFBSixDQUFPLEtBQVAsRUFBY0gsRUFBZDtBQUNELENBUEQifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/parsers/urlencoded.js b/together/node_modules/superagent/lib/node/parsers/urlencoded.js new file mode 100644 index 0000000..88a2475 --- /dev/null +++ b/together/node_modules/superagent/lib/node/parsers/urlencoded.js @@ -0,0 +1,22 @@ +"use strict"; + +/** + * Module dependencies. + */ +const qs = require('qs'); + +module.exports = (res, fn) => { + res.text = ''; + res.setEncoding('ascii'); + res.on('data', chunk => { + res.text += chunk; + }); + res.on('end', () => { + try { + fn(null, qs.parse(res.text)); + } catch (err) { + fn(err); + } + }); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJxcyIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2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BRCxFQUFPTCxFQUFFLENBQUNVLEtBQUgsQ0FBU04sR0FBRyxDQUFDRSxJQUFiLENBQVAsQ0FBRjtJQUNELENBRkQsQ0FFRSxPQUFPSyxHQUFQLEVBQVk7TUFDWk4sRUFBRSxDQUFDTSxHQUFELENBQUY7SUFDRDtFQUNGLENBTkQ7QUFPRCxDQWJEIn0=
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/response.js b/together/node_modules/superagent/lib/node/response.js new file mode 100644 index 0000000..0208dfb --- /dev/null +++ b/together/node_modules/superagent/lib/node/response.js @@ -0,0 +1,139 @@ +"use strict"; + +/** + * Module dependencies. + */ +const util = require('util'); + +const Stream = require('stream'); + +const ResponseBase = require('../response-base'); + +const _require = require('../utils'), + mixin = _require.mixin; +/** + * Expose `Response`. + */ + + +module.exports = Response; +/** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * @param {Request} req + * @param {Object} options + * @constructor + * @extends {Stream} + * @implements {ReadableStream} + * @api private + */ + +function Response(request) { + Stream.call(this); + this.res = request.res; + const res = this.res; + this.request = request; + this.req = request.req; + this.text = res.text; + this.files = res.files || {}; + this.buffered = request._resBuffered; + this.headers = res.headers; + this.header = this.headers; + + this._setStatusProperties(res.statusCode); + + this._setHeaderProperties(this.header); + + this.setEncoding = res.setEncoding.bind(res); + res.on('data', this.emit.bind(this, 'data')); + res.on('end', this.emit.bind(this, 'end')); + res.on('close', this.emit.bind(this, 'close')); + res.on('error', this.emit.bind(this, 'error')); +} // Lazy access res.body. +// https://github.com/nodejs/node/pull/39520#issuecomment-889697136 + + +Object.defineProperty(Response.prototype, 'body', { + get() { + return this._body !== undefined ? this._body : this.res.body !== undefined ? this.res.body : {}; + }, + + set(value) { + this._body = value; + } + +}); +/** + * Inherit from `Stream`. + */ + +util.inherits(Response, Stream); +mixin(Response.prototype, ResponseBase.prototype); +/** + * Implements methods of a `ReadableStream` + */ + +Response.prototype.destroy = function (error) { + this.res.destroy(error); +}; +/** + * Pause. + */ + + +Response.prototype.pause = function () { + this.res.pause(); +}; +/** + * Resume. + */ + + +Response.prototype.resume = function () { + this.res.resume(); +}; +/** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ + + +Response.prototype.toError = function () { + const req = this.req; + const method = req.method; + const path = req.path; + const message = "cannot ".concat(method, " ").concat(path, " (").concat(this.status, ")"); + const error = new Error(message); + error.status = this.status; + error.text = this.text; + error.method = method; + error.path = path; + return error; +}; + +Response.prototype.setStatusProperties = function (status) { + console.warn('In superagent 2.x setStatusProperties is a private method'); + return this._setStatusProperties(status); +}; +/** + * To json. + * + * @return {Object} + * @api public + */ + + +Response.prototype.toJSON = function () { + return { + req: this.request.toJSON(), + header: this.header, + status: this.status, + text: this.text + }; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJ1dGlsIiwicmVxdWlyZSIsIlN0cmVhbSIsIlJlc3BvbnNlQmFzZSIsIm1peGluIiwibW9kdWxlIiwiZXhwb3J0cyIsIlJlc3BvbnNlIiwicmVxdWVzdCIsImNhbGwiLCJyZXMiLCJyZXEiLCJ0ZXh0IiwiZmlsZXMiLCJidWZmZXJlZCIsIl9yZXNCdWZmZXJlZCIsImhlYWRlcnMiLCJoZWFkZXIiLCJfc2V0U3RhdHVzUHJvcGVydGllcyIsInN0YXR1c0NvZGUiLCJfc2V0SGVhZGVyUHJvcGVydGllcyIsInNldEVuY29kaW5nIiwiYmluZCIsIm9uIiwiZW1pdCIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwicHJvdG90eXBlIiwiZ2V0IiwiX2JvZHkiLCJ1bmRlZmluZWQiLCJib2R5Iiwic2V0IiwidmFsdWUiLCJpbmhlcml0cyIsImRlc3Ryb3kiLCJlcnJvciIsInBhdXNlIiwicmVzdW1lIiwidG9FcnJvciIsIm1ldGhvZCIsInBhdGgiLCJtZXNzYWdlIiwic3RhdHVzIiwiRXJyb3IiLCJzZXR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CLEdBQXlDLFVBQVVGLE1BQVYsRUFBa0I7RUFDekRHLE9BQU8sQ0FBQ0MsSUFBUixDQUFhLDJEQUFiO0VBQ0EsT0FBTyxLQUFLN0Isb0JBQUwsQ0FBMEJ5QixNQUExQixDQUFQO0FBQ0QsQ0FIRDtBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUFwQyxRQUFRLENBQUNvQixTQUFULENBQW1CcUIsTUFBbkIsR0FBNEIsWUFBWTtFQUN0QyxPQUFPO0lBQ0xyQyxHQUFHLEVBQUUsS0FBS0gsT0FBTCxDQUFhd0MsTUFBYixFQURBO0lBRUwvQixNQUFNLEVBQUUsS0FBS0EsTUFGUjtJQUdMMEIsTUFBTSxFQUFFLEtBQUtBLE1BSFI7SUFJTC9CLElBQUksRUFBRSxLQUFLQTtFQUpOLENBQVA7QUFNRCxDQVBEIn0=
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/node/unzip.js b/together/node_modules/superagent/lib/node/unzip.js new file mode 100644 index 0000000..a15ffe1 --- /dev/null +++ b/together/node_modules/superagent/lib/node/unzip.js @@ -0,0 +1,72 @@ +"use strict"; + +/** + * Module dependencies. + */ +const _require = require('string_decoder'), + StringDecoder = _require.StringDecoder; + +const Stream = require('stream'); + +const zlib = require('zlib'); +/** + * Buffers response data events and re-emits when they're unzipped. + * + * @param {Request} req + * @param {Response} res + * @api private + */ + + +exports.unzip = (request, res) => { + const unzip = zlib.createUnzip(); + const stream = new Stream(); + let decoder; // make node responseOnEnd() happy + + stream.req = request; + unzip.on('error', error => { + if (error && error.code === 'Z_BUF_ERROR') { + // unexpected end of file is ignored by browsers and curl + stream.emit('end'); + return; + } + + stream.emit('error', error); + }); // pipe to unzip + + res.pipe(unzip); // override `setEncoding` to capture encoding + + res.setEncoding = type => { + decoder = new StringDecoder(type); + }; // decode upon decompressing with captured encoding + + + unzip.on('data', buf => { + if (decoder) { + const string_ = decoder.write(buf); + if (string_.length > 0) stream.emit('data', string_); + } else { + stream.emit('data', buf); + } + }); + unzip.on('end', () => { + stream.emit('end'); + }); // override `on` to capture data listeners + + const _on = res.on; + + res.on = function (type, fn) { + if (type === 'data' || type === 'end') { + stream.on(type, fn.bind(res)); + } else if (type === 'error') { + stream.on(type, fn.bind(res)); + + _on.call(res, type, fn); + } else { + _on.call(res, type, fn); + } + + return this; + }; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyZXF1aXJlIiwiU3RyaW5nRGVjb2RlciIsIlN0cmVhbSIsInpsaWIiLCJleHBvcnRzIiwidW56aXAiLCJyZXF1ZXN0IiwicmVzIiwiY3JlYXRlVW56aXAiLCJzdHJlYW0iLCJkZWNvZGVyIiwicmVxIiwib24iLCJlcnJvciIsImNvZGUiLCJlbWl0IiwicGlwZSIsInNldEVuY29kaW5nIiwidHlwZSIsImJ1ZiIsInN0cmluZ18iLCJ3cml0ZSIsImxlbmd0aCIsIl9vbiIsImZuIiwiYmluZCIsImNhbGwiXSwic291cmNlcyI6WyIuLi8uLi9zcmMvbm9kZS91bnppcC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1vZHVsZSBkZXBlbmRlbmNpZXMuXG4gKi9cblxuY29uc3QgeyBTdHJpbmdEZWNvZGVyIH0gPSByZXF1aXJlKCdzdHJpbmdfZGVjb2RlcicpO1xuY29uc3QgU3RyZWFtID0gcmVxdWlyZSgnc3RyZWFtJyk7XG5jb25zdCB6bGliID0gcmVxdWlyZSgnemxpYicpO1xuXG4vKipcbiAqIEJ1ZmZlcnMgcmVzcG9uc2UgZGF0YSBldmVudHMgYW5kIHJlLWVtaXRzIHdoZW4gdGhleSdyZSB1bnppcHBlZC5cbiAqXG4gKiBAcGFyYW0ge1JlcXVlc3R9IHJlcVxuICogQHBhcmFtIHtSZXNwb25zZX0gcmVzXG4gKiBAYXBpIHByaXZhdGVcbiAqL1xuXG5leHBvcnRzLnVuemlwID0gKHJlc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Q0FBQ08sRUFBTixDQUFTLEtBQVQsRUFBZ0IsTUFBTTtJQUNwQkgsTUFBTSxDQUFDTSxJQUFQLENBQVksS0FBWjtFQUNELENBRkQsRUFwQ2dDLENBd0NoQzs7RUFDQSxNQUFNUSxHQUFHLEdBQUdoQixHQUFHLENBQUNLLEVBQWhCOztFQUNBTCxHQUFHLENBQUNLLEVBQUosR0FBUyxVQUFVTSxJQUFWLEVBQWdCTSxFQUFoQixFQUFvQjtJQUMzQixJQUFJTixJQUFJLEtBQUssTUFBVCxJQUFtQkEsSUFBSSxLQUFLLEtBQWhDLEVBQXVDO01BQ3JDVCxNQUFNLENBQUNHLEVBQVAsQ0FBVU0sSUFBVixFQUFnQk0sRUFBRSxDQUFDQyxJQUFILENBQVFsQixHQUFSLENBQWhCO0lBQ0QsQ0FGRCxNQUVPLElBQUlXLElBQUksS0FBSyxPQUFiLEVBQXNCO01BQzNCVCxNQUFNLENBQUNHLEVBQVAsQ0FBVU0sSUFBVixFQUFnQk0sRUFBRSxDQUFDQyxJQUFILENBQVFsQixHQUFSLENBQWhCOztNQUNBZ0IsR0FBRyxDQUFDRyxJQUFKLENBQVNuQixHQUFULEVBQWNXLElBQWQsRUFBb0JNLEVBQXBCO0lBQ0QsQ0FITSxNQUdBO01BQ0xELEdBQUcsQ0FBQ0csSUFBSixDQUFTbkIsR0FBVCxFQUFjVyxJQUFkLEVBQW9CTSxFQUFwQjtJQUNEOztJQUVELE9BQU8sSUFBUDtFQUNELENBWEQ7QUFZRCxDQXRERCJ9
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/request-base.js b/together/node_modules/superagent/lib/request-base.js new file mode 100644 index 0000000..d2038ff --- /dev/null +++ b/together/node_modules/superagent/lib/request-base.js @@ -0,0 +1,789 @@ +"use strict"; + +const semver = require('semver'); +/** + * Module of mixed-in functions shared between node and client code + */ + + +const _require = require('./utils'), + isObject = _require.isObject, + hasOwn = _require.hasOwn; +/** + * Expose `RequestBase`. + */ + + +module.exports = RequestBase; +/** + * Initialize a new `RequestBase`. + * + * @api public + */ + +function RequestBase() {} +/** + * Clear previous timeout. + * + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.clearTimeout = function () { + clearTimeout(this._timer); + clearTimeout(this._responseTimeoutTimer); + clearTimeout(this._uploadTimeoutTimer); + delete this._timer; + delete this._responseTimeoutTimer; + delete this._uploadTimeoutTimer; + return this; +}; +/** + * Override default response body parser + * + * This function will be called to convert incoming data into request.body + * + * @param {Function} + * @api public + */ + + +RequestBase.prototype.parse = function (fn) { + this._parser = fn; + return this; +}; +/** + * Set format of binary response body. + * In browser valid formats are 'blob' and 'arraybuffer', + * which return Blob and ArrayBuffer, respectively. + * + * In Node all values result in Buffer. + * + * Examples: + * + * req.get('/') + * .responseType('blob') + * .end(callback); + * + * @param {String} val + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.responseType = function (value) { + this._responseType = value; + return this; +}; +/** + * Override default request body serializer + * + * This function will be called to convert data set via .send or .attach into payload to send + * + * @param {Function} + * @api public + */ + + +RequestBase.prototype.serialize = function (fn) { + this._serializer = fn; + return this; +}; +/** + * Set timeouts. + * + * - response timeout is time between sending request and receiving the first byte of the response. Includes DNS and connection time. + * - deadline is the time from start of the request to receiving response body in full. If the deadline is too short large files may not load at all on slow connections. + * - upload is the time since last bit of data was sent or received. This timeout works only if deadline timeout is off + * + * Value of 0 or false means no timeout. + * + * @param {Number|Object} ms or {response, deadline} + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.timeout = function (options) { + if (!options || typeof options !== 'object') { + this._timeout = options; + this._responseTimeout = 0; + this._uploadTimeout = 0; + return this; + } + + for (const option in options) { + if (hasOwn(options, option)) { + switch (option) { + case 'deadline': + this._timeout = options.deadline; + break; + + case 'response': + this._responseTimeout = options.response; + break; + + case 'upload': + this._uploadTimeout = options.upload; + break; + + default: + console.warn('Unknown timeout option', option); + } + } + } + + return this; +}; +/** + * Set number of retry attempts on error. + * + * Failed requests will be retried 'count' times if timeout or err.code >= 500. + * + * @param {Number} count + * @param {Function} [fn] + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.retry = function (count, fn) { + // Default to 1 if no count passed or true + if (arguments.length === 0 || count === true) count = 1; + if (count <= 0) count = 0; + this._maxRetries = count; + this._retries = 0; + this._retryCallback = fn; + return this; +}; // +// NOTE: we do not include ESOCKETTIMEDOUT because that is from `request` package +// <https://github.com/sindresorhus/got/pull/537> +// +// NOTE: we do not include EADDRINFO because it was removed from libuv in 2014 +// <https://github.com/libuv/libuv/commit/02e1ebd40b807be5af46343ea873331b2ee4e9c1> +// <https://github.com/request/request/search?q=ESOCKETTIMEDOUT&unscoped_q=ESOCKETTIMEDOUT> +// +// +// TODO: expose these as configurable defaults +// + + +const ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN']); +const STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524]); // TODO: we would need to make this easily configurable before adding it in (e.g. some might want to add POST) +// const METHODS = new Set(['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE']); + +/** + * Determine if a request should be retried. + * (Inspired by https://github.com/sindresorhus/got#retry) + * + * @param {Error} err an error + * @param {Response} [res] response + * @returns {Boolean} if segment should be retried + */ + +RequestBase.prototype._shouldRetry = function (error, res) { + if (!this._maxRetries || this._retries++ >= this._maxRetries) { + return false; + } + + if (this._retryCallback) { + try { + const override = this._retryCallback(error, res); + + if (override === true) return true; + if (override === false) return false; // undefined falls back to defaults + } catch (err) { + console.error(err); + } + } // TODO: we would need to make this easily configurable before adding it in (e.g. some might want to add POST) + + /* + if ( + this.req && + this.req.method && + !METHODS.has(this.req.method.toUpperCase()) + ) + return false; + */ + + + if (res && res.status && STATUS_CODES.has(res.status)) return true; + + if (error) { + if (error.code && ERROR_CODES.has(error.code)) return true; // Superagent timeout + + if (error.timeout && error.code === 'ECONNABORTED') return true; + if (error.crossDomain) return true; + } + + return false; +}; +/** + * Retry request + * + * @return {Request} for chaining + * @api private + */ + + +RequestBase.prototype._retry = function () { + this.clearTimeout(); // node + + if (this.req) { + this.req = null; + this.req = this.request(); + } + + this._aborted = false; + this.timedout = false; + this.timedoutError = null; + return this._end(); +}; +/** + * Promise support + * + * @param {Function} resolve + * @param {Function} [reject] + * @return {Request} + */ + + +RequestBase.prototype.then = function (resolve, reject) { + if (!this._fullfilledPromise) { + const self = this; + + if (this._endCalled) { + console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises'); + } + + this._fullfilledPromise = new Promise((resolve, reject) => { + self.on('abort', () => { + if (this._maxRetries && this._maxRetries > this._retries) { + return; + } + + if (this.timedout && this.timedoutError) { + reject(this.timedoutError); + return; + } + + const error = new Error('Aborted'); + error.code = 'ABORTED'; + error.status = this.status; + error.method = this.method; + error.url = this.url; + reject(error); + }); + self.end((error, res) => { + if (error) reject(error);else resolve(res); + }); + }); + } + + return this._fullfilledPromise.then(resolve, reject); +}; + +RequestBase.prototype.catch = function (callback) { + return this.then(undefined, callback); +}; +/** + * Allow for extension + */ + + +RequestBase.prototype.use = function (fn) { + fn(this); + return this; +}; + +RequestBase.prototype.ok = function (callback) { + if (typeof callback !== 'function') throw new Error('Callback required'); + this._okCallback = callback; + return this; +}; + +RequestBase.prototype._isResponseOK = function (res) { + if (!res) { + return false; + } + + if (this._okCallback) { + return this._okCallback(res); + } + + return res.status >= 200 && res.status < 300; +}; +/** + * Get request header `field`. + * Case-insensitive. + * + * @param {String} field + * @return {String} + * @api public + */ + + +RequestBase.prototype.get = function (field) { + return this._header[field.toLowerCase()]; +}; +/** + * Get case-insensitive header `field` value. + * This is a deprecated internal API. Use `.get(field)` instead. + * + * (getHeader is no longer used internally by the superagent code base) + * + * @param {String} field + * @return {String} + * @api private + * @deprecated + */ + + +RequestBase.prototype.getHeader = RequestBase.prototype.get; +/** + * Set header `field` to `val`, or multiple fields with one object. + * Case-insensitive. + * + * Examples: + * + * req.get('/') + * .set('Accept', 'application/json') + * .set('X-API-Key', 'foobar') + * .end(callback); + * + * req.get('/') + * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) + * .end(callback); + * + * @param {String|Object} field + * @param {String} val + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.set = function (field, value) { + if (isObject(field)) { + for (const key in field) { + if (hasOwn(field, key)) this.set(key, field[key]); + } + + return this; + } + + this._header[field.toLowerCase()] = value; + this.header[field] = value; + return this; +}; +/** + * Remove header `field`. + * Case-insensitive. + * + * Example: + * + * req.get('/') + * .unset('User-Agent') + * .end(callback); + * + * @param {String} field field name + */ + + +RequestBase.prototype.unset = function (field) { + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; +}; +/** + * Write the field `name` and `val`, or multiple fields with one object + * for "multipart/form-data" request bodies. + * + * ``` js + * request.post('/upload') + * .field('foo', 'bar') + * .end(callback); + * + * request.post('/upload') + * .field({ foo: 'bar', baz: 'qux' }) + * .end(callback); + * ``` + * + * @param {String|Object} name name of field + * @param {String|Blob|File|Buffer|fs.ReadStream} val value of field + * @param {String} options extra options, e.g. 'blob' + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.field = function (name, value, options) { + // name should be either a string or an object. + if (name === null || undefined === name) { + throw new Error('.field(name, val) name can not be empty'); + } + + if (this._data) { + throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"); + } + + if (isObject(name)) { + for (const key in name) { + if (hasOwn(name, key)) this.field(key, name[key]); + } + + return this; + } + + if (Array.isArray(value)) { + for (const i in value) { + if (hasOwn(value, i)) this.field(name, value[i]); + } + + return this; + } // val should be defined now + + + if (value === null || undefined === value) { + throw new Error('.field(name, val) val can not be empty'); + } + + if (typeof value === 'boolean') { + value = String(value); + } // fix https://github.com/visionmedia/superagent/issues/1680 + + + if (options) this._getFormData().append(name, value, options);else this._getFormData().append(name, value); + return this; +}; +/** + * Abort the request, and clear potential timeout. + * + * @return {Request} request + * @api public + */ + + +RequestBase.prototype.abort = function () { + if (this._aborted) { + return this; + } + + this._aborted = true; + if (this.xhr) this.xhr.abort(); // browser + + if (this.req) { + // Node v13 has major differences in `abort()` + // https://github.com/nodejs/node/blob/v12.x/lib/internal/streams/end-of-stream.js + // https://github.com/nodejs/node/blob/v13.x/lib/internal/streams/end-of-stream.js + // https://github.com/nodejs/node/blob/v14.x/lib/internal/streams/end-of-stream.js + // (if you run a diff across these you will see the differences) + // + // References: + // <https://github.com/nodejs/node/issues/31630> + // <https://github.com/visionmedia/superagent/pull/1084/commits/dc18679a7c5ccfc6046d882015e5126888973bc8> + // + // Thanks to @shadowgate15 and @niftylettuce + if (semver.gte(process.version, 'v13.0.0') && semver.lt(process.version, 'v14.0.0')) { + // Note that the reason this doesn't work is because in v13 as compared to v14 + // there is no `callback = nop` set in end-of-stream.js above + throw new Error('Superagent does not work in v13 properly with abort() due to Node.js core changes'); + } else if (semver.gte(process.version, 'v14.0.0')) { + // We have to manually set `destroyed` to `true` in order for this to work + // (see core internals of end-of-stream.js above in v14 branch as compared to v12) + this.req.destroyed = true; + } + + this.req.abort(); // node + } + + this.clearTimeout(); + this.emit('abort'); + return this; +}; + +RequestBase.prototype._auth = function (user, pass, options, base64Encoder) { + switch (options.type) { + case 'basic': + this.set('Authorization', "Basic ".concat(base64Encoder("".concat(user, ":").concat(pass)))); + break; + + case 'auto': + this.username = user; + this.password = pass; + break; + + case 'bearer': + // usage would be .auth(accessToken, { type: 'bearer' }) + this.set('Authorization', "Bearer ".concat(user)); + break; + + default: + break; + } + + return this; +}; +/** + * Enable transmission of cookies with x-domain requests. + * + * Note that for this to work the origin must not be + * using "Access-Control-Allow-Origin" with a wildcard, + * and also must set "Access-Control-Allow-Credentials" + * to "true". + * + * @api public + */ + + +RequestBase.prototype.withCredentials = function (on) { + // This is browser-only functionality. Node side is no-op. + if (on === undefined) on = true; + this._withCredentials = on; + return this; +}; +/** + * Set the max redirects to `n`. Does nothing in browser XHR implementation. + * + * @param {Number} n + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.redirects = function (n) { + this._maxRedirects = n; + return this; +}; +/** + * Maximum size of buffered response body, in bytes. Counts uncompressed size. + * Default 200MB. + * + * @param {Number} n number of bytes + * @return {Request} for chaining + */ + + +RequestBase.prototype.maxResponseSize = function (n) { + if (typeof n !== 'number') { + throw new TypeError('Invalid argument'); + } + + this._maxResponseSize = n; + return this; +}; +/** + * Convert to a plain javascript object (not JSON string) of scalar properties. + * Note as this method is designed to return a useful non-this value, + * it cannot be chained. + * + * @return {Object} describing method, url, and data of this request + * @api public + */ + + +RequestBase.prototype.toJSON = function () { + return { + method: this.method, + url: this.url, + data: this._data, + headers: this._header + }; +}; +/** + * Send `data` as the request body, defaulting the `.type()` to "json" when + * an object is given. + * + * Examples: + * + * // manual json + * request.post('/user') + * .type('json') + * .send('{"name":"tj"}') + * .end(callback) + * + * // auto json + * request.post('/user') + * .send({ name: 'tj' }) + * .end(callback) + * + * // manual x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send('name=tj') + * .end(callback) + * + * // auto x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send({ name: 'tj' }) + * .end(callback) + * + * // defaults to x-www-form-urlencoded + * request.post('/user') + * .send('name=tobi') + * .send('species=ferret') + * .end(callback) + * + * @param {String|Object} data + * @return {Request} for chaining + * @api public + */ +// eslint-disable-next-line complexity + + +RequestBase.prototype.send = function (data) { + const isObject_ = isObject(data); + let type = this._header['content-type']; + + if (this._formData) { + throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"); + } + + if (isObject_ && !this._data) { + if (Array.isArray(data)) { + this._data = []; + } else if (!this._isHost(data)) { + this._data = {}; + } + } else if (data && this._data && this._isHost(this._data)) { + throw new Error("Can't merge these send calls"); + } // merge + + + if (isObject_ && isObject(this._data)) { + for (const key in data) { + if (hasOwn(data, key)) this._data[key] = data[key]; + } + } else if (typeof data === 'string') { + // default to x-www-form-urlencoded + if (!type) this.type('form'); + type = this._header['content-type']; + if (type) type = type.toLowerCase().trim(); + + if (type === 'application/x-www-form-urlencoded') { + this._data = this._data ? "".concat(this._data, "&").concat(data) : data; + } else { + this._data = (this._data || '') + data; + } + } else { + this._data = data; + } + + if (!isObject_ || this._isHost(data)) { + return this; + } // default to json + + + if (!type) this.type('json'); + return this; +}; +/** + * Sort `querystring` by the sort function + * + * + * Examples: + * + * // default order + * request.get('/user') + * .query('name=Nick') + * .query('search=Manny') + * .sortQuery() + * .end(callback) + * + * // customized sort function + * request.get('/user') + * .query('name=Nick') + * .query('search=Manny') + * .sortQuery(function(a, b){ + * return a.length - b.length; + * }) + * .end(callback) + * + * + * @param {Function} sort + * @return {Request} for chaining + * @api public + */ + + +RequestBase.prototype.sortQuery = function (sort) { + // _sort default to true but otherwise can be a function or boolean + this._sort = typeof sort === 'undefined' ? true : sort; + return this; +}; +/** + * Compose querystring to append to req.url + * + * @api private + */ + + +RequestBase.prototype._finalizeQueryString = function () { + const query = this._query.join('&'); + + if (query) { + this.url += (this.url.includes('?') ? '&' : '?') + query; + } + + this._query.length = 0; // Makes the call idempotent + + if (this._sort) { + const index = this.url.indexOf('?'); + + if (index >= 0) { + const queryArray = this.url.slice(index + 1).split('&'); + + if (typeof this._sort === 'function') { + queryArray.sort(this._sort); + } else { + queryArray.sort(); + } + + this.url = this.url.slice(0, index) + '?' + queryArray.join('&'); + } + } +}; // For backwards compat only + + +RequestBase.prototype._appendQueryString = () => { + console.warn('Unsupported'); +}; +/** + * Invoke callback with timeout error. + * + * @api private + */ + + +RequestBase.prototype._timeoutError = function (reason, timeout, errno) { + if (this._aborted) { + return; + } + + const error = new Error("".concat(reason + timeout, "ms exceeded")); + error.timeout = timeout; + error.code = 'ECONNABORTED'; + error.errno = errno; + this.timedout = true; + this.timedoutError = error; + this.abort(); + this.callback(error); +}; + +RequestBase.prototype._setTimeouts = function () { + const self = this; // deadline + + if (this._timeout && !this._timer) { + this._timer = setTimeout(() => { + self._timeoutError('Timeout of ', self._timeout, 'ETIME'); + }, this._timeout); + } // response timeout + + + if (this._responseTimeout && !this._responseTimeoutTimer) { + this._responseTimeoutTimer = setTimeout(() => { + self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT'); + }, this._responseTimeout); + } +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJzZW12ZXIiLCJyZXF1aXJlIiwiaXNPYmplY3QiLCJoYXNPd24iLCJtb2R1bGUiLCJleHBvcnRzIiwiUmVxdWVzdEJhc2UiLCJwcm90b3R5cGUiLCJjbGVhclRpbWVvdXQiLCJfdGltZXIiLCJfcmVzcG9uc2VUaW1lb3V0VGltZXIiLCJfdXBsb2FkVGltZW91dFRpbWVyIiwicGFyc2UiLCJmbiIsIl9wYXJzZXIiLCJyZXNwb25zZVR5cGUiLCJ2YWx1ZSIsIl9yZXNwb25zZVR5cGUiLCJzZXJpYWxpemUiLCJfc2VyaWFsaXplciIsInRpbWVvdXQiLCJvcHRpb25zIiwiX3RpbWVvdXQiLCJfcmVzcG9uc2VUaW1lb3V0IiwiX3VwbG9hZFRpbWVvdXQiLCJvcHRpb24iLCJkZWFkbGluZSIsInJlc3BvbnNlIiwidXBsb2FkIiwiY29uc29sZSIsIndhcm4iLCJyZXRyeSIsImNvdW50IiwiYXJndW1lbnRzIiwibGVuZ3RoIiwiX21heFJldHJpZXMiLCJfcmV0cmllcyIsIl9yZXRyeUNhbGxiYWNrIiwiRVJST1JfQ09ERVMiLCJTZXQiLCJTVEFUVVNfQ09ERVMiLCJfc2hvdWxkUmV0cnkiLCJlcnJvciIsInJlcyIsIm92ZXJyaWRlIiwiZXJyIiwic3RhdHVzIiwiaGFzIiwiY29kZSIsImNyb3NzRG9tYWluIiwiX3JldHJ5IiwicmVxIiwicmVxdWVzdCIsIl9hYm9ydGVkIiwidGltZWRvdXQiLCJ0aW1lZG91dEVycm9yIiwiX2VuZCIsInRoZW4iLCJyZXNv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xsZWRQcm9taXNlKSB7XG4gICAgY29uc3Qgc2VsZiA9IHRoaXM7XG4gICAgaWYgKHRoaXMuX2VuZENhbGxlZCkge1xuICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAnV2FybmluZzogc3VwZXJhZ2VudCByZXF1ZXN0IHdhcyBzZW50IHR3aWNlLCBiZWNhdXNlIGJvdGggLmVuZCgpIGFuZCAudGhlbigpIHdlcmUgY2FsbGVkLiBOZXZlciBjYWxsIC5lbmQoKSBpZiB5b3UgdXNlIHByb21pc2VzJ1xuICAgICAgKTtcbiAgICB9XG5cbiAgICB0aGlzLl9mdWxsZmlsbGVkUHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgIHNlbGYub24oJ2Fib3J0JywgKCkgPT4ge1xuICAgICAgICBpZiAodGhpcy5fbWF4UmV0cmllcyAmJiB0aGlzLl9tYXhSZXRyaWVzID4gdGhpcy5fcmV0cmllcykge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLnRpbWVkb3V0ICYmIHRoaXMudGltZWRvdXRFcnJvcikge1xuICAgICAgICAgIHJlamVjdCh0aGlzLnRpbWVkb3V0RXJyb3IpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGVycm9yID0gbmV3IEVycm9yKCdBYm9ydGVkJyk7XG4gICAgICAgIGVycm9yLmNvZGUgPSAnQUJPUlRFRCc7XG4gICAgICAgIGVycm9yLnN0YXR1cyA9IHRoaXMuc3RhdHVzO1xuICAgICAgICBlcnJvci5tZXRob2QgPSB0aGlzLm1ldGhvZDtcbiAgICAgICAgZXJyb3IudXJsID0gdGhpcy51cmw7XG4gICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICB9KTtcbiAgICAgIHNlbGYuZW5kKChlcnJvciwgcmVzKSA9PiB7XG4gICAgICAgIGlmIChlcnJvcikgcmVqZWN0K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gICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQnKVxuICogICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogQHBhcmFtIHtTdHJpbmd8T2JqZWN0fSBkYXRhXG4gKiBAcmV0dXJuIHtSZXF1ZXN0fSBmb3IgY2hhaW5pbmdcbiAqIEBhcGkgcHVibGljXG4gKi9cblxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGNvbXBsZXhpdHlcblJlcXVlc3RCYX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LENBQUMsS0FBS2IscUJBQW5DLEVBQTBEO0lBQ3hELEtBQUtBLHFCQUFMLEdBQTZCb0ksVUFBVSxDQUFDLE1BQU07TUFDNUNqRixJQUFJLENBQUM2RSxhQUFMLENBQ0Usc0JBREYsRUFFRTdFLElBQUksQ0FBQ3RDLGdCQUZQLEVBR0UsV0FIRjtJQUtELENBTnNDLEVBTXBDLEtBQUtBLGdCQU4rQixDQUF2QztFQU9EO0FBQ0YsQ0FwQkQifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/response-base.js b/together/node_modules/superagent/lib/response-base.js new file mode 100644 index 0000000..8add90f --- /dev/null +++ b/together/node_modules/superagent/lib/response-base.js @@ -0,0 +1,113 @@ +"use strict"; + +/** + * Module dependencies. + */ +const utils = require('./utils'); +/** + * Expose `ResponseBase`. + */ + + +module.exports = ResponseBase; +/** + * Initialize a new `ResponseBase`. + * + * @api public + */ + +function ResponseBase() {} +/** + * Get case-insensitive `field` value. + * + * @param {String} field + * @return {String} + * @api public + */ + + +ResponseBase.prototype.get = function (field) { + return this.header[field.toLowerCase()]; +}; +/** + * Set header related properties: + * + * - `.type` the content type without params + * + * A response of "Content-Type: text/plain; charset=utf-8" + * will provide you with a `.type` of "text/plain". + * + * @param {Object} header + * @api private + */ + + +ResponseBase.prototype._setHeaderProperties = function (header) { + // TODO: moar! + // TODO: make this a util + // content-type + const ct = header['content-type'] || ''; + this.type = utils.type(ct); // params + + const parameters = utils.params(ct); + + for (const key in parameters) { + if (Object.prototype.hasOwnProperty.call(parameters, key)) this[key] = parameters[key]; + } + + this.links = {}; // links + + try { + if (header.link) { + this.links = utils.parseLinks(header.link); + } + } catch (err) {// ignore + } +}; +/** + * Set flags such as `.ok` based on `status`. + * + * For example a 2xx response will give you a `.ok` of __true__ + * whereas 5xx will be __false__ and `.error` will be __true__. The + * `.clientError` and `.serverError` are also available to be more + * specific, and `.statusType` is the class of error ranging from 1..5 + * sometimes useful for mapping respond colors etc. + * + * "sugar" properties are also defined for common cases. Currently providing: + * + * - .noContent + * - .badRequest + * - .unauthorized + * - .notAcceptable + * - .notFound + * + * @param {Number} status + * @api private + */ + + +ResponseBase.prototype._setStatusProperties = function (status) { + const type = Math.trunc(status / 100); // status / class + + this.statusCode = status; + this.status = this.statusCode; + this.statusType = type; // basics + + this.info = type === 1; + this.ok = type === 2; + this.redirect = type === 3; + this.clientError = type === 4; + this.serverError = type === 5; + this.error = type === 4 || type === 5 ? this.toError() : false; // sugar + + this.created = status === 201; + this.accepted = status === 202; + this.noContent = status === 204; + this.badRequest = status === 400; + this.unauthorized = status === 401; + this.notAcceptable = status === 406; + this.forbidden = status === 403; + this.notFound = status === 404; + this.unprocessableEntity = status === 422; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJ1dGlscyIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwiUmVzcG9uc2VCYXNlIiwicHJvdG90eXBlIiwiZ2V0IiwiZmllbGQiLCJoZWFkZXIiLCJ0b0xvd2VyQ2FzZSIsIl9zZXRIZWFkZXJQcm9wZXJ0aWVzIiwiY3QiLCJ0eXBlIiwicGFyYW1ldGVycyIsInBhcmFtcyIsImtleSIsIk9iamVjdCIsImhhc093blByb3BlcnR5IiwiY2FsbCIsImxpbmtzIiwibGluayIsInBhcnNlTGlua3MiLCJlcnIiLCJfc2V0U3RhdHVzUHJvcGVydGllcyIsInN0YXR1cyIsIk1hdGgiLCJ0cnVuYyIsInN0YXR1c0NvZGUiLCJzdGF0dXNUeXBlIiwiaW5mbyIsIm9rIiwicmVkaXJlY3QiLCJjbGllbnRFcnJvciIsInNlcnZlckVycm9yIiwiZXJyb3IiLCJ0b0Vycm9yIiwiY3JlYXRlZCIsImFjY2VwdGVkIiwibm9Db250ZW50IiwiYmFkUmVxdWVzdCIsInVuYXV0aG9yaXplZCIsIm5vdEFjY2VwdGFibGUiLCJmb3JiaWRkZW4iLCJub3RGb3VuZCIsInVuc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S0FBSyxHQUE1QjtFQUNBLEtBQUttQixRQUFMLEdBQWdCbkIsTUFBTSxLQUFLLEdBQTNCO0VBQ0EsS0FBS29CLG1CQUFMLEdBQTJCcEIsTUFBTSxLQUFLLEdBQXRDO0FBQ0QsQ0ExQkQifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/lib/utils.js b/together/node_modules/superagent/lib/utils.js new file mode 100644 index 0000000..d4f7174 --- /dev/null +++ b/together/node_modules/superagent/lib/utils.js @@ -0,0 +1,136 @@ +"use strict"; + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + +/** + * Return the mime type for the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ +exports.type = string_ => string_.split(/ *; */).shift(); +/** + * Return header field parameters. + * + * @param {String} str + * @return {Object} + * @api private + */ + + +exports.params = value => { + const object = {}; + + var _iterator = _createForOfIteratorHelper(value.split(/ *; */)), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + const string_ = _step.value; + const parts = string_.split(/ *= */); + const key = parts.shift(); + const value = parts.shift(); + if (key && value) object[key] = value; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + return object; +}; +/** + * Parse Link header fields. + * + * @param {String} str + * @return {Object} + * @api private + */ + + +exports.parseLinks = value => { + const object = {}; + + var _iterator2 = _createForOfIteratorHelper(value.split(/ *, */)), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + const string_ = _step2.value; + const parts = string_.split(/ *; */); + const url = parts[0].slice(1, -1); + const rel = parts[1].split(/ *= */)[1].slice(1, -1); + object[rel] = url; + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + + return object; +}; +/** + * Strip content related fields from `header`. + * + * @param {Object} header + * @return {Object} header + * @api private + */ + + +exports.cleanHeader = (header, changesOrigin) => { + delete header['content-type']; + delete header['content-length']; + delete header['transfer-encoding']; + delete header.host; // secuirty + + if (changesOrigin) { + delete header.authorization; + delete header.cookie; + } + + return header; +}; +/** + * Check if `obj` is an object. + * + * @param {Object} object + * @return {Boolean} + * @api private + */ + + +exports.isObject = object => { + return object !== null && typeof object === 'object'; +}; +/** + * Object.hasOwn fallback/polyfill. + * + * @type {(object: object, property: string) => boolean} object + * @api private + */ + + +exports.hasOwn = Object.hasOwn || function (object, property) { + if (object == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + return Object.prototype.hasOwnProperty.call(new Object(object), property); +}; + +exports.mixin = (target, source) => { + for (const key in source) { + if (exports.hasOwn(source, key)) { + target[key] = source[key]; + } + } +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnR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VBRUQsT0FBT0osTUFBUDtBQUNELENBWkQ7QUFjQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQ0FmLE9BQU8sQ0FBQ29CLFFBQVIsR0FBb0JiLE1BQUQsSUFBWTtFQUM3QixPQUFPQSxNQUFNLEtBQUssSUFBWCxJQUFtQixPQUFPQSxNQUFQLEtBQWtCLFFBQTVDO0FBQ0QsQ0FGRDtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQ0FQLE9BQU8sQ0FBQ3FCLE1BQVIsR0FDRUMsTUFBTSxDQUFDRCxNQUFQLElBQ0EsVUFBVWQsTUFBVixFQUFrQmdCLFFBQWxCLEVBQTRCO0VBQzFCLElBQUloQixNQUFNLElBQUksSUFBZCxFQUFvQjtJQUNsQixNQUFNLElBQUlpQixTQUFKLENBQWMsNENBQWQsQ0FBTjtFQUNEOztFQUVELE9BQU9GLE1BQU0sQ0FBQ0csU0FBUCxDQUFpQkMsY0FBakIsQ0FBZ0NDLElBQWhDLENBQXFDLElBQUlMLE1BQUosQ0FBV2YsTUFBWCxDQUFyQyxFQUF5RGdCLFFBQXpELENBQVA7QUFDRCxDQVJIOztBQVVBdkIsT0FBTyxDQUFDNEIsS0FBUixHQUFnQixDQUFDQyxNQUFELEVBQVNDLE1BQVQsS0FBb0I7RUFDbEMsS0FBSyxNQUFNckIsR0FBWCxJQUFrQnFCLE1BQWxCLEVBQTBCO0lBQ3hCLElBQUk5QixPQUFPLENBQUNxQixNQUFSLENBQWVTLE1BQWYsRUFBdUJyQixHQUF2QixDQUFKLEVBQWlDO01BQy9Cb0IsTUFBTSxDQUFDcEIsR0FBRCxDQUFOLEdBQWNxQixNQUFNLENBQUNyQixHQUFELENBQXBCO0lBQ0Q7RUFDRjtBQUNGLENBTkQifQ==
\ No newline at end of file diff --git a/together/node_modules/superagent/package.json b/together/node_modules/superagent/package.json new file mode 100644 index 0000000..6206f36 --- /dev/null +++ b/together/node_modules/superagent/package.json @@ -0,0 +1,136 @@ +{ + "name": "superagent", + "description": "elegant & feature rich browser / node HTTP with a fluent API", + "version": "8.0.0", + "author": "TJ Holowaychuk <tj@vision-media.ca>", + "browser": { + "./src/node/index.js": "./src/client.js", + "./lib/node/index.js": "./lib/client.js", + "./test/support/server.js": "./test/support/blank.js", + "semver": false + }, + "bugs": { + "url": "https://github.com/visionmedia/superagent/issues" + }, + "contributors": [ + "Kornel Lesiński <kornel@geekhood.net>", + "Peter Lyons <pete@peterlyons.com>", + "Hunter Loftis <hunter@hunterloftis.com>", + "Nick Baugh <niftylettuce@gmail.com>" + ], + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.3", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.0.1", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.10.3", + "readable-stream": "^3.6.0", + "semver": "^7.3.7" + }, + "devDependencies": { + "@babel/cli": "^7.17.10", + "@babel/core": "^7.18.5", + "@babel/plugin-transform-runtime": "^7.18.5", + "@babel/preset-env": "^7.18.2", + "@babel/runtime": "^7.18.3", + "@commitlint/cli": "^17.0.2", + "@commitlint/config-conventional": "^17.0.2", + "Base64": "^1.1.0", + "babelify": "^10.0.0", + "basic-auth-connect": "^1.0.0", + "body-parser": "^1.20.0", + "browserify": "^17.0.0", + "codecov": "^3.8.3", + "cookie-parser": "^1.4.6", + "cross-env": "^7.0.3", + "eslint": "^8.18.0", + "eslint-config-xo-lass": "^2.0.1", + "eslint-plugin-compat": "^4.0.2", + "eslint-plugin-node": "^11.1.0", + "express": "^4.18.1", + "express-session": "^1.17.3", + "fixpack": "^4.0.0", + "get-port": "4.2.0", + "husky": "^8.0.1", + "lint-staged": "^13.0.2", + "marked": "^2.0.0", + "mocha": "6.2.2", + "multer": "^1.4.4", + "nyc": "^15.1.0", + "remark-cli": "^10.0.1", + "remark-preset-github": "^4.0.4", + "rimraf": "^3.0.2", + "should": "^13.2.3", + "should-http": "^0.1.1", + "tinyify": "^3.0.0", + "xo": "^0.49.0", + "zuul": "^3.12.0" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + }, + "files": [ + "dist/*.js", + "lib/**/*.js" + ], + "homepage": "https://github.com/visionmedia/superagent", + "jsdelivr": "dist/superagent.min.js", + "keywords": [ + "agent", + "ajax", + "ajax", + "api", + "async", + "await", + "axios", + "cancel", + "client", + "frisbee", + "got", + "http", + "http", + "https", + "ky", + "promise", + "promise", + "promises", + "request", + "request", + "requests", + "response", + "rest", + "retry", + "super", + "superagent", + "timeout", + "transform", + "xhr", + "xmlhttprequest" + ], + "license": "MIT", + "main": "lib/node/index.js", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/superagent.git" + }, + "scripts": { + "browserify": "browserify src/node/index.js -o dist/superagent.js -s superagent -g [ babelify --configFile ./.dist.babelrc ]", + "build": "npm run build:clean && npm run build:lib && npm run build:dist", + "build:clean": "rimraf lib dist", + "build:dist": "npm run browserify && npm run minify", + "build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib", + "build:test": "babel --config-file ./.test.babelrc test --out-dir lib/node/test", + "coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", + "lint": "eslint -c .eslintrc src test && remark . -qfo && eslint -c .lib.eslintrc lib/**/*.js && eslint -c .dist.eslintrc dist/**/*.js", + "minify": "cross-env NODE_ENV=production browserify src/node/index.js -o dist/superagent.min.js -s superagent -g [ babelify --configFile ./.dist.babelrc ] -p tinyify", + "nyc": "cross-env NODE_ENV=test nyc ava", + "prepare": "husky install", + "test": "npm run build && npm run lint && make test", + "test-http2": "npm run build && npm run lint && make test-node-http2" + }, + "unpkg": "dist/superagent.min.js" +} |