mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 18:30:49 +00:00
12194 lines
6.8 MiB
12194 lines
6.8 MiB
/******/ (function(modules) { // webpackBootstrap
|
||
/******/ // The module cache
|
||
/******/ var installedModules = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/
|
||
/******/ // Check if module is in cache
|
||
/******/ if(installedModules[moduleId]) {
|
||
/******/ return installedModules[moduleId].exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = installedModules[moduleId] = {
|
||
/******/ i: moduleId,
|
||
/******/ l: false,
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Flag the module as loaded
|
||
/******/ module.l = true;
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/******/
|
||
/******/ // expose the modules object (__webpack_modules__)
|
||
/******/ __webpack_require__.m = modules;
|
||
/******/
|
||
/******/ // expose the module cache
|
||
/******/ __webpack_require__.c = installedModules;
|
||
/******/
|
||
/******/ // define getter function for harmony exports
|
||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||
/******/ }
|
||
/******/ };
|
||
/******/
|
||
/******/ // define __esModule on exports
|
||
/******/ __webpack_require__.r = function(exports) {
|
||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
/******/ }
|
||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
/******/ };
|
||
/******/
|
||
/******/ // create a fake namespace object
|
||
/******/ // mode & 1: value is a module id, require it
|
||
/******/ // mode & 2: merge all properties of value into the ns
|
||
/******/ // mode & 4: return value when already ns object
|
||
/******/ // mode & 8|1: behave like require
|
||
/******/ __webpack_require__.t = function(value, mode) {
|
||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||
/******/ if(mode & 8) return value;
|
||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||
/******/ var ns = Object.create(null);
|
||
/******/ __webpack_require__.r(ns);
|
||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||
/******/ return ns;
|
||
/******/ };
|
||
/******/
|
||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
/******/ __webpack_require__.n = function(module) {
|
||
/******/ var getter = module && module.__esModule ?
|
||
/******/ function getDefault() { return module['default']; } :
|
||
/******/ function getModuleExports() { return module; };
|
||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||
/******/ return getter;
|
||
/******/ };
|
||
/******/
|
||
/******/ // Object.prototype.hasOwnProperty.call
|
||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||
/******/
|
||
/******/ // __webpack_public_path__
|
||
/******/ __webpack_require__.p = "";
|
||
/******/
|
||
/******/
|
||
/******/ // Load entry module and return exports
|
||
/******/ return __webpack_require__(__webpack_require__.s = "./index.js");
|
||
/******/ })
|
||
/************************************************************************/
|
||
/******/ ({
|
||
|
||
/***/ "./Errors.js":
|
||
/*!*******************!*\
|
||
!*** ./Errors.js ***!
|
||
\*******************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("errors = {};\n\n// Use this when the code logic has been broken - e.g. something is called with an undefined parameter, its preferable to console.assert\n// Typically this is an error, that should have been caught higher up.\nclass CodingError extends Error {\n constructor(message) {\n super(message || \"Coding Error\");\n this.name = \"CodingError\"\n }\n}\nerrors.CodingError = CodingError;\n// These are equivalent of python exceptions, will log and raise alert in most cases - exceptions aren't caught\nclass ToBeImplementedError extends Error {\n constructor(message) {\n super(\"To be implemented: \" + message);\n this.name = \"ToBeImplementedError\"\n }\n}\nerrors.ToBeImplementedError = ToBeImplementedError;\n\nclass TransportError extends Error {\n constructor(message) {\n super(message || \"Transport failure\");\n this.name = \"TransportError\"\n }\n}\nerrors.TransportError = TransportError;\n\nclass TimeoutError extends Error {\n constructor(message) {\n super(message || \"Timed out\");\n this.name = \"TimeoutError\"\n }\n}\nerrors.TimeoutError = TimeoutError;\n\nclass IntentionallyUnimplementedError extends Error {\n constructor(message) {\n super(message || \"Intentionally Unimplemented Function\");\n this.name = \"IntentionallyUnimplementedError\"\n }\n}\nerrors.IntentionallyUnimplementedError = IntentionallyUnimplementedError;\n\n\n/*---- Below here are errors copied from previous Dweb-Transport and not currently used */\n/*\nclass ObsoleteError extends Error {\n constructor(message) {\n super(\"Obsolete: \" + message);\n this.name = \"ObsoleteError\"\n }\n}\nerrors.ObsoleteError = ObsoleteError;\n\n// Use this when the logic of encryption wont let you do something, typically something higher should have stopped you trying.\n// Examples include signing something when you only have a public key.\nclass EncryptionError extends Error {\n constructor(message) {\n super(message || \"Encryption Error\");\n this.name = \"EncryptionError\"\n }\n}\nerrors.EncryptionError = EncryptionError;\n\n// Use this something that should have been signed isn't - this is externally signed, i.e. a data rather than coding error\nclass SigningError extends Error {\n constructor(message) {\n super(message || \"Signing Error\");\n this.name = \"SigningError\"\n }\n}\nerrors.SigningError = SigningError;\n\nclass ForbiddenError extends Error {\n constructor(message) {\n super(message || \"Forbidden failure\");\n this.name = \"ForbiddenError\"\n }\n}\nerrors.ForbiddenError = ForbiddenError;\n\nclass AuthenticationError extends Error {\n constructor(message) {\n super(message || \"Authentication failure\");\n this.name = \"AuthenticationError\"\n }\n}\nerrors.AuthenticationError = AuthenticationError;\n\nclass DecryptionFailError extends Error {\n constructor(message) {\n super(message || \"Decryption Failed\");\n this.name = \"DecryptionFailError\"\n }\n}\nerrors.DecryptionFailError = DecryptionFailError;\n\nclass SecurityWarning extends Error {\n constructor(message) {\n super(message || \"Security Warning\");\n this.name = \"SecurityWarning\"\n }\n}\nerrors.SecurityWarning = SecurityWarning;\n\nclass ResolutionError extends Error {\n constructor(message) {\n super(message || \"Resolution failure\");\n this.name = \"ResolutionError\"\n }\n}\nerrors.ResolutionError = ResolutionError;\n*/\nexports = module.exports = errors;\n\n\n//# sourceURL=webpack:///./Errors.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./Transport.js":
|
||
/*!**********************!*\
|
||
!*** ./Transport.js ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\");\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\n\nfunction delay(ms, val) { return new Promise(resolve => {setTimeout(() => { resolve(val); },ms)})}\n\n\nclass Transport {\n\n constructor(options) {\n /*\n Doesnt do anything, its all done by SuperClasses,\n Superclass should merge with default options, call super\n\n Fields:\n statuselement: If set is an HTML Element that should be adjusted to indicate status (this is managed by Transports, just stored on Transport)\n statuscb: Callback when status changes\n name: Short name of element e.g. HTTP IPFS WEBTORRENT GUN\n */\n }\n\n //TODO-SPLIT define load()\n\n static setup0(options) {\n /*\n First part of setup, create obj, add to Transports but dont attempt to connect, typically called instead of p_setup if want to parallelize connections.\n */\n throw new errors.IntentionallyUnimplementedError(\"Intentionally undefined function Transport.setup0 should have been subclassed\");\n }\n\n p_setup1(cb) {\n /*\n Setup the resource and open any P2P connections etc required to be done just once. Asynchronous and should leave status=STATUS_STARTING until it resolves, or STATUS_FAILED if fails.\n\n cb (t)=>void If set, will be called back as status changes (so could be multiple times)\n Resolves to the Transport instance\n */\n return this;\n }\n p_setup2(cb) {\n /*\n Works like p_setup1 but runs after p_setup1 has completed for all transports. This allows for example YJS to wait for IPFS to be connected in TransportIPFS.setup1() and then connect itself using the IPFS object.\n\n cb (t)=>void If set, will be called back as status changes (so could be multiple times)\n Resolves to the Transport instance\n */\n return this;\n }\n static async p_setup(options, cb) {\n /*\n A deprecated utility to simply setup0 then p_setup1 then p_setup2 to allow a transport to be started in one step, normally Transports.p_setup should be called instead.\n */\n let t = await this.setup0(options) // Sync version that doesnt connect\n .p_setup1(cb); // And connect\n\n return t.p_setup2(cb); // And connect\n }\n /* Disconnect from the transport service - there is no guarrantee that a restart will be successfull so this is usually only for when exiting */\n stop(refreshstatus, cb) {\n // refreshstatus(Transport instance) => optional callback to the UI to update the status on the display\n this.status = Transport.STATUS_FAILED;\n if (refreshstatus) refreshstatus(this);\n cb(null, this);\n }\n togglePaused(cb) {\n /*\n Switch the state of the transport between STATUS_CONNECTED and STATUS_PAUSED,\n in the paused state it will not be used for transport but, in some cases, will still do background tasks like serving files.\n\n cb(transport)=>void a callback called after this is run, may be used for example to change the UI\n */\n switch (this.status) {\n case Transport.STATUS_CONNECTED:\n this.status = Transport.STATUS_PAUSED;\n break;\n case Transport.STATUS_PAUSED:\n this.status = Transport.STATUS_CONNECTED; // Superclass might change to STATUS_STARTING if needs to stop/restart\n break;\n case Transport.STATUS_LOADED:\n this.p_setup1(cb).then((t)=>t.p_setup2(cb)); // Allows for updating status progressively as attempts to connect\n }\n if (cb) cb(this);\n }\n\n async p_status() {\n /*\n Check the status of the underlying transport. This may update the \"status\" field from the underlying transport.\n returns: a numeric code for the status of a transport.\n */\n return this.status;\n }\n\n connected() {\n // True if connected (status==STATUS_CONNECTED==0) should not need subclassing\n return ! this.status;\n }\n supports(url, func, {noCache=undefined}={}) { //TODO-API\n /*\n Determine if this transport supports a certain set of URLs and a func\n\n :param url: String or parsed URL\n :param opts: { noCache } check against supportFeatures\n :return: true if this protocol supports these URLs and this func\n :throw: TransportError if invalid URL\n */\n if (typeof url === \"string\") {\n url = Url.parse(url); // For efficiency, only parse once.\n }\n if (url && !url.protocol) {\n throw new Error(\"URL failed to specific a scheme (before :) \" + url.href)\n } //Should be TransportError but out of scope here\n // noinspection Annotator supportURLs is defined in subclasses\n return ( (!url || this.supportURLs.includes(url.protocol.slice(0, -1)))\n && (!func || this.supportFunctions.includes(func))\n && (!noCache || this.supportFeatures.includes(\"noCache\"))\n )\n }\n\n validFor(url, func, opts) {\n // By default a transport can handle a url and a func if its connected and supports that url/func\n // This shouldnt need subclassing, an exception is HTTP which only applies \"connected\" against urls heading for the gateway\n return this.connected() && this.supports(url, func, opts);\n }\n\n\n p_rawstore(data, opts) {\n /*\n Store a blob of data onto the decentralised transport.\n Returns a promise that resolves to the url of the data\n\n :param string|Buffer data: Data to store - no assumptions made to size or content\n :resolve string: url of data stored\n */\n throw new errors.ToBeImplementedError(\"Intentionally undefined function Transport.p_rawstore should have been subclassed\");\n }\n\n async p_rawstoreCaught(data) {\n try {\n return await this.p_rawstore(data);\n } catch (err) {\n\n }\n }\n p_store() {\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_store - may define higher level semantics here (see Python)\");\n }\n\n //noinspection JSUnusedLocalSymbols\n\n p_rawfetch(url, {timeoutMS=undefined, start=undefined, end=undefined, relay=false}={}) {\n /*\n Fetch some bytes based on a url, no assumption is made about the data in terms of size or structure.\n Where required by the underlying transport it should retrieve a number if its \"blocks\" and concatenate them.\n Returns a new Promise that resolves currently to a string.\n There may also be need for a streaming version of this call, at this point undefined.\n\n :param string url: URL of object being retrieved\n :param timeoutMS Max time to wait on transports that support it (IPFS for fetch)\n :param start,end Inclusive byte range wanted (must be supported, uses a \"slice\" on output if transport ignores it.\n :param relay If first transport fails, try and retrieve on 2nd, then store on 1st, and so on.\n\n :resolve string: Return the object being fetched, (note currently returned as a string, may refactor to return Buffer)\n :throws: TransportError if url invalid - note this happens immediately, not as a catch in the promise\n */\n console.assert(false, \"Intentionally undefined function Transport.p_rawfetch should have been subclassed\");\n return \"UNIMPLEMENTED\";\n }\n\n p_fetch() {\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_fetch - may define higher level semantics here (see Python)\");\n }\n\n p_rawadd(url, sig) {\n /*\n Store a new list item, ideally it should be stored so that it can be retrieved either by \"signedby\" (using p_rawlist) or\n by \"url\" (with p_rawreverse). The underlying transport does not need to guarantee the signature,\n an invalid item on a list should be rejected on higher layers.\n\n :param string url: String identifying an object being added to the list.\n :param Signature sig: A signature data structure.\n :resolve undefined:\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_rawadd\");\n }\n\n p_rawlist(url) {\n /*\n Fetch all the objects in a list, these are identified by the url of the public key used for signing.\n (Note this is the 'signedby' parameter of the p_rawadd call, not the 'url' parameter\n Returns a promise that resolves to the list.\n Each item of the list is a dict: {\"url\": url, \"date\": date, \"signature\": signature, \"signedby\": signedby}\n List items may have other data (e.g. reference ids of underlying transport)\n\n :param string url: String with the url that identifies the list.\n :resolve array: An array of objects as stored on the list.\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_rawlist\");\n }\n\n p_list() {\n throw new Error(\"Undefined function Transport.p_list\");\n }\n p_newlisturls(cl) {\n /*\n Must be implemented by any list, return a pair of URLS that may be the same, private and public links to the list.\n returns: ( privateurl, publicurl) e.g. yjs:xyz/abc or orbitdb:a123\n */\n throw new Error(\"undefined function Transport.p_newlisturls\");\n }\n\n //noinspection JSUnusedGlobalSymbols\n p_rawreverse(url) {\n /*\n Similar to p_rawlist, but return the list item of all the places where the object url has been listed.\n The url here corresponds to the \"url\" parameter of p_rawadd\n Returns a promise that resolves to the list.\n\n :param string url: String with the url that identifies the object put on a list.\n :resolve array: An array of objects as stored on the list.\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_rawreverse\");\n }\n\n listmonitor(url, callback, {current=false}={}) {\n /*\n Setup a callback called whenever an item is added to a list, typically it would be called immediately after a p_rawlist to get any more items not returned by p_rawlist.\n\n :param url: string Identifier of list (as used by p_rawlist and \"signedby\" parameter of p_rawadd\n :param callback: function(obj) Callback for each new item added to the list\n \tobj is same format as p_rawlist or p_rawreverse\n */\n console.log(\"Undefined function Transport.listmonitor\"); // Note intentionally a log, as legitamte to not implement it\n }\n\n\n // ==== TO SUPPORT KEY VALUE INTERFACES IMPLEMENT THESE =====\n // Support for Key-Value pairs as per\n // https://docs.google.com/document/d/1yfmLRqKPxKwB939wIy9sSaa7GKOzM5PrCZ4W1jRGW6M/edit#\n\n async p_newdatabase(pubkey) {\n /*\n Create a new database based on some existing object\n pubkey: Something that is, or has a pubkey, by default support Dweb.PublicPrivate, KeyPair or an array of strings as in the output of keypair.publicexport()\n returns: {publicurl, privateurl} which may be the same if there is no write authentication\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_newdatabase\");\n }\n //TODO maybe change the listmonitor / monitor code for to use \"on\" and the structure of PP.events\n //TODO but note https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy about Proxy which might be suitable, prob not as doesnt map well to lists\n async p_newtable(pubkey, table) {\n /*\n Create a new table,\n pubkey: Is or has a pubkey (see p_newdatabase)\n table: String representing the table - unique to the database\n returns: {privateurl, publicurl} which may be the same if there is no write authentication\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_newtable\");\n }\n\n async p_set(url, keyvalues, value) { // url = yjs:/yjs/database/table/key\n /*\n Set one or more keys in a table.\n url: URL of the table\n keyvalues: String representing a single key OR dictionary of keys\n value: String or other object to be stored (its not defined yet what objects should be supported, e.g. any object ?\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_set\");\n }\n async p_get(url, keys) {\n /* Get one or more keys from a table\n url: URL of the table\n keys: Array of keys\n returns: Dictionary of values found (undefined if not found)\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_get\");\n }\n\n async p_delete(url, keys) {\n /* Delete one or more keys from a table\n url: URL of the table\n keys: Array of keys\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_delete\");\n }\n\n async p_keys(url) {\n /* Return a list of keys in a table (suitable for iterating through)\n url: URL of the table\n returns: Array of strings\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_keys\");\n }\n async p_getall(url) {\n /* Return a dictionary representing the table\n url: URL of the table\n returns: Dictionary of Key:Value pairs, note take care if this could be large.\n */\n throw new errors.ToBeImplementedError(\"Undefined function Transport.p_keys\");\n }\n static async p_f_createReadStream(url, {wanturl=false}) {\n /*\n Provide a function of the form needed by tag and renderMedia library etc\n\n url Urls of stream\n wanturl True if want the URL of the stream (for service workers)\n returns f(opts) => stream returning bytes from opts.start || start of file to opts.end-1 || end of file\n */\n }\n // ------ UTILITY FUNCTIONS, NOT REQD TO BE SUBCLASSED ----\n\n static mergeoptions(a) {\n /*\n Deep merge options dictionaries, careful since searchparameters from URL passed in as null\n */\n let c = {};\n for (let i = 0; i < arguments.length; i++) {\n let b = arguments[i];\n for (let key in b) {\n let val = b[key];\n if (val !== null) {\n if ((typeof val === \"object\") && !Array.isArray(val) && c[key]) {\n c[key] = Transport.mergeoptions(a[key], b[key]);\n } else {\n c[key] = b[key];\n }\n }\n }\n }\n return c;\n }\n\n async p_test_list({urlexpectedsubstring=undefined}={}) {\n //TODO - this test doesn't work since we dont have Signature nor want to create dependency on it - when works, add to GUN & YJS\n {console.log(this.name,\"p_test_kvt\")}\n try {\n let table = await this.p_newlisturls(\"NACL VERIFY:1234567LIST\");\n let mapurl = table.publicurl;\n console.log(\"newlisturls=\",mapurl);\n console.assert((!urlexpectedsubstring) || mapurl.includes(urlexpectedsubstring));\n await this.p_rawadd(mapurl, \"testvalue\");\n let res = await this.p_rawlist(mapurl);\n console.assert(res.length===1 && res[0] === \"testvalue\");\n await this.p_rawadd(mapurl, {foo: \"bar\"}); // Try adding an object\n res = await this.p_rawlist(mapurl);\n console.assert(res.length === 2 && res[1].foo === \"bar\");\n await this.p_rawadd(mapurl, [1,2,3]); // Try setting to an array\n res = await this.p_rawlist(mapurl);\n console.assert(res.length === 2 && res[2].length === 3 && res[2][1] === 2);\n await delay(200);\n console.log(this.name, \"p_test_list complete\")\n } catch(err) {\n console.log(\"Exception thrown in \", this.name, \"p_test_list:\", err.message);\n throw err;\n }\n\n }\n async p_test_kvt(urlexpectedsubstring) {\n /*\n Test the KeyValue functionality of any transport that supports it.\n urlexpectedsubstring: Some string expected in the publicurl of the table.\n */\n {console.log(this.name,\"p_test_kvt\")}\n try {\n let table = await this.p_newtable(\"NACL VERIFY:1234567KVT\",\"mytable\");\n let mapurl = table.publicurl;\n console.log(\"newtable=\",mapurl);\n console.assert(mapurl.includes(urlexpectedsubstring));\n await this.p_set(mapurl, \"testkey\", \"testvalue\");\n let res = await this.p_get(mapurl, \"testkey\");\n console.assert(res === \"testvalue\");\n await this.p_set(mapurl, \"testkey2\", {foo: \"bar\"}); // Try setting to an object\n res = await this.p_get(mapurl, \"testkey2\");\n console.assert(res.foo === \"bar\");\n await this.p_set(mapurl, \"testkey3\", [1,2,3]); // Try setting to an array\n res = await this.p_get(mapurl, \"testkey3\");\n console.assert(res[1] === 2);\n res = await this.p_keys(mapurl);\n console.assert(res.includes(\"testkey\") && res.includes(\"testkey3\") && res.length === 3);\n await this.p_delete(mapurl, [\"testkey\"]);\n res = await this.p_getall(mapurl);\n console.log(\"getall=>\",res);\n console.assert(res.testkey2.foo === \"bar\" && res.testkey3[\"1\"] === 2 && !res.testkey);\n await delay(200);\n console.log(this.name, \"p_test_kvt complete\")\n } catch(err) {\n console.log(\"Exception thrown in \", this.name, \"p_test_kvt:\", err.message);\n throw err;\n }\n }\n\n\n}\nTransport.STATUS_CONNECTED = 0; // Connected - all other numbers are some version of not ok to use\nTransport.STATUS_FAILED = 1; // Failed to connect\nTransport.STATUS_STARTING = 2; // In the process of connecting\nTransport.STATUS_LOADED = 3; // Code loaded, but haven't tried to connect. (this is typically hard coded in subclasses constructor)\nTransport.STATUS_PAUSED = 4; // It was launched, probably connected, but now paused so will be ignored by validFor // Note this is copied to dweb-archive/Nav.js so check if change\nTransport.STATUSTEXT = [\"Connected\", \"Failed\", \"Starting\", \"Loaded\", \"Paused\"];\nexports = module.exports = Transport;\n\n\n//# sourceURL=webpack:///./Transport.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./TransportGUN.js":
|
||
/*!*************************!*\
|
||
!*** ./TransportGUN.js ***!
|
||
\*************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/*\nThis Transport layers uses GUN.\n\nSee https://github.com/internetarchive/dweb-mirror/issues/43 for meta issue\n*/\nconst Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nprocess.env.GUN_ENV = \"false\";\nconst Gun = __webpack_require__(/*! gun/gun.js */ \"./node_modules/gun/gun.js\"); // gun/gun is the minimized version\n// Raw Gun has almost nothing in it, it needs at least the following to work properly.\n__webpack_require__(/*! gun/lib/path.js */ \"./node_modules/gun/lib/path.js\"); // So that .path works\n\n//WORKAROUND-GUN-STORAGE\n// The next step is to stop it failing as soon as its cached 5Mb in localstorage\n// see https://github.com/amark/gun/blob/master/test/tmp/indexedDB.html and https://github.com/amark/gun/issues/590\n// but the instructions on how to do this are obviously broken so waiting on @amark to get this working.\n\n// See https://github.com/internetarchive/dweb-archive/issues/106 unable to get this working (Gun doesnt work well with webpack)\n//require('gun/nts');\n//require('gun/lib/wire'); // NodeJS websocket\n//require('gun/lib/multicast'); // Local area broadcasting needs passing `multicast: true` in options (which is safe in node + browser)\n__webpack_require__(/*! gun/lib/radix.js */ \"./node_modules/gun/lib/radix.js\"); // loaded by store but required for webpack\n__webpack_require__(/*! gun/lib/radisk.js */ \"./node_modules/gun/lib/radisk.js\"); // loaded by store but required for webpack\n__webpack_require__(/*! gun/lib/store.js */ \"./node_modules/gun/lib/store.js\");\n__webpack_require__(/*! gun/lib/rindexed.js */ \"./node_modules/gun/lib/rindexed.js\");\n\nconst debuggun = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:gun');\nconst stringify = __webpack_require__(/*! canonical-json */ \"./node_modules/canonical-json/index.js\");\n\n\n// Other Dweb modules\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\nconst Transport = __webpack_require__(/*! ./Transport.js */ \"./Transport.js\"); // Base class for TransportXyz\nconst Transports = __webpack_require__(/*! ./Transports */ \"./Transports.js\"); // Manage all Transports that are loaded\nconst utils = __webpack_require__(/*! ./utils */ \"./utils.js\"); // Utility functions\n\n// Utility packages (ours) And one-liners\n//unused currently: function delay(ms, val) { return new Promise(resolve => {setTimeout(() => { resolve(val); },ms)})}\n\nlet defaultoptions = {\n peers: [ \"https://dweb.me:4246/gun\" ],\n localStorage: false // Need to be false to turn localStorage off on browser (do this if include radix/radisk)\n};\n//To run a superpeer - cd wherever; node install gun; cd node_modules/gun; npm start - starts server by default on port 8080, or set an \"env\" - see http.js\n//setenv GUN_ENV false; node examples/http.js 4246\n//Make sure to open of the port (typically in /etc/ferm)\n// TODO-GUN - copy example from systemctl here\n\n/*\n WORKING AROUND GUN WEIRDNESS/SUBOPTIMAL (of course, whats weird/sub-optimal to me, might be ideal to someone else) - search the code to see where worked around\n\n WORKAROUND-GUN-UNDERSCORE .once() and possibly .on() send an extra GUN internal field \"_\" which needs filtering. Reported and hopefully will get fixed\n .once behaves differently on node or the browser - this is a bug https://github.com/amark/gun/issues/586 and for now this code doesnt work on Node\n WORKAROUND-GUN-CURRENT: .once() and .on() deliver existing values as well as changes, reported & hopefully will get way to find just new ones.\n WORKAROUND-GUN-DELETE: There is no way to delete an item, setting it to null is recorded and is by convention a deletion. BUT the field will still show up in .once and .on,\n WORKAROUND-GUN-PROMISES: GUN is not promisified, there is only one place we care, and that is .once (since .on is called multiple times).\n WORKAROUND-GUN-ERRORS: GUN does an unhelpful job with errors, for example returning undefined when it cant find something (e.g. if connection to superpeer is down),\n for now just throw an error on undefined\n WORKAROUND-GUN-STORAGE: GUN defaults to local storage, which then fails on 5Mb or more of data, need to use radix, which has to be included and has bizarre config requirement I can't figure out\n TODO-GUN, handle error callbacks which are available in put etc\n Errors and Promises: Note that GUN's use of promises is seriously unexpected (aka weird), see https://gun.eco/docs/SEA#errors\n instead of using .reject or throwing an error at async it puts the error in SEA.err, so how that works in async parallel context is anyone's guess\n */\n\nclass TransportGUN extends Transport {\n /*\n GUN specific transport - over IPFS\n\n Fields:\n gun: object returned when starting GUN\n */\n\n constructor(options) {\n super(options);\n this.options = options; // Dictionary of options\n this.gun = undefined;\n this.name = \"GUN\"; // For console log etc\n this.supportURLs = ['gun'];\n this.supportFunctions = [ 'fetch', //'store'\n 'connection', 'get', 'set', 'getall', 'keys', 'newdatabase', 'newtable', 'monitor',\n 'add', 'list', 'listmonitor', 'newlisturls'];\n this.supportFeatures = []; // Doesnt support noCache and is mutable\n this.status = Transport.STATUS_LOADED;\n }\n\n connection(url) {\n /*\n TODO-GUN need to determine what a \"rooted\" Url is in gun, is it specific to a superpeer for example\n Utility function to get Gun object for this URL (note this isn't async)\n url: URL string or structure, to find list of of form [gun|dweb]:/gun/<database>/<table>[/<key] but could be arbitrary gun path\n resolves: Gun a connection to use for get's etc, undefined if fails\n */\n url = Url.parse(url); // Accept string or Url structure\n let patharray = url.pathname.split('/'); //[ 'gun', database, table ] but could be arbitrary length path\n patharray.shift(); // Loose leading \"\"\n patharray.shift(); // Loose \"gun\"\n debuggun(\"path=\", patharray);\n return this.gun.path(patharray); // Not sure how this could become undefined as it will return g before the path is walked, but if do a lookup on this \"g\" then should get undefined\n }\n\n //TODO-SPLIT define load()\n\n static setup0(options) {\n /*\n First part of setup, create obj, add to Transports but dont attempt to connect, typically called instead of p_setup if want to parallelize connections.\n options: { gun: { }, } Set of options - \"gun\" is used for those to pass direct to Gun\n */\n let combinedoptions = Transport.mergeoptions(defaultoptions, options.gun);\n debuggun(\"options %o\", combinedoptions);\n let t = new TransportGUN(combinedoptions); // Note doesnt start IPFS or OrbitDB\n t.gun = new Gun(t.options); // This doesnt connect, just creates db structure\n Transports.addtransport(t);\n return t;\n }\n\n async p_setup1(cb) {\n /*\n This sets up for GUN.\n Throws: TODO-GUN-DOC document possible error behavior\n */\n try {\n this.status = Transport.STATUS_STARTING; // Should display, but probably not refreshed in most case\n if (cb) cb(this);\n //TODO-GUN-TEST - try connect and retrieve info then look at ._.opt.peers\n await this.p_status();\n } catch(err) {\n console.error(this.name,\"failed to start\",err);\n this.status = Transport.STATUS_FAILED;\n }\n if (cb) cb(this);\n return this;\n }\n\n async p_status() {\n /*\n Return an integer for the status of a transport see Transport\n */\n //TODO-GUN-TEST - try connect and retrieve info then look at ._.opt.peers\n this.status = Transport.STATUS_CONNECTED; //TODO-GUN how do I know if/when I'm connected (see comment on p_setup1 as well)\n return this.status;\n }\n // ===== DATA ======\n\n async p_rawfetch(url) {\n url = Url.parse(url); // Accept url as string or object\n let g = this.connection(url); // Goes all the way to the key\n let val = await this._p_once(g);\n //g.on((data)=>debuggun(\"Got late result of: %o\", data)); // Checking for bug in GUN issue#586 - ignoring result\n if (!val)\n throw new errors.TransportError(\"GUN unable to retrieve: \"+url.href); // WORKAROUND-GUN-ERRORS - gun doesnt throw errors when it cant find something\n let o = typeof val === \"string\" ? JSON.parse(val) : val; // This looks like it is sync (see same code on p_get and p_rawfetch)\n //TODO-GUN this is a hack because the metadata such as metadata/audio is getting cached in GUN and in this case is wrong.\n if (o.metadata && o.metadata.thumbnaillinks && o.metadata.thumbnaillinks.find(t => t.includes('ipfs/zb2'))) {\n throw new errors.TransportError(\"GUN retrieving legacy data at: \"+url.href)\n }\n return o;\n }\n\n\n // ===== LISTS ========\n\n // noinspection JSCheckFunctionSignatures\n async p_rawlist(url) {\n /*\n Fetch all the objects in a list, these are identified by the url of the public key used for signing.\n (Note this is the 'signedby' parameter of the p_rawadd call, not the 'url' parameter\n Returns a promise that resolves to the list.\n Each item of the list is a dict: {\"url\": url, \"date\": date, \"signature\": signature, \"signedby\": signedby}\n List items may have other data (e.g. reference ids of underlying transport)\n\n :param string url: String with the url that identifies the list.\n :resolve array: An array of objects as stored on the list.\n */\n try {\n let g = this.connection(url);\n let data = await this._p_once(g);\n let res = data ? Object.keys(data).filter(k => k !== '_').sort().map(k => data[k]) : []; //See WORKAROUND-GUN-UNDERSCORE\n // .filter((obj) => (obj.signedby.includes(url))); // upper layers verify, which filters\n debuggun(\"p_rawlist found\", ...utils.consolearr(res));\n return res;\n } catch(err) {\n // Will be logged by Transports\n throw(err);\n }\n }\n\n listmonitor(url, callback, {current=false}={}) {\n /*\n Setup a callback called whenever an item is added to a list, typically it would be called immediately after a p_rawlist to get any more items not returned by p_rawlist.\n\n url: string Identifier of list (as used by p_rawlist and \"signedby\" parameter of p_rawadd\n callback: function(obj) Callback for each new item added to the list\n obj is same format as p_rawlist or p_rawreverse\n current true if should send list of existing elements\n */\n let g = this.connection(url);\n if (!current) { // See WORKAROUND-GUN-CURRENT have to keep an extra copy to compare for which calls are new.\n g.once(data => {\n this.monitored = data ? Object.keys(data) : []; // Keep a copy - could actually just keep high water mark unless getting partial knowledge of state of array.\n g.map().on((v, k) => {\n if (!(this.monitored.includes(k)) && (k !== '_')) { //See WORKAROUND-GUN-UNDERSCORE\n this.monitored.push(k);\n callback(JSON.parse(v));\n }\n });\n });\n } else {\n g.map().on((v, k) => callback(\"set\", k, JSON.parse(v)));\n }\n }\n\n // noinspection JSCheckFunctionSignatures\n async p_rawadd(url, sig) {\n /*\n Store a new list item, it should be stored so that it can be retrieved either by \"signedby\" (using p_rawlist) or\n by \"url\" (with p_rawreverse). The underlying transport does not need to guarantee the signature,\n an invalid item on a list should be rejected on higher layers.\n\n :param string url: String identifying list to post to\n :param Signature sig: Signature object containing at least:\n date - date of signing in ISO format,\n urls - array of urls for the object being signed\n signature - verifiable signature of date+urls\n signedby - urls of public key used for the signature\n :resolve undefined:\n */\n // noinspection JSUnresolvedVariable\n // Logged by Transports\n console.assert(url && sig.urls.length && sig.signature && sig.signedby.length, \"TransportGUN.p_rawadd args\", url, sig);\n this.connection(url)\n .set( stringify( sig.preflight( Object.assign({}, sig))));\n }\n\n // noinspection JSCheckFunctionSignatures\n async p_newlisturls(cl) {\n let u = await this._p_newgun(cl);\n return [ u, u];\n }\n\n //=======KEY VALUE TABLES ========\n\n // noinspection JSMethodCanBeStatic\n async _p_newgun(pubkey) {\n if (pubkey.hasOwnProperty(\"keypair\"))\n pubkey = pubkey.keypair.signingexport();\n // By this point pubkey should be an export of a public key of form xyz:abc where xyz\n // specifies the type of public key (NACL VERIFY being the only kind we expect currently)\n return `gun:/gun/${encodeURIComponent(pubkey)}`;\n }\n async p_newdatabase(pubkey) {\n /*\n Request a new database\n For GUN it doesnt actually create anything, just generates the URLs\n TODO-GUN simple version first - userid based on my keypair first, then switch to Gun's userid and its keypair\n Include gun/sea.js; user.create(<alias>,<passphrase>); user.auth(<alias>,<passphrase>); # See gun.eco/docs/Auth\n\n returns: {publicurl: \"gun:/gun/<publickey>\", privateurl: \"gun:/gun/<publickey>\">\n */\n let u = await this._p_newgun(pubkey);\n return {publicurl: u, privateurl: u};\n }\n\n async p_newtable(pubkey, table) {\n /*\n Request a new table\n For GUN it doesnt actually create anything, just generates the URLs\n\n returns: {publicurl: \"gun:/gun/<publickey>/<table>\", privateurl: \"gun:/gun/<publickey>/<table>\">\n */\n if (!pubkey) throw new errors.CodingError(\"p_newtable currently requires a pubkey\");\n let database = await this.p_newdatabase(pubkey);\n // If have use cases without a database, then call p_newdatabase first\n return { privateurl: `${database.privateurl}/${table}`, publicurl: `${database.publicurl}/${table}`} // No action required to create it\n }\n\n async p_set(url, keyvalues, value) { // url = yjs:/yjs/database/table\n /*\n Set key values\n keyvalues: string (key) in which case value should be set there OR\n object in which case value is ignored\n */\n let table = this.connection(url);\n if (typeof keyvalues === \"string\") {\n table.path(keyvalues).put(stringify(value));\n } else {\n // Store all key-value pairs without destroying any other key/value pairs previously set\n console.assert(!Array.isArray(keyvalues), \"TransportGUN - shouldnt be passsing an array as the keyvalues\");\n table.put(\n Object.keys(keyvalues).reduce(\n function(previous, key) { previous[key] = stringify(keyvalues[key]); return previous; },\n {}\n ))\n }\n }\n\n async p_get(url, keys) {\n let table = this.connection(url);\n if (Array.isArray(keys)) {\n throw new errors.ToBeImplementedError(\"p_get(url, [keys]) isn't supported - because of ambiguity better to explicitly loop on set of keys or use getall and filter\");\n /*\n return keys.reduce(function(previous, key) {\n let val = table.get(key);\n previous[key] = typeof val === \"string\" ? JSON.parse(val) : val; // Handle undefined\n return previous;\n }, {});\n */\n } else {\n let val = await this._p_once(table.get(keys)); // Resolves to value\n return typeof val === \"string\" ? JSON.parse(val) : val; // This looks like it is sync (see same code on p_get and p_rawfetch)\n }\n }\n\n async p_delete(url, keys) {\n let table = this.connection(url);\n if (typeof keys === \"string\") {\n table.path(keys).put(null);\n } else {\n keys.map((key) => table.path(key).put(null)); // This looks like it is sync\n }\n }\n\n //WORKAROUND-GUN-PROMISE suggest p_once as a good single addition\n //TODO-GUN expand this to workaround Gun weirdness with errors.\n _p_once(gun) { // Note in some cases (e.g. p_getall) this will resolve to a object, others a string/number (p_get)\n // TODO-GUN Temporarily added a 2000ms delay to workaround https://github.com/internetarchive/dweb-archive/issues/106 / https://github.com/amark/gun/issues/762\n return new Promise((resolve) => gun.once(resolve, {wait: 2000}));\n }\n\n async p_keys(url) {\n let res = await this._p_once(this.connection(url));\n return Object.keys(res)\n .filter(k=> (k !== '_') && (res[k] !== null)); //See WORKAROUND-GUN-UNDERSCORE and WORKAROUND-GUN-DELETE\n }\n\n async p_getall(url) {\n let res = await this._p_once(this.connection(url));\n return Object.keys(res)\n .filter(k=> (k !== '_') && res[k] !== null) //See WORKAROUND-GUN-UNDERSCORE and WORKAROUND-GUN-DELETE\n .reduce( function(previous, key) { previous[key] = JSON.parse(res[key]); return previous; }, {});\n }\n\n async monitor(url, callback, {current=false}={}) {\n /*\n Setup a callback called whenever an item is added to a list, typically it would be called immediately after a p_getall to get any more items not returned by p_getall.\n Stack: KVT()|KVT.p_new => KVT.monitor => (a: Transports.monitor => GUN.monitor)(b: dispatchEvent)\n\n url: string Identifier of list (as used by p_rawlist and \"signedby\" parameter of p_rawadd\n callback: function({type, key, value}) Callback for each new item added to the list (type = \"set\"|\"delete\")\n current Send existing items to the callback as well\n */\n let g = this.connection(url);\n if (!current) { // See WORKAROUND-GUN-CURRENT have to keep an extra copy to compare for which calls are new.\n g.once(data => {\n this.monitored = Object.assign({},data); // Make a copy of data (this.monitored = data won't work as just points at same structure)\n g.map().on((v, k) => {\n if ((v !== this.monitored[k]) && (k !== '_')) { //See WORKAROUND-GUN-UNDERSCORE\n this.monitored[k] = v;\n callback(\"set\", k, JSON.parse(v));\n }\n });\n });\n } else {\n g.map().on((v, k) => callback(\"set\", k, JSON.parse(v)));\n }\n }\n\n static async p_test() {\n debuggun(\"p_test\");\n try {\n let t = this.setup0({}); //TODO-GUN when works with peers commented out, try passing peers: []\n await t.p_setup1(); // Not passing cb yet\n await t.p_setup2(); // Not passing cb yet - this one does nothing on GUN\n // noinspection JSIgnoredPromiseFromCall\n t.p_test_kvt(\"gun:/gun/NACL\");\n //t.p_test_list(\"gun:/gun/NACL\"); //TODO test_list needs fixing to not create a dependency on Signature\n } catch(err) {\n console.warn(\"Exception thrown in TransportGUN.test:\", err.message);\n throw err;\n }\n }\n\n // noinspection JSUnusedGlobalSymbols\n static async demo_bugs() {\n let gun = new Gun();\n gun.get('foo').get('bar').put('baz');\n console.log(\"Expect {bar: 'baz'} but get {_:..., bar: 'baz'}\");\n gun.get('foo').once(data => console.log(data));\n gun.get('zip').get('bar').set('alice');\n console.log(\"Expect {12345: 'alice'} but get {_:..., 12345: 'alice'}\");\n gun.get('foo').once(data => console.log(data));\n // Returns extra \"_\" field\n }\n}\nTransports._transportclasses[\"GUN\"] = TransportGUN;\nexports = module.exports = TransportGUN;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./TransportGUN.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./TransportHTTP.js":
|
||
/*!**************************!*\
|
||
!*** ./TransportHTTP.js ***!
|
||
\**************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const Transport = __webpack_require__(/*! ./Transport */ \"./Transport.js\"); // Base class for TransportXyz\nconst Transports = __webpack_require__(/*! ./Transports */ \"./Transports.js\"); // Manage all Transports that are loaded\nconst httptools = __webpack_require__(/*! ./httptools */ \"./httptools.js\"); // Expose some of the httptools so that IPFS can use it as a backup\nconst Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:http');\nconst stringify = __webpack_require__(/*! canonical-json */ \"./node_modules/canonical-json/index.js\");\n\n\ndefaulthttpoptions = {\n urlbase: 'https://dweb.me',\n heartbeat: { delay: 30000 } // By default check twice a minute\n};\n\nservercommands = { // What the server wants to see to return each of these\n rawfetch: \"contenthash\", // was content/rawfetch which should still work.\n rawstore: \"contenturl/rawstore\",\n rawadd: \"void/rawadd\",\n rawlist: \"metadata/rawlist\",\n get: \"get/table\",\n set: \"set/table\",\n delete: \"delete/table\",\n keys: \"keys/table\",\n getall: \"getall/table\"\n};\n\n\nclass TransportHTTP extends Transport {\n /* Subclass of Transport for handling HTTP - see API.md for docs\n\n options {\n urlbase: e.g. https://dweb.me Where to go for URLS like /arc/...\n heartbeat: {\n delay // Time in milliseconds between checks - 30000 might be appropriate - if missing it wont do a heartbeat\n statusCB // Callback cb(transport) when status changes\n }\n }\n */\n\n constructor(options) {\n super(options); // These are now options.http\n this.options = options;\n this.urlbase = options.urlbase; // e.g. https://dweb.me\n this.supportURLs = ['contenthash', 'http','https'];\n this.supportFunctions = ['fetch', 'store', 'add', 'list', 'reverse', 'newlisturls', \"get\", \"set\", \"keys\", \"getall\", \"delete\", \"newtable\", \"newdatabase\"]; //Does not support: listmonitor - reverse is disabled somewhere not sure if here or caller\n this.supportFeatures = ['noCache'];\n if (typeof window === \"undefined\") {\n // running in node, can support createReadStream, (browser can't - see createReadStream below)\n this.supportFunctions.push(\"createReadStream\");\n }\n // noinspection JSUnusedGlobalSymbols\n this.supportFeatures = ['fetch.range', 'noCache'];\n this.name = \"HTTP\"; // For console log etc\n this.status = Transport.STATUS_LOADED;\n }\n\n //TODO-SPLIT define load()\n\n static setup0(options) {\n let combinedoptions = Transport.mergeoptions(defaulthttpoptions, options.http);\n try {\n let t = new TransportHTTP(combinedoptions);\n Transports.addtransport(t);\n return t;\n } catch (err) {\n console.error(\"HTTP unable to setup0\", err.message);\n throw err;\n }\n }\n\n p_setup1(statusCB) {\n return new Promise((resolve, unusedReject) => {\n this.status = Transport.STATUS_STARTING;\n if (statusCB) statusCB(this);\n this.updateStatus((unusedErr, unusedRes) => {\n if (statusCB) statusCB(this);\n this.startHeartbeat(this.options.heartbeat);\n resolve(this); // Note always resolve even if error from p_status as have set status to failed\n });\n })\n }\n\n async p_status(cb) { //TODO-API\n /*\n Return (via cb or promise) a numeric code for the status of a transport.\n */\n if (cb) { try { this.updateStatus(cb) } catch(err) { cb(err)}} else { return new Promise((resolve, reject) => { try { this.updateStatus((err, res) => { if (err) {reject(err)} else {resolve(res)} })} catch(err) {reject(err)}})} // Promisify pattern v2f\n }\n updateStatus(cb) { //TODO-API\n this.updateInfo((err, res) => {\n if (err) {\n debug(\"Error status call to info failed %s\", err.message);\n this.status = Transport.STATUS_FAILED;\n cb(null, this.status); // DOnt pass error up, the status indicates the error\n } else {\n this.info = res; // Save result\n this.status = Transport.STATUS_CONNECTED;\n cb(null, this.status);\n }\n });\n }\n\n startHeartbeat({delay=undefined, statusCB=undefined}) {\n if (delay) {\n debug(\"HTTP Starting Heartbeat\")\n this.HTTPheartbeatTimer = setInterval(() => {\n this.updateStatus((err, res)=>{ // Pings server and sets status\n if (statusCB) statusCB(this); // repeatedly call callback if supplies\n }, (unusedErr, unusedRes)=>{}); // Dont wait for status to complete\n }, delay);\n }\n }\n stopHeartbeat() {\n if (this.HTTPheartbeatTimer) {\n debug(\"HTTP stopping heartbeat\");\n clearInterval(this.HTTPheartbeatTimer);}\n }\n stop(refreshstatus, cb) {\n this.stopHeartbeat();\n this.status = Transport.STATUS_FAILED;\n if (refreshstatus) { refreshstatus(this); }\n cb(null, this);\n }\n\n _cmdurl(command) {\n return `${this.urlbase}/${command}`\n }\n _url(url, command, parmstr) {\n if (!url) throw new errors.CodingError(`${command}: requires url`);\n if (typeof url !== \"string\") { url = url.href }\n url = url.replace('contenthash:/contenthash', this._cmdurl(command)) ; // Note leaves http: and https: urls unchanged\n url = url.replace('getall/table', command);\n url = url + (parmstr ? \"?\"+parmstr : \"\");\n return url;\n }\n\n validFor(url, func, opts) {\n // Overrides Transport.prototype.validFor because HTTP's connection test is only really for dweb.me\n // in particular this allows urls like https://be-api.us.archive.org\n return (this.connected() || (url.protocol.startsWith(\"http\") && ! url.href.startsWith(this.urlbase))) && this.supports(url, func, opts);\n }\n // noinspection JSCheckFunctionSignatures\n async p_rawfetch(url, opts={}) {\n /*\n Fetch from underlying transport,\n Fetch is used both for contenthash requests and table as when passed to SmartDict.p_fetch may not know what we have\n url: Of resource - which is turned into the HTTP url in p_httpfetch\n opts: {start, end, retries, noCache} see p_GET for documentation\n throws: TransportError if fails\n */\n //if (!(url && url.includes(':') ))\n // throw new errors.CodingError(\"TransportHTTP.p_rawfetch bad url: \"+url);\n //if (url.href.includes('contenthash//'))\n // console.error(\"XXX@91\", url)\n if (((typeof url === \"string\") ? url : url.href).includes('/getall/table')) {\n throw new Error(\"Probably dont want to be calling p_rawfetch on a KeyValueTable, especially since dont know if its keyvaluetable or subclass\"); //TODO-NAMING\n } else {\n return await httptools.p_GET(this._url(url, servercommands.rawfetch), opts);\n }\n }\n\n p_rawlist(url) {\n // obj being loaded\n // Locate and return a block, based on its url\n if (!url) throw new errors.CodingError(\"TransportHTTP.p_rawlist: requires url\");\n return httptools.p_GET(this._url(url, servercommands.rawlist));\n }\n rawreverse() { throw new errors.ToBeImplementedError(\"Undefined function TransportHTTP.rawreverse\"); }\n\n async p_rawstore(data) {\n /*\n Store data on http server,\n data: string\n resolves to: {string}: url\n throws: TransportError on failure in p_POST > p_httpfetch\n */\n //PY: res = self._sendGetPost(True, \"rawstore\", headers={\"Content-Type\": \"application/octet-stream\"}, urlargs=[], data=data)\n console.assert(data, \"TransportHttp.p_rawstore: requires data\");\n const res = await httptools.p_POST(this._cmdurl(servercommands.rawstore), {data, contenttype: \"application/octet-stream\"}); // resolves to URL\n let parsedurl = Url.parse(res);\n let pathparts = parsedurl.pathname.split('/');\n return `contenthash:/contenthash/${pathparts.slice(-1)}`\n\n }\n\n p_rawadd(url, sig) {\n // Logged by Transports\n if (!url || !sig) throw new errors.CodingError(\"TransportHTTP.p_rawadd: invalid parms\", url, sig);\n const data = stringify(sig.preflight(Object.assign({},sig)))+\"\\n\";\n return httptools.p_POST(this._url(url, servercommands.rawadd), {data, contenttype: \"application/json\"}); // Returns immediately\n }\n\n p_newlisturls(cl) {\n let u = cl._publicurls.map(urlstr => Url.parse(urlstr))\n .find(parsedurl =>\n ((parsedurl.protocol === \"https:\" && [\"gateway.dweb.me\", \"dweb.me\"].includes(parsedurl.host)\n && (parsedurl.pathname.includes('/content/rawfetch') || parsedurl.pathname.includes('/contenthash/')))\n || (parsedurl.protocol === \"contenthash:\") && (parsedurl.pathname.split('/')[1] === \"contenthash\")));\n if (!u) {\n // noinspection JSUnresolvedVariable\n u = `contenthash:/contenthash/${ cl.keypair.verifyexportmultihashsha256_58() }`; // Pretty random, but means same test will generate same list and server is expecting base58 of a hash\n }\n return [u,u];\n }\n\n // ============================== Stream support\n\n /*\n Code disabled until have a chance to test it with <VIDEO> tag etc, problem is that it returns p_createReadStream whch is async\n if need sync, look at WebTorrent and how it buffers through a stream which can be returned immediately\n */\n async p_f_createReadStream(url, {wanturl=false}={}) {\n /*\n Fetch bytes progressively, using a node.js readable stream, based on a url of the form:\n No assumption is made about the data in terms of size or structure.\n\n This is the initialisation step, which returns a function suitable for <VIDEO>\n\n Returns a new Promise that resolves to function for a node.js readable stream.\n\n Node.js readable stream docs: https://nodejs.org/api/stream.html#stream_readable_streams\n\n :param string url: URL of object being retrieved of form magnet:xyzabc/path/to/file (Where xyzabc is the typical magnet uri contents)\n :param boolean wanturl True if want the URL of the stream (for service workers)\n :resolves to: f({start, end}) => stream (The readable stream.)\n :throws: TransportError if url invalid - note this happens immediately, not as a catch in the promise\n */\n //Logged by Transports\n //debug(\"p_f_createreadstream %s\", Url.parse(url).href);\n try {\n let self = this;\n if (wanturl) {\n return url;\n } else {\n return function (opts) { return self.createReadStream(url, opts); };\n }\n } catch(err) {\n //Logged by Transports\n //console.warn(`p_f_createReadStream failed on ${Url.parse(url).href} ${err.message}`);\n throw(err);\n }\n }\n\n createReadStream(url, opts) {\n /*\n The function, encapsulated and inside another function by p_f_createReadStream (see docs)\n NOTE THIS DOESNT WONT WORK FOR <VIDEO> tags, but shouldnt be using it there anyway - reports stream.on an filestream.pipe aren't functions\n\n :param file: Webtorrent \"file\" as returned by webtorrentfindfile\n :param opts: { start: byte to start from; end: optional end byte }\n :returns stream: The readable stream - it is returned immediately, though won't be sending data until the http completes\n */\n // This breaks in browsers ... as 's' doesn't have .pipe but has .pipeTo and .pipeThrough neither of which work with stream.PassThrough\n // TODO See https://github.com/nodejs/readable-stream/issues/406 in case its fixed in which case enable createReadStream in constructor above.\n debug(\"createreadstream %s %o\", Url.parse(url).href, opts);\n let through;\n through = new stream.PassThrough();\n httptools.p_GET(this._url(url, servercommands.rawfetch), Object.assign({wantstream: true}, opts))\n .then(s => s.pipe(through))\n // Note any .catch is happening AFTER through returned\n .catch(err => {\n console.warn(this.name, \"createReadStream caught error\", err.message);\n if (typeof through.destroy === 'function') {\n through.destroy(err); // Will emit error & close and free up resources\n // caller MUST implimit through.on('error', err=>) or will generate uncaught error message\n } else {\n through.emit('error', err);\n }\n });\n return through; // Returns \"through\" synchronously, before the pipe is setup\n }\n\n async p_createReadStream(url, opts) {\n /*\n The function, encapsulated and inside another function by p_f_createReadStream (see docs)\n NOTE THIS PROBABLY WONT WORK FOR <VIDEO> tags, but shouldnt be using it there anyway\n\n :param file: Webtorrent \"file\" as returned by webtorrentfindfile\n :param opts: { start: byte to start from; end: optional end byte }\n :resolves to stream: The readable stream.\n */\n debug(\"createreadstream %s %o\", Url.parse(url).href, opts);\n try {\n return await httptools.p_GET(this._url(url, servercommands.rawfetch), Object.assign({wantstream: true}, opts));\n } catch(err) {\n console.warn(this.name, \"caught error\", err);\n throw err;\n }\n }\n\n\n // ============================== Key Value support\n\n\n // Support for Key-Value pairs as per\n // https://docs.google.com/document/d/1yfmLRqKPxKwB939wIy9sSaa7GKOzM5PrCZ4W1jRGW6M/edit#\n async p_newdatabase(pubkey) {\n //if (pubkey instanceof Dweb.PublicPrivate)\n if (pubkey.hasOwnProperty(\"keypair\"))\n pubkey = pubkey.keypair.signingexport();\n // By this point pubkey should be an export of a public key of form xyz:abc where xyz\n // specifies the type of public key (NACL VERIFY being the only kind we expect currently)\n let u = `${this.urlbase}/getall/table/${encodeURIComponent(pubkey)}`;\n return {\"publicurl\": u, \"privateurl\": u};\n }\n\n\n async p_newtable(pubkey, table) {\n if (!pubkey) throw new errors.CodingError(\"p_newtable currently requires a pubkey\");\n let database = await this.p_newdatabase(pubkey);\n // If have use cases without a database, then call p_newdatabase first\n return { privateurl: `${database.privateurl}/${table}`, publicurl: `${database.publicurl}/${table}`} // No action required to create it\n }\n\n //TODO-KEYVALUE needs signing with private key of list\n async p_set(url, keyvalues, value) { // url = yjs:/yjs/database/table/key\n if (!url || !keyvalues) throw new errors.CodingError(\"TransportHTTP.p_set: invalid parms\", url, keyvalyes);\n // Logged by Transports\n //debug(\"p_set %o %o %o\", url, keyvalues, value);\n if (typeof keyvalues === \"string\") {\n let data = stringify([{key: keyvalues, value: value}]);\n await httptools.p_POST(this._url(url, servercommands.set), {data, contenttype: \"application/json\"}); // Returns immediately\n } else {\n let data = stringify(Object.keys(keyvalues).map((k) => ({\"key\": k, \"value\": keyvalues[k]})));\n await httptools.p_POST(this._url(url, servercommands.set), {data, contenttype: \"application/json\"}); // Returns immediately\n }\n }\n\n _keyparm(key) {\n return `key=${encodeURIComponent(key)}`\n }\n async p_get(url, keys) {\n if (!url && keys) throw new errors.CodingError(\"TransportHTTP.p_get: requires url and at least one key\");\n let parmstr =Array.isArray(keys) ? keys.map(k => this._keyparm(k)).join('&') : this._keyparm(keys);\n const res = await httptools.p_GET(this._url(url, servercommands.get, parmstr));\n return Array.isArray(keys) ? res : res[keys]\n }\n\n async p_delete(url, keys) {\n if (!url && keys) throw new errors.CodingError(\"TransportHTTP.p_get: requires url and at least one key\");\n let parmstr = keys.map(k => this._keyparm(k)).join('&');\n await httptools.p_GET(this._url(url, servercommands.delete, parmstr));\n }\n\n async p_keys(url) {\n if (!url && keys) throw new errors.CodingError(\"TransportHTTP.p_get: requires url and at least one key\");\n return await httptools.p_GET(this._url(url, servercommands.keys));\n }\n async p_getall(url) {\n if (!url && keys) throw new errors.CodingError(\"TransportHTTP.p_get: requires url and at least one key\");\n return await httptools.p_GET(this._url(url, servercommands.getall));\n }\n /* Make sure doesnt shadow regular p_rawfetch\n async p_rawfetch(url) {\n return {\n table: \"keyvaluetable\",\n _map: await this.p_getall(url)\n }; // Data structure is ok as SmartDict.p_fetch will pass to KVT constructor\n }\n */\n\n async p_info() { //TODO-API\n /*\n Return (via cb or promise) a numeric code for the status of a transport.\n */\n return new Promise((resolve, reject) => { try { this.updateInfo((err, res) => { if (err) {reject(err)} else {resolve(res)} })} catch(err) {reject(err)}}) // Promisify pattern v2b (no CB)\n }\n\n updateInfo(cb) {\n httptools.p_GET(`${this.urlbase}/info`, {retries: 1}, cb); // Try info, but dont retry (usually heartbeat will reconnect)\n }\n\n static async p_test(opts={}) {\n {console.log(\"TransportHTTP.test\")}\n try {\n let transport = await this.p_setup(opts);\n console.log(\"HTTP connected\");\n let res = await transport.p_info();\n console.log(\"TransportHTTP info=\",res);\n res = await transport.p_status();\n console.assert(res === Transport.STATUS_CONNECTED);\n await transport.p_test_kvt(\"NACL%20VERIFY\");\n } catch(err) {\n console.log(\"Exception thrown in TransportHTTP.test:\", err.message);\n throw err;\n }\n }\n\n static async test() {\n return this;\n }\n\n}\nTransports._transportclasses[\"HTTP\"] = TransportHTTP;\nexports = module.exports = TransportHTTP;\n\n\n\n//# sourceURL=webpack:///./TransportHTTP.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./TransportIPFS.js":
|
||
/*!**************************!*\
|
||
!*** ./TransportIPFS.js ***!
|
||
\**************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {/*\nThis is a shim to the IPFS library, (Lists are handled in YJS or OrbitDB)\nSee https://github.com/ipfs/js-ipfs but note its often out of date relative to the generic API doc.\n*/\n\n//TODO-IPFS Note API changes in https://github.com/ipfs/js-ipfs/issues/1721 probably all ipfs.files -> ipfs.\n\nconst httptools = __webpack_require__(/*! ./httptools */ \"./httptools.js\"); // Expose some of the httptools so that IPFS can use it as a backup\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:ipfs');\n\n// IPFS components\n//TODO-SPLIT remove this import depend on archive.html or node to pre-load\nlet IPFS\n//IPFS = require('ipfs');\n//TODO-SPLIT remove this import depend on archive.html or node to pre-load\nconst ipfsAPI = __webpack_require__(/*! ipfs-http-client */ \"./node_modules/ipfs-http-client/src/index.js\");\n//TODO-SPLIT looks like can get ths from Ipfs.CID\n//const CID = require('cids');\n//TODO-SPLIT unclear why need unixfs - only appears to be used in test_ipfs.js\n//const unixFs = require('ipfs-unixfs');\n\n// Library packages other than IPFS\nconst Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\"); // Needed for the pullthrough - this is NOT Ipfs streams\n// Alternative to through - as used in WebTorrent\n\n// Utility packages (ours) And one-liners\n//No longer reqd: const promisify = require('promisify-es6');\n//const makepromises = require('./utils/makepromises'); // Replaced by direct call to promisify\n\n// Other Dweb modules\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\nconst Transport = __webpack_require__(/*! ./Transport.js */ \"./Transport.js\"); // Base class for TransportXyz\nconst Transports = __webpack_require__(/*! ./Transports */ \"./Transports.js\"); // Manage all Transports that are loaded\nconst utils = __webpack_require__(/*! ./utils */ \"./utils.js\"); // Utility functions\n\nconst defaultoptions = {\n repo: '/tmp/dweb_ipfsv3107', //TODO-IPFS restarted 2018-10-06 because was caching connection ws-star\n //init: false,\n //start: false,\n //TODO-IPFS-Q how is this decentralized - can it run offline? Does it depend on star-signal.cloud.ipfs.team\n config: {\n // Addresses: { Swarm: [ '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star']}, // For Y - same as defaults\n // Addresses: { Swarm: [ ] }, // Disable WebRTC to test browser crash, note disables Y so doesnt work.\n //Addresses: {Swarm: ['/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star']}, // from https://github.com/ipfs/js-ipfs#faq 2017-12-05 as alternative to webrtc works sort-of\n //Bootstrap: ['/dns4/dweb.me/tcp/4245/wss/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'], // Connect via WSS to IPFS instance at IA on FnF\n Bootstrap: ['/dns4/dweb.me/tcp/4245/wss/ipfs/QmQz3p44VVQDeAieaW28DMjcTVzLbpxqaQB9bkXnyd7HY5'], // Connect via WSS to IPFS instance in Kube at IA\n // Previously was: QmQ921MRjsbP12fHSEDcdFeuHFg6qKDFurm2rXgA5K3RQD on kube\n },\n //init: true, // Comment out for Y\n EXPERIMENTAL: { pubsub: true },\n preload: { enabled: false },\n //Off by default, it never seems to have the content (routing issues) pass as an argument if want to use\n //httpIPFSgateway: \"https://ipfs.io\",\n};\n\nclass TransportIPFS extends Transport {\n /*\n IPFS specific transport\n\n Fields:\n ipfs: object returned when starting IPFS\n */\n\n constructor(options) {\n super(options);\n [ \"urlUrlstore\", \"httpIPFSgateway\"].forEach(k => {\n this[k] = options[k];\n delete options[k];\n });\n this.ipfs = undefined; // Undefined till start IPFS\n this.options = options; // Dictionary of options\n this.name = \"IPFS\"; // For console log etc\n this.supportURLs = ['ipfs'];\n this.supportFunctions = ['fetch', 'store', 'seed', 'createReadStream']; // Does not support reverse\n this.supportFeatures = ['noCache']; // Note doesnt actually support noCache, but immutable is same\n this.status = Transport.STATUS_LOADED;\n }\n\n _ipfsversion(ipfs, s, cb) {\n ipfs.version((err, data) => {\n if (err) {\n debug(\"IPFS via %s present but unresponsive: %o\", s, data);\n this.ipfstype = \"FAILED\";\n cb(err);\n } else {\n debug(\"IPFS available via %s: %o\", s, data);\n this.ipfstype = s;\n cb(null, ipfs);\n }\n });\n }\n IPFSAutoConnect(cb) {\n if (global.Ipfs) {\n IPFS = global.Ipfs; //Loaded by <script etc but still need a create\n } else if (window.Ipfs) {\n IPFS = window.Ipfs; //Loaded by <script etc but still need a create\n }\n //TODO-SPLIT I think next few lines are wrong, dont think I've seen global.ipfs or window.ipfs but\n //TODO-SPLIT https://github.com/ipfs/js-ipfs implies global.Ipfs but needs a \"create\" or \"new\"\n if (global.ipfs) {\n this._ipfsversion(global.ipfs, \"global.ipfs\", cb );\n } else if (typeof window !== \"undefined\" && window.ipfs) {\n this._ipfsversion(window.ipfs, \"window.ipfs\", cb);\n } else {\n // noinspection ES6ConvertVarToLetConst\n var ipfs = ipfsAPI('localhost', '5001', {protocol: 'http'}); // leaving out the arguments will default to these values\n ipfs.version((err, data) => {\n if (err) {\n debug(\"IPFS via API failed %s, trying running own IPFS client\", err.message);\n ipfs = new IPFS(this.options);\n ipfs.on('ready', () => {\n this._ipfsversion(ipfs, \"client\", cb);\n }); // This only works in the client version, not on API\n ipfs.on('error', (err) => {\n debug(\"IPFS via client error %s\", err.message); // Calls error, note this could be a problem if it gets errors after \"ready\"\n cb(err);\n }) // This only works in the client version, not on API\n } else {\n\n this._ipfsversion(ipfs, \"API\", cb); // Note wastes an extra ipfs.version call but that's cheap\n }\n });\n }\n }\n\n /*OBS\n p_ipfsstart() {\n /-*\n Just start IPFS - not Y (note used with \"yarrays\" and will be used for non-IPFS list management)\n Note - can't figure out how to use async with this, as we resolve the promise based on the event callback\n *-/\n const self = this;\n return new Promise((resolve, reject) => {\n this.ipfs = new IPFS(this.options);\n this.ipfs.on('ready', () => {\n //this._makepromises();\n resolve();\n });\n this.ipfs.on('error', (err) => reject(err));\n })\n .then(() => self.ipfs.version())\n .then((version) => debug('ready %o',version))\n .catch((err) => {\n console.warn(\"IPFS p_ipfsstart failed\", err.message);\n throw(err);\n });\n }\n */\n\n //TODO-SPLIT define load()\n\n static setup0(options) {\n /*\n First part of setup, create obj, add to Transports but dont attempt to connect, typically called instead of p_setup if want to parallelize connections.\n */\n const combinedoptions = Transport.mergeoptions(defaultoptions, options.ipfs);\n debug(\"setup options=%o\", combinedoptions);\n const t = new TransportIPFS(combinedoptions); // Note doesnt start IPFS\n Transports.addtransport(t);\n return t;\n }\n\n p_setup1(cbstatus, cb) {\n /* Start IPFS connection\n cbstatus function(this), for updating status, it must be ale to be called multiple times.\n returns this via cb(err,res) or promise\n errors This should never \"fail\" as it will break the Promise.all, it should return \"this\" but set this.status = Transport.STATUS_FAILED\n */\n\n if (cb) { try { f.call(this, cb) } catch(err) { cb(err)}} else { return new Promise((resolve, reject) => { try { f.call(this, (err, res) => { if (err) {reject(err)} else {resolve(res)} })} catch(err) {reject(err)}})} // Promisify pattern v2\n function f(cb) {\n // Logged by Transports\n this.status = Transport.STATUS_STARTING; // Should display, but probably not refreshed in most case\n if (cbstatus) cbstatus(this);\n this.IPFSAutoConnect((err, ipfs) => { // Various errors possible inc websocket\n if (err) {\n debug(\"Failed to connect %s\", err.message);\n this.status = Transport.STATUS_FAILED;\n } else {\n this.ipfs = ipfs;\n this.status = Transport.STATUS_CONNECTED;\n }\n if (cbstatus) cbstatus(this);\n cb(null, this); // Don't fail, report the error and set statust to Transport.STATUS_FAILED\n })\n }\n }\n\n p_setup2(refreshstatus) {\n if (this.status === Transport.STATUS_FAILED) {\n debug(\"Stage 1 failed, skipping\");\n }\n return this;\n }\n\n stop(refreshstatus, cb) { //TODO-API p_stop > stop\n if (this.ipfstype === \"client\") {\n this.ipfs.stop((err, res) => {\n this.status = Transport.STATUS_FAILED;\n if (refreshstatus) refreshstatus(this);\n cb(err, res);\n });\n } else {\n // We didn't start it, don't try and stop it\n this.status = Transport.STATUS_FAILED;\n if (refreshstatus) refreshstatus(this);\n cb(miull, this);\n }\n }\n async p_status() {\n /*\n Return a numeric code for the status of a transport.\n TODO - this no longer works if using the http api\n */\n this.status = (await this.ipfs.isOnline()) ? Transport.STATUS_CONNECTED : Transport.STATUS_FAILED;\n return super.p_status();\n }\n\n // Everything else - unless documented here - should be opaque to the actual structure of a CID\n // or a url. This code may change as its not clear (from IPFS docs) if this is the right mapping.\n static urlFrom(unknown) {\n /*\n Convert a CID into a standardised URL e.g. ipfs:/ipfs/abc123\n */\n if (unknown instanceof IPFS.CID) //TODO-SPLIT - I think there is a way to get this from a types array\n return \"ipfs:/ipfs/\"+unknown.toBaseEncodedString();\n if (typeof unknown === \"object\" && unknown.hash) // e.g. from files.add\n return \"ipfs:/ipfs/\"+unknown.hash;\n if (typeof unknown === \"string\") // Not used currently\n return \"ipfs:/ipfs/\"+unknown;\n throw new errors.CodingError(\"TransportIPFS.urlFrom: Cant convert to url from\",unknown);\n }\n\n static cidFrom(url) {\n /*\n Convert a URL e.g. ipfs:/ipfs/abc123 into a CID structure suitable for retrieval\n url: String of form \"ipfs://ipfs/<hash>\" or parsed URL or CID\n returns: CID\n throws: TransportError if cant convert\n */\n if (url instanceof IPFS.CID) return url;\n if (typeof(url) === \"string\") url = Url.parse(url);\n if (url && url[\"pathname\"]) { // On browser \"instanceof Url\" isn't valid)\n const patharr = url.pathname.split('/');\n if ((![\"ipfs:\",\"dweb:\"].includes(url.protocol)) || (patharr[1] !== 'ipfs') || (patharr.length < 3))\n throw new errors.TransportError(\"TransportIPFS.cidFrom bad format for url should be dweb: or ipfs:/ipfs/...: \" + url.href);\n if (patharr.length > 3)\n throw new errors.TransportError(\"TransportIPFS.cidFrom not supporting paths in url yet, should be dweb: or ipfs:/ipfs/...: \" + url.href);\n return new IPFS.CID(patharr[2]);\n } else {\n throw new errors.CodingError(\"TransportIPFS.cidFrom: Cant convert url\", url);\n }\n }\n\n static _stringFrom(url) {\n // Tool for ipfsFrom and ipfsGatewayFrom\n if (url instanceof IPFS.CID)\n return \"/ipfs/\"+url.toBaseEncodedString();\n if (typeof url === 'object' && url.path) { // It better be URL which unfortunately is hard to test\n return url.path;\n }\n }\n static ipfsFrom(url) {\n /*\n Convert to a ipfspath i.e. /ipfs/Qm....\n Required because of strange differences in APIs between files.cat and dag.get see https://github.com/ipfs/js-ipfs/issues/1229\n */\n url = this._stringFrom(url); // Convert CID or Url to a string hopefully containing /ipfs/\n if (url.indexOf('/ipfs/') > -1) {\n return url.slice(url.indexOf('/ipfs/'));\n }\n throw new errors.CodingError(`TransportIPFS.ipfsFrom: Cant convert url ${url} into a path starting /ipfs/`);\n }\n\n ipfsGatewayFrom(url) {\n /*\n url: CID, Url, or a string\n returns: https://ipfs.io/ipfs/<cid>\n */\n url = this._stringFrom(url); // Convert CID or Url to a string hopefully containing /ipfs/\n if (url.indexOf('/ipfs/') > -1) {\n return this.httpIPFSgateway + url.slice(url.indexOf('/ipfs/'));\n }\n throw new errors.CodingError(`TransportIPFS.ipfsGatewayFrom: Cant convert url ${url} into a path starting /ipfs/`);\n }\n\n static multihashFrom(url) {\n if (url instanceof IPFS.CID)\n return url.toBaseEncodedString();\n if (typeof url === 'object' && url.path)\n url = url.path; // /ipfs/Q...\n if (typeof(url) === \"string\") {\n const idx = url.indexOf(\"/ipfs/\");\n if (idx > -1) {\n return url.slice(idx+6);\n }\n }\n throw new errors.CodingError(`Cant turn ${url} into a multihash`);\n }\n\n // noinspection JSCheckFunctionSignatures\n async p_rawfetch(url, {timeoutMS=60000, relay=false}={}) {\n /*\n Fetch some bytes based on a url of the form ipfs:/ipfs/Qm..... or ipfs:/ipfs/z.... .\n No assumption is made about the data in terms of size or structure, nor can we know whether it was created with dag.put or ipfs add or http /api/v0/add/\n\n Where required by the underlying transport it should retrieve a number if its \"blocks\" and concatenate them.\n Returns a new Promise that resolves currently to a string.\n There may also be need for a streaming version of this call, at this point undefined since we havent (currently) got a use case..\n\n :param string url: URL of object being retrieved {ipfs|dweb}:/ipfs/<cid> or /\n :resolve buffer: Return the object being fetched. (may in the future return a stream and buffer externally)\n :throws: TransportError if url invalid - note this happens immediately, not as a catch in the promise\n */\n // Attempt logged by Transports\n if (!url) throw new errors.CodingError(\"TransportIPFS.p_rawfetch: requires url\");\n const cid = TransportIPFS.cidFrom(url); // Throws TransportError if url bad\n const ipfspath = TransportIPFS.ipfsFrom(url); // Need because dag.get has different requirement than file.cat\n\n try {\n const res = await utils.p_timeout(this.ipfs.dag.get(cid), timeoutMS, \"Timed out IPFS fetch of \"+TransportIPFS._stringFrom(cid)); // Will reject and throw TimeoutError if times out\n // noinspection Annotator\n if (res.remainderPath.length)\n { // noinspection ExceptionCaughtLocallyJS\n throw new errors.TransportError(\"Not yet supporting paths in p_rawfetch\");\n }\n let buff;\n if (res.value.constructor.name === \"DAGNode\") { // Kludge to replace above, as its not matching the type against the \"require\" above.\n // We retrieved a DAGNode, call files.cat (the node will come from the cache quickly)\n buff = await this.ipfs.cat(ipfspath); //See js-ipfs v0.27 version and https://github.com/ipfs/js-ipfs/issues/1229 and https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/FILES.md#cat\n } else { //c: not a file\n debug(\"Found a raw IPFS block (unusual) - not a DAGNode - handling as such\");\n buff = res.value;\n }\n // Success logged by Transports\n return buff;\n } catch (err) { // TimeoutError or could be some other error from IPFS etc\n debug(\"Caught error '%s' fetching via IPFS\", err.message);\n if (!this.httpIPFSgateway) {\n throw(err);\n } else {\n try {\n debug(\"Trying IPFS HTTP gateway\");\n let ipfsurl = this.ipfsGatewayFrom(url);\n return await utils.p_timeout(\n httptools.p_GET(ipfsurl), // Returns a buffer\n timeoutMS, \"Timed out IPFS fetch of \"+ipfsurl)\n } catch (err) {\n // Failure logged by Transports:\n //debug(\"Failed to retrieve from gateway: %s\", err.message);\n throw err;\n }\n }\n }\n }\n\n async p_rawstore(data) {\n /*\n Store a blob of data onto the decentralised transport.\n Returns a promise that resolves to the url of the data\n\n :param string|Buffer data: Data to store - no assumptions made to size or content\n :resolve string: url of data stored\n */\n console.assert(data, \"TransportIPFS.p_rawstore: requires data\");\n const buf = (data instanceof Buffer) ? data : new Buffer(data);\n const res = (await this.ipfs.add(buf,{ \"cid-version\": 1, hashAlg: 'sha2-256'}))[0];\n return TransportIPFS.urlFrom(res);\n }\n\n seed({directoryPath=undefined, fileRelativePath=undefined, ipfsHash=undefined, urlToFile=undefined}, cb) {\n /* Note always passed a cb by Transports.seed - no need to support Promise here\n ipfsHash: IPFS hash if known (usually not known)\n urlToFile: Where the IPFS server can get the file - must be live before this called as will fetch and hash\n TODO support directoryPath/fileRelativePath, but to working around IPFS limitation in https://github.com/ipfs/go-ipfs/issues/4224 will need to check relative to IPFS home, and if not symlink it and add symlink\n TODO maybe support adding raw data (using add)\n\n Note neither js-ipfs-http-client nor js-ipfs appear to support urlstore yet, see https://github.com/ipfs/js-ipfs-http-client/issues/969\n */\n // This is the URL that the IPFS server uses to get the file from the local mirrorHttp\n if (!(this.urlUrlstore && urlToFile)) { // Not doing IPFS\n debug(\"IPFS.seed support requires urlUrlstore and urlToFile\"); // Report, though Transports.seed currently ignores this\n cb(new Error(\"IPFS.seed support requires urlUrlstore and urlToFile\")); // Report, though Transports.seed currently ignores this\n } else {\n // Building by hand becase of lack of support in js-ipfs-http-client\n const url = `${this.urlUrlstore}?arg=${encodeURIComponent(urlToFile)}`;\n // Have to be careful to avoid loops, the call to addIPFS should only be after file is retrieved and cached, and then addIPFS shouldnt be called if already cached\n httptools.p_GET(url, {retries:0}, (err, res) => {\n if (err) {\n debug(\"IPFS.seed for %s failed in http: %s\", urlToFile, err.message);\n cb(err); // Note error currently ignored in Transports\n } else {\n debug(\"Added %s to IPFS key=\", urlToFile, res.Key);\n // Check for mismatch - this isn't an error, for example it could be an updated file, old IPFS hash will now fail, but is out of date and shouldnt be shared\n if (ipfsHash && ipfsHash !== res.Key) { debug(\"ipfs hash doesnt match expected metadata has %s daemon returned %s\", ipfsHash, res.Key); }\n cb(null, res)\n }\n })\n }\n }\n async p_f_createReadStream(url, {wanturl=false}={}) {\n /*\n Fetch bytes progressively, using a node.js readable stream, based on a url of the form:\n No assumption is made about the data in terms of size or structure.\n\n This is the initialisation step, which returns a function suitable for <VIDEO>\n\n Returns a new Promise that resolves to function for a node.js readable stream.\n\n Node.js readable stream docs: https://nodejs.org/api/stream.html#stream_readable_streams\n\n :param string url: URL of object being retrieved of form:\n magnet:xyzabc/path/to/file (Where xyzabc is the typical magnet uri contents)\n ipfs:/ipfs/Q123\n :param boolean wanturl True if want the URL of the stream (for service workers)\n :resolves to: f({start, end}) => stream (The readable stream.)\n :throws: TransportError if url invalid - note this happens immediately, not as a catch in the promise\n */\n // Logged by Transports;\n //debug(\"p_f_createreadstream %o\", url);\n let stream;\n try {\n let multihash = url.pathname.split('/ipfs/')[1];\n if (multihash.includes('/'))\n { // noinspection ExceptionCaughtLocallyJS\n throw new CodingError(\"Should not be seeing URLS with a path here:\"+url);\n }\n let self = this;\n if (wanturl) { // In ServiceWorker\n return url;\n } else {\n return function createReadStream(opts) {\n /*\n The function, encapsulated and inside another function by p_f_createReadStream (see docs)\n :param opts: { start: byte to start from; end: optional end byte }\n :returns stream: The readable stream.\n FOR IPFS this is copied and adapted from git repo js-ipfs/examples/browser-readablestream/index.js\n */\n debug(\"reading from stream %o %o\", multihash, opts || \"\" );\n\n const start = opts ? opts.start : 0;\n // The videostream library does not always pass an end byte but when\n // it does, it wants bytes between start & end inclusive.\n // catReadableStream returns the bytes exclusive so increment the end\n // byte if it's been requested\n const end = (opts && opts.end) ? start + opts.end + 1 : undefined;\n // If we've streamed before, clean up the existing stream\n if (stream && stream.destroy) {\n stream.destroy()\n }\n\n // This stream will contain the requested bytes\n\n // For debugging used a known good IPFS video\n //let fakehash=\"QmedXJYwvNSJFRMVFuJt7BfCMcJwPoqJgqN3U2MYxHET5a\"\n //console.log(\"XXX@IPFS.p_f_createReadStream faking call to\",multihash, \"with\", fakehash)\n //multihash=fakehash;\n stream = self.ipfs.catReadableStream(multihash, {\n offset: start,\n length: end && end - start\n });\n // Log error messages\n\n stream.on('error', (err) => console.error(err));\n\n /* Gimmick from example :-)\n if (start === 0) {\n // Show the user some messages while we wait for the data stream to start\n statusMessages(stream, log)\n }\n */\n return stream\n };\n }\n } catch(err) {\n if (stream && stream.destroy) {\n stream.destroy()\n }\n // Error logged by Transports\n //console.log(`p_f_createReadStream failed on ${url} ${err.message}`);\n throw(err);\n }\n }\n\n static async p_test(opts) {\n {console.log(\"TransportIPFS.test\")}\n try {\n const transport = await this.p_setup(opts); // Assumes IPFS already setup\n console.log(transport.name,\"setup\");\n const res = await transport.p_status();\n console.assert(res === Transport.STATUS_CONNECTED);\n\n let urlqbf;\n const qbf = \"The quick brown fox\";\n const qbf_url = \"ipfs:/ipfs/zdpuAscRnisRkYnEyJAp1LydQ3po25rCEDPPEDMymYRfN1yPK\"; // Expected url\n const testurl = \"1114\"; // Just a predictable number can work with\n const url = await transport.p_rawstore(qbf);\n console.log(\"rawstore returned\", url);\n const newcid = TransportIPFS.cidFrom(url); // Its a CID which has a buffer in it\n console.assert(url === qbf_url, \"url should match url from rawstore\");\n const cidmultihash = url.split('/')[2]; // Store cid from first block in form of multihash\n const newurl = TransportIPFS.urlFrom(newcid);\n console.assert(url === newurl, \"Should round trip\");\n urlqbf = url;\n const data = await transport.p_rawfetch(urlqbf);\n console.assert(data.toString() === qbf, \"Should fetch block stored above\");\n //console.log(\"TransportIPFS test complete\");\n return transport\n } catch(err) {\n console.log(\"Exception thrown in TransportIPFS.test:\", err.message);\n throw err;\n }\n }\n\n}\nTransports._transportclasses[\"IPFS\"] = TransportIPFS;\n// noinspection JSUndefinedPropertyAssignment\nexports = module.exports = TransportIPFS;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./TransportIPFS.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./TransportWEBTORRENT.js":
|
||
/*!********************************!*\
|
||
!*** ./TransportWEBTORRENT.js ***!
|
||
\********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\nThis Transport layers builds on WebTorrent\n\nY Lists have listeners and generate events - see docs at ...\n*/\n\n// WebTorrent components\n\nconst WebTorrent = __webpack_require__(/*! webtorrent */ \"./node_modules/webtorrent/index.js\");\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\");\nconst Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nconst path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:webtorrent');\n\n// Other Dweb modules\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\nconst Transport = __webpack_require__(/*! ./Transport.js */ \"./Transport.js\"); // Base class for TransportXyz\nconst Transports = __webpack_require__(/*! ./Transports */ \"./Transports.js\"); // Manage all Transports that are loaded\n\nlet defaultoptions = {\n};\n\nclass TransportWEBTORRENT extends Transport {\n /*\n WebTorrent specific transport\n\n Fields:\n webtorrent: object returned when starting webtorrent\n */\n\n constructor(options) {\n super(options);\n this.webtorrent = undefined; // Undefined till start WebTorrent\n this.options = options; // Dictionary of options\n this.name = \"WEBTORRENT\"; // For console log etc\n this.supportURLs = ['magnet'];\n this.supportFunctions = ['fetch', 'createReadStream', \"seed\"];\n this.supportFeatures = ['noCache']; // Note doesnt actually support noCache, but immutable is same\n this.status = Transport.STATUS_LOADED;\n }\n\n p_webtorrentstart() {\n /*\n Start WebTorrent and wait until for ready.\n */\n let self = this;\n return new Promise((resolve, reject) => {\n this.webtorrent = new WebTorrent(this.options);\n this.webtorrent.once(\"ready\", () => {\n debug(\"ready\");\n resolve();\n });\n this.webtorrent.once(\"error\", (err) => reject(err));\n this.webtorrent.on(\"warning\", (err) => {\n console.warn(\"WebTorrent Torrent WARNING: \" + err.message);\n });\n })\n }\n\n //TODO-SPLIT define load()\n\n static setup0(options) {\n /*\n First part of setup, create obj, add to Transports but dont attempt to connect, typically called instead of p_setup if want to parallelize connections.\n */\n let combinedoptions = Transport.mergeoptions(defaultoptions, options.webtorrent);\n debug(\"setup0: options=%o\", combinedoptions);\n let t = new TransportWEBTORRENT(combinedoptions);\n Transports.addtransport(t);\n\n return t;\n }\n\n async p_setup1(cb) {\n try {\n this.status = Transport.STATUS_STARTING;\n if (cb) cb(this);\n await this.p_webtorrentstart();\n await this.p_status();\n } catch(err) {\n console.error(this.name, \"failed to connect\", err.message);\n this.status = Transport.STATUS_FAILED;\n }\n if (cb) cb(this);\n return this;\n }\n\n stop(refreshstatus, cb) {\n this.webtorrent.destroy((err) => {\n this.status = Transport.STATUS_FAILED;\n if (refreshstatus) refreshstatus(this);\n if (err) {\n debug(\"Webtorrent error during stopping %o\", err);\n } else {\n debug(\"Webtorrent stopped\");\n }\n cb(err, this);\n });\n }\n\n async p_status() {\n /*\n Return a string for the status of a transport. No particular format, but keep it short as it will probably be in a small area of the screen.\n */\n if (this.webtorrent && this.webtorrent.ready) {\n this.status = Transport.STATUS_CONNECTED;\n } else if (this.webtorrent) {\n this.status = Transport.STATUS_STARTING;\n } else {\n this.status = Transport.STATUS_FAILED;\n }\n return super.p_status();\n }\n\n webtorrentparseurl(url) {\n /* Parse a URL\n url: URL as string or already parsed into Url - should start magnet: or in future might support dweb:/magnet/; some other formats might be supported\n returns: torrentid, path\n */\n if (!url) {\n throw new errors.CodingError(\"TransportWEBTORRENT.p_rawfetch: requires url\");\n }\n\n const urlstring = (typeof url === \"string\" ? url : url.href);\n const index = urlstring.indexOf('/');\n\n if (index === -1) {\n throw new errors.CodingError(\"TransportWEBTORRENT.p_rawfetch: invalid url - missing path component. Should look like magnet:xyzabc/path/to/file\");\n }\n\n const torrentId = urlstring.slice(0, index);\n const path = urlstring.slice(index + 1);\n\n return { torrentId, path }\n }\n\n async p_webtorrentadd(torrentId, opts) {\n return new Promise((resolve, reject) => {\n // Check if this torrentId is already added to the webtorrent client\n let torrent = this.webtorrent.get(torrentId);\n\n // If not, then add the torrentId to the torrent client\n if (!torrent) {\n // This can be added in to rewrite a known torrent for example to test a different tracker.\n //let testid = \"magnet:?xt=urn:btih:ELHVM7F4VEOTZQFDHCX7OZXUXKINUIPJ&tr=http%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=http%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&tr=wss%3A%2F%2Ftracker.fastcast.nz&ws=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Fdownload%2F&xs=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Ftorrent%2Fcommute\";\n //let testidnewtrack = \"magnet:?xt=urn:btih:ELHVM7F4VEOTZQFDHCX7OZXUXKINUIPJ&tr=http%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=http%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&tr=wss%3A%2F%2Fdweb.archive.org:6969&ws=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Fdownload%2F&xs=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Ftorrent%2Fcommute\";\n //if (torrentId === testid) torrentId = testidnewtrack;\n torrent = this.webtorrent.add(torrentId, opts);\n\n torrent.once(\"error\", (err) => {\n reject(new errors.TransportError(\"Torrent encountered a fatal error \" + err.message));\n });\n\n torrent.on(\"warning\", (err) => {\n console.warn(\"WebTorrent Torrent WARNING: \" + err.message + \" (\" + torrent.name + \")\");\n });\n }\n\n if (torrent.ready) {\n resolve(torrent);\n } else {\n torrent.once(\"ready\", () => {\n resolve(torrent);\n });\n }\n });\n }\n\n webtorrentfindfile (torrent, path) {\n /*\n Given a torrent object and a path to a file within the torrent, find the given file.\n */\n const filePath = torrent.name + '/' + path;\n const file = torrent.files.find(file => {\n return file.path === filePath;\n });\n if (!file) {\n //debugger;\n throw new errors.TransportError(\"Requested file (\" + path + \") not found within torrent \");\n }\n return file;\n }\n\n p_rawfetch(url) {\n /*\n Fetch some bytes based on a url of the form:\n\n magnet:xyzabc/path/to/file\n\n (Where xyzabc is the typical magnet uri contents)\n\n No assumption is made about the data in terms of size or structure. Returns a new Promise that resolves to a buffer.\n\n :param string url: URL of object being retrieved\n :resolve buffer: Return the object being fetched.\n :throws: TransportError if url invalid - note this happens immediately, not as a catch in the promise\n */\n return new Promise((resolve, reject) => {\n // Logged by Transports\n const { torrentId, path } = this.webtorrentparseurl(url);\n this.p_webtorrentadd(torrentId)\n .then((torrent) => {\n torrent.deselect(0, torrent.pieces.length - 1, false); // Dont download entire torrent as will pull just the file we want (warning - may give problems if multiple reads from same webtorrent)\n const file = this.webtorrentfindfile(torrent, path);\n file.getBuffer((err, buffer) => {\n if (err) {\n return reject(new errors.TransportError(\"Torrent encountered a fatal error \" + err.message + \" (\" + torrent.name + \")\"));\n }\n resolve(buffer);\n });\n })\n .catch((err) => reject(err));\n });\n }\n\n seed({fileRelativePath, directoryPath, torrentRelativePath }, cb) {\n /* Add a file to webTorrent - this will be called each time a file is cached and adds the torrent to WT handling so its seeding this (and other) files in directory */\n if (!torrentRelativePath) { // If no torrentfile available then just skip WebTorrent, MirrorFS will often seed the file (eg to IPFS) while its fetching the torrent and then seed that.\n cb(null);\n } else {\n const torrentfile = path.join(directoryPath, torrentRelativePath);\n this.p_addTorrentFromTorrentFile(torrentfile, directoryPath)\n .then(res => { debug(\"Added %s/%s to webtorrent\", directoryPath, fileRelativePath); cb(null)})\n .catch(err => {\n if (err.message.includes(\"Cannot add duplicate torrent\")) { // Ignore silently if already added\n cb(null);\n } else {\n debug(\"addWebTorrent failed %s/%s\", directoryPath, fileRelativePath); cb(err);\n }\n });\n }\n }\n\n async _p_fileTorrentFromUrl(url) {\n /*\n Then open a webtorrent for the file specified in the path part of the url\n url: of form magnet:... or magnet/:...\n return: Web Torrent file\n */\n try {\n const {torrentId, path} = this.webtorrentparseurl(url);\n const torrent = await this.p_webtorrentadd(torrentId);\n torrent.deselect(0, torrent.pieces.length - 1, false); // Dont download entire torrent as will pull just the file we want (warning - may give problems if multiple reads from same webtorrent)\n const file = this.webtorrentfindfile(torrent, path);\n if (typeof window !== \"undefined\") { // Check running in browser\n window.WEBTORRENT_TORRENT = torrent;\n window.WEBTORRENT_FILE = file;\n torrent.once('close', () => {\n window.WEBTORRENT_TORRENT = null;\n window.WEBTORRENT_FILE = null;\n })\n }\n return file\n } catch(err) {\n // Logged by Transports\n throw(err);\n }\n\n }\n\n async p_addTorrentFromTorrentFile(torrentFilePath, filesPath) {\n // TODO-API: doc\n try {\n const opts = { path: filesPath };\n const oldTorrent = this.webtorrent.get(torrentFilePath);\n if (oldTorrent) {\n oldTorrent.rescanFiles();\n } else {\n const torrent = await this.p_webtorrentadd(torrentFilePath, opts);\n torrent.deselect(0, torrent.pieces.length - 1, false); // Dont download entire torrent as will pull just the file we want (warning - may give problems if multiple reads from same webtorrent)\n }\n } catch(err) {\n // Logged by Transports\n throw(err);\n }\n\n }\n\n async p_f_createReadStream(url, {wanturl=false}={}) {\n /*\n Fetch bytes progressively, using a node.js readable stream, based on a url of the form:\n No assumption is made about the data in terms of size or structure.\n\n This is the initialisation step, which returns a function suitable for <VIDEO>\n\n Returns a new Promise that resolves to function for a node.js readable stream.\n\n Node.js readable stream docs: https://nodejs.org/api/stream.html#stream_readable_streams\n\n :param string url: URL of object being retrieved of form magnet:xyzabc/path/to/file (Where xyzabc is the typical magnet uri contents)\n :param boolean wanturl True if want the URL of the stream (for service workers)\n :resolves to: f({start, end}) => stream (The readable stream.)\n :throws: TransportError if url invalid - note this happens immediately, not as a catch in the promise\n */\n // Logged by Transports\n try {\n let filet = await this._p_fileTorrentFromUrl(url);\n let self = this;\n if (wanturl) {\n return url;\n } else {\n return function (opts) { return self.createReadStream(filet, opts); };\n }\n } catch(err) {\n // Logged by Transports\n throw(err);\n }\n }\n\n createReadStream(file, opts) {\n /*\n The function, encapsulated and inside another function by p_f_createReadStream (see docs)\n\n :param file: Webtorrent \"file\" as returned by webtorrentfindfile\n :param opts: { start: byte to start from; end: optional end byte }\n :returns stream: The readable stream.\n */\n debug(\"reading from stream %s %o\", file.name, opts);\n let through;\n try {\n through = new stream.PassThrough();\n const fileStream = file.createReadStream(opts);\n fileStream.pipe(through);\n return through;\n } catch(err) {\n debug(\"createReadStream error %s\", err);\n if (typeof through.destroy === 'function')\n through.destroy(err);\n else through.emit('error', err)\n }\n }\n\n async p_createReadableStream(url, opts) {\n //Return a readable stream (suitable for a HTTP response) from a node type stream from webtorrent.\n // This is used by dweb-serviceworker for WebTorrent only\n let filet = await this._p_fileTorrentFromUrl(url);\n return new ReadableStream({\n start (controller) {\n debug(\"start %s %o\", url, opts);\n // Create a webtorrent file stream\n const filestream = filet.createReadStream(opts);\n // When data comes out of webtorrent node.js style stream, put it into the WHATWG stream\n filestream.on('data', value => {\n controller.enqueue(value)\n });\n filestream.on('end', () => {\n controller.close()\n })\n },\n cancel (reason) {\n throw new errors.TransportError(`cancelled ${url}, ${opts} ${reason}`);\n }\n });\n }\n\n\n\n static async p_test(opts) {\n try {\n let transport = await this.p_setup(opts); // Assumes IPFS already setup\n console.log(transport.name, \"p_test setup\", opts, \"complete\");\n let res = await transport.p_status();\n console.assert(res === Transport.STATUS_CONNECTED);\n\n // Creative commons torrent, copied from https://webtorrent.io/free-torrents\n let bigBuckBunny = 'magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fbig-buck-bunny.torrent/Big Buck Bunny.en.srt';\n\n let data1 = await transport.p_rawfetch(bigBuckBunny);\n data1 = data1.toString();\n assertData(data1);\n\n const stream = await transport.createReadStream(bigBuckBunny);\n\n const chunks = [];\n stream.on(\"data\", (chunk) => {\n chunks.push(chunk);\n });\n stream.on(\"end\", () => {\n const data2 = Buffer.concat(chunks).toString();\n assertData(data2);\n });\n\n function assertData(data) {\n // Test for a string that is contained within the file\n let expectedWithinData = \"00:00:02,000 --> 00:00:05,000\";\n\n console.assert(data.indexOf(expectedWithinData) !== -1, \"Should fetch 'Big Buck Bunny.en.srt' from the torrent\");\n\n // Test that the length is what we expect\n console.assert(data.length, 129, \"'Big Buck Bunny.en.srt' was \" + data.length);\n }\n } catch (err) {\n console.log(\"Exception thrown in\", transport.name, \"p_test():\", err.message);\n throw err;\n }\n }\n\n}\nTransports._transportclasses[\"WEBTORRENT\"] = TransportWEBTORRENT;\n\nexports = module.exports = TransportWEBTORRENT;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./TransportWEBTORRENT.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./TransportWOLK.js":
|
||
/*!**************************!*\
|
||
!*** ./TransportWOLK.js ***!
|
||
\**************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\nThis Transport layers uses Wolk NoSQL + Cloudstore.\n*/\nvar WOLK\nconst Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nif( typeof window === 'undefined' ) {\n WOLK = __webpack_require__(/*! wolkjs */ \"./node_modules/wolkjs/index.js\").FS;\n} else {\n WOLK = __webpack_require__(/*! wolkjs */ \"./node_modules/wolkjs/index.js\").WOLK;\n}\nconst stringify = __webpack_require__(/*! canonical-json */ \"./node_modules/canonical-json/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:wolk');\n\n// Other Dweb modules\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\nconst Transport = __webpack_require__(/*! ./Transport.js */ \"./Transport.js\"); // Base class for TransportXyz\nconst Transports = __webpack_require__(/*! ./Transports */ \"./Transports.js\"); // Manage all Transports that are loaded\nconst utils = __webpack_require__(/*! ./utils */ \"./utils.js\"); // Utility functions\n\nlet defaultoptions = {\n wolk_addr: \"https://cloud.wolk.com\",\n};\n\nclass TransportWOLK extends Transport {\n /* Wolk specific transport */\n constructor(options) {\n super(options);\n this.options = options; // Dictionary of options\n this.wolk = undefined;\n this.name = \"WOLK\"; // For console log etc\n this.supportURLs = ['wolk'];\n this.supportFunctions = [ 'fetch', 'connection', 'get', 'set', ]; // 'store' - requires chunkdata; 'createReadStream' not implemented\n this.supportFeatures = []; // Doesnt support noCache and is mutable\n\n this.status = Transport.STATUS_LOADED;\n }\n\n connection(url) {\n debug(\"connection call\")\n var wolknode = new WOLK();\n return wolknode\n }\n\n //TODO-SPLIT define load()\n\n //stuff that happens b/f using ntwk bandwidth (config/connect/stuff)\n static setup0(options) {\n let combinedoptions = Transport.mergeoptions(defaultoptions, options.wolk);\n debug(\"setup options=%o\", combinedoptions);\n let t = new TransportWOLK(combinedoptions);\n t.wolk = new WOLK();\n //var successinit = await Promise.all(t.wolk.init())\n t.wolk.setProvider(t.options.wolk_addr);\n Transports.addtransport(t);\n return t;\n }\n\n //make the connection\n async p_setup1(cb) {\n await this.wolk.init()\n .then( async () => { //TODO-WOLK check - I'm just not familiar with this construct - an async function inside a .then\n if( this.wolk.ecdsaKey == undefined || this.wolk.ecdsaKey == null ) {\n var wolkName = \"user\" + Math.floor((Math.random() * 1000) + 1);\n debug(\"createAccount because ecdsaKey null\")\n return await this.wolk.createAccount(wolkName)\n .then( hash => {\n debug(\"Account Created: [\" + wolkName + \"] hash: \" + hash + \" KEY: \" + this.wolk.ecdsaKey)\n })\n .catch( err => {\n throw new Error(\"Error Creating Account: \" + err);\n })\n }\n })\n .catch( (err) => {\n throw new Error(\"Error Initializing Wolk: \" + err);\n });\n\n try {\n this.status = Transport.STATUS_STARTING; // Should display, but probably not refreshed in most case\n if (cb) cb(this);\n await this.p_status();\n } catch(err) {\n this.status = Transport.STATUS_FAILED;\n }\n if (cb) cb(this);\n return this;\n }\n\n async p_status() {\n /* Return an integer for the status of a transport see Transport */\n return this.wolk.getLatestBlockNumber()\n .then( (bn) => {\n if (bn >= 0) {\n debug(\"STATUS: connected? [1] = BN: %s\", bn)\n this.status = Transport.STATUS_CONNECTED;\n } else {\n debug(\"STATUS: connected? [0] = BN: %s\", bn)\n this.status = Transport.STATUS_FAILED;\n }\n return this.status;\n })\n .catch( (err) => { console.error(\"Error getting bn: \" + err); })\n }\n\n // ===== DATA ======\n async p_rawstore(chunk) {\n /*\n Store a blob of data onto the decentralised transport.\n Returns a promise that resolves to the url of the data\n\n :param string|Buffer data: Data to store - no assumptions made to size or content\n :resolve string: url of data stored\n */\n\n console.assert(chunk, \"TransportWOLK.p_rawstore: requires chunkdata\");\n /* TODO:\n const rawRes = this.wolk.setChunk(chunk);\n if (rawRes.err) {\n throw new errors.TransportError(\"Error encountered storing chunk: \" + rawRes.err);\n }\n return \"wolk://wolk/\" + rawRes.h;\n */\n }\n\n parseWolkUrl(url) {\n var url = Url.parse(url);\n if(url.protocol != \"wolk:\") {\n throw new errors.TransportError(\"WOLK Error encountered retrieving val: url (\" + url.href + \") is not a valid WOLK url | protocol = \" + url.protocol);\n }\n let wolkowner = url.host\n var urlParts = url.path.split(\"/\");\n let wolkbucket = urlParts[1];\n let wolkpath = url.path.substring(wolkbucket.length + 2);\n var wolkurltype = \"key\"\n if( wolkowner == \"wolk\" && wolkbucket == \"chunk\" ) {\n wolkurltype = \"chunk\"\n }\n let wolkquery = url.query\n return { owner: wolkowner, bucket: wolkbucket, path: wolkpath, urltype: wolkurltype, query: wolkquery }\n }\n\n async p_rawfetch(url) {\n //TODO: use this.wolk.parseWolkUrl eventually\n var wolkurl = this.parseWolkUrl(url)\n/*\n console.log(\"WOLK p_rawfetch url: \" + JSON.stringify(wolkurl));\n console.log(\"WOLK owner: \" + wolkurl.owner);\n console.log(\"WOLK bucket: \" + wolkurl.bucket);\n console.log(\"WOLK key: \" + wolkurl.path);\n console.log(\"WOLK query: \" + wolkurl.query);\n console.log(\"WOLK urltype: \" + wolkurl.urltype);\n*/\n\n var responseData = \"\"\n if( wolkurl.urltype == \"key\" ) {\n debug(\"Checking Wolk NoSQL for: %s\", url)\n return this.wolk.getKey(wolkurl.owner, wolkurl.bucket, wolkurl.path, \"latest\")\n .then(function(responseData) {\n //TODO-WOLK: error checking\n //debug(\"Response: %s\", JSON.stringify(responseData)); //Commented as could be big\n return responseData;\n })\n .catch( (err) => {\n throw new Error(\"ERROR: p_rawfetch - \" + err);\n })\n }\n }\n\n //=======KEY VALUE TABLES ========\n async p_newdatabase(pubkey) {\n\n }\n\n async p_newtable(pubkey, table) {\n\n }\n\n async p_set(url, keyvalues, value) {\n /*\n Set key values\n keyvalues: string (key) in which case value should be set there OR object in which case value is ignored\n */\n var wolkurl = this.parseWolkUrl(url)\n/*\n console.log(\"WOLK p_set url: \" + JSON.stringify(wolkurl));\n console.log(\"WOLK owner: \" + wolkurl.owner);\n console.log(\"WOLK bucket: \" + wolkurl.bucket);\n console.log(\"WOLK key: \" + wolkurl.path);\n console.log(\"WOLK query: \" + wolkurl.query);\n console.log(\"WOLK urltype: \" + wolkurl.urltype);\n*/\n if (typeof keyvalues === \"string\") {\n return this.wolk.setKey(wolkurl.owner, wolkurl.bucket, keyvalues, stringify(value))\n .then( (hash) => {\n return hash;\n })\n .catch( (err) => {\n throw new Error(\"TransportWOLK - Error setting key value pair: \" + err)\n });\n } else {\n // Store all key-value pairs without destroying any other key/value pairs previously set\n //TODO: Why not support Arrays?\n console.assert(!Array.isArray(keyvalues), \"TransportWOLK - shouldnt be passsing an array as the keyvalues\");\n //TODO: better understand dictionary objects\n /*\n table.put(\n Object.keys(keyvalues).reduce(\n function(previous, key) {\n previous[key] = stringify(keyvalues[key]);\n return previous;\n },\n {}\n )\n )\n */\n }\n }\n\n async p_get(url, keys) {\n var wolkurl = this.parseWolkUrl(url)\n\n debug(\"Getting url: %s\", JSON.stringify(wolkurl));\n/*\n console.log(\"WOLK owner: \" + wolkurl.owner);\n console.log(\"WOLK bucket: \" + wolkurl.bucket);\n console.log(\"WOLK key: \" + wolkurl.path);\n console.log(\"WOLK query: \" + wolkurl.query);\n console.log(\"WOLK urltype: \" + wolkurl.urltype);\n*/\n if (Array.isArray(keys)) {\n throw new errors.ToBeImplementedError(\"p_get(url, [keys]) isn't supported - because of ambiguity better to explicitly loop on set of keys\");\n /*\n return keys.reduce(function(previous, key) {\n let val = table.get(key);\n previous[key] = typeof val === \"string\" ? JSON.parse(val) : val; // Handle undefined\n return previous;\n }, {});\n */\n } else {\n return this.wolk.getKey(wolkurl.owner, wolkurl.bucket, keys, \"latest\")\n .then( (value) => { return value; })\n .catch( (err) => {\n throw new errors.TransportError(\"Error encountered getting keyvalues: \" + err);\n })\n }\n }\n\n async p_delete(url, keys) {\n var wolkurl = this.parseWolkUrl(url)\n\n if ( typeof keys === \"string\") {\n return this.wolk.deleteKey(wolkurl.owner, wolkurl.bucket, keys)\n .then( (res) => { return res; })\n .catch( (err) => { throw new errors.TransportError(\"Error deleting key(s): \" + err)})\n } else {\n keys.map( (key) => {\n this.wolk.deleteKey(wolkurl.owner, wolkurl.bucket, key)\n })\n }\n }\n\n async p_keys(url) {\n var wolkurl = this.parseWolkUrl(url)\n return this.listCollection(wolkurl.owner, wolkurl.bucket, {})\n }\n\n async p_getall(url) {\n //TODO: difference between this and p_keys\n }\n}\nTransports._transportclasses[\"WOLK\"] = TransportWOLK;\nexports = module.exports = TransportWOLK;\n\n\n//# sourceURL=webpack:///./TransportWOLK.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./TransportYJS.js":
|
||
/*!*************************!*\
|
||
!*** ./TransportYJS.js ***!
|
||
\*************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\nThis Transport layers builds on the YJS DB and uses IPFS as its transport.\n\nY Lists have listeners and generate events - see docs at ...\n*/\nconst Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nconst debugyjs = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:yjs');\nconst stringify = __webpack_require__(/*! canonical-json */ \"./node_modules/canonical-json/index.js\");\n\n//const Y = require('yjs/dist/y.js'); // Explicity require of dist/y.js to get around a webpack warning but causes different error in YJS\nconst Y = __webpack_require__(/*! yjs */ \"./node_modules/yjs/src/y.js\"); // Explicity require of dist/y.js to get around a webpack warning\n__webpack_require__(/*! y-memory */ \"./node_modules/y-memory/src/Memory.js\")(Y);\n__webpack_require__(/*! y-array */ \"./node_modules/y-array/src/Array.js\")(Y);\n__webpack_require__(/*! y-text */ \"./node_modules/y-text/src/Text.js\")(Y);\n__webpack_require__(/*! y-map */ \"./node_modules/y-map/src/Map.js\")(Y);\n__webpack_require__(/*! y-ipfs-connector */ \"./node_modules/y-ipfs-connector/src/index.js\")(Y);\n__webpack_require__(/*! y-indexeddb */ \"./node_modules/y-indexeddb/src/IndexedDB.js\")(Y);\n//require('y-leveldb')(Y); //- can't be there for browser, node seems to find it ok without this, though not sure why..\n\n// Utility packages (ours) And one-liners\nfunction delay(ms, val) { return new Promise(resolve => {setTimeout(() => { resolve(val); },ms)})}\n\n// Other Dweb modules\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\nconst Transport = __webpack_require__(/*! ./Transport.js */ \"./Transport.js\"); // Base class for TransportXyz\nconst Transports = __webpack_require__(/*! ./Transports */ \"./Transports.js\"); // Manage all Transports that are loaded\nconst utils = __webpack_require__(/*! ./utils */ \"./utils.js\"); // Utility functions\n\nlet defaultoptions = {\n db: {\n name: 'indexeddb', // leveldb in node\n },\n connector: {\n name: 'ipfs',\n //ipfs: ipfs, // Need to link IPFS here once created\n },\n};\n\nclass TransportYJS extends Transport {\n /*\n YJS specific transport - over IPFS, but could probably use other YJS transports\n\n Fields: TODO document this\n */\n\n constructor(options) {\n super(options);\n this.options = options; // Dictionary of options\n this.name = \"YJS\"; // For console log etc\n this.supportURLs = ['yjs'];\n this.supportFunctions = ['fetch', 'add', 'list', 'listmonitor', 'newlisturls',\n 'connection', 'get', 'set', 'getall', 'keys', 'newdatabase', 'newtable', 'monitor']; // Only does list functions, Does not support reverse,\n this.supportFeatures = []; // Doesnt support noCache and is mutable\n this.status = Transport.STATUS_LOADED;\n }\n\n async p__y(url, opts) {\n /*\n Utility function to get Y for this URL with appropriate options and open a new connection if not already\n\n url: URL string to find list of\n opts: Options to add to defaults\n resolves: Y\n */\n if (!(typeof(url) === \"string\")) { url = url.href; } // Convert if its a parsed URL\n console.assert(url.startsWith(\"yjs:/yjs/\"));\n try {\n if (this.yarrays[url]) {\n //debugyjs(\"Found Y for %s\", url);\n return this.yarrays[url];\n } else {\n let options = Transport.mergeoptions(this.options, {connector: {room: url}}, opts); // Copies options, ipfs will be set already\n //debugyjs(\"Creating Y for %s\", url);\n return this.yarrays[url] = await Y(options);\n }\n } catch(err) {\n console.error(\"Failed to initialize Y\", err.message);\n throw err;\n }\n }\n\n async p__yarray(url) {\n /*\n Utility function to get Yarray for this URL and open a new connection if not already\n url: URL string to find list of\n resolves: Y\n */\n return this.p__y(url, { share: {array: \"Array\"}}); // Copies options, ipfs will be set already\n }\n async p_connection(url) {\n /*\n Utility function to get Yarray for this URL and open a new connection if not already\n url: URL string to find list of\n resolves: Y - a connection to use for get's etc.\n */\n return this.p__y(url, { share: {map: \"Map\"}}); // Copies options, ipfs will be set already\n }\n\n //TODO-SPLIT define load()\n\n static setup0(options) {\n /*\n First part of setup, create obj, add to Transports but dont attempt to connect, typically called instead of p_setup if want to parallelize connections.\n */\n let combinedoptions = Transport.mergeoptions(defaultoptions, options.yjs);\n debugyjs(\"YJS options %o\", combinedoptions);\n let t = new TransportYJS(combinedoptions); // Note doesnt start IPFS or Y\n Transports.addtransport(t);\n return t;\n }\n\n async p_setup2(cb) {\n /*\n This sets up for Y connections, which are opened each time a resource is listed, added to, or listmonitored.\n p_setup2 is defined because IPFS will have started during the p_setup1 phase.\n Throws: Error(\"websocket error\") if WiFi off, probably other errors if fails to connect\n */\n try {\n this.status = Transport.STATUS_STARTING; // Should display, but probably not refreshed in most case\n if (cb) cb(this);\n this.options.connector.ipfs = Transports.ipfs().ipfs; // Find an IPFS to use (IPFS's should be starting in p_setup1)\n this.yarrays = {};\n await this.p_status();\n } catch(err) {\n console.error(this.name,\"failed to start\",err);\n this.status = Transport.STATUS_FAILED;\n }\n if (cb) cb(this);\n return this;\n }\n\n async p_status() {\n /*\n Return a string for the status of a transport. No particular format, but keep it short as it will probably be in a small area of the screen.\n For YJS, its online if IPFS is.\n */\n this.status = (await this.options.connector.ipfs.isOnline()) ? Transport.STATUS_CONNECTED : Transport.STATUS_FAILED;\n return super.p_status();\n }\n\n // ======= LISTS ========\n\n async p_rawlist(url) {\n /*\n Fetch all the objects in a list, these are identified by the url of the public key used for signing.\n (Note this is the 'signedby' parameter of the p_rawadd call, not the 'url' parameter\n Returns a promise that resolves to the list.\n Each item of the list is a dict: {\"url\": url, \"date\": date, \"signature\": signature, \"signedby\": signedby}\n List items may have other data (e.g. reference ids of underlying transport)\n\n :param string url: String with the url that identifies the list.\n :resolve array: An array of objects as stored on the list.\n */\n try {\n let y = await this.p__yarray(url);\n let res = y.share.array.toArray();\n // .filter((obj) => (obj.signedby.includes(url))); Cant filter since url is the YJS URL, not the URL of the CL that signed it. (upper layers verify, which filters)\n //Logged by Transports\n //debugyjs(\"p_rawlist found %o\", res);\n return res;\n } catch(err) {\n //Logged by Transports\n // console.log(\"TransportYJS.p_rawlist failed\",err.message);\n throw(err);\n }\n }\n\n listmonitor(url, callback, {current=false}={}) {\n /*\n Setup a callback called whenever an item is added to a list, typically it would be called immediately after a p_rawlist to get any more items not returned by p_rawlist.\n\n :param url: string Identifier of list (as used by p_rawlist and \"signedby\" parameter of p_rawadd\n :param callback: function(obj) Callback for each new item added to the list\n obj is same format as p_rawlist or p_rawreverse\n */\n let y = this.yarrays[typeof url === \"string\" ? url : url.href];\n console.assert(y,\"Should always exist before calling listmonitor - async call p__yarray(url) to create\");\n if (current) {\n y.share.array.toArray.map(callback);\n }\n y.share.array.observe((event) => {\n if (event.type === 'insert') { // Currently ignoring deletions.\n debugyjs('resources inserted %o', event.values);\n //cant filter because url is YJS local, not signer, callback should filter\n //event.values.filter((obj) => obj.signedby.includes(url)).map(callback);\n event.values.map(callback);\n }\n })\n }\n\n rawreverse() {\n /*\n Similar to p_rawlist, but return the list item of all the places where the object url has been listed.\n The url here corresponds to the \"url\" parameter of p_rawadd\n Returns a promise that resolves to the list.\n\n :param string url: String with the url that identifies the object put on a list.\n :resolve array: An array of objects as stored on the list.\n */\n //TODO-REVERSE this needs implementing once list structure on IPFS more certain\n throw new errors.ToBeImplementedError(\"Undefined function TransportYJS.rawreverse\"); }\n\n async p_rawadd(url, sig) {\n /*\n Store a new list item, it should be stored so that it can be retrieved either by \"signedby\" (using p_rawlist) or\n by \"url\" (with p_rawreverse). The underlying transport does not need to guarantee the signature,\n an invalid item on a list should be rejected on higher layers.\n\n :param string url: String identifying list to post to\n :param Signature sig: Signature object containing at least:\n date - date of signing in ISO format,\n urls - array of urls for the object being signed\n signature - verifiable signature of date+urls\n signedby - urls of public key used for the signature\n :resolve undefined:\n */\n // Logged by Transports\n //debugyjs(\"TransportYJS.p_rawadd %o %o\", url.href, sig);\n console.assert(url && sig.urls.length && sig.signature && sig.signedby.length, \"TransportYJS.p_rawadd args\", url, sig);\n let value = sig.preflight(Object.assign({}, sig));\n let y = await this.p__yarray(url);\n y.share.array.push([value]);\n }\n\n p_newlisturls(cl) {\n let u = cl._publicurls.map(urlstr => Url.parse(urlstr))\n .find(parsedurl =>\n (parsedurl.protocol === \"ipfs\" && parsedurl.pathname.includes('/ipfs/'))\n || (parsedurl.protocol === \"yjs:\"));\n if (!u) {\n u = `yjs:/yjs/${ cl.keypair.verifyexportmultihashsha256_58() }`; // Pretty random, but means same test will generate same list\n }\n return [u,u];\n }\n\n // ======= KEY VALUE TABLES ========\n\n async p_newdatabase(pubkey) {\n //if (pubkey instanceof Dweb.PublicPrivate)\n if (pubkey.hasOwnProperty(\"keypair\"))\n pubkey = pubkey.keypair.signingexport();\n // By this point pubkey should be an export of a public key of form xyz:abc where xyz\n // specifies the type of public key (NACL VERIFY being the only kind we expect currently)\n let u = `yjs:/yjs/${encodeURIComponent(pubkey)}`;\n return {\"publicurl\": u, \"privateurl\": u};\n }\n\n //TODO maybe change the listmonitor / monitor code for to use \"on\" and the structure of PP.events\n //TODO but note https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy about Proxy which might be suitable, prob not as doesnt map well to lists\n async p_newtable(pubkey, table) {\n if (!pubkey) throw new errors.CodingError(\"p_newtable currently requires a pubkey\");\n let database = await this.p_newdatabase(pubkey);\n // If have use cases without a database, then call p_newdatabase first\n return { privateurl: `${database.privateurl}/${table}`, publicurl: `${database.publicurl}/${table}`} // No action required to create it\n }\n\n async p_set(url, keyvalues, value) { // url = yjs:/yjs/database/table\n /*\n Set key values\n keyvalues: string (key) in which case value should be set there OR\n object in which case value is ignored\n */\n let y = await this.p_connection(url);\n if (typeof keyvalues === \"string\") {\n y.share.map.set(keyvalues, stringify(value));\n } else {\n Object.keys(keyvalues).map((key) => y.share.map.set(key, keyvalues[key]));\n }\n }\n _p_get(y, keys) {\n if (Array.isArray(keys)) {\n return keys.reduce(function(previous, key) {\n let val = y.share.map.get(key);\n previous[key] = typeof val === \"string\" ? JSON.parse(val) : val; // Handle undefined\n return previous;\n }, {});\n } else {\n let val = y.share.map.get(keys);\n return typeof val === \"string\" ? JSON.parse(val) : val; // Surprisingly this is sync, the p_connection should have synchronised\n }\n }\n async p_get(url, keys) {\n return this._p_get(await this.p_connection(url), keys);\n }\n\n async p_delete(url, keys) {\n let y = await this.p_connection(url);\n if (typeof keys === \"string\") {\n y.share.map.delete(keys);\n } else {\n keys.map((key) => y.share.map.delete(key)); // Surprisingly this is sync, the p_connection should have synchronised\n }\n }\n\n async p_keys(url) {\n let y = await this.p_connection(url);\n return y.share.map.keys(); // Surprisingly this is sync, the p_connection should have synchronised\n }\n async p_getall(url) {\n let y = await this.p_connection(url);\n let keys = y.share.map.keys(); // Surprisingly this is sync, the p_connection should have synchronised\n return this._p_get(y, keys);\n }\n async p_rawfetch(url) {\n return { // See identical structure in TransportHTTP\n table: \"keyvaluetable\", //TODO-KEYVALUE its unclear if this is the best way, as maybe want to know the real type of table e.g. domain\n _map: await this.p_getall(url)\n }; // Data struc is ok as SmartDict.p_fetch will pass to KVT constructor\n }\n async monitor(url, callback, {current=false}={}) {\n /*\n Setup a callback called whenever an item is added to a list, typically it would be called immediately after a p_getall to get any more items not returned by p_getall.\n Stack: KVT()|KVT.p_new => KVT.monitor => (a: Transports.monitor => YJS.monitor)(b: dispatchEvent)\n\n :param url: string Identifier of list (as used by p_rawlist and \"signedby\" parameter of p_rawadd\n :param callback: function({type, key, value}) Callback for each new item added to the list\n\n :param current: boolean - true if want events for current items on table\n */\n url = typeof url === \"string\" ? url : url.href;\n let y = this.yarrays[url];\n if (!y) {\n throw new errors.CodingError(\"Should always exist before calling monitor - async call p__yarray(url) to create\");\n }\n if (current) {\n // Iterate over existing items with callback\n y.share.map.keys()\n .forEach(k => {\n let val = y.share.map.get[k];\n callback({type: \"set\", key: k, value: (typeof val === \"string\" ? JSON.parse(val) : val)});\n })\n }\n y.share.map.observe((event) => {\n if (['add','update'].includes(event.type)) { // Currently ignoring deletions.\n debugyjs(\"YJS monitor: %o %s %s %o\", url, event.type, event.name, event.value);\n // ignores event.path (only in observeDeep) and event.object\n if (!(event.type === \"update\" && event.oldValue === event.value)) {\n // Dont trigger on update as seeing some loops with p_set\n let newevent = {\n \"type\": {\"add\": \"set\", \"update\": \"set\", \"delete\": \"delete\"}[event.type],\n \"value\": JSON.parse(event.value),\n \"key\": event.name,\n };\n callback(newevent);\n }\n }\n })\n }\n\n static async p_test(opts={}) {\n {console.log(\"TransportHTTP.test\")}\n try {\n let transport = await this.p_setup(opts);\n console.log(\"HTTP connected\");\n let res = await transport.p_info();\n console.log(\"TransportHTTP info=\",res);\n res = await transport.p_status();\n console.assert(res === Transport.STATUS_CONNECTED);\n await transport.p_test_kvt(\"NACL%20VERIFY\");\n } catch(err) {\n console.log(\"Exception thrown in TransportHTTP.test:\", err.message);\n throw err;\n }\n }\n\n\n\n}\nTransportYJS.Y = Y; // Allow node tests to find it\nTransports._transportclasses[\"YJS\"] = TransportYJS;\nexports = module.exports = TransportYJS;\n\n\n//# sourceURL=webpack:///./TransportYJS.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./Transports.js":
|
||
/*!***********************!*\
|
||
!*** ./Transports.js ***!
|
||
\***********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const Url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\");\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\");\nconst utils = __webpack_require__(/*! ./utils */ \"./utils.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports');\nconst httptools = __webpack_require__(/*! ./httptools */ \"./httptools.js\");\nconst each = __webpack_require__(/*! async/each */ \"./node_modules/async/each.js\");\nconst map = __webpack_require__(/*! async/map */ \"./node_modules/async/map.js\");\n\nclass Transports {\n /*\n Handles multiple transports, API should be (almost) the same as for an individual transport)\n\n Fields:\n _transports List of transports loaded (internal)\n namingcb If set will be called cb(urls) => urls to convert to urls from names.\n _transportclasses All classes whose code is loaded e.g. {HTTP: TransportHTTP, IPFS: TransportIPFS}\n _optionspaused Saves paused option for setup\n */\n\n //TODO a few of these things could be much better as events that are listened for, especially p_statuses\n\n constructor(options) {\n // THIS IS UNUSED - ALL METHODS ARE STATIC, THERE IS NO Transports INSTANCE\n }\n\n static _connected() {\n /*\n Get an array of transports that are connected, i.e. currently usable\n */\n return this._transports.filter((t) => (!t.status));\n }\n static p_connectedNames(cb) { //TODO rename to connectedNames\n /*\n resolves to: an array of the names of connected transports\n Note this is async only because the TransportsProxy version of this has to be - that isn't currently used, so this could be made sync\n */\n const res = this._connected().map(t => t.name);\n if (cb) { cb(null, res)} else { return new Promise((resolve, reject) => resolve(res))}\n }\n static async p_connectedNamesParm() { // Doesnt strictly need to be async, but for consistency with Proxy it has to be.\n return (await this.p_connectedNames()).map(n => \"transport=\"+n).join('&')\n }\n static statuses({connected=undefined}) { //TODO-API (especially add info:)\n /*\n Return array of statuses,\n connected: If true then only connected transports\n */\n const ss = Transports._transports.map((t) => { return {name: t.name, status: t.status, info: t.info}});\n return connected ? ss.filter(s => !s.status) : ss;\n }\n static p_statuses(cb) {\n /*\n resolves to: a dictionary of statuses of transports, e.g. { TransportHTTP: STATUS_CONNECTED }\n */\n const res = this.statuses({connected: false}); // No errors possible\n if (cb) { cb(null, res)} else { return new Promise((resolve, reject) => resolve(res))}\n }\n static validFor(urls, func, opts) { //TODO-RELOAD check for noCache support\n /*\n Finds an array or Transports that can support this URL.\n\n Excludes any transports whose status != 0 as they aren't connected\n\n urls: Array of urls\n func: Function to check support for: fetch, store, add, list, listmonitor, reverse - see supportFunctions on each Transport class\n opts: Passed to each Transport, esp for supportFeatures\n returns: Array of pairs of Url & transport instance [ [ u1, t1], [u1, t2], [u2, t1]]\n throws: CodingError if urls empty or [undefined...]\n */\n if (typeof urls === \"string\") urls = [urls];\n if (!((urls && urls[0]) || [\"store\", \"newlisturls\", \"newdatabase\", \"newtable\", \"seed\"].includes(func))) {\n console.error(\"Transports.validFor called with invalid arguments: urls=\", urls, \"func=\", func); // FOr debugging old calling patterns with [ undefined ]\n return [];\n }\n if (!(urls && urls.length > 0)) { // No url supplied we are just checking which transports support this function on no url.\n return this._transports.filter((t) => (t.validFor(undefined, func, opts)))\n .map((t) => [undefined, t]);\n } else {\n return [].concat(\n ...urls.map((url) => typeof url === 'string' ? Url.parse(url) : url) // parse URLs once\n .map((url) =>\n this._transports.filter((t) => (t.validFor(url, func, opts))) // [ t1, t2 ]\n .map((t) => [url, t]))); // [[ u, t1], [u, t2]]\n }\n }\n static async p_urlsValidFor(urls, func, opts) {\n // Need a async version of this for serviceworker and TransportsProxy\n return this.validFor(urls, func, opts).map((ut) => ut[0]);\n }\n\n // SEE-OTHER-ADDTRANSPORT\n\n static http() {\n // Find an http transport if it exists.\n return Transports._connected().find((t) => t.name === \"HTTP\")\n }\n\n static wolk() {\n // Find a Wolk transport if it exists.\n return Transports._connected().find((t) => t.name === \"WOLK\")\n }\n\n static ipfs() {\n // Find an ipfs transport if it exists, in particular, so YJS can use it.\n return Transports._connected().find((t) => t.name === \"IPFS\")\n }\n\n static webtorrent() {\n // Find an ipfs transport if it exists, so for example ServiceWorker.p_respondWebTorrent can use it.\n return Transports._connected().find((t) => t.name === \"WEBTORRENT\")\n }\n\n static gun() {\n // Find a GUN transport if it exists\n return Transports._connected().find((t) => t.name === \"GUN\")\n }\n\n static async p_resolveNames(urls) {\n /* If and only if TransportNAME was loaded (it might not be as it depends on higher level classes like Domain and SmartDict)\n then resolve urls that might be names, returning a modified array.\n */\n if (this.mirror) {\n return Array.isArray(urls) ? this.gatewayUrls(urls) : this.gatewayUrl(url);\n } else if (this.namingcb) {\n return await this.namingcb(urls); // Array of resolved urls\n } else {\n return urls;\n }\n }\n\n static resolveNamesWith(cb) {\n // Set a callback for p_resolveNames\n this.namingcb = cb;\n }\n\n static togglePaused(name, cb) {\n /*\n Toggle a transport by name,\n name e.g. \"HTTP\"\n cb(err, status)\n */\n const transport = this._transports.find((t) => t.name === name);\n if (!transport) {\n cb(undefined);\n } else {\n transport.togglePaused(t => cb(null, t.status));\n }\n }\n // Storage of data\n\n static async _p_rawstore(tt, data) {\n // Internal method to store at known transports\n let errs = [];\n let rr = await Promise.all(tt.map(async function(t) {\n try {\n debug(\"Storing %d bytes to %s\", data.length, t.name);\n let url = await t.p_rawstore(data);\n debug(\"Storing %d bytes to %s succeeded: %s\", data.length, t.name, url);\n return url; //url\n } catch(err) {\n debug(\"Storing %d bytes to %s failed: %s\", data.length, t.name, err.message);\n errs.push(err);\n return undefined;\n }\n }));\n rr = rr.filter((r) => !!r); // Trim any that had errors\n if (!rr.length) {\n debug(\"Storing %d bytes failed on all transports\", data.length);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); // New error with concatenated messages\n }\n return rr;\n\n }\n static async p_rawstore(data) {\n /*\n data: Raw data to store - typically a string, but its passed on unmodified here\n returns: Array of urls of where stored\n throws: TransportError with message being concatenated messages of transports if NONE of them succeed.\n */\n let tt = this.validFor(undefined, \"store\").map(([u, t]) => t); // Valid connected transports that support \"store\"\n if (!tt.length) {\n debug(\"Storing %d bytes failed: no transports available\", data.length);\n throw new errors.TransportError('Transports.p_rawstore: Cant find transport for store');\n }\n return this._p_rawstore(tt, data);\n }\n static async p_rawfetch(urls, opts={}) {\n /*\n Fetch the data for a url, transports act on the data, typically storing it.\n urls:\tarray of urls to retrieve (any are valid)\n opts {\n start, integer - first byte wanted\n end integer - last byte wanted (note this is inclusive start=0,end=1023 is 1024 bytes\n timeoutMS integer - max time to wait on transports (IPFS) that support it\n noCache bool - Skip caching (passed to Transports)\n }\n returns:\tstring - arbitrary bytes retrieved.\n throws: TransportError with concatenated error messages if none succeed.\n throws: CodingError if urls empty or [undefined ... ]\n */\n if (!urls.length) throw new errors.TransportError(\"Transports.p_rawfetch given an empty list of urls\");\n let resolvedurls = await this.p_resolveNames(urls); // If naming is loaded then convert name to [urls]\n if (!resolvedurls.length) throw new errors.TransportError(\"Transports.p_rawfetch none of the urls resolved: \" + urls);\n let tt = this.validFor(resolvedurls, \"fetch\", {noCache: opts.noCache}); //[ [Url,t],[Url,t]] throws CodingError on empty /undefined urls\n if (!tt.length) {\n throw new errors.TransportError(\"Transports.p_rawfetch cant find any transport for urls: \" + resolvedurls);\n }\n //With multiple transports, it should return when the first one returns something.\n let errs = [];\n let failedtransports = []; // Will accumulate any transports fail on before the success\n for (const [url, t] of tt) {\n try {\n debug(\"Fetching %s via %s\", url.href, t.name);\n let data = await t.p_rawfetch(url, opts); // throws errors if fails or timesout\n debug(\"Fetching %s via %s succeeded %d bytes\", url.href, t.name, data.length);\n if (opts.relay && failedtransports.length) {\n debug(\"Fetching attempting relay of %d bytes from %s to %o\", data.length, url.href, failedtransports.map(t=>t.name));\n this._p_rawstore(failedtransports, data)\n .then(uu => debug(`Fetching relayed %d bytes to %o`, data.length, uu)); // Happening async, not waiting and dont care if fails\n }\n //END TODO-MULTI-GATEWAY\n return data;\n } catch (err) {\n failedtransports.push(t);\n errs.push(err);\n debug(\"Fetching %s via %s failed: %s\", url.href, t.name, err.message);\n // Don't throw anything here, loop round for next, only throw if drop out bottom\n //TODO-MULTI-GATEWAY potentially copy from success to failed URLs.\n }\n }\n debug(\"Fetching %o failed on all transports\", urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); //Throw err with combined messages if none succeed\n }\n static fetch(urls, opts={}, cb) {\n if (typeof opts === \"function\") { cb = opts; opts={}; }\n const prom = this.p_rawfetch(urls, opts);\n if (cb) { prom.then((res)=>{ try { cb(null,res)} catch(err) { debug(\"Uncaught error in fetch %O\",err)}}).catch((err) => cb(err)); } else { return prom; } // Unpromisify pattern v5\n }\n\n// Seeding =====\n // Similar to storing.\n static seed({directoryPath=undefined, fileRelativePath=undefined, ipfsHash=undefined, urlToFile=undefined, torrentRelativePath=undefined}, cb) {\n /*\n ipfsHash: When passed as a parameter, its checked against whatever IPFS calculates.\n Its reported, but not an error if it doesn't match. (the cases are complex, for example the file might have been updated).\n urlToFile: The URL where that file is available, this is to enable transports (e.g. IPFS) that just map an internal id to a URL.\n directoryPath: Absolute path to the directory, for transports that think in terms of directories (e.g. WebTorrent)\n this is the unit corresponding to a torrent, and should be where the torrent file will be found or should be built\n fileRelativePath: Path (relative to directoryPath) to the file to be seeded.\n torrentRelativePath: Path within directory to torrent file if present.\n */\n if (cb) { try { f.call(this, cb) } catch(err) { cb(err)}} else { return new Promise((resolve, reject) => { try { f.call(this, (err, res) => { if (err) {reject(err)} else {resolve(res)} })} catch(err) {reject(err)}})} // Promisify pattern v2\n function f(cb1) {\n let tt = this.validFor(undefined, \"seed\").map(([u, t]) => t); // Valid connected transports that support \"seed\"\n if (!tt.length) {\n debug(\"Seeding: no transports available\");\n cb1(null); // Its not (currently) an error to be unable to seed\n } else {\n const res = {};\n each(tt, // [ Transport]\n (t, cb2) => t.seed({directoryPath, torrentRelativePath, fileRelativePath, ipfsHash, urlToFile},\n (err, oneres) => { res[t.name] = err ? { err: err.message } : oneres; cb2(null)}), // Its not an error for t.seed to fail - errors should have been logged by transports\n (unusederr) => cb1(null, res)); // Return result of any seeds that succeeded as e.g. { HTTP: {}, IPFS: {ipfsHash:} }\n }\n }\n }\n\n // List handling ===========================================\n\n static async p_rawlist(urls) {\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n let tt = this.validFor(urls, \"list\"); // Valid connected transports that support \"store\"\n if (!tt.length) {\n throw new errors.TransportError('Transports.p_rawlist: Cant find transport to \"list\" urls:'+urls.join(','));\n }\n let errs = [];\n let ttlines = await Promise.all(tt.map(async function([url, t]) {\n try {\n debug(\"Listing %s via %s\", url, t.name);\n let res = await t.p_rawlist(url); // [sig]\n debug(\"Listing %s via %s retrieved %d items\", url, t.name, res.length);\n return res;\n } catch(err) {\n debug(\"Listing %s via %s failed: %s\", url, t.name, err.message);\n errs.push(err);\n return [];\n }\n })); // [[sig,sig],[sig,sig]]\n if (errs.length >= tt.length) {\n // All Transports failed (maybe only 1)\n debug(\"Listing %o failed on all transports\", urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); // New error with concatenated messages\n }\n let uniques = {}; // Used to filter duplicates\n return [].concat(...ttlines)\n .filter((x) => (!uniques[x.signature] && (uniques[x.signature] = true)));\n }\n\n static async p_rawadd(urls, sig) {\n /*\n urls: of lists to add to\n sig: Sig to add\n returns: undefined\n throws: TransportError with message being concatenated messages of transports if NONE of them succeed.\n */\n //TODO-MULTI-GATEWAY might be smarter about not waiting but Promise.race is inappropriate as returns after a failure as well.\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n let tt = this.validFor(urls, \"add\"); // Valid connected transports that support \"store\"\n if (!tt.length) {\n debug(\"Adding to %o failed: no transports available\", urls);\n throw new errors.TransportError('Transports.p_rawstore: Cant find transport for urls:'+urls.join(','));\n }\n let errs = [];\n await Promise.all(tt.map(async function([u, t]) {\n try {\n debug(\"Adding to %s via %s\", u, t.name);\n await t.p_rawadd(u, sig); //undefined\n debug(\"Adding to %s via %s succeeded\", u, t.name);\n return undefined;\n } catch(err) {\n debug(\"Adding to %s via %s failed: %s\", u, t.name, err.message);\n errs.push(err);\n return undefined;\n }\n }));\n if (errs.length >= tt.length) {\n debug(\"Adding to %o failed on all transports\", urls);\n // All Transports failed (maybe only 1)\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); // New error with concatenated messages\n }\n return undefined;\n\n }\n\n static listmonitor(urls, cb, opts={}) {\n /*\n Add a listmonitor for each transport - note this means if multiple transports support it, then will get duplicate events back if everyone else is notifying all of them.\n */\n // Note cant do p_resolveNames since sync but should know real urls of resource by here.\n this.validFor(urls, \"listmonitor\")\n .map(([u, t]) => {\n t.listmonitor(u, cb, opts);\n debug(\"Monitoring list %s via %s\", u, t.name);\n });\n }\n\n static async p_newlisturls(cl) {\n // Create a new list in any transport layer that supports lists.\n // cl is a CommonList or subclass and can be used by the Transport to get info for choosing the list URL (normally it won't use it)\n // Note that normally the CL will not have been stored yet, so you can't use its urls.\n let uuu = await Promise.all(this.validFor(undefined, \"newlisturls\")\n .map(([u, t]) => t.p_newlisturls(cl)) ); // [ [ priv, pub] [ priv, pub] [priv pub] ]\n return [uuu.map(uu=>uu[0]), uuu.map(uu=>uu[1])]; // [[ priv priv priv ] [ pub pub pub ] ]\n }\n\n // Stream handling ===========================================\n //myArray[Math.floor(Math.random() * myArray.length)];\n\n static async p_f_createReadStream(urls, {wanturl=false, preferredTransports=[]}={}) { // Note options is options for selecting a stream, not the start/end in a createReadStream call\n /*\n urls: Url or [urls] of the stream\n wanturl True if want the URL of the stream (for service workers)\n returns: f(opts) => stream returning bytes from opts.start || start of file to opts.end-1 || end of file\n */\n // Find all the transports that CAN support this request\n let tt = this.validFor(urls, \"createReadStream\", {}); //[ [Url,t],[Url,t]] // Can pass options TODO-STREAM support options in validFor\n if (!tt.length) {\n debug(\"Opening stream from %o failed: no transports available\", urls);\n throw new errors.TransportError(\"Transports.p_createReadStream cant find any transport for urls: \" + urls);\n }\n //With multiple transports, it should return when the first one returns something.\n let errs = [];\n\n // Select first from preferredTransports in the order presented, then the rest at random\n tt.sort((a,b) =>\n ((preferredTransports.indexOf(a[1].name)+1) || 999+Math.random()) - ((preferredTransports.indexOf(b[1].name)+1) || 999+Math.random())\n );\n\n for (const [url, t] of tt) {\n try {\n debug(\"Opening stream from %s via %s\", url.href, t.name);\n let res = await t.p_f_createReadStream(url, {wanturl} );\n debug(\"Opening stream from %s via %s succeeded\", url.href, t.name);\n return res;\n } catch (err) {\n errs.push(err);\n debug(\"Opening stream from %s via %s failed: %s\", url.href, t.name, err.message);\n // Don't throw anything here, loop round for next, only throw if drop out bottom\n //TODO-MULTI-GATEWAY potentially copy from success to failed URLs.\n }\n }\n debug(\"Opening stream from %o failed on all transports\", urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); //Throw err with combined messages if none succeed\n }\n static createReadStream(urls, opts, cb) {\n /*\n Different interface, more suitable when just want a stream, now.\n urls: Url or [urls] of the stream\n opts{\n start, end: First and last byte wanted (default to 0...last)\n preferredTransports: preferred order to select stream transports (usually determined by application)\n }\n cb(err, stream): Called with open readable stream from the net.\n Returns promise if no cb\n */\n if (typeof opts === \"function\") { cb = opts; opts = {start: 0}; } // Allow skipping opts\n DwebTransports.p_f_createReadStream(urls, {preferredTransports: (opts.preferredTransports || [])})\n .then(f => {\n let s = f(opts);\n if (cb) { cb(null, s); } else { return(s); }; // Callback or resolve stream\n })\n .catch(err => {\n if (err instanceof errors.TransportError) {\n console.warn(\"Transports.createReadStream caught\", err.message);\n } else {\n console.error(\"Transports.createReadStream caught\", err);\n }\n if (cb) { cb(err); } else { reject(err)}\n });\n };\n\n\n// KeyValue support ===========================================\n\n static async p_get(urls, keys) {\n /*\n Fetch the values for a url and one or more keys, transports act on the data, typically storing it.\n urls:\tarray of urls to retrieve (any are valid)\n keys: array of keys wanted or single key\n returns:\tstring - arbitrary bytes retrieved or dict of key: value\n throws: TransportError with concatenated error messages if none succeed.\n */\n let tt = this.validFor(urls, \"get\"); //[ [Url,t],[Url,t]]\n let debug1 = Array.isArray(keys) ? `${keys.length} keys` : keys; // \"1 keys\" or \"foo\"\n if (!tt.length) {\n debug(\"Getting %s from %o failed: no transports available\", debug1, urls);\n throw new errors.TransportError(\"Transports.p_get cant find any transport to get keys from urls: \" + urls);\n }\n //With multiple transports, it should return when the first one returns something.\n let errs = [];\n for (const [url, t] of tt) {\n try {\n debug(\"Getting %s from %s via %s\", debug1, url.href, t.name);\n let res = await t.p_get(url, keys); //TODO-MULTI-GATEWAY potentially copy from success to failed URLs.\n debug(\"Getting %s from %s via %s succeeded length=%d\", debug1, url.href, t.name, res.length);\n return res;\n } catch (err) {\n errs.push(err);\n debug(\"Getting %s from %s via %s failed: %s\", debug1, url.href, t.name, err.message);\n // Don't throw anything here, loop round for next, only throw if drop out bottom\n }\n }\n debug(\"Getting %s from %o failed on all transports\", debug1, urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); //Throw err with combined messages if none succeed\n }\n static async p_set(urls, keyvalues, value) {\n /* Set a series of key/values or a single value\n keyvalues: Either dict or a string\n value: if kv is a string, this is the value to set\n throws: TransportError with message being concatenated messages of transports if NONE of them succeed.\n */\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n let debug1 = typeof keyvalues === \"object\" ? `${keyvalues.length} keys` : keyvalues; // \"1 keys\" or \"foo\"\n let tt = this.validFor(urls, \"set\"); //[ [Url,t],[Url,t]]\n if (!tt.length) {\n debug(\"Setting %s on %o failed: no transports available\", debug1, urls);\n throw new errors.TransportError(\"Transports.p_set cant find any transport for urls: \" + urls);\n }\n let errs = [];\n let success = false;\n await Promise.all(tt.map(async function([url, t]) {\n try {\n debug(\"Setting %s on %s via %s\", debug1, url.href, t.name);\n await t.p_set(url, keyvalues, value);\n debug(\"Setting %s on %s via %s succeeded\", debug1, url.href, t.name);\n success = true; // Any one success will return true\n } catch(err) {\n debug(\"Setting %s on %s via %s failed: %s\", debug1, url.href, t.name, err.message);\n errs.push(err);\n }\n }));\n if (!success) {\n debug(\"Setting %s on %o failed on all transports\", debug1, urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); // New error with concatenated messages\n }\n }\n\n static async p_delete(urls, keys) {\n /* Delete a key or a list of keys\n kv: Either dict or a string\n value: if kv is a string, this is the value to set\n throws: TransportError with message being concatenated messages of transports if NONE of them succeed.\n */\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n let debug1 = Array.isArray(keys) ? `${keys.length} keys` : keys; // \"1 keys\" or \"foo\"\n let tt = this.validFor(urls, \"set\"); //[ [Url,t],[Url,t]]\n if (!tt.length) {\n debug(\"Deleting %s on %o failed: no transports available\", debug1, urls);\n throw new errors.TransportError(\"Transports.p_set cant find any transport for urls: \" + urls);\n }\n let errs = [];\n let success = false;\n await Promise.all(tt.map(async function([url, t]) {\n try {\n debug(\"Deleting %s on %s via %s\", debug1, url.href, t.name);\n await t.p_delete(url, keys);\n debug(\"Deleting %s on %s via %s succeeded\", debug1, url.href, t.name);\n success = true; // Any one success will return true\n } catch(err) {\n debug(\"Deleting %s on %s via %s failed: %s\", debug1, url.href, t.name, err.message);\n errs.push(err);\n }\n }));\n if (!success) {\n debug(\"Deleting %s on %o failed on all transports\", debug1, urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); // New error with concatenated messages\n }\n }\n static async p_keys(urls) {\n /*\n Fetch the values for a url and one or more keys, transports act on the data, typically storing it.\n urls:\tarray of urls to retrieve (any are valid)\n keys: array of keys wanted\n returns:\tstring - arbitrary bytes retrieved or dict of key: value\n throws: TransportError with concatenated error messages if none succeed.\n */\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n let tt = this.validFor(urls, \"keys\"); //[ [Url,t],[Url,t]]\n if (!tt.length) {\n debug(\"Getting all keys on %o failed: no transports available\", urls);\n throw new errors.TransportError(\"Transports.p_keys cant find any transport for urls: \" + urls);\n }\n //With multiple transports, it should return when the first one returns something. TODO make it return the aggregate\n let errs = [];\n for (const [url, t] of tt) {\n try {\n debug(\"Getting all keys on %s via %s\", url.href, t.name);\n let res = await t.p_keys(url); //TODO-MULTI-GATEWAY potentially copy from success to failed URLs.\n debug(\"Getting all keys on %s via %s succeeded with %d keys\", url.href, t.name, res.length);\n return res;\n } catch (err) {\n errs.push(err);\n debug(\"Getting all keys on %s via %s failed: %s\", url.href, t.name, err.message);\n // Don't throw anything here, loop round for next, only throw if drop out bottom\n }\n }\n debug(\"Getting all keys on %o failed on all transports\", urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); //Throw err with combined messages if none succeed\n }\n\n static async p_getall(urls) {\n /*\n Fetch the values for a url and one or more keys, transports act on the data, typically storing it.\n urls:\tarray of urls to retrieve (any are valid)\n keys: array of keys wanted\n returns:\tarray of strings returned for the keys. //TODO consider issues around return a data type rather than array of strings\n throws: TransportError with concatenated error messages if none succeed.\n */\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n let tt = this.validFor(urls, \"getall\"); //[ [Url,t],[Url,t]]\n if (!tt.length) {\n debug(\"Getting all values on %o failed: no transports available\", urls);\n throw new errors.TransportError(\"Transports.p_getall cant find any transport for urls: \" + urls);\n }\n //With multiple transports, it should return when the first one returns something.\n let errs = [];\n for (const [url, t] of tt) {\n try {\n debug(\"Getting all values on %s via %s\", url.href, t.name);\n let res = await t.p_getall(url); //TODO-MULTI-GATEWAY potentially copy from success to failed URLs.\n debug(\"Getting all values on %s via %s succeeded with %d values\", url.href, t.name, res.length);\n return res;\n } catch (err) {\n errs.push(err);\n debug(\"Getting all values on %s via %s failed: %s\", url.href, t.name, err.message);\n // Don't throw anything here, loop round for next, only throw if drop out bottom\n }\n }\n debug(\"Getting all keys on %o failed on all transports\", urls);\n throw new errors.TransportError(errs.map((err)=>err.message).join(', ')); //Throw err with combined messages if none succeed\n }\n\n static async p_newdatabase(pubkey) {\n /*\n Create a new database in any transport layer that supports databases (key value pairs).\n pubkey: CommonList, KeyPair, or exported public key\n resolves to: [ privateurl, publicurl]\n */\n let uuu = await Promise.all(this.validFor(undefined, \"newdatabase\")\n .map(([u, t]) => t.p_newdatabase(pubkey)) ); // [ { privateurl, publicurl} { privateurl, publicurl} { privateurl, publicurl} ]\n return { privateurls: uuu.map(uu=>uu.privateurl), publicurls: uuu.map(uu=>uu.publicurl) }; // { privateurls: [], publicurls: [] }\n }\n\n static async p_newtable(pubkey, table) {\n /*\n Create a new table in any transport layer that supports the function (key value pairs).\n pubkey: CommonList, KeyPair, or exported public key\n resolves to: [ privateurl, publicurl]\n */\n let uuu = await Promise.all(this.validFor(undefined, \"newtable\")\n .map(([u, t]) => t.p_newtable(pubkey, table)) ); // [ [ priv, pub] [ priv, pub] [priv pub] ]\n return { privateurls: uuu.map(uu=>uu.privateurl), publicurls: uuu.map(uu=>uu.publicurl)}; // {privateurls: [ priv priv priv ], publicurls: [ pub pub pub ] }\n }\n\n static async p_connection(urls) {\n /*\n Do any asynchronous connection opening work prior to potentially synchronous methods (like monitor)\n */\n urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n await Promise.all(\n this.validFor(urls, \"connection\")\n .map(([u, t]) => t.p_connection(u)));\n }\n\n static monitor(urls, cb, {current=false}={}) {\n /*\n Add a listmonitor for each transport - note this means if multiple transports support it, then will get duplicate events back if everyone else is notifying all of them.\n Stack: KVT()|KVT.p_new => KVT.monitor => (a: Transports.monitor => YJS.monitor)(b: dispatchEvent)\n cb: function({type, key, value})\n current: If true then then send all current entries as well\n */\n //Can't its async. urls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name\n this.validFor(urls, \"monitor\")\n .map(([u, t]) => {\n debug(\"Monitoring table %s via %s\", u, t.name);\n t.monitor(u, cb, {current})\n }\n );\n }\n\n // Setup and connection\n\n static addtransport(t) {\n /*\n Add a transport to _transports,\n */\n Transports._transports.push(t);\n }\n\n // Setup Transports - setup0 is called once, and should return quickly, p_setup1 and p_setup2 are asynchronous and p_setup2 relies on p_setup1 having resolved.\n\n static setup0(tabbrevs, options, cb) {\n /*\n Setup Transports for a range of classes\n tabbrevs is abbreviation HTTP, IPFS, LOCAL or list of them e.g. \"HTTP,IPFS\"\n cb is callback for when status changes, but there are no status changes here so its not called.\n Handles \"LOCAL\" specially, turning into a HTTP to a local server (for debugging)\n\n returns array of transport instances\n */\n // \"IPFS\" or \"IPFS,LOCAL,HTTP\"\n //TODO-SPLIT need to call something like [tabbrevs].import()\n //TODO-SPLIT need to call this from archive.html\n let localoptions = {http: {urlbase: \"http://localhost:4244\"}}; //TODO-MIRROR \"localoptions\" may not be needed any more\n return tabbrevs.map((tabbrev) => {\n let transportclass = this._transportclasses[ (tabbrev === \"LOCAL\") ? \"HTTP\" : tabbrev ];\n if (!transportclass) {\n debug(\"Connection to %s unavailable\", tabbrev);\n return undefined;\n } else {\n debug(\"Setting up connection to %s with options %o\", tabbrev, options);\n return transportclass.setup0(tabbrev === \"LOCAL\" ? localoptions : options);\n }\n }).filter(f => !!f); // Trim out any undefined\n }\n static p_setup1(refreshstatus, cb) {\n /* Second stage of setup, connect if possible */\n // Does all setup1a before setup1b since 1b can rely on ones with 1a, e.g. YJS relies on IPFS\n const prom = Promise.all(this._transports\n .filter((t) => (! this._optionspaused.includes(t.name)))\n .map((t) => {\n debug(\"Connection stage 1 to %s\", t.name);\n return t.p_setup1(refreshstatus);\n }))\n if (cb) { prom.catch((err) => cb(err)).then((res)=>cb(null,res)); } else { return prom; } // This should be a standard unpromisify pattern\n }\n static p_setup2(refreshstatus, cb) {\n /* Second stage of setup, connect if possible */\n // Does all setup1a before setup1b since 1b can rely on ones with 1a, e.g. YJS relies on IPFS\n\n const prom = Promise.all(this._transports\n .filter((t) => (! this._optionspaused.includes(t.name)))\n .map((t) => {\n debug(\"Connection stage 2 to %s\", t.name);\n return t.p_setup2(refreshstatus);\n }));\n if (cb) { prom.catch((err) => cb(err)).then((res)=>cb(null,res)); } else { return prom; } // This should be a standard unpromisify pattern\n }\n static p_stop(refreshstatus, cb) { //TODO-API cb\n if (cb) { try { f.call(this, cb) } catch(err) { cb(err)}} else { return new Promise((resolve, reject) => { try { f.call(this, (err, res) => { if (err) {reject(err)} else {resolve(res)} })} catch(err) {reject(err)}})} // Promisify pattern v2\n /* Disconnect from all services, may not be able to reconnect */\n //TODO rewrite with async/map\n function f(cb) {\n map(this._connected(),\n (t, cb2) => {\n debug(\"Stopping %s\", t.name);\n t.stop(refreshstatus, cb2);\n },\n cb);\n }\n }\n\n static async refreshstatus(t) {\n //Note \"this' undefined as called as callback\n let statusclasses = [\"transportstatus0\",\"transportstatus1\",\"transportstatus2\",\"transportstatus3\",\"transportstatus4\"];\n let el = t.statuselement;\n if (el) {\n el.classList.remove(...statusclasses);\n el.classList.add(statusclasses[t.status]);\n }\n if (Transports.statuscb) {\n Transports.statuscb(t);\n }\n }\n\n static connect(options, cb) {\n const prom = this.p_connect(options);\n if (cb) { prom.catch((err) => cb(err)).then((res)=>cb(null,res)); } else { return prom; } // This should be a standard unpromisify pattern\n }\n static async p_connect(options) {\n /*\n This is a standardish starting process, feel free to subclass or replace !\n It will connect to a set of standard transports and is intended to work inside a browser.\n options = { defaulttransports: [\"IPFS\"], statuselement: el, http: {}, ipfs: {}; paused: [\"IPFS\"] }\n */\n try {\n options = options || {};\n let tabbrevs = options.transports; // Array of transport abbreviations\n this._optionspaused = (options.paused || []).map(n => n.toUpperCase()); // Array of transports paused - defaults to none, upper cased\n if (!(tabbrevs && tabbrevs.length)) { tabbrevs = options.defaulttransports || [] }\n // WOLK is currently failing, and what is worse returning a data structure with a 404 instead of just failing\n // GUN is turned off by default because it fills up localstorage on browser and stops working, https://github.com/internetarchive/dweb-archive/issues/106\n //if (! tabbrevs.length) { tabbrevs = [\"HTTP\", \"YJS\", \"IPFS\", \"WEBTORRENT\", \"GUN\", \"WOLK\"]; } // SEE-OTHER-ADDTRANSPORT\n if (! tabbrevs.length) { tabbrevs = [\"HTTP\", \"IPFS\", \"WEBTORRENT\", \"WOLK\"]; } // SEE-OTHER-ADDTRANSPORT\n tabbrevs = tabbrevs.map(n => n.toUpperCase());\n let transports = this.setup0(tabbrevs, options);\n [\"statuscb\", \"mirror\"].forEach(k => { if (options[k]) this[k] = options[k];} )\n if (!!options.statuselement) {\n let statuselement = options.statuselement;\n while (statuselement.lastChild) {statuselement.removeChild(statuselement.lastChild); } // Remove any exist status\n statuselement.appendChild(\n utils.createElement(\"UL\", {}, transports.map(t => {\n let el = utils.createElement(\"LI\",\n {onclick: \"this.source.togglePaused(DwebTransports.refreshstatus);\", source: t, name: t.name}, //TODO-SW figure out how t osend this back\n t.name);\n t.statuselement = el; // Save status element on transport\n return el;\n }))\n );\n }\n await this.p_setup1(this.refreshstatus);\n await this.p_setup2(this.refreshstatus);\n debug(\"Connection completed to %o\", this._connected().map(t=>t.name))\n } catch(err) {\n console.error(\"ERROR in p_connect:\",err.message);\n throw(err);\n }\n }\n\n static async p_urlsFrom(url) {\n /* Utility to convert to urls form wanted for Transports functions, e.g. from user input\n url: Array of urls, or string representing url or representing array of urls\n return: Array of strings representing url\n */\n if (typeof(url) === \"string\") {\n if (url[0] === '[')\n url = JSON.parse(url);\n else if (url.includes(','))\n url = url.split(',');\n else\n url = [ url ];\n }\n if (!Array.isArray(url)) throw new Error(`Unparsable url: ${url}`);\n return url;\n }\n\n static async p_httpfetchurl(urls) {\n /*\n Utility to take a array of Transport urls, convert back to a single url that can be used for a fetch, typically\n this is done when cant handle a stream, so want to give the url to the <VIDEO> tag.\n */\n return Transports.http()._url(urls.find(u => (u.startsWith(\"contenthash\") || u.startsWith(\"http\") )), \"content/rawfetch\");\n }\n\n static canonicalName(url, options={}) {\n /*\n Utility function to convert a variety of missentered, or presumed names into a canonical result that can be resolved or passed to a transport\n */\n if (typeof url !== \"string\") url = Url.parse(url).href;\n // In patterns below http or https; and :/ or :// are treated the same\n const gateways = [\"dweb.me\", \"ipfs.io\"]; // Known gateways, may dynamically load this at some point\n // SEE-OTHER-ADDTRANSPORT\n const protocols = [\"ipfs\",\"gun\",\"magnet\",\"yjs\",\"wolk\",\"arc\", \"contenthash\", \"http\", \"https\"];\n const protocolsWantingDomains = [\"arc\", \"http\", \"https\"];\n const gatewaypatts = [ // Must be before patts because gateway names often start with a valid proto\n /^http[s]?:[/]+([^/]+)[/](\\w+)[/](.*)/i, // https://(gateway)/proto/(internal) + gateway in list (IPFS gateways. dweb.me)\n ]\n const patts = [ // No overlap between patts & arcpatts, so order unimportant\n /^dweb:[/]+(\\w+)[/]+(.*)/i, // dweb://(proto)/(internal)\n /^\\w+:[/]+(\\w+)[/](.*)/i, // proto1://proto2//(internal) - maybe only match if proto1=proto2 (must be before proto:/internal)\n /^(\\w+):[/]*(.*)/i, // (proto)://(internal) # must be after proto1://proto2\n /^[/]*(\\w+)[/](.*)/i, // /(proto)//(internal) - maybe only match if proto1=proto2\n /^[/]*dweb[/]*(\\w+)[/](.*)/i, // /dweb/(proto)//(internal)\n ]\n const arcpatts = [ // No overlap between patts & arcpatts, so order unimportant\n /^http[s]?:[/]+[^/]+[/](archive).(org)[/]*(.*)/i, // https://localhost;123/(archive.org)/(internal)\n /^http[s]?:[/]+[^/]+[/]arc[/](archive).(org)[/]*(.*)/i, // https://localhost;123/arc/(archive.org)/(internal)\n /^http[s]?:[/]+dweb.(\\w+)[.]([^/]+)[/]*(.*)/i, // https://dweb.(proto).(dom.ain)/(internal) # Before dweb.dom.ain\n // /^http[s]?:[/]+dweb.([^/]+[.][^/]+[/]*.*)/i, // https://dweb.(dom.ain)/internal) or https://dweb.(domain) Handled by coe on recognizing above\n /^(http[s])?:[/]+([^/]+)[/]+(.*)/i, // https://dom.ain/pa/th\n ]\n\n for (let patt of gatewaypatts) {\n let rr = url.match(patt);\n if (rr && gateways.includes(rr[1]) && protocols.includes(rr[2]))\n return {proto: rr[2], internal: rr[3]};\n }\n for (let patt of arcpatts) {\n let rr = url.match(patt);\n if (rr) {\n if (protocols.includes(rr[1])) {\n // arc (and possibly others) want the domain as part of the internal\n return {proto: rr[1], internal: (protocolsWantingDomains.includes(rr[1]) ? [rr[2], rr[3]].join('/') : rr[3])};\n } else {\n return {proto: \"arc\", internal: [[rr[1], rr[2]].join('.'), rr[3]].join('/')};\n }\n }\n };\n for (let patt of patts) {\n let rr = url.match(patt);\n if (rr && protocols.includes(rr[1]))\n return {proto: rr[1], internal: rr[2]};\n };\n return undefined;\n }\n static canonicalUrl(url, options={}) {\n let o = this.canonicalName(url, options);\n return o.protocol + \":/\" + o.internal;\n }\n static _o2url(o) {\n return [\"http\",\"https\"].includes(o.proto) ? [o.proto, o.internal].join('://') // Shouldnt be relative\n : o.proto ? [this.mirror, o.proto, o.internal].join('/')\n : o.internal; // Uncanonicalizable\n }\n static gatewayUrl(url) {\n // Convert url to gateway url, if not canonicalizable then just pass the url along\n let o = Transports.canonicalName(url);\n return !o ? url : this._o2url(o)\n }\n static gatewayUrls(urls) { //TODO-API\n // Convert urls to gateway urls,\n // Easier to work on single form [ { proto, internal } ]\n const oo = urls.map(url => Transports.canonicalName(url) || { proto: undefined, internal: url }); //if not canonicalizable then just pass the url along\n const oArc = oo.filter(o => [\"arc\"].includes(o.proto)); // Prefered\n return (oArc.length ? oArc : oo) // Prefered if have them, else others\n .map(o=>this._o2url(o))\n }\n}\nTransports._transports = []; // Array of transport instances connected\nTransports.namingcb = undefined; // Will be defined by the naming component (turns URLs for names into URLs for transport)\nTransports._transportclasses = {}; // Pointers to classes whose code is loaded.\nTransports.httptools = httptools; // Static http tools\nexports = module.exports = Transports;\n\n\n//# sourceURL=webpack:///./Transports.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./httptools.js":
|
||
/*!**********************!*\
|
||
!*** ./httptools.js ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * There is an original fo this file at dweb-transports.httptools\n * and a duplicate at dweb-archivecontroller which is only there while DwebTransports is being made more usable\n */\nconst nodefetch = __webpack_require__(/*! node-fetch */ 0); // Note, were using node-fetch-npm which had a warning in webpack see https://github.com/bitinn/node-fetch/issues/421 and is intended for clients\nconst errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\"); // Standard Dweb Errors\nconst TransportError = errors.TransportError;\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('dweb-transports:httptools');\nconst queue = __webpack_require__(/*! async/queue */ \"./node_modules/async/queue.js\");\n\n\n//var fetch,Headers,Request;\n//if (typeof(Window) === \"undefined\") {\nif (typeof(fetch) === \"undefined\") {\n //var fetch = require('whatwg-fetch').fetch; //Not as good as node-fetch-npm, but might be the polyfill needed for browser.safari\n //XMLHttpRequest = require(\"xmlhttprequest\").XMLHttpRequest; // Note this doesnt work if set to a var or const, needed by whatwg-fetch\n fetch = nodefetch;\n Headers = fetch.Headers; // A class\n Request = fetch.Request; // A class\n} /* else {\n // If on a browser, need to find fetch,Headers,Request in window\n console.log(\"Loading browser version of fetch,Headers,Request\");\n fetch = window.fetch;\n Headers = window.Headers;\n Request = window.Request;\n} */\n//TODO-HTTP to work on Safari or mobile will require a polyfill, see https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch for comment\n\n\nhttptools = {};\nlet httpTaskQueue;\n\nfunction queueSetup({concurrency}) {\n httpTaskQueue = queue((task, cb) => {\n if (task.loopguard === ((typeof window != \"undefined\") && window.loopguard)) {\n fetch(task.req)\n .then(res => {\n debug(\"Fetch of %s completed\", task.what);\n httpTaskQueue.concurrency = Math.min(httpTaskQueue.concurrency+1, httpTaskQueue.running()+6);\n //debug(\"Raising concurrency to %s\", httpTaskQueue.concurrency);\n cb(null); // This is telling the queue that we are done\n task.cb(null, res); // This is the caller of the task\n })\n .catch(err => {\n // Adjust concurrency, dont go below running number (which is running-1 because this failed task counts)\n // and we know browser doesnt complain below 6\n httpTaskQueue.concurrency = Math.max(httpTaskQueue.concurrency-1, 6, httpTaskQueue.running()-1);\n //debug(\"Dropping concurrency to %s\", httpTaskQueue.concurrency);\n cb(err); // Tell queue done with an error\n if (--task.count > 0) {\n debug(\"Retrying fetch of %s in %s ms: %s\", task.what, task.ms, err.message);\n httpTaskQueue.push(task);\n /* Alternative with timeouts - not needed\n let timeout = task.ms;\n task.ms = Math.floor(task.ms*(1+Math.random())); // Spread out delays incase all requesting same time\n setTimeout(() => { httpTaskQueue.push(task);}, timeout);\n */\n } else {\n debug(\"Requeued fetch of %s failed: %s\", task.what, err.message);\n task.cb(err);\n }\n });\n } else {\n err = new Error(`Dropping fetch of ${task.what} as window changed from ${task.loopguard} to ${window.loopguard}`)\n debug(\"Dropping fetch of %s as window changed from %s to %s\", task.what, task.loopguard, window.loopguard);\n task.cb(err); // Tell caller it failed\n cb(err); // Tell queue it failed\n }\n }, concurrency)\n}\nqueueSetup({concurrency: 6});\n\nfunction queuedFetch(req, ms, count, what) {\n return new Promise((resolve, reject) => {\n count = count || 1; // 0 means 1\n httpTaskQueue.push({\n req, count, ms, what,\n loopguard: (typeof window != \"undefined\") && window.loopguard, // Optional global parameter, will cancel any loops if changes\n cb: (err, res) => {\n if(err) { reject(err); } else {resolve(res); }\n },\n });\n });\n}\n\nasync function loopfetch(req, ms, count, what) {\n /*\n A workaround for a nasty Chrome issue which fails if there is a (cross-origin?) fetch of more than 6 files. See other WORKAROUND-CHROME-CROSSORIGINFETCH\n Loops at longer and longer intervals trying\n req: Request\n ms: Initial wait between polls\n count: Max number of times to try (0 means just once)\n what: Name of what retrieving for log (usually file name or URL)\n returns Response:\n */\n let lasterr;\n let loopguard = (typeof window != \"undefined\") && window.loopguard; // Optional global parameter, will cancel any loops if changes\n count = count || 1; // count of 0 actually means 1\n while (count-- && (loopguard === ((typeof window != \"undefined\") && window.loopguard)) ) {\n try {\n return await fetch(req);\n } catch(err) {\n lasterr = err;\n debug(\"Delaying %s by %d ms because %s\", what, ms, err.message);\n await new Promise(resolve => {setTimeout(() => { resolve(); },ms)})\n ms = Math.floor(ms*(1+Math.random())); // Spread out delays incase all requesting same time\n }\n }\n console.warn(\"loopfetch of\",what,\"failed\");\n if (loopguard !== ((typeof window != \"undefined\") && window.loopguard)) {\n debug(\"Looping exited because of page change %s\", what);\n throw new Error(\"Looping exited because of page change \"+ what)\n } else {\n throw(lasterr);\n }\n}\n\nhttptools.p_httpfetch = async function(httpurl, init, {wantstream=false, retries=undefined}={}) { // Embrace and extend \"fetch\" to check result etc.\n /*\n Fetch a url\n\n httpurl: optional (depends on command)\n init: {headers}\n resolves to: data as text or json depending on Content-Type header\n throws: TransportError if fails to fetch\n */\n try {\n // THis was get(\"range\") but that works when init.headers is a Headers, but not when its an object\n debug(\"p_httpfetch: %s %o\", httpurl, init.headers.range || \"\" );\n //console.log('CTX=',init[\"headers\"].get('Content-Type'))\n // Using window.fetch, because it doesn't appear to be in scope otherwise in the browser.\n let req = new Request(httpurl, init);\n\n // EITHER Use queuedFetch if have async/queue\n let response = await queuedFetch(req, 500, retries, httpurl);\n // OR Use loopfetch if dont have async/queue and hitting browser Insufficient resources\n //let response = await loopfetch(req, 500, retries, httpurl);\n // OR use fetch for simplicity\n //let response = await fetch(req);\n\n // fetch throws (on Chrome, untested on Firefox or Node) TypeError: Failed to fetch)\n // Note response.body gets a stream and response.blob gets a blob and response.arrayBuffer gets a buffer.\n if (response.ok) {\n let contenttype = response.headers.get('Content-Type');\n if (wantstream) {\n return response.body; // Note property while json() or text() are functions\n } else if ((typeof contenttype !== \"undefined\") && contenttype.startsWith(\"application/json\")) {\n return response.json(); // promise resolving to JSON\n } else if ((typeof contenttype !== \"undefined\") && contenttype.startsWith(\"text\")) { // Note in particular this is used for responses to store\n return response.text();\n } else { // Typically application/octetStream when don't know what fetching\n return new Buffer(await response.arrayBuffer()); // Convert arrayBuffer to Buffer which is much more usable currently\n }\n }\n // noinspection ExceptionCaughtLocallyJS\n throw new TransportError(`Transport Error ${httpurl} ${response.status}: ${response.statusText}`);\n } catch (err) {\n // Error here is particularly unhelpful - if rejected during the COrs process it throws a TypeError\n debug(\"p_httpfetch failed: %s\", err.message); // note TypeErrors are generated by CORS or the Chrome anti DDOS 'feature' should catch them here and comment\n if (err instanceof TransportError) {\n throw err;\n } else {\n throw new TransportError(`Transport error thrown by ${httpurl}: ${err.message}`);\n }\n }\n}\n\nhttptools.p_GET = function(httpurl, opts={}, cb) {\n /* Locate and return a block, based on its url\n Throws TransportError if fails\n opts {\n start, end, // Range of bytes wanted - inclusive i.e. 0,1023 is 1024 bytes\n wantstream, // Return a stream rather than data\n retries=12, // How many times to retry\n noCache // Add Cache-Control: no-cache header\n }\n returns result via promise or cb(err, result)\n */\n if (typeof opts === \"function\") { cb = opts; opts = {}; }\n let headers = new Headers();\n if (opts.start || opts.end) headers.append(\"range\", `bytes=${opts.start || 0}-${(opts.end<Infinity) ? opts.end : \"\"}`);\n //if (opts.noCache) headers.append(\"Cache-Control\", \"no-cache\"); It complains about preflight with no-cache\n const retries = typeof opts.retries === \"undefined\" ? 12 : opts.retries;\n let init = { //https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch\n method: 'GET',\n headers: headers,\n mode: 'cors',\n cache: opts.noCache ? 'no-cache' : 'default', // In Chrome, This will set Cache-Control: max-age=0\n redirect: 'follow', // Chrome defaults to manual\n keepalive: true // Keep alive - mostly we'll be going back to same places a lot\n };\n const prom = httptools.p_httpfetch(httpurl, init, {retries, wantstream: opts.wantstream}); // This s a real http url\n if (cb) { prom.then((res)=>{ try { cb(null,res)} catch(err) { debug(\"Uncaught error %O\",err)}}).catch((err) => cb(err)); } else { return prom; } // Unpromisify pattern v5\n}\nhttptools.p_POST = function(httpurl, opts={}, cb) {\n /* Locate and return a block, based on its url\n opts = { data, contenttype, retries }\n returns result via promise or cb(err, result)\n */\n // Throws TransportError if fails\n //let headers = new window.Headers();\n //headers.set('content-type',type); Doesn't work, it ignores it\n if (typeof opts === \"function\") { cb = opts; opts = {}; }\n const retries = typeof opts.retries === \"undefined\" ? 0 : opts.retries;\n let init = {\n //https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch\n //https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name for headers tat cant be set\n method: 'POST',\n headers: {}, //headers,\n //body: new Buffer(data),\n body: opts.data,\n mode: 'cors',\n cache: 'default',\n redirect: 'follow', // Chrome defaults to manual\n keepalive: false // Keep alive - mostly we'll be going back to same places a lot\n };\n if (opts.contenttype) init.headers[\"Content-Type\"] = opts.contenttype;\n const prom = httptools.p_httpfetch(httpurl, init, {retries});\n if (cb) { prom.then((res)=>cb(null,res)).catch((err) => cb(err)); } else { return prom; } // Unpromisify pattern v3\n}\n\n\nexports = module.exports = httptools;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./httptools.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./index.js":
|
||
/*!******************!*\
|
||
!*** ./index.js ***!
|
||
\******************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Order is significant as should search earlier ones first\n// put IPFS before Webtorrent for showcasing, as Webtorrent works in some cases IPFS doesnt so that way we exercise both\nconst DwebTransports = __webpack_require__(/*! ./Transports.js */ \"./Transports.js\");\n// SEE-OTHER-ADDTRANSPORT\n__webpack_require__(/*! ./TransportHTTP.js */ \"./TransportHTTP.js\"); // Can access via window.DwebTransports._transportclasses[\"HTTP\"]\n__webpack_require__(/*! ./TransportIPFS.js */ \"./TransportIPFS.js\");\n__webpack_require__(/*! ./TransportYJS.js */ \"./TransportYJS.js\");\n__webpack_require__(/*! ./TransportWEBTORRENT.js */ \"./TransportWEBTORRENT.js\");\n__webpack_require__(/*! ./TransportWOLK.js */ \"./TransportWOLK.js\");\n__webpack_require__(/*! ./TransportGUN.js */ \"./TransportGUN.js\");\nif (typeof window !== \"undefined\") { window.DwebTransports = DwebTransports; }\nexports = module.exports = DwebTransports;\n\n\n//# sourceURL=webpack:///./index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/node_modules/text-encoding/index.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/node_modules/text-encoding/index.js ***!
|
||
\***************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// This is free and unencumbered software released into the public domain.\n// See LICENSE.md for more information.\n\nvar encoding = __webpack_require__(/*! ./lib/encoding.js */ \"./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding.js\");\n\nmodule.exports = {\n TextEncoder: encoding.TextEncoder,\n TextDecoder: encoding.TextDecoder,\n};\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/node_modules/text-encoding/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding-indexes.js":
|
||
/*!******************************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding-indexes.js ***!
|
||
\******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("(function(global) {\n 'use strict';\n\n if ( true && module.exports) {\n module.exports = global;\n }\n\n global[\"encoding-indexes\"] =\n{\n \"big5\":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17392,19506,17923,17830,17784,160359,19831,17843,162993,19682,163013,15253,18230,18244,19527,19520,148159,144919,160594,159371,159954,19543,172881,18255,17882,19589,162924,19719,19108,18081,158499,29221,154196,137827,146950,147297,26189,22267,null,32149,22813,166841,15860,38708,162799,23515,138590,23204,13861,171696,23249,23479,23804,26478,34195,170309,29793,29853,14453,138579,145054,155681,16108,153822,15093,31484,40855,147809,166157,143850,133770,143966,17162,33924,40854,37935,18736,34323,22678,38730,37400,31184,31282,26208,27177,34973,29772,31685,26498,31276,21071,36934,13542,29636,155065,29894,40903,22451,18735,21580,16689,145038,22552,31346,162661,35727,18094,159368,16769,155033,31662,140476,40904,140481,140489,140492,40905,34052,144827,16564,40906,17633,175615,25281,28782,40907,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,12736,12737,12738,12739,12740,131340,12741,131281,131277,12742,12743,131275,139240,12744,131274,12745,12746,12747,12748,131342,12749,12750,256,193,461,192,274,201,282,200,332,211,465,210,null,7870,null,7872,202,257,225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,null,7871,null,7873,234,609,9178,9179,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,172969,135493,null,25866,null,null,20029,28381,40270,37343,null,null,161589,25745,20250,20264,20392,20822,20852,20892,20964,21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,36710,36711,36718,29713,31996,32205,26950,31433,21031,null,null,null,null,37260,30904,37214,32956,null,36107,33014,133607,null,null,32927,40647,19661,40393,40460,19518,171510,159758,40458,172339,13761,null,28314,33342,29977,null,18705,39532,39567,40857,31111,164972,138698,132560,142054,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,163204,21797,null,134210,134421,151851,21904,142534,14828,131905,36422,150968,169189,16467,164030,30586,142392,14900,18389,164189,158194,151018,25821,134524,135092,134357,135412,25741,36478,134806,134155,135012,142505,164438,148691,null,134470,170573,164073,18420,151207,142530,39602,14951,169460,16365,13574,152263,169940,161992,142660,40302,38933,null,17369,155813,25780,21731,142668,142282,135287,14843,135279,157402,157462,162208,25834,151634,134211,36456,139681,166732,132913,null,18443,131497,16378,22643,142733,null,148936,132348,155799,134988,134550,21881,16571,17338,null,19124,141926,135325,33194,39157,134556,25465,14846,141173,36288,22177,25724,15939,null,173569,134665,142031,142537,null,135368,145858,14738,14854,164507,13688,155209,139463,22098,134961,142514,169760,13500,27709,151099,null,null,161140,142987,139784,173659,167117,134778,134196,157724,32659,135375,141315,141625,13819,152035,134796,135053,134826,16275,134960,134471,135503,134732,null,134827,134057,134472,135360,135485,16377,140950,25650,135085,144372,161337,142286,134526,134527,142417,142421,14872,134808,135367,134958,173618,158544,167122,167321,167114,38314,21708,33476,21945,null,171715,39974,39606,161630,142830,28992,33133,33004,23580,157042,33076,14231,21343,164029,37302,134906,134671,134775,134907,13789,151019,13833,134358,22191,141237,135369,134672,134776,135288,135496,164359,136277,134777,151120,142756,23124,135197,135198,135413,135414,22428,134673,161428,164557,135093,134779,151934,14083,135094,135552,152280,172733,149978,137274,147831,164476,22681,21096,13850,153405,31666,23400,18432,19244,40743,18919,39967,39821,154484,143677,22011,13810,22153,20008,22786,138177,194680,38737,131206,20059,20155,13630,23587,24401,24516,14586,25164,25909,27514,27701,27706,28780,29227,20012,29357,149737,32594,31035,31993,32595,156266,13505,null,156491,32770,32896,157202,158033,21341,34916,35265,161970,35744,36125,38021,38264,38271,38376,167439,38886,39029,39118,39134,39267,170000,40060,40479,40644,27503,63751,20023,131207,38429,25143,38050,null,20539,28158,171123,40870,15817,34959,147790,28791,23797,19232,152013,13657,154928,24866,166450,36775,37366,29073,26393,29626,144001,172295,15499,137600,19216,30948,29698,20910,165647,16393,27235,172730,16931,34319,133743,31274,170311,166634,38741,28749,21284,139390,37876,30425,166371,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,22736,138678,24210,24217,24514,141074,25995,144377,26905,27203,146531,27903,null,29184,148741,29580,16091,150035,23317,29881,35715,154788,153237,31379,31724,31939,32364,33528,34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,167353,136255,16497,17058,23066,null,null,null,39016,26475,17014,22333,null,34262,149883,33471,160013,19585,159092,23931,158485,159678,40877,40878,23446,40879,26343,32347,28247,31178,15752,17603,143958,141206,17306,17718,null,23765,146202,35577,23672,15634,144721,23928,40882,29015,17752,147692,138787,19575,14712,13386,131492,158785,35532,20404,131641,22975,33132,38998,170234,24379,134047,null,139713,166253,16642,18107,168057,16135,40883,172469,16632,14294,18167,158790,16764,165554,160767,17773,14548,152730,17761,17691,19849,19579,19830,17898,16328,150287,13921,17630,17597,16877,23870,23880,23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,25368,14840,22193,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,28201,28294,166336,28347,28386,28378,40831,28392,28393,28452,28468,15686,147265,28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,28809,131877,17345,13809,134872,147159,22462,159443,28990,153568,13902,27042,166889,23412,31305,153825,169177,31333,31357,154028,31419,31408,31426,31427,29137,156813,16842,31450,31453,31466,16879,21682,154625,31499,31573,31529,152334,154878,31650,31599,33692,154548,158847,31696,33825,31634,31672,154912,15789,154725,33938,31738,31750,31797,154817,31812,31875,149634,31910,26237,148856,31945,31943,31974,31860,31987,31989,31950,32359,17693,159300,32093,159446,29837,32137,32171,28981,32179,32210,147543,155689,32228,15635,32245,137209,32229,164717,32285,155937,155994,32366,32402,17195,37996,32295,32576,32577,32583,31030,156368,39393,32663,156497,32675,136801,131176,17756,145254,17667,164666,32762,156809,32773,32776,32797,32808,32815,172167,158915,32827,32828,32865,141076,18825,157222,146915,157416,26405,32935,166472,33031,33050,22704,141046,27775,156824,151480,25831,136330,33304,137310,27219,150117,150165,17530,33321,133901,158290,146814,20473,136445,34018,33634,158474,149927,144688,137075,146936,33450,26907,194964,16859,34123,33488,33562,134678,137140,14017,143741,144730,33403,33506,33560,147083,159139,158469,158615,144846,15807,33565,21996,33669,17675,159141,33708,33729,33747,13438,159444,27223,34138,13462,159298,143087,33880,154596,33905,15827,17636,27303,33866,146613,31064,33960,158614,159351,159299,34014,33807,33681,17568,33939,34020,154769,16960,154816,17731,34100,23282,159385,17703,34163,17686,26559,34326,165413,165435,34241,159880,34306,136578,159949,194994,17770,34344,13896,137378,21495,160666,34430,34673,172280,34798,142375,34737,34778,34831,22113,34412,26710,17935,34885,34886,161248,146873,161252,34910,34972,18011,34996,34997,25537,35013,30583,161551,35207,35210,35238,35241,35239,35260,166437,35303,162084,162493,35484,30611,37374,35472,162393,31465,162618,147343,18195,162616,29052,35596,35615,152624,152933,35647,35660,35661,35497,150138,35728,35739,35503,136927,17941,34895,35995,163156,163215,195028,14117,163155,36054,163224,163261,36114,36099,137488,36059,28764,36113,150729,16080,36215,36265,163842,135188,149898,15228,164284,160012,31463,36525,36534,36547,37588,36633,36653,164709,164882,36773,37635,172703,133712,36787,18730,166366,165181,146875,24312,143970,36857,172052,165564,165121,140069,14720,159447,36919,165180,162494,36961,165228,165387,37032,165651,37060,165606,37038,37117,37223,15088,37289,37316,31916,166195,138889,37390,27807,37441,37474,153017,37561,166598,146587,166668,153051,134449,37676,37739,166625,166891,28815,23235,166626,166629,18789,37444,166892,166969,166911,37747,37979,36540,38277,38310,37926,38304,28662,17081,140922,165592,135804,146990,18911,27676,38523,38550,16748,38563,159445,25050,38582,30965,166624,38589,21452,18849,158904,131700,156688,168111,168165,150225,137493,144138,38705,34370,38710,18959,17725,17797,150249,28789,23361,38683,38748,168405,38743,23370,168427,38751,37925,20688,143543,143548,38793,38815,38833,38846,38848,38866,38880,152684,38894,29724,169011,38911,38901,168989,162170,19153,38964,38963,38987,39014,15118,160117,15697,132656,147804,153350,39114,39095,39112,39111,19199,159015,136915,21936,39137,39142,39148,37752,39225,150057,19314,170071,170245,39413,39436,39483,39440,39512,153381,14020,168113,170965,39648,39650,170757,39668,19470,39700,39725,165376,20532,39732,158120,14531,143485,39760,39744,171326,23109,137315,39822,148043,39938,39935,39948,171624,40404,171959,172434,172459,172257,172323,172511,40318,40323,172340,40462,26760,40388,139611,172435,172576,137531,172595,40249,172217,172724,40592,40597,40606,40610,19764,40618,40623,148324,40641,15200,14821,15645,20274,14270,166955,40706,40712,19350,37924,159138,40727,40726,40761,22175,22154,40773,39352,168075,38898,33919,40802,40809,31452,40846,29206,19390,149877,149947,29047,150008,148296,150097,29598,166874,137466,31135,166270,167478,37737,37875,166468,37612,37761,37835,166252,148665,29207,16107,30578,31299,28880,148595,148472,29054,137199,28835,137406,144793,16071,137349,152623,137208,14114,136955,137273,14049,137076,137425,155467,14115,136896,22363,150053,136190,135848,136134,136374,34051,145062,34051,33877,149908,160101,146993,152924,147195,159826,17652,145134,170397,159526,26617,14131,15381,15847,22636,137506,26640,16471,145215,147681,147595,147727,158753,21707,22174,157361,22162,135135,134056,134669,37830,166675,37788,20216,20779,14361,148534,20156,132197,131967,20299,20362,153169,23144,131499,132043,14745,131850,132116,13365,20265,131776,167603,131701,35546,131596,20120,20685,20749,20386,20227,150030,147082,20290,20526,20588,20609,20428,20453,20568,20732,20825,20827,20829,20830,28278,144789,147001,147135,28018,137348,147081,20904,20931,132576,17629,132259,132242,132241,36218,166556,132878,21081,21156,133235,21217,37742,18042,29068,148364,134176,149932,135396,27089,134685,29817,16094,29849,29716,29782,29592,19342,150204,147597,21456,13700,29199,147657,21940,131909,21709,134086,22301,37469,38644,37734,22493,22413,22399,13886,22731,23193,166470,136954,137071,136976,23084,22968,37519,23166,23247,23058,153926,137715,137313,148117,14069,27909,29763,23073,155267,23169,166871,132115,37856,29836,135939,28933,18802,37896,166395,37821,14240,23582,23710,24158,24136,137622,137596,146158,24269,23375,137475,137476,14081,137376,14045,136958,14035,33066,166471,138682,144498,166312,24332,24334,137511,137131,23147,137019,23364,34324,161277,34912,24702,141408,140843,24539,16056,140719,140734,168072,159603,25024,131134,131142,140827,24985,24984,24693,142491,142599,149204,168269,25713,149093,142186,14889,142114,144464,170218,142968,25399,173147,25782,25393,25553,149987,142695,25252,142497,25659,25963,26994,15348,143502,144045,149897,144043,21773,144096,137433,169023,26318,144009,143795,15072,16784,152964,166690,152975,136956,152923,152613,30958,143619,137258,143924,13412,143887,143746,148169,26254,159012,26219,19347,26160,161904,138731,26211,144082,144097,26142,153714,14545,145466,145340,15257,145314,144382,29904,15254,26511,149034,26806,26654,15300,27326,14435,145365,148615,27187,27218,27337,27397,137490,25873,26776,27212,15319,27258,27479,147392,146586,37792,37618,166890,166603,37513,163870,166364,37991,28069,28427,149996,28007,147327,15759,28164,147516,23101,28170,22599,27940,30786,28987,148250,148086,28913,29264,29319,29332,149391,149285,20857,150180,132587,29818,147192,144991,150090,149783,155617,16134,16049,150239,166947,147253,24743,16115,29900,29756,37767,29751,17567,159210,17745,30083,16227,150745,150790,16216,30037,30323,173510,15129,29800,166604,149931,149902,15099,15821,150094,16127,149957,149747,37370,22322,37698,166627,137316,20703,152097,152039,30584,143922,30478,30479,30587,149143,145281,14942,149744,29752,29851,16063,150202,150215,16584,150166,156078,37639,152961,30750,30861,30856,30930,29648,31065,161601,153315,16654,31131,33942,31141,27181,147194,31290,31220,16750,136934,16690,37429,31217,134476,149900,131737,146874,137070,13719,21867,13680,13994,131540,134157,31458,23129,141045,154287,154268,23053,131675,30960,23082,154566,31486,16889,31837,31853,16913,154547,155324,155302,31949,150009,137136,31886,31868,31918,27314,32220,32263,32211,32590,156257,155996,162632,32151,155266,17002,158581,133398,26582,131150,144847,22468,156690,156664,149858,32733,31527,133164,154345,154947,31500,155150,39398,34373,39523,27164,144447,14818,150007,157101,39455,157088,33920,160039,158929,17642,33079,17410,32966,33033,33090,157620,39107,158274,33378,33381,158289,33875,159143,34320,160283,23174,16767,137280,23339,137377,23268,137432,34464,195004,146831,34861,160802,23042,34926,20293,34951,35007,35046,35173,35149,153219,35156,161669,161668,166901,166873,166812,166393,16045,33955,18165,18127,14322,35389,35356,169032,24397,37419,148100,26068,28969,28868,137285,40301,35999,36073,163292,22938,30659,23024,17262,14036,36394,36519,150537,36656,36682,17140,27736,28603,140065,18587,28537,28299,137178,39913,14005,149807,37051,37015,21873,18694,37307,37892,166475,16482,166652,37927,166941,166971,34021,35371,38297,38311,38295,38294,167220,29765,16066,149759,150082,148458,16103,143909,38543,167655,167526,167525,16076,149997,150136,147438,29714,29803,16124,38721,168112,26695,18973,168083,153567,38749,37736,166281,166950,166703,156606,37562,23313,35689,18748,29689,147995,38811,38769,39224,134950,24001,166853,150194,38943,169178,37622,169431,37349,17600,166736,150119,166756,39132,166469,16128,37418,18725,33812,39227,39245,162566,15869,39323,19311,39338,39516,166757,153800,27279,39457,23294,39471,170225,19344,170312,39356,19389,19351,37757,22642,135938,22562,149944,136424,30788,141087,146872,26821,15741,37976,14631,24912,141185,141675,24839,40015,40019,40059,39989,39952,39807,39887,171565,39839,172533,172286,40225,19630,147716,40472,19632,40204,172468,172269,172275,170287,40357,33981,159250,159711,158594,34300,17715,159140,159364,159216,33824,34286,159232,145367,155748,31202,144796,144960,18733,149982,15714,37851,37566,37704,131775,30905,37495,37965,20452,13376,36964,152925,30781,30804,30902,30795,137047,143817,149825,13978,20338,28634,28633,28702,28702,21524,147893,22459,22771,22410,40214,22487,28980,13487,147884,29163,158784,151447,23336,137141,166473,24844,23246,23051,17084,148616,14124,19323,166396,37819,37816,137430,134941,33906,158912,136211,148218,142374,148417,22932,146871,157505,32168,155995,155812,149945,149899,166394,37605,29666,16105,29876,166755,137375,16097,150195,27352,29683,29691,16086,150078,150164,137177,150118,132007,136228,149989,29768,149782,28837,149878,37508,29670,37727,132350,37681,166606,166422,37766,166887,153045,18741,166530,29035,149827,134399,22180,132634,134123,134328,21762,31172,137210,32254,136898,150096,137298,17710,37889,14090,166592,149933,22960,137407,137347,160900,23201,14050,146779,14000,37471,23161,166529,137314,37748,15565,133812,19094,14730,20724,15721,15692,136092,29045,17147,164376,28175,168164,17643,27991,163407,28775,27823,15574,147437,146989,28162,28428,15727,132085,30033,14012,13512,18048,16090,18545,22980,37486,18750,36673,166940,158656,22546,22472,14038,136274,28926,148322,150129,143331,135856,140221,26809,26983,136088,144613,162804,145119,166531,145366,144378,150687,27162,145069,158903,33854,17631,17614,159014,159057,158850,159710,28439,160009,33597,137018,33773,158848,159827,137179,22921,23170,137139,23137,23153,137477,147964,14125,23023,137020,14023,29070,37776,26266,148133,23150,23083,148115,27179,147193,161590,148571,148170,28957,148057,166369,20400,159016,23746,148686,163405,148413,27148,148054,135940,28838,28979,148457,15781,27871,194597,150095,32357,23019,23855,15859,24412,150109,137183,32164,33830,21637,146170,144128,131604,22398,133333,132633,16357,139166,172726,28675,168283,23920,29583,31955,166489,168992,20424,32743,29389,29456,162548,29496,29497,153334,29505,29512,16041,162584,36972,29173,149746,29665,33270,16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,16348,30330,151388,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,30801,30822,33864,152885,31027,26627,31026,16643,16649,31121,31129,36795,31238,36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,134351,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,33044,17409,15161,33110,33113,33114,17427,22586,33148,33156,17445,33171,17453,33189,22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,34990,35071,35108,35143,35217,162151,35369,35384,35476,35508,35921,36052,36082,36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,19565,39968,14191,138178,40265,39994,40702,22096,40339,40381,40384,40444,38134,36790,40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,131220,131767,132000,26906,38083,22956,132311,22592,38081,14265,132565,132629,132726,136890,22359,29043,133826,133837,134079,21610,194619,134091,21662,134139,134203,134227,134245,134268,24807,134285,22138,134325,134365,134381,134511,134578,134600,26965,39983,34725,134660,134670,134871,135056,134957,134771,23584,135100,24075,135260,135247,135286,26398,135291,135304,135318,13895,135359,135379,135471,135483,21348,33965,135907,136053,135990,35713,136567,136729,137155,137159,20088,28859,137261,137578,137773,137797,138282,138352,138412,138952,25283,138965,139029,29080,26709,139333,27113,14024,139900,140247,140282,141098,141425,141647,33533,141671,141715,142037,35237,142056,36768,142094,38840,142143,38983,39613,142412,null,142472,142519,154600,142600,142610,142775,142741,142914,143220,143308,143411,143462,144159,144350,24497,26184,26303,162425,144743,144883,29185,149946,30679,144922,145174,32391,131910,22709,26382,26904,146087,161367,155618,146961,147129,161278,139418,18640,19128,147737,166554,148206,148237,147515,148276,148374,150085,132554,20946,132625,22943,138920,15294,146687,148484,148694,22408,149108,14747,149295,165352,170441,14178,139715,35678,166734,39382,149522,149755,150037,29193,150208,134264,22885,151205,151430,132985,36570,151596,21135,22335,29041,152217,152601,147274,150183,21948,152646,152686,158546,37332,13427,152895,161330,152926,18200,152930,152934,153543,149823,153693,20582,13563,144332,24798,153859,18300,166216,154286,154505,154630,138640,22433,29009,28598,155906,162834,36950,156082,151450,35682,156674,156746,23899,158711,36662,156804,137500,35562,150006,156808,147439,156946,19392,157119,157365,141083,37989,153569,24981,23079,194765,20411,22201,148769,157436,20074,149812,38486,28047,158909,13848,35191,157593,157806,156689,157790,29151,157895,31554,168128,133649,157990,37124,158009,31301,40432,158202,39462,158253,13919,156777,131105,31107,158260,158555,23852,144665,33743,158621,18128,158884,30011,34917,159150,22710,14108,140685,159819,160205,15444,160384,160389,37505,139642,160395,37680,160486,149968,27705,38047,160848,134904,34855,35061,141606,164979,137137,28344,150058,137248,14756,14009,23568,31203,17727,26294,171181,170148,35139,161740,161880,22230,16607,136714,14753,145199,164072,136133,29101,33638,162269,168360,23143,19639,159919,166315,162301,162314,162571,163174,147834,31555,31102,163849,28597,172767,27139,164632,21410,159239,37823,26678,38749,164207,163875,158133,136173,143919,163912,23941,166960,163971,22293,38947,166217,23979,149896,26046,27093,21458,150181,147329,15377,26422,163984,164084,164142,139169,164175,164233,164271,164378,164614,164655,164746,13770,164968,165546,18682,25574,166230,30728,37461,166328,17394,166375,17375,166376,166726,166868,23032,166921,36619,167877,168172,31569,168208,168252,15863,168286,150218,36816,29327,22155,169191,169449,169392,169400,169778,170193,170313,170346,170435,170536,170766,171354,171419,32415,171768,171811,19620,38215,172691,29090,172799,19857,36882,173515,19868,134300,36798,21953,36794,140464,36793,150163,17673,32383,28502,27313,20202,13540,166700,161949,14138,36480,137205,163876,166764,166809,162366,157359,15851,161365,146615,153141,153942,20122,155265,156248,22207,134765,36366,23405,147080,150686,25566,25296,137206,137339,25904,22061,154698,21530,152337,15814,171416,19581,22050,22046,32585,155352,22901,146752,34672,19996,135146,134473,145082,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,33527,22053,33074,33816,32957,21994,31074,22083,21526,134813,13774,22021,22001,26353,164578,13869,30004,22000,21946,21655,21874,134209,134294,24272,151880,134774,142434,134818,40619,32090,21982,135285,25245,38765,21652,36045,29174,37238,25596,25529,25598,21865,142147,40050,143027,20890,13535,134567,20903,21581,21790,21779,30310,36397,157834,30129,32950,34820,34694,35015,33206,33820,135361,17644,29444,149254,23440,33547,157843,22139,141044,163119,147875,163187,159440,160438,37232,135641,37384,146684,173737,134828,134905,29286,138402,18254,151490,163833,135147,16634,40029,25887,142752,18675,149472,171388,135148,134666,24674,161187,135149,null,155720,135559,29091,32398,40272,19994,19972,13687,23309,27826,21351,13996,14812,21373,13989,149016,22682,150382,33325,21579,22442,154261,133497,null,14930,140389,29556,171692,19721,39917,146686,171824,19547,151465,169374,171998,33884,146870,160434,157619,145184,25390,32037,147191,146988,14890,36872,21196,15988,13946,17897,132238,30272,23280,134838,30842,163630,22695,16575,22140,39819,23924,30292,173108,40581,19681,30201,14331,24857,143578,148466,null,22109,135849,22439,149859,171526,21044,159918,13741,27722,40316,31830,39737,22494,137068,23635,25811,169168,156469,160100,34477,134440,159010,150242,134513,null,20990,139023,23950,38659,138705,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,39726,31810,31878,39957,31740,39689,40727,39963,149822,40794,21875,23491,20477,40600,20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,39232,38842,21292,24880,26924,21466,39946,40194,19515,38465,27008,20646,30022,137069,39386,21107,null,37209,38529,37212,null,37201,167575,25471,159011,27338,22033,37262,30074,25221,132092,29519,31856,154657,146685,null,149785,30422,39837,20010,134356,33726,34882,null,23626,27072,20717,22394,21023,24053,20174,27697,131570,20281,21660,21722,21146,36226,13822,24332,13811,null,27474,37244,40869,39831,38958,39092,39610,40616,40580,29050,31508,null,27642,34840,32632,null,22048,173642,36471,40787,null,36308,36431,40476,36353,25218,164733,36392,36469,31443,150135,31294,30936,27882,35431,30215,166490,40742,27854,34774,30147,172722,30803,194624,36108,29410,29553,35629,29442,29937,36075,150203,34351,24506,34976,17591,null,137275,159237,null,35454,140571,null,24829,30311,39639,40260,37742,39823,34805,null,34831,36087,29484,38689,39856,13782,29362,19463,31825,39242,155993,24921,19460,40598,24957,null,22367,24943,25254,25145,25294,14940,25058,21418,144373,25444,26626,13778,23895,166850,36826,167481,null,20697,138566,30982,21298,38456,134971,16485,null,30718,null,31938,155418,31962,31277,32870,32867,32077,29957,29938,35220,33306,26380,32866,160902,32859,29936,33027,30500,35209,157644,30035,159441,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,27058,36262,null,35241,29800,28089,34753,147473,29927,15835,29046,24740,24988,15569,29026,24695,null,32625,166701,29264,24809,19326,21024,15384,146631,155351,161366,152881,137540,135934,170243,159196,159917,23745,156077,166415,145015,131310,157766,151310,17762,23327,156492,40784,40614,156267,12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,65115,65116,65117,65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,8453,175,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,8801,65122,65123,65124,65125,65126,65374,8745,8746,8869,8736,8735,8895,13266,13265,8747,8750,8757,8756,9792,9794,8853,8857,8593,8595,8592,8594,8598,8599,8601,8600,8741,8739,65295,65340,8725,65128,65284,65509,12306,65504,65505,65285,65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,9552,9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,729,713,714,711,715,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9249,8364,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19968,20057,19969,19971,20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,24051,24062,24178,24318,24331,24339,25165,19985,19984,19981,20013,20016,20025,20043,23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,21488,21477,21485,21499,22235,22234,22806,22830,22833,22900,22902,23381,23427,23612,24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,23546,23574,23673,24030,24070,24182,24180,24335,24347,24537,24534,25102,25100,25101,25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,22256,22244,22251,22346,22353,22336,22349,22343,22350,22334,22352,22351,22331,22767,22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,32925,32920,32923,32922,32946,33391,33426,33419,33421,35211,35282,35328,35895,35910,35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,23448,23452,23449,23451,23578,23624,23621,23622,23735,23713,23736,23721,23723,23729,23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,27867,27850,27820,27887,27868,27862,27872,28821,28814,28818,28810,28825,29228,29229,29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,21670,21683,21703,21698,21693,21674,21697,21700,21704,21679,21675,21681,21691,21673,21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,27946,27969,27941,27916,27953,27934,27927,27963,27965,27966,27958,27931,27893,27961,27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,36557,36556,36848,36838,36834,36842,36837,36845,36843,36836,36840,37066,37070,37057,37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,24237,24231,24369,24466,24465,24464,24665,24675,24677,24656,24661,24685,24681,24687,24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,30697,30768,30759,30776,30749,30772,30775,30757,30765,30752,30751,30770,31061,31056,31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,37335,37340,37337,38275,38498,38499,38497,38491,38493,38500,38488,38494,38587,39138,39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,24713,24736,24744,24779,24756,24806,24765,24773,24763,24757,24796,24764,24792,24789,24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,29706,29699,29702,29694,29709,29920,29942,29943,29980,29986,30053,30054,30050,30064,30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,36894,36896,36879,36898,36886,36891,36884,37096,37101,37117,37207,37326,37365,37350,37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,25484,25551,25536,25577,25545,25542,25549,25554,25571,25552,25569,25558,25581,25582,25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,30831,31245,31240,31243,31237,31232,31384,31383,31382,31461,31459,31561,31574,31558,31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,37392,37383,37393,38292,38287,38283,38289,38291,38290,38286,38538,38542,38539,38525,38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,26262,26244,26264,26253,26371,27028,26989,26970,26999,26976,26964,26997,26928,27010,26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,33137,33136,33144,33125,33134,33139,33131,33145,33146,33126,33285,33351,33922,33911,33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,38929,38931,38922,38930,38924,39164,39156,39165,39166,39347,39345,39348,39649,40169,40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,28457,28478,28448,28460,28431,28418,28450,28415,28399,28422,28465,28472,28466,28451,28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,35468,35486,35491,35469,35489,35475,35492,35498,35493,35496,35480,35473,35482,35495,35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,24501,24950,24935,24942,24925,24917,24962,24956,24944,24939,24958,24999,24976,25003,24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,32158,32217,32242,32249,32629,32631,32687,32745,32806,33179,33180,33181,33184,33178,33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,39719,39749,39748,39799,39791,40198,40201,40195,40617,40638,40654,22696,40786,20754,20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,31707,31713,31721,31718,31957,31958,32266,32273,32264,32283,32291,32286,32285,32265,32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,20786,21237,22158,22144,22160,22149,22151,22159,22741,22739,22737,22734,23344,23338,23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,33213,33225,33214,33256,33289,33393,34218,34180,34174,34204,34193,34196,34223,34203,34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,29559,29557,29863,29887,29973,30294,30296,30290,30653,30655,30651,30652,30990,31150,31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,28693,28696,29190,29197,29272,29346,29560,29562,29885,29898,29923,30087,30086,30303,30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,31811,31821,31983,31984,36782,32381,32380,32386,32588,32768,33242,33382,34299,34297,34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,28753,28760,29568,29924,30090,30318,30316,31155,31840,31839,32894,32893,33247,35186,35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,40474,29224,39530,39729,40475,40478,31858,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,21304,21353,21430,22794,23424,24027,12083,24191,24308,24400,24417,25908,26080,30098,30326,36789,38582,168,710,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,65339,65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,131276,20058,131210,20994,17553,40880,20872,40881,161287,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65506,65508,65287,65282,12849,8470,8481,12443,12444,11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,11998,12003,null,null,null,643,592,603,596,629,339,248,331,650,618,20034,20060,20981,21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,23667,24068,24192,24194,24521,25097,25168,27669,27702,27715,27711,27707,29358,29360,29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,21559,21546,21588,21573,21529,21532,21541,21528,21565,21583,21569,21544,21540,21575,22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,32914,32924,33424,33423,33413,33422,33425,33427,33418,33411,33412,35960,36809,36799,37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,24445,24542,24549,24621,24614,24601,24626,24587,24628,24586,24599,24627,24602,24606,24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,30449,30448,30453,30712,30716,30713,30715,30714,30711,31042,31039,31173,31352,31355,31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,23464,23628,23760,23768,23756,23767,23755,23771,23774,23770,23753,23751,23754,23766,23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,27908,27929,27962,27930,27921,27904,27933,27970,27905,27928,27959,27907,27919,27968,27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,33505,33522,33525,33548,33531,33526,33520,33514,33508,33504,33530,33523,33517,34423,34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,24234,24236,24371,24368,24423,24669,24666,24679,24641,24738,24712,24704,24722,24705,24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,28869,28870,28871,28890,28878,28897,29250,29304,29303,29302,29440,29434,29428,29438,29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,33617,33573,33622,33599,33601,33574,33564,33570,33602,33614,33563,33578,33544,33596,33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,21802,21841,21858,21814,21813,21808,21842,21829,21772,21810,21861,21838,21817,21832,21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,25461,25500,25453,25518,25468,25508,25403,25503,25464,25477,25473,25489,25485,25456,25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,29707,29684,29704,30052,30051,30158,30162,30159,30155,30156,30161,30160,30351,30345,30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,33671,33710,33654,33690,34393,34390,34495,34487,34498,34497,34501,34490,34480,34504,34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,21926,21887,21909,21921,21902,22284,22569,22583,22553,22558,22567,22563,22568,22517,22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,25960,25957,25996,26013,26014,26030,26064,26066,26236,26220,26235,26240,26225,26233,26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,29475,29493,29452,29742,29740,29744,29739,29718,29722,29729,29741,29745,29732,29731,29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,33737,33801,33807,33758,33809,33798,33730,33779,33749,33786,33735,33745,33770,33811,33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,37398,38267,38285,38284,38288,38535,38526,38536,38537,38531,38528,38594,38600,38595,38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,25541,25585,25579,25616,25618,25609,25632,25636,25651,25667,25631,25621,25624,25657,25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,28994,29016,28995,29003,29040,29023,29008,29011,28996,29005,29018,29263,29325,29324,29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,33115,33122,33138,26401,33118,33142,33127,33135,33092,33121,33309,33353,33348,33344,33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,36608,36613,36615,36616,36610,36619,36946,36927,36932,36937,36925,37136,37133,37135,37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,23276,23262,23261,23257,23272,23263,23415,23520,23523,23651,23938,23936,23933,23942,23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,28441,28442,28455,28440,28475,28434,28397,28426,28470,28531,28409,28398,28461,28480,28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,32169,32161,32201,32627,32738,32739,32741,32734,32804,32861,32860,33161,33158,33155,33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,37540,37494,37531,37498,37536,37524,37546,37517,37542,37530,37547,37497,37527,37503,37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,24498,24971,24963,24953,25009,25008,24994,24969,24987,24979,25007,25005,24991,24978,25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,29534,29535,29536,29533,29531,29537,29530,29529,29538,29831,29833,29834,29830,29825,29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,34041,34072,34080,34096,34059,34073,34095,34402,34646,34659,34660,34679,34785,34675,34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,37581,37589,37577,37600,37598,37607,37585,37587,37557,37601,37574,37556,38268,38316,38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,25000,24982,25029,25012,25030,25025,25036,25018,25023,25016,24972,25815,25814,25808,25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,30621,30625,30620,30619,30626,30627,30613,30617,30615,30941,30953,30949,30954,30942,30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,35106,35113,35107,35119,35116,35103,35313,35552,35554,35570,35572,35573,35549,35604,35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,39806,39803,39810,39827,39826,39824,39802,39829,39805,39816,40229,40215,40224,40222,40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,30279,30372,30441,30645,30635,30642,30647,30646,30644,30641,30632,30704,30963,30973,30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,35127,35138,35245,35247,35246,35314,35315,35614,35608,35606,35601,35589,35595,35618,35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,40257,40295,40246,40238,40239,40241,40248,40240,40261,40258,40259,40254,40247,40256,40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,32339,32693,32691,32759,32760,32885,33233,33234,33232,33375,33374,34228,34246,34240,34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,38690,38693,38828,38830,38824,38827,38820,38826,38818,38821,38871,38873,38870,38872,38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,29974,30304,30665,30666,30660,30705,31005,31003,31009,31004,30999,31006,31152,31335,31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,38362,38363,38625,38697,38699,38700,38696,38694,38835,38839,38838,38877,38878,38879,39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,30669,30706,31013,31011,31015,31016,31012,31017,31154,31342,31340,31341,31479,31817,31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,40351,40345,40356,40349,40338,40344,40336,40347,40352,40340,40348,40362,40343,40353,40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,39254,39481,39485,39494,39492,39490,39489,39482,39487,39629,39701,39703,39704,39702,39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,39259,39502,39507,39508,39500,39503,39496,39498,39497,39506,39504,39632,39705,39723,39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,40691,40710,40732,40760,40759,40758,40771,40783,40817,40816,40814,40815,22227,22221,23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,40052,40051,40049,40053,40468,40467,40694,40714,40868,28776,28773,31991,34410,34878,34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,40058,40477,28777,28778,40612,40830,40777,40856,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,65517,132423,37595,132575,147397,34124,17077,29679,20917,13897,149826,166372,37700,137691,33518,146632,30780,26436,25311,149811,166314,131744,158643,135941,20395,140525,20488,159017,162436,144896,150193,140563,20521,131966,24484,131968,131911,28379,132127,20605,20737,13434,20750,39020,14147,33814,149924,132231,20832,144308,20842,134143,139516,131813,140592,132494,143923,137603,23426,34685,132531,146585,20914,20920,40244,20937,20943,20945,15580,20947,150182,20915,20962,21314,20973,33741,26942,145197,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,21216,34317,158483,21253,166622,21833,28377,147328,133460,147436,21299,21316,134114,27851,136998,26651,29653,24650,16042,14540,136936,29149,17570,21357,21364,165547,21374,21375,136598,136723,30694,21395,166555,21408,21419,21422,29607,153458,16217,29596,21441,21445,27721,20041,22526,21465,15019,134031,21472,147435,142755,21494,134263,21523,28793,21803,26199,27995,21613,158547,134516,21853,21647,21668,18342,136973,134877,15796,134477,166332,140952,21831,19693,21551,29719,21894,21929,22021,137431,147514,17746,148533,26291,135348,22071,26317,144010,26276,26285,22093,22095,30961,22257,38791,21502,22272,22255,22253,166758,13859,135759,22342,147877,27758,28811,22338,14001,158846,22502,136214,22531,136276,148323,22566,150517,22620,22698,13665,22752,22748,135740,22779,23551,22339,172368,148088,37843,13729,22815,26790,14019,28249,136766,23076,21843,136850,34053,22985,134478,158849,159018,137180,23001,137211,137138,159142,28017,137256,136917,23033,159301,23211,23139,14054,149929,23159,14088,23190,29797,23251,159649,140628,15749,137489,14130,136888,24195,21200,23414,25992,23420,162318,16388,18525,131588,23509,24928,137780,154060,132517,23539,23453,19728,23557,138052,23571,29646,23572,138405,158504,23625,18653,23685,23785,23791,23947,138745,138807,23824,23832,23878,138916,23738,24023,33532,14381,149761,139337,139635,33415,14390,15298,24110,27274,24181,24186,148668,134355,21414,20151,24272,21416,137073,24073,24308,164994,24313,24315,14496,24316,26686,37915,24333,131521,194708,15070,18606,135994,24378,157832,140240,24408,140401,24419,38845,159342,24434,37696,166454,24487,23990,15711,152144,139114,159992,140904,37334,131742,166441,24625,26245,137335,14691,15815,13881,22416,141236,31089,15936,24734,24740,24755,149890,149903,162387,29860,20705,23200,24932,33828,24898,194726,159442,24961,20980,132694,24967,23466,147383,141407,25043,166813,170333,25040,14642,141696,141505,24611,24924,25886,25483,131352,25285,137072,25301,142861,25452,149983,14871,25656,25592,136078,137212,25744,28554,142902,38932,147596,153373,25825,25829,38011,14950,25658,14935,25933,28438,150056,150051,25989,25965,25951,143486,26037,149824,19255,26065,16600,137257,26080,26083,24543,144384,26136,143863,143864,26180,143780,143781,26187,134773,26215,152038,26227,26228,138813,143921,165364,143816,152339,30661,141559,39332,26370,148380,150049,15147,27130,145346,26462,26471,26466,147917,168173,26583,17641,26658,28240,37436,26625,144358,159136,26717,144495,27105,27147,166623,26995,26819,144845,26881,26880,15666,14849,144956,15232,26540,26977,166474,17148,26934,27032,15265,132041,33635,20624,27129,144985,139562,27205,145155,27293,15347,26545,27336,168348,15373,27421,133411,24798,27445,27508,141261,28341,146139,132021,137560,14144,21537,146266,27617,147196,27612,27703,140427,149745,158545,27738,33318,27769,146876,17605,146877,147876,149772,149760,146633,14053,15595,134450,39811,143865,140433,32655,26679,159013,159137,159211,28054,27996,28284,28420,149887,147589,159346,34099,159604,20935,27804,28189,33838,166689,28207,146991,29779,147330,31180,28239,23185,143435,28664,14093,28573,146992,28410,136343,147517,17749,37872,28484,28508,15694,28532,168304,15675,28575,147780,28627,147601,147797,147513,147440,147380,147775,20959,147798,147799,147776,156125,28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,148087,28971,28997,23176,29002,29038,23708,148325,29007,37730,148161,28972,148570,150055,150050,29114,166888,28861,29198,37954,29205,22801,37955,29220,37697,153093,29230,29248,149876,26813,29269,29271,15957,143428,26637,28477,29314,29482,29483,149539,165931,18669,165892,29480,29486,29647,29610,134202,158254,29641,29769,147938,136935,150052,26147,14021,149943,149901,150011,29687,29717,26883,150054,29753,132547,16087,29788,141485,29792,167602,29767,29668,29814,33721,29804,14128,29812,37873,27180,29826,18771,150156,147807,150137,166799,23366,166915,137374,29896,137608,29966,29929,29982,167641,137803,23511,167596,37765,30029,30026,30055,30062,151426,16132,150803,30094,29789,30110,30132,30210,30252,30289,30287,30319,30326,156661,30352,33263,14328,157969,157966,30369,30373,30391,30412,159647,33890,151709,151933,138780,30494,30502,30528,25775,152096,30552,144044,30639,166244,166248,136897,30708,30729,136054,150034,26826,30895,30919,30931,38565,31022,153056,30935,31028,30897,161292,36792,34948,166699,155779,140828,31110,35072,26882,31104,153687,31133,162617,31036,31145,28202,160038,16040,31174,168205,31188],\n \"euc-kr\":[44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,null,null,null,null,null,null,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,44115,44117,null,null,null,null,null,null,44118,44119,44121,44122,44123,44125,44126,44127,44128,44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,null,null,null,null,null,null,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,44374,44375,null,null,null,null,null,null,44377,44378,44379,44380,44381,44382,44383,44384,44386,44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,null,null,null,null,null,null,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,44603,44604,null,null,null,null,null,null,44605,44606,44607,44610,44612,44615,44616,44617,44619,44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,null,null,null,null,null,null,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,44834,44835,null,null,null,null,null,null,44836,44837,44838,44839,44840,44841,44842,44843,44846,44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,null,null,null,null,null,null,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,45058,45059,null,null,null,null,null,null,45061,45062,45063,45064,45065,45066,45067,45069,45070,45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,null,null,null,null,null,null,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,45295,45296,null,null,null,null,null,null,45297,45298,45299,45300,45301,45302,45303,45304,45305,45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,null,null,null,null,null,null,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,45523,45525,null,null,null,null,null,null,45526,45527,45528,45529,45530,45531,45534,45536,45537,45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,null,null,null,null,null,null,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,45750,45751,null,null,null,null,null,null,45752,45753,45754,45755,45756,45757,45758,45759,45760,45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,null,null,null,null,null,null,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,45995,45997,null,null,null,null,null,null,45998,45999,46000,46001,46002,46003,46004,46005,46006,46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,null,null,null,null,null,null,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,46209,46210,null,null,null,null,null,null,46211,46212,46213,46214,46215,46217,46218,46219,46220,46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,null,null,null,null,null,null,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,46441,46442,null,null,null,null,null,null,46443,46444,46445,46446,46447,46448,46449,46450,46451,46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,null,null,null,null,null,null,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,46649,46650,null,null,null,null,null,null,46651,46652,46653,46654,46655,46656,46657,46658,46659,46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,null,null,null,null,null,null,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,46841,46842,null,null,null,null,null,null,46843,46844,46845,46846,46847,46850,46851,46852,46854,46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,null,null,null,null,null,null,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,47068,47069,null,null,null,null,null,null,47070,47071,47072,47073,47074,47075,47076,47077,47078,47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,null,null,null,null,null,null,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,47292,47293,null,null,null,null,null,null,47294,47295,47298,47300,47302,47303,47304,47305,47306,47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,null,null,null,null,null,null,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,47517,47518,null,null,null,null,null,null,47519,47520,47521,47522,47523,47524,47525,47526,47527,47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,null,null,null,null,null,null,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,47761,47762,null,null,null,null,null,null,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,null,null,null,null,null,null,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,47984,47985,null,null,null,null,null,null,47986,47987,47988,47989,47990,47991,47992,47993,47994,47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,null,null,null,null,null,null,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,48216,48217,null,null,null,null,null,null,48218,48219,48220,48222,48223,48224,48225,48226,48227,48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,null,null,null,null,null,null,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,48440,48441,null,null,null,null,null,null,48442,48443,48444,48445,48446,48447,48449,48450,48451,48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,null,null,null,null,null,null,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,48658,48659,null,null,null,null,null,null,48661,48662,48663,48664,48665,48666,48667,48670,48672,48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,null,null,null,null,null,null,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,48884,48885,null,null,null,null,null,null,48886,48887,48888,48889,48890,48891,48892,48893,48894,48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,null,null,null,null,null,null,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,49079,49080,null,null,null,null,null,null,49081,49082,49083,49084,49085,49086,49087,49088,49089,49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,null,null,null,null,null,null,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,null,null,null,null,null,null,49274,49275,49276,49277,49278,49279,49280,49281,49282,49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,null,null,null,null,null,null,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,49530,49531,null,null,null,null,null,null,49532,49533,49534,49535,49536,49537,49538,49539,49540,49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,null,null,null,null,null,null,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,49764,49766,null,null,null,null,null,null,49767,49768,49769,49770,49771,49774,49775,49777,49778,49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,null,null,null,null,null,null,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,49996,49997,null,null,null,null,null,null,49998,49999,50000,50001,50002,50003,50004,50005,50006,50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,null,null,null,null,null,null,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,50201,50202,null,null,null,null,null,null,50203,50204,50205,50206,50207,50208,50209,50210,50211,50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,null,null,null,null,null,null,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,50398,50399,null,null,null,null,null,null,50400,50401,50402,50403,50404,50405,50406,50407,50408,50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,null,null,null,null,null,null,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,50662,50663,null,null,null,null,null,null,50664,50665,50666,50667,50671,50673,50674,50675,50677,50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,null,null,null,null,null,null,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,50929,50930,null,null,null,null,null,null,50931,50932,50933,50934,50935,50938,50939,50940,50942,50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,null,null,null,null,null,null,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,51193,51194,null,null,null,null,null,null,51195,51196,51197,51198,51199,51202,51203,51205,51206,51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,null,null,null,null,null,null,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,51427,51429,null,null,null,null,null,null,51430,51431,51432,51433,51434,51435,51436,51437,51438,51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,8835,8746,8745,8743,8744,65506,51472,51474,51475,51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,null,null,null,null,null,null,51501,51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,null,null,null,null,null,null,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,51560,51561,51562,51563,51565,51566,51567,8658,8660,8704,8707,180,65374,711,728,733,730,729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51569,51570,51571,51573,51574,51575,51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,51590,51591,51594,51595,51597,51598,51599,null,null,null,null,null,null,51601,51602,51603,51604,51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,51622,51623,51624,51625,51626,51627,51628,51629,51630,null,null,null,null,null,null,51631,51632,51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,51668,51671,51672,51675,65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,51678,51679,51681,51683,51685,51686,51688,51689,51690,51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,51713,51714,51715,51716,null,null,null,null,null,null,51717,51718,51719,51722,51726,51727,51728,51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,51744,51745,51746,51747,51748,51749,null,null,null,null,null,null,51750,51751,51752,51754,51755,51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,51782,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,51818,null,null,null,null,null,null,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,51843,51845,51846,null,null,null,null,null,null,51847,51848,51849,51850,51851,51852,51853,51854,51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,null,null,null,null,null,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,51880,51881,51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,null,null,null,null,null,null,51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,null,null,null,null,null,null,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,51970,51971,51972,51973,51974,51975,51977,51978,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51979,51980,51981,51982,51983,51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,52002,52003,52004,52005,52006,52007,52008,52009,null,null,null,null,null,null,52010,52011,52012,52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,null,null,null,null,null,null,52037,52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,52072,52073,52074,52075,52076,13205,13206,13207,8467,13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52077,52078,52079,52080,52081,52082,52083,52084,52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,52100,52101,52102,52103,52104,null,null,null,null,null,null,52105,52106,52107,52108,52109,52110,52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,52125,52126,52127,52128,52129,52130,52131,null,null,null,null,null,null,52132,52133,52134,52135,52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,52163,52164,198,208,170,294,null,306,null,319,321,216,338,186,222,358,330,null,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540,8541,8542,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,52190,52191,null,null,null,null,null,null,52192,52193,52194,52195,52197,52198,52200,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217,52218,52219,52220,null,null,null,null,null,null,52221,52222,52223,52224,52225,52226,52227,52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,52261,52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,null,null,null,null,null,null,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,52338,null,null,null,null,null,null,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,52363,52364,52365,52366,52367,52368,52369,52370,52371,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,52372,52373,52374,52375,52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,52398,52399,52400,52401,52402,52403,52406,52407,52409,null,null,null,null,null,null,52410,52411,52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,null,null,null,null,null,null,52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,52472,52473,52474,52475,52476,52477,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,52478,52479,52480,52482,52483,52484,52485,52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,52503,52506,52508,52510,52511,52512,null,null,null,null,null,null,52513,52514,52515,52517,52518,52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,52534,52535,52536,52538,52539,52540,52541,52542,null,null,null,null,null,null,52543,52544,52545,52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,52573,52574,52575,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,52606,52607,52608,null,null,null,null,null,null,52609,52610,52611,52612,52613,52614,52615,52617,52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,52634,52635,52637,52638,52639,null,null,null,null,null,null,52640,52641,52642,52643,52646,52648,52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,null,null,null,null,null,null,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,52737,52738,null,null,null,null,null,null,52739,52741,52742,52743,52745,52746,52747,52749,52750,52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52780,52781,52782,52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,null,null,null,null,null,null,52810,52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,null,null,null,null,null,null,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,52879,52882,52883,52885,52886,52887,52889,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52890,52891,52892,52893,52894,52895,52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,52916,52917,52918,52919,52920,52921,52922,null,null,null,null,null,null,52923,52924,52925,52926,52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,52941,52942,52943,52944,52945,52946,52947,52948,52949,null,null,null,null,null,null,52950,52951,52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,52988,52989,52990,52991,44032,44033,44036,44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,52994,52995,52997,52998,52999,53001,53002,53003,53004,53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,53023,53025,53026,53027,null,null,null,null,null,null,53029,53030,53031,53032,53033,53034,53035,53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53060,null,null,null,null,null,null,53061,53062,53063,53064,53065,53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,53100,44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,53133,null,null,null,null,null,null,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,53158,53159,53161,null,null,null,null,null,null,53162,53163,53164,53165,53166,53167,53169,53170,53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143,45145,53196,53197,53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,null,null,null,null,null,null,53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,null,null,null,null,null,null,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,53285,53286,53287,53288,53289,53290,53291,53292,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516,45520,45524,45532,45533,53294,53295,53296,53297,53298,53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,53318,53320,53322,53323,53324,53325,53326,53327,null,null,null,null,null,null,53329,53330,53331,53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,null,null,null,null,null,null,53361,53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,53392,53393,53394,53395,53396,45535,45544,45545,45548,45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,53397,53398,53399,53400,53401,53402,53403,53404,53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,53422,53423,53424,53425,53426,null,null,null,null,null,null,53427,53430,53432,53434,53435,53436,53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,53455,53458,53462,53463,53464,53465,53466,null,null,null,null,null,null,53467,53470,53471,53473,53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,53507,53508,45927,45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,53534,53535,null,null,null,null,null,null,53536,53537,53538,53539,53540,53541,53542,53543,53544,53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,53563,53564,53565,53566,null,null,null,null,null,null,53567,53570,53574,53575,53576,53577,53578,53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998,46999,53614,53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,null,null,null,null,null,null,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,53671,null,null,null,null,null,null,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,53703,53704,53705,53706,53707,53708,53709,53710,53711,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,53712,53713,53714,53715,53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,53730,53731,53732,53733,53734,53735,53736,53737,53738,null,null,null,null,null,null,53739,53740,53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,null,null,null,null,null,null,53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,53796,53797,53798,53799,53800,53801,47467,47469,47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,53802,53803,53806,53807,53809,53810,53811,53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,53830,53831,53833,53834,53835,53836,null,null,null,null,null,null,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,53856,53857,53858,53859,53861,53862,53863,53864,null,null,null,null,null,null,53865,53866,53867,53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,53898,53899,53900,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,53930,53931,53933,null,null,null,null,null,null,53934,53935,53936,53938,53939,53940,53941,53942,53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,53965,53966,53967,53968,53969,null,null,null,null,null,null,53970,53971,53973,53974,53975,53977,53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,null,null,null,null,null,null,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,54088,54089,null,null,null,null,null,null,54090,54091,54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373,49380,54122,54123,54124,54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,null,null,null,null,null,null,54152,54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,null,null,null,null,null,null,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228,54229,54230,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,54231,54233,54234,54235,54236,54237,54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,54255,54257,54258,54259,54261,54262,54263,null,null,null,null,null,null,54264,54265,54266,54267,54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,54286,54287,54288,54289,54290,54291,54292,54293,54294,null,null,null,null,null,null,54295,54296,54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,54324,54325,54326,54327,49711,49713,49714,49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,54328,54329,54330,54331,54332,54333,54334,54335,54337,54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,54354,54355,null,null,null,null,null,null,54356,54357,54358,54359,54360,54361,54362,54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,54379,54380,54382,54384,54385,54386,null,null,null,null,null,null,54387,54388,54389,54390,54391,54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,54429,50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,54456,null,null,null,null,null,null,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,54482,54483,54485,null,null,null,null,null,null,54486,54487,54488,54489,54490,54491,54493,54494,54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912,50913,50920,54526,54527,54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,null,null,null,null,null,null,54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,null,null,null,null,null,null,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,54618,54619,54621,54622,54623,54625,54626,54627,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,54628,54630,54631,54634,54636,54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,54655,54656,54657,54658,54659,54662,54666,54667,null,null,null,null,null,null,54668,54669,54670,54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,null,null,null,null,null,null,54696,54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,54723,54724,54725,54726,54727,51216,51217,51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,54730,54731,54733,54734,54735,54737,54739,54740,54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,54761,54762,54763,54765,54766,null,null,null,null,null,null,54767,54768,54769,54770,54771,54774,54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,54794,54795,54796,54797,54798,54799,54802,null,null,null,null,null,null,54806,54807,54808,54809,54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,54842,54843,51669,51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,54880,54881,null,null,null,null,null,null,54882,54883,54884,54885,54886,54888,54890,54891,54892,54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54911,54912,null,null,null,null,null,null,54913,54914,54916,54918,54919,54920,54921,54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,54955,54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,null,null,null,null,null,null,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,55021,null,null,null,null,null,null,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,55051,55052,55053,55054,55055,55056,55058,55059,55060,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293,53300,53301,53304,53308,55061,55062,55063,55066,55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,55086,55087,55088,55089,55090,55091,55094,55095,55097,null,null,null,null,null,null,55098,55099,55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,null,null,null,null,null,null,55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,55172,55173,55174,55175,55178,55179,53316,53317,53319,53321,53328,53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,55181,55182,55183,55185,55186,55187,55188,55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,53860,53888,53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192,55193,55195,55197,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20285,20339,20551,20729,21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21283,23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106,26690,26800,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799,20018,23521,25096,26524,29916,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31185,33747,35463,35506,36328,36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21312,21475,21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,26071,26083,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,63778,30007,63779,63780,63781,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32013,63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088,25891,28451,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009,29134,30274,30637,32842,34044,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36988,39719,40845,22744,23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31435,31520,31890,25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,21563,21839,25991,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30332,36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849,26388,63850,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32997,33298,34223,35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,24833,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,36848,37477,23815,23847,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23913,29791,33181,34664,28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63858,28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27387,32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,25942,26111,26212,26791,27738,28595,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28879,29100,29522,31613,34568,35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31368,31407,32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,28216,63947,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,33380,34191,34811,34915,35516,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,35696,37291,20108,20197,20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63991,63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,28593,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,37580,37664,38662,38742,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121,29742,31278,32066,32156,32305,33131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36394,36405,37758,37912,20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21675,22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,20874,26613,31574,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,21119,21736,24980,25220,25307,26786,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26898,26970,27189,28818,28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,36774,37393,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961,39111,39108,39491,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,64008,64009,38917,20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,30069,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,26313,26783,28045,28102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29243,32948,37237,39501,20399,20505,21402,21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\n \"gb18030\":[19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,58848,58849,58850,58851,58852,12288,65281,65282,65283,65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,234,593,7743,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565],\n \"gb18030-ranges\":[[0,128],[36,165],[38,169],[45,178],[50,184],[81,216],[89,226],[95,235],[96,238],[100,244],[103,248],[104,251],[105,253],[109,258],[126,276],[133,284],[148,300],[172,325],[175,329],[179,334],[208,364],[306,463],[307,465],[308,467],[309,469],[310,471],[311,473],[312,475],[313,477],[341,506],[428,594],[443,610],[544,712],[545,716],[558,730],[741,930],[742,938],[749,962],[750,970],[805,1026],[819,1104],[820,1106],[7922,8209],[7924,8215],[7925,8218],[7927,8222],[7934,8231],[7943,8241],[7944,8244],[7945,8246],[7950,8252],[8062,8365],[8148,8452],[8149,8454],[8152,8458],[8164,8471],[8174,8482],[8236,8556],[8240,8570],[8262,8596],[8264,8602],[8374,8713],[8380,8720],[8381,8722],[8384,8726],[8388,8731],[8390,8737],[8392,8740],[8393,8742],[8394,8748],[8396,8751],[8401,8760],[8406,8766],[8416,8777],[8419,8781],[8424,8787],[8437,8802],[8439,8808],[8445,8816],[8482,8854],[8485,8858],[8496,8870],[8521,8896],[8603,8979],[8936,9322],[8946,9372],[9046,9548],[9050,9588],[9063,9616],[9066,9622],[9076,9634],[9092,9652],[9100,9662],[9108,9672],[9111,9676],[9113,9680],[9131,9702],[9162,9735],[9164,9738],[9218,9793],[9219,9795],[11329,11906],[11331,11909],[11334,11913],[11336,11917],[11346,11928],[11361,11944],[11363,11947],[11366,11951],[11370,11956],[11372,11960],[11375,11964],[11389,11979],[11682,12284],[11686,12292],[11687,12312],[11692,12319],[11694,12330],[11714,12351],[11716,12436],[11723,12447],[11725,12535],[11730,12543],[11736,12586],[11982,12842],[11989,12850],[12102,12964],[12336,13200],[12348,13215],[12350,13218],[12384,13253],[12393,13263],[12395,13267],[12397,13270],[12510,13384],[12553,13428],[12851,13727],[12962,13839],[12973,13851],[13738,14617],[13823,14703],[13919,14801],[13933,14816],[14080,14964],[14298,15183],[14585,15471],[14698,15585],[15583,16471],[15847,16736],[16318,17208],[16434,17325],[16438,17330],[16481,17374],[16729,17623],[17102,17997],[17122,18018],[17315,18212],[17320,18218],[17402,18301],[17418,18318],[17859,18760],[17909,18811],[17911,18814],[17915,18820],[17916,18823],[17936,18844],[17939,18848],[17961,18872],[18664,19576],[18703,19620],[18814,19738],[18962,19887],[19043,40870],[33469,59244],[33470,59336],[33471,59367],[33484,59413],[33485,59417],[33490,59423],[33497,59431],[33501,59437],[33505,59443],[33513,59452],[33520,59460],[33536,59478],[33550,59493],[37845,63789],[37921,63866],[37948,63894],[38029,63976],[38038,63986],[38064,64016],[38065,64018],[38066,64021],[38069,64025],[38075,64034],[38076,64037],[38078,64042],[39108,65074],[39109,65093],[39113,65107],[39114,65112],[39115,65127],[39116,65132],[39265,65375],[39394,65510],[189000,65536]],\n \"jis0208\":[12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,8213,8208,65295,65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,65293,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,null,null,null,null,null,null,null,null,null,null,null,8712,8715,8838,8839,8834,8835,8746,8745,null,null,null,null,null,null,null,null,8743,8744,65506,8658,8660,8704,8707,null,null,null,null,null,null,null,null,null,null,null,8736,8869,8978,8706,8711,8801,8786,8810,8811,8730,8765,8733,8757,8747,8748,null,null,null,null,null,null,null,8491,8240,9839,9837,9834,8224,8225,182,null,null,null,null,9711,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,null,null,null,null,null,null,null,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,null,null,null,null,null,null,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,null,null,null,null,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,13129,13076,13090,13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,13213,13214,13198,13199,13252,13217,null,null,null,null,null,null,null,null,13179,12317,12319,8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\n \"jis0212\":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,728,711,184,729,733,175,731,730,65374,900,901,null,null,null,null,null,null,null,null,161,166,191,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,186,170,169,174,8482,164,8470,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,902,904,905,906,938,null,908,null,910,939,null,911,null,null,null,null,940,941,942,943,970,912,972,962,973,971,944,974,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,198,272,null,294,null,306,null,321,319,null,330,216,338,null,358,222,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,230,273,240,295,305,307,312,322,320,329,331,248,339,223,359,254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,201,200,203,202,282,278,274,280,null,284,286,290,288,292,205,204,207,206,463,304,298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,366,360,471,475,473,469,372,221,376,374,377,381,379,null,null,null,null,null,null,null,225,224,228,226,259,462,257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,285,287,null,289,293,237,236,239,238,464,null,299,303,297,309,311,314,318,316,324,328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,375,378,382,380,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,40855,40862,40865,40866,40867,40869,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\n \"ibm866\":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],\n \"iso-8859-2\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],\n \"iso-8859-3\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],\n \"iso-8859-4\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],\n \"iso-8859-5\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],\n \"iso-8859-6\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],\n \"iso-8859-7\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],\n \"iso-8859-8\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],\n \"iso-8859-10\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],\n \"iso-8859-13\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],\n \"iso-8859-14\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],\n \"iso-8859-15\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],\n \"iso-8859-16\":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],\n \"koi8-r\":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],\n \"koi8-u\":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],\n \"macintosh\":[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],\n \"windows-874\":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],\n \"windows-1250\":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],\n \"windows-1251\":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],\n \"windows-1252\":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],\n \"windows-1253\":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],\n \"windows-1254\":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],\n \"windows-1255\":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],\n \"windows-1256\":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],\n \"windows-1257\":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],\n \"windows-1258\":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],\n \"x-mac-cyrillic\":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]\n};\n\n// For strict environments where `this` inside the global scope\n// is `undefined`, take a pure object instead\n}(this || {}));\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding-indexes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding.js ***!
|
||
\**********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// This is free and unencumbered software released into the public domain.\n// See LICENSE.md for more information.\n\n/**\n * @fileoverview Global |this| required for resolving indexes in node.\n * @suppress {globalThis}\n */\n(function(global) {\n 'use strict';\n\n // If we're in node require encoding-indexes and attach it to the global.\n if ( true && module.exports &&\n !global[\"encoding-indexes\"]) {\n global[\"encoding-indexes\"] =\n __webpack_require__(/*! ./encoding-indexes.js */ \"./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding-indexes.js\")[\"encoding-indexes\"];\n }\n\n //\n // Utilities\n //\n\n /**\n * @param {number} a The number to test.\n * @param {number} min The minimum value in the range, inclusive.\n * @param {number} max The maximum value in the range, inclusive.\n * @return {boolean} True if a >= min and a <= max.\n */\n function inRange(a, min, max) {\n return min <= a && a <= max;\n }\n\n /**\n * @param {!Array.<*>} array The array to check.\n * @param {*} item The item to look for in the array.\n * @return {boolean} True if the item appears in the array.\n */\n function includes(array, item) {\n return array.indexOf(item) !== -1;\n }\n\n var floor = Math.floor;\n\n /**\n * @param {*} o\n * @return {Object}\n */\n function ToDictionary(o) {\n if (o === undefined) return {};\n if (o === Object(o)) return o;\n throw TypeError('Could not convert argument to dictionary');\n }\n\n /**\n * @param {string} string Input string of UTF-16 code units.\n * @return {!Array.<number>} Code points.\n */\n function stringToCodePoints(string) {\n // https://heycam.github.io/webidl/#dfn-obtain-unicode\n\n // 1. Let S be the DOMString value.\n var s = String(string);\n\n // 2. Let n be the length of S.\n var n = s.length;\n\n // 3. Initialize i to 0.\n var i = 0;\n\n // 4. Initialize U to be an empty sequence of Unicode characters.\n var u = [];\n\n // 5. While i < n:\n while (i < n) {\n\n // 1. Let c be the code unit in S at index i.\n var c = s.charCodeAt(i);\n\n // 2. Depending on the value of c:\n\n // c < 0xD800 or c > 0xDFFF\n if (c < 0xD800 || c > 0xDFFF) {\n // Append to U the Unicode character with code point c.\n u.push(c);\n }\n\n // 0xDC00 ≤ c ≤ 0xDFFF\n else if (0xDC00 <= c && c <= 0xDFFF) {\n // Append to U a U+FFFD REPLACEMENT CHARACTER.\n u.push(0xFFFD);\n }\n\n // 0xD800 ≤ c ≤ 0xDBFF\n else if (0xD800 <= c && c <= 0xDBFF) {\n // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT\n // CHARACTER.\n if (i === n - 1) {\n u.push(0xFFFD);\n }\n // 2. Otherwise, i < n−1:\n else {\n // 1. Let d be the code unit in S at index i+1.\n var d = s.charCodeAt(i + 1);\n\n // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then:\n if (0xDC00 <= d && d <= 0xDFFF) {\n // 1. Let a be c & 0x3FF.\n var a = c & 0x3FF;\n\n // 2. Let b be d & 0x3FF.\n var b = d & 0x3FF;\n\n // 3. Append to U the Unicode character with code point\n // 2^16+2^10*a+b.\n u.push(0x10000 + (a << 10) + b);\n\n // 4. Set i to i+1.\n i += 1;\n }\n\n // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a\n // U+FFFD REPLACEMENT CHARACTER.\n else {\n u.push(0xFFFD);\n }\n }\n }\n\n // 3. Set i to i+1.\n i += 1;\n }\n\n // 6. Return U.\n return u;\n }\n\n /**\n * @param {!Array.<number>} code_points Array of code points.\n * @return {string} string String of UTF-16 code units.\n */\n function codePointsToString(code_points) {\n var s = '';\n for (var i = 0; i < code_points.length; ++i) {\n var cp = code_points[i];\n if (cp <= 0xFFFF) {\n s += String.fromCharCode(cp);\n } else {\n cp -= 0x10000;\n s += String.fromCharCode((cp >> 10) + 0xD800,\n (cp & 0x3FF) + 0xDC00);\n }\n }\n return s;\n }\n\n\n //\n // Implementation of Encoding specification\n // https://encoding.spec.whatwg.org/\n //\n\n //\n // 4. Terminology\n //\n\n /**\n * An ASCII byte is a byte in the range 0x00 to 0x7F, inclusive.\n * @param {number} a The number to test.\n * @return {boolean} True if a is in the range 0x00 to 0x7F, inclusive.\n */\n function isASCIIByte(a) {\n return 0x00 <= a && a <= 0x7F;\n }\n\n /**\n * An ASCII code point is a code point in the range U+0000 to\n * U+007F, inclusive.\n */\n var isASCIICodePoint = isASCIIByte;\n\n\n /**\n * End-of-stream is a special token that signifies no more tokens\n * are in the stream.\n * @const\n */ var end_of_stream = -1;\n\n /**\n * A stream represents an ordered sequence of tokens.\n *\n * @constructor\n * @param {!(Array.<number>|Uint8Array)} tokens Array of tokens that provide\n * the stream.\n */\n function Stream(tokens) {\n /** @type {!Array.<number>} */\n this.tokens = [].slice.call(tokens);\n // Reversed as push/pop is more efficient than shift/unshift.\n this.tokens.reverse();\n }\n\n Stream.prototype = {\n /**\n * @return {boolean} True if end-of-stream has been hit.\n */\n endOfStream: function() {\n return !this.tokens.length;\n },\n\n /**\n * When a token is read from a stream, the first token in the\n * stream must be returned and subsequently removed, and\n * end-of-stream must be returned otherwise.\n *\n * @return {number} Get the next token from the stream, or\n * end_of_stream.\n */\n read: function() {\n if (!this.tokens.length)\n return end_of_stream;\n return this.tokens.pop();\n },\n\n /**\n * When one or more tokens are prepended to a stream, those tokens\n * must be inserted, in given order, before the first token in the\n * stream.\n *\n * @param {(number|!Array.<number>)} token The token(s) to prepend to the\n * stream.\n */\n prepend: function(token) {\n if (Array.isArray(token)) {\n var tokens = /**@type {!Array.<number>}*/(token);\n while (tokens.length)\n this.tokens.push(tokens.pop());\n } else {\n this.tokens.push(token);\n }\n },\n\n /**\n * When one or more tokens are pushed to a stream, those tokens\n * must be inserted, in given order, after the last token in the\n * stream.\n *\n * @param {(number|!Array.<number>)} token The tokens(s) to push to the\n * stream.\n */\n push: function(token) {\n if (Array.isArray(token)) {\n var tokens = /**@type {!Array.<number>}*/(token);\n while (tokens.length)\n this.tokens.unshift(tokens.shift());\n } else {\n this.tokens.unshift(token);\n }\n }\n };\n\n //\n // 5. Encodings\n //\n\n // 5.1 Encoders and decoders\n\n /** @const */\n var finished = -1;\n\n /**\n * @param {boolean} fatal If true, decoding errors raise an exception.\n * @param {number=} opt_code_point Override the standard fallback code point.\n * @return {number} The code point to insert on a decoding error.\n */\n function decoderError(fatal, opt_code_point) {\n if (fatal)\n throw TypeError('Decoder error');\n return opt_code_point || 0xFFFD;\n }\n\n /**\n * @param {number} code_point The code point that could not be encoded.\n * @return {number} Always throws, no value is actually returned.\n */\n function encoderError(code_point) {\n throw TypeError('The code point ' + code_point + ' could not be encoded.');\n }\n\n /** @interface */\n function Decoder() {}\n Decoder.prototype = {\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point, or |finished|.\n */\n handler: function(stream, bite) {}\n };\n\n /** @interface */\n function Encoder() {}\n Encoder.prototype = {\n /**\n * @param {Stream} stream The stream of code points being encoded.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit, or |finished|.\n */\n handler: function(stream, code_point) {}\n };\n\n // 5.2 Names and labels\n\n // TODO: Define @typedef for Encoding: {name:string,labels:Array.<string>}\n // https://github.com/google/closure-compiler/issues/247\n\n /**\n * @param {string} label The encoding label.\n * @return {?{name:string,labels:Array.<string>}}\n */\n function getEncoding(label) {\n // 1. Remove any leading and trailing ASCII whitespace from label.\n label = String(label).trim().toLowerCase();\n\n // 2. If label is an ASCII case-insensitive match for any of the\n // labels listed in the table below, return the corresponding\n // encoding, and failure otherwise.\n if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) {\n return label_to_encoding[label];\n }\n return null;\n }\n\n /**\n * Encodings table: https://encoding.spec.whatwg.org/encodings.json\n * @const\n * @type {!Array.<{\n * heading: string,\n * encodings: Array.<{name:string,labels:Array.<string>}>\n * }>}\n */\n var encodings = [\n {\n \"encodings\": [\n {\n \"labels\": [\n \"unicode-1-1-utf-8\",\n \"utf-8\",\n \"utf8\"\n ],\n \"name\": \"UTF-8\"\n }\n ],\n \"heading\": \"The Encoding\"\n },\n {\n \"encodings\": [\n {\n \"labels\": [\n \"866\",\n \"cp866\",\n \"csibm866\",\n \"ibm866\"\n ],\n \"name\": \"IBM866\"\n },\n {\n \"labels\": [\n \"csisolatin2\",\n \"iso-8859-2\",\n \"iso-ir-101\",\n \"iso8859-2\",\n \"iso88592\",\n \"iso_8859-2\",\n \"iso_8859-2:1987\",\n \"l2\",\n \"latin2\"\n ],\n \"name\": \"ISO-8859-2\"\n },\n {\n \"labels\": [\n \"csisolatin3\",\n \"iso-8859-3\",\n \"iso-ir-109\",\n \"iso8859-3\",\n \"iso88593\",\n \"iso_8859-3\",\n \"iso_8859-3:1988\",\n \"l3\",\n \"latin3\"\n ],\n \"name\": \"ISO-8859-3\"\n },\n {\n \"labels\": [\n \"csisolatin4\",\n \"iso-8859-4\",\n \"iso-ir-110\",\n \"iso8859-4\",\n \"iso88594\",\n \"iso_8859-4\",\n \"iso_8859-4:1988\",\n \"l4\",\n \"latin4\"\n ],\n \"name\": \"ISO-8859-4\"\n },\n {\n \"labels\": [\n \"csisolatincyrillic\",\n \"cyrillic\",\n \"iso-8859-5\",\n \"iso-ir-144\",\n \"iso8859-5\",\n \"iso88595\",\n \"iso_8859-5\",\n \"iso_8859-5:1988\"\n ],\n \"name\": \"ISO-8859-5\"\n },\n {\n \"labels\": [\n \"arabic\",\n \"asmo-708\",\n \"csiso88596e\",\n \"csiso88596i\",\n \"csisolatinarabic\",\n \"ecma-114\",\n \"iso-8859-6\",\n \"iso-8859-6-e\",\n \"iso-8859-6-i\",\n \"iso-ir-127\",\n \"iso8859-6\",\n \"iso88596\",\n \"iso_8859-6\",\n \"iso_8859-6:1987\"\n ],\n \"name\": \"ISO-8859-6\"\n },\n {\n \"labels\": [\n \"csisolatingreek\",\n \"ecma-118\",\n \"elot_928\",\n \"greek\",\n \"greek8\",\n \"iso-8859-7\",\n \"iso-ir-126\",\n \"iso8859-7\",\n \"iso88597\",\n \"iso_8859-7\",\n \"iso_8859-7:1987\",\n \"sun_eu_greek\"\n ],\n \"name\": \"ISO-8859-7\"\n },\n {\n \"labels\": [\n \"csiso88598e\",\n \"csisolatinhebrew\",\n \"hebrew\",\n \"iso-8859-8\",\n \"iso-8859-8-e\",\n \"iso-ir-138\",\n \"iso8859-8\",\n \"iso88598\",\n \"iso_8859-8\",\n \"iso_8859-8:1988\",\n \"visual\"\n ],\n \"name\": \"ISO-8859-8\"\n },\n {\n \"labels\": [\n \"csiso88598i\",\n \"iso-8859-8-i\",\n \"logical\"\n ],\n \"name\": \"ISO-8859-8-I\"\n },\n {\n \"labels\": [\n \"csisolatin6\",\n \"iso-8859-10\",\n \"iso-ir-157\",\n \"iso8859-10\",\n \"iso885910\",\n \"l6\",\n \"latin6\"\n ],\n \"name\": \"ISO-8859-10\"\n },\n {\n \"labels\": [\n \"iso-8859-13\",\n \"iso8859-13\",\n \"iso885913\"\n ],\n \"name\": \"ISO-8859-13\"\n },\n {\n \"labels\": [\n \"iso-8859-14\",\n \"iso8859-14\",\n \"iso885914\"\n ],\n \"name\": \"ISO-8859-14\"\n },\n {\n \"labels\": [\n \"csisolatin9\",\n \"iso-8859-15\",\n \"iso8859-15\",\n \"iso885915\",\n \"iso_8859-15\",\n \"l9\"\n ],\n \"name\": \"ISO-8859-15\"\n },\n {\n \"labels\": [\n \"iso-8859-16\"\n ],\n \"name\": \"ISO-8859-16\"\n },\n {\n \"labels\": [\n \"cskoi8r\",\n \"koi\",\n \"koi8\",\n \"koi8-r\",\n \"koi8_r\"\n ],\n \"name\": \"KOI8-R\"\n },\n {\n \"labels\": [\n \"koi8-ru\",\n \"koi8-u\"\n ],\n \"name\": \"KOI8-U\"\n },\n {\n \"labels\": [\n \"csmacintosh\",\n \"mac\",\n \"macintosh\",\n \"x-mac-roman\"\n ],\n \"name\": \"macintosh\"\n },\n {\n \"labels\": [\n \"dos-874\",\n \"iso-8859-11\",\n \"iso8859-11\",\n \"iso885911\",\n \"tis-620\",\n \"windows-874\"\n ],\n \"name\": \"windows-874\"\n },\n {\n \"labels\": [\n \"cp1250\",\n \"windows-1250\",\n \"x-cp1250\"\n ],\n \"name\": \"windows-1250\"\n },\n {\n \"labels\": [\n \"cp1251\",\n \"windows-1251\",\n \"x-cp1251\"\n ],\n \"name\": \"windows-1251\"\n },\n {\n \"labels\": [\n \"ansi_x3.4-1968\",\n \"ascii\",\n \"cp1252\",\n \"cp819\",\n \"csisolatin1\",\n \"ibm819\",\n \"iso-8859-1\",\n \"iso-ir-100\",\n \"iso8859-1\",\n \"iso88591\",\n \"iso_8859-1\",\n \"iso_8859-1:1987\",\n \"l1\",\n \"latin1\",\n \"us-ascii\",\n \"windows-1252\",\n \"x-cp1252\"\n ],\n \"name\": \"windows-1252\"\n },\n {\n \"labels\": [\n \"cp1253\",\n \"windows-1253\",\n \"x-cp1253\"\n ],\n \"name\": \"windows-1253\"\n },\n {\n \"labels\": [\n \"cp1254\",\n \"csisolatin5\",\n \"iso-8859-9\",\n \"iso-ir-148\",\n \"iso8859-9\",\n \"iso88599\",\n \"iso_8859-9\",\n \"iso_8859-9:1989\",\n \"l5\",\n \"latin5\",\n \"windows-1254\",\n \"x-cp1254\"\n ],\n \"name\": \"windows-1254\"\n },\n {\n \"labels\": [\n \"cp1255\",\n \"windows-1255\",\n \"x-cp1255\"\n ],\n \"name\": \"windows-1255\"\n },\n {\n \"labels\": [\n \"cp1256\",\n \"windows-1256\",\n \"x-cp1256\"\n ],\n \"name\": \"windows-1256\"\n },\n {\n \"labels\": [\n \"cp1257\",\n \"windows-1257\",\n \"x-cp1257\"\n ],\n \"name\": \"windows-1257\"\n },\n {\n \"labels\": [\n \"cp1258\",\n \"windows-1258\",\n \"x-cp1258\"\n ],\n \"name\": \"windows-1258\"\n },\n {\n \"labels\": [\n \"x-mac-cyrillic\",\n \"x-mac-ukrainian\"\n ],\n \"name\": \"x-mac-cyrillic\"\n }\n ],\n \"heading\": \"Legacy single-byte encodings\"\n },\n {\n \"encodings\": [\n {\n \"labels\": [\n \"chinese\",\n \"csgb2312\",\n \"csiso58gb231280\",\n \"gb2312\",\n \"gb_2312\",\n \"gb_2312-80\",\n \"gbk\",\n \"iso-ir-58\",\n \"x-gbk\"\n ],\n \"name\": \"GBK\"\n },\n {\n \"labels\": [\n \"gb18030\"\n ],\n \"name\": \"gb18030\"\n }\n ],\n \"heading\": \"Legacy multi-byte Chinese (simplified) encodings\"\n },\n {\n \"encodings\": [\n {\n \"labels\": [\n \"big5\",\n \"big5-hkscs\",\n \"cn-big5\",\n \"csbig5\",\n \"x-x-big5\"\n ],\n \"name\": \"Big5\"\n }\n ],\n \"heading\": \"Legacy multi-byte Chinese (traditional) encodings\"\n },\n {\n \"encodings\": [\n {\n \"labels\": [\n \"cseucpkdfmtjapanese\",\n \"euc-jp\",\n \"x-euc-jp\"\n ],\n \"name\": \"EUC-JP\"\n },\n {\n \"labels\": [\n \"csiso2022jp\",\n \"iso-2022-jp\"\n ],\n \"name\": \"ISO-2022-JP\"\n },\n {\n \"labels\": [\n \"csshiftjis\",\n \"ms932\",\n \"ms_kanji\",\n \"shift-jis\",\n \"shift_jis\",\n \"sjis\",\n \"windows-31j\",\n \"x-sjis\"\n ],\n \"name\": \"Shift_JIS\"\n }\n ],\n \"heading\": \"Legacy multi-byte Japanese encodings\"\n },\n {\n \"encodings\": [\n {\n \"labels\": [\n \"cseuckr\",\n \"csksc56011987\",\n \"euc-kr\",\n \"iso-ir-149\",\n \"korean\",\n \"ks_c_5601-1987\",\n \"ks_c_5601-1989\",\n \"ksc5601\",\n \"ksc_5601\",\n \"windows-949\"\n ],\n \"name\": \"EUC-KR\"\n }\n ],\n \"heading\": \"Legacy multi-byte Korean encodings\"\n },\n {\n \"encodings\": [\n {\n \"labels\": [\n \"csiso2022kr\",\n \"hz-gb-2312\",\n \"iso-2022-cn\",\n \"iso-2022-cn-ext\",\n \"iso-2022-kr\"\n ],\n \"name\": \"replacement\"\n },\n {\n \"labels\": [\n \"utf-16be\"\n ],\n \"name\": \"UTF-16BE\"\n },\n {\n \"labels\": [\n \"utf-16\",\n \"utf-16le\"\n ],\n \"name\": \"UTF-16LE\"\n },\n {\n \"labels\": [\n \"x-user-defined\"\n ],\n \"name\": \"x-user-defined\"\n }\n ],\n \"heading\": \"Legacy miscellaneous encodings\"\n }\n ];\n\n // Label to encoding registry.\n /** @type {Object.<string,{name:string,labels:Array.<string>}>} */\n var label_to_encoding = {};\n encodings.forEach(function(category) {\n category.encodings.forEach(function(encoding) {\n encoding.labels.forEach(function(label) {\n label_to_encoding[label] = encoding;\n });\n });\n });\n\n // Registry of of encoder/decoder factories, by encoding name.\n /** @type {Object.<string, function({fatal:boolean}): Encoder>} */\n var encoders = {};\n /** @type {Object.<string, function({fatal:boolean}): Decoder>} */\n var decoders = {};\n\n //\n // 6. Indexes\n //\n\n /**\n * @param {number} pointer The |pointer| to search for.\n * @param {(!Array.<?number>|undefined)} index The |index| to search within.\n * @return {?number} The code point corresponding to |pointer| in |index|,\n * or null if |code point| is not in |index|.\n */\n function indexCodePointFor(pointer, index) {\n if (!index) return null;\n return index[pointer] || null;\n }\n\n /**\n * @param {number} code_point The |code point| to search for.\n * @param {!Array.<?number>} index The |index| to search within.\n * @return {?number} The first pointer corresponding to |code point| in\n * |index|, or null if |code point| is not in |index|.\n */\n function indexPointerFor(code_point, index) {\n var pointer = index.indexOf(code_point);\n return pointer === -1 ? null : pointer;\n }\n\n /**\n * @param {string} name Name of the index.\n * @return {(!Array.<number>|!Array.<Array.<number>>)}\n * */\n function index(name) {\n if (!('encoding-indexes' in global)) {\n throw Error(\"Indexes missing.\" +\n \" Did you forget to include encoding-indexes.js first?\");\n }\n return global['encoding-indexes'][name];\n }\n\n /**\n * @param {number} pointer The |pointer| to search for in the gb18030 index.\n * @return {?number} The code point corresponding to |pointer| in |index|,\n * or null if |code point| is not in the gb18030 index.\n */\n function indexGB18030RangesCodePointFor(pointer) {\n // 1. If pointer is greater than 39419 and less than 189000, or\n // pointer is greater than 1237575, return null.\n if ((pointer > 39419 && pointer < 189000) || (pointer > 1237575))\n return null;\n\n // 2. If pointer is 7457, return code point U+E7C7.\n if (pointer === 7457) return 0xE7C7;\n\n // 3. Let offset be the last pointer in index gb18030 ranges that\n // is equal to or less than pointer and let code point offset be\n // its corresponding code point.\n var offset = 0;\n var code_point_offset = 0;\n var idx = index('gb18030-ranges');\n var i;\n for (i = 0; i < idx.length; ++i) {\n /** @type {!Array.<number>} */\n var entry = idx[i];\n if (entry[0] <= pointer) {\n offset = entry[0];\n code_point_offset = entry[1];\n } else {\n break;\n }\n }\n\n // 4. Return a code point whose value is code point offset +\n // pointer − offset.\n return code_point_offset + pointer - offset;\n }\n\n /**\n * @param {number} code_point The |code point| to locate in the gb18030 index.\n * @return {number} The first pointer corresponding to |code point| in the\n * gb18030 index.\n */\n function indexGB18030RangesPointerFor(code_point) {\n // 1. If code point is U+E7C7, return pointer 7457.\n if (code_point === 0xE7C7) return 7457;\n\n // 2. Let offset be the last code point in index gb18030 ranges\n // that is equal to or less than code point and let pointer offset\n // be its corresponding pointer.\n var offset = 0;\n var pointer_offset = 0;\n var idx = index('gb18030-ranges');\n var i;\n for (i = 0; i < idx.length; ++i) {\n /** @type {!Array.<number>} */\n var entry = idx[i];\n if (entry[1] <= code_point) {\n offset = entry[1];\n pointer_offset = entry[0];\n } else {\n break;\n }\n }\n\n // 3. Return a pointer whose value is pointer offset + code point\n // − offset.\n return pointer_offset + code_point - offset;\n }\n\n /**\n * @param {number} code_point The |code_point| to search for in the Shift_JIS\n * index.\n * @return {?number} The code point corresponding to |pointer| in |index|,\n * or null if |code point| is not in the Shift_JIS index.\n */\n function indexShiftJISPointerFor(code_point) {\n // 1. Let index be index jis0208 excluding all entries whose\n // pointer is in the range 8272 to 8835, inclusive.\n shift_jis_index = shift_jis_index ||\n index('jis0208').map(function(code_point, pointer) {\n return inRange(pointer, 8272, 8835) ? null : code_point;\n });\n var index_ = shift_jis_index;\n\n // 2. Return the index pointer for code point in index.\n return index_.indexOf(code_point);\n }\n var shift_jis_index;\n\n /**\n * @param {number} code_point The |code_point| to search for in the big5\n * index.\n * @return {?number} The code point corresponding to |pointer| in |index|,\n * or null if |code point| is not in the big5 index.\n */\n function indexBig5PointerFor(code_point) {\n // 1. Let index be index Big5 excluding all entries whose pointer\n big5_index_no_hkscs = big5_index_no_hkscs ||\n index('big5').map(function(code_point, pointer) {\n return (pointer < (0xA1 - 0x81) * 157) ? null : code_point;\n });\n var index_ = big5_index_no_hkscs;\n\n // 2. If code point is U+2550, U+255E, U+2561, U+256A, U+5341, or\n // U+5345, return the last pointer corresponding to code point in\n // index.\n if (code_point === 0x2550 || code_point === 0x255E ||\n code_point === 0x2561 || code_point === 0x256A ||\n code_point === 0x5341 || code_point === 0x5345) {\n return index_.lastIndexOf(code_point);\n }\n\n // 3. Return the index pointer for code point in index.\n return indexPointerFor(code_point, index_);\n }\n var big5_index_no_hkscs;\n\n //\n // 8. API\n //\n\n /** @const */ var DEFAULT_ENCODING = 'utf-8';\n\n // 8.1 Interface TextDecoder\n\n /**\n * @constructor\n * @param {string=} label The label of the encoding;\n * defaults to 'utf-8'.\n * @param {Object=} options\n */\n function TextDecoder(label, options) {\n // Web IDL conventions\n if (!(this instanceof TextDecoder))\n throw TypeError('Called as a function. Did you forget \\'new\\'?');\n label = label !== undefined ? String(label) : DEFAULT_ENCODING;\n options = ToDictionary(options);\n\n // A TextDecoder object has an associated encoding, decoder,\n // stream, ignore BOM flag (initially unset), BOM seen flag\n // (initially unset), error mode (initially replacement), and do\n // not flush flag (initially unset).\n\n /** @private */\n this._encoding = null;\n /** @private @type {?Decoder} */\n this._decoder = null;\n /** @private @type {boolean} */\n this._ignoreBOM = false;\n /** @private @type {boolean} */\n this._BOMseen = false;\n /** @private @type {string} */\n this._error_mode = 'replacement';\n /** @private @type {boolean} */\n this._do_not_flush = false;\n\n\n // 1. Let encoding be the result of getting an encoding from\n // label.\n var encoding = getEncoding(label);\n\n // 2. If encoding is failure or replacement, throw a RangeError.\n if (encoding === null || encoding.name === 'replacement')\n throw RangeError('Unknown encoding: ' + label);\n if (!decoders[encoding.name]) {\n throw Error('Decoder not present.' +\n ' Did you forget to include encoding-indexes.js first?');\n }\n\n // 3. Let dec be a new TextDecoder object.\n var dec = this;\n\n // 4. Set dec's encoding to encoding.\n dec._encoding = encoding;\n\n // 5. If options's fatal member is true, set dec's error mode to\n // fatal.\n if (Boolean(options['fatal']))\n dec._error_mode = 'fatal';\n\n // 6. If options's ignoreBOM member is true, set dec's ignore BOM\n // flag.\n if (Boolean(options['ignoreBOM']))\n dec._ignoreBOM = true;\n\n // For pre-ES5 runtimes:\n if (!Object.defineProperty) {\n this.encoding = dec._encoding.name.toLowerCase();\n this.fatal = dec._error_mode === 'fatal';\n this.ignoreBOM = dec._ignoreBOM;\n }\n\n // 7. Return dec.\n return dec;\n }\n\n if (Object.defineProperty) {\n // The encoding attribute's getter must return encoding's name.\n Object.defineProperty(TextDecoder.prototype, 'encoding', {\n /** @this {TextDecoder} */\n get: function() { return this._encoding.name.toLowerCase(); }\n });\n\n // The fatal attribute's getter must return true if error mode\n // is fatal, and false otherwise.\n Object.defineProperty(TextDecoder.prototype, 'fatal', {\n /** @this {TextDecoder} */\n get: function() { return this._error_mode === 'fatal'; }\n });\n\n // The ignoreBOM attribute's getter must return true if ignore\n // BOM flag is set, and false otherwise.\n Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', {\n /** @this {TextDecoder} */\n get: function() { return this._ignoreBOM; }\n });\n }\n\n /**\n * @param {BufferSource=} input The buffer of bytes to decode.\n * @param {Object=} options\n * @return {string} The decoded string.\n */\n TextDecoder.prototype.decode = function decode(input, options) {\n var bytes;\n if (typeof input === 'object' && input instanceof ArrayBuffer) {\n bytes = new Uint8Array(input);\n } else if (typeof input === 'object' && 'buffer' in input &&\n input.buffer instanceof ArrayBuffer) {\n bytes = new Uint8Array(input.buffer,\n input.byteOffset,\n input.byteLength);\n } else {\n bytes = new Uint8Array(0);\n }\n\n options = ToDictionary(options);\n\n // 1. If the do not flush flag is unset, set decoder to a new\n // encoding's decoder, set stream to a new stream, and unset the\n // BOM seen flag.\n if (!this._do_not_flush) {\n this._decoder = decoders[this._encoding.name]({\n fatal: this._error_mode === 'fatal'});\n this._BOMseen = false;\n }\n\n // 2. If options's stream is true, set the do not flush flag, and\n // unset the do not flush flag otherwise.\n this._do_not_flush = Boolean(options['stream']);\n\n // 3. If input is given, push a copy of input to stream.\n // TODO: Align with spec algorithm - maintain stream on instance.\n var input_stream = new Stream(bytes);\n\n // 4. Let output be a new stream.\n var output = [];\n\n /** @type {?(number|!Array.<number>)} */\n var result;\n\n // 5. While true:\n while (true) {\n // 1. Let token be the result of reading from stream.\n var token = input_stream.read();\n\n // 2. If token is end-of-stream and the do not flush flag is\n // set, return output, serialized.\n // TODO: Align with spec algorithm.\n if (token === end_of_stream)\n break;\n\n // 3. Otherwise, run these subsubsteps:\n\n // 1. Let result be the result of processing token for decoder,\n // stream, output, and error mode.\n result = this._decoder.handler(input_stream, token);\n\n // 2. If result is finished, return output, serialized.\n if (result === finished)\n break;\n\n if (result !== null) {\n if (Array.isArray(result))\n output.push.apply(output, /**@type {!Array.<number>}*/(result));\n else\n output.push(result);\n }\n\n // 3. Otherwise, if result is error, throw a TypeError.\n // (Thrown in handler)\n\n // 4. Otherwise, do nothing.\n }\n // TODO: Align with spec algorithm.\n if (!this._do_not_flush) {\n do {\n result = this._decoder.handler(input_stream, input_stream.read());\n if (result === finished)\n break;\n if (result === null)\n continue;\n if (Array.isArray(result))\n output.push.apply(output, /**@type {!Array.<number>}*/(result));\n else\n output.push(result);\n } while (!input_stream.endOfStream());\n this._decoder = null;\n }\n\n // A TextDecoder object also has an associated serialize stream\n // algorithm...\n /**\n * @param {!Array.<number>} stream\n * @return {string}\n * @this {TextDecoder}\n */\n function serializeStream(stream) {\n // 1. Let token be the result of reading from stream.\n // (Done in-place on array, rather than as a stream)\n\n // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore\n // BOM flag and BOM seen flag are unset, run these subsubsteps:\n if (includes(['UTF-8', 'UTF-16LE', 'UTF-16BE'], this._encoding.name) &&\n !this._ignoreBOM && !this._BOMseen) {\n if (stream.length > 0 && stream[0] === 0xFEFF) {\n // 1. If token is U+FEFF, set BOM seen flag.\n this._BOMseen = true;\n stream.shift();\n } else if (stream.length > 0) {\n // 2. Otherwise, if token is not end-of-stream, set BOM seen\n // flag and append token to stream.\n this._BOMseen = true;\n } else {\n // 3. Otherwise, if token is not end-of-stream, append token\n // to output.\n // (no-op)\n }\n }\n // 4. Otherwise, return output.\n return codePointsToString(stream);\n }\n\n return serializeStream.call(this, output);\n };\n\n // 8.2 Interface TextEncoder\n\n /**\n * @constructor\n * @param {string=} label The label of the encoding. NONSTANDARD.\n * @param {Object=} options NONSTANDARD.\n */\n function TextEncoder(label, options) {\n // Web IDL conventions\n if (!(this instanceof TextEncoder))\n throw TypeError('Called as a function. Did you forget \\'new\\'?');\n options = ToDictionary(options);\n\n // A TextEncoder object has an associated encoding and encoder.\n\n /** @private */\n this._encoding = null;\n /** @private @type {?Encoder} */\n this._encoder = null;\n\n // Non-standard\n /** @private @type {boolean} */\n this._do_not_flush = false;\n /** @private @type {string} */\n this._fatal = Boolean(options['fatal']) ? 'fatal' : 'replacement';\n\n // 1. Let enc be a new TextEncoder object.\n var enc = this;\n\n // 2. Set enc's encoding to UTF-8's encoder.\n if (Boolean(options['NONSTANDARD_allowLegacyEncoding'])) {\n // NONSTANDARD behavior.\n label = label !== undefined ? String(label) : DEFAULT_ENCODING;\n var encoding = getEncoding(label);\n if (encoding === null || encoding.name === 'replacement')\n throw RangeError('Unknown encoding: ' + label);\n if (!encoders[encoding.name]) {\n throw Error('Encoder not present.' +\n ' Did you forget to include encoding-indexes.js first?');\n }\n enc._encoding = encoding;\n } else {\n // Standard behavior.\n enc._encoding = getEncoding('utf-8');\n\n if (label !== undefined && 'console' in global) {\n console.warn('TextEncoder constructor called with encoding label, '\n + 'which is ignored.');\n }\n }\n\n // For pre-ES5 runtimes:\n if (!Object.defineProperty)\n this.encoding = enc._encoding.name.toLowerCase();\n\n // 3. Return enc.\n return enc;\n }\n\n if (Object.defineProperty) {\n // The encoding attribute's getter must return encoding's name.\n Object.defineProperty(TextEncoder.prototype, 'encoding', {\n /** @this {TextEncoder} */\n get: function() { return this._encoding.name.toLowerCase(); }\n });\n }\n\n /**\n * @param {string=} opt_string The string to encode.\n * @param {Object=} options\n * @return {!Uint8Array} Encoded bytes, as a Uint8Array.\n */\n TextEncoder.prototype.encode = function encode(opt_string, options) {\n opt_string = opt_string === undefined ? '' : String(opt_string);\n options = ToDictionary(options);\n\n // NOTE: This option is nonstandard. None of the encodings\n // permitted for encoding (i.e. UTF-8, UTF-16) are stateful when\n // the input is a USVString so streaming is not necessary.\n if (!this._do_not_flush)\n this._encoder = encoders[this._encoding.name]({\n fatal: this._fatal === 'fatal'});\n this._do_not_flush = Boolean(options['stream']);\n\n // 1. Convert input to a stream.\n var input = new Stream(stringToCodePoints(opt_string));\n\n // 2. Let output be a new stream\n var output = [];\n\n /** @type {?(number|!Array.<number>)} */\n var result;\n // 3. While true, run these substeps:\n while (true) {\n // 1. Let token be the result of reading from input.\n var token = input.read();\n if (token === end_of_stream)\n break;\n // 2. Let result be the result of processing token for encoder,\n // input, output.\n result = this._encoder.handler(input, token);\n if (result === finished)\n break;\n if (Array.isArray(result))\n output.push.apply(output, /**@type {!Array.<number>}*/(result));\n else\n output.push(result);\n }\n // TODO: Align with spec algorithm.\n if (!this._do_not_flush) {\n while (true) {\n result = this._encoder.handler(input, input.read());\n if (result === finished)\n break;\n if (Array.isArray(result))\n output.push.apply(output, /**@type {!Array.<number>}*/(result));\n else\n output.push(result);\n }\n this._encoder = null;\n }\n // 3. If result is finished, convert output into a byte sequence,\n // and then return a Uint8Array object wrapping an ArrayBuffer\n // containing output.\n return new Uint8Array(output);\n };\n\n\n //\n // 9. The encoding\n //\n\n // 9.1 utf-8\n\n // 9.1.1 utf-8 decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function UTF8Decoder(options) {\n var fatal = options.fatal;\n\n // utf-8's decoder's has an associated utf-8 code point, utf-8\n // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8\n // lower boundary (initially 0x80), and a utf-8 upper boundary\n // (initially 0xBF).\n var /** @type {number} */ utf8_code_point = 0,\n /** @type {number} */ utf8_bytes_seen = 0,\n /** @type {number} */ utf8_bytes_needed = 0,\n /** @type {number} */ utf8_lower_boundary = 0x80,\n /** @type {number} */ utf8_upper_boundary = 0xBF;\n\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and utf-8 bytes needed is not 0,\n // set utf-8 bytes needed to 0 and return error.\n if (bite === end_of_stream && utf8_bytes_needed !== 0) {\n utf8_bytes_needed = 0;\n return decoderError(fatal);\n }\n\n // 2. If byte is end-of-stream, return finished.\n if (bite === end_of_stream)\n return finished;\n\n // 3. If utf-8 bytes needed is 0, based on byte:\n if (utf8_bytes_needed === 0) {\n\n // 0x00 to 0x7F\n if (inRange(bite, 0x00, 0x7F)) {\n // Return a code point whose value is byte.\n return bite;\n }\n\n // 0xC2 to 0xDF\n else if (inRange(bite, 0xC2, 0xDF)) {\n // 1. Set utf-8 bytes needed to 1.\n utf8_bytes_needed = 1;\n\n // 2. Set UTF-8 code point to byte & 0x1F.\n utf8_code_point = bite & 0x1F;\n }\n\n // 0xE0 to 0xEF\n else if (inRange(bite, 0xE0, 0xEF)) {\n // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0.\n if (bite === 0xE0)\n utf8_lower_boundary = 0xA0;\n // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F.\n if (bite === 0xED)\n utf8_upper_boundary = 0x9F;\n // 3. Set utf-8 bytes needed to 2.\n utf8_bytes_needed = 2;\n // 4. Set UTF-8 code point to byte & 0xF.\n utf8_code_point = bite & 0xF;\n }\n\n // 0xF0 to 0xF4\n else if (inRange(bite, 0xF0, 0xF4)) {\n // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90.\n if (bite === 0xF0)\n utf8_lower_boundary = 0x90;\n // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F.\n if (bite === 0xF4)\n utf8_upper_boundary = 0x8F;\n // 3. Set utf-8 bytes needed to 3.\n utf8_bytes_needed = 3;\n // 4. Set UTF-8 code point to byte & 0x7.\n utf8_code_point = bite & 0x7;\n }\n\n // Otherwise\n else {\n // Return error.\n return decoderError(fatal);\n }\n\n // Return continue.\n return null;\n }\n\n // 4. If byte is not in the range utf-8 lower boundary to utf-8\n // upper boundary, inclusive, run these substeps:\n if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) {\n\n // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8\n // bytes seen to 0, set utf-8 lower boundary to 0x80, and set\n // utf-8 upper boundary to 0xBF.\n utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;\n utf8_lower_boundary = 0x80;\n utf8_upper_boundary = 0xBF;\n\n // 2. Prepend byte to stream.\n stream.prepend(bite);\n\n // 3. Return error.\n return decoderError(fatal);\n }\n\n // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary\n // to 0xBF.\n utf8_lower_boundary = 0x80;\n utf8_upper_boundary = 0xBF;\n\n // 6. Set UTF-8 code point to (UTF-8 code point << 6) | (byte &\n // 0x3F)\n utf8_code_point = (utf8_code_point << 6) | (bite & 0x3F);\n\n // 7. Increase utf-8 bytes seen by one.\n utf8_bytes_seen += 1;\n\n // 8. If utf-8 bytes seen is not equal to utf-8 bytes needed,\n // continue.\n if (utf8_bytes_seen !== utf8_bytes_needed)\n return null;\n\n // 9. Let code point be utf-8 code point.\n var code_point = utf8_code_point;\n\n // 10. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes\n // seen to 0.\n utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;\n\n // 11. Return a code point whose value is code point.\n return code_point;\n };\n }\n\n // 9.1.2 utf-8 encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function UTF8Encoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. Set count and offset based on the range code point is in:\n var count, offset;\n // U+0080 to U+07FF, inclusive:\n if (inRange(code_point, 0x0080, 0x07FF)) {\n // 1 and 0xC0\n count = 1;\n offset = 0xC0;\n }\n // U+0800 to U+FFFF, inclusive:\n else if (inRange(code_point, 0x0800, 0xFFFF)) {\n // 2 and 0xE0\n count = 2;\n offset = 0xE0;\n }\n // U+10000 to U+10FFFF, inclusive:\n else if (inRange(code_point, 0x10000, 0x10FFFF)) {\n // 3 and 0xF0\n count = 3;\n offset = 0xF0;\n }\n\n // 4. Let bytes be a byte sequence whose first byte is (code\n // point >> (6 × count)) + offset.\n var bytes = [(code_point >> (6 * count)) + offset];\n\n // 5. Run these substeps while count is greater than 0:\n while (count > 0) {\n\n // 1. Set temp to code point >> (6 × (count − 1)).\n var temp = code_point >> (6 * (count - 1));\n\n // 2. Append to bytes 0x80 | (temp & 0x3F).\n bytes.push(0x80 | (temp & 0x3F));\n\n // 3. Decrease count by one.\n count -= 1;\n }\n\n // 6. Return bytes bytes, in order.\n return bytes;\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['UTF-8'] = function(options) {\n return new UTF8Encoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['UTF-8'] = function(options) {\n return new UTF8Decoder(options);\n };\n\n //\n // 10. Legacy single-byte encodings\n //\n\n // 10.1 single-byte decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {!Array.<number>} index The encoding index.\n * @param {{fatal: boolean}} options\n */\n function SingleByteDecoder(index, options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream, return finished.\n if (bite === end_of_stream)\n return finished;\n\n // 2. If byte is an ASCII byte, return a code point whose value\n // is byte.\n if (isASCIIByte(bite))\n return bite;\n\n // 3. Let code point be the index code point for byte − 0x80 in\n // index single-byte.\n var code_point = index[bite - 0x80];\n\n // 4. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 5. Return a code point whose value is code point.\n return code_point;\n };\n }\n\n // 10.2 single-byte encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {!Array.<?number>} index The encoding index.\n * @param {{fatal: boolean}} options\n */\n function SingleByteEncoder(index, options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. Let pointer be the index pointer for code point in index\n // single-byte.\n var pointer = indexPointerFor(code_point, index);\n\n // 4. If pointer is null, return error with code point.\n if (pointer === null)\n encoderError(code_point);\n\n // 5. Return a byte whose value is pointer + 0x80.\n return pointer + 0x80;\n };\n }\n\n (function() {\n if (!('encoding-indexes' in global))\n return;\n encodings.forEach(function(category) {\n if (category.heading !== 'Legacy single-byte encodings')\n return;\n category.encodings.forEach(function(encoding) {\n var name = encoding.name;\n var idx = index(name.toLowerCase());\n /** @param {{fatal: boolean}} options */\n decoders[name] = function(options) {\n return new SingleByteDecoder(idx, options);\n };\n /** @param {{fatal: boolean}} options */\n encoders[name] = function(options) {\n return new SingleByteEncoder(idx, options);\n };\n });\n });\n }());\n\n //\n // 11. Legacy multi-byte Chinese (simplified) encodings\n //\n\n // 11.1 gbk\n\n // 11.1.1 gbk decoder\n // gbk's decoder is gb18030's decoder.\n /** @param {{fatal: boolean}} options */\n decoders['GBK'] = function(options) {\n return new GB18030Decoder(options);\n };\n\n // 11.1.2 gbk encoder\n // gbk's encoder is gb18030's encoder with its gbk flag set.\n /** @param {{fatal: boolean}} options */\n encoders['GBK'] = function(options) {\n return new GB18030Encoder(options, true);\n };\n\n // 11.2 gb18030\n\n // 11.2.1 gb18030 decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function GB18030Decoder(options) {\n var fatal = options.fatal;\n // gb18030's decoder has an associated gb18030 first, gb18030\n // second, and gb18030 third (all initially 0x00).\n var /** @type {number} */ gb18030_first = 0x00,\n /** @type {number} */ gb18030_second = 0x00,\n /** @type {number} */ gb18030_third = 0x00;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and gb18030 first, gb18030\n // second, and gb18030 third are 0x00, return finished.\n if (bite === end_of_stream && gb18030_first === 0x00 &&\n gb18030_second === 0x00 && gb18030_third === 0x00) {\n return finished;\n }\n // 2. If byte is end-of-stream, and gb18030 first, gb18030\n // second, or gb18030 third is not 0x00, set gb18030 first,\n // gb18030 second, and gb18030 third to 0x00, and return error.\n if (bite === end_of_stream &&\n (gb18030_first !== 0x00 || gb18030_second !== 0x00 ||\n gb18030_third !== 0x00)) {\n gb18030_first = 0x00;\n gb18030_second = 0x00;\n gb18030_third = 0x00;\n decoderError(fatal);\n }\n var code_point;\n // 3. If gb18030 third is not 0x00, run these substeps:\n if (gb18030_third !== 0x00) {\n // 1. Let code point be null.\n code_point = null;\n // 2. If byte is in the range 0x30 to 0x39, inclusive, set\n // code point to the index gb18030 ranges code point for\n // (((gb18030 first − 0x81) × 10 + gb18030 second − 0x30) ×\n // 126 + gb18030 third − 0x81) × 10 + byte − 0x30.\n if (inRange(bite, 0x30, 0x39)) {\n code_point = indexGB18030RangesCodePointFor(\n (((gb18030_first - 0x81) * 10 + gb18030_second - 0x30) * 126 +\n gb18030_third - 0x81) * 10 + bite - 0x30);\n }\n\n // 3. Let buffer be a byte sequence consisting of gb18030\n // second, gb18030 third, and byte, in order.\n var buffer = [gb18030_second, gb18030_third, bite];\n\n // 4. Set gb18030 first, gb18030 second, and gb18030 third to\n // 0x00.\n gb18030_first = 0x00;\n gb18030_second = 0x00;\n gb18030_third = 0x00;\n\n // 5. If code point is null, prepend buffer to stream and\n // return error.\n if (code_point === null) {\n stream.prepend(buffer);\n return decoderError(fatal);\n }\n\n // 6. Return a code point whose value is code point.\n return code_point;\n }\n\n // 4. If gb18030 second is not 0x00, run these substeps:\n if (gb18030_second !== 0x00) {\n\n // 1. If byte is in the range 0x81 to 0xFE, inclusive, set\n // gb18030 third to byte and return continue.\n if (inRange(bite, 0x81, 0xFE)) {\n gb18030_third = bite;\n return null;\n }\n\n // 2. Prepend gb18030 second followed by byte to stream, set\n // gb18030 first and gb18030 second to 0x00, and return error.\n stream.prepend([gb18030_second, bite]);\n gb18030_first = 0x00;\n gb18030_second = 0x00;\n return decoderError(fatal);\n }\n\n // 5. If gb18030 first is not 0x00, run these substeps:\n if (gb18030_first !== 0x00) {\n\n // 1. If byte is in the range 0x30 to 0x39, inclusive, set\n // gb18030 second to byte and return continue.\n if (inRange(bite, 0x30, 0x39)) {\n gb18030_second = bite;\n return null;\n }\n\n // 2. Let lead be gb18030 first, let pointer be null, and set\n // gb18030 first to 0x00.\n var lead = gb18030_first;\n var pointer = null;\n gb18030_first = 0x00;\n\n // 3. Let offset be 0x40 if byte is less than 0x7F and 0x41\n // otherwise.\n var offset = bite < 0x7F ? 0x40 : 0x41;\n\n // 4. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80\n // to 0xFE, inclusive, set pointer to (lead − 0x81) × 190 +\n // (byte − offset).\n if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFE))\n pointer = (lead - 0x81) * 190 + (bite - offset);\n\n // 5. Let code point be null if pointer is null and the index\n // code point for pointer in index gb18030 otherwise.\n code_point = pointer === null ? null :\n indexCodePointFor(pointer, index('gb18030'));\n\n // 6. If code point is null and byte is an ASCII byte, prepend\n // byte to stream.\n if (code_point === null && isASCIIByte(bite))\n stream.prepend(bite);\n\n // 7. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 8. Return a code point whose value is code point.\n return code_point;\n }\n\n // 6. If byte is an ASCII byte, return a code point whose value\n // is byte.\n if (isASCIIByte(bite))\n return bite;\n\n // 7. If byte is 0x80, return code point U+20AC.\n if (bite === 0x80)\n return 0x20AC;\n\n // 8. If byte is in the range 0x81 to 0xFE, inclusive, set\n // gb18030 first to byte and return continue.\n if (inRange(bite, 0x81, 0xFE)) {\n gb18030_first = bite;\n return null;\n }\n\n // 9. Return error.\n return decoderError(fatal);\n };\n }\n\n // 11.2.2 gb18030 encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n * @param {boolean=} gbk_flag\n */\n function GB18030Encoder(options, gbk_flag) {\n var fatal = options.fatal;\n // gb18030's decoder has an associated gbk flag (initially unset).\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. If code point is U+E5E5, return error with code point.\n if (code_point === 0xE5E5)\n return encoderError(code_point);\n\n // 4. If the gbk flag is set and code point is U+20AC, return\n // byte 0x80.\n if (gbk_flag && code_point === 0x20AC)\n return 0x80;\n\n // 5. Let pointer be the index pointer for code point in index\n // gb18030.\n var pointer = indexPointerFor(code_point, index('gb18030'));\n\n // 6. If pointer is not null, run these substeps:\n if (pointer !== null) {\n\n // 1. Let lead be floor(pointer / 190) + 0x81.\n var lead = floor(pointer / 190) + 0x81;\n\n // 2. Let trail be pointer % 190.\n var trail = pointer % 190;\n\n // 3. Let offset be 0x40 if trail is less than 0x3F and 0x41 otherwise.\n var offset = trail < 0x3F ? 0x40 : 0x41;\n\n // 4. Return two bytes whose values are lead and trail + offset.\n return [lead, trail + offset];\n }\n\n // 7. If gbk flag is set, return error with code point.\n if (gbk_flag)\n return encoderError(code_point);\n\n // 8. Set pointer to the index gb18030 ranges pointer for code\n // point.\n pointer = indexGB18030RangesPointerFor(code_point);\n\n // 9. Let byte1 be floor(pointer / 10 / 126 / 10).\n var byte1 = floor(pointer / 10 / 126 / 10);\n\n // 10. Set pointer to pointer − byte1 × 10 × 126 × 10.\n pointer = pointer - byte1 * 10 * 126 * 10;\n\n // 11. Let byte2 be floor(pointer / 10 / 126).\n var byte2 = floor(pointer / 10 / 126);\n\n // 12. Set pointer to pointer − byte2 × 10 × 126.\n pointer = pointer - byte2 * 10 * 126;\n\n // 13. Let byte3 be floor(pointer / 10).\n var byte3 = floor(pointer / 10);\n\n // 14. Let byte4 be pointer − byte3 × 10.\n var byte4 = pointer - byte3 * 10;\n\n // 15. Return four bytes whose values are byte1 + 0x81, byte2 +\n // 0x30, byte3 + 0x81, byte4 + 0x30.\n return [byte1 + 0x81,\n byte2 + 0x30,\n byte3 + 0x81,\n byte4 + 0x30];\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['gb18030'] = function(options) {\n return new GB18030Encoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['gb18030'] = function(options) {\n return new GB18030Decoder(options);\n };\n\n\n //\n // 12. Legacy multi-byte Chinese (traditional) encodings\n //\n\n // 12.1 Big5\n\n // 12.1.1 Big5 decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function Big5Decoder(options) {\n var fatal = options.fatal;\n // Big5's decoder has an associated Big5 lead (initially 0x00).\n var /** @type {number} */ Big5_lead = 0x00;\n\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and Big5 lead is not 0x00, set\n // Big5 lead to 0x00 and return error.\n if (bite === end_of_stream && Big5_lead !== 0x00) {\n Big5_lead = 0x00;\n return decoderError(fatal);\n }\n\n // 2. If byte is end-of-stream and Big5 lead is 0x00, return\n // finished.\n if (bite === end_of_stream && Big5_lead === 0x00)\n return finished;\n\n // 3. If Big5 lead is not 0x00, let lead be Big5 lead, let\n // pointer be null, set Big5 lead to 0x00, and then run these\n // substeps:\n if (Big5_lead !== 0x00) {\n var lead = Big5_lead;\n var pointer = null;\n Big5_lead = 0x00;\n\n // 1. Let offset be 0x40 if byte is less than 0x7F and 0x62\n // otherwise.\n var offset = bite < 0x7F ? 0x40 : 0x62;\n\n // 2. If byte is in the range 0x40 to 0x7E, inclusive, or 0xA1\n // to 0xFE, inclusive, set pointer to (lead − 0x81) × 157 +\n // (byte − offset).\n if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0xA1, 0xFE))\n pointer = (lead - 0x81) * 157 + (bite - offset);\n\n // 3. If there is a row in the table below whose first column\n // is pointer, return the two code points listed in its second\n // column\n // Pointer | Code points\n // --------+--------------\n // 1133 | U+00CA U+0304\n // 1135 | U+00CA U+030C\n // 1164 | U+00EA U+0304\n // 1166 | U+00EA U+030C\n switch (pointer) {\n case 1133: return [0x00CA, 0x0304];\n case 1135: return [0x00CA, 0x030C];\n case 1164: return [0x00EA, 0x0304];\n case 1166: return [0x00EA, 0x030C];\n }\n\n // 4. Let code point be null if pointer is null and the index\n // code point for pointer in index Big5 otherwise.\n var code_point = (pointer === null) ? null :\n indexCodePointFor(pointer, index('big5'));\n\n // 5. If code point is null and byte is an ASCII byte, prepend\n // byte to stream.\n if (code_point === null && isASCIIByte(bite))\n stream.prepend(bite);\n\n // 6. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 7. Return a code point whose value is code point.\n return code_point;\n }\n\n // 4. If byte is an ASCII byte, return a code point whose value\n // is byte.\n if (isASCIIByte(bite))\n return bite;\n\n // 5. If byte is in the range 0x81 to 0xFE, inclusive, set Big5\n // lead to byte and return continue.\n if (inRange(bite, 0x81, 0xFE)) {\n Big5_lead = bite;\n return null;\n }\n\n // 6. Return error.\n return decoderError(fatal);\n };\n }\n\n // 12.1.2 Big5 encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function Big5Encoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. Let pointer be the index Big5 pointer for code point.\n var pointer = indexBig5PointerFor(code_point);\n\n // 4. If pointer is null, return error with code point.\n if (pointer === null)\n return encoderError(code_point);\n\n // 5. Let lead be floor(pointer / 157) + 0x81.\n var lead = floor(pointer / 157) + 0x81;\n\n // 6. If lead is less than 0xA1, return error with code point.\n if (lead < 0xA1)\n return encoderError(code_point);\n\n // 7. Let trail be pointer % 157.\n var trail = pointer % 157;\n\n // 8. Let offset be 0x40 if trail is less than 0x3F and 0x62\n // otherwise.\n var offset = trail < 0x3F ? 0x40 : 0x62;\n\n // Return two bytes whose values are lead and trail + offset.\n return [lead, trail + offset];\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['Big5'] = function(options) {\n return new Big5Encoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['Big5'] = function(options) {\n return new Big5Decoder(options);\n };\n\n\n //\n // 13. Legacy multi-byte Japanese encodings\n //\n\n // 13.1 euc-jp\n\n // 13.1.1 euc-jp decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function EUCJPDecoder(options) {\n var fatal = options.fatal;\n\n // euc-jp's decoder has an associated euc-jp jis0212 flag\n // (initially unset) and euc-jp lead (initially 0x00).\n var /** @type {boolean} */ eucjp_jis0212_flag = false,\n /** @type {number} */ eucjp_lead = 0x00;\n\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and euc-jp lead is not 0x00, set\n // euc-jp lead to 0x00, and return error.\n if (bite === end_of_stream && eucjp_lead !== 0x00) {\n eucjp_lead = 0x00;\n return decoderError(fatal);\n }\n\n // 2. If byte is end-of-stream and euc-jp lead is 0x00, return\n // finished.\n if (bite === end_of_stream && eucjp_lead === 0x00)\n return finished;\n\n // 3. If euc-jp lead is 0x8E and byte is in the range 0xA1 to\n // 0xDF, inclusive, set euc-jp lead to 0x00 and return a code\n // point whose value is 0xFF61 − 0xA1 + byte.\n if (eucjp_lead === 0x8E && inRange(bite, 0xA1, 0xDF)) {\n eucjp_lead = 0x00;\n return 0xFF61 - 0xA1 + bite;\n }\n\n // 4. If euc-jp lead is 0x8F and byte is in the range 0xA1 to\n // 0xFE, inclusive, set the euc-jp jis0212 flag, set euc-jp lead\n // to byte, and return continue.\n if (eucjp_lead === 0x8F && inRange(bite, 0xA1, 0xFE)) {\n eucjp_jis0212_flag = true;\n eucjp_lead = bite;\n return null;\n }\n\n // 5. If euc-jp lead is not 0x00, let lead be euc-jp lead, set\n // euc-jp lead to 0x00, and run these substeps:\n if (eucjp_lead !== 0x00) {\n var lead = eucjp_lead;\n eucjp_lead = 0x00;\n\n // 1. Let code point be null.\n var code_point = null;\n\n // 2. If lead and byte are both in the range 0xA1 to 0xFE,\n // inclusive, set code point to the index code point for (lead\n // − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp\n // jis0212 flag is unset and in index jis0212 otherwise.\n if (inRange(lead, 0xA1, 0xFE) && inRange(bite, 0xA1, 0xFE)) {\n code_point = indexCodePointFor(\n (lead - 0xA1) * 94 + (bite - 0xA1),\n index(!eucjp_jis0212_flag ? 'jis0208' : 'jis0212'));\n }\n\n // 3. Unset the euc-jp jis0212 flag.\n eucjp_jis0212_flag = false;\n\n // 4. If byte is not in the range 0xA1 to 0xFE, inclusive,\n // prepend byte to stream.\n if (!inRange(bite, 0xA1, 0xFE))\n stream.prepend(bite);\n\n // 5. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 6. Return a code point whose value is code point.\n return code_point;\n }\n\n // 6. If byte is an ASCII byte, return a code point whose value\n // is byte.\n if (isASCIIByte(bite))\n return bite;\n\n // 7. If byte is 0x8E, 0x8F, or in the range 0xA1 to 0xFE,\n // inclusive, set euc-jp lead to byte and return continue.\n if (bite === 0x8E || bite === 0x8F || inRange(bite, 0xA1, 0xFE)) {\n eucjp_lead = bite;\n return null;\n }\n\n // 8. Return error.\n return decoderError(fatal);\n };\n }\n\n // 13.1.2 euc-jp encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function EUCJPEncoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. If code point is U+00A5, return byte 0x5C.\n if (code_point === 0x00A5)\n return 0x5C;\n\n // 4. If code point is U+203E, return byte 0x7E.\n if (code_point === 0x203E)\n return 0x7E;\n\n // 5. If code point is in the range U+FF61 to U+FF9F, inclusive,\n // return two bytes whose values are 0x8E and code point −\n // 0xFF61 + 0xA1.\n if (inRange(code_point, 0xFF61, 0xFF9F))\n return [0x8E, code_point - 0xFF61 + 0xA1];\n\n // 6. If code point is U+2212, set it to U+FF0D.\n if (code_point === 0x2212)\n code_point = 0xFF0D;\n\n // 7. Let pointer be the index pointer for code point in index\n // jis0208.\n var pointer = indexPointerFor(code_point, index('jis0208'));\n\n // 8. If pointer is null, return error with code point.\n if (pointer === null)\n return encoderError(code_point);\n\n // 9. Let lead be floor(pointer / 94) + 0xA1.\n var lead = floor(pointer / 94) + 0xA1;\n\n // 10. Let trail be pointer % 94 + 0xA1.\n var trail = pointer % 94 + 0xA1;\n\n // 11. Return two bytes whose values are lead and trail.\n return [lead, trail];\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['EUC-JP'] = function(options) {\n return new EUCJPEncoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['EUC-JP'] = function(options) {\n return new EUCJPDecoder(options);\n };\n\n // 13.2 iso-2022-jp\n\n // 13.2.1 iso-2022-jp decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function ISO2022JPDecoder(options) {\n var fatal = options.fatal;\n /** @enum */\n var states = {\n ASCII: 0,\n Roman: 1,\n Katakana: 2,\n LeadByte: 3,\n TrailByte: 4,\n EscapeStart: 5,\n Escape: 6\n };\n // iso-2022-jp's decoder has an associated iso-2022-jp decoder\n // state (initially ASCII), iso-2022-jp decoder output state\n // (initially ASCII), iso-2022-jp lead (initially 0x00), and\n // iso-2022-jp output flag (initially unset).\n var /** @type {number} */ iso2022jp_decoder_state = states.ASCII,\n /** @type {number} */ iso2022jp_decoder_output_state = states.ASCII,\n /** @type {number} */ iso2022jp_lead = 0x00,\n /** @type {boolean} */ iso2022jp_output_flag = false;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // switching on iso-2022-jp decoder state:\n switch (iso2022jp_decoder_state) {\n default:\n case states.ASCII:\n // ASCII\n // Based on byte:\n\n // 0x1B\n if (bite === 0x1B) {\n // Set iso-2022-jp decoder state to escape start and return\n // continue.\n iso2022jp_decoder_state = states.EscapeStart;\n return null;\n }\n\n // 0x00 to 0x7F, excluding 0x0E, 0x0F, and 0x1B\n if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E\n && bite !== 0x0F && bite !== 0x1B) {\n // Unset the iso-2022-jp output flag and return a code point\n // whose value is byte.\n iso2022jp_output_flag = false;\n return bite;\n }\n\n // end-of-stream\n if (bite === end_of_stream) {\n // Return finished.\n return finished;\n }\n\n // Otherwise\n // Unset the iso-2022-jp output flag and return error.\n iso2022jp_output_flag = false;\n return decoderError(fatal);\n\n case states.Roman:\n // Roman\n // Based on byte:\n\n // 0x1B\n if (bite === 0x1B) {\n // Set iso-2022-jp decoder state to escape start and return\n // continue.\n iso2022jp_decoder_state = states.EscapeStart;\n return null;\n }\n\n // 0x5C\n if (bite === 0x5C) {\n // Unset the iso-2022-jp output flag and return code point\n // U+00A5.\n iso2022jp_output_flag = false;\n return 0x00A5;\n }\n\n // 0x7E\n if (bite === 0x7E) {\n // Unset the iso-2022-jp output flag and return code point\n // U+203E.\n iso2022jp_output_flag = false;\n return 0x203E;\n }\n\n // 0x00 to 0x7F, excluding 0x0E, 0x0F, 0x1B, 0x5C, and 0x7E\n if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F\n && bite !== 0x1B && bite !== 0x5C && bite !== 0x7E) {\n // Unset the iso-2022-jp output flag and return a code point\n // whose value is byte.\n iso2022jp_output_flag = false;\n return bite;\n }\n\n // end-of-stream\n if (bite === end_of_stream) {\n // Return finished.\n return finished;\n }\n\n // Otherwise\n // Unset the iso-2022-jp output flag and return error.\n iso2022jp_output_flag = false;\n return decoderError(fatal);\n\n case states.Katakana:\n // Katakana\n // Based on byte:\n\n // 0x1B\n if (bite === 0x1B) {\n // Set iso-2022-jp decoder state to escape start and return\n // continue.\n iso2022jp_decoder_state = states.EscapeStart;\n return null;\n }\n\n // 0x21 to 0x5F\n if (inRange(bite, 0x21, 0x5F)) {\n // Unset the iso-2022-jp output flag and return a code point\n // whose value is 0xFF61 − 0x21 + byte.\n iso2022jp_output_flag = false;\n return 0xFF61 - 0x21 + bite;\n }\n\n // end-of-stream\n if (bite === end_of_stream) {\n // Return finished.\n return finished;\n }\n\n // Otherwise\n // Unset the iso-2022-jp output flag and return error.\n iso2022jp_output_flag = false;\n return decoderError(fatal);\n\n case states.LeadByte:\n // Lead byte\n // Based on byte:\n\n // 0x1B\n if (bite === 0x1B) {\n // Set iso-2022-jp decoder state to escape start and return\n // continue.\n iso2022jp_decoder_state = states.EscapeStart;\n return null;\n }\n\n // 0x21 to 0x7E\n if (inRange(bite, 0x21, 0x7E)) {\n // Unset the iso-2022-jp output flag, set iso-2022-jp lead\n // to byte, iso-2022-jp decoder state to trail byte, and\n // return continue.\n iso2022jp_output_flag = false;\n iso2022jp_lead = bite;\n iso2022jp_decoder_state = states.TrailByte;\n return null;\n }\n\n // end-of-stream\n if (bite === end_of_stream) {\n // Return finished.\n return finished;\n }\n\n // Otherwise\n // Unset the iso-2022-jp output flag and return error.\n iso2022jp_output_flag = false;\n return decoderError(fatal);\n\n case states.TrailByte:\n // Trail byte\n // Based on byte:\n\n // 0x1B\n if (bite === 0x1B) {\n // Set iso-2022-jp decoder state to escape start and return\n // continue.\n iso2022jp_decoder_state = states.EscapeStart;\n return decoderError(fatal);\n }\n\n // 0x21 to 0x7E\n if (inRange(bite, 0x21, 0x7E)) {\n // 1. Set the iso-2022-jp decoder state to lead byte.\n iso2022jp_decoder_state = states.LeadByte;\n\n // 2. Let pointer be (iso-2022-jp lead − 0x21) × 94 + byte − 0x21.\n var pointer = (iso2022jp_lead - 0x21) * 94 + bite - 0x21;\n\n // 3. Let code point be the index code point for pointer in\n // index jis0208.\n var code_point = indexCodePointFor(pointer, index('jis0208'));\n\n // 4. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 5. Return a code point whose value is code point.\n return code_point;\n }\n\n // end-of-stream\n if (bite === end_of_stream) {\n // Set the iso-2022-jp decoder state to lead byte, prepend\n // byte to stream, and return error.\n iso2022jp_decoder_state = states.LeadByte;\n stream.prepend(bite);\n return decoderError(fatal);\n }\n\n // Otherwise\n // Set iso-2022-jp decoder state to lead byte and return\n // error.\n iso2022jp_decoder_state = states.LeadByte;\n return decoderError(fatal);\n\n case states.EscapeStart:\n // Escape start\n\n // 1. If byte is either 0x24 or 0x28, set iso-2022-jp lead to\n // byte, iso-2022-jp decoder state to escape, and return\n // continue.\n if (bite === 0x24 || bite === 0x28) {\n iso2022jp_lead = bite;\n iso2022jp_decoder_state = states.Escape;\n return null;\n }\n\n // 2. Prepend byte to stream.\n stream.prepend(bite);\n\n // 3. Unset the iso-2022-jp output flag, set iso-2022-jp\n // decoder state to iso-2022-jp decoder output state, and\n // return error.\n iso2022jp_output_flag = false;\n iso2022jp_decoder_state = iso2022jp_decoder_output_state;\n return decoderError(fatal);\n\n case states.Escape:\n // Escape\n\n // 1. Let lead be iso-2022-jp lead and set iso-2022-jp lead to\n // 0x00.\n var lead = iso2022jp_lead;\n iso2022jp_lead = 0x00;\n\n // 2. Let state be null.\n var state = null;\n\n // 3. If lead is 0x28 and byte is 0x42, set state to ASCII.\n if (lead === 0x28 && bite === 0x42)\n state = states.ASCII;\n\n // 4. If lead is 0x28 and byte is 0x4A, set state to Roman.\n if (lead === 0x28 && bite === 0x4A)\n state = states.Roman;\n\n // 5. If lead is 0x28 and byte is 0x49, set state to Katakana.\n if (lead === 0x28 && bite === 0x49)\n state = states.Katakana;\n\n // 6. If lead is 0x24 and byte is either 0x40 or 0x42, set\n // state to lead byte.\n if (lead === 0x24 && (bite === 0x40 || bite === 0x42))\n state = states.LeadByte;\n\n // 7. If state is non-null, run these substeps:\n if (state !== null) {\n // 1. Set iso-2022-jp decoder state and iso-2022-jp decoder\n // output state to states.\n iso2022jp_decoder_state = iso2022jp_decoder_state = state;\n\n // 2. Let output flag be the iso-2022-jp output flag.\n var output_flag = iso2022jp_output_flag;\n\n // 3. Set the iso-2022-jp output flag.\n iso2022jp_output_flag = true;\n\n // 4. Return continue, if output flag is unset, and error\n // otherwise.\n return !output_flag ? null : decoderError(fatal);\n }\n\n // 8. Prepend lead and byte to stream.\n stream.prepend([lead, bite]);\n\n // 9. Unset the iso-2022-jp output flag, set iso-2022-jp\n // decoder state to iso-2022-jp decoder output state and\n // return error.\n iso2022jp_output_flag = false;\n iso2022jp_decoder_state = iso2022jp_decoder_output_state;\n return decoderError(fatal);\n }\n };\n }\n\n // 13.2.2 iso-2022-jp encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function ISO2022JPEncoder(options) {\n var fatal = options.fatal;\n // iso-2022-jp's encoder has an associated iso-2022-jp encoder\n // state which is one of ASCII, Roman, and jis0208 (initially\n // ASCII).\n /** @enum */\n var states = {\n ASCII: 0,\n Roman: 1,\n jis0208: 2\n };\n var /** @type {number} */ iso2022jp_state = states.ASCII;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream and iso-2022-jp encoder\n // state is not ASCII, prepend code point to stream, set\n // iso-2022-jp encoder state to ASCII, and return three bytes\n // 0x1B 0x28 0x42.\n if (code_point === end_of_stream &&\n iso2022jp_state !== states.ASCII) {\n stream.prepend(code_point);\n iso2022jp_state = states.ASCII;\n return [0x1B, 0x28, 0x42];\n }\n\n // 2. If code point is end-of-stream and iso-2022-jp encoder\n // state is ASCII, return finished.\n if (code_point === end_of_stream && iso2022jp_state === states.ASCII)\n return finished;\n\n // 3. If ISO-2022-JP encoder state is ASCII or Roman, and code\n // point is U+000E, U+000F, or U+001B, return error with U+FFFD.\n if ((iso2022jp_state === states.ASCII ||\n iso2022jp_state === states.Roman) &&\n (code_point === 0x000E || code_point === 0x000F ||\n code_point === 0x001B)) {\n return encoderError(0xFFFD);\n }\n\n // 4. If iso-2022-jp encoder state is ASCII and code point is an\n // ASCII code point, return a byte whose value is code point.\n if (iso2022jp_state === states.ASCII &&\n isASCIICodePoint(code_point))\n return code_point;\n\n // 5. If iso-2022-jp encoder state is Roman and code point is an\n // ASCII code point, excluding U+005C and U+007E, or is U+00A5\n // or U+203E, run these substeps:\n if (iso2022jp_state === states.Roman &&\n ((isASCIICodePoint(code_point) &&\n code_point !== 0x005C && code_point !== 0x007E) ||\n (code_point == 0x00A5 || code_point == 0x203E))) {\n\n // 1. If code point is an ASCII code point, return a byte\n // whose value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 2. If code point is U+00A5, return byte 0x5C.\n if (code_point === 0x00A5)\n return 0x5C;\n\n // 3. If code point is U+203E, return byte 0x7E.\n if (code_point === 0x203E)\n return 0x7E;\n }\n\n // 6. If code point is an ASCII code point, and iso-2022-jp\n // encoder state is not ASCII, prepend code point to stream, set\n // iso-2022-jp encoder state to ASCII, and return three bytes\n // 0x1B 0x28 0x42.\n if (isASCIICodePoint(code_point) &&\n iso2022jp_state !== states.ASCII) {\n stream.prepend(code_point);\n iso2022jp_state = states.ASCII;\n return [0x1B, 0x28, 0x42];\n }\n\n // 7. If code point is either U+00A5 or U+203E, and iso-2022-jp\n // encoder state is not Roman, prepend code point to stream, set\n // iso-2022-jp encoder state to Roman, and return three bytes\n // 0x1B 0x28 0x4A.\n if ((code_point === 0x00A5 || code_point === 0x203E) &&\n iso2022jp_state !== states.Roman) {\n stream.prepend(code_point);\n iso2022jp_state = states.Roman;\n return [0x1B, 0x28, 0x4A];\n }\n\n // 8. If code point is U+2212, set it to U+FF0D.\n if (code_point === 0x2212)\n code_point = 0xFF0D;\n\n // 9. Let pointer be the index pointer for code point in index\n // jis0208.\n var pointer = indexPointerFor(code_point, index('jis0208'));\n\n // 10. If pointer is null, return error with code point.\n if (pointer === null)\n return encoderError(code_point);\n\n // 11. If iso-2022-jp encoder state is not jis0208, prepend code\n // point to stream, set iso-2022-jp encoder state to jis0208,\n // and return three bytes 0x1B 0x24 0x42.\n if (iso2022jp_state !== states.jis0208) {\n stream.prepend(code_point);\n iso2022jp_state = states.jis0208;\n return [0x1B, 0x24, 0x42];\n }\n\n // 12. Let lead be floor(pointer / 94) + 0x21.\n var lead = floor(pointer / 94) + 0x21;\n\n // 13. Let trail be pointer % 94 + 0x21.\n var trail = pointer % 94 + 0x21;\n\n // 14. Return two bytes whose values are lead and trail.\n return [lead, trail];\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['ISO-2022-JP'] = function(options) {\n return new ISO2022JPEncoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['ISO-2022-JP'] = function(options) {\n return new ISO2022JPDecoder(options);\n };\n\n // 13.3 Shift_JIS\n\n // 13.3.1 Shift_JIS decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function ShiftJISDecoder(options) {\n var fatal = options.fatal;\n // Shift_JIS's decoder has an associated Shift_JIS lead (initially\n // 0x00).\n var /** @type {number} */ Shift_JIS_lead = 0x00;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and Shift_JIS lead is not 0x00,\n // set Shift_JIS lead to 0x00 and return error.\n if (bite === end_of_stream && Shift_JIS_lead !== 0x00) {\n Shift_JIS_lead = 0x00;\n return decoderError(fatal);\n }\n\n // 2. If byte is end-of-stream and Shift_JIS lead is 0x00,\n // return finished.\n if (bite === end_of_stream && Shift_JIS_lead === 0x00)\n return finished;\n\n // 3. If Shift_JIS lead is not 0x00, let lead be Shift_JIS lead,\n // let pointer be null, set Shift_JIS lead to 0x00, and then run\n // these substeps:\n if (Shift_JIS_lead !== 0x00) {\n var lead = Shift_JIS_lead;\n var pointer = null;\n Shift_JIS_lead = 0x00;\n\n // 1. Let offset be 0x40, if byte is less than 0x7F, and 0x41\n // otherwise.\n var offset = (bite < 0x7F) ? 0x40 : 0x41;\n\n // 2. Let lead offset be 0x81, if lead is less than 0xA0, and\n // 0xC1 otherwise.\n var lead_offset = (lead < 0xA0) ? 0x81 : 0xC1;\n\n // 3. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80\n // to 0xFC, inclusive, set pointer to (lead − lead offset) ×\n // 188 + byte − offset.\n if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFC))\n pointer = (lead - lead_offset) * 188 + bite - offset;\n\n // 4. If pointer is in the range 8836 to 10715, inclusive,\n // return a code point whose value is 0xE000 − 8836 + pointer.\n if (inRange(pointer, 8836, 10715))\n return 0xE000 - 8836 + pointer;\n\n // 5. Let code point be null, if pointer is null, and the\n // index code point for pointer in index jis0208 otherwise.\n var code_point = (pointer === null) ? null :\n indexCodePointFor(pointer, index('jis0208'));\n\n // 6. If code point is null and byte is an ASCII byte, prepend\n // byte to stream.\n if (code_point === null && isASCIIByte(bite))\n stream.prepend(bite);\n\n // 7. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 8. Return a code point whose value is code point.\n return code_point;\n }\n\n // 4. If byte is an ASCII byte or 0x80, return a code point\n // whose value is byte.\n if (isASCIIByte(bite) || bite === 0x80)\n return bite;\n\n // 5. If byte is in the range 0xA1 to 0xDF, inclusive, return a\n // code point whose value is 0xFF61 − 0xA1 + byte.\n if (inRange(bite, 0xA1, 0xDF))\n return 0xFF61 - 0xA1 + bite;\n\n // 6. If byte is in the range 0x81 to 0x9F, inclusive, or 0xE0\n // to 0xFC, inclusive, set Shift_JIS lead to byte and return\n // continue.\n if (inRange(bite, 0x81, 0x9F) || inRange(bite, 0xE0, 0xFC)) {\n Shift_JIS_lead = bite;\n return null;\n }\n\n // 7. Return error.\n return decoderError(fatal);\n };\n }\n\n // 13.3.2 Shift_JIS encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function ShiftJISEncoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point or U+0080, return a\n // byte whose value is code point.\n if (isASCIICodePoint(code_point) || code_point === 0x0080)\n return code_point;\n\n // 3. If code point is U+00A5, return byte 0x5C.\n if (code_point === 0x00A5)\n return 0x5C;\n\n // 4. If code point is U+203E, return byte 0x7E.\n if (code_point === 0x203E)\n return 0x7E;\n\n // 5. If code point is in the range U+FF61 to U+FF9F, inclusive,\n // return a byte whose value is code point − 0xFF61 + 0xA1.\n if (inRange(code_point, 0xFF61, 0xFF9F))\n return code_point - 0xFF61 + 0xA1;\n\n // 6. If code point is U+2212, set it to U+FF0D.\n if (code_point === 0x2212)\n code_point = 0xFF0D;\n\n // 7. Let pointer be the index Shift_JIS pointer for code point.\n var pointer = indexShiftJISPointerFor(code_point);\n\n // 8. If pointer is null, return error with code point.\n if (pointer === null)\n return encoderError(code_point);\n\n // 9. Let lead be floor(pointer / 188).\n var lead = floor(pointer / 188);\n\n // 10. Let lead offset be 0x81, if lead is less than 0x1F, and\n // 0xC1 otherwise.\n var lead_offset = (lead < 0x1F) ? 0x81 : 0xC1;\n\n // 11. Let trail be pointer % 188.\n var trail = pointer % 188;\n\n // 12. Let offset be 0x40, if trail is less than 0x3F, and 0x41\n // otherwise.\n var offset = (trail < 0x3F) ? 0x40 : 0x41;\n\n // 13. Return two bytes whose values are lead + lead offset and\n // trail + offset.\n return [lead + lead_offset, trail + offset];\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['Shift_JIS'] = function(options) {\n return new ShiftJISEncoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['Shift_JIS'] = function(options) {\n return new ShiftJISDecoder(options);\n };\n\n //\n // 14. Legacy multi-byte Korean encodings\n //\n\n // 14.1 euc-kr\n\n // 14.1.1 euc-kr decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function EUCKRDecoder(options) {\n var fatal = options.fatal;\n\n // euc-kr's decoder has an associated euc-kr lead (initially 0x00).\n var /** @type {number} */ euckr_lead = 0x00;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and euc-kr lead is not 0x00, set\n // euc-kr lead to 0x00 and return error.\n if (bite === end_of_stream && euckr_lead !== 0) {\n euckr_lead = 0x00;\n return decoderError(fatal);\n }\n\n // 2. If byte is end-of-stream and euc-kr lead is 0x00, return\n // finished.\n if (bite === end_of_stream && euckr_lead === 0)\n return finished;\n\n // 3. If euc-kr lead is not 0x00, let lead be euc-kr lead, let\n // pointer be null, set euc-kr lead to 0x00, and then run these\n // substeps:\n if (euckr_lead !== 0x00) {\n var lead = euckr_lead;\n var pointer = null;\n euckr_lead = 0x00;\n\n // 1. If byte is in the range 0x41 to 0xFE, inclusive, set\n // pointer to (lead − 0x81) × 190 + (byte − 0x41).\n if (inRange(bite, 0x41, 0xFE))\n pointer = (lead - 0x81) * 190 + (bite - 0x41);\n\n // 2. Let code point be null, if pointer is null, and the\n // index code point for pointer in index euc-kr otherwise.\n var code_point = (pointer === null)\n ? null : indexCodePointFor(pointer, index('euc-kr'));\n\n // 3. If code point is null and byte is an ASCII byte, prepend\n // byte to stream.\n if (pointer === null && isASCIIByte(bite))\n stream.prepend(bite);\n\n // 4. If code point is null, return error.\n if (code_point === null)\n return decoderError(fatal);\n\n // 5. Return a code point whose value is code point.\n return code_point;\n }\n\n // 4. If byte is an ASCII byte, return a code point whose value\n // is byte.\n if (isASCIIByte(bite))\n return bite;\n\n // 5. If byte is in the range 0x81 to 0xFE, inclusive, set\n // euc-kr lead to byte and return continue.\n if (inRange(bite, 0x81, 0xFE)) {\n euckr_lead = bite;\n return null;\n }\n\n // 6. Return error.\n return decoderError(fatal);\n };\n }\n\n // 14.1.2 euc-kr encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function EUCKREncoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. Let pointer be the index pointer for code point in index\n // euc-kr.\n var pointer = indexPointerFor(code_point, index('euc-kr'));\n\n // 4. If pointer is null, return error with code point.\n if (pointer === null)\n return encoderError(code_point);\n\n // 5. Let lead be floor(pointer / 190) + 0x81.\n var lead = floor(pointer / 190) + 0x81;\n\n // 6. Let trail be pointer % 190 + 0x41.\n var trail = (pointer % 190) + 0x41;\n\n // 7. Return two bytes whose values are lead and trail.\n return [lead, trail];\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['EUC-KR'] = function(options) {\n return new EUCKREncoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['EUC-KR'] = function(options) {\n return new EUCKRDecoder(options);\n };\n\n\n //\n // 15. Legacy miscellaneous encodings\n //\n\n // 15.1 replacement\n\n // Not needed - API throws RangeError\n\n // 15.2 Common infrastructure for utf-16be and utf-16le\n\n /**\n * @param {number} code_unit\n * @param {boolean} utf16be\n * @return {!Array.<number>} bytes\n */\n function convertCodeUnitToBytes(code_unit, utf16be) {\n // 1. Let byte1 be code unit >> 8.\n var byte1 = code_unit >> 8;\n\n // 2. Let byte2 be code unit & 0x00FF.\n var byte2 = code_unit & 0x00FF;\n\n // 3. Then return the bytes in order:\n // utf-16be flag is set: byte1, then byte2.\n if (utf16be)\n return [byte1, byte2];\n // utf-16be flag is unset: byte2, then byte1.\n return [byte2, byte1];\n }\n\n // 15.2.1 shared utf-16 decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {boolean} utf16_be True if big-endian, false if little-endian.\n * @param {{fatal: boolean}} options\n */\n function UTF16Decoder(utf16_be, options) {\n var fatal = options.fatal;\n var /** @type {?number} */ utf16_lead_byte = null,\n /** @type {?number} */ utf16_lead_surrogate = null;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream and either utf-16 lead byte or\n // utf-16 lead surrogate is not null, set utf-16 lead byte and\n // utf-16 lead surrogate to null, and return error.\n if (bite === end_of_stream && (utf16_lead_byte !== null ||\n utf16_lead_surrogate !== null)) {\n return decoderError(fatal);\n }\n\n // 2. If byte is end-of-stream and utf-16 lead byte and utf-16\n // lead surrogate are null, return finished.\n if (bite === end_of_stream && utf16_lead_byte === null &&\n utf16_lead_surrogate === null) {\n return finished;\n }\n\n // 3. If utf-16 lead byte is null, set utf-16 lead byte to byte\n // and return continue.\n if (utf16_lead_byte === null) {\n utf16_lead_byte = bite;\n return null;\n }\n\n // 4. Let code unit be the result of:\n var code_unit;\n if (utf16_be) {\n // utf-16be decoder flag is set\n // (utf-16 lead byte << 8) + byte.\n code_unit = (utf16_lead_byte << 8) + bite;\n } else {\n // utf-16be decoder flag is unset\n // (byte << 8) + utf-16 lead byte.\n code_unit = (bite << 8) + utf16_lead_byte;\n }\n // Then set utf-16 lead byte to null.\n utf16_lead_byte = null;\n\n // 5. If utf-16 lead surrogate is not null, let lead surrogate\n // be utf-16 lead surrogate, set utf-16 lead surrogate to null,\n // and then run these substeps:\n if (utf16_lead_surrogate !== null) {\n var lead_surrogate = utf16_lead_surrogate;\n utf16_lead_surrogate = null;\n\n // 1. If code unit is in the range U+DC00 to U+DFFF,\n // inclusive, return a code point whose value is 0x10000 +\n // ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00).\n if (inRange(code_unit, 0xDC00, 0xDFFF)) {\n return 0x10000 + (lead_surrogate - 0xD800) * 0x400 +\n (code_unit - 0xDC00);\n }\n\n // 2. Prepend the sequence resulting of converting code unit\n // to bytes using utf-16be decoder flag to stream and return\n // error.\n stream.prepend(convertCodeUnitToBytes(code_unit, utf16_be));\n return decoderError(fatal);\n }\n\n // 6. If code unit is in the range U+D800 to U+DBFF, inclusive,\n // set utf-16 lead surrogate to code unit and return continue.\n if (inRange(code_unit, 0xD800, 0xDBFF)) {\n utf16_lead_surrogate = code_unit;\n return null;\n }\n\n // 7. If code unit is in the range U+DC00 to U+DFFF, inclusive,\n // return error.\n if (inRange(code_unit, 0xDC00, 0xDFFF))\n return decoderError(fatal);\n\n // 8. Return code point code unit.\n return code_unit;\n };\n }\n\n // 15.2.2 shared utf-16 encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {boolean} utf16_be True if big-endian, false if little-endian.\n * @param {{fatal: boolean}} options\n */\n function UTF16Encoder(utf16_be, options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1. If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is in the range U+0000 to U+FFFF, inclusive,\n // return the sequence resulting of converting code point to\n // bytes using utf-16be encoder flag.\n if (inRange(code_point, 0x0000, 0xFFFF))\n return convertCodeUnitToBytes(code_point, utf16_be);\n\n // 3. Let lead be ((code point − 0x10000) >> 10) + 0xD800,\n // converted to bytes using utf-16be encoder flag.\n var lead = convertCodeUnitToBytes(\n ((code_point - 0x10000) >> 10) + 0xD800, utf16_be);\n\n // 4. Let trail be ((code point − 0x10000) & 0x3FF) + 0xDC00,\n // converted to bytes using utf-16be encoder flag.\n var trail = convertCodeUnitToBytes(\n ((code_point - 0x10000) & 0x3FF) + 0xDC00, utf16_be);\n\n // 5. Return a byte sequence of lead followed by trail.\n return lead.concat(trail);\n };\n }\n\n // 15.3 utf-16be\n // 15.3.1 utf-16be decoder\n /** @param {{fatal: boolean}} options */\n encoders['UTF-16BE'] = function(options) {\n return new UTF16Encoder(true, options);\n };\n // 15.3.2 utf-16be encoder\n /** @param {{fatal: boolean}} options */\n decoders['UTF-16BE'] = function(options) {\n return new UTF16Decoder(true, options);\n };\n\n // 15.4 utf-16le\n // 15.4.1 utf-16le decoder\n /** @param {{fatal: boolean}} options */\n encoders['UTF-16LE'] = function(options) {\n return new UTF16Encoder(false, options);\n };\n // 15.4.2 utf-16le encoder\n /** @param {{fatal: boolean}} options */\n decoders['UTF-16LE'] = function(options) {\n return new UTF16Decoder(false, options);\n };\n\n // 15.5 x-user-defined\n\n // 15.5.1 x-user-defined decoder\n /**\n * @constructor\n * @implements {Decoder}\n * @param {{fatal: boolean}} options\n */\n function XUserDefinedDecoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not enough data exists in the input\n * stream to decode a complete code point.\n */\n this.handler = function(stream, bite) {\n // 1. If byte is end-of-stream, return finished.\n if (bite === end_of_stream)\n return finished;\n\n // 2. If byte is an ASCII byte, return a code point whose value\n // is byte.\n if (isASCIIByte(bite))\n return bite;\n\n // 3. Return a code point whose value is 0xF780 + byte − 0x80.\n return 0xF780 + bite - 0x80;\n };\n }\n\n // 15.5.2 x-user-defined encoder\n /**\n * @constructor\n * @implements {Encoder}\n * @param {{fatal: boolean}} options\n */\n function XUserDefinedEncoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n */\n this.handler = function(stream, code_point) {\n // 1.If code point is end-of-stream, return finished.\n if (code_point === end_of_stream)\n return finished;\n\n // 2. If code point is an ASCII code point, return a byte whose\n // value is code point.\n if (isASCIICodePoint(code_point))\n return code_point;\n\n // 3. If code point is in the range U+F780 to U+F7FF, inclusive,\n // return a byte whose value is code point − 0xF780 + 0x80.\n if (inRange(code_point, 0xF780, 0xF7FF))\n return code_point - 0xF780 + 0x80;\n\n // 4. Return error with code point.\n return encoderError(code_point);\n };\n }\n\n /** @param {{fatal: boolean}} options */\n encoders['x-user-defined'] = function(options) {\n return new XUserDefinedEncoder(options);\n };\n /** @param {{fatal: boolean}} options */\n decoders['x-user-defined'] = function(options) {\n return new XUserDefinedDecoder(options);\n };\n\n if (!global['TextEncoder'])\n global['TextEncoder'] = TextEncoder;\n if (!global['TextDecoder'])\n global['TextDecoder'] = TextDecoder;\n\n if ( true && module.exports) {\n module.exports = {\n TextEncoder: global['TextEncoder'],\n TextDecoder: global['TextDecoder'],\n EncodingIndexes: global[\"encoding-indexes\"]\n };\n }\n\n// For strict environments where `this` inside the global scope\n// is `undefined`, take a pure object instead\n}(this || {}));\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/node_modules/text-encoding/lib/encoding.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/Crypto.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/Crypto.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Module dependencies\n */\nconst legacyCrypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\")\nconst SubtleCrypto = __webpack_require__(/*! ./SubtleCrypto */ \"./node_modules/@trust/webcrypto/src/SubtleCrypto.js\")\nconst {QuotaExceededError, TypeMismatchError} = __webpack_require__(/*! ./errors */ \"./node_modules/@trust/webcrypto/src/errors/index.js\")\n\n/**\n * integerTypes\n */\nconst integerTypes = [\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array\n]\n\n/**\n * integerGetByConstructor\n */\nconst integerGetByConstructor = {\n 'Int8Array': 'getInt8',\n 'Uint8Array': 'getUint8',\n 'Int16Array': 'getInt16',\n 'Uint16Array': 'getUint16',\n 'Int32Array': 'getInt32',\n 'Uint32Array': 'getUint32'\n}\n\n/**\n * Crypto interface\n */\nclass Crypto {\n\n /**\n * getRandomValues\n */\n getRandomValues (typedArray) {\n if (!integerTypes.some(type => typedArray instanceof type)) {\n throw new TypeMismatchError()\n }\n\n let byteLength = typedArray.byteLength\n\n if (byteLength > 65536) {\n throw new QuotaExceededError()\n }\n\n let type = typedArray.constructor\n let method = integerGetByConstructor[type.name]\n let totalBytes = byteLength * typedArray.length\n let buffer = legacyCrypto.randomBytes(totalBytes)\n let arrayBuffer = new Uint8Array(buffer)\n let dataView = new DataView(arrayBuffer.buffer)\n\n for (let byteIndex = 0; byteIndex < totalBytes; byteIndex += byteLength) {\n let integer = dataView[method](byteIndex)\n let arrayIndex = byteIndex / byteLength\n typedArray[arrayIndex] = integer\n }\n\n return typedArray\n }\n\n /**\n * subtle\n */\n get subtle () {\n return new SubtleCrypto()\n }\n\n}\n\n/**\n * Export\n */\nmodule.exports = Crypto\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/Crypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/SubtleCrypto.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/SubtleCrypto.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Local dependencies\n */\nconst CryptoKey = __webpack_require__(/*! ./keys/CryptoKey */ \"./node_modules/@trust/webcrypto/src/keys/CryptoKey.js\")\nconst CryptoKeyPair = __webpack_require__(/*! ./keys/CryptoKeyPair */ \"./node_modules/@trust/webcrypto/src/keys/CryptoKeyPair.js\")\nconst JsonWebKey = __webpack_require__(/*! ./keys/JsonWebKey */ \"./node_modules/@trust/webcrypto/src/keys/JsonWebKey.js\")\nconst recognizedKeyUsages = __webpack_require__(/*! ./keys/recognizedKeyUsages */ \"./node_modules/@trust/webcrypto/src/keys/recognizedKeyUsages.js\")\nconst supportedAlgorithms = __webpack_require__(/*! ./algorithms */ \"./node_modules/@trust/webcrypto/src/algorithms/index.js\")\nconst {InvalidAccessError, NotSupportedError} = __webpack_require__(/*! ./errors */ \"./node_modules/@trust/webcrypto/src/errors/index.js\")\nconst {TextEncoder,TextDecoder} = __webpack_require__(/*! text-encoding */ \"./node_modules/@trust/webcrypto/node_modules/text-encoding/index.js\")\n\n/**\n * SubtleCrypto\n */\nclass SubtleCrypto {\n\n /**\n * encrypt\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {CryptoKey} key\n * @param {BufferSource} data\n *\n * @returns {Promise}\n */\n encrypt (algorithm, key, data) {\n data = data.slice()\n\n let normalizedAlgorithm = supportedAlgorithms.normalize('encrypt', algorithm)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n return new Promise((resolve, reject) => {\n if (normalizedAlgorithm.name !== key.algorithm.name) {\n throw new InvalidAccessError('Algorithm does not match key')\n }\n\n if (!key.usages.includes('encrypt')) {\n throw new InvalidAccessError('Key usages must include \"encrypt\"')\n }\n\n let ciphertext = normalizedAlgorithm.encrypt(algorithm,key, data)\n\n resolve(ciphertext)\n })\n }\n\n /**\n * decrypt\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {CryptoKey} key\n * @param {BufferSource} data\n *\n * @returns {Promise}\n */\n decrypt (algorithm, key, data) {\n let normalizedAlgorithm = supportedAlgorithms.normalize('decrypt', algorithm)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n data = data.slice()\n\n return new Promise((resolve, reject) => {\n if (normalizedAlgorithm.name !== key.algorithm.name) {\n throw new InvalidAccessError('Algorithm does not match key')\n }\n\n if (!key.usages.includes('decrypt')) {\n throw new InvalidAccessError('Key usages must include \"decrypt\"')\n }\n\n let plaintext = normalizedAlgorithm.decrypt(algorithm, key, data)\n resolve(plaintext)\n })\n }\n\n /**\n * sign\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {CryptoKey} key\n * @param {BufferSource} data\n *\n * @returns {Promise}\n */\n sign (algorithm, key, data) {\n data = data.slice()\n\n let normalizedAlgorithm = supportedAlgorithms.normalize('sign', algorithm)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n return new Promise((resolve, reject) => {\n if (normalizedAlgorithm.name !== key.algorithm.name) {\n throw new InvalidAccessError('Algorithm does not match key')\n }\n\n if (!key.usages.includes('sign')) {\n throw new InvalidAccessError('Key usages must include \"sign\"')\n }\n\n let result = normalizedAlgorithm.sign(key, data)\n\n resolve(result)\n })\n }\n\n /**\n * verify\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {CryptoKey} key\n * @param {BufferSource} signature\n * @param {BufferSource} data\n *\n * @returns {Promise}\n */\n verify (alg, key, signature, data) {\n signature = signature.slice()\n\n let normalizedAlgorithm = supportedAlgorithms.normalize('verify', alg)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n data = data.slice()\n\n return new Promise((resolve, reject) => {\n if (normalizedAlgorithm.name !== key.algorithm.name) {\n throw new InvalidAccessError('Algorithm does not match key')\n }\n\n if (!key.usages.includes('verify')) {\n throw new InvalidAccessError('Key usages must include \"verify\"')\n }\n\n let result = normalizedAlgorithm.verify(key, signature, data)\n resolve(result)\n })\n }\n\n /**\n * digest\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {BufferSource} data\n *\n * @returns {Promise.<ArrayBuffer>}\n */\n digest (algorithm, data) {\n data = data.slice()\n\n let normalizedAlgorithm = supportedAlgorithms.normalize('digest', algorithm)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n return new Promise((resolve, reject) => {\n try {\n let result = normalizedAlgorithm.digest(algorithm, data)\n return resolve(result)\n } catch (error) {\n return reject(error)\n }\n })\n }\n\n /**\n * generateKey\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {Boolean} extractable\n * @param {Array} keyUsages\n *\n * @returns {Promise}\n */\n generateKey (algorithm, extractable, keyUsages) {\n let normalizedAlgorithm = supportedAlgorithms.normalize('generateKey', algorithm)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n return new Promise((resolve, reject) => {\n try {\n let result = normalizedAlgorithm.generateKey(algorithm, extractable, keyUsages)\n\n if (result instanceof CryptoKey) {\n let {type,usages} = result\n let restricted = (type === 'secret' || type === 'private')\n let emptyUsages = (!usages || usages.length === 0)\n\n if (restricted && emptyUsages) {\n throw new SyntaxError()\n }\n }\n\n if (result instanceof CryptoKeyPair) {\n let {privateKey:{usages}} = result\n\n if (!usages || usages.length === 0) {\n throw new SyntaxError()\n }\n }\n\n resolve(result)\n } catch (error) {\n return reject(error)\n }\n })\n }\n\n /**\n * deriveKey\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {CryptoKey} baseKey\n * @param {AlgorithmIdentifier} derivedKeyType\n * @param {Boolean} extractable\n * @param {Array} keyUsages\n * @returns {Promise}\n */\n deriveKey (algorithm, baseKey, derivedKeyType, extractable, keyUsages) {\n return new Promise()\n }\n\n /**\n * deriveBits\n *\n * @description\n *\n * @param {AlgorithmIdentifier} algorithm\n * @param {CryptoKey} baseKey\n * @param {number} length\n *\n * @returns {Promise}\n */\n deriveBits (algorithm, baseKey, length) {\n return new Promise()\n }\n\n /**\n * importKey\n *\n * @description\n *\n * @param {KeyFormat} format\n * @param {BufferSource|JWK} keyData\n * @param {AlgorithmIdentifier} algorithm\n * @param {Boolean} extractable\n * @param {Array} keyUsages\n *\n * @returns {Promise}\n */\n importKey (format, keyData, algorithm, extractable, keyUsages) {\n let normalizedAlgorithm = supportedAlgorithms.normalize('importKey', algorithm)\n\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n return new Promise((resolve, reject) => {\n if (format === 'raw' || format === 'pkcs8' || format === 'spki') {\n if (keyData instanceof JsonWebKey) {\n throw new TypeError()\n }\n\n keyData = keyData.slice()\n }\n\n if (format === 'jwk') {\n keyData = new JsonWebKey(keyData)\n\n if (!(keyData instanceof JsonWebKey)) {\n throw new TypeError('key is not a JSON Web Key')\n }\n }\n\n try {\n let result = normalizedAlgorithm\n .importKey(format, keyData, algorithm, extractable, keyUsages)\n\n if (result.type === 'secret' || result.type === 'private') {\n if (!result.usages || result.usages.length === 0) {\n throw new SyntaxError()\n }\n }\n\n result.extractable = extractable\n result.usages = recognizedKeyUsages.normalize(keyUsages)\n\n resolve(result)\n } catch (error) {\n return reject(error)\n }\n })\n }\n\n /**\n * exportKey\n *\n * @description\n *\n * @param {KeyFormat} format\n * @param {CryptoKey} key\n *\n * @returns {Promise}\n */\n exportKey (format, key) {\n return new Promise((resolve, reject) => {\n try {\n let registeredAlgorithms = supportedAlgorithms['exportKey']\n\n if (!registeredAlgorithms[key.algorithm.name]) {\n throw new NotSupportedError(key.algorithm.name)\n }\n\n if (key.extractable === false) {\n throw new InvalidAccessError('Key is not extractable')\n }\n\n let result = key.algorithm.exportKey(format, key)\n\n resolve(result)\n } catch (error) {\n return reject(error)\n }\n })\n }\n\n /**\n * wrapKey\n *\n * @description\n *\n * @param {KeyFormat} format\n * @param {CryptoKey} key\n * @param {CryptoKey} wrappingKey\n * @param {AlgorithmIdentifier} wrapAlgorithm\n *\n * @returns {Promise}\n */\n wrapKey (format, key, wrappingKey, wrapAlgorithm) {\n // 1. Parameters\n // 2. Setup normalizedAlgorithm with op as 'unwrap'\n let normalizedAlgorithm = supportedAlgorithms.normalize('wrapKey', wrapAlgorithm)\n if (normalizedAlgorithm instanceof Error) {\n // 3. If failed, then try again with op as 'encrypt'\n normalizedAlgorithm = supportedAlgorithms.normalize('encrypt', wrapAlgorithm)\n }\n // 4. Otherwise reject outright\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n // 5-6. Setup and asynchronously return a new promise\n return new Promise((resolve, reject) => {\n // 7. Try catch the following step...\n // if anything goes wrong then reject the promise outright\n try {\n // 8. Validate normalizedAlgorithm name property\n if (normalizedAlgorithm.name !== wrappingKey.algorithm.name) {\n throw new InvalidAccessError('NormalizedAlgorthm name must be same as wrappingKey algorithm name')\n } \n\n // 9. Validate usages property contains wrap\n if (!wrappingKey.usages.includes('wrapKey')) {\n throw new InvalidAccessError('Wrapping key usages must include \"wrapKey\"')\n }\n\n // 10. Validate algorithm contains exportKey\n let exportKeyAlgorithms = supportedAlgorithms['exportKey']\n if (!exportKeyAlgorithms[key.algorithm.name]) {\n throw new NotSupportedError(key.algorithm.name)\n }\n\n // 11. Validate extractable property\n if (key.extractable === false) {\n throw new InvalidAccessError('Key is not extractable')\n }\n\n // 12. Generate extracted key\n return this.exportKey(format,key)\n .then(exportedKey => { \n let bytes\n // 13.1. If format is \"raw\", \"pkcs8\", or \"spki\":\n if ([\"raw\", \"pkcs8\",\"spki\"].includes(format)) {\n bytes = exportedKey\n }\n // 13.2. If format is \"jwk\"\n else if (format === \"jwk\"){\n let json = JSON.stringify(exportedKey)\n bytes = new TextEncoder().encode(json)\n } \n // 14.1. If the normalizedAlgorithm supports wrapKey then use it\n if (normalizedAlgorithm['wrapKey']){\n return normalizedAlgorithm.wrapKey(format,bytes,wrappingKey,wrapAlgorithm)\n }\n // 14.2. Otherwise try with encrypt\n else if (normalizedAlgorithm['encrypt']){\n return normalizedAlgorithm.encrypt(wrapAlgorithm,wrappingKey,new Uint8Array(bytes))\n } \n // 14.3. Otherwise throw error\n else {\n return reject (new NotSupportedError(normalizedAlgorithm.name))\n }\n })\n // 15. Return the resulting promise\n .then(resolve)\n } catch (error) {\n return reject(error)\n }\n })\n }\n\n /**\n * unwrapKey\n *\n * @description\n *\n * @param {KeyFormat} format\n * @param {BufferSource} wrappedKey\n * @param {CryptoKey} unwrappingKey\n * @param {AlgorithmIdentifier} unwrapAlgorithm\n * @param {AlgorithmIdentifier} unwrappedKeyAlgorithm\n * @param {Boolean} extractable\n * @param {Array} keyUsages\n *\n * @returns {Promise}\n */\n unwrapKey (format, wrappedKey, unwrappingKey, unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages) {\n // 1. Parameters\n // 2. Ommited due to redundancy\n \n // 3. Setup normalizedAlgorithm with op as 'unwrap'\n let normalizedAlgorithm = supportedAlgorithms.normalize('unwrapKey', unwrapAlgorithm)\n if (normalizedAlgorithm instanceof Error) {\n // 4. If failed, then try again with op as 'encrypt'\n normalizedAlgorithm = supportedAlgorithms.normalize('decrypt', unwrapAlgorithm)\n }\n\n // 5. Otherwise reject outright\n if (normalizedAlgorithm instanceof Error) {\n return Promise.reject(normalizedAlgorithm)\n }\n\n // 6. Setup normalizedKeyAlgorithm\n let normalizedKeyAlgorithm = supportedAlgorithms.normalize('importKey', unwrappedKeyAlgorithm)\n if (normalizedKeyAlgorithm instanceof Error) {\n // 7. If failed, then try again with op as 'encrypt'\n return Promise.reject(normalizedKeyAlgorithm)\n }\n\n // 8-9. Setup and asynchronously return a new promise\n return new Promise((resolve, reject) => {\n // 10. Try catch the following step...\n // if anything goes wrong then reject the promise outright\n try {\n // 11. Validate normalizedAlgorithm name property\n if (normalizedAlgorithm.name !== unwrappingKey.algorithm.name) {\n throw new InvalidAccessError('NormalizedAlgorthm name must be same as unwrappingKey algorithm name')\n } \n\n // 12. Validate usages property contains unwrap\n if (!unwrappingKey.usages.includes('unwrapKey')) {\n throw new InvalidAccessError('Unwrapping key usages must include \"unwrapKey\"')\n }\n \n let key\n // 13.1. If the normalizedAlgorithm supports unwrapKey then use it\n if (normalizedAlgorithm['unwrapKey']){\n key = normalizedAlgorithm.unwrapKey(format,wrappedKey,unwrappingKey,unwrapAlgorithm,unwrappedKeyAlgorithm,extractable,keyUsages)\n }\n\n // 13.2. Otherwise try with decrypt\n else if (normalizedAlgorithm['decrypt']){\n key = normalizedAlgorithm.decrypt(unwrapAlgorithm,unwrappingKey,wrappedKey)\n } \n\n // 13.3. Otherwise throw error\n else {\n return reject (new NotSupportedError(normalizedAlgorithm.name))\n }\n \n let bytes\n // 14.1. If format is \"raw\", \"pkcs8\", or \"spki\":\n if ([\"raw\", \"pkcs8\",\"spki\"].includes(format)) {\n bytes = key\n }\n\n // 14.2. If format is \"jwk\"\n else if (format === \"jwk\"){\n bytes = JSON.parse(new TextDecoder().decode(key))\n } \n\n // 15. Import the resulting unwrapped content\n // 16-18. Ommitted because it is handled by importKey interface\n let result = normalizedKeyAlgorithm.importKey(format,\n bytes,\n unwrappedKeyAlgorithm,\n extractable,\n keyUsages)\n // 19. Resolve the result\n return resolve(result)\n } catch (error) {\n return reject(error)\n }\n })\n }\n}\n\n/**\n * Export\n */\nmodule.exports = SubtleCrypto\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/SubtleCrypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/algorithms sync recursive":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/algorithms sync ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = \"./node_modules/@trust/webcrypto/src/algorithms sync recursive\";\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/algorithms_sync?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/algorithms/RegisteredAlgorithms.js":
|
||
/*!******************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/algorithms/RegisteredAlgorithms.js ***!
|
||
\******************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * RegisteredAlgorithms\n */\nclass RegisteredAlgorithms {\n\n /**\n * Constructor\n *\n * @param {Object} mapping\n */\n constructor (mapping) {\n Object.assign(this, mapping)\n }\n\n /**\n * getCaseInsensitive\n *\n * @param {string} algName\n * @returns {string}\n */\n getCaseInsensitive (algName) {\n for (let key in this) {\n if (key.match(new RegExp(`^${algName}$`, 'i'))) {\n return key\n }\n }\n }\n}\n\n/**\n * Export\n */\nmodule.exports = RegisteredAlgorithms\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/algorithms/RegisteredAlgorithms.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/algorithms/SupportedAlgorithms.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/algorithms/SupportedAlgorithms.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Local dependencies\n */\nconst Algorithm = __webpack_require__(/*! ../dictionaries/Algorithm */ \"./node_modules/@trust/webcrypto/src/dictionaries/Algorithm.js\")\nconst KeyAlgorithm = __webpack_require__(/*! ../dictionaries/KeyAlgorithm */ \"./node_modules/@trust/webcrypto/src/dictionaries/KeyAlgorithm.js\")\nconst RegisteredAlgorithms = __webpack_require__(/*! ./RegisteredAlgorithms */ \"./node_modules/@trust/webcrypto/src/algorithms/RegisteredAlgorithms.js\")\nconst {NotSupportedError} = __webpack_require__(/*! ../errors */ \"./node_modules/@trust/webcrypto/src/errors/index.js\")\n\n/**\n * Supported Operations\n */\nconst operations = [\n 'encrypt',\n 'decrypt',\n 'sign',\n 'verify',\n 'deriveBits',\n 'digest', // THIS WASN'T IN THE LIST. PROBABLY GETTING SOMETHING WRONG HERE\n 'wrapKey',\n 'unwrapKey',\n 'generateKey',\n 'importKey',\n 'exportKey',\n 'getLength'\n]\n\n/**\n * SupportedAlgorithms\n */\nclass SupportedAlgorithms {\n\n /**\n * Constructor\n */\n constructor () {\n operations.forEach(op => {\n this[op] = new RegisteredAlgorithms()\n })\n }\n\n /**\n * Supported Operations\n */\n static get operations () {\n return operations\n }\n\n /**\n * Define Algorithm\n */\n define (alg, op, type) {\n let registeredAlgorithms = this[op]\n registeredAlgorithms[alg] = type\n }\n\n /**\n * Normalize\n */\n normalize (op, alg) {\n if (typeof alg === 'string') {\n return this.normalize(op, new KeyAlgorithm({ name: alg }))\n }\n\n if (typeof alg === 'object') {\n let registeredAlgorithms = this[op]\n let initialAlg\n\n try {\n initialAlg = new Algorithm(alg)\n } catch (error) {\n return error\n }\n\n let algName = initialAlg.name\n algName = registeredAlgorithms.getCaseInsensitive(algName)\n\n if (algName === undefined) {\n return new NotSupportedError(alg.name)\n }\n\n let desiredType, normalizedAlgorithm\n\n try {\n desiredType = __webpack_require__(\"./node_modules/@trust/webcrypto/src/algorithms sync recursive\")(registeredAlgorithms[algName])\n normalizedAlgorithm = new desiredType(alg)\n normalizedAlgorithm.name = algName\n } catch (error) {\n return error\n }\n\n let dictionaries = desiredType.dictionaries\n\n for (let i = 0; i < dictionaries.length; i++) {\n let dictionary = dictionaries[i]\n let members = dictionary.members\n\n for (let key in members) {\n let member = members[key]\n let idlValue = normalizedAlgorithm[key]\n\n try {\n if (member === 'BufferSource' && idlValue !== undefined) {\n normalizedAlgorithm[key] = idlValue.slice()\n }\n\n if (member === 'HashAlgorithmIdentifier') {\n let hashAlgorithm = this.normalize('digest', idlValue)\n if (hashAlgorithm instanceof Error) { return hashAlgorithm }\n normalizedAlgorithm[key] = hashAlgorithm\n }\n\n if (member === 'AlgorithmIdentifier') {\n normalizedAlgorithm[key] = this.normalize(WTF, idlValue)\n }\n } catch (error) {\n return error\n }\n }\n }\n\n return normalizedAlgorithm\n }\n }\n}\n\n/**\n * Export\n */\nmodule.exports = SupportedAlgorithms\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/algorithms/SupportedAlgorithms.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/algorithms/index.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/algorithms/index.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Local dependencies\n */\nconst SupportedAlgorithms = __webpack_require__(/*! ./SupportedAlgorithms */ \"./node_modules/@trust/webcrypto/src/algorithms/SupportedAlgorithms.js\")\n\n/**\n * Register Supported Algorithms\n */\nconst supportedAlgorithms = new SupportedAlgorithms()\n\n/**\n * encrypt\n */\nsupportedAlgorithms.define('RSA-OAEP', 'encrypt', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('AES-CTR', 'encrypt', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'encrypt', '../algorithms/AES-CBC')\nsupportedAlgorithms.define('AES-GCM', 'encrypt', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'encrypt', )\n\n/**\n * decrypt\n */\nsupportedAlgorithms.define('RSA-OAEP', 'decrypt', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('AES-CTR', 'decrypt', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'decrypt', '../algorithms/AES-CBC')\nsupportedAlgorithms.define('AES-GCM', 'decrypt', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'decrypt', )\n\n/**\n * sign\n */\nsupportedAlgorithms.define('RSASSA-PKCS1-v1_5', 'sign', '../algorithms/RSASSA-PKCS1-v1_5')\nsupportedAlgorithms.define('RSA-PSS', 'sign', '../algorithms/RSA-PSS')\nsupportedAlgorithms.define('ECDSA', 'sign', '../algorithms/ECDSA')\nsupportedAlgorithms.define('EDDSA', 'sign', '../algorithms/EDDSA')\n//supportedAlgorithms.define('AES-CMAC', 'sign', )\nsupportedAlgorithms.define('HMAC', 'sign', '../algorithms/HMAC')\n\n/**\n * verify\n */\nsupportedAlgorithms.define('RSASSA-PKCS1-v1_5', 'verify', '../algorithms/RSASSA-PKCS1-v1_5')\nsupportedAlgorithms.define('RSA-PSS', 'verify', '../algorithms/RSA-PSS')\nsupportedAlgorithms.define('ECDSA', 'verify', '../algorithms/ECDSA')\nsupportedAlgorithms.define('EDDSA', 'verify', '../algorithms/EDDSA')\n//supportedAlgorithms.define('AES-CMAC', 'verify', )\nsupportedAlgorithms.define('HMAC', 'verify', '../algorithms/HMAC')\n\n/**\n * digest\n */\nsupportedAlgorithms.define('SHA-1', 'digest', '../algorithms/SHA')\nsupportedAlgorithms.define('SHA-256', 'digest', '../algorithms/SHA')\nsupportedAlgorithms.define('SHA-384', 'digest', '../algorithms/SHA')\nsupportedAlgorithms.define('SHA-512', 'digest', '../algorithms/SHA')\n\n/**\n * deriveKey\n */\n//supportedAlgorithms.define('ECDH', 'deriveKey', )\n//supportedAlgorithms.define('DH', 'deriveKey', )\n//supportedAlgorithms.define('CONCAT', 'deriveKey', )\n//supportedAlgorithms.define('HKDF-CTR', 'deriveKey', )\n//supportedAlgorithms.define('PBKDF2', 'deriveKey', )\n\n/**\n * deriveBits\n */\n//supportedAlgorithms.define('ECDH', 'deriveBits', )\n//supportedAlgorithms.define('DH', 'deriveBits', )\n//supportedAlgorithms.define('CONCAT', 'deriveBits', )\n//supportedAlgorithms.define('HKDF-CTR', 'deriveBits', )\n//supportedAlgorithms.define('PBKDF2', 'deriveBits', )\n\n/**\n * generateKey\n */\nsupportedAlgorithms.define('RSASSA-PKCS1-v1_5', 'generateKey', '../algorithms/RSASSA-PKCS1-v1_5')\nsupportedAlgorithms.define('RSA-PSS', 'generateKey', '../algorithms/RSA-PSS')\nsupportedAlgorithms.define('RSA-OAEP', 'generateKey', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('ECDSA', 'generateKey', '../algorithms/ECDSA')\nsupportedAlgorithms.define('EDDSA', 'generateKey', '../algorithms/EDDSA')\n//supportedAlgorithms.define('ECDH', 'generateKey', )\nsupportedAlgorithms.define('AES-CTR', 'generateKey', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'generateKey', '../algorithms/AES-CBC')\n//supportedAlgorithms.define('AES-CMAC', 'generateKey', )\nsupportedAlgorithms.define('AES-GCM', 'generateKey', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'generateKey', )\nsupportedAlgorithms.define('AES-KW', 'generateKey', '../algorithms/AES-KW')\nsupportedAlgorithms.define('HMAC', 'generateKey', '../algorithms/HMAC')\n//supportedAlgorithms.define('DH', 'generateKey', )\n//supportedAlgorithms.define('PBKDF2', 'generateKey', )\n\n/**\n * importKey\n */\nsupportedAlgorithms.define('RSASSA-PKCS1-v1_5', 'importKey', '../algorithms/RSASSA-PKCS1-v1_5')\nsupportedAlgorithms.define('RSA-PSS', 'importKey', '../algorithms/RSA-PSS')\nsupportedAlgorithms.define('RSA-OAEP', 'importKey', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('ECDSA', 'importKey', '../algorithms/ECDSA')\nsupportedAlgorithms.define('EDDSA', 'importKey', '../algorithms/EDDSA')\n//supportedAlgorithms.define('ECDH', 'importKey', )\nsupportedAlgorithms.define('AES-CTR', 'importKey', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'importKey', '../algorithms/AES-CBC')\n//supportedAlgorithms.define('AES-CMAC', 'importKey', )\nsupportedAlgorithms.define('AES-GCM', 'importKey', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'importKey', )\nsupportedAlgorithms.define('AES-KW', 'importKey', '../algorithms/AES-KW')\nsupportedAlgorithms.define('HMAC', 'importKey', '../algorithms/HMAC')\n//supportedAlgorithms.define('DH', 'importKey', )\n//supportedAlgorithms.define('CONCAT', 'importKey', )\n//supportedAlgorithms.define('HKDF-CTR', 'importKey', )\n//supportedAlgorithms.define('PBKDF2', 'importey', )\n\n/**\n * exportKey\n */\nsupportedAlgorithms.define('RSASSA-PKCS1-v1_5', 'exportKey', '../algorithms/RSASSA-PKCS1-v1_5')\nsupportedAlgorithms.define('RSA-PSS', 'exportKey', '../algorithms/RSA-PSS')\nsupportedAlgorithms.define('RSA-OAEP', 'exportKey', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('EDDSA', 'exportKey', '../algorithms/EDDSA')\nsupportedAlgorithms.define('ECDSA', 'exportKey', '../algorithms/ECDSA')\n//supportedAlgorithms.define('ECDH', 'exportKey', )\nsupportedAlgorithms.define('AES-CTR', 'exportKey', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'exportKey', '../algorithms/AES-CBC')\n//supportedAlgorithms.define('AES-CMAC', 'exportKey', )\nsupportedAlgorithms.define('AES-GCM', 'exportKey', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'exportKey', )\nsupportedAlgorithms.define('AES-KW', 'exportKey', '../algorithms/AES-KW')\nsupportedAlgorithms.define('HMAC', 'exportKey', '../algorithms/HMAC')\n//supportedAlgorithms.define('DH', 'exportKey', )\n\n/**\n * wrapKey\n */\nsupportedAlgorithms.define('RSA-OAEP', 'wrapKey', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('AES-CTR', 'wrapKey', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'wrapKey', '../algorithms/AES-CBC')\nsupportedAlgorithms.define('AES-GCM', 'wrapKey', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'wrapKey', )\nsupportedAlgorithms.define('AES-KW', 'wrapKey', '../algorithms/AES-KW')\n\n/**\n * unwrapKey\n */\nsupportedAlgorithms.define('RSA-OAEP', 'unwrapKey', '../algorithms/RSA-OAEP')\nsupportedAlgorithms.define('AES-CTR', 'unwrapKey', '../algorithms/AES-CTR')\nsupportedAlgorithms.define('AES-CBC', 'unwrapKey', '../algorithms/AES-CBC')\nsupportedAlgorithms.define('AES-GCM', 'unwrapKey', '../algorithms/AES-GCM')\n//supportedAlgorithms.define('AES-CFB', 'unwrapKey', )\nsupportedAlgorithms.define('AES-KW', 'unwrapKey', '../algorithms/AES-KW')\n\n/**\n * Export\n */\nmodule.exports = supportedAlgorithms\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/algorithms/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/dictionaries/Algorithm.js":
|
||
/*!*********************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/dictionaries/Algorithm.js ***!
|
||
\*********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Algorithm\n */\nclass Algorithm {\n\n /**\n * constructor\n *\n * @description\n * The Algorithm object is a dictionary object [WebIDL] which is used\n * to specify an algorithm and any additional parameters required to\n * fully specify the desired operation.\n *\n * @param {string|Object} algorithm\n */\n constructor (algorithm) {\n if (typeof algorithm === 'string') {\n this.name = algorithm\n } else {\n Object.assign(this, algorithm)\n if (typeof this.name !== 'string') {\n throw new Error('Algorithm name must be a string')\n }\n }\n }\n}\n\n/**\n * Export\n */\nmodule.exports = Algorithm\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/dictionaries/Algorithm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/dictionaries/KeyAlgorithm.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/dictionaries/KeyAlgorithm.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Local dependencies\n */\nconst {NotSupportedError} = __webpack_require__(/*! ../errors */ \"./node_modules/@trust/webcrypto/src/errors/index.js\")\n\n/**\n * KeyAlgorithm dictionary\n */\nclass KeyAlgorithm {\n\n /**\n * constructor\n *\n * @param {object} algorithm\n */\n constructor (algorithm) {\n Object.assign(this, algorithm)\n\n // validate name\n if (this.name === undefined) {\n throw new Error('KeyAlgorithm must have a name')\n }\n }\n}\n\n\n\n/**\n * Export\n */\nmodule.exports = KeyAlgorithm\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/dictionaries/KeyAlgorithm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/CurrentlyNotSupportedError.js":
|
||
/*!********************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/CurrentlyNotSupportedError.js ***!
|
||
\********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Local dependencies\n */\nconst NotSupportedError = __webpack_require__(/*! ./NotSupportedError */ \"./node_modules/@trust/webcrypto/src/errors/NotSupportedError.js\")\n\n/**\n * CurrentlyNotSupportedError\n */\nclass CurrentlyNotSupportedError extends NotSupportedError {\n constructor (format,available) {\n super()\n this.message = `Currently '${format}' is not a supported format. Please use '${available}' in the interim.`\n }\n}\n\n/**\n * Export\n */\nmodule.exports = CurrentlyNotSupportedError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/CurrentlyNotSupportedError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/DataError.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/DataError.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * DataError\n */\nclass DataError extends Error {\n constructor (message) {\n super(message)\n }\n}\n\n/**\n * Export\n */\nmodule.exports = DataError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/DataError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/InvalidAccessError.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/InvalidAccessError.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * InvalidAccessError\n */\nclass InvalidAccessError extends Error {\n constructor (message) {\n super(message)\n }\n}\n\n/**\n * Export\n */\nmodule.exports = InvalidAccessError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/InvalidAccessError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/KeyFormatNotSupportedError.js":
|
||
/*!********************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/KeyFormatNotSupportedError.js ***!
|
||
\********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Local dependencies\n */\nconst NotSupportedError = __webpack_require__(/*! ./NotSupportedError */ \"./node_modules/@trust/webcrypto/src/errors/NotSupportedError.js\")\n\n/**\n * KeyFormatNotSupportedError\n */\nclass KeyFormatNotSupportedError extends NotSupportedError {\n constructor (format) {\n super()\n this.message = `${format} is not a supported key format`\n }\n}\n\n/**\n * Export\n */\nmodule.exports = KeyFormatNotSupportedError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/KeyFormatNotSupportedError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/NotSupportedError.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/NotSupportedError.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * NotSupportedError\n */\nclass NotSupportedError extends Error {\n constructor (alg) {\n super()\n this.message = `${alg} is not a supported algorithm`\n }\n}\n\n/**\n * Export\n */\nmodule.exports = NotSupportedError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/NotSupportedError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/OperationError.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/OperationError.js ***!
|
||
\********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * OperationError\n */\nclass OperationError extends Error {\n constructor (message) {\n super(message)\n }\n}\n\n/**\n * Export\n */\nmodule.exports = OperationError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/OperationError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/QuotaExceededError.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/QuotaExceededError.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * QuotaExceededError\n */\nclass QuotaExceededError extends Error {\n constructor (message) {\n super(message)\n }\n}\n\n/**\n * Export\n */\nmodule.exports = QuotaExceededError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/QuotaExceededError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/TypeMismatchError.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/TypeMismatchError.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * TypeMismatchError\n */\nclass TypeMismatchError extends Error {\n constructor (message) {\n super(message)\n }\n}\n\n/**\n * Export\n */\nmodule.exports = TypeMismatchError\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/TypeMismatchError.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/errors/index.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/errors/index.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = {\n DataError: __webpack_require__(/*! ./DataError */ \"./node_modules/@trust/webcrypto/src/errors/DataError.js\"),\n InvalidAccessError: __webpack_require__(/*! ./InvalidAccessError */ \"./node_modules/@trust/webcrypto/src/errors/InvalidAccessError.js\"),\n KeyFormatNotSupportedError: __webpack_require__(/*! ./KeyFormatNotSupportedError */ \"./node_modules/@trust/webcrypto/src/errors/KeyFormatNotSupportedError.js\"),\n CurrentlyNotSupportedError: __webpack_require__(/*! ./CurrentlyNotSupportedError */ \"./node_modules/@trust/webcrypto/src/errors/CurrentlyNotSupportedError.js\"),\n NotSupportedError: __webpack_require__(/*! ./NotSupportedError */ \"./node_modules/@trust/webcrypto/src/errors/NotSupportedError.js\"),\n OperationError: __webpack_require__(/*! ./OperationError */ \"./node_modules/@trust/webcrypto/src/errors/OperationError.js\"),\n QuotaExceededError: __webpack_require__(/*! ./QuotaExceededError */ \"./node_modules/@trust/webcrypto/src/errors/QuotaExceededError.js\"),\n TypeMismatchError: __webpack_require__(/*! ./TypeMismatchError */ \"./node_modules/@trust/webcrypto/src/errors/TypeMismatchError.js\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/errors/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const Crypto = __webpack_require__(/*! ./Crypto */ \"./node_modules/@trust/webcrypto/src/Crypto.js\")\nmodule.exports = new Crypto()\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/keys/CryptoKey.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/keys/CryptoKey.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * CryptoKey interface\n */\nclass CryptoKey {\n\n /**\n * Constructor\n */\n constructor ({type, extractable, algorithm, usages, handle}) {\n this.type = type\n this.extractable = extractable\n this.algorithm = algorithm\n this.usages = usages\n\n // ensure values are not writeable\n Object.defineProperties(this, {\n // TODO\n // These properties can't be fixed immediately on creation of the\n // object because the implementation may build it up in stages.\n // At some point in the operations before returning a key we should\n // freeze the object to prevent further manipulation.\n\n //type: {\n // enumerable: true,\n // writeable: false,\n // value: type\n //},\n //extractable: {\n // enumerable: true,\n // writeable: true,\n // value: extractable\n //},\n //algorithm: {\n // enumerable: true,\n // writeable: false,\n // value: algorithm\n //},\n //usages: {\n // enumerable: true,\n // writeable: true,\n // value: usages\n //},\n\n // this is the \"key material\" used internally\n // it is not enumerable, but we need it to be\n // accessible by algorithm implementations\n handle: {\n enumerable: false,\n writeable: false,\n value: handle\n }\n })\n\n //if (!Array.isArray(type) || KeyType.indexOf(type) === -1) { throw new Error('Invalid CryptoKey type') }\n // verify type of algorithm\n // verify type/enum of usages\n }\n\n /**\n * Structured clone algorithm\n * https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface-clone\n *\n * TODO\n * This requires review and consideration with respect to the\n * internal structured cloning algorithm.\n * https://www.w3.org/TR/WebCryptoAPI/#dfn-structured-clone\n *\n * @param {Object} input\n * @param {Object} memory\n *\n * @returns {CryptoKey}\n */\n clone ({type,extractable,algorithm,usages,handle}, memory) {\n return new CryptoKey({type,extractable,algorithm,usages,handle})\n }\n}\n\n/**\n * Export\n */\nmodule.exports = CryptoKey\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/keys/CryptoKey.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/keys/CryptoKeyPair.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/keys/CryptoKeyPair.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * CryptoKeyPair dictionary\n */\nclass CryptoKeyPair {\n constructor ({publicKey,privateKey}) {\n this.publicKey = publicKey\n this.privateKey = privateKey\n }\n}\n\n/**\n * Export\n */\nmodule.exports = CryptoKeyPair\n\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/keys/CryptoKeyPair.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/keys/JsonWebKey.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/keys/JsonWebKey.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * JsonWebKey\n */\nclass JsonWebKey {\n\n /**\n * Constructor\n */\n constructor (data) {\n Object.assign(this, data)\n }\n}\n\n/**\n * Export\n */\nmodule.exports = JsonWebKey\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/keys/JsonWebKey.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@trust/webcrypto/src/keys/recognizedKeyUsages.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/@trust/webcrypto/src/keys/recognizedKeyUsages.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * KeyUsage\n */\nclass KeyUsage extends Array {\n\n /**\n * constructor\n */\n constructor (collection) {\n super()\n collection.forEach(item => this.push(item))\n }\n\n /**\n * normalize\n */\n normalize (usages) {\n let result = []\n\n for (let i = 0; i < this.length; i++) {\n let usage = this[i]\n\n if (usages.includes(usage)) {\n result.push(usage)\n }\n }\n\n return result\n }\n}\n\n/**\n * Export\n */\nmodule.exports = new KeyUsage([\n 'encrypt',\n 'decrypt',\n 'sign',\n 'verify',\n 'deriveBits',\n 'wrapKey',\n 'unwrapKey'\n])\n\n\n//# sourceURL=webpack:///./node_modules/@trust/webcrypto/src/keys/recognizedKeyUsages.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/addr-to-ip-port/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/addr-to-ip-port/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("const ADDR_RE = /^\\[?([^\\]]+)\\]?:(\\d+)$/ // ipv4/ipv6/hostname + port\n\nlet cache = {}\n\n// reset cache when it gets to 100,000 elements (~ 600KB of ipv4 addresses)\n// so it will not grow to consume all memory in long-running processes\nlet size = 0\n\nmodule.exports = function addrToIPPort (addr) {\n if (size === 100000) module.exports.reset()\n if (!cache[addr]) {\n const m = ADDR_RE.exec(addr)\n if (!m) throw new Error(`invalid addr: ${addr}`)\n cache[addr] = [ m[1], Number(m[2]) ]\n size += 1\n }\n return cache[addr]\n}\n\nmodule.exports.reset = function reset () {\n cache = {}\n size = 0\n}\n\n\n//# sourceURL=webpack:///./node_modules/addr-to-ip-port/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/ajv.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/ajv/lib/ajv.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar compileSchema = __webpack_require__(/*! ./compile */ \"./node_modules/ajv/lib/compile/index.js\")\n , resolve = __webpack_require__(/*! ./compile/resolve */ \"./node_modules/ajv/lib/compile/resolve.js\")\n , Cache = __webpack_require__(/*! ./cache */ \"./node_modules/ajv/lib/cache.js\")\n , SchemaObject = __webpack_require__(/*! ./compile/schema_obj */ \"./node_modules/ajv/lib/compile/schema_obj.js\")\n , stableStringify = __webpack_require__(/*! fast-json-stable-stringify */ \"./node_modules/fast-json-stable-stringify/index.js\")\n , formats = __webpack_require__(/*! ./compile/formats */ \"./node_modules/ajv/lib/compile/formats.js\")\n , rules = __webpack_require__(/*! ./compile/rules */ \"./node_modules/ajv/lib/compile/rules.js\")\n , $dataMetaSchema = __webpack_require__(/*! ./data */ \"./node_modules/ajv/lib/data.js\")\n , util = __webpack_require__(/*! ./compile/util */ \"./node_modules/ajv/lib/compile/util.js\");\n\nmodule.exports = Ajv;\n\nAjv.prototype.validate = validate;\nAjv.prototype.compile = compile;\nAjv.prototype.addSchema = addSchema;\nAjv.prototype.addMetaSchema = addMetaSchema;\nAjv.prototype.validateSchema = validateSchema;\nAjv.prototype.getSchema = getSchema;\nAjv.prototype.removeSchema = removeSchema;\nAjv.prototype.addFormat = addFormat;\nAjv.prototype.errorsText = errorsText;\n\nAjv.prototype._addSchema = _addSchema;\nAjv.prototype._compile = _compile;\n\nAjv.prototype.compileAsync = __webpack_require__(/*! ./compile/async */ \"./node_modules/ajv/lib/compile/async.js\");\nvar customKeyword = __webpack_require__(/*! ./keyword */ \"./node_modules/ajv/lib/keyword.js\");\nAjv.prototype.addKeyword = customKeyword.add;\nAjv.prototype.getKeyword = customKeyword.get;\nAjv.prototype.removeKeyword = customKeyword.remove;\nAjv.prototype.validateKeyword = customKeyword.validate;\n\nvar errorClasses = __webpack_require__(/*! ./compile/error_classes */ \"./node_modules/ajv/lib/compile/error_classes.js\");\nAjv.ValidationError = errorClasses.Validation;\nAjv.MissingRefError = errorClasses.MissingRef;\nAjv.$dataMetaSchema = $dataMetaSchema;\n\nvar META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';\n\nvar META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];\nvar META_SUPPORT_DATA = ['/properties'];\n\n/**\n * Creates validator instance.\n * Usage: `Ajv(opts)`\n * @param {Object} opts optional options\n * @return {Object} ajv instance\n */\nfunction Ajv(opts) {\n if (!(this instanceof Ajv)) return new Ajv(opts);\n opts = this._opts = util.copy(opts) || {};\n setLogger(this);\n this._schemas = {};\n this._refs = {};\n this._fragments = {};\n this._formats = formats(opts.format);\n\n this._cache = opts.cache || new Cache;\n this._loadingSchemas = {};\n this._compilations = [];\n this.RULES = rules();\n this._getId = chooseGetId(opts);\n\n opts.loopRequired = opts.loopRequired || Infinity;\n if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;\n if (opts.serialize === undefined) opts.serialize = stableStringify;\n this._metaOpts = getMetaSchemaOptions(this);\n\n if (opts.formats) addInitialFormats(this);\n addDefaultMetaSchema(this);\n if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);\n if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});\n addInitialSchemas(this);\n}\n\n\n\n/**\n * Validate data using schema\n * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.\n * @this Ajv\n * @param {String|Object} schemaKeyRef key, ref or schema object\n * @param {Any} data to be validated\n * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).\n */\nfunction validate(schemaKeyRef, data) {\n var v;\n if (typeof schemaKeyRef == 'string') {\n v = this.getSchema(schemaKeyRef);\n if (!v) throw new Error('no schema with key or ref \"' + schemaKeyRef + '\"');\n } else {\n var schemaObj = this._addSchema(schemaKeyRef);\n v = schemaObj.validate || this._compile(schemaObj);\n }\n\n var valid = v(data);\n if (v.$async !== true) this.errors = v.errors;\n return valid;\n}\n\n\n/**\n * Create validating function for passed schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.\n * @return {Function} validating function\n */\nfunction compile(schema, _meta) {\n var schemaObj = this._addSchema(schema, undefined, _meta);\n return schemaObj.validate || this._compile(schemaObj);\n}\n\n\n/**\n * Adds schema to the instance.\n * @this Ajv\n * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.\n * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n * @return {Ajv} this for method chaining\n */\nfunction addSchema(schema, key, _skipValidation, _meta) {\n if (Array.isArray(schema)){\n for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);\n return this;\n }\n var id = this._getId(schema);\n if (id !== undefined && typeof id != 'string')\n throw new Error('schema id must be string');\n key = resolve.normalizeId(key || id);\n checkUnique(this, key);\n this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);\n return this;\n}\n\n\n/**\n * Add schema that will be used to validate other schemas\n * options in META_IGNORE_OPTIONS are alway set to false\n * @this Ajv\n * @param {Object} schema schema object\n * @param {String} key optional schema key\n * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema\n * @return {Ajv} this for method chaining\n */\nfunction addMetaSchema(schema, key, skipValidation) {\n this.addSchema(schema, key, skipValidation, true);\n return this;\n}\n\n\n/**\n * Validate schema\n * @this Ajv\n * @param {Object} schema schema to validate\n * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid\n * @return {Boolean} true if schema is valid\n */\nfunction validateSchema(schema, throwOrLogError) {\n var $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != 'string')\n throw new Error('$schema must be a string');\n $schema = $schema || this._opts.defaultMeta || defaultMeta(this);\n if (!$schema) {\n this.logger.warn('meta-schema not available');\n this.errors = null;\n return true;\n }\n var valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n var message = 'schema is invalid: ' + this.errorsText();\n if (this._opts.validateSchema == 'log') this.logger.error(message);\n else throw new Error(message);\n }\n return valid;\n}\n\n\nfunction defaultMeta(self) {\n var meta = self._opts.meta;\n self._opts.defaultMeta = typeof meta == 'object'\n ? self._getId(meta) || meta\n : self.getSchema(META_SCHEMA_ID)\n ? META_SCHEMA_ID\n : undefined;\n return self._opts.defaultMeta;\n}\n\n\n/**\n * Get compiled schema from the instance by `key` or `ref`.\n * @this Ajv\n * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).\n * @return {Function} schema validating function (with property `schema`).\n */\nfunction getSchema(keyRef) {\n var schemaObj = _getSchemaObj(this, keyRef);\n switch (typeof schemaObj) {\n case 'object': return schemaObj.validate || this._compile(schemaObj);\n case 'string': return this.getSchema(schemaObj);\n case 'undefined': return _getSchemaFragment(this, keyRef);\n }\n}\n\n\nfunction _getSchemaFragment(self, ref) {\n var res = resolve.schema.call(self, { schema: {} }, ref);\n if (res) {\n var schema = res.schema\n , root = res.root\n , baseId = res.baseId;\n var v = compileSchema.call(self, schema, root, undefined, baseId);\n self._fragments[ref] = new SchemaObject({\n ref: ref,\n fragment: true,\n schema: schema,\n root: root,\n baseId: baseId,\n validate: v\n });\n return v;\n }\n}\n\n\nfunction _getSchemaObj(self, keyRef) {\n keyRef = resolve.normalizeId(keyRef);\n return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];\n}\n\n\n/**\n * Remove cached schema(s).\n * If no parameter is passed all schemas but meta-schemas are removed.\n * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n * @this Ajv\n * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object\n * @return {Ajv} this for method chaining\n */\nfunction removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n _removeAllSchemas(this, this._schemas, schemaKeyRef);\n _removeAllSchemas(this, this._refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case 'undefined':\n _removeAllSchemas(this, this._schemas);\n _removeAllSchemas(this, this._refs);\n this._cache.clear();\n return this;\n case 'string':\n var schemaObj = _getSchemaObj(this, schemaKeyRef);\n if (schemaObj) this._cache.del(schemaObj.cacheKey);\n delete this._schemas[schemaKeyRef];\n delete this._refs[schemaKeyRef];\n return this;\n case 'object':\n var serialize = this._opts.serialize;\n var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;\n this._cache.del(cacheKey);\n var id = this._getId(schemaKeyRef);\n if (id) {\n id = resolve.normalizeId(id);\n delete this._schemas[id];\n delete this._refs[id];\n }\n }\n return this;\n}\n\n\nfunction _removeAllSchemas(self, schemas, regex) {\n for (var keyRef in schemas) {\n var schemaObj = schemas[keyRef];\n if (!schemaObj.meta && (!regex || regex.test(keyRef))) {\n self._cache.del(schemaObj.cacheKey);\n delete schemas[keyRef];\n }\n }\n}\n\n\n/* @this Ajv */\nfunction _addSchema(schema, skipValidation, meta, shouldAddSchema) {\n if (typeof schema != 'object' && typeof schema != 'boolean')\n throw new Error('schema should be object or boolean');\n var serialize = this._opts.serialize;\n var cacheKey = serialize ? serialize(schema) : schema;\n var cached = this._cache.get(cacheKey);\n if (cached) return cached;\n\n shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;\n\n var id = resolve.normalizeId(this._getId(schema));\n if (id && shouldAddSchema) checkUnique(this, id);\n\n var willValidate = this._opts.validateSchema !== false && !skipValidation;\n var recursiveMeta;\n if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))\n this.validateSchema(schema, true);\n\n var localRefs = resolve.ids.call(this, schema);\n\n var schemaObj = new SchemaObject({\n id: id,\n schema: schema,\n localRefs: localRefs,\n cacheKey: cacheKey,\n meta: meta\n });\n\n if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;\n this._cache.put(cacheKey, schemaObj);\n\n if (willValidate && recursiveMeta) this.validateSchema(schema, true);\n\n return schemaObj;\n}\n\n\n/* @this Ajv */\nfunction _compile(schemaObj, root) {\n if (schemaObj.compiling) {\n schemaObj.validate = callValidate;\n callValidate.schema = schemaObj.schema;\n callValidate.errors = null;\n callValidate.root = root ? root : callValidate;\n if (schemaObj.schema.$async === true)\n callValidate.$async = true;\n return callValidate;\n }\n schemaObj.compiling = true;\n\n var currentOpts;\n if (schemaObj.meta) {\n currentOpts = this._opts;\n this._opts = this._metaOpts;\n }\n\n var v;\n try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }\n catch(e) {\n delete schemaObj.validate;\n throw e;\n }\n finally {\n schemaObj.compiling = false;\n if (schemaObj.meta) this._opts = currentOpts;\n }\n\n schemaObj.validate = v;\n schemaObj.refs = v.refs;\n schemaObj.refVal = v.refVal;\n schemaObj.root = v.root;\n return v;\n\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var _validate = schemaObj.validate;\n var result = _validate.apply(this, arguments);\n callValidate.errors = _validate.errors;\n return result;\n }\n}\n\n\nfunction chooseGetId(opts) {\n switch (opts.schemaId) {\n case 'auto': return _get$IdOrId;\n case 'id': return _getId;\n default: return _get$Id;\n }\n}\n\n/* @this Ajv */\nfunction _getId(schema) {\n if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);\n return schema.id;\n}\n\n/* @this Ajv */\nfunction _get$Id(schema) {\n if (schema.id) this.logger.warn('schema id ignored', schema.id);\n return schema.$id;\n}\n\n\nfunction _get$IdOrId(schema) {\n if (schema.$id && schema.id && schema.$id != schema.id)\n throw new Error('schema $id is different from id');\n return schema.$id || schema.id;\n}\n\n\n/**\n * Convert array of error message objects to string\n * @this Ajv\n * @param {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.\n * @param {Object} options optional options with properties `separator` and `dataVar`.\n * @return {String} human readable string with all errors descriptions\n */\nfunction errorsText(errors, options) {\n errors = errors || this.errors;\n if (!errors) return 'No errors';\n options = options || {};\n var separator = options.separator === undefined ? ', ' : options.separator;\n var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;\n\n var text = '';\n for (var i=0; i<errors.length; i++) {\n var e = errors[i];\n if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;\n }\n return text.slice(0, -separator.length);\n}\n\n\n/**\n * Add custom format\n * @this Ajv\n * @param {String} name format name\n * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)\n * @return {Ajv} this for method chaining\n */\nfunction addFormat(name, format) {\n if (typeof format == 'string') format = new RegExp(format);\n this._formats[name] = format;\n return this;\n}\n\n\nfunction addDefaultMetaSchema(self) {\n var $dataSchema;\n if (self._opts.$data) {\n $dataSchema = __webpack_require__(/*! ./refs/data.json */ \"./node_modules/ajv/lib/refs/data.json\");\n self.addMetaSchema($dataSchema, $dataSchema.$id, true);\n }\n if (self._opts.meta === false) return;\n var metaSchema = __webpack_require__(/*! ./refs/json-schema-draft-07.json */ \"./node_modules/ajv/lib/refs/json-schema-draft-07.json\");\n if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);\n self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);\n self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;\n}\n\n\nfunction addInitialSchemas(self) {\n var optsSchemas = self._opts.schemas;\n if (!optsSchemas) return;\n if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);\n else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);\n}\n\n\nfunction addInitialFormats(self) {\n for (var name in self._opts.formats) {\n var format = self._opts.formats[name];\n self.addFormat(name, format);\n }\n}\n\n\nfunction checkUnique(self, id) {\n if (self._schemas[id] || self._refs[id])\n throw new Error('schema with key or id \"' + id + '\" already exists');\n}\n\n\nfunction getMetaSchemaOptions(self) {\n var metaOpts = util.copy(self._opts);\n for (var i=0; i<META_IGNORE_OPTIONS.length; i++)\n delete metaOpts[META_IGNORE_OPTIONS[i]];\n return metaOpts;\n}\n\n\nfunction setLogger(self) {\n var logger = self._opts.logger;\n if (logger === false) {\n self.logger = {log: noop, warn: noop, error: noop};\n } else {\n if (logger === undefined) logger = console;\n if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))\n throw new Error('logger must implement log, warn and error methods');\n self.logger = logger;\n }\n}\n\n\nfunction noop() {}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/ajv.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/cache.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ajv/lib/cache.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n\nvar Cache = module.exports = function Cache() {\n this._cache = {};\n};\n\n\nCache.prototype.put = function Cache_put(key, value) {\n this._cache[key] = value;\n};\n\n\nCache.prototype.get = function Cache_get(key) {\n return this._cache[key];\n};\n\n\nCache.prototype.del = function Cache_del(key) {\n delete this._cache[key];\n};\n\n\nCache.prototype.clear = function Cache_clear() {\n this._cache = {};\n};\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/cache.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/async.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/async.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar MissingRefError = __webpack_require__(/*! ./error_classes */ \"./node_modules/ajv/lib/compile/error_classes.js\").MissingRef;\n\nmodule.exports = compileAsync;\n\n\n/**\n * Creates validating function for passed schema with asynchronous loading of missing schemas.\n * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped\n * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.\n * @return {Promise} promise that resolves with a validating function.\n */\nfunction compileAsync(schema, meta, callback) {\n /* eslint no-shadow: 0 */\n /* global Promise */\n /* jshint validthis: true */\n var self = this;\n if (typeof this._opts.loadSchema != 'function')\n throw new Error('options.loadSchema should be a function');\n\n if (typeof meta == 'function') {\n callback = meta;\n meta = undefined;\n }\n\n var p = loadMetaSchemaOf(schema).then(function () {\n var schemaObj = self._addSchema(schema, undefined, meta);\n return schemaObj.validate || _compileAsync(schemaObj);\n });\n\n if (callback) {\n p.then(\n function(v) { callback(null, v); },\n callback\n );\n }\n\n return p;\n\n\n function loadMetaSchemaOf(sch) {\n var $schema = sch.$schema;\n return $schema && !self.getSchema($schema)\n ? compileAsync.call(self, { $ref: $schema }, true)\n : Promise.resolve();\n }\n\n\n function _compileAsync(schemaObj) {\n try { return self._compile(schemaObj); }\n catch(e) {\n if (e instanceof MissingRefError) return loadMissingSchema(e);\n throw e;\n }\n\n\n function loadMissingSchema(e) {\n var ref = e.missingSchema;\n if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');\n\n var schemaPromise = self._loadingSchemas[ref];\n if (!schemaPromise) {\n schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);\n schemaPromise.then(removePromise, removePromise);\n }\n\n return schemaPromise.then(function (sch) {\n if (!added(ref)) {\n return loadMetaSchemaOf(sch).then(function () {\n if (!added(ref)) self.addSchema(sch, ref, undefined, meta);\n });\n }\n }).then(function() {\n return _compileAsync(schemaObj);\n });\n\n function removePromise() {\n delete self._loadingSchemas[ref];\n }\n\n function added(ref) {\n return self._refs[ref] || self._schemas[ref];\n }\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/async.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/error_classes.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/error_classes.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar resolve = __webpack_require__(/*! ./resolve */ \"./node_modules/ajv/lib/compile/resolve.js\");\n\nmodule.exports = {\n Validation: errorSubclass(ValidationError),\n MissingRef: errorSubclass(MissingRefError)\n};\n\n\nfunction ValidationError(errors) {\n this.message = 'validation failed';\n this.errors = errors;\n this.ajv = this.validation = true;\n}\n\n\nMissingRefError.message = function (baseId, ref) {\n return 'can\\'t resolve reference ' + ref + ' from id ' + baseId;\n};\n\n\nfunction MissingRefError(baseId, ref, message) {\n this.message = message || MissingRefError.message(baseId, ref);\n this.missingRef = resolve.url(baseId, ref);\n this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));\n}\n\n\nfunction errorSubclass(Subclass) {\n Subclass.prototype = Object.create(Error.prototype);\n Subclass.prototype.constructor = Subclass;\n return Subclass;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/error_classes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/formats.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/formats.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/ajv/lib/compile/util.js\");\n\nvar DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\nvar DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];\nvar TIME = /^(\\d\\d):(\\d\\d):(\\d\\d)(\\.\\d+)?(z|[+-]\\d\\d:\\d\\d)?$/i;\nvar HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i;\nvar URI = /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\nvar URIREF = /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'\"()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\\?(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\n// uri-template: https://tools.ietf.org/html/rfc6570\nvar URITEMPLATE = /^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i;\n// For the source: https://gist.github.com/dperini/729294\n// For test cases: https://mathiasbynens.be/demo/url-regex\n// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.\n// var URL = /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu;\nvar URL = /^(?:(?:http[s\\u017F]?|ftp):\\/\\/)(?:(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+(?::(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?@)?(?:(?!10(?:\\.[0-9]{1,3}){3})(?!127(?:\\.[0-9]{1,3}){3})(?!169\\.254(?:\\.[0-9]{1,3}){2})(?!192\\.168(?:\\.[0-9]{1,3}){2})(?!172\\.(?:1[6-9]|2[0-9]|3[01])(?:\\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-?)*(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)(?:\\.(?:(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-?)*(?:[0-9KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)*(?:\\.(?:(?:[KSa-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\\/(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?$/i;\nvar UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;\nvar JSON_POINTER = /^(?:\\/(?:[^~/]|~0|~1)*)*$/;\nvar JSON_POINTER_URI_FRAGMENT = /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;\nvar RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/;\n\n\nmodule.exports = formats;\n\nfunction formats(mode) {\n mode = mode == 'full' ? 'full' : 'fast';\n return util.copy(formats[mode]);\n}\n\n\nformats.fast = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)?$/i,\n 'date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d:\\d\\d)$/i,\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n 'uri-template': URITEMPLATE,\n url: URL,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\n hostname: HOSTNAME,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n ipv6: /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\n regex: regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: UUID,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nformats.full = {\n date: date,\n time: time,\n 'date-time': date_time,\n uri: uri,\n 'uri-reference': URIREF,\n 'uri-template': URITEMPLATE,\n url: URL,\n email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname: hostname,\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n ipv6: /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\n regex: regex,\n uuid: UUID,\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nfunction isLeapYear(year) {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\n\nfunction date(str) {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n var matches = str.match(DATE);\n if (!matches) return false;\n\n var year = +matches[1];\n var month = +matches[2];\n var day = +matches[3];\n\n return month >= 1 && month <= 12 && day >= 1 &&\n day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);\n}\n\n\nfunction time(str, full) {\n var matches = str.match(TIME);\n if (!matches) return false;\n\n var hour = matches[1];\n var minute = matches[2];\n var second = matches[3];\n var timeZone = matches[5];\n return ((hour <= 23 && minute <= 59 && second <= 59) ||\n (hour == 23 && minute == 59 && second == 60)) &&\n (!full || timeZone);\n}\n\n\nvar DATE_TIME_SEPARATOR = /t|\\s/i;\nfunction date_time(str) {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n var dateTime = str.split(DATE_TIME_SEPARATOR);\n return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);\n}\n\n\nfunction hostname(str) {\n // https://tools.ietf.org/html/rfc1034#section-3.5\n // https://tools.ietf.org/html/rfc1123#section-2\n return str.length <= 255 && HOSTNAME.test(str);\n}\n\n\nvar NOT_URI_FRAGMENT = /\\/|:/;\nfunction uri(str) {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str);\n}\n\n\nvar Z_ANCHOR = /[^\\\\]\\\\Z/;\nfunction regex(str) {\n if (Z_ANCHOR.test(str)) return false;\n try {\n new RegExp(str);\n return true;\n } catch(e) {\n return false;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/formats.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar resolve = __webpack_require__(/*! ./resolve */ \"./node_modules/ajv/lib/compile/resolve.js\")\n , util = __webpack_require__(/*! ./util */ \"./node_modules/ajv/lib/compile/util.js\")\n , errorClasses = __webpack_require__(/*! ./error_classes */ \"./node_modules/ajv/lib/compile/error_classes.js\")\n , stableStringify = __webpack_require__(/*! fast-json-stable-stringify */ \"./node_modules/fast-json-stable-stringify/index.js\");\n\nvar validateGenerator = __webpack_require__(/*! ../dotjs/validate */ \"./node_modules/ajv/lib/dotjs/validate.js\");\n\n/**\n * Functions below are used inside compiled validations function\n */\n\nvar ucs2length = util.ucs2length;\nvar equal = __webpack_require__(/*! fast-deep-equal */ \"./node_modules/fast-deep-equal/index.js\");\n\n// this error is thrown by async schemas to return validation errors via exception\nvar ValidationError = errorClasses.Validation;\n\nmodule.exports = compile;\n\n\n/**\n * Compiles schema to validation function\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Object} root object with information about the root schema for this schema\n * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution\n * @param {String} baseId base ID for IDs in the schema\n * @return {Function} validation function\n */\nfunction compile(schema, root, localRefs, baseId) {\n /* jshint validthis: true, evil: true */\n /* eslint no-shadow: 0 */\n var self = this\n , opts = this._opts\n , refVal = [ undefined ]\n , refs = {}\n , patterns = []\n , patternsHash = {}\n , defaults = []\n , defaultsHash = {}\n , customRules = [];\n\n root = root || { schema: schema, refVal: refVal, refs: refs };\n\n var c = checkCompiling.call(this, schema, root, baseId);\n var compilation = this._compilations[c.index];\n if (c.compiling) return (compilation.callValidate = callValidate);\n\n var formats = this._formats;\n var RULES = this.RULES;\n\n try {\n var v = localCompile(schema, root, localRefs, baseId);\n compilation.validate = v;\n var cv = compilation.callValidate;\n if (cv) {\n cv.schema = v.schema;\n cv.errors = null;\n cv.refs = v.refs;\n cv.refVal = v.refVal;\n cv.root = v.root;\n cv.$async = v.$async;\n if (opts.sourceCode) cv.source = v.source;\n }\n return v;\n } finally {\n endCompiling.call(this, schema, root, baseId);\n }\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var validate = compilation.validate;\n var result = validate.apply(this, arguments);\n callValidate.errors = validate.errors;\n return result;\n }\n\n function localCompile(_schema, _root, localRefs, baseId) {\n var isRoot = !_root || (_root && _root.schema == _schema);\n if (_root.schema != root.schema)\n return compile.call(self, _schema, _root, localRefs, baseId);\n\n var $async = _schema.$async === true;\n\n var sourceCode = validateGenerator({\n isTop: true,\n schema: _schema,\n isRoot: isRoot,\n baseId: baseId,\n root: _root,\n schemaPath: '',\n errSchemaPath: '#',\n errorPath: '\"\"',\n MissingRefError: errorClasses.MissingRef,\n RULES: RULES,\n validate: validateGenerator,\n util: util,\n resolve: resolve,\n resolveRef: resolveRef,\n usePattern: usePattern,\n useDefault: useDefault,\n useCustomRule: useCustomRule,\n opts: opts,\n formats: formats,\n logger: self.logger,\n self: self\n });\n\n sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)\n + vars(defaults, defaultCode) + vars(customRules, customRuleCode)\n + sourceCode;\n\n if (opts.processCode) sourceCode = opts.processCode(sourceCode);\n // console.log('\\n\\n\\n *** \\n', JSON.stringify(sourceCode));\n var validate;\n try {\n var makeValidate = new Function(\n 'self',\n 'RULES',\n 'formats',\n 'root',\n 'refVal',\n 'defaults',\n 'customRules',\n 'equal',\n 'ucs2length',\n 'ValidationError',\n sourceCode\n );\n\n validate = makeValidate(\n self,\n RULES,\n formats,\n root,\n refVal,\n defaults,\n customRules,\n equal,\n ucs2length,\n ValidationError\n );\n\n refVal[0] = validate;\n } catch(e) {\n self.logger.error('Error compiling schema, function code:', sourceCode);\n throw e;\n }\n\n validate.schema = _schema;\n validate.errors = null;\n validate.refs = refs;\n validate.refVal = refVal;\n validate.root = isRoot ? validate : _root;\n if ($async) validate.$async = true;\n if (opts.sourceCode === true) {\n validate.source = {\n code: sourceCode,\n patterns: patterns,\n defaults: defaults\n };\n }\n\n return validate;\n }\n\n function resolveRef(baseId, ref, isRoot) {\n ref = resolve.url(baseId, ref);\n var refIndex = refs[ref];\n var _refVal, refCode;\n if (refIndex !== undefined) {\n _refVal = refVal[refIndex];\n refCode = 'refVal[' + refIndex + ']';\n return resolvedRef(_refVal, refCode);\n }\n if (!isRoot && root.refs) {\n var rootRefId = root.refs[ref];\n if (rootRefId !== undefined) {\n _refVal = root.refVal[rootRefId];\n refCode = addLocalRef(ref, _refVal);\n return resolvedRef(_refVal, refCode);\n }\n }\n\n refCode = addLocalRef(ref);\n var v = resolve.call(self, localCompile, root, ref);\n if (v === undefined) {\n var localSchema = localRefs && localRefs[ref];\n if (localSchema) {\n v = resolve.inlineRef(localSchema, opts.inlineRefs)\n ? localSchema\n : compile.call(self, localSchema, root, localRefs, baseId);\n }\n }\n\n if (v === undefined) {\n removeLocalRef(ref);\n } else {\n replaceLocalRef(ref, v);\n return resolvedRef(v, refCode);\n }\n }\n\n function addLocalRef(ref, v) {\n var refId = refVal.length;\n refVal[refId] = v;\n refs[ref] = refId;\n return 'refVal' + refId;\n }\n\n function removeLocalRef(ref) {\n delete refs[ref];\n }\n\n function replaceLocalRef(ref, v) {\n var refId = refs[ref];\n refVal[refId] = v;\n }\n\n function resolvedRef(refVal, code) {\n return typeof refVal == 'object' || typeof refVal == 'boolean'\n ? { code: code, schema: refVal, inline: true }\n : { code: code, $async: refVal && !!refVal.$async };\n }\n\n function usePattern(regexStr) {\n var index = patternsHash[regexStr];\n if (index === undefined) {\n index = patternsHash[regexStr] = patterns.length;\n patterns[index] = regexStr;\n }\n return 'pattern' + index;\n }\n\n function useDefault(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n return '' + value;\n case 'string':\n return util.toQuotedString(value);\n case 'object':\n if (value === null) return 'null';\n var valueStr = stableStringify(value);\n var index = defaultsHash[valueStr];\n if (index === undefined) {\n index = defaultsHash[valueStr] = defaults.length;\n defaults[index] = value;\n }\n return 'default' + index;\n }\n }\n\n function useCustomRule(rule, schema, parentSchema, it) {\n if (self._opts.validateSchema !== false) {\n var deps = rule.definition.dependencies;\n if (deps && !deps.every(function(keyword) {\n return Object.prototype.hasOwnProperty.call(parentSchema, keyword);\n }))\n throw new Error('parent schema must have all required keywords: ' + deps.join(','));\n\n var validateSchema = rule.definition.validateSchema;\n if (validateSchema) {\n var valid = validateSchema(schema);\n if (!valid) {\n var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);\n if (self._opts.validateSchema == 'log') self.logger.error(message);\n else throw new Error(message);\n }\n }\n }\n\n var compile = rule.definition.compile\n , inline = rule.definition.inline\n , macro = rule.definition.macro;\n\n var validate;\n if (compile) {\n validate = compile.call(self, schema, parentSchema, it);\n } else if (macro) {\n validate = macro.call(self, schema, parentSchema, it);\n if (opts.validateSchema !== false) self.validateSchema(validate, true);\n } else if (inline) {\n validate = inline.call(self, it, rule.keyword, schema, parentSchema);\n } else {\n validate = rule.definition.validate;\n if (!validate) return;\n }\n\n if (validate === undefined)\n throw new Error('custom keyword \"' + rule.keyword + '\"failed to compile');\n\n var index = customRules.length;\n customRules[index] = validate;\n\n return {\n code: 'customRule' + index,\n validate: validate\n };\n }\n}\n\n\n/**\n * Checks if the schema is currently compiled\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Object} object with properties \"index\" (compilation index) and \"compiling\" (boolean)\n */\nfunction checkCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var index = compIndex.call(this, schema, root, baseId);\n if (index >= 0) return { index: index, compiling: true };\n index = this._compilations.length;\n this._compilations[index] = {\n schema: schema,\n root: root,\n baseId: baseId\n };\n return { index: index, compiling: false };\n}\n\n\n/**\n * Removes the schema from the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n */\nfunction endCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var i = compIndex.call(this, schema, root, baseId);\n if (i >= 0) this._compilations.splice(i, 1);\n}\n\n\n/**\n * Index of schema compilation in the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Integer} compilation index\n */\nfunction compIndex(schema, root, baseId) {\n /* jshint validthis: true */\n for (var i=0; i<this._compilations.length; i++) {\n var c = this._compilations[i];\n if (c.schema == schema && c.root == root && c.baseId == baseId) return i;\n }\n return -1;\n}\n\n\nfunction patternCode(i, patterns) {\n return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';\n}\n\n\nfunction defaultCode(i) {\n return 'var default' + i + ' = defaults[' + i + '];';\n}\n\n\nfunction refValCode(i, refVal) {\n return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';\n}\n\n\nfunction customRuleCode(i) {\n return 'var customRule' + i + ' = customRules[' + i + '];';\n}\n\n\nfunction vars(arr, statement) {\n if (!arr.length) return '';\n var code = '';\n for (var i=0; i<arr.length; i++)\n code += statement(i, arr);\n return code;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/resolve.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/resolve.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar URI = __webpack_require__(/*! uri-js */ \"./node_modules/uri-js/dist/es5/uri.all.js\")\n , equal = __webpack_require__(/*! fast-deep-equal */ \"./node_modules/fast-deep-equal/index.js\")\n , util = __webpack_require__(/*! ./util */ \"./node_modules/ajv/lib/compile/util.js\")\n , SchemaObject = __webpack_require__(/*! ./schema_obj */ \"./node_modules/ajv/lib/compile/schema_obj.js\")\n , traverse = __webpack_require__(/*! json-schema-traverse */ \"./node_modules/json-schema-traverse/index.js\");\n\nmodule.exports = resolve;\n\nresolve.normalizeId = normalizeId;\nresolve.fullPath = getFullPath;\nresolve.url = resolveUrl;\nresolve.ids = resolveIds;\nresolve.inlineRef = inlineRef;\nresolve.schema = resolveSchema;\n\n/**\n * [resolve and compile the references ($ref)]\n * @this Ajv\n * @param {Function} compile reference to schema compilation funciton (localCompile)\n * @param {Object} root object with information about the root schema for the current schema\n * @param {String} ref reference to resolve\n * @return {Object|Function} schema object (if the schema can be inlined) or validation function\n */\nfunction resolve(compile, root, ref) {\n /* jshint validthis: true */\n var refVal = this._refs[ref];\n if (typeof refVal == 'string') {\n if (this._refs[refVal]) refVal = this._refs[refVal];\n else return resolve.call(this, compile, root, refVal);\n }\n\n refVal = refVal || this._schemas[ref];\n if (refVal instanceof SchemaObject) {\n return inlineRef(refVal.schema, this._opts.inlineRefs)\n ? refVal.schema\n : refVal.validate || this._compile(refVal);\n }\n\n var res = resolveSchema.call(this, root, ref);\n var schema, v, baseId;\n if (res) {\n schema = res.schema;\n root = res.root;\n baseId = res.baseId;\n }\n\n if (schema instanceof SchemaObject) {\n v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);\n } else if (schema !== undefined) {\n v = inlineRef(schema, this._opts.inlineRefs)\n ? schema\n : compile.call(this, schema, root, undefined, baseId);\n }\n\n return v;\n}\n\n\n/**\n * Resolve schema, its root and baseId\n * @this Ajv\n * @param {Object} root root object with properties schema, refVal, refs\n * @param {String} ref reference to resolve\n * @return {Object} object with properties schema, root, baseId\n */\nfunction resolveSchema(root, ref) {\n /* jshint validthis: true */\n var p = URI.parse(ref)\n , refPath = _getFullPath(p)\n , baseId = getFullPath(this._getId(root.schema));\n if (Object.keys(root.schema).length === 0 || refPath !== baseId) {\n var id = normalizeId(refPath);\n var refVal = this._refs[id];\n if (typeof refVal == 'string') {\n return resolveRecursive.call(this, root, refVal, p);\n } else if (refVal instanceof SchemaObject) {\n if (!refVal.validate) this._compile(refVal);\n root = refVal;\n } else {\n refVal = this._schemas[id];\n if (refVal instanceof SchemaObject) {\n if (!refVal.validate) this._compile(refVal);\n if (id == normalizeId(ref))\n return { schema: refVal, root: root, baseId: baseId };\n root = refVal;\n } else {\n return;\n }\n }\n if (!root.schema) return;\n baseId = getFullPath(this._getId(root.schema));\n }\n return getJsonPointer.call(this, p, baseId, root.schema, root);\n}\n\n\n/* @this Ajv */\nfunction resolveRecursive(root, ref, parsedRef) {\n /* jshint validthis: true */\n var res = resolveSchema.call(this, root, ref);\n if (res) {\n var schema = res.schema;\n var baseId = res.baseId;\n root = res.root;\n var id = this._getId(schema);\n if (id) baseId = resolveUrl(baseId, id);\n return getJsonPointer.call(this, parsedRef, baseId, schema, root);\n }\n}\n\n\nvar PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);\n/* @this Ajv */\nfunction getJsonPointer(parsedRef, baseId, schema, root) {\n /* jshint validthis: true */\n parsedRef.fragment = parsedRef.fragment || '';\n if (parsedRef.fragment.slice(0,1) != '/') return;\n var parts = parsedRef.fragment.split('/');\n\n for (var i = 1; i < parts.length; i++) {\n var part = parts[i];\n if (part) {\n part = util.unescapeFragment(part);\n schema = schema[part];\n if (schema === undefined) break;\n var id;\n if (!PREVENT_SCOPE_CHANGE[part]) {\n id = this._getId(schema);\n if (id) baseId = resolveUrl(baseId, id);\n if (schema.$ref) {\n var $ref = resolveUrl(baseId, schema.$ref);\n var res = resolveSchema.call(this, root, $ref);\n if (res) {\n schema = res.schema;\n root = res.root;\n baseId = res.baseId;\n }\n }\n }\n }\n }\n if (schema !== undefined && schema !== root.schema)\n return { schema: schema, root: root, baseId: baseId };\n}\n\n\nvar SIMPLE_INLINED = util.toHash([\n 'type', 'format', 'pattern',\n 'maxLength', 'minLength',\n 'maxProperties', 'minProperties',\n 'maxItems', 'minItems',\n 'maximum', 'minimum',\n 'uniqueItems', 'multipleOf',\n 'required', 'enum'\n]);\nfunction inlineRef(schema, limit) {\n if (limit === false) return false;\n if (limit === undefined || limit === true) return checkNoRef(schema);\n else if (limit) return countKeys(schema) <= limit;\n}\n\n\nfunction checkNoRef(schema) {\n var item;\n if (Array.isArray(schema)) {\n for (var i=0; i<schema.length; i++) {\n item = schema[i];\n if (typeof item == 'object' && !checkNoRef(item)) return false;\n }\n } else {\n for (var key in schema) {\n if (key == '$ref') return false;\n item = schema[key];\n if (typeof item == 'object' && !checkNoRef(item)) return false;\n }\n }\n return true;\n}\n\n\nfunction countKeys(schema) {\n var count = 0, item;\n if (Array.isArray(schema)) {\n for (var i=0; i<schema.length; i++) {\n item = schema[i];\n if (typeof item == 'object') count += countKeys(item);\n if (count == Infinity) return Infinity;\n }\n } else {\n for (var key in schema) {\n if (key == '$ref') return Infinity;\n if (SIMPLE_INLINED[key]) {\n count++;\n } else {\n item = schema[key];\n if (typeof item == 'object') count += countKeys(item) + 1;\n if (count == Infinity) return Infinity;\n }\n }\n }\n return count;\n}\n\n\nfunction getFullPath(id, normalize) {\n if (normalize !== false) id = normalizeId(id);\n var p = URI.parse(id);\n return _getFullPath(p);\n}\n\n\nfunction _getFullPath(p) {\n return URI.serialize(p).split('#')[0] + '#';\n}\n\n\nvar TRAILING_SLASH_HASH = /#\\/?$/;\nfunction normalizeId(id) {\n return id ? id.replace(TRAILING_SLASH_HASH, '') : '';\n}\n\n\nfunction resolveUrl(baseId, id) {\n id = normalizeId(id);\n return URI.resolve(baseId, id);\n}\n\n\n/* @this Ajv */\nfunction resolveIds(schema) {\n var schemaId = normalizeId(this._getId(schema));\n var baseIds = {'': schemaId};\n var fullPaths = {'': getFullPath(schemaId, false)};\n var localRefs = {};\n var self = this;\n\n traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (jsonPtr === '') return;\n var id = self._getId(sch);\n var baseId = baseIds[parentJsonPtr];\n var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;\n if (keyIndex !== undefined)\n fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));\n\n if (typeof id == 'string') {\n id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);\n\n var refVal = self._refs[id];\n if (typeof refVal == 'string') refVal = self._refs[refVal];\n if (refVal && refVal.schema) {\n if (!equal(sch, refVal.schema))\n throw new Error('id \"' + id + '\" resolves to more than one schema');\n } else if (id != normalizeId(fullPath)) {\n if (id[0] == '#') {\n if (localRefs[id] && !equal(sch, localRefs[id]))\n throw new Error('id \"' + id + '\" resolves to more than one schema');\n localRefs[id] = sch;\n } else {\n self._refs[id] = fullPath;\n }\n }\n }\n baseIds[jsonPtr] = baseId;\n fullPaths[jsonPtr] = fullPath;\n });\n\n return localRefs;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/resolve.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/rules.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/rules.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar ruleModules = __webpack_require__(/*! ../dotjs */ \"./node_modules/ajv/lib/dotjs/index.js\")\n , toHash = __webpack_require__(/*! ./util */ \"./node_modules/ajv/lib/compile/util.js\").toHash;\n\nmodule.exports = function rules() {\n var RULES = [\n { type: 'number',\n rules: [ { 'maximum': ['exclusiveMaximum'] },\n { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },\n { type: 'string',\n rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },\n { type: 'array',\n rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] },\n { type: 'object',\n rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',\n { 'properties': ['additionalProperties', 'patternProperties'] } ] },\n { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] }\n ];\n\n var ALL = [ 'type', '$comment' ];\n var KEYWORDS = [\n '$schema', '$id', 'id', '$data', '$async', 'title',\n 'description', 'default', 'definitions',\n 'examples', 'readOnly', 'writeOnly',\n 'contentMediaType', 'contentEncoding',\n 'additionalItems', 'then', 'else'\n ];\n var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];\n RULES.all = toHash(ALL);\n RULES.types = toHash(TYPES);\n\n RULES.forEach(function (group) {\n group.rules = group.rules.map(function (keyword) {\n var implKeywords;\n if (typeof keyword == 'object') {\n var key = Object.keys(keyword)[0];\n implKeywords = keyword[key];\n keyword = key;\n implKeywords.forEach(function (k) {\n ALL.push(k);\n RULES.all[k] = true;\n });\n }\n ALL.push(keyword);\n var rule = RULES.all[keyword] = {\n keyword: keyword,\n code: ruleModules[keyword],\n implements: implKeywords\n };\n return rule;\n });\n\n RULES.all.$comment = {\n keyword: '$comment',\n code: ruleModules.$comment\n };\n\n if (group.type) RULES.types[group.type] = group;\n });\n\n RULES.keywords = toHash(ALL.concat(KEYWORDS));\n RULES.custom = {};\n\n return RULES;\n};\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/rules.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/schema_obj.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/schema_obj.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/ajv/lib/compile/util.js\");\n\nmodule.exports = SchemaObject;\n\nfunction SchemaObject(obj) {\n util.copy(obj, this);\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/schema_obj.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/ucs2length.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/ucs2length.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nmodule.exports = function ucs2length(str) {\n var length = 0\n , len = str.length\n , pos = 0\n , value;\n while (pos < len) {\n length++;\n value = str.charCodeAt(pos++);\n if (value >= 0xD800 && value <= 0xDBFF && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate\n }\n }\n return length;\n};\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/ucs2length.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/compile/util.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ajv/lib/compile/util.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n\nmodule.exports = {\n copy: copy,\n checkDataType: checkDataType,\n checkDataTypes: checkDataTypes,\n coerceToTypes: coerceToTypes,\n toHash: toHash,\n getProperty: getProperty,\n escapeQuotes: escapeQuotes,\n equal: __webpack_require__(/*! fast-deep-equal */ \"./node_modules/fast-deep-equal/index.js\"),\n ucs2length: __webpack_require__(/*! ./ucs2length */ \"./node_modules/ajv/lib/compile/ucs2length.js\"),\n varOccurences: varOccurences,\n varReplace: varReplace,\n cleanUpCode: cleanUpCode,\n finalCleanUpCode: finalCleanUpCode,\n schemaHasRules: schemaHasRules,\n schemaHasRulesExcept: schemaHasRulesExcept,\n schemaUnknownRules: schemaUnknownRules,\n toQuotedString: toQuotedString,\n getPathExpr: getPathExpr,\n getPath: getPath,\n getData: getData,\n unescapeFragment: unescapeFragment,\n unescapeJsonPointer: unescapeJsonPointer,\n escapeFragment: escapeFragment,\n escapeJsonPointer: escapeJsonPointer\n};\n\n\nfunction copy(o, to) {\n to = to || {};\n for (var key in o) to[key] = o[key];\n return to;\n}\n\n\nfunction checkDataType(dataType, data, negate) {\n var EQUAL = negate ? ' !== ' : ' === '\n , AND = negate ? ' || ' : ' && '\n , OK = negate ? '!' : ''\n , NOT = negate ? '' : '!';\n switch (dataType) {\n case 'null': return data + EQUAL + 'null';\n case 'array': return OK + 'Array.isArray(' + data + ')';\n case 'object': return '(' + OK + data + AND +\n 'typeof ' + data + EQUAL + '\"object\"' + AND +\n NOT + 'Array.isArray(' + data + '))';\n case 'integer': return '(typeof ' + data + EQUAL + '\"number\"' + AND +\n NOT + '(' + data + ' % 1)' +\n AND + data + EQUAL + data + ')';\n default: return 'typeof ' + data + EQUAL + '\"' + dataType + '\"';\n }\n}\n\n\nfunction checkDataTypes(dataTypes, data) {\n switch (dataTypes.length) {\n case 1: return checkDataType(dataTypes[0], data, true);\n default:\n var code = '';\n var types = toHash(dataTypes);\n if (types.array && types.object) {\n code = types.null ? '(': '(!' + data + ' || ';\n code += 'typeof ' + data + ' !== \"object\")';\n delete types.null;\n delete types.array;\n delete types.object;\n }\n if (types.number) delete types.integer;\n for (var t in types)\n code += (code ? ' && ' : '' ) + checkDataType(t, data, true);\n\n return code;\n }\n}\n\n\nvar COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);\nfunction coerceToTypes(optionCoerceTypes, dataTypes) {\n if (Array.isArray(dataTypes)) {\n var types = [];\n for (var i=0; i<dataTypes.length; i++) {\n var t = dataTypes[i];\n if (COERCE_TO_TYPES[t]) types[types.length] = t;\n else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;\n }\n if (types.length) return types;\n } else if (COERCE_TO_TYPES[dataTypes]) {\n return [dataTypes];\n } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {\n return ['array'];\n }\n}\n\n\nfunction toHash(arr) {\n var hash = {};\n for (var i=0; i<arr.length; i++) hash[arr[i]] = true;\n return hash;\n}\n\n\nvar IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nvar SINGLE_QUOTE = /'|\\\\/g;\nfunction getProperty(key) {\n return typeof key == 'number'\n ? '[' + key + ']'\n : IDENTIFIER.test(key)\n ? '.' + key\n : \"['\" + escapeQuotes(key) + \"']\";\n}\n\n\nfunction escapeQuotes(str) {\n return str.replace(SINGLE_QUOTE, '\\\\$&')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\t/g, '\\\\t');\n}\n\n\nfunction varOccurences(str, dataVar) {\n dataVar += '[^0-9]';\n var matches = str.match(new RegExp(dataVar, 'g'));\n return matches ? matches.length : 0;\n}\n\n\nfunction varReplace(str, dataVar, expr) {\n dataVar += '([^0-9])';\n expr = expr.replace(/\\$/g, '$$$$');\n return str.replace(new RegExp(dataVar, 'g'), expr + '$1');\n}\n\n\nvar EMPTY_ELSE = /else\\s*{\\s*}/g\n , EMPTY_IF_NO_ELSE = /if\\s*\\([^)]+\\)\\s*\\{\\s*\\}(?!\\s*else)/g\n , EMPTY_IF_WITH_ELSE = /if\\s*\\(([^)]+)\\)\\s*\\{\\s*\\}\\s*else(?!\\s*if)/g;\nfunction cleanUpCode(out) {\n return out.replace(EMPTY_ELSE, '')\n .replace(EMPTY_IF_NO_ELSE, '')\n .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))');\n}\n\n\nvar ERRORS_REGEXP = /[^v.]errors/g\n , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g\n , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g\n , RETURN_VALID = 'return errors === 0;'\n , RETURN_TRUE = 'validate.errors = null; return true;'\n , RETURN_ASYNC = /if \\(errors === 0\\) return data;\\s*else throw new ValidationError\\(vErrors\\);/\n , RETURN_DATA_ASYNC = 'return data;'\n , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g\n , REMOVE_ROOTDATA = /if \\(rootData === undefined\\) rootData = data;/;\n\nfunction finalCleanUpCode(out, async) {\n var matches = out.match(ERRORS_REGEXP);\n if (matches && matches.length == 2) {\n out = async\n ? out.replace(REMOVE_ERRORS_ASYNC, '')\n .replace(RETURN_ASYNC, RETURN_DATA_ASYNC)\n : out.replace(REMOVE_ERRORS, '')\n .replace(RETURN_VALID, RETURN_TRUE);\n }\n\n matches = out.match(ROOTDATA_REGEXP);\n if (!matches || matches.length !== 3) return out;\n return out.replace(REMOVE_ROOTDATA, '');\n}\n\n\nfunction schemaHasRules(schema, rules) {\n if (typeof schema == 'boolean') return !schema;\n for (var key in schema) if (rules[key]) return true;\n}\n\n\nfunction schemaHasRulesExcept(schema, rules, exceptKeyword) {\n if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';\n for (var key in schema) if (key != exceptKeyword && rules[key]) return true;\n}\n\n\nfunction schemaUnknownRules(schema, rules) {\n if (typeof schema == 'boolean') return;\n for (var key in schema) if (!rules[key]) return key;\n}\n\n\nfunction toQuotedString(str) {\n return '\\'' + escapeQuotes(str) + '\\'';\n}\n\n\nfunction getPathExpr(currentPath, expr, jsonPointers, isNumber) {\n var path = jsonPointers // false by default\n ? '\\'/\\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \\'~0\\').replace(/\\\\//g, \\'~1\\')')\n : (isNumber ? '\\'[\\' + ' + expr + ' + \\']\\'' : '\\'[\\\\\\'\\' + ' + expr + ' + \\'\\\\\\']\\'');\n return joinPaths(currentPath, path);\n}\n\n\nfunction getPath(currentPath, prop, jsonPointers) {\n var path = jsonPointers // false by default\n ? toQuotedString('/' + escapeJsonPointer(prop))\n : toQuotedString(getProperty(prop));\n return joinPaths(currentPath, path);\n}\n\n\nvar JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\nvar RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\nfunction getData($data, lvl, paths) {\n var up, jsonPointer, data, matches;\n if ($data === '') return 'rootData';\n if ($data[0] == '/') {\n if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);\n jsonPointer = $data;\n data = 'rootData';\n } else {\n matches = $data.match(RELATIVE_JSON_POINTER);\n if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);\n up = +matches[1];\n jsonPointer = matches[2];\n if (jsonPointer == '#') {\n if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);\n return paths[lvl - up];\n }\n\n if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);\n data = 'data' + ((lvl - up) || '');\n if (!jsonPointer) return data;\n }\n\n var expr = data;\n var segments = jsonPointer.split('/');\n for (var i=0; i<segments.length; i++) {\n var segment = segments[i];\n if (segment) {\n data += getProperty(unescapeJsonPointer(segment));\n expr += ' && ' + data;\n }\n }\n return expr;\n}\n\n\nfunction joinPaths (a, b) {\n if (a == '\"\"') return b;\n return (a + ' + ' + b).replace(/' \\+ '/g, '');\n}\n\n\nfunction unescapeFragment(str) {\n return unescapeJsonPointer(decodeURIComponent(str));\n}\n\n\nfunction escapeFragment(str) {\n return encodeURIComponent(escapeJsonPointer(str));\n}\n\n\nfunction escapeJsonPointer(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n\n\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/compile/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/data.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ajv/lib/data.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar KEYWORDS = [\n 'multipleOf',\n 'maximum',\n 'exclusiveMaximum',\n 'minimum',\n 'exclusiveMinimum',\n 'maxLength',\n 'minLength',\n 'pattern',\n 'additionalItems',\n 'maxItems',\n 'minItems',\n 'uniqueItems',\n 'maxProperties',\n 'minProperties',\n 'required',\n 'additionalProperties',\n 'enum',\n 'format',\n 'const'\n];\n\nmodule.exports = function (metaSchema, keywordsJsonPointers) {\n for (var i=0; i<keywordsJsonPointers.length; i++) {\n metaSchema = JSON.parse(JSON.stringify(metaSchema));\n var segments = keywordsJsonPointers[i].split('/');\n var keywords = metaSchema;\n var j;\n for (j=1; j<segments.length; j++)\n keywords = keywords[segments[j]];\n\n for (j=0; j<KEYWORDS.length; j++) {\n var key = KEYWORDS[j];\n var schema = keywords[key];\n if (schema) {\n keywords[key] = {\n anyOf: [\n schema,\n { $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#' }\n ]\n };\n }\n }\n }\n\n return metaSchema;\n};\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/data.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/_limit.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/_limit.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate__limit(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $isMax = $keyword == 'maximum',\n $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',\n $schemaExcl = it.schema[$exclusiveKeyword],\n $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,\n $op = $isMax ? '<' : '>',\n $notOp = $isMax ? '>' : '<',\n $errorKeyword = undefined;\n if ($isDataExcl) {\n var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),\n $exclusive = 'exclusive' + $lvl,\n $exclType = 'exclType' + $lvl,\n $exclIsNumber = 'exclIsNumber' + $lvl,\n $opExpr = 'op' + $lvl,\n $opStr = '\\' + ' + $opExpr + ' + \\'';\n out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';\n $schemaValueExcl = 'schemaExcl' + $lvl;\n out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \\'boolean\\' && ' + ($exclType) + ' != \\'undefined\\' && ' + ($exclType) + ' != \\'number\\') { ';\n var $errorKeyword = $exclusiveKeyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_exclusiveLimit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'' + ($exclusiveKeyword) + ' should be boolean\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($exclType) + ' == \\'number\\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \\'' + ($op) + '\\' : \\'' + ($op) + '=\\'; ';\n if ($schema === undefined) {\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaValueExcl;\n $isData = $isDataExcl;\n }\n } else {\n var $exclIsNumber = typeof $schemaExcl == 'number',\n $opStr = $op;\n if ($exclIsNumber && $isData) {\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';\n } else {\n if ($exclIsNumber && $schema === undefined) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaExcl;\n $notOp += '=';\n } else {\n if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);\n if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $notOp += '=';\n } else {\n $exclusive = false;\n $opStr += '=';\n }\n }\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';\n }\n }\n $errorKeyword = $errorKeyword || $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ' + ($opStr) + ' ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/_limit.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/_limitItems.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/_limitItems.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate__limitItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $op = $keyword == 'maxItems' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxItems') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/_limitItems.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/_limitLength.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/_limitLength.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate__limitLength(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $op = $keyword == 'maxLength' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n if (it.opts.unicode === false) {\n out += ' ' + ($data) + '.length ';\n } else {\n out += ' ucs2length(' + ($data) + ') ';\n }\n out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitLength') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be ';\n if ($keyword == 'maxLength') {\n out += 'longer';\n } else {\n out += 'shorter';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' characters\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/_limitLength.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/_limitProperties.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/_limitProperties.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate__limitProperties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $op = $keyword == 'maxProperties' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxProperties') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' properties\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/_limitProperties.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/allOf.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/allOf.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_allOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $allSchemasEmpty = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if (it.util.schemaHasRules($sch, it.RULES.all)) {\n $allSchemasEmpty = false;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($breakOnError) {\n if ($allSchemasEmpty) {\n out += ' if (true) { ';\n } else {\n out += ' ' + ($closingBraces.slice(0, -1)) + ' ';\n }\n }\n out = it.util.cleanUpCode(out);\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/allOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/anyOf.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/anyOf.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_anyOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $noEmptySchema = $schema.every(function($sch) {\n return it.util.schemaHasRules($sch, it.RULES.all);\n });\n if ($noEmptySchema) {\n var $currentBaseId = $it.baseId;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';\n $closingBraces += '}';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('anyOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match some schema in anyOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n out = it.util.cleanUpCode(out);\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/anyOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/comment.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/comment.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_comment(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $comment = it.util.toQuotedString($schema);\n if (it.opts.$comment === true) {\n out += ' console.log(' + ($comment) + ');';\n } else if (typeof it.opts.$comment == 'function') {\n out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/comment.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/const.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/const.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_const(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!$isData) {\n out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('const') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to constant\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/const.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/contains.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/contains.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_contains(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId,\n $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all);\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($nonEmptySchema) {\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (' + ($nextValid) + ') break; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';\n } else {\n out += ' if (' + ($data) + '.length == 0) {';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('contains') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should contain a valid item\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n if ($nonEmptySchema) {\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n }\n if (it.opts.allErrors) {\n out += ' } ';\n }\n out = it.util.cleanUpCode(out);\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/contains.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/custom.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/custom.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_custom(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $rule = this,\n $definition = 'definition' + $lvl,\n $rDef = $rule.definition,\n $closingBraces = '';\n var $compile, $inline, $macro, $ruleValidate, $validateCode;\n if ($isData && $rDef.$data) {\n $validateCode = 'keywordValidate' + $lvl;\n var $validateSchema = $rDef.validateSchema;\n out += ' var ' + ($definition) + ' = RULES.custom[\\'' + ($keyword) + '\\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';\n } else {\n $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);\n if (!$ruleValidate) return;\n $schemaValue = 'validate.schema' + $schemaPath;\n $validateCode = $ruleValidate.code;\n $compile = $rDef.compile;\n $inline = $rDef.inline;\n $macro = $rDef.macro;\n }\n var $ruleErrs = $validateCode + '.errors',\n $i = 'i' + $lvl,\n $ruleErr = 'ruleErr' + $lvl,\n $asyncKeyword = $rDef.async;\n if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');\n if (!($inline || $macro)) {\n out += '' + ($ruleErrs) + ' = null;';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($isData && $rDef.$data) {\n $closingBraces += '}';\n out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';\n if ($validateSchema) {\n $closingBraces += '}';\n out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';\n }\n }\n if ($inline) {\n if ($rDef.statements) {\n out += ' ' + ($ruleValidate.validate) + ' ';\n } else {\n out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';\n }\n } else if ($macro) {\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $ruleValidate.validate;\n $it.schemaPath = '';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it).replace(/validate\\.schema/g, $validateCode);\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($code);\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n out += ' ' + ($validateCode) + '.call( ';\n if (it.opts.passContext) {\n out += 'this';\n } else {\n out += 'self';\n }\n if ($compile || $rDef.schema === false) {\n out += ' , ' + ($data) + ' ';\n } else {\n out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';\n }\n out += ' , (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';\n var def_callRuleValidate = out;\n out = $$outStack.pop();\n if ($rDef.errors === false) {\n out += ' ' + ($valid) + ' = ';\n if ($asyncKeyword) {\n out += 'await ';\n }\n out += '' + (def_callRuleValidate) + '; ';\n } else {\n if ($asyncKeyword) {\n $ruleErrs = 'customErrors' + $lvl;\n out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';\n } else {\n out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';\n }\n }\n }\n if ($rDef.modifying) {\n out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';\n }\n out += '' + ($closingBraces);\n if ($rDef.valid) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n out += ' if ( ';\n if ($rDef.valid === undefined) {\n out += ' !';\n if ($macro) {\n out += '' + ($nextValid);\n } else {\n out += '' + ($valid);\n }\n } else {\n out += ' ' + (!$rDef.valid) + ' ';\n }\n out += ') { ';\n $errorKeyword = $rule.keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'custom') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \\'' + ($rule.keyword) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"' + ($rule.keyword) + '\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n var def_customError = out;\n out = $$outStack.pop();\n if ($inline) {\n if ($rDef.errors) {\n if ($rDef.errors != 'full') {\n out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \\'\\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = \"' + ($errSchemaPath) + '\"; } ';\n if (it.opts.verbose) {\n out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';\n }\n out += ' } ';\n }\n } else {\n if ($rDef.errors === false) {\n out += ' ' + (def_customError) + ' ';\n } else {\n out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \\'\\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = \"' + ($errSchemaPath) + '\"; } ';\n if (it.opts.verbose) {\n out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';\n }\n out += ' } } ';\n }\n }\n } else if ($macro) {\n out += ' var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'custom') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \\'' + ($rule.keyword) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"' + ($rule.keyword) + '\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n } else {\n if ($rDef.errors === false) {\n out += ' ' + (def_customError) + ' ';\n } else {\n out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \\'\\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = \"' + ($errSchemaPath) + '\"; ';\n if (it.opts.verbose) {\n out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';\n }\n out += ' } } else { ' + (def_customError) + ' } ';\n }\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/custom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/dependencies.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/dependencies.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_dependencies(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $schemaDeps = {},\n $propertyDeps = {},\n $ownProperties = it.opts.ownProperties;\n for ($property in $schema) {\n var $sch = $schema[$property];\n var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;\n $deps[$property] = $sch;\n }\n out += 'var ' + ($errs) + ' = errors;';\n var $currentErrorPath = it.errorPath;\n out += 'var missing' + ($lvl) + ';';\n for (var $property in $propertyDeps) {\n $deps = $propertyDeps[$property];\n if ($deps.length) {\n out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($property)) + '\\') ';\n }\n if ($breakOnError) {\n out += ' && ( ';\n var arr1 = $deps;\n if (arr1) {\n var $propertyKey, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $propertyKey = arr1[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ')) { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('dependencies') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \\'' + (it.util.escapeQuotes($property)) + '\\', missingProperty: \\'' + ($missingProperty) + '\\', depsCount: ' + ($deps.length) + ', deps: \\'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(\", \"))) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should have ';\n if ($deps.length == 1) {\n out += 'property ' + (it.util.escapeQuotes($deps[0]));\n } else {\n out += 'properties ' + (it.util.escapeQuotes($deps.join(\", \")));\n }\n out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n } else {\n out += ' ) { ';\n var arr2 = $deps;\n if (arr2) {\n var $propertyKey, i2 = -1,\n l2 = arr2.length - 1;\n while (i2 < l2) {\n $propertyKey = arr2[i2 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('dependencies') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \\'' + (it.util.escapeQuotes($property)) + '\\', missingProperty: \\'' + ($missingProperty) + '\\', depsCount: ' + ($deps.length) + ', deps: \\'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(\", \"))) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should have ';\n if ($deps.length == 1) {\n out += 'property ' + (it.util.escapeQuotes($deps[0]));\n } else {\n out += 'properties ' + (it.util.escapeQuotes($deps.join(\", \")));\n }\n out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n out += ' } ';\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n }\n it.errorPath = $currentErrorPath;\n var $currentBaseId = $it.baseId;\n for (var $property in $schemaDeps) {\n var $sch = $schemaDeps[$property];\n if (it.util.schemaHasRules($sch, it.RULES.all)) {\n out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($property)) + '\\') ';\n }\n out += ') { ';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + it.util.getProperty($property);\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n out = it.util.cleanUpCode(out);\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/dependencies.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/enum.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/enum.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_enum(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $i = 'i' + $lvl,\n $vSchema = 'schema' + $lvl;\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ';';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('enum') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to one of the allowed values\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/enum.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/format.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/format.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_format(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n if (it.opts.format === false) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $unknownFormats = it.opts.unknownFormats,\n $allowUnknown = Array.isArray($unknownFormats);\n if ($isData) {\n var $format = 'format' + $lvl,\n $isObject = 'isObject' + $lvl,\n $formatType = 'formatType' + $lvl;\n out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \\'object\\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \\'string\\'; if (' + ($isObject) + ') { ';\n if (it.async) {\n out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';\n }\n out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' (';\n if ($unknownFormats != 'ignore') {\n out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';\n if ($allowUnknown) {\n out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';\n }\n out += ') || ';\n }\n out += ' (' + ($format) + ' && ' + ($formatType) + ' == \\'' + ($ruleType) + '\\' && !(typeof ' + ($format) + ' == \\'function\\' ? ';\n if (it.async) {\n out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';\n } else {\n out += ' ' + ($format) + '(' + ($data) + ') ';\n }\n out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';\n } else {\n var $format = it.formats[$schema];\n if (!$format) {\n if ($unknownFormats == 'ignore') {\n it.logger.warn('unknown format \"' + $schema + '\" ignored in schema at path \"' + it.errSchemaPath + '\"');\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else {\n throw new Error('unknown format \"' + $schema + '\" is used in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;\n var $formatType = $isObject && $format.type || 'string';\n if ($isObject) {\n var $async = $format.async === true;\n $format = $format.validate;\n }\n if ($formatType != $ruleType) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n if ($async) {\n if (!it.async) throw new Error('async format in sync schema');\n var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';\n out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';\n } else {\n out += ' if (! ';\n var $formatRef = 'formats' + it.util.getProperty($schema);\n if ($isObject) $formatRef += '.validate';\n if (typeof $format == 'function') {\n out += ' ' + ($formatRef) + '(' + ($data) + ') ';\n } else {\n out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';\n }\n out += ') { ';\n }\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('format') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match format \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/format.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/if.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/if.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_if(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $thenSch = it.schema['then'],\n $elseSch = it.schema['else'],\n $thenPresent = $thenSch !== undefined && it.util.schemaHasRules($thenSch, it.RULES.all),\n $elsePresent = $elseSch !== undefined && it.util.schemaHasRules($elseSch, it.RULES.all),\n $currentBaseId = $it.baseId;\n if ($thenPresent || $elsePresent) {\n var $ifClause;\n $it.createErrors = false;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n $it.createErrors = true;\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n if ($thenPresent) {\n out += ' if (' + ($nextValid) + ') { ';\n $it.schema = it.schema['then'];\n $it.schemaPath = it.schemaPath + '.then';\n $it.errSchemaPath = it.errSchemaPath + '/then';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'then\\'; ';\n } else {\n $ifClause = '\\'then\\'';\n }\n out += ' } ';\n if ($elsePresent) {\n out += ' else { ';\n }\n } else {\n out += ' if (!' + ($nextValid) + ') { ';\n }\n if ($elsePresent) {\n $it.schema = it.schema['else'];\n $it.schemaPath = it.schemaPath + '.else';\n $it.errSchemaPath = it.errSchemaPath + '/else';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'else\\'; ';\n } else {\n $ifClause = '\\'else\\'';\n }\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('if') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match \"\\' + ' + ($ifClause) + ' + \\'\" schema\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n out = it.util.cleanUpCode(out);\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/if.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n//all requires must be explicit because browserify won't work with dynamic requires\nmodule.exports = {\n '$ref': __webpack_require__(/*! ./ref */ \"./node_modules/ajv/lib/dotjs/ref.js\"),\n allOf: __webpack_require__(/*! ./allOf */ \"./node_modules/ajv/lib/dotjs/allOf.js\"),\n anyOf: __webpack_require__(/*! ./anyOf */ \"./node_modules/ajv/lib/dotjs/anyOf.js\"),\n '$comment': __webpack_require__(/*! ./comment */ \"./node_modules/ajv/lib/dotjs/comment.js\"),\n const: __webpack_require__(/*! ./const */ \"./node_modules/ajv/lib/dotjs/const.js\"),\n contains: __webpack_require__(/*! ./contains */ \"./node_modules/ajv/lib/dotjs/contains.js\"),\n dependencies: __webpack_require__(/*! ./dependencies */ \"./node_modules/ajv/lib/dotjs/dependencies.js\"),\n 'enum': __webpack_require__(/*! ./enum */ \"./node_modules/ajv/lib/dotjs/enum.js\"),\n format: __webpack_require__(/*! ./format */ \"./node_modules/ajv/lib/dotjs/format.js\"),\n 'if': __webpack_require__(/*! ./if */ \"./node_modules/ajv/lib/dotjs/if.js\"),\n items: __webpack_require__(/*! ./items */ \"./node_modules/ajv/lib/dotjs/items.js\"),\n maximum: __webpack_require__(/*! ./_limit */ \"./node_modules/ajv/lib/dotjs/_limit.js\"),\n minimum: __webpack_require__(/*! ./_limit */ \"./node_modules/ajv/lib/dotjs/_limit.js\"),\n maxItems: __webpack_require__(/*! ./_limitItems */ \"./node_modules/ajv/lib/dotjs/_limitItems.js\"),\n minItems: __webpack_require__(/*! ./_limitItems */ \"./node_modules/ajv/lib/dotjs/_limitItems.js\"),\n maxLength: __webpack_require__(/*! ./_limitLength */ \"./node_modules/ajv/lib/dotjs/_limitLength.js\"),\n minLength: __webpack_require__(/*! ./_limitLength */ \"./node_modules/ajv/lib/dotjs/_limitLength.js\"),\n maxProperties: __webpack_require__(/*! ./_limitProperties */ \"./node_modules/ajv/lib/dotjs/_limitProperties.js\"),\n minProperties: __webpack_require__(/*! ./_limitProperties */ \"./node_modules/ajv/lib/dotjs/_limitProperties.js\"),\n multipleOf: __webpack_require__(/*! ./multipleOf */ \"./node_modules/ajv/lib/dotjs/multipleOf.js\"),\n not: __webpack_require__(/*! ./not */ \"./node_modules/ajv/lib/dotjs/not.js\"),\n oneOf: __webpack_require__(/*! ./oneOf */ \"./node_modules/ajv/lib/dotjs/oneOf.js\"),\n pattern: __webpack_require__(/*! ./pattern */ \"./node_modules/ajv/lib/dotjs/pattern.js\"),\n properties: __webpack_require__(/*! ./properties */ \"./node_modules/ajv/lib/dotjs/properties.js\"),\n propertyNames: __webpack_require__(/*! ./propertyNames */ \"./node_modules/ajv/lib/dotjs/propertyNames.js\"),\n required: __webpack_require__(/*! ./required */ \"./node_modules/ajv/lib/dotjs/required.js\"),\n uniqueItems: __webpack_require__(/*! ./uniqueItems */ \"./node_modules/ajv/lib/dotjs/uniqueItems.js\"),\n validate: __webpack_require__(/*! ./validate */ \"./node_modules/ajv/lib/dotjs/validate.js\")\n};\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/items.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/items.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_items(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId;\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if (Array.isArray($schema)) {\n var $additionalItems = it.schema.additionalItems;\n if ($additionalItems === false) {\n out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have more than ' + ($schema.length) + ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if (it.util.schemaHasRules($sch, it.RULES.all)) {\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';\n var $passData = $data + '[' + $i + ']';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);\n $it.dataPathArr[$dataNxt] = $i;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) {\n $it.schema = $additionalItems;\n $it.schemaPath = it.schemaPath + '.additionalItems';\n $it.errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n } else if (it.util.schemaHasRules($schema, it.RULES.all)) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' }';\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n out = it.util.cleanUpCode(out);\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/items.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/multipleOf.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/multipleOf.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_multipleOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n out += 'var division' + ($lvl) + ';if (';\n if ($isData) {\n out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \\'number\\' || ';\n }\n out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';\n if (it.opts.multipleOfPrecision) {\n out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';\n } else {\n out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';\n }\n out += ' ) ';\n if ($isData) {\n out += ' ) ';\n }\n out += ' ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('multipleOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be multiple of ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/multipleOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/not.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/not.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_not(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n if (it.util.schemaHasRules($schema, it.RULES.all)) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.createErrors = false;\n var $allErrorsOption;\n if ($it.opts.allErrors) {\n $allErrorsOption = $it.opts.allErrors;\n $it.opts.allErrors = false;\n }\n out += ' ' + (it.validate($it)) + ' ';\n $it.createErrors = true;\n if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (' + ($nextValid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n out += ' var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/not.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/oneOf.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/oneOf.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_oneOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $prevValid = 'prevValid' + $lvl,\n $passingSchemas = 'passingSchemas' + $lvl;\n out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if (it.util.schemaHasRules($sch, it.RULES.all)) {\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n } else {\n out += ' var ' + ($nextValid) + ' = true; ';\n }\n if ($i) {\n out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';\n $closingBraces += '}';\n }\n out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('oneOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match exactly one schema in oneOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/oneOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/pattern.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/pattern.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_pattern(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('pattern') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match pattern \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/pattern.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/properties.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/properties.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_properties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl;\n var $schemaKeys = Object.keys($schema || {}),\n $pProperties = it.schema.patternProperties || {},\n $pPropertyKeys = Object.keys($pProperties),\n $aProperties = it.schema.additionalProperties,\n $someProperties = $schemaKeys.length || $pPropertyKeys.length,\n $noAdditional = $aProperties === false,\n $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,\n $removeAdditional = it.opts.removeAdditional,\n $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n var $required = it.schema.required;\n if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required);\n out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined;';\n }\n if ($checkAdditional) {\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n if ($someProperties) {\n out += ' var isAdditional' + ($lvl) + ' = !(false ';\n if ($schemaKeys.length) {\n if ($schemaKeys.length > 8) {\n out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';\n } else {\n var arr1 = $schemaKeys;\n if (arr1) {\n var $propertyKey, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $propertyKey = arr1[i1 += 1];\n out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr2 = $pPropertyKeys;\n if (arr2) {\n var $pProperty, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $pProperty = arr2[$i += 1];\n out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';\n }\n }\n }\n out += ' ); if (isAdditional' + ($lvl) + ') { ';\n }\n if ($removeAdditional == 'all') {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n var $currentErrorPath = it.errorPath;\n var $additionalProperty = '\\' + ' + $key + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n }\n if ($noAdditional) {\n if ($removeAdditional) {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n out += ' ' + ($nextValid) + ' = false; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalProperties';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \\'' + ($additionalProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is an invalid additional property';\n } else {\n out += 'should NOT have additional properties';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n out += ' break; ';\n }\n }\n } else if ($additionalIsSchema) {\n if ($removeAdditional == 'failing') {\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n } else {\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n }\n }\n it.errorPath = $currentErrorPath;\n }\n if ($someProperties) {\n out += ' } ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n var $useDefaults = it.opts.useDefaults && !it.compositeRule;\n if ($schemaKeys.length) {\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if (it.util.schemaHasRules($sch, it.RULES.all)) {\n var $prop = it.util.getProperty($propertyKey),\n $passData = $data + $prop,\n $hasDefault = $useDefaults && $sch.default !== undefined;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + $prop;\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);\n $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);\n $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n $code = it.util.varReplace($code, $nextData, $passData);\n var $useData = $passData;\n } else {\n var $useData = $nextData;\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';\n }\n if ($hasDefault) {\n out += ' ' + ($code) + ' ';\n } else {\n if ($requiredHash && $requiredHash[$propertyKey]) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = false; ';\n var $currentErrorPath = it.errorPath,\n $currErrSchemaPath = $errSchemaPath,\n $missingProperty = it.util.escapeQuotes($propertyKey);\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n $errSchemaPath = it.errSchemaPath + '/required';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n it.errorPath = $currentErrorPath;\n out += ' } else { ';\n } else {\n if ($breakOnError) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = true; } else { ';\n } else {\n out += ' if (' + ($useData) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ' ) { ';\n }\n }\n out += ' ' + ($code) + ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr4 = $pPropertyKeys;\n if (arr4) {\n var $pProperty, i4 = -1,\n l4 = arr4.length - 1;\n while (i4 < l4) {\n $pProperty = arr4[i4 += 1];\n var $sch = $pProperties[$pProperty];\n if (it.util.schemaHasRules($sch, it.RULES.all)) {\n $it.schema = $sch;\n $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);\n $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else ' + ($nextValid) + ' = true; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n out = it.util.cleanUpCode(out);\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/properties.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/propertyNames.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/propertyNames.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_propertyNames(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n out += 'var ' + ($errs) + ' = errors;';\n if (it.util.schemaHasRules($schema, it.RULES.all)) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $i = 'i' + $lvl,\n $invalidName = '\\' + ' + $key + ' + \\'',\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined; ';\n }\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' var startErrs' + ($lvl) + ' = errors; ';\n var $passData = $key;\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; } var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('propertyNames') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \\'' + ($invalidName) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'property name \\\\\\'' + ($invalidName) + '\\\\\\' is invalid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n if ($breakOnError) {\n out += ' break; ';\n }\n out += ' } }';\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n out = it.util.cleanUpCode(out);\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/propertyNames.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/ref.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/ref.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_ref(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $async, $refCode;\n if ($schema == '#' || $schema == '#/') {\n if (it.isRoot) {\n $async = it.async;\n $refCode = 'validate';\n } else {\n $async = it.root.schema.$async === true;\n $refCode = 'root.refVal[0]';\n }\n } else {\n var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);\n if ($refVal === undefined) {\n var $message = it.MissingRefError.message(it.baseId, $schema);\n if (it.opts.missingRefs == 'fail') {\n it.logger.error($message);\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('$ref') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \\'' + (it.util.escapeQuotes($schema)) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'can\\\\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n } else if (it.opts.missingRefs == 'ignore') {\n it.logger.warn($message);\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n throw new it.MissingRefError(it.baseId, $schema, $message);\n }\n } else if ($refVal.inline) {\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $refVal.schema;\n $it.schemaPath = '';\n $it.errSchemaPath = $schema;\n var $code = it.validate($it).replace(/validate\\.schema/g, $refVal.code);\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n }\n } else {\n $async = $refVal.$async === true || (it.async && $refVal.$async !== false);\n $refCode = $refVal.code;\n }\n }\n if ($refCode) {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n if (it.opts.passContext) {\n out += ' ' + ($refCode) + '.call(this, ';\n } else {\n out += ' ' + ($refCode) + '( ';\n }\n out += ' ' + ($data) + ', (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';\n var __callValidate = out;\n out = $$outStack.pop();\n if ($async) {\n if (!it.async) throw new Error('async schema referenced by sync schema');\n if ($breakOnError) {\n out += ' var ' + ($valid) + '; ';\n }\n out += ' try { await ' + (__callValidate) + '; ';\n if ($breakOnError) {\n out += ' ' + ($valid) + ' = true; ';\n }\n out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';\n if ($breakOnError) {\n out += ' ' + ($valid) + ' = false; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($valid) + ') { ';\n }\n } else {\n out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n }\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/ref.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/required.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/required.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_required(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $vSchema = 'schema' + $lvl;\n if (!$isData) {\n if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {\n var $required = [];\n var arr1 = $schema;\n if (arr1) {\n var $property, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $property = arr1[i1 += 1];\n var $propertySch = it.schema.properties[$property];\n if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) {\n $required[$required.length] = $property;\n }\n }\n }\n } else {\n var $required = $schema;\n }\n }\n if ($isData || $required.length) {\n var $currentErrorPath = it.errorPath,\n $loopRequired = $isData || $required.length >= it.opts.loopRequired,\n $ownProperties = it.opts.ownProperties;\n if ($breakOnError) {\n out += ' var missing' + ($lvl) + '; ';\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n out += ' var ' + ($valid) + ' = true; ';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += '; if (!' + ($valid) + ') break; } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n } else {\n out += ' if ( ';\n var arr2 = $required;\n if (arr2) {\n var $propertyKey, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $propertyKey = arr2[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ') { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n }\n } else {\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n if ($isData) {\n out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';\n if ($isData) {\n out += ' } ';\n }\n } else {\n var arr3 = $required;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n }\n it.errorPath = $currentErrorPath;\n } else if ($breakOnError) {\n out += ' if (true) {';\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/required.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/uniqueItems.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/uniqueItems.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_uniqueItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (($schema || $isData) && it.opts.uniqueItems !== false) {\n if ($isData) {\n out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'boolean\\') ' + ($valid) + ' = false; else { ';\n }\n out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';\n var $itemType = it.schema.items && it.schema.items.type,\n $typeIsArray = Array.isArray($itemType);\n if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {\n out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';\n } else {\n out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';\n var $method = 'checkDataType' + ($typeIsArray ? 's' : '');\n out += ' if (' + (it.util[$method]($itemType, 'item', true)) + ') continue; ';\n if ($typeIsArray) {\n out += ' if (typeof item == \\'string\\') item = \\'\"\\' + item; ';\n }\n out += ' if (typeof itemIndices[item] == \\'number\\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';\n }\n out += ' } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('uniqueItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have duplicate items (items ## \\' + j + \\' and \\' + i + \\' are identical)\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/uniqueItems.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/dotjs/validate.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ajv/lib/dotjs/validate.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function generate_validate(it, $keyword, $ruleType) {\n var out = '';\n var $async = it.schema.$async === true,\n $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),\n $id = it.self._getId(it.schema);\n if (it.opts.strictKeywords) {\n var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);\n if ($unknownKwd) {\n var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;\n if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);\n else throw new Error($keywordsMsg);\n }\n }\n if (it.isTop) {\n out += ' var validate = ';\n if ($async) {\n it.async = true;\n out += 'async ';\n }\n out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \\'use strict\\'; ';\n if ($id && (it.opts.sourceCode || it.opts.processCode)) {\n out += ' ' + ('/\\*# sourceURL=' + $id + ' */') + ' ';\n }\n }\n if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {\n var $keyword = 'false schema';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n if (it.schema === false) {\n if (it.isTop) {\n $breakOnError = true;\n } else {\n out += ' var ' + ($valid) + ' = false; ';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'false schema') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'boolean schema is false\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n } else {\n if (it.isTop) {\n if ($async) {\n out += ' return data; ';\n } else {\n out += ' validate.errors = null; return true; ';\n }\n } else {\n out += ' var ' + ($valid) + ' = true; ';\n }\n }\n if (it.isTop) {\n out += ' }; return validate; ';\n }\n return out;\n }\n if (it.isTop) {\n var $top = it.isTop,\n $lvl = it.level = 0,\n $dataLvl = it.dataLevel = 0,\n $data = 'data';\n it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));\n it.baseId = it.baseId || it.rootId;\n delete it.isTop;\n it.dataPathArr = [undefined];\n if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored in the schema root';\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n out += ' var vErrors = null; ';\n out += ' var errors = 0; ';\n out += ' if (rootData === undefined) rootData = data; ';\n } else {\n var $lvl = it.level,\n $dataLvl = it.dataLevel,\n $data = 'data' + ($dataLvl || '');\n if ($id) it.baseId = it.resolve.url(it.baseId, $id);\n if ($async && !it.async) throw new Error('async schema in sync schema');\n out += ' var errs_' + ($lvl) + ' = errors;';\n }\n var $valid = 'valid' + $lvl,\n $breakOnError = !it.opts.allErrors,\n $closingBraces1 = '',\n $closingBraces2 = '';\n var $errorKeyword;\n var $typeSchema = it.schema.type,\n $typeIsArray = Array.isArray($typeSchema);\n if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {\n if ($typeIsArray) {\n if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');\n } else if ($typeSchema != 'null') {\n $typeSchema = [$typeSchema, 'null'];\n $typeIsArray = true;\n }\n }\n if ($typeIsArray && $typeSchema.length == 1) {\n $typeSchema = $typeSchema[0];\n $typeIsArray = false;\n }\n if (it.schema.$ref && $refKeywords) {\n if (it.opts.extendRefs == 'fail') {\n throw new Error('$ref: validation keywords used in schema at path \"' + it.errSchemaPath + '\" (see option extendRefs)');\n } else if (it.opts.extendRefs !== true) {\n $refKeywords = false;\n it.logger.warn('$ref: keywords ignored in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n if (it.schema.$comment && it.opts.$comment) {\n out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));\n }\n if ($typeSchema) {\n if (it.opts.coerceTypes) {\n var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);\n }\n var $rulesGroup = it.RULES.types[$typeSchema];\n if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type',\n $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';\n out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { ';\n if ($coerceToTypes) {\n var $dataType = 'dataType' + $lvl,\n $coerced = 'coerced' + $lvl;\n out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; ';\n if (it.opts.coerceTypes == 'array') {\n out += ' if (' + ($dataType) + ' == \\'object\\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \\'array\\'; ';\n }\n out += ' var ' + ($coerced) + ' = undefined; ';\n var $bracesCoercion = '';\n var arr1 = $coerceToTypes;\n if (arr1) {\n var $type, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $type = arr1[$i += 1];\n if ($i) {\n out += ' if (' + ($coerced) + ' === undefined) { ';\n $bracesCoercion += '}';\n }\n if (it.opts.coerceTypes == 'array' && $type != 'array') {\n out += ' if (' + ($dataType) + ' == \\'array\\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } ';\n }\n if ($type == 'string') {\n out += ' if (' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\') ' + ($coerced) + ' = \\'\\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \\'\\'; ';\n } else if ($type == 'number' || $type == 'integer') {\n out += ' if (' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \\'string\\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';\n if ($type == 'integer') {\n out += ' && !(' + ($data) + ' % 1)';\n }\n out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';\n } else if ($type == 'boolean') {\n out += ' if (' + ($data) + ' === \\'false\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \\'true\\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';\n } else if ($type == 'null') {\n out += ' if (' + ($data) + ' === \\'\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';\n } else if (it.opts.coerceTypes == 'array' && $type == 'array') {\n out += ' if (' + ($dataType) + ' == \\'string\\' || ' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';\n }\n }\n }\n out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' ' + ($data) + ' = ' + ($coerced) + '; ';\n if (!$dataLvl) {\n out += 'if (' + ($parentData) + ' !== undefined)';\n }\n out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n }\n out += ' } ';\n }\n }\n if (it.schema.$ref && !$refKeywords) {\n out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';\n if ($breakOnError) {\n out += ' } if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n } else {\n var arr2 = it.RULES;\n if (arr2) {\n var $rulesGroup, i2 = -1,\n l2 = arr2.length - 1;\n while (i2 < l2) {\n $rulesGroup = arr2[i2 += 1];\n if ($shouldUseGroup($rulesGroup)) {\n if ($rulesGroup.type) {\n out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { ';\n }\n if (it.opts.useDefaults) {\n if ($rulesGroup.type == 'object' && it.schema.properties) {\n var $schema = it.schema.properties,\n $schemaKeys = Object.keys($schema);\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ($sch.default !== undefined) {\n var $passData = $data + it.util.getProperty($propertyKey);\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {\n var arr4 = it.schema.items;\n if (arr4) {\n var $sch, $i = -1,\n l4 = arr4.length - 1;\n while ($i < l4) {\n $sch = arr4[$i += 1];\n if ($sch.default !== undefined) {\n var $passData = $data + '[' + $i + ']';\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n }\n }\n var arr5 = $rulesGroup.rules;\n if (arr5) {\n var $rule, i5 = -1,\n l5 = arr5.length - 1;\n while (i5 < l5) {\n $rule = arr5[i5 += 1];\n if ($shouldUseRule($rule)) {\n var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);\n if ($code) {\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n $closingBraces1 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces1) + ' ';\n $closingBraces1 = '';\n }\n if ($rulesGroup.type) {\n out += ' } ';\n if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {\n out += ' else { ';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces2) + ' ';\n }\n if ($top) {\n if ($async) {\n out += ' if (errors === 0) return data; ';\n out += ' else throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; ';\n out += ' return errors === 0; ';\n }\n out += ' }; return validate;';\n } else {\n out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';\n }\n out = it.util.cleanUpCode(out);\n if ($top) {\n out = it.util.finalCleanUpCode(out, $async);\n }\n\n function $shouldUseGroup($rulesGroup) {\n var rules = $rulesGroup.rules;\n for (var i = 0; i < rules.length; i++)\n if ($shouldUseRule(rules[i])) return true;\n }\n\n function $shouldUseRule($rule) {\n return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));\n }\n\n function $ruleImplementsSomeKeyword($rule) {\n var impl = $rule.implements;\n for (var i = 0; i < impl.length; i++)\n if (it.schema[impl[i]] !== undefined) return true;\n }\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/dotjs/validate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/keyword.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ajv/lib/keyword.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;\nvar customRuleCode = __webpack_require__(/*! ./dotjs/custom */ \"./node_modules/ajv/lib/dotjs/custom.js\");\nvar metaSchema = __webpack_require__(/*! ./refs/json-schema-draft-07.json */ \"./node_modules/ajv/lib/refs/json-schema-draft-07.json\");\n\nmodule.exports = {\n add: addKeyword,\n get: getKeyword,\n remove: removeKeyword,\n validate: validateKeyword\n};\n\nvar definitionSchema = {\n definitions: {\n simpleTypes: metaSchema.definitions.simpleTypes\n },\n type: 'object',\n dependencies: {\n schema: ['validate'],\n $data: ['validate'],\n statements: ['inline'],\n valid: {not: {required: ['macro']}}\n },\n properties: {\n type: metaSchema.properties.type,\n schema: {type: 'boolean'},\n statements: {type: 'boolean'},\n dependencies: {\n type: 'array',\n items: {type: 'string'}\n },\n metaSchema: {type: 'object'},\n modifying: {type: 'boolean'},\n valid: {type: 'boolean'},\n $data: {type: 'boolean'},\n async: {type: 'boolean'},\n errors: {\n anyOf: [\n {type: 'boolean'},\n {const: 'full'}\n ]\n }\n }\n};\n\n/**\n * Define custom keyword\n * @this Ajv\n * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).\n * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.\n * @return {Ajv} this for method chaining\n */\nfunction addKeyword(keyword, definition) {\n /* jshint validthis: true */\n /* eslint no-shadow: 0 */\n var RULES = this.RULES;\n if (RULES.keywords[keyword])\n throw new Error('Keyword ' + keyword + ' is already defined');\n\n if (!IDENTIFIER.test(keyword))\n throw new Error('Keyword ' + keyword + ' is not a valid identifier');\n\n if (definition) {\n this.validateKeyword(definition, true);\n\n var dataType = definition.type;\n if (Array.isArray(dataType)) {\n for (var i=0; i<dataType.length; i++)\n _addRule(keyword, dataType[i], definition);\n } else {\n _addRule(keyword, dataType, definition);\n }\n\n var metaSchema = definition.metaSchema;\n if (metaSchema) {\n if (definition.$data && this._opts.$data) {\n metaSchema = {\n anyOf: [\n metaSchema,\n { '$ref': 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#' }\n ]\n };\n }\n definition.validateSchema = this.compile(metaSchema, true);\n }\n }\n\n RULES.keywords[keyword] = RULES.all[keyword] = true;\n\n\n function _addRule(keyword, dataType, definition) {\n var ruleGroup;\n for (var i=0; i<RULES.length; i++) {\n var rg = RULES[i];\n if (rg.type == dataType) {\n ruleGroup = rg;\n break;\n }\n }\n\n if (!ruleGroup) {\n ruleGroup = { type: dataType, rules: [] };\n RULES.push(ruleGroup);\n }\n\n var rule = {\n keyword: keyword,\n definition: definition,\n custom: true,\n code: customRuleCode,\n implements: definition.implements\n };\n ruleGroup.rules.push(rule);\n RULES.custom[keyword] = rule;\n }\n\n return this;\n}\n\n\n/**\n * Get keyword\n * @this Ajv\n * @param {String} keyword pre-defined or custom keyword.\n * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.\n */\nfunction getKeyword(keyword) {\n /* jshint validthis: true */\n var rule = this.RULES.custom[keyword];\n return rule ? rule.definition : this.RULES.keywords[keyword] || false;\n}\n\n\n/**\n * Remove keyword\n * @this Ajv\n * @param {String} keyword pre-defined or custom keyword.\n * @return {Ajv} this for method chaining\n */\nfunction removeKeyword(keyword) {\n /* jshint validthis: true */\n var RULES = this.RULES;\n delete RULES.keywords[keyword];\n delete RULES.all[keyword];\n delete RULES.custom[keyword];\n for (var i=0; i<RULES.length; i++) {\n var rules = RULES[i].rules;\n for (var j=0; j<rules.length; j++) {\n if (rules[j].keyword == keyword) {\n rules.splice(j, 1);\n break;\n }\n }\n }\n return this;\n}\n\n\n/**\n * Validate keyword definition\n * @this Ajv\n * @param {Object} definition keyword definition object.\n * @param {Boolean} throwError true to throw exception if definition is invalid\n * @return {boolean} validation result\n */\nfunction validateKeyword(definition, throwError) {\n validateKeyword.errors = null;\n var v = this._validateKeyword = this._validateKeyword\n || this.compile(definitionSchema, true);\n\n if (v(definition)) return true;\n validateKeyword.errors = v.errors;\n if (throwError)\n throw new Error('custom keyword definition is invalid: ' + this.errorsText(v.errors));\n else\n return false;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/keyword.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/refs/data.json":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ajv/lib/refs/data.json ***!
|
||
\*********************************************/
|
||
/*! exports provided: $schema, $id, description, type, required, properties, additionalProperties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"$id\":\"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#\",\"description\":\"Meta-schema for $data reference (JSON Schema extension proposal)\",\"type\":\"object\",\"required\":[\"$data\"],\"properties\":{\"$data\":{\"type\":\"string\",\"anyOf\":[{\"format\":\"relative-json-pointer\"},{\"format\":\"json-pointer\"}]}},\"additionalProperties\":false};\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/refs/data.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/refs/json-schema-draft-06.json":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ajv/lib/refs/json-schema-draft-06.json ***!
|
||
\*************************************************************/
|
||
/*! exports provided: $schema, $id, title, definitions, type, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"$id\":\"http://json-schema.org/draft-06/schema#\",\"title\":\"Core schema meta-schema\",\"definitions\":{\"schemaArray\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#\"}},\"nonNegativeInteger\":{\"type\":\"integer\",\"minimum\":0},\"nonNegativeIntegerDefault0\":{\"allOf\":[{\"$ref\":\"#/definitions/nonNegativeInteger\"},{\"default\":0}]},\"simpleTypes\":{\"enum\":[\"array\",\"boolean\",\"integer\",\"null\",\"number\",\"object\",\"string\"]},\"stringArray\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true,\"default\":[]}},\"type\":[\"object\",\"boolean\"],\"properties\":{\"$id\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"$schema\":{\"type\":\"string\",\"format\":\"uri\"},\"$ref\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"title\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"default\":{},\"examples\":{\"type\":\"array\",\"items\":{}},\"multipleOf\":{\"type\":\"number\",\"exclusiveMinimum\":0},\"maximum\":{\"type\":\"number\"},\"exclusiveMaximum\":{\"type\":\"number\"},\"minimum\":{\"type\":\"number\"},\"exclusiveMinimum\":{\"type\":\"number\"},\"maxLength\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minLength\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"pattern\":{\"type\":\"string\",\"format\":\"regex\"},\"additionalItems\":{\"$ref\":\"#\"},\"items\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/schemaArray\"}],\"default\":{}},\"maxItems\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minItems\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"uniqueItems\":{\"type\":\"boolean\",\"default\":false},\"contains\":{\"$ref\":\"#\"},\"maxProperties\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minProperties\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"required\":{\"$ref\":\"#/definitions/stringArray\"},\"additionalProperties\":{\"$ref\":\"#\"},\"definitions\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"patternProperties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"dependencies\":{\"type\":\"object\",\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/stringArray\"}]}},\"propertyNames\":{\"$ref\":\"#\"},\"const\":{},\"enum\":{\"type\":\"array\",\"minItems\":1,\"uniqueItems\":true},\"type\":{\"anyOf\":[{\"$ref\":\"#/definitions/simpleTypes\"},{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/simpleTypes\"},\"minItems\":1,\"uniqueItems\":true}]},\"format\":{\"type\":\"string\"},\"allOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"anyOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"oneOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"not\":{\"$ref\":\"#\"}},\"default\":{}};\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/refs/json-schema-draft-06.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ajv/lib/refs/json-schema-draft-07.json":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ajv/lib/refs/json-schema-draft-07.json ***!
|
||
\*************************************************************/
|
||
/*! exports provided: $schema, $id, title, definitions, type, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"$id\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"Core schema meta-schema\",\"definitions\":{\"schemaArray\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#\"}},\"nonNegativeInteger\":{\"type\":\"integer\",\"minimum\":0},\"nonNegativeIntegerDefault0\":{\"allOf\":[{\"$ref\":\"#/definitions/nonNegativeInteger\"},{\"default\":0}]},\"simpleTypes\":{\"enum\":[\"array\",\"boolean\",\"integer\",\"null\",\"number\",\"object\",\"string\"]},\"stringArray\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"uniqueItems\":true,\"default\":[]}},\"type\":[\"object\",\"boolean\"],\"properties\":{\"$id\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"$schema\":{\"type\":\"string\",\"format\":\"uri\"},\"$ref\":{\"type\":\"string\",\"format\":\"uri-reference\"},\"$comment\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"default\":true,\"readOnly\":{\"type\":\"boolean\",\"default\":false},\"examples\":{\"type\":\"array\",\"items\":true},\"multipleOf\":{\"type\":\"number\",\"exclusiveMinimum\":0},\"maximum\":{\"type\":\"number\"},\"exclusiveMaximum\":{\"type\":\"number\"},\"minimum\":{\"type\":\"number\"},\"exclusiveMinimum\":{\"type\":\"number\"},\"maxLength\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minLength\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"pattern\":{\"type\":\"string\",\"format\":\"regex\"},\"additionalItems\":{\"$ref\":\"#\"},\"items\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/schemaArray\"}],\"default\":true},\"maxItems\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minItems\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"uniqueItems\":{\"type\":\"boolean\",\"default\":false},\"contains\":{\"$ref\":\"#\"},\"maxProperties\":{\"$ref\":\"#/definitions/nonNegativeInteger\"},\"minProperties\":{\"$ref\":\"#/definitions/nonNegativeIntegerDefault0\"},\"required\":{\"$ref\":\"#/definitions/stringArray\"},\"additionalProperties\":{\"$ref\":\"#\"},\"definitions\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"properties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"default\":{}},\"patternProperties\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#\"},\"propertyNames\":{\"format\":\"regex\"},\"default\":{}},\"dependencies\":{\"type\":\"object\",\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#\"},{\"$ref\":\"#/definitions/stringArray\"}]}},\"propertyNames\":{\"$ref\":\"#\"},\"const\":true,\"enum\":{\"type\":\"array\",\"items\":true,\"minItems\":1,\"uniqueItems\":true},\"type\":{\"anyOf\":[{\"$ref\":\"#/definitions/simpleTypes\"},{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/simpleTypes\"},\"minItems\":1,\"uniqueItems\":true}]},\"format\":{\"type\":\"string\"},\"contentMediaType\":{\"type\":\"string\"},\"contentEncoding\":{\"type\":\"string\"},\"if\":{\"$ref\":\"#\"},\"then\":{\"$ref\":\"#\"},\"else\":{\"$ref\":\"#\"},\"allOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"anyOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"oneOf\":{\"$ref\":\"#/definitions/schemaArray\"},\"not\":{\"$ref\":\"#\"}},\"default\":true};\n\n//# sourceURL=webpack:///./node_modules/ajv/lib/refs/json-schema-draft-07.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst asn1 = exports;\n\nasn1.bignum = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nasn1.define = __webpack_require__(/*! ./asn1/api */ \"./node_modules/asn1.js/lib/asn1/api.js\").define;\nasn1.base = __webpack_require__(/*! ./asn1/base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\");\nasn1.constants = __webpack_require__(/*! ./asn1/constants */ \"./node_modules/asn1.js/lib/asn1/constants/index.js\");\nasn1.decoders = __webpack_require__(/*! ./asn1/decoders */ \"./node_modules/asn1.js/lib/asn1/decoders/index.js\");\nasn1.encoders = __webpack_require__(/*! ./asn1/encoders */ \"./node_modules/asn1.js/lib/asn1/encoders/index.js\");\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/api.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/api.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst asn1 = __webpack_require__(/*! ../asn1 */ \"./node_modules/asn1.js/lib/asn1.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst api = exports;\n\napi.define = function define(name, body) {\n return new Entity(name, body);\n};\n\nfunction Entity(name, body) {\n this.name = name;\n this.body = body;\n\n this.decoders = {};\n this.encoders = {};\n}\n\nEntity.prototype._createNamed = function createNamed(Base) {\n const name = this.name;\n\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n inherits(Generated, Base);\n Generated.prototype._initNamed = function _initNamed(entity, name) {\n Base.call(this, entity, name);\n };\n\n return new Generated(this);\n};\n\nEntity.prototype._getDecoder = function _getDecoder(enc) {\n enc = enc || 'der';\n // Lazily create decoder\n if (!this.decoders.hasOwnProperty(enc))\n this.decoders[enc] = this._createNamed(asn1.decoders[enc]);\n return this.decoders[enc];\n};\n\nEntity.prototype.decode = function decode(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n};\n\nEntity.prototype._getEncoder = function _getEncoder(enc) {\n enc = enc || 'der';\n // Lazily create encoder\n if (!this.encoders.hasOwnProperty(enc))\n this.encoders[enc] = this._createNamed(asn1.encoders[enc]);\n return this.encoders[enc];\n};\n\nEntity.prototype.encode = function encode(data, enc, /* internal */ reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n};\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/api.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/base/buffer.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst Reporter = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").Reporter;\nconst Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nfunction DecoderBuffer(base, options) {\n Reporter.call(this, options);\n if (!Buffer.isBuffer(base)) {\n this.error('Input not Buffer');\n return;\n }\n\n this.base = base;\n this.offset = 0;\n this.length = base.length;\n}\ninherits(DecoderBuffer, Reporter);\nexports.DecoderBuffer = DecoderBuffer;\n\nDecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) {\n if (data instanceof DecoderBuffer) {\n return true;\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n Buffer.isBuffer(data.base) &&\n data.constructor.name === 'DecoderBuffer' &&\n typeof data.offset === 'number' &&\n typeof data.length === 'number' &&\n typeof data.save === 'function' &&\n typeof data.restore === 'function' &&\n typeof data.isEmpty === 'function' &&\n typeof data.readUInt8 === 'function' &&\n typeof data.skip === 'function' &&\n typeof data.raw === 'function';\n\n return isCompatible;\n};\n\nDecoderBuffer.prototype.save = function save() {\n return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };\n};\n\nDecoderBuffer.prototype.restore = function restore(save) {\n // Return skipped data\n const res = new DecoderBuffer(this.base);\n res.offset = save.offset;\n res.length = this.offset;\n\n this.offset = save.offset;\n Reporter.prototype.restore.call(this, save.reporter);\n\n return res;\n};\n\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\n return this.offset === this.length;\n};\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\n if (this.offset + 1 <= this.length)\n return this.base.readUInt8(this.offset++, true);\n else\n return this.error(fail || 'DecoderBuffer overrun');\n};\n\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || 'DecoderBuffer overrun');\n\n const res = new DecoderBuffer(this.base);\n\n // Share reporter state\n res._reporterState = this._reporterState;\n\n res.offset = this.offset;\n res.length = this.offset + bytes;\n this.offset += bytes;\n return res;\n};\n\nDecoderBuffer.prototype.raw = function raw(save) {\n return this.base.slice(save ? save.offset : this.offset, this.length);\n};\n\nfunction EncoderBuffer(value, reporter) {\n if (Array.isArray(value)) {\n this.length = 0;\n this.value = value.map(function(item) {\n if (!EncoderBuffer.isEncoderBuffer(item))\n item = new EncoderBuffer(item, reporter);\n this.length += item.length;\n return item;\n }, this);\n } else if (typeof value === 'number') {\n if (!(0 <= value && value <= 0xff))\n return reporter.error('non-byte EncoderBuffer value');\n this.value = value;\n this.length = 1;\n } else if (typeof value === 'string') {\n this.value = value;\n this.length = Buffer.byteLength(value);\n } else if (Buffer.isBuffer(value)) {\n this.value = value;\n this.length = value.length;\n } else {\n return reporter.error('Unsupported type: ' + typeof value);\n }\n}\nexports.EncoderBuffer = EncoderBuffer;\n\nEncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) {\n if (data instanceof EncoderBuffer) {\n return true;\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n data.constructor.name === 'EncoderBuffer' &&\n typeof data.length === 'number' &&\n typeof data.join === 'function';\n\n return isCompatible;\n};\n\nEncoderBuffer.prototype.join = function join(out, offset) {\n if (!out)\n out = new Buffer(this.length);\n if (!offset)\n offset = 0;\n\n if (this.length === 0)\n return out;\n\n if (Array.isArray(this.value)) {\n this.value.forEach(function(item) {\n item.join(out, offset);\n offset += item.length;\n });\n } else {\n if (typeof this.value === 'number')\n out[offset] = this.value;\n else if (typeof this.value === 'string')\n out.write(this.value, offset);\n else if (Buffer.isBuffer(this.value))\n this.value.copy(out, offset);\n offset += this.length;\n }\n\n return out;\n};\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/base/buffer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/base/index.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst base = exports;\n\nbase.Reporter = __webpack_require__(/*! ./reporter */ \"./node_modules/asn1.js/lib/asn1/base/reporter.js\").Reporter;\nbase.DecoderBuffer = __webpack_require__(/*! ./buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").DecoderBuffer;\nbase.EncoderBuffer = __webpack_require__(/*! ./buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").EncoderBuffer;\nbase.Node = __webpack_require__(/*! ./node */ \"./node_modules/asn1.js/lib/asn1/base/node.js\");\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/base/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/base/node.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Reporter = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").Reporter;\nconst EncoderBuffer = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").EncoderBuffer;\nconst DecoderBuffer = __webpack_require__(/*! ../base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\").DecoderBuffer;\nconst assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\n// Supported tags\nconst tags = [\n 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n];\n\n// Public methods list\nconst methods = [\n 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n 'any', 'contains'\n].concat(tags);\n\n// Overrided methods list\nconst overrided = [\n '_peekTag', '_decodeTag', '_use',\n '_decodeStr', '_decodeObjid', '_decodeTime',\n '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n '_encodeNull', '_encodeInt', '_encodeBool'\n];\n\nfunction Node(enc, parent, name) {\n const state = {};\n this._baseState = state;\n\n state.name = name;\n state.enc = enc;\n\n state.parent = parent || null;\n state.children = null;\n\n // State\n state.tag = null;\n state.args = null;\n state.reverseArgs = null;\n state.choice = null;\n state.optional = false;\n state.any = false;\n state.obj = false;\n state.use = null;\n state.useDecoder = null;\n state.key = null;\n state['default'] = null;\n state.explicit = null;\n state.implicit = null;\n state.contains = null;\n\n // Should create new instance on each method\n if (!state.parent) {\n state.children = [];\n this._wrap();\n }\n}\nmodule.exports = Node;\n\nconst stateProps = [\n 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n 'implicit', 'contains'\n];\n\nNode.prototype.clone = function clone() {\n const state = this._baseState;\n const cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n const res = new this.constructor(cstate.parent);\n res._baseState = cstate;\n return res;\n};\n\nNode.prototype._wrap = function wrap() {\n const state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function _wrappedMethod() {\n const clone = new this.constructor(this);\n state.children.push(clone);\n return clone[method].apply(clone, arguments);\n };\n }, this);\n};\n\nNode.prototype._init = function init(body) {\n const state = this._baseState;\n\n assert(state.parent === null);\n body.call(this);\n\n // Filter children\n state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this);\n assert.equal(state.children.length, 1, 'Root node can have only one child');\n};\n\nNode.prototype._useArgs = function useArgs(args) {\n const state = this._baseState;\n\n // Filter children and args\n const children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this);\n\n if (children.length !== 0) {\n assert(state.children === null);\n state.children = children;\n\n // Replace parent to maintain backward link\n children.forEach(function(child) {\n child._baseState.parent = this;\n }, this);\n }\n if (args.length !== 0) {\n assert(state.args === null);\n state.args = args;\n state.reverseArgs = args.map(function(arg) {\n if (typeof arg !== 'object' || arg.constructor !== Object)\n return arg;\n\n const res = {};\n Object.keys(arg).forEach(function(key) {\n if (key == (key | 0))\n key |= 0;\n const value = arg[key];\n res[value] = key;\n });\n return res;\n });\n }\n};\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function(method) {\n Node.prototype[method] = function _overrided() {\n const state = this._baseState;\n throw new Error(method + ' not implemented for encoding: ' + state.enc);\n };\n});\n\n//\n// Public methods\n//\n\ntags.forEach(function(tag) {\n Node.prototype[tag] = function _tagMethod() {\n const state = this._baseState;\n const args = Array.prototype.slice.call(arguments);\n\n assert(state.tag === null);\n state.tag = tag;\n\n this._useArgs(args);\n\n return this;\n };\n});\n\nNode.prototype.use = function use(item) {\n assert(item);\n const state = this._baseState;\n\n assert(state.use === null);\n state.use = item;\n\n return this;\n};\n\nNode.prototype.optional = function optional() {\n const state = this._baseState;\n\n state.optional = true;\n\n return this;\n};\n\nNode.prototype.def = function def(val) {\n const state = this._baseState;\n\n assert(state['default'] === null);\n state['default'] = val;\n state.optional = true;\n\n return this;\n};\n\nNode.prototype.explicit = function explicit(num) {\n const state = this._baseState;\n\n assert(state.explicit === null && state.implicit === null);\n state.explicit = num;\n\n return this;\n};\n\nNode.prototype.implicit = function implicit(num) {\n const state = this._baseState;\n\n assert(state.explicit === null && state.implicit === null);\n state.implicit = num;\n\n return this;\n};\n\nNode.prototype.obj = function obj() {\n const state = this._baseState;\n const args = Array.prototype.slice.call(arguments);\n\n state.obj = true;\n\n if (args.length !== 0)\n this._useArgs(args);\n\n return this;\n};\n\nNode.prototype.key = function key(newKey) {\n const state = this._baseState;\n\n assert(state.key === null);\n state.key = newKey;\n\n return this;\n};\n\nNode.prototype.any = function any() {\n const state = this._baseState;\n\n state.any = true;\n\n return this;\n};\n\nNode.prototype.choice = function choice(obj) {\n const state = this._baseState;\n\n assert(state.choice === null);\n state.choice = obj;\n this._useArgs(Object.keys(obj).map(function(key) {\n return obj[key];\n }));\n\n return this;\n};\n\nNode.prototype.contains = function contains(item) {\n const state = this._baseState;\n\n assert(state.use === null);\n state.contains = item;\n\n return this;\n};\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode(input, options) {\n const state = this._baseState;\n\n // Decode root node\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n\n let result = state['default'];\n let present = true;\n\n let prevKey = null;\n if (state.key !== null)\n prevKey = input.enterKey(state.key);\n\n // Check if tag is there\n if (state.optional) {\n let tag = null;\n if (state.explicit !== null)\n tag = state.explicit;\n else if (state.implicit !== null)\n tag = state.implicit;\n else if (state.tag !== null)\n tag = state.tag;\n\n if (tag === null && !state.any) {\n // Trial and Error\n const save = input.save();\n try {\n if (state.choice === null)\n this._decodeGeneric(state.tag, input, options);\n else\n this._decodeChoice(input, options);\n present = true;\n } catch (e) {\n present = false;\n }\n input.restore(save);\n } else {\n present = this._peekTag(input, tag, state.any);\n\n if (input.isError(present))\n return present;\n }\n }\n\n // Push object on stack\n let prevObj;\n if (state.obj && present)\n prevObj = input.enterObject();\n\n if (present) {\n // Unwrap explicit values\n if (state.explicit !== null) {\n const explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n\n const start = input.offset;\n\n // Unwrap implicit and normal values\n if (state.use === null && state.choice === null) {\n let save;\n if (state.any)\n save = input.save();\n const body = this._decodeTag(\n input,\n state.implicit !== null ? state.implicit : state.tag,\n state.any\n );\n if (input.isError(body))\n return body;\n\n if (state.any)\n result = input.raw(save);\n else\n input = body;\n }\n\n if (options && options.track && state.tag !== null)\n options.track(input.path(), start, input.length, 'tagged');\n\n if (options && options.track && state.tag !== null)\n options.track(input.path(), input.offset, input.length, 'content');\n\n // Select proper method for tag\n if (state.any) {\n // no-op\n } else if (state.choice === null) {\n result = this._decodeGeneric(state.tag, input, options);\n } else {\n result = this._decodeChoice(input, options);\n }\n\n if (input.isError(result))\n return result;\n\n // Decode children\n if (!state.any && state.choice === null && state.children !== null) {\n state.children.forEach(function decodeChildren(child) {\n // NOTE: We are ignoring errors here, to let parser continue with other\n // parts of encoded data\n child._decode(input, options);\n });\n }\n\n // Decode contained/encoded by schema, only in bit or octet strings\n if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n const data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)\n ._decode(data, options);\n }\n }\n\n // Pop object\n if (state.obj && present)\n result = input.leaveObject(prevObj);\n\n // Set key\n if (state.key !== null && (result !== null || present === true))\n input.leaveKey(prevKey, state.key, result);\n else if (prevKey !== null)\n input.exitKey(prevKey);\n\n return result;\n};\n\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\n const state = this._baseState;\n\n if (tag === 'seq' || tag === 'set')\n return null;\n if (tag === 'seqof' || tag === 'setof')\n return this._decodeList(input, tag, state.args[0], options);\n else if (/str$/.test(tag))\n return this._decodeStr(input, tag, options);\n else if (tag === 'objid' && state.args)\n return this._decodeObjid(input, state.args[0], state.args[1], options);\n else if (tag === 'objid')\n return this._decodeObjid(input, null, null, options);\n else if (tag === 'gentime' || tag === 'utctime')\n return this._decodeTime(input, tag, options);\n else if (tag === 'null_')\n return this._decodeNull(input, options);\n else if (tag === 'bool')\n return this._decodeBool(input, options);\n else if (tag === 'objDesc')\n return this._decodeStr(input, tag, options);\n else if (tag === 'int' || tag === 'enum')\n return this._decodeInt(input, state.args && state.args[0], options);\n\n if (state.use !== null) {\n return this._getUse(state.use, input._reporterState.obj)\n ._decode(input, options);\n } else {\n return input.error('unknown tag: ' + tag);\n }\n};\n\nNode.prototype._getUse = function _getUse(entity, obj) {\n\n const state = this._baseState;\n // Create altered use decoder if implicit is set\n state.useDecoder = this._use(entity, obj);\n assert(state.useDecoder._baseState.parent === null);\n state.useDecoder = state.useDecoder._baseState.children[0];\n if (state.implicit !== state.useDecoder._baseState.implicit) {\n state.useDecoder = state.useDecoder.clone();\n state.useDecoder._baseState.implicit = state.implicit;\n }\n return state.useDecoder;\n};\n\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\n const state = this._baseState;\n let result = null;\n let match = false;\n\n Object.keys(state.choice).some(function(key) {\n const save = input.save();\n const node = state.choice[key];\n try {\n const value = node._decode(input, options);\n if (input.isError(value))\n return false;\n\n result = { type: key, value: value };\n match = true;\n } catch (e) {\n input.restore(save);\n return false;\n }\n return true;\n }, this);\n\n if (!match)\n return input.error('Choice not matched');\n\n return result;\n};\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\n return new EncoderBuffer(data, this.reporter);\n};\n\nNode.prototype._encode = function encode(data, reporter, parent) {\n const state = this._baseState;\n if (state['default'] !== null && state['default'] === data)\n return;\n\n const result = this._encodeValue(data, reporter, parent);\n if (result === undefined)\n return;\n\n if (this._skipDefault(result, reporter, parent))\n return;\n\n return result;\n};\n\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\n const state = this._baseState;\n\n // Decode root node\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter());\n\n let result = null;\n\n // Set reporter to share it with a child class\n this.reporter = reporter;\n\n // Check if data is there\n if (state.optional && data === undefined) {\n if (state['default'] !== null)\n data = state['default'];\n else\n return;\n }\n\n // Encode children first\n let content = null;\n let primitive = false;\n if (state.any) {\n // Anything that was given is translated to buffer\n result = this._createEncoderBuffer(data);\n } else if (state.choice) {\n result = this._encodeChoice(data, reporter);\n } else if (state.contains) {\n content = this._getUse(state.contains, parent)._encode(data, reporter);\n primitive = true;\n } else if (state.children) {\n content = state.children.map(function(child) {\n if (child._baseState.tag === 'null_')\n return child._encode(null, reporter, data);\n\n if (child._baseState.key === null)\n return reporter.error('Child should have a key');\n const prevKey = reporter.enterKey(child._baseState.key);\n\n if (typeof data !== 'object')\n return reporter.error('Child expected, but input is not object');\n\n const res = child._encode(data[child._baseState.key], reporter, data);\n reporter.leaveKey(prevKey);\n\n return res;\n }, this).filter(function(child) {\n return child;\n });\n content = this._createEncoderBuffer(content);\n } else {\n if (state.tag === 'seqof' || state.tag === 'setof') {\n // TODO(indutny): this should be thrown on DSL level\n if (!(state.args && state.args.length === 1))\n return reporter.error('Too many args for : ' + state.tag);\n\n if (!Array.isArray(data))\n return reporter.error('seqof/setof, but data is not Array');\n\n const child = this.clone();\n child._baseState.implicit = null;\n content = this._createEncoderBuffer(data.map(function(item) {\n const state = this._baseState;\n\n return this._getUse(state.args[0], data)._encode(item, reporter);\n }, child));\n } else if (state.use !== null) {\n result = this._getUse(state.use, parent)._encode(data, reporter);\n } else {\n content = this._encodePrimitive(state.tag, data);\n primitive = true;\n }\n }\n\n // Encode data itself\n if (!state.any && state.choice === null) {\n const tag = state.implicit !== null ? state.implicit : state.tag;\n const cls = state.implicit === null ? 'universal' : 'context';\n\n if (tag === null) {\n if (state.use === null)\n reporter.error('Tag could be omitted only for .use()');\n } else {\n if (state.use === null)\n result = this._encodeComposite(tag, primitive, cls, content);\n }\n }\n\n // Wrap in explicit\n if (state.explicit !== null)\n result = this._encodeComposite(state.explicit, false, 'context', result);\n\n return result;\n};\n\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\n const state = this._baseState;\n\n const node = state.choice[data.type];\n if (!node) {\n assert(\n false,\n data.type + ' not found in ' +\n JSON.stringify(Object.keys(state.choice)));\n }\n return node._encode(data.value, reporter);\n};\n\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\n const state = this._baseState;\n\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n else if (tag === 'objid' && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n else if (tag === 'objid')\n return this._encodeObjid(data, null, null);\n else if (tag === 'gentime' || tag === 'utctime')\n return this._encodeTime(data, tag);\n else if (tag === 'null_')\n return this._encodeNull();\n else if (tag === 'int' || tag === 'enum')\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n else if (tag === 'bool')\n return this._encodeBool(data);\n else if (tag === 'objDesc')\n return this._encodeStr(data, tag);\n else\n throw new Error('Unsupported tag: ' + tag);\n};\n\nNode.prototype._isNumstr = function isNumstr(str) {\n return /^[0-9 ]*$/.test(str);\n};\n\nNode.prototype._isPrintstr = function isPrintstr(str) {\n return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str);\n};\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/base/node.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/base/reporter.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n}\nexports.Reporter = Reporter;\n\nReporter.prototype.isError = function isError(obj) {\n return obj instanceof ReporterError;\n};\n\nReporter.prototype.save = function save() {\n const state = this._reporterState;\n\n return { obj: state.obj, pathLen: state.path.length };\n};\n\nReporter.prototype.restore = function restore(data) {\n const state = this._reporterState;\n\n state.obj = data.obj;\n state.path = state.path.slice(0, data.pathLen);\n};\n\nReporter.prototype.enterKey = function enterKey(key) {\n return this._reporterState.path.push(key);\n};\n\nReporter.prototype.exitKey = function exitKey(index) {\n const state = this._reporterState;\n\n state.path = state.path.slice(0, index - 1);\n};\n\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\n const state = this._reporterState;\n\n this.exitKey(index);\n if (state.obj !== null)\n state.obj[key] = value;\n};\n\nReporter.prototype.path = function path() {\n return this._reporterState.path.join('/');\n};\n\nReporter.prototype.enterObject = function enterObject() {\n const state = this._reporterState;\n\n const prev = state.obj;\n state.obj = {};\n return prev;\n};\n\nReporter.prototype.leaveObject = function leaveObject(prev) {\n const state = this._reporterState;\n\n const now = state.obj;\n state.obj = prev;\n return now;\n};\n\nReporter.prototype.error = function error(msg) {\n let err;\n const state = this._reporterState;\n\n const inherited = msg instanceof ReporterError;\n if (inherited) {\n err = msg;\n } else {\n err = new ReporterError(state.path.map(function(elem) {\n return '[' + JSON.stringify(elem) + ']';\n }).join(''), msg.message || msg, msg.stack);\n }\n\n if (!state.options.partial)\n throw err;\n\n if (!inherited)\n state.errors.push(err);\n\n return err;\n};\n\nReporter.prototype.wrapResult = function wrapResult(result) {\n const state = this._reporterState;\n if (!state.options.partial)\n return result;\n\n return {\n result: this.isError(result) ? null : result,\n errors: state.errors\n };\n};\n\nfunction ReporterError(path, msg) {\n this.path = path;\n this.rethrow(msg);\n}\ninherits(ReporterError, Error);\n\nReporterError.prototype.rethrow = function rethrow(msg) {\n this.message = msg + ' at: ' + (this.path || '(shallow)');\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, ReporterError);\n\n if (!this.stack) {\n try {\n // IE only adds stack when thrown\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n }\n return this;\n};\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/base/reporter.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/constants/der.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst constants = __webpack_require__(/*! ../constants */ \"./node_modules/asn1.js/lib/asn1/constants/index.js\");\n\nexports.tagClass = {\n 0: 'universal',\n 1: 'application',\n 2: 'context',\n 3: 'private'\n};\nexports.tagClassByName = constants._reverse(exports.tagClass);\n\nexports.tag = {\n 0x00: 'end',\n 0x01: 'bool',\n 0x02: 'int',\n 0x03: 'bitstr',\n 0x04: 'octstr',\n 0x05: 'null_',\n 0x06: 'objid',\n 0x07: 'objDesc',\n 0x08: 'external',\n 0x09: 'real',\n 0x0a: 'enum',\n 0x0b: 'embed',\n 0x0c: 'utf8str',\n 0x0d: 'relativeOid',\n 0x10: 'seq',\n 0x11: 'set',\n 0x12: 'numstr',\n 0x13: 'printstr',\n 0x14: 't61str',\n 0x15: 'videostr',\n 0x16: 'ia5str',\n 0x17: 'utctime',\n 0x18: 'gentime',\n 0x19: 'graphstr',\n 0x1a: 'iso646str',\n 0x1b: 'genstr',\n 0x1c: 'unistr',\n 0x1d: 'charstr',\n 0x1e: 'bmpstr'\n};\nexports.tagByName = constants._reverse(exports.tag);\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/constants/der.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/constants/index.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst constants = exports;\n\n// Helper\nconstants._reverse = function reverse(map) {\n const res = {};\n\n Object.keys(map).forEach(function(key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key)\n key = key | 0;\n\n const value = map[key];\n res[value] = key;\n });\n\n return res;\n};\n\nconstants.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/constants/der.js\");\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/constants/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/decoders/der.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst asn1 = __webpack_require__(/*! ../../asn1 */ \"./node_modules/asn1.js/lib/asn1.js\");\nconst base = asn1.base;\nconst bignum = asn1.bignum;\n\n// Import DER constants\nconst der = asn1.constants.der;\n\nfunction DERDecoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity;\n\n // Construct base tree\n this.tree = new DERNode();\n this.tree._init(entity.body);\n}\nmodule.exports = DERDecoder;\n\nDERDecoder.prototype.decode = function decode(data, options) {\n if (!base.DecoderBuffer.isDecoderBuffer(data)) {\n data = new base.DecoderBuffer(data, options);\n }\n\n return this.tree._decode(data, options);\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\n if (buffer.isEmpty())\n return false;\n\n const state = buffer.save();\n const decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n\n buffer.restore(state);\n\n return decodedTag.tag === tag || decodedTag.tagStr === tag ||\n (decodedTag.tagStr + 'of') === tag || any;\n};\n\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\n const decodedTag = derDecodeTag(buffer,\n 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n\n let len = derDecodeLen(buffer,\n decodedTag.primitive,\n 'Failed to get length of \"' + tag + '\"');\n\n // Failure\n if (buffer.isError(len))\n return len;\n\n if (!any &&\n decodedTag.tag !== tag &&\n decodedTag.tagStr !== tag &&\n decodedTag.tagStr + 'of' !== tag) {\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n }\n\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n\n // Indefinite length... find END tag\n const state = buffer.save();\n const res = this._skipUntilEnd(\n buffer,\n 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n if (buffer.isError(res))\n return res;\n\n len = buffer.offset - state.offset;\n buffer.restore(state);\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n};\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\n for (;;) {\n const tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n const len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n\n let res;\n if (tag.primitive || len !== null)\n res = buffer.skip(len);\n else\n res = this._skipUntilEnd(buffer, fail);\n\n // Failure\n if (buffer.isError(res))\n return res;\n\n if (tag.tagStr === 'end')\n break;\n }\n};\n\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,\n options) {\n const result = [];\n while (!buffer.isEmpty()) {\n const possibleEnd = this._peekTag(buffer, 'end');\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n\n const res = decoder.decode(buffer, 'der', options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n};\n\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\n if (tag === 'bitstr') {\n const unused = buffer.readUInt8();\n if (buffer.isError(unused))\n return unused;\n return { unused: unused, data: buffer.raw() };\n } else if (tag === 'bmpstr') {\n const raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error('Decoding of string type: bmpstr length mismatch');\n\n let str = '';\n for (let i = 0; i < raw.length / 2; i++) {\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n }\n return str;\n } else if (tag === 'numstr') {\n const numstr = buffer.raw().toString('ascii');\n if (!this._isNumstr(numstr)) {\n return buffer.error('Decoding of string type: ' +\n 'numstr unsupported characters');\n }\n return numstr;\n } else if (tag === 'octstr') {\n return buffer.raw();\n } else if (tag === 'objDesc') {\n return buffer.raw();\n } else if (tag === 'printstr') {\n const printstr = buffer.raw().toString('ascii');\n if (!this._isPrintstr(printstr)) {\n return buffer.error('Decoding of string type: ' +\n 'printstr unsupported characters');\n }\n return printstr;\n } else if (/str$/.test(tag)) {\n return buffer.raw().toString();\n } else {\n return buffer.error('Decoding of string type: ' + tag + ' unsupported');\n }\n};\n\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\n let result;\n const identifiers = [];\n let ident = 0;\n let subident = 0;\n while (!buffer.isEmpty()) {\n subident = buffer.readUInt8();\n ident <<= 7;\n ident |= subident & 0x7f;\n if ((subident & 0x80) === 0) {\n identifiers.push(ident);\n ident = 0;\n }\n }\n if (subident & 0x80)\n identifiers.push(ident);\n\n const first = (identifiers[0] / 40) | 0;\n const second = identifiers[0] % 40;\n\n if (relative)\n result = identifiers;\n else\n result = [first, second].concat(identifiers.slice(1));\n\n if (values) {\n let tmp = values[result.join(' ')];\n if (tmp === undefined)\n tmp = values[result.join('.')];\n if (tmp !== undefined)\n result = tmp;\n }\n\n return result;\n};\n\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\n const str = buffer.raw().toString();\n\n let year;\n let mon;\n let day;\n let hour;\n let min;\n let sec;\n if (tag === 'gentime') {\n year = str.slice(0, 4) | 0;\n mon = str.slice(4, 6) | 0;\n day = str.slice(6, 8) | 0;\n hour = str.slice(8, 10) | 0;\n min = str.slice(10, 12) | 0;\n sec = str.slice(12, 14) | 0;\n } else if (tag === 'utctime') {\n year = str.slice(0, 2) | 0;\n mon = str.slice(2, 4) | 0;\n day = str.slice(4, 6) | 0;\n hour = str.slice(6, 8) | 0;\n min = str.slice(8, 10) | 0;\n sec = str.slice(10, 12) | 0;\n if (year < 70)\n year = 2000 + year;\n else\n year = 1900 + year;\n } else {\n return buffer.error('Decoding ' + tag + ' time is not supported yet');\n }\n\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n};\n\nDERNode.prototype._decodeNull = function decodeNull() {\n return null;\n};\n\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\n const res = buffer.readUInt8();\n if (buffer.isError(res))\n return res;\n else\n return res !== 0;\n};\n\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\n // Bigint, return as it is (assume big endian)\n const raw = buffer.raw();\n let res = new bignum(raw);\n\n if (values)\n res = values[res.toString(10)] || res;\n\n return res;\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function')\n entity = entity(obj);\n return entity._getDecoder('der').tree;\n};\n\n// Utility methods\n\nfunction derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n\n const cls = der.tagClass[tag >> 6];\n const primitive = (tag & 0x20) === 0;\n\n // Multi-octet tag - load\n if ((tag & 0x1f) === 0x1f) {\n let oct = tag;\n tag = 0;\n while ((oct & 0x80) === 0x80) {\n oct = buf.readUInt8(fail);\n if (buf.isError(oct))\n return oct;\n\n tag <<= 7;\n tag |= oct & 0x7f;\n }\n } else {\n tag &= 0x1f;\n }\n const tagStr = der.tag[tag];\n\n return {\n cls: cls,\n primitive: primitive,\n tag: tag,\n tagStr: tagStr\n };\n}\n\nfunction derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n\n // Indefinite form\n if (!primitive && len === 0x80)\n return null;\n\n // Definite form\n if ((len & 0x80) === 0) {\n // Short form\n return len;\n }\n\n // Long form\n const num = len & 0x7f;\n if (num > 4)\n return buf.error('length octect is too long');\n\n len = 0;\n for (let i = 0; i < num; i++) {\n len <<= 8;\n const j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n\n return len;\n}\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/decoders/der.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/decoders/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst decoders = exports;\n\ndecoders.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/decoders/der.js\");\ndecoders.pem = __webpack_require__(/*! ./pem */ \"./node_modules/asn1.js/lib/asn1/decoders/pem.js\");\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/decoders/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/decoders/pem.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nconst DERDecoder = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/decoders/der.js\");\n\nfunction PEMDecoder(entity) {\n DERDecoder.call(this, entity);\n this.enc = 'pem';\n}\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n const lines = data.toString().split(/[\\r\\n]+/g);\n\n const label = options.label.toUpperCase();\n\n const re = /^-----(BEGIN|END) ([^-]+)-----$/;\n let start = -1;\n let end = -1;\n for (let i = 0; i < lines.length; i++) {\n const match = lines[i].match(re);\n if (match === null)\n continue;\n\n if (match[2] !== label)\n continue;\n\n if (start === -1) {\n if (match[1] !== 'BEGIN')\n break;\n start = i;\n } else {\n if (match[1] !== 'END')\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error('PEM section not found for: ' + label);\n\n const base64 = lines.slice(start + 1, end).join('');\n // Remove excessive symbols\n base64.replace(/[^a-z0-9+/=]+/gi, '');\n\n const input = new Buffer(base64, 'base64');\n return DERDecoder.prototype.decode.call(this, input, options);\n};\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/decoders/pem.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/encoders/der.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nconst asn1 = __webpack_require__(/*! ../../asn1 */ \"./node_modules/asn1.js/lib/asn1.js\");\nconst base = asn1.base;\n\n// Import DER constants\nconst der = asn1.constants.der;\n\nfunction DEREncoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity;\n\n // Construct base tree\n this.tree = new DERNode();\n this.tree._init(entity.body);\n}\nmodule.exports = DEREncoder;\n\nDEREncoder.prototype.encode = function encode(data, reporter) {\n return this.tree._encode(data, reporter).join();\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._encodeComposite = function encodeComposite(tag,\n primitive,\n cls,\n content) {\n const encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n\n // Short form\n if (content.length < 0x80) {\n const header = new Buffer(2);\n header[0] = encodedTag;\n header[1] = content.length;\n return this._createEncoderBuffer([ header, content ]);\n }\n\n // Long form\n // Count octets required to store length\n let lenOctets = 1;\n for (let i = content.length; i >= 0x100; i >>= 8)\n lenOctets++;\n\n const header = new Buffer(1 + 1 + lenOctets);\n header[0] = encodedTag;\n header[1] = 0x80 | lenOctets;\n\n for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)\n header[i] = j & 0xff;\n\n return this._createEncoderBuffer([ header, content ]);\n};\n\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\n if (tag === 'bitstr') {\n return this._createEncoderBuffer([ str.unused | 0, str.data ]);\n } else if (tag === 'bmpstr') {\n const buf = new Buffer(str.length * 2);\n for (let i = 0; i < str.length; i++) {\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n }\n return this._createEncoderBuffer(buf);\n } else if (tag === 'numstr') {\n if (!this._isNumstr(str)) {\n return this.reporter.error('Encoding of string type: numstr supports ' +\n 'only digits and space');\n }\n return this._createEncoderBuffer(str);\n } else if (tag === 'printstr') {\n if (!this._isPrintstr(str)) {\n return this.reporter.error('Encoding of string type: printstr supports ' +\n 'only latin upper and lower case letters, ' +\n 'digits, space, apostrophe, left and rigth ' +\n 'parenthesis, plus sign, comma, hyphen, ' +\n 'dot, slash, colon, equal sign, ' +\n 'question mark');\n }\n return this._createEncoderBuffer(str);\n } else if (/str$/.test(tag)) {\n return this._createEncoderBuffer(str);\n } else if (tag === 'objDesc') {\n return this._createEncoderBuffer(str);\n } else {\n return this.reporter.error('Encoding of string type: ' + tag +\n ' unsupported');\n }\n};\n\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\n if (typeof id === 'string') {\n if (!values)\n return this.reporter.error('string objid given, but no values map found');\n if (!values.hasOwnProperty(id))\n return this.reporter.error('objid not found in values map');\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0; i < id.length; i++)\n id[i] |= 0;\n } else if (Array.isArray(id)) {\n id = id.slice();\n for (let i = 0; i < id.length; i++)\n id[i] |= 0;\n }\n\n if (!Array.isArray(id)) {\n return this.reporter.error('objid() should be either array or string, ' +\n 'got: ' + JSON.stringify(id));\n }\n\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error('Second objid identifier OOB');\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n\n // Count number of octets\n let size = 0;\n for (let i = 0; i < id.length; i++) {\n let ident = id[i];\n for (size++; ident >= 0x80; ident >>= 7)\n size++;\n }\n\n const objid = new Buffer(size);\n let offset = objid.length - 1;\n for (let i = id.length - 1; i >= 0; i--) {\n let ident = id[i];\n objid[offset--] = ident & 0x7f;\n while ((ident >>= 7) > 0)\n objid[offset--] = 0x80 | (ident & 0x7f);\n }\n\n return this._createEncoderBuffer(objid);\n};\n\nfunction two(num) {\n if (num < 10)\n return '0' + num;\n else\n return num;\n}\n\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\n let str;\n const date = new Date(time);\n\n if (tag === 'gentime') {\n str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('');\n } else if (tag === 'utctime') {\n str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('');\n } else {\n this.reporter.error('Encoding ' + tag + ' time is not supported yet');\n }\n\n return this._encodeStr(str, 'octstr');\n};\n\nDERNode.prototype._encodeNull = function encodeNull() {\n return this._createEncoderBuffer('');\n};\n\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\n if (typeof num === 'string') {\n if (!values)\n return this.reporter.error('String int or enum given, but no values map');\n if (!values.hasOwnProperty(num)) {\n return this.reporter.error('Values map doesn\\'t contain: ' +\n JSON.stringify(num));\n }\n num = values[num];\n }\n\n // Bignum, assume big endian\n if (typeof num !== 'number' && !Buffer.isBuffer(num)) {\n const numArray = num.toArray();\n if (!num.sign && numArray[0] & 0x80) {\n numArray.unshift(0);\n }\n num = new Buffer(numArray);\n }\n\n if (Buffer.isBuffer(num)) {\n let size = num.length;\n if (num.length === 0)\n size++;\n\n const out = new Buffer(size);\n num.copy(out);\n if (num.length === 0)\n out[0] = 0;\n return this._createEncoderBuffer(out);\n }\n\n if (num < 0x80)\n return this._createEncoderBuffer(num);\n\n if (num < 0x100)\n return this._createEncoderBuffer([0, num]);\n\n let size = 1;\n for (let i = num; i >= 0x100; i >>= 8)\n size++;\n\n const out = new Array(size);\n for (let i = out.length - 1; i >= 0; i--) {\n out[i] = num & 0xff;\n num >>= 8;\n }\n if(out[0] & 0x80) {\n out.unshift(0);\n }\n\n return this._createEncoderBuffer(new Buffer(out));\n};\n\nDERNode.prototype._encodeBool = function encodeBool(value) {\n return this._createEncoderBuffer(value ? 0xff : 0);\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function')\n entity = entity(obj);\n return entity._getEncoder('der').tree;\n};\n\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\n const state = this._baseState;\n let i;\n if (state['default'] === null)\n return false;\n\n const data = dataBuffer.join();\n if (state.defaultBuffer === undefined)\n state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();\n\n if (data.length !== state.defaultBuffer.length)\n return false;\n\n for (i=0; i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return false;\n\n return true;\n};\n\n// Utility methods\n\nfunction encodeTag(tag, primitive, cls, reporter) {\n let res;\n\n if (tag === 'seqof')\n tag = 'seq';\n else if (tag === 'setof')\n tag = 'set';\n\n if (der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag === 'number' && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error('Unknown tag: ' + tag);\n\n if (res >= 0x1f)\n return reporter.error('Multi-octet tag encoding unsupported');\n\n if (!primitive)\n res |= 0x20;\n\n res |= (der.tagClassByName[cls || 'universal'] << 6);\n\n return res;\n}\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/encoders/der.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/encoders/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst encoders = exports;\n\nencoders.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/encoders/der.js\");\nencoders.pem = __webpack_require__(/*! ./pem */ \"./node_modules/asn1.js/lib/asn1/encoders/pem.js\");\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/encoders/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/asn1.js/lib/asn1/encoders/pem.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst DEREncoder = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/encoders/der.js\");\n\nfunction PEMEncoder(entity) {\n DEREncoder.call(this, entity);\n this.enc = 'pem';\n}\ninherits(PEMEncoder, DEREncoder);\nmodule.exports = PEMEncoder;\n\nPEMEncoder.prototype.encode = function encode(data, options) {\n const buf = DEREncoder.prototype.encode.call(this, data);\n\n const p = buf.toString('base64');\n const out = [ '-----BEGIN ' + options.label + '-----' ];\n for (let i = 0; i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n out.push('-----END ' + options.label + '-----');\n return out.join('\\n');\n};\n\n\n//# sourceURL=webpack:///./node_modules/asn1.js/lib/asn1/encoders/pem.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/assert-plus/assert.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/assert-plus/assert.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {// Copyright (c) 2012, Mark Cavage. All rights reserved.\n// Copyright 2015 Joyent, Inc.\n\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\nvar Stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Stream;\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\n\n///--- Globals\n\n/* JSSTYLED */\nvar UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;\n\n\n///--- Internal\n\nfunction _capitalize(str) {\n return (str.charAt(0).toUpperCase() + str.slice(1));\n}\n\nfunction _toss(name, expected, oper, arg, actual) {\n throw new assert.AssertionError({\n message: util.format('%s (%s) is required', name, expected),\n actual: (actual === undefined) ? typeof (arg) : actual(arg),\n expected: expected,\n operator: oper || '===',\n stackStartFunction: _toss.caller\n });\n}\n\nfunction _getClass(arg) {\n return (Object.prototype.toString.call(arg).slice(8, -1));\n}\n\nfunction noop() {\n // Why even bother with asserts?\n}\n\n\n///--- Exports\n\nvar types = {\n bool: {\n check: function (arg) { return typeof (arg) === 'boolean'; }\n },\n func: {\n check: function (arg) { return typeof (arg) === 'function'; }\n },\n string: {\n check: function (arg) { return typeof (arg) === 'string'; }\n },\n object: {\n check: function (arg) {\n return typeof (arg) === 'object' && arg !== null;\n }\n },\n number: {\n check: function (arg) {\n return typeof (arg) === 'number' && !isNaN(arg);\n }\n },\n finite: {\n check: function (arg) {\n return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);\n }\n },\n buffer: {\n check: function (arg) { return Buffer.isBuffer(arg); },\n operator: 'Buffer.isBuffer'\n },\n array: {\n check: function (arg) { return Array.isArray(arg); },\n operator: 'Array.isArray'\n },\n stream: {\n check: function (arg) { return arg instanceof Stream; },\n operator: 'instanceof',\n actual: _getClass\n },\n date: {\n check: function (arg) { return arg instanceof Date; },\n operator: 'instanceof',\n actual: _getClass\n },\n regexp: {\n check: function (arg) { return arg instanceof RegExp; },\n operator: 'instanceof',\n actual: _getClass\n },\n uuid: {\n check: function (arg) {\n return typeof (arg) === 'string' && UUID_REGEXP.test(arg);\n },\n operator: 'isUUID'\n }\n};\n\nfunction _setExports(ndebug) {\n var keys = Object.keys(types);\n var out;\n\n /* re-export standard assert */\n if (process.env.NODE_NDEBUG) {\n out = noop;\n } else {\n out = function (arg, msg) {\n if (!arg) {\n _toss(msg, 'true', arg);\n }\n };\n }\n\n /* standard checks */\n keys.forEach(function (k) {\n if (ndebug) {\n out[k] = noop;\n return;\n }\n var type = types[k];\n out[k] = function (arg, msg) {\n if (!type.check(arg)) {\n _toss(msg, k, type.operator, arg, type.actual);\n }\n };\n });\n\n /* optional checks */\n keys.forEach(function (k) {\n var name = 'optional' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n out[name] = function (arg, msg) {\n if (arg === undefined || arg === null) {\n return;\n }\n if (!type.check(arg)) {\n _toss(msg, k, type.operator, arg, type.actual);\n }\n };\n });\n\n /* arrayOf checks */\n keys.forEach(function (k) {\n var name = 'arrayOf' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n var expected = '[' + k + ']';\n out[name] = function (arg, msg) {\n if (!Array.isArray(arg)) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n var i;\n for (i = 0; i < arg.length; i++) {\n if (!type.check(arg[i])) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n }\n };\n });\n\n /* optionalArrayOf checks */\n keys.forEach(function (k) {\n var name = 'optionalArrayOf' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n var expected = '[' + k + ']';\n out[name] = function (arg, msg) {\n if (arg === undefined || arg === null) {\n return;\n }\n if (!Array.isArray(arg)) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n var i;\n for (i = 0; i < arg.length; i++) {\n if (!type.check(arg[i])) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n }\n };\n });\n\n /* re-export built-in assertions */\n Object.keys(assert).forEach(function (k) {\n if (k === 'AssertionError') {\n out[k] = assert[k];\n return;\n }\n if (ndebug) {\n out[k] = noop;\n return;\n }\n out[k] = assert[k];\n });\n\n /* export ourselves (for unit tests _only_) */\n out._setExports = _setExports;\n\n return out;\n}\n\nmodule.exports = _setExports(process.env.NODE_NDEBUG);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/assert-plus/assert.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/assert/assert.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/assert/assert.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {\n\nvar objectAssign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\n\n// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nfunction isBuffer(b) {\n if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {\n return global.Buffer.isBuffer(b);\n }\n return !!(b != null && b._isBuffer);\n}\n\n// based on node assert, original notice:\n// NB: The URL to the CommonJS spec is kept just for tradition.\n// node-assert has evolved a lot since then, both in API and behavior.\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar util = __webpack_require__(/*! util/ */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar pSlice = Array.prototype.slice;\nvar functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n}());\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!util.isFunction(func)) {\n return;\n }\n if (functionsHaveNames) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames || !util.isFunction(something)) {\n return util.inspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);\n }\n};\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (util.isPrimitive(a) || util.isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && util.isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n};\n\nassert.ifError = function(err) { if (err) throw err; };\n\n// Expose a strict only variant of assert\nfunction strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/assert/assert.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/asyncify.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/async/asyncify.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = asyncify;\n\nvar _isObject = __webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\");\n\nvar _isObject2 = _interopRequireDefault(_isObject);\n\nvar _initialParams = __webpack_require__(/*! ./internal/initialParams */ \"./node_modules/async/internal/initialParams.js\");\n\nvar _initialParams2 = _interopRequireDefault(_initialParams);\n\nvar _setImmediate = __webpack_require__(/*! ./internal/setImmediate */ \"./node_modules/async/internal/setImmediate.js\");\n\nvar _setImmediate2 = _interopRequireDefault(_setImmediate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(JSON.parse),\n * function (data, next) {\n * // data is the result of parsing the text.\n * // If there was a parsing error, it would have been caught.\n * }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(function (contents) {\n * return db.model.create(contents);\n * }),\n * function (model, next) {\n * // `model` is the instantiated model object.\n * // If there was an error, this function would be skipped.\n * }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n * var intermediateStep = await processFile(file);\n * return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n return (0, _initialParams2.default)(function (args, callback) {\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if ((0, _isObject2.default)(result) && typeof result.then === 'function') {\n result.then(function (value) {\n invokeCallback(callback, null, value);\n }, function (err) {\n invokeCallback(callback, err.message ? err : new Error(err));\n });\n } else {\n callback(null, result);\n }\n });\n}\n\nfunction invokeCallback(callback, error, value) {\n try {\n callback(error, value);\n } catch (e) {\n (0, _setImmediate2.default)(rethrow, e);\n }\n}\n\nfunction rethrow(error) {\n throw error;\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/asyncify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/each.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/async/each.js ***!
|
||
\************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = eachLimit;\n\nvar _eachOf = __webpack_require__(/*! ./eachOf */ \"./node_modules/async/eachOf.js\");\n\nvar _eachOf2 = _interopRequireDefault(_eachOf);\n\nvar _withoutIndex = __webpack_require__(/*! ./internal/withoutIndex */ \"./node_modules/async/internal/withoutIndex.js\");\n\nvar _withoutIndex2 = _interopRequireDefault(_withoutIndex);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n * // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n * // Perform operation on file here.\n * console.log('Processing file ' + file);\n *\n * if( file.length > 32 ) {\n * console.log('This file name is too long');\n * callback('File name too long');\n * } else {\n * // Do work to process file here\n * console.log('File processed');\n * callback();\n * }\n * }, function(err) {\n * // if any of the file processing produced an error, err would equal that error\n * if( err ) {\n * // One of the iterations produced an error.\n * // All processing will now stop.\n * console.log('A file failed to process');\n * } else {\n * console.log('All files have been processed successfully');\n * }\n * });\n */\nfunction eachLimit(coll, iteratee, callback) {\n (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/each.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/eachLimit.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/async/eachLimit.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = eachLimit;\n\nvar _eachOfLimit = __webpack_require__(/*! ./internal/eachOfLimit */ \"./node_modules/async/internal/eachOfLimit.js\");\n\nvar _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);\n\nvar _withoutIndex = __webpack_require__(/*! ./internal/withoutIndex */ \"./node_modules/async/internal/withoutIndex.js\");\n\nvar _withoutIndex2 = _interopRequireDefault(_withoutIndex);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachLimit(coll, limit, iteratee, callback) {\n (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/eachLimit.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/eachOf.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/async/eachOf.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (coll, iteratee, callback) {\n var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;\n eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);\n};\n\nvar _isArrayLike = __webpack_require__(/*! lodash/isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\nvar _isArrayLike2 = _interopRequireDefault(_isArrayLike);\n\nvar _breakLoop = __webpack_require__(/*! ./internal/breakLoop */ \"./node_modules/async/internal/breakLoop.js\");\n\nvar _breakLoop2 = _interopRequireDefault(_breakLoop);\n\nvar _eachOfLimit = __webpack_require__(/*! ./eachOfLimit */ \"./node_modules/async/eachOfLimit.js\");\n\nvar _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);\n\nvar _doLimit = __webpack_require__(/*! ./internal/doLimit */ \"./node_modules/async/internal/doLimit.js\");\n\nvar _doLimit2 = _interopRequireDefault(_doLimit);\n\nvar _noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _once = __webpack_require__(/*! ./internal/once */ \"./node_modules/async/internal/once.js\");\n\nvar _once2 = _interopRequireDefault(_once);\n\nvar _onlyOnce = __webpack_require__(/*! ./internal/onlyOnce */ \"./node_modules/async/internal/onlyOnce.js\");\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = (0, _once2.default)(callback || _noop2.default);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if (++completed === length || value === _breakLoop2.default) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nvar eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * var obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n * fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n * if (err) return callback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }, function (err) {\n * if (err) console.error(err.message);\n * // configs is now a map of JSON data\n * doSomethingWith(configs);\n * });\n */\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/eachOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/eachOfLimit.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/async/eachOfLimit.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = eachOfLimit;\n\nvar _eachOfLimit2 = __webpack_require__(/*! ./internal/eachOfLimit */ \"./node_modules/async/internal/eachOfLimit.js\");\n\nvar _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/eachOfLimit.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/eachSeries.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/async/eachSeries.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _eachLimit = __webpack_require__(/*! ./eachLimit */ \"./node_modules/async/eachLimit.js\");\n\nvar _eachLimit2 = _interopRequireDefault(_eachLimit);\n\nvar _doLimit = __webpack_require__(/*! ./internal/doLimit */ \"./node_modules/async/internal/doLimit.js\");\n\nvar _doLimit2 = _interopRequireDefault(_doLimit);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nexports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/eachSeries.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/DoublyLinkedList.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/async/internal/DoublyLinkedList.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = DLL;\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nfunction DLL() {\n this.head = this.tail = null;\n this.length = 0;\n}\n\nfunction setInitial(dll, node) {\n dll.length = 1;\n dll.head = dll.tail = node;\n}\n\nDLL.prototype.removeLink = function (node) {\n if (node.prev) node.prev.next = node.next;else this.head = node.next;\n if (node.next) node.next.prev = node.prev;else this.tail = node.prev;\n\n node.prev = node.next = null;\n this.length -= 1;\n return node;\n};\n\nDLL.prototype.empty = function () {\n while (this.head) this.shift();\n return this;\n};\n\nDLL.prototype.insertAfter = function (node, newNode) {\n newNode.prev = node;\n newNode.next = node.next;\n if (node.next) node.next.prev = newNode;else this.tail = newNode;\n node.next = newNode;\n this.length += 1;\n};\n\nDLL.prototype.insertBefore = function (node, newNode) {\n newNode.prev = node.prev;\n newNode.next = node;\n if (node.prev) node.prev.next = newNode;else this.head = newNode;\n node.prev = newNode;\n this.length += 1;\n};\n\nDLL.prototype.unshift = function (node) {\n if (this.head) this.insertBefore(this.head, node);else setInitial(this, node);\n};\n\nDLL.prototype.push = function (node) {\n if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node);\n};\n\nDLL.prototype.shift = function () {\n return this.head && this.removeLink(this.head);\n};\n\nDLL.prototype.pop = function () {\n return this.tail && this.removeLink(this.tail);\n};\n\nDLL.prototype.toArray = function () {\n var arr = Array(this.length);\n var curr = this.head;\n for (var idx = 0; idx < this.length; idx++) {\n arr[idx] = curr.data;\n curr = curr.next;\n }\n return arr;\n};\n\nDLL.prototype.remove = function (testFn) {\n var curr = this.head;\n while (!!curr) {\n var next = curr.next;\n if (testFn(curr)) {\n this.removeLink(curr);\n }\n curr = next;\n }\n return this;\n};\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/DoublyLinkedList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/breakLoop.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/async/internal/breakLoop.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nexports.default = {};\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/breakLoop.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/doLimit.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/async/internal/doLimit.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = doLimit;\nfunction doLimit(fn, limit) {\n return function (iterable, iteratee, callback) {\n return fn(iterable, limit, iteratee, callback);\n };\n}\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/doLimit.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/doParallel.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/async/internal/doParallel.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = doParallel;\n\nvar _eachOf = __webpack_require__(/*! ../eachOf */ \"./node_modules/async/eachOf.js\");\n\nvar _eachOf2 = _interopRequireDefault(_eachOf);\n\nvar _wrapAsync = __webpack_require__(/*! ./wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction doParallel(fn) {\n return function (obj, iteratee, callback) {\n return fn(_eachOf2.default, obj, (0, _wrapAsync2.default)(iteratee), callback);\n };\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/doParallel.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/eachOfLimit.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/async/internal/eachOfLimit.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _eachOfLimit;\n\nvar _noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _once = __webpack_require__(/*! ./once */ \"./node_modules/async/internal/once.js\");\n\nvar _once2 = _interopRequireDefault(_once);\n\nvar _iterator = __webpack_require__(/*! ./iterator */ \"./node_modules/async/internal/iterator.js\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _onlyOnce = __webpack_require__(/*! ./onlyOnce */ \"./node_modules/async/internal/onlyOnce.js\");\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _breakLoop = __webpack_require__(/*! ./breakLoop */ \"./node_modules/async/internal/breakLoop.js\");\n\nvar _breakLoop2 = _interopRequireDefault(_breakLoop);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _eachOfLimit(limit) {\n return function (obj, iteratee, callback) {\n callback = (0, _once2.default)(callback || _noop2.default);\n if (limit <= 0 || !obj) {\n return callback(null);\n }\n var nextElem = (0, _iterator2.default)(obj);\n var done = false;\n var running = 0;\n var looping = false;\n\n function iterateeCallback(err, value) {\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n } else if (value === _breakLoop2.default || done && running <= 0) {\n done = true;\n return callback(null);\n } else if (!looping) {\n replenish();\n }\n }\n\n function replenish() {\n looping = true;\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback));\n }\n looping = false;\n }\n\n replenish();\n };\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/eachOfLimit.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/getIterator.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/async/internal/getIterator.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (coll) {\n return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n};\n\nvar iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/getIterator.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/initialParams.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/async/internal/initialParams.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (fn) {\n return function () /*...args, callback*/{\n var args = (0, _slice2.default)(arguments);\n var callback = args.pop();\n fn.call(this, args, callback);\n };\n};\n\nvar _slice = __webpack_require__(/*! ./slice */ \"./node_modules/async/internal/slice.js\");\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/initialParams.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/iterator.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/async/internal/iterator.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = iterator;\n\nvar _isArrayLike = __webpack_require__(/*! lodash/isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\nvar _isArrayLike2 = _interopRequireDefault(_isArrayLike);\n\nvar _getIterator = __webpack_require__(/*! ./getIterator */ \"./node_modules/async/internal/getIterator.js\");\n\nvar _getIterator2 = _interopRequireDefault(_getIterator);\n\nvar _keys = __webpack_require__(/*! lodash/keys */ \"./node_modules/lodash/keys.js\");\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? { value: coll[i], key: i } : null;\n };\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done) return null;\n i++;\n return { value: item.value, key: i };\n };\n}\n\nfunction createObjectIterator(obj) {\n var okeys = (0, _keys2.default)(obj);\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n return i < len ? { value: obj[key], key: key } : null;\n };\n}\n\nfunction iterator(coll) {\n if ((0, _isArrayLike2.default)(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = (0, _getIterator2.default)(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/iterator.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/map.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/async/internal/map.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _asyncMap;\n\nvar _noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _wrapAsync = __webpack_require__(/*! ./wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n callback = callback || _noop2.default;\n arr = arr || [];\n var results = [];\n var counter = 0;\n var _iteratee = (0, _wrapAsync2.default)(iteratee);\n\n eachfn(arr, function (value, _, callback) {\n var index = counter++;\n _iteratee(value, function (err, v) {\n results[index] = v;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/once.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/async/internal/once.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = once;\nfunction once(fn) {\n return function () {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/once.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/onlyOnce.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/async/internal/onlyOnce.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = onlyOnce;\nfunction onlyOnce(fn) {\n return function () {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/onlyOnce.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/queue.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/async/internal/queue.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = queue;\n\nvar _baseIndexOf = __webpack_require__(/*! lodash/_baseIndexOf */ \"./node_modules/lodash/_baseIndexOf.js\");\n\nvar _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);\n\nvar _isArray = __webpack_require__(/*! lodash/isArray */ \"./node_modules/lodash/isArray.js\");\n\nvar _isArray2 = _interopRequireDefault(_isArray);\n\nvar _noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _onlyOnce = __webpack_require__(/*! ./onlyOnce */ \"./node_modules/async/internal/onlyOnce.js\");\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _setImmediate = __webpack_require__(/*! ./setImmediate */ \"./node_modules/async/internal/setImmediate.js\");\n\nvar _setImmediate2 = _interopRequireDefault(_setImmediate);\n\nvar _DoublyLinkedList = __webpack_require__(/*! ./DoublyLinkedList */ \"./node_modules/async/internal/DoublyLinkedList.js\");\n\nvar _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList);\n\nvar _wrapAsync = __webpack_require__(/*! ./wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction queue(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var _worker = (0, _wrapAsync2.default)(worker);\n var numRunning = 0;\n var workersList = [];\n\n var processingScheduled = false;\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n if (!(0, _isArray2.default)(data)) {\n data = [data];\n }\n if (data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n return (0, _setImmediate2.default)(function () {\n q.drain();\n });\n }\n\n for (var i = 0, l = data.length; i < l; i++) {\n var item = {\n data: data[i],\n callback: callback || _noop2.default\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n }\n\n if (!processingScheduled) {\n processingScheduled = true;\n (0, _setImmediate2.default)(function () {\n processingScheduled = false;\n q.process();\n });\n }\n }\n\n function _next(tasks) {\n return function (err) {\n numRunning -= 1;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n var task = tasks[i];\n\n var index = (0, _baseIndexOf2.default)(workersList, task, 0);\n if (index === 0) {\n workersList.shift();\n } else if (index > 0) {\n workersList.splice(index, 1);\n }\n\n task.callback.apply(task, arguments);\n\n if (err != null) {\n q.error(err, task.data);\n }\n }\n\n if (numRunning <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n q.process();\n };\n }\n\n var isProcessing = false;\n var q = {\n _tasks: new _DoublyLinkedList2.default(),\n concurrency: concurrency,\n payload: payload,\n saturated: _noop2.default,\n unsaturated: _noop2.default,\n buffer: concurrency / 4,\n empty: _noop2.default,\n drain: _noop2.default,\n error: _noop2.default,\n started: false,\n paused: false,\n push: function (data, callback) {\n _insert(data, false, callback);\n },\n kill: function () {\n q.drain = _noop2.default;\n q._tasks.empty();\n },\n unshift: function (data, callback) {\n _insert(data, true, callback);\n },\n remove: function (testFn) {\n q._tasks.remove(testFn);\n },\n process: function () {\n // Avoid trying to start too many processing operations. This can occur\n // when callbacks resolve synchronously (#1267).\n if (isProcessing) {\n return;\n }\n isProcessing = true;\n while (!q.paused && numRunning < q.concurrency && q._tasks.length) {\n var tasks = [],\n data = [];\n var l = q._tasks.length;\n if (q.payload) l = Math.min(l, q.payload);\n for (var i = 0; i < l; i++) {\n var node = q._tasks.shift();\n tasks.push(node);\n workersList.push(node);\n data.push(node.data);\n }\n\n numRunning += 1;\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n if (numRunning === q.concurrency) {\n q.saturated();\n }\n\n var cb = (0, _onlyOnce2.default)(_next(tasks));\n _worker(data, cb);\n }\n isProcessing = false;\n },\n length: function () {\n return q._tasks.length;\n },\n running: function () {\n return numRunning;\n },\n workersList: function () {\n return workersList;\n },\n idle: function () {\n return q._tasks.length + numRunning === 0;\n },\n pause: function () {\n q.paused = true;\n },\n resume: function () {\n if (q.paused === false) {\n return;\n }\n q.paused = false;\n (0, _setImmediate2.default)(q.process);\n }\n };\n return q;\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/internal/queue.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/setImmediate.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/async/internal/setImmediate.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hasNextTick = exports.hasSetImmediate = undefined;\nexports.fallback = fallback;\nexports.wrap = wrap;\n\nvar _slice = __webpack_require__(/*! ./slice */ \"./node_modules/async/internal/slice.js\");\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n return function (fn /*, ...args*/) {\n var args = (0, _slice2.default)(arguments, 1);\n defer(function () {\n fn.apply(null, args);\n });\n };\n}\n\nvar _defer;\n\nif (hasSetImmediate) {\n _defer = setImmediate;\n} else if (hasNextTick) {\n _defer = process.nextTick;\n} else {\n _defer = fallback;\n}\n\nexports.default = wrap(_defer);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/async/internal/setImmediate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/slice.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/async/internal/slice.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = slice;\nfunction slice(arrayLike, start) {\n start = start | 0;\n var newLen = Math.max(arrayLike.length - start, 0);\n var newArr = Array(newLen);\n for (var idx = 0; idx < newLen; idx++) {\n newArr[idx] = arrayLike[start + idx];\n }\n return newArr;\n}\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/slice.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/withoutIndex.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/async/internal/withoutIndex.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _withoutIndex;\nfunction _withoutIndex(iteratee) {\n return function (value, index, callback) {\n return iteratee(value, callback);\n };\n}\nmodule.exports = exports[\"default\"];\n\n//# sourceURL=webpack:///./node_modules/async/internal/withoutIndex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/internal/wrapAsync.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/async/internal/wrapAsync.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAsync = undefined;\n\nvar _asyncify = __webpack_require__(/*! ../asyncify */ \"./node_modules/async/asyncify.js\");\n\nvar _asyncify2 = _interopRequireDefault(_asyncify);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar supportsSymbol = typeof Symbol === 'function';\n\nfunction isAsync(fn) {\n return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction wrapAsync(asyncFn) {\n return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;\n}\n\nexports.default = wrapAsync;\nexports.isAsync = isAsync;\n\n//# sourceURL=webpack:///./node_modules/async/internal/wrapAsync.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/map.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/async/map.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _doParallel = __webpack_require__(/*! ./internal/doParallel */ \"./node_modules/async/internal/doParallel.js\");\n\nvar _doParallel2 = _interopRequireDefault(_doParallel);\n\nvar _map = __webpack_require__(/*! ./internal/map */ \"./node_modules/async/internal/map.js\");\n\nvar _map2 = _interopRequireDefault(_map);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n * // results is now an array of stats for each file\n * });\n */\nexports.default = (0, _doParallel2.default)(_map2.default);\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/nextTick.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/async/nextTick.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _setImmediate = __webpack_require__(/*! ./internal/setImmediate */ \"./node_modules/async/internal/setImmediate.js\");\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTick`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer;\n\nif (_setImmediate.hasNextTick) {\n _defer = process.nextTick;\n} else if (_setImmediate.hasSetImmediate) {\n _defer = setImmediate;\n} else {\n _defer = _setImmediate.fallback;\n}\n\nexports.default = (0, _setImmediate.wrap)(_defer);\nmodule.exports = exports['default'];\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/async/nextTick.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/queue.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/async/queue.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (worker, concurrency) {\n var _worker = (0, _wrapAsync2.default)(worker);\n return (0, _queue2.default)(function (items, cb) {\n _worker(items[0], cb);\n }, concurrency, 1);\n};\n\nvar _queue = __webpack_require__(/*! ./internal/queue */ \"./node_modules/async/internal/queue.js\");\n\nvar _queue2 = _interopRequireDefault(_queue);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports['default'];\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Object} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {Function} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {Function} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {Function} remove - remove items from the queue that match a test\n * function. The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a callback that is called when the number of\n * running workers hits the `concurrency` limit, and further tasks will be\n * queued.\n * @property {Function} unsaturated - a callback that is called when the number\n * of running workers is less than the `concurrency` & `buffer` limits, and\n * further tasks will not be queued.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - a callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} error - a callback that is called when a task errors.\n * Has the signature `function(error, task)`.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n * console.log('hello ' + task.name);\n * callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain = function() {\n * console.log('all items have been processed');\n * };\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * q.push({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n * console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n */\n\n//# sourceURL=webpack:///./node_modules/async/queue.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/setImmediate.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/async/setImmediate.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _setImmediate = __webpack_require__(/*! ./internal/setImmediate */ \"./node_modules/async/internal/setImmediate.js\");\n\nvar _setImmediate2 = _interopRequireDefault(_setImmediate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `setImmediate`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name setImmediate\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.nextTick]{@link module:Utils.nextTick}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nexports.default = _setImmediate2.default;\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/setImmediate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/waterfall.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/async/waterfall.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (tasks, callback) {\n callback = (0, _once2.default)(callback || _noop2.default);\n if (!(0, _isArray2.default)(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n if (!tasks.length) return callback();\n var taskIndex = 0;\n\n function nextTask(args) {\n var task = (0, _wrapAsync2.default)(tasks[taskIndex++]);\n args.push((0, _onlyOnce2.default)(next));\n task.apply(null, args);\n }\n\n function next(err /*, ...args*/) {\n if (err || taskIndex === tasks.length) {\n return callback.apply(null, arguments);\n }\n nextTask((0, _slice2.default)(arguments, 1));\n }\n\n nextTask([]);\n};\n\nvar _isArray = __webpack_require__(/*! lodash/isArray */ \"./node_modules/lodash/isArray.js\");\n\nvar _isArray2 = _interopRequireDefault(_isArray);\n\nvar _noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _once = __webpack_require__(/*! ./internal/once */ \"./node_modules/async/internal/once.js\");\n\nvar _once2 = _interopRequireDefault(_once);\n\nvar _slice = __webpack_require__(/*! ./internal/slice */ \"./node_modules/async/internal/slice.js\");\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nvar _onlyOnce = __webpack_require__(/*! ./internal/onlyOnce */ \"./node_modules/async/internal/onlyOnce.js\");\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports['default'];\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns undefined\n * @example\n *\n * async.waterfall([\n * function(callback) {\n * callback(null, 'one', 'two');\n * },\n * function(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * },\n * function(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n * myFirstFunction,\n * mySecondFunction,\n * myLastFunction,\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n * callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n */\n\n//# sourceURL=webpack:///./node_modules/async/waterfall.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/async/whilst.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/async/whilst.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = whilst;\n\nvar _noop = __webpack_require__(/*! lodash/noop */ \"./node_modules/lodash/noop.js\");\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _slice = __webpack_require__(/*! ./internal/slice */ \"./node_modules/async/internal/slice.js\");\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nvar _onlyOnce = __webpack_require__(/*! ./internal/onlyOnce */ \"./node_modules/async/internal/onlyOnce.js\");\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(/*! ./internal/wrapAsync */ \"./node_modules/async/internal/wrapAsync.js\");\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns undefined\n * @example\n *\n * var count = 0;\n * async.whilst(\n * function() { return count < 5; },\n * function(callback) {\n * count++;\n * setTimeout(function() {\n * callback(null, count);\n * }, 1000);\n * },\n * function (err, n) {\n * // 5 seconds have passed, n = 5\n * }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n callback = (0, _onlyOnce2.default)(callback || _noop2.default);\n var _iteratee = (0, _wrapAsync2.default)(iteratee);\n if (!test()) return callback(null);\n var next = function (err /*, ...args*/) {\n if (err) return callback(err);\n if (test()) return _iteratee(next);\n var args = (0, _slice2.default)(arguments, 1);\n callback.apply(null, [null].concat(args));\n };\n _iteratee(next);\n}\nmodule.exports = exports['default'];\n\n//# sourceURL=webpack:///./node_modules/async/whilst.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/aws-sign2/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/aws-sign2/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("\n/*!\n * Copyright 2010 LearnBoost <dev@learnboost.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Module dependencies.\n */\n\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\")\n , parse = __webpack_require__(/*! url */ \"./node_modules/url/url.js\").parse\n ;\n\n/**\n * Valid keys.\n */\n\nvar keys = \n [ 'acl'\n , 'location'\n , 'logging'\n , 'notification'\n , 'partNumber'\n , 'policy'\n , 'requestPayment'\n , 'torrent'\n , 'uploadId'\n , 'uploads'\n , 'versionId'\n , 'versioning'\n , 'versions'\n , 'website'\n ]\n\n/**\n * Return an \"Authorization\" header value with the given `options`\n * in the form of \"AWS <key>:<signature>\"\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction authorization (options) {\n return 'AWS ' + options.key + ':' + sign(options)\n}\n\nmodule.exports = authorization\nmodule.exports.authorization = authorization\n\n/**\n * Simple HMAC-SHA1 Wrapper\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */ \n\nfunction hmacSha1 (options) {\n return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')\n}\n\nmodule.exports.hmacSha1 = hmacSha1\n\n/**\n * Create a base64 sha1 HMAC for `options`. \n * \n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction sign (options) {\n options.message = stringToSign(options)\n return hmacSha1(options)\n}\nmodule.exports.sign = sign\n\n/**\n * Create a base64 sha1 HMAC for `options`. \n *\n * Specifically to be used with S3 presigned URLs\n * \n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction signQuery (options) {\n options.message = queryStringToSign(options)\n return hmacSha1(options)\n}\nmodule.exports.signQuery= signQuery\n\n/**\n * Return a string for sign() with the given `options`.\n *\n * Spec:\n * \n * <verb>\\n\n * <md5>\\n\n * <content-type>\\n\n * <date>\\n\n * [headers\\n]\n * <resource>\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction stringToSign (options) {\n var headers = options.amazonHeaders || ''\n if (headers) headers += '\\n'\n var r = \n [ options.verb\n , options.md5\n , options.contentType\n , options.date ? options.date.toUTCString() : ''\n , headers + options.resource\n ]\n return r.join('\\n')\n}\nmodule.exports.stringToSign = stringToSign\n\n/**\n * Return a string for sign() with the given `options`, but is meant exclusively\n * for S3 presigned URLs\n *\n * Spec:\n * \n * <date>\\n\n * <resource>\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction queryStringToSign (options){\n return 'GET\\n\\n\\n' + options.date + '\\n' + options.resource\n}\nmodule.exports.queryStringToSign = queryStringToSign\n\n/**\n * Perform the following:\n *\n * - ignore non-amazon headers\n * - lowercase fields\n * - sort lexicographically\n * - trim whitespace between \":\"\n * - join with newline\n *\n * @param {Object} headers\n * @return {String}\n * @api private\n */\n\nfunction canonicalizeHeaders (headers) {\n var buf = []\n , fields = Object.keys(headers)\n ;\n for (var i = 0, len = fields.length; i < len; ++i) {\n var field = fields[i]\n , val = headers[field]\n , field = field.toLowerCase()\n ;\n if (0 !== field.indexOf('x-amz')) continue\n buf.push(field + ':' + val)\n }\n return buf.sort().join('\\n')\n}\nmodule.exports.canonicalizeHeaders = canonicalizeHeaders\n\n/**\n * Perform the following:\n *\n * - ignore non sub-resources\n * - sort lexicographically\n *\n * @param {String} resource\n * @return {String}\n * @api private\n */\n\nfunction canonicalizeResource (resource) {\n var url = parse(resource, true)\n , path = url.pathname\n , buf = []\n ;\n\n Object.keys(url.query).forEach(function(key){\n if (!~keys.indexOf(key)) return\n var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])\n buf.push(key + val)\n })\n\n return path + (buf.length ? '?' + buf.sort().join('&') : '')\n}\nmodule.exports.canonicalizeResource = canonicalizeResource\n\n\n//# sourceURL=webpack:///./node_modules/aws-sign2/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/aws4/aws4.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/aws4/aws4.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var aws4 = exports,\n url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\"),\n querystring = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\"),\n crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\"),\n lru = __webpack_require__(/*! ./lru */ \"./node_modules/aws4/lru.js\"),\n credentialsCache = lru(1000)\n\n// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html\n\nfunction hmac(key, string, encoding) {\n return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)\n}\n\nfunction hash(string, encoding) {\n return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)\n}\n\n// This function assumes the string has already been percent encoded\nfunction encodeRfc3986(urlEncodedString) {\n return urlEncodedString.replace(/[!'()*]/g, function(c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n// request: { path | body, [host], [method], [headers], [service], [region] }\n// credentials: { accessKeyId, secretAccessKey, [sessionToken] }\nfunction RequestSigner(request, credentials) {\n\n if (typeof request === 'string') request = url.parse(request)\n\n var headers = request.headers = (request.headers || {}),\n hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)\n\n this.request = request\n this.credentials = credentials || this.defaultCredentials()\n\n this.service = request.service || hostParts[0] || ''\n this.region = request.region || hostParts[1] || 'us-east-1'\n\n // SES uses a different domain from the service name\n if (this.service === 'email') this.service = 'ses'\n\n if (!request.method && request.body)\n request.method = 'POST'\n\n if (!headers.Host && !headers.host) {\n headers.Host = request.hostname || request.host || this.createHost()\n\n // If a port is specified explicitly, use it as is\n if (request.port)\n headers.Host += ':' + request.port\n }\n if (!request.hostname && !request.host)\n request.hostname = headers.Host || headers.host\n\n this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'\n}\n\nRequestSigner.prototype.matchHost = function(host) {\n var match = (host || '').match(/([^\\.]+)\\.(?:([^\\.]*)\\.)?amazonaws\\.com(\\.cn)?$/)\n var hostParts = (match || []).slice(1, 3)\n\n // ES's hostParts are sometimes the other way round, if the value that is expected\n // to be region equals ‘es’ switch them back\n // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com\n if (hostParts[1] === 'es')\n hostParts = hostParts.reverse()\n\n return hostParts\n}\n\n// http://docs.aws.amazon.com/general/latest/gr/rande.html\nRequestSigner.prototype.isSingleRegion = function() {\n // Special case for S3 and SimpleDB in us-east-1\n if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true\n\n return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']\n .indexOf(this.service) >= 0\n}\n\nRequestSigner.prototype.createHost = function() {\n var region = this.isSingleRegion() ? '' :\n (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,\n service = this.service === 'ses' ? 'email' : this.service\n return service + region + '.amazonaws.com'\n}\n\nRequestSigner.prototype.prepareRequest = function() {\n this.parsePath()\n\n var request = this.request, headers = request.headers, query\n\n if (request.signQuery) {\n\n this.parsedPath.query = query = this.parsedPath.query || {}\n\n if (this.credentials.sessionToken)\n query['X-Amz-Security-Token'] = this.credentials.sessionToken\n\n if (this.service === 's3' && !query['X-Amz-Expires'])\n query['X-Amz-Expires'] = 86400\n\n if (query['X-Amz-Date'])\n this.datetime = query['X-Amz-Date']\n else\n query['X-Amz-Date'] = this.getDateTime()\n\n query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'\n query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()\n query['X-Amz-SignedHeaders'] = this.signedHeaders()\n\n } else {\n\n if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {\n if (request.body && !headers['Content-Type'] && !headers['content-type'])\n headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'\n\n if (request.body && !headers['Content-Length'] && !headers['content-length'])\n headers['Content-Length'] = Buffer.byteLength(request.body)\n\n if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token'])\n headers['X-Amz-Security-Token'] = this.credentials.sessionToken\n\n if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256'])\n headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')\n\n if (headers['X-Amz-Date'] || headers['x-amz-date'])\n this.datetime = headers['X-Amz-Date'] || headers['x-amz-date']\n else\n headers['X-Amz-Date'] = this.getDateTime()\n }\n\n delete headers.Authorization\n delete headers.authorization\n }\n}\n\nRequestSigner.prototype.sign = function() {\n if (!this.parsedPath) this.prepareRequest()\n\n if (this.request.signQuery) {\n this.parsedPath.query['X-Amz-Signature'] = this.signature()\n } else {\n this.request.headers.Authorization = this.authHeader()\n }\n\n this.request.path = this.formatPath()\n\n return this.request\n}\n\nRequestSigner.prototype.getDateTime = function() {\n if (!this.datetime) {\n var headers = this.request.headers,\n date = new Date(headers.Date || headers.date || new Date)\n\n this.datetime = date.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '')\n\n // Remove the trailing 'Z' on the timestamp string for CodeCommit git access\n if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1)\n }\n return this.datetime\n}\n\nRequestSigner.prototype.getDate = function() {\n return this.getDateTime().substr(0, 8)\n}\n\nRequestSigner.prototype.authHeader = function() {\n return [\n 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),\n 'SignedHeaders=' + this.signedHeaders(),\n 'Signature=' + this.signature(),\n ].join(', ')\n}\n\nRequestSigner.prototype.signature = function() {\n var date = this.getDate(),\n cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),\n kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)\n if (!kCredentials) {\n kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)\n kRegion = hmac(kDate, this.region)\n kService = hmac(kRegion, this.service)\n kCredentials = hmac(kService, 'aws4_request')\n credentialsCache.set(cacheKey, kCredentials)\n }\n return hmac(kCredentials, this.stringToSign(), 'hex')\n}\n\nRequestSigner.prototype.stringToSign = function() {\n return [\n 'AWS4-HMAC-SHA256',\n this.getDateTime(),\n this.credentialString(),\n hash(this.canonicalString(), 'hex'),\n ].join('\\n')\n}\n\nRequestSigner.prototype.canonicalString = function() {\n if (!this.parsedPath) this.prepareRequest()\n\n var pathStr = this.parsedPath.path,\n query = this.parsedPath.query,\n headers = this.request.headers,\n queryStr = '',\n normalizePath = this.service !== 's3',\n decodePath = this.service === 's3' || this.request.doNotEncodePath,\n decodeSlashesInPath = this.service === 's3',\n firstValOnly = this.service === 's3',\n bodyHash\n\n if (this.service === 's3' && this.request.signQuery) {\n bodyHash = 'UNSIGNED-PAYLOAD'\n } else if (this.isCodeCommitGit) {\n bodyHash = ''\n } else {\n bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] ||\n hash(this.request.body || '', 'hex')\n }\n\n if (query) {\n queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) {\n if (!key) return obj\n obj[key] = !Array.isArray(query[key]) ? query[key] :\n (firstValOnly ? query[key][0] : query[key].slice().sort())\n return obj\n }, {})))\n }\n if (pathStr !== '/') {\n if (normalizePath) pathStr = pathStr.replace(/\\/{2,}/g, '/')\n pathStr = pathStr.split('/').reduce(function(path, piece) {\n if (normalizePath && piece === '..') {\n path.pop()\n } else if (!normalizePath || piece !== '.') {\n if (decodePath) piece = decodeURIComponent(piece)\n path.push(encodeRfc3986(encodeURIComponent(piece)))\n }\n return path\n }, []).join('/')\n if (pathStr[0] !== '/') pathStr = '/' + pathStr\n if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')\n }\n\n return [\n this.request.method || 'GET',\n pathStr,\n queryStr,\n this.canonicalHeaders() + '\\n',\n this.signedHeaders(),\n bodyHash,\n ].join('\\n')\n}\n\nRequestSigner.prototype.canonicalHeaders = function() {\n var headers = this.request.headers\n function trimAll(header) {\n return header.toString().trim().replace(/\\s+/g, ' ')\n }\n return Object.keys(headers)\n .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })\n .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })\n .join('\\n')\n}\n\nRequestSigner.prototype.signedHeaders = function() {\n return Object.keys(this.request.headers)\n .map(function(key) { return key.toLowerCase() })\n .sort()\n .join(';')\n}\n\nRequestSigner.prototype.credentialString = function() {\n return [\n this.getDate(),\n this.region,\n this.service,\n 'aws4_request',\n ].join('/')\n}\n\nRequestSigner.prototype.defaultCredentials = function() {\n var env = process.env\n return {\n accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,\n secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,\n sessionToken: env.AWS_SESSION_TOKEN,\n }\n}\n\nRequestSigner.prototype.parsePath = function() {\n var path = this.request.path || '/',\n queryIx = path.indexOf('?'),\n query = null\n\n if (queryIx >= 0) {\n query = querystring.parse(path.slice(queryIx + 1))\n path = path.slice(0, queryIx)\n }\n\n // S3 doesn't always encode characters > 127 correctly and\n // all services don't encode characters > 255 correctly\n // So if there are non-reserved chars (and it's not already all % encoded), just encode them all\n if (/[^0-9A-Za-z!'()*\\-._~%/]/.test(path)) {\n path = path.split('/').map(function(piece) {\n return encodeURIComponent(decodeURIComponent(piece))\n }).join('/')\n }\n\n this.parsedPath = {\n path: path,\n query: query,\n }\n}\n\nRequestSigner.prototype.formatPath = function() {\n var path = this.parsedPath.path,\n query = this.parsedPath.query\n\n if (!query) return path\n\n // Services don't support empty query string keys\n if (query[''] != null) delete query['']\n\n return path + '?' + encodeRfc3986(querystring.stringify(query))\n}\n\naws4.RequestSigner = RequestSigner\n\naws4.sign = function(request, credentials) {\n return new RequestSigner(request, credentials).sign()\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/aws4/aws4.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/aws4/lru.js":
|
||
/*!**********************************!*\
|
||
!*** ./node_modules/aws4/lru.js ***!
|
||
\**********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function(size) {\n return new LruCache(size)\n}\n\nfunction LruCache(size) {\n this.capacity = size | 0\n this.map = Object.create(null)\n this.list = new DoublyLinkedList()\n}\n\nLruCache.prototype.get = function(key) {\n var node = this.map[key]\n if (node == null) return undefined\n this.used(node)\n return node.val\n}\n\nLruCache.prototype.set = function(key, val) {\n var node = this.map[key]\n if (node != null) {\n node.val = val\n } else {\n if (!this.capacity) this.prune()\n if (!this.capacity) return false\n node = new DoublyLinkedNode(key, val)\n this.map[key] = node\n this.capacity--\n }\n this.used(node)\n return true\n}\n\nLruCache.prototype.used = function(node) {\n this.list.moveToFront(node)\n}\n\nLruCache.prototype.prune = function() {\n var node = this.list.pop()\n if (node != null) {\n delete this.map[node.key]\n this.capacity++\n }\n}\n\n\nfunction DoublyLinkedList() {\n this.firstNode = null\n this.lastNode = null\n}\n\nDoublyLinkedList.prototype.moveToFront = function(node) {\n if (this.firstNode == node) return\n\n this.remove(node)\n\n if (this.firstNode == null) {\n this.firstNode = node\n this.lastNode = node\n node.prev = null\n node.next = null\n } else {\n node.prev = null\n node.next = this.firstNode\n node.next.prev = node\n this.firstNode = node\n }\n}\n\nDoublyLinkedList.prototype.pop = function() {\n var lastNode = this.lastNode\n if (lastNode != null) {\n this.remove(lastNode)\n }\n return lastNode\n}\n\nDoublyLinkedList.prototype.remove = function(node) {\n if (this.firstNode == node) {\n this.firstNode = node.next\n } else if (node.prev != null) {\n node.prev.next = node.next\n }\n if (this.lastNode == node) {\n this.lastNode = node.prev\n } else if (node.next != null) {\n node.next.prev = node.prev\n }\n}\n\n\nfunction DoublyLinkedNode(key, val) {\n this.key = key\n this.val = val\n this.prev = null\n this.next = null\n}\n\n\n//# sourceURL=webpack:///./node_modules/aws4/lru.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/base-x/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/base-x/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n\nconst Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nmodule.exports = function base (ALPHABET) {\n if (ALPHABET.length >= 255) throw new TypeError('Alphabet too long')\n\n const BASE_MAP = new Uint8Array(256)\n BASE_MAP.fill(255)\n\n for (let i = 0; i < ALPHABET.length; i++) {\n const x = ALPHABET.charAt(i)\n const xc = x.charCodeAt(0)\n\n if (BASE_MAP[xc] !== 255) throw new TypeError(x + ' is ambiguous')\n BASE_MAP[xc] = i\n }\n\n const BASE = ALPHABET.length\n const LEADER = ALPHABET.charAt(0)\n const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n\n function encode (source) {\n if (!Buffer.isBuffer(source)) throw new TypeError('Expected Buffer')\n if (source.length === 0) return ''\n\n // Skip & count leading zeroes.\n let zeroes = 0\n let length = 0\n let pbegin = 0\n const pend = source.length\n\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++\n zeroes++\n }\n\n // Allocate enough space in big-endian base58 representation.\n const size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n const b58 = new Uint8Array(size)\n\n // Process the bytes.\n while (pbegin !== pend) {\n let carry = source[pbegin]\n\n // Apply \"b58 = b58 * 256 + ch\".\n let i = 0\n for (let it = size - 1; (carry !== 0 || i < length) && (it !== -1); it--, i++) {\n carry += (256 * b58[it]) >>> 0\n b58[it] = (carry % BASE) >>> 0\n carry = (carry / BASE) >>> 0\n }\n\n if (carry !== 0) throw new Error('Non-zero carry')\n length = i\n pbegin++\n }\n\n // Skip leading zeroes in base58 result.\n let it = size - length\n while (it !== size && b58[it] === 0) {\n it++\n }\n\n // Translate the result into a string.\n let str = LEADER.repeat(zeroes)\n for (; it < size; ++it) str += ALPHABET.charAt(b58[it])\n\n return str\n }\n\n function decodeUnsafe (source) {\n if (typeof source !== 'string') throw new TypeError('Expected String')\n if (source.length === 0) return Buffer.alloc(0)\n\n let psz = 0\n\n // Skip leading spaces.\n if (source[psz] === ' ') return\n\n // Skip and count leading '1's.\n let zeroes = 0\n let length = 0\n while (source[psz] === LEADER) {\n zeroes++\n psz++\n }\n\n // Allocate enough space in big-endian base256 representation.\n const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n const b256 = new Uint8Array(size)\n\n // Process the characters.\n while (source[psz]) {\n // Decode character\n let carry = BASE_MAP[source.charCodeAt(psz)]\n\n // Invalid character\n if (carry === 255) return\n\n let i = 0\n for (let it = size - 1; (carry !== 0 || i < length) && (it !== -1); it--, i++) {\n carry += (BASE * b256[it]) >>> 0\n b256[it] = (carry % 256) >>> 0\n carry = (carry / 256) >>> 0\n }\n\n if (carry !== 0) throw new Error('Non-zero carry')\n length = i\n psz++\n }\n\n // Skip trailing spaces.\n if (source[psz] === ' ') return\n\n // Skip leading zeroes in b256.\n let it = size - length\n while (it !== size && b256[it] === 0) {\n it++\n }\n\n const vch = Buffer.allocUnsafe(zeroes + (size - it))\n vch.fill(0x00, 0, zeroes)\n\n let j = zeroes\n while (it !== size) {\n vch[j++] = b256[it++]\n }\n\n return vch\n }\n\n function decode (string) {\n const buffer = decodeUnsafe(string)\n if (buffer) return buffer\n\n throw new Error('Non-base' + BASE + ' character')\n }\n\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/base-x/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/base64-js/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/base64-js/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack:///./node_modules/base64-js/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bcrypt-pbkdf/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/bcrypt-pbkdf/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar crypto_hash_sha512 = __webpack_require__(/*! tweetnacl */ \"./node_modules/tweetnacl/nacl-fast.js\").lowlevel.crypto_hash;\n\n/*\n * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a\n * result, it retains the original copyright and license. The two files are\n * under slightly different (but compatible) licenses, and are here combined in\n * one file.\n *\n * Credit for the actual porting work goes to:\n * Devi Mandiri <me@devi.web.id>\n */\n\n/*\n * The Blowfish portions are under the following license:\n *\n * Blowfish block cipher for OpenBSD\n * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>\n * All rights reserved.\n *\n * Implementation advice by David Mazieres <dm@lcs.mit.edu>.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * The bcrypt_pbkdf portions are under the following license:\n *\n * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n * Performance improvements (Javascript-specific):\n *\n * Copyright 2016, Joyent Inc\n * Author: Alex Wilson <alex.wilson@joyent.com>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n// Ported from OpenBSD bcrypt_pbkdf.c v1.9\n\nvar BLF_J = 0;\n\nvar Blowfish = function() {\n this.S = [\n new Uint32Array([\n 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,\n 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,\n 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,\n 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,\n 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,\n 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,\n 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,\n 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,\n 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,\n 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,\n 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,\n 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,\n 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,\n 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,\n 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,\n 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,\n 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,\n 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,\n 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,\n 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,\n 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,\n 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,\n 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,\n 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,\n 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,\n 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,\n 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,\n 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,\n 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,\n 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,\n 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,\n 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,\n 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,\n 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,\n 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,\n 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,\n 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,\n 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,\n 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,\n 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,\n 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,\n 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,\n 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),\n new Uint32Array([\n 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,\n 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,\n 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,\n 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,\n 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,\n 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,\n 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,\n 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,\n 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,\n 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,\n 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,\n 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,\n 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,\n 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,\n 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,\n 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,\n 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,\n 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,\n 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,\n 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,\n 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,\n 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,\n 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,\n 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,\n 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,\n 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,\n 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,\n 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,\n 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,\n 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,\n 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,\n 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,\n 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,\n 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,\n 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,\n 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,\n 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,\n 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,\n 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,\n 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,\n 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,\n 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,\n 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),\n new Uint32Array([\n 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,\n 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,\n 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,\n 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,\n 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,\n 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,\n 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,\n 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,\n 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,\n 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,\n 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,\n 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,\n 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,\n 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,\n 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,\n 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,\n 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,\n 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,\n 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,\n 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,\n 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,\n 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,\n 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,\n 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,\n 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,\n 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,\n 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,\n 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,\n 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,\n 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,\n 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,\n 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,\n 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,\n 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,\n 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,\n 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,\n 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,\n 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,\n 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,\n 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,\n 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,\n 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,\n 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),\n new Uint32Array([\n 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,\n 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,\n 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,\n 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,\n 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,\n 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,\n 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,\n 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,\n 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,\n 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,\n 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,\n 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,\n 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,\n 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,\n 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,\n 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,\n 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,\n 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,\n 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,\n 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,\n 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,\n 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,\n 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,\n 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,\n 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,\n 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,\n 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,\n 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,\n 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,\n 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,\n 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,\n 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,\n 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,\n 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,\n 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,\n 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,\n 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,\n 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,\n 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,\n 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,\n 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,\n 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,\n 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])\n ];\n this.P = new Uint32Array([\n 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,\n 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,\n 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,\n 0x9216d5d9, 0x8979fb1b]);\n};\n\nfunction F(S, x8, i) {\n return (((S[0][x8[i+3]] +\n S[1][x8[i+2]]) ^\n S[2][x8[i+1]]) +\n S[3][x8[i]]);\n};\n\nBlowfish.prototype.encipher = function(x, x8) {\n if (x8 === undefined) {\n x8 = new Uint8Array(x.buffer);\n if (x.byteOffset !== 0)\n x8 = x8.subarray(x.byteOffset);\n }\n x[0] ^= this.P[0];\n for (var i = 1; i < 16; i += 2) {\n x[1] ^= F(this.S, x8, 0) ^ this.P[i];\n x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];\n }\n var t = x[0];\n x[0] = x[1] ^ this.P[17];\n x[1] = t;\n};\n\nBlowfish.prototype.decipher = function(x) {\n var x8 = new Uint8Array(x.buffer);\n if (x.byteOffset !== 0)\n x8 = x8.subarray(x.byteOffset);\n x[0] ^= this.P[17];\n for (var i = 16; i > 0; i -= 2) {\n x[1] ^= F(this.S, x8, 0) ^ this.P[i];\n x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];\n }\n var t = x[0];\n x[0] = x[1] ^ this.P[0];\n x[1] = t;\n};\n\nfunction stream2word(data, databytes){\n var i, temp = 0;\n for (i = 0; i < 4; i++, BLF_J++) {\n if (BLF_J >= databytes) BLF_J = 0;\n temp = (temp << 8) | data[BLF_J];\n }\n return temp;\n};\n\nBlowfish.prototype.expand0state = function(key, keybytes) {\n var d = new Uint32Array(2), i, k;\n var d8 = new Uint8Array(d.buffer);\n\n for (i = 0, BLF_J = 0; i < 18; i++) {\n this.P[i] ^= stream2word(key, keybytes);\n }\n BLF_J = 0;\n\n for (i = 0; i < 18; i += 2) {\n this.encipher(d, d8);\n this.P[i] = d[0];\n this.P[i+1] = d[1];\n }\n\n for (i = 0; i < 4; i++) {\n for (k = 0; k < 256; k += 2) {\n this.encipher(d, d8);\n this.S[i][k] = d[0];\n this.S[i][k+1] = d[1];\n }\n }\n};\n\nBlowfish.prototype.expandstate = function(data, databytes, key, keybytes) {\n var d = new Uint32Array(2), i, k;\n\n for (i = 0, BLF_J = 0; i < 18; i++) {\n this.P[i] ^= stream2word(key, keybytes);\n }\n\n for (i = 0, BLF_J = 0; i < 18; i += 2) {\n d[0] ^= stream2word(data, databytes);\n d[1] ^= stream2word(data, databytes);\n this.encipher(d);\n this.P[i] = d[0];\n this.P[i+1] = d[1];\n }\n\n for (i = 0; i < 4; i++) {\n for (k = 0; k < 256; k += 2) {\n d[0] ^= stream2word(data, databytes);\n d[1] ^= stream2word(data, databytes);\n this.encipher(d);\n this.S[i][k] = d[0];\n this.S[i][k+1] = d[1];\n }\n }\n BLF_J = 0;\n};\n\nBlowfish.prototype.enc = function(data, blocks) {\n for (var i = 0; i < blocks; i++) {\n this.encipher(data.subarray(i*2));\n }\n};\n\nBlowfish.prototype.dec = function(data, blocks) {\n for (var i = 0; i < blocks; i++) {\n this.decipher(data.subarray(i*2));\n }\n};\n\nvar BCRYPT_BLOCKS = 8,\n BCRYPT_HASHSIZE = 32;\n\nfunction bcrypt_hash(sha2pass, sha2salt, out) {\n var state = new Blowfish(),\n cdata = new Uint32Array(BCRYPT_BLOCKS), i,\n ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,\n 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,\n 105,116,101]); //\"OxychromaticBlowfishSwatDynamite\"\n\n state.expandstate(sha2salt, 64, sha2pass, 64);\n for (i = 0; i < 64; i++) {\n state.expand0state(sha2salt, 64);\n state.expand0state(sha2pass, 64);\n }\n\n for (i = 0; i < BCRYPT_BLOCKS; i++)\n cdata[i] = stream2word(ciphertext, ciphertext.byteLength);\n for (i = 0; i < 64; i++)\n state.enc(cdata, cdata.byteLength / 8);\n\n for (i = 0; i < BCRYPT_BLOCKS; i++) {\n out[4*i+3] = cdata[i] >>> 24;\n out[4*i+2] = cdata[i] >>> 16;\n out[4*i+1] = cdata[i] >>> 8;\n out[4*i+0] = cdata[i];\n }\n};\n\nfunction bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {\n var sha2pass = new Uint8Array(64),\n sha2salt = new Uint8Array(64),\n out = new Uint8Array(BCRYPT_HASHSIZE),\n tmpout = new Uint8Array(BCRYPT_HASHSIZE),\n countsalt = new Uint8Array(saltlen+4),\n i, j, amt, stride, dest, count,\n origkeylen = keylen;\n\n if (rounds < 1)\n return -1;\n if (passlen === 0 || saltlen === 0 || keylen === 0 ||\n keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))\n return -1;\n\n stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);\n amt = Math.floor((keylen + stride - 1) / stride);\n\n for (i = 0; i < saltlen; i++)\n countsalt[i] = salt[i];\n\n crypto_hash_sha512(sha2pass, pass, passlen);\n\n for (count = 1; keylen > 0; count++) {\n countsalt[saltlen+0] = count >>> 24;\n countsalt[saltlen+1] = count >>> 16;\n countsalt[saltlen+2] = count >>> 8;\n countsalt[saltlen+3] = count;\n\n crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);\n bcrypt_hash(sha2pass, sha2salt, tmpout);\n for (i = out.byteLength; i--;)\n out[i] = tmpout[i];\n\n for (i = 1; i < rounds; i++) {\n crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);\n bcrypt_hash(sha2pass, sha2salt, tmpout);\n for (j = 0; j < out.byteLength; j++)\n out[j] ^= tmpout[j];\n }\n\n amt = Math.min(amt, keylen);\n for (i = 0; i < amt; i++) {\n dest = i * stride + (count - 1);\n if (dest >= origkeylen)\n break;\n key[dest] = out[i];\n }\n keylen -= i;\n }\n\n return 0;\n};\n\nmodule.exports = {\n BLOCKS: BCRYPT_BLOCKS,\n HASHSIZE: BCRYPT_HASHSIZE,\n hash: bcrypt_hash,\n pbkdf: bcrypt_pbkdf\n};\n\n\n//# sourceURL=webpack:///./node_modules/bcrypt-pbkdf/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bencode/lib/decode.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/bencode/lib/decode.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nconst INTEGER_START = 0x69 // 'i'\nconst STRING_DELIM = 0x3A // ':'\nconst DICTIONARY_START = 0x64 // 'd'\nconst LIST_START = 0x6C // 'l'\nconst END_OF_TYPE = 0x65 // 'e'\n\n/**\n * replaces parseInt(buffer.toString('ascii', start, end)).\n * For strings with less then ~30 charachters, this is actually a lot faster.\n *\n * @param {Buffer} data\n * @param {Number} start\n * @param {Number} end\n * @return {Number} calculated number\n */\nfunction getIntFromBuffer (buffer, start, end) {\n var sum = 0\n var sign = 1\n\n for (var i = start; i < end; i++) {\n var num = buffer[i]\n\n if (num < 58 && num >= 48) {\n sum = sum * 10 + (num - 48)\n continue\n }\n\n if (i === start && num === 43) { // +\n continue\n }\n\n if (i === start && num === 45) { // -\n sign = -1\n continue\n }\n\n if (num === 46) { // .\n // its a float. break here.\n break\n }\n\n throw new Error('not a number: buffer[' + i + '] = ' + num)\n }\n\n return sum * sign\n}\n\n/**\n * Decodes bencoded data.\n *\n * @param {Buffer} data\n * @param {Number} start (optional)\n * @param {Number} end (optional)\n * @param {String} encoding (optional)\n * @return {Object|Array|Buffer|String|Number}\n */\nfunction decode (data, start, end, encoding) {\n if (data == null || data.length === 0) {\n return null\n }\n\n if (typeof start !== 'number' && encoding == null) {\n encoding = start\n start = undefined\n }\n\n if (typeof end !== 'number' && encoding == null) {\n encoding = end\n end = undefined\n }\n\n decode.position = 0\n decode.encoding = encoding || null\n\n decode.data = !(Buffer.isBuffer(data))\n ? Buffer.from(data)\n : data.slice(start, end)\n\n decode.bytes = decode.data.length\n\n return decode.next()\n}\n\ndecode.bytes = 0\ndecode.position = 0\ndecode.data = null\ndecode.encoding = null\n\ndecode.next = function () {\n switch (decode.data[decode.position]) {\n case DICTIONARY_START:\n return decode.dictionary()\n case LIST_START:\n return decode.list()\n case INTEGER_START:\n return decode.integer()\n default:\n return decode.buffer()\n }\n}\n\ndecode.find = function (chr) {\n var i = decode.position\n var c = decode.data.length\n var d = decode.data\n\n while (i < c) {\n if (d[i] === chr) return i\n i++\n }\n\n throw new Error(\n 'Invalid data: Missing delimiter \"' +\n String.fromCharCode(chr) + '\" [0x' +\n chr.toString(16) + ']'\n )\n}\n\ndecode.dictionary = function () {\n decode.position++\n\n var dict = {}\n\n while (decode.data[decode.position] !== END_OF_TYPE) {\n dict[decode.buffer()] = decode.next()\n }\n\n decode.position++\n\n return dict\n}\n\ndecode.list = function () {\n decode.position++\n\n var lst = []\n\n while (decode.data[decode.position] !== END_OF_TYPE) {\n lst.push(decode.next())\n }\n\n decode.position++\n\n return lst\n}\n\ndecode.integer = function () {\n var end = decode.find(END_OF_TYPE)\n var number = getIntFromBuffer(decode.data, decode.position + 1, end)\n\n decode.position += end + 1 - decode.position\n\n return number\n}\n\ndecode.buffer = function () {\n var sep = decode.find(STRING_DELIM)\n var length = getIntFromBuffer(decode.data, decode.position, sep)\n var end = ++sep + length\n\n decode.position = end\n\n return decode.encoding\n ? decode.data.toString(decode.encoding, sep, end)\n : decode.data.slice(sep, end)\n}\n\nmodule.exports = decode\n\n\n//# sourceURL=webpack:///./node_modules/bencode/lib/decode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bencode/lib/encode.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/bencode/lib/encode.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\n/**\n * Encodes data in bencode.\n *\n * @param {Buffer|Array|String|Object|Number|Boolean} data\n * @return {Buffer}\n */\nfunction encode (data, buffer, offset) {\n var buffers = []\n var result = null\n\n encode._encode(buffers, data)\n result = Buffer.concat(buffers)\n encode.bytes = result.length\n\n if (Buffer.isBuffer(buffer)) {\n result.copy(buffer, offset)\n return buffer\n }\n\n return result\n}\n\nencode.bytes = -1\nencode._floatConversionDetected = false\n\nencode.getType = function (value) {\n if (Buffer.isBuffer(value)) return 'buffer'\n if (Array.isArray(value)) return 'array'\n if (ArrayBuffer.isView(value)) return 'arraybufferview'\n if (value instanceof Number) return 'number'\n if (value instanceof Boolean) return 'boolean'\n if (value instanceof ArrayBuffer) return 'arraybuffer'\n return typeof value\n}\n\nencode._encode = function (buffers, data) {\n if (data == null) { return }\n\n switch (encode.getType(data)) {\n case 'buffer': encode.buffer(buffers, data); break\n case 'object': encode.dict(buffers, data); break\n case 'array': encode.list(buffers, data); break\n case 'string': encode.string(buffers, data); break\n case 'number': encode.number(buffers, data); break\n case 'boolean': encode.number(buffers, data); break\n case 'arraybufferview': encode.buffer(buffers, Buffer.from(data.buffer, data.byteOffset, data.byteLength)); break\n case 'arraybuffer': encode.buffer(buffers, Buffer.from(data)); break\n }\n}\n\nvar buffE = Buffer.from('e')\nvar buffD = Buffer.from('d')\nvar buffL = Buffer.from('l')\n\nencode.buffer = function (buffers, data) {\n buffers.push(Buffer.from(data.length + ':'), data)\n}\n\nencode.string = function (buffers, data) {\n buffers.push(Buffer.from(Buffer.byteLength(data) + ':' + data))\n}\n\nencode.number = function (buffers, data) {\n var maxLo = 0x80000000\n var hi = (data / maxLo) << 0\n var lo = (data % maxLo) << 0\n var val = hi * maxLo + lo\n\n buffers.push(Buffer.from('i' + val + 'e'))\n\n if (val !== data && !encode._floatConversionDetected) {\n encode._floatConversionDetected = true\n console.warn(\n 'WARNING: Possible data corruption detected with value \"' + data + '\":',\n 'Bencoding only defines support for integers, value was converted to \"' + val + '\"'\n )\n console.trace()\n }\n}\n\nencode.dict = function (buffers, data) {\n buffers.push(buffD)\n\n var j = 0\n var k\n // fix for issue #13 - sorted dicts\n var keys = Object.keys(data).sort()\n var kl = keys.length\n\n for (; j < kl; j++) {\n k = keys[j]\n if (data[k] == null) continue\n encode.string(buffers, k)\n encode._encode(buffers, data[k])\n }\n\n buffers.push(buffE)\n}\n\nencode.list = function (buffers, data) {\n var i = 0\n var c = data.length\n buffers.push(buffL)\n\n for (; i < c; i++) {\n if (data[i] == null) continue\n encode._encode(buffers, data[i])\n }\n\n buffers.push(buffE)\n}\n\nmodule.exports = encode\n\n\n//# sourceURL=webpack:///./node_modules/bencode/lib/encode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bencode/lib/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/bencode/lib/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var bencode = module.exports\n\nbencode.encode = __webpack_require__(/*! ./encode */ \"./node_modules/bencode/lib/encode.js\")\nbencode.decode = __webpack_require__(/*! ./decode */ \"./node_modules/bencode/lib/decode.js\")\n\n/**\n * Determines the amount of bytes\n * needed to encode the given value\n * @param {Object|Array|Buffer|String|Number|Boolean} value\n * @return {Number} byteCount\n */\nbencode.byteLength = bencode.encodingLength = function (value) {\n return bencode.encode(value).length\n}\n\n\n//# sourceURL=webpack:///./node_modules/bencode/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bignumber.js/bignumber.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/bignumber.js/bignumber.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalObject) {\r\n 'use strict';\r\n\r\n/*\r\n * bignumber.js v8.1.1\r\n * A JavaScript library for arbitrary-precision arithmetic.\r\n * https://github.com/MikeMcl/bignumber.js\r\n * Copyright (c) 2019 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Licensed.\r\n *\r\n * BigNumber.prototype methods | BigNumber methods\r\n * |\r\n * absoluteValue abs | clone\r\n * comparedTo | config set\r\n * decimalPlaces dp | DECIMAL_PLACES\r\n * dividedBy div | ROUNDING_MODE\r\n * dividedToIntegerBy idiv | EXPONENTIAL_AT\r\n * exponentiatedBy pow | RANGE\r\n * integerValue | CRYPTO\r\n * isEqualTo eq | MODULO_MODE\r\n * isFinite | POW_PRECISION\r\n * isGreaterThan gt | FORMAT\r\n * isGreaterThanOrEqualTo gte | ALPHABET\r\n * isInteger | isBigNumber\r\n * isLessThan lt | maximum max\r\n * isLessThanOrEqualTo lte | minimum min\r\n * isNaN | random\r\n * isNegative | sum\r\n * isPositive |\r\n * isZero |\r\n * minus |\r\n * modulo mod |\r\n * multipliedBy times |\r\n * negated |\r\n * plus |\r\n * precision sd |\r\n * shiftedBy |\r\n * squareRoot sqrt |\r\n * toExponential |\r\n * toFixed |\r\n * toFormat |\r\n * toFraction |\r\n * toJSON |\r\n * toNumber |\r\n * toPrecision |\r\n * toString |\r\n * valueOf |\r\n *\r\n */\r\n\r\n\r\n var BigNumber,\r\n isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n hasSymbol = typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol',\r\n\r\n mathceil = Math.ceil,\r\n mathfloor = Math.floor,\r\n\r\n bignumberError = '[BigNumber Error] ',\r\n tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n BASE = 1e14,\r\n LOG_BASE = 14,\r\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\r\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\r\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n SQRT_BASE = 1e7,\r\n\r\n // EDITABLE\r\n // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n MAX = 1E9; // 0 to MAX_INT32\r\n\r\n\r\n /*\r\n * Create and return a BigNumber constructor.\r\n */\r\n function clone(configObject) {\r\n var div, convertBase, parseNumeric,\r\n P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r\n ONE = new BigNumber(1),\r\n\r\n\r\n //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n // The default values below must be integers within the inclusive ranges stated.\r\n // The values can also be changed at run-time using BigNumber.set.\r\n\r\n // The maximum number of decimal places for operations involving division.\r\n DECIMAL_PLACES = 20, // 0 to MAX\r\n\r\n // The rounding mode used when rounding to the above decimal places, and when using\r\n // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n // UP 0 Away from zero.\r\n // DOWN 1 Towards zero.\r\n // CEIL 2 Towards +Infinity.\r\n // FLOOR 3 Towards -Infinity.\r\n // HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n ROUNDING_MODE = 4, // 0 to 8\r\n\r\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n // The exponent value at and beneath which toString returns exponential notation.\r\n // Number type: -7\r\n TO_EXP_NEG = -7, // 0 to -MAX\r\n\r\n // The exponent value at and above which toString returns exponential notation.\r\n // Number type: 21\r\n TO_EXP_POS = 21, // 0 to MAX\r\n\r\n // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // Number type: -324 (5e-324)\r\n MIN_EXP = -1e7, // -1 to -MAX\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // Number type: 308 (1.7976931348623157e+308)\r\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n MAX_EXP = 1e7, // 1 to MAX\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n CRYPTO = false, // true or false\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend.\r\n // This modulo mode is commonly known as 'truncated division' and is\r\n // equivalent to (a % n) in JavaScript.\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n // The remainder is always positive.\r\n //\r\n // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n // modes are commonly used for the modulus operation.\r\n // Although the other rounding modes can also be used, they may not give useful results.\r\n MODULO_MODE = 1, // 0 to 9\r\n\r\n // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n POW_PRECISION = 0, // 0 to MAX\r\n\r\n // The format specification used by the BigNumber.prototype.toFormat method.\r\n FORMAT = {\r\n prefix: '',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n groupSeparator: ',',\r\n decimalSeparator: '.',\r\n fractionGroupSize: 0,\r\n fractionGroupSeparator: '\\xA0', // non-breaking space\r\n suffix: ''\r\n },\r\n\r\n // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r\n // '-', '.', whitespace, or repeated character.\r\n // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz';\r\n\r\n\r\n //------------------------------------------------------------------------------------------\r\n\r\n\r\n // CONSTRUCTOR\r\n\r\n\r\n /*\r\n * The BigNumber constructor and exported function.\r\n * Create and return a new instance of a BigNumber object.\r\n *\r\n * v {number|string|BigNumber} A numeric value.\r\n * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r\n */\r\n function BigNumber(v, b) {\r\n var alphabet, c, caseChanged, e, i, isNum, len, str,\r\n x = this;\r\n\r\n // Enable constructor call without `new`.\r\n if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r\n\r\n if (b == null) {\r\n\r\n if (v && v._isBigNumber === true) {\r\n x.s = v.s;\r\n\r\n if (!v.c || v.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else if (v.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = v.e;\r\n x.c = v.c.slice();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if ((isNum = typeof v == 'number') && v * 0 == 0) {\r\n\r\n // Use `1 / n` to handle minus zero also.\r\n x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r\n\r\n // Fast path for integers, where n < 2147483648 (2**31).\r\n if (v === ~~v) {\r\n for (e = 0, i = v; i >= 10; i /= 10, e++);\r\n\r\n if (e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else {\r\n x.e = e;\r\n x.c = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n str = String(v);\r\n } else {\r\n\r\n if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r\n\r\n x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n\r\n // Allow exponential notation to be used with base 10 argument, while\r\n // also rounding to DECIMAL_PLACES as with other bases.\r\n if (b == 10) {\r\n x = new BigNumber(v);\r\n return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r\n }\r\n\r\n str = String(v);\r\n\r\n if (isNum = typeof v == 'number') {\r\n\r\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r\n\r\n x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (BigNumber.DEBUG && str.replace(/^0\\.0*|\\./, '').length > 15) {\r\n throw Error\r\n (tooManyDigits + v);\r\n }\r\n } else {\r\n x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n alphabet = ALPHABET.slice(0, b);\r\n e = i = 0;\r\n\r\n // Check that str is a valid base b number.\r\n // Don't use RegExp, so alphabet can contain special characters.\r\n for (len = str.length; i < len; i++) {\r\n if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r\n if (c == '.') {\r\n\r\n // If '.' is not the first character and it has not be found before.\r\n if (i > e) {\r\n e = len;\r\n continue;\r\n }\r\n } else if (!caseChanged) {\r\n\r\n // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r\n str == str.toLowerCase() && (str = str.toUpperCase())) {\r\n caseChanged = true;\r\n i = -1;\r\n e = 0;\r\n continue;\r\n }\r\n }\r\n\r\n return parseNumeric(x, String(v), isNum, b);\r\n }\r\n }\r\n\r\n // Prevent later check for length on converted number.\r\n isNum = false;\r\n str = convertBase(str, b, 10, x.s);\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n else e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(--len) === 48;);\r\n\r\n if (str = str.slice(i, ++len)) {\r\n len -= i;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (isNum && BigNumber.DEBUG &&\r\n len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r\n throw Error\r\n (tooManyDigits + (x.s * v));\r\n }\r\n\r\n // Overflow?\r\n if ((e = e - i - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n x.c = x.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = e;\r\n x.c = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first element of the coefficient array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE; // i < 1\r\n\r\n if (i < len) {\r\n if (i) x.c.push(+str.slice(0, i));\r\n\r\n for (len -= LOG_BASE; i < len;) {\r\n x.c.push(+str.slice(i, i += LOG_BASE));\r\n }\r\n\r\n i = LOG_BASE - (str = str.slice(i)).length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--; str += '0');\r\n x.c.push(+str);\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n\r\n // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n BigNumber.clone = clone;\r\n\r\n BigNumber.ROUND_UP = 0;\r\n BigNumber.ROUND_DOWN = 1;\r\n BigNumber.ROUND_CEIL = 2;\r\n BigNumber.ROUND_FLOOR = 3;\r\n BigNumber.ROUND_HALF_UP = 4;\r\n BigNumber.ROUND_HALF_DOWN = 5;\r\n BigNumber.ROUND_HALF_EVEN = 6;\r\n BigNumber.ROUND_HALF_CEIL = 7;\r\n BigNumber.ROUND_HALF_FLOOR = 8;\r\n BigNumber.EUCLID = 9;\r\n\r\n\r\n /*\r\n * Configure infrequently-changing library-wide settings.\r\n *\r\n * Accept an object with the following optional properties (if the value of a property is\r\n * a number, it must be an integer within the inclusive range stated):\r\n *\r\n * DECIMAL_PLACES {number} 0 to MAX\r\n * ROUNDING_MODE {number} 0 to 8\r\n * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]\r\n * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]\r\n * CRYPTO {boolean} true or false\r\n * MODULO_MODE {number} 0 to 9\r\n * POW_PRECISION {number} 0 to MAX\r\n * ALPHABET {string} A string of two or more unique characters which does\r\n * not contain '.'.\r\n * FORMAT {object} An object with some of the following properties:\r\n * prefix {string}\r\n * groupSize {number}\r\n * secondaryGroupSize {number}\r\n * groupSeparator {string}\r\n * decimalSeparator {string}\r\n * fractionGroupSize {number}\r\n * fractionGroupSeparator {string}\r\n * suffix {string}\r\n *\r\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n *\r\n * E.g.\r\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n *\r\n * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n *\r\n * Return an object with the properties current values.\r\n */\r\n BigNumber.config = BigNumber.set = function (obj) {\r\n var p, v;\r\n\r\n if (obj != null) {\r\n\r\n if (typeof obj == 'object') {\r\n\r\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n DECIMAL_PLACES = v;\r\n }\r\n\r\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 8, p);\r\n ROUNDING_MODE = v;\r\n }\r\n\r\n // EXPONENTIAL_AT {number|number[]}\r\n // Integer, -MAX to MAX inclusive or\r\n // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, 0, p);\r\n intCheck(v[1], 0, MAX, p);\r\n TO_EXP_NEG = v[0];\r\n TO_EXP_POS = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r\n }\r\n }\r\n\r\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n if (obj.hasOwnProperty(p = 'RANGE')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, -1, p);\r\n intCheck(v[1], 1, MAX, p);\r\n MIN_EXP = v[0];\r\n MAX_EXP = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n if (v) {\r\n MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' cannot be zero: ' + v);\r\n }\r\n }\r\n }\r\n\r\n // CRYPTO {boolean} true or false.\r\n // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n // '[BigNumber Error] crypto unavailable'\r\n if (obj.hasOwnProperty(p = 'CRYPTO')) {\r\n v = obj[p];\r\n if (v === !!v) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n CRYPTO = v;\r\n } else {\r\n CRYPTO = !v;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n } else {\r\n CRYPTO = v;\r\n }\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' not true or false: ' + v);\r\n }\r\n }\r\n\r\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 9, p);\r\n MODULO_MODE = v;\r\n }\r\n\r\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n POW_PRECISION = v;\r\n }\r\n\r\n // FORMAT {object}\r\n // '[BigNumber Error] FORMAT not an object: {v}'\r\n if (obj.hasOwnProperty(p = 'FORMAT')) {\r\n v = obj[p];\r\n if (typeof v == 'object') FORMAT = v;\r\n else throw Error\r\n (bignumberError + p + ' not an object: ' + v);\r\n }\r\n\r\n // ALPHABET {string}\r\n // '[BigNumber Error] ALPHABET invalid: {v}'\r\n if (obj.hasOwnProperty(p = 'ALPHABET')) {\r\n v = obj[p];\r\n\r\n // Disallow if only one character,\r\n // or if it contains '+', '-', '.', whitespace, or a repeated character.\r\n if (typeof v == 'string' && !/^.$|[+-.\\s]|(.).*\\1/.test(v)) {\r\n ALPHABET = v;\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' invalid: ' + v);\r\n }\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Object expected: {v}'\r\n throw Error\r\n (bignumberError + 'Object expected: ' + obj);\r\n }\r\n }\r\n\r\n return {\r\n DECIMAL_PLACES: DECIMAL_PLACES,\r\n ROUNDING_MODE: ROUNDING_MODE,\r\n EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r\n RANGE: [MIN_EXP, MAX_EXP],\r\n CRYPTO: CRYPTO,\r\n MODULO_MODE: MODULO_MODE,\r\n POW_PRECISION: POW_PRECISION,\r\n FORMAT: FORMAT,\r\n ALPHABET: ALPHABET\r\n };\r\n };\r\n\r\n\r\n /*\r\n * Return true if v is a BigNumber instance, otherwise return false.\r\n *\r\n * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r\n *\r\n * v {any}\r\n *\r\n * '[BigNumber Error] Invalid BigNumber: {v}'\r\n */\r\n BigNumber.isBigNumber = function (v) {\r\n if (!v || v._isBigNumber !== true) return false;\r\n if (!BigNumber.DEBUG) return true;\r\n\r\n var i, n,\r\n c = v.c,\r\n e = v.e,\r\n s = v.s;\r\n\r\n out: if ({}.toString.call(c) == '[object Array]') {\r\n\r\n if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r\n\r\n // If the first element is zero, the BigNumber value must be zero.\r\n if (c[0] === 0) {\r\n if (e === 0 && c.length === 1) return true;\r\n break out;\r\n }\r\n\r\n // Calculate number of digits that c[0] should have, based on the exponent.\r\n i = (e + 1) % LOG_BASE;\r\n if (i < 1) i += LOG_BASE;\r\n\r\n // Calculate number of digits of c[0].\r\n //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r\n if (String(c[0]).length == i) {\r\n\r\n for (i = 0; i < c.length; i++) {\r\n n = c[i];\r\n if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r\n }\r\n\r\n // Last element cannot be zero, unless it is the only element.\r\n if (n !== 0) return true;\r\n }\r\n }\r\n\r\n // Infinity/NaN\r\n } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r\n return true;\r\n }\r\n\r\n throw Error\r\n (bignumberError + 'Invalid BigNumber: ' + v);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.maximum = BigNumber.max = function () {\r\n return maxOrMin(arguments, P.lt);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.minimum = BigNumber.min = function () {\r\n return maxOrMin(arguments, P.gt);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n * zeros are produced).\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n * '[BigNumber Error] crypto unavailable'\r\n */\r\n BigNumber.random = (function () {\r\n var pow2_53 = 0x20000000000000;\r\n\r\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n // Check if Math.random() produces more than 32 bits of randomness.\r\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n ? function () { return mathfloor(Math.random() * pow2_53); }\r\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n (Math.random() * 0x800000 | 0); };\r\n\r\n return function (dp) {\r\n var a, b, e, k, v,\r\n i = 0,\r\n c = [],\r\n rand = new BigNumber(ONE);\r\n\r\n if (dp == null) dp = DECIMAL_PLACES;\r\n else intCheck(dp, 0, MAX);\r\n\r\n k = mathceil(dp / LOG_BASE);\r\n\r\n if (CRYPTO) {\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n if (crypto.getRandomValues) {\r\n\r\n a = crypto.getRandomValues(new Uint32Array(k *= 2));\r\n\r\n for (; i < k;) {\r\n\r\n // 53 bits:\r\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n // 11111 11111111 11111111\r\n // 0x20000 is 2^21.\r\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n // Rejection sampling:\r\n // 0 <= v < 9007199254740992\r\n // Probability that v >= 9e15, is\r\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n if (v >= 9e15) {\r\n b = crypto.getRandomValues(new Uint32Array(2));\r\n a[i] = b[0];\r\n a[i + 1] = b[1];\r\n } else {\r\n\r\n // 0 <= v <= 8999999999999999\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 2;\r\n }\r\n }\r\n i = k / 2;\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n a = crypto.randomBytes(k *= 7);\r\n\r\n for (; i < k;) {\r\n\r\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n // 0 <= v < 9007199254740992\r\n v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r\n (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r\n (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r\n\r\n if (v >= 9e15) {\r\n crypto.randomBytes(7).copy(a, i);\r\n } else {\r\n\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 7;\r\n }\r\n }\r\n i = k / 7;\r\n } else {\r\n CRYPTO = false;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n }\r\n\r\n // Use Math.random.\r\n if (!CRYPTO) {\r\n\r\n for (; i < k;) {\r\n v = random53bitInt();\r\n if (v < 9e15) c[i++] = v % 1e14;\r\n }\r\n }\r\n\r\n k = c[--i];\r\n dp %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to dp.\r\n if (k && dp) {\r\n v = POWS_TEN[LOG_BASE - dp];\r\n c[i] = mathfloor(k / v) * v;\r\n }\r\n\r\n // Remove trailing elements which are zero.\r\n for (; c[i] === 0; c.pop(), i--);\r\n\r\n // Zero?\r\n if (i < 0) {\r\n c = [e = 0];\r\n } else {\r\n\r\n // Remove leading elements which are zero and adjust exponent accordingly.\r\n for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n // Count the digits of the first element of c to determine leading zeros, and...\r\n for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n // adjust the exponent accordingly.\r\n if (i < LOG_BASE) e -= LOG_BASE - i;\r\n }\r\n\r\n rand.e = e;\r\n rand.c = c;\r\n return rand;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the sum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.sum = function () {\r\n var i = 1,\r\n args = arguments,\r\n sum = new BigNumber(args[0]);\r\n for (; i < args.length;) sum = sum.plus(args[i++]);\r\n return sum;\r\n };\r\n\r\n\r\n // PRIVATE FUNCTIONS\r\n\r\n\r\n // Called by BigNumber and BigNumber.prototype.toString.\r\n convertBase = (function () {\r\n var decimal = '0123456789';\r\n\r\n /*\r\n * Convert string of baseIn to an array of numbers of baseOut.\r\n * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n */\r\n function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n // If the caller is toString, we are converting from base 10 to baseOut.\r\n // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n return function (str, baseIn, baseOut, sign, callerIsToString) {\r\n var alphabet, d, e, k, r, x, xc, y,\r\n i = str.indexOf('.'),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace('.', '');\r\n y = new BigNumber(baseIn);\r\n x = y.pow(str.length - i);\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n\r\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r\n 10, baseOut, decimal);\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n\r\n xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r\n ? (alphabet = ALPHABET, decimal)\r\n : (alphabet = decimal, ALPHABET));\r\n\r\n // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--k] == 0; xc.pop());\r\n\r\n // Zero?\r\n if (!xc[0]) return alphabet.charAt(0);\r\n\r\n // Does str represent an integer? If so, no need for the division.\r\n if (i < 0) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // The sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div(x, y, dp, rm, baseOut);\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n // xc now represents str converted to baseOut.\r\n\r\n // THe index of the rounding digit.\r\n d = e + dp + 1;\r\n\r\n // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n\r\n // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n // If the index of the rounding digit is not greater than zero, or xc represents\r\n // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n // such as 0.00001.\r\n if (d < 1 || !xc[0]) {\r\n\r\n // 1^-dp or 0\r\n str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r\n } else {\r\n\r\n // Truncate xc to the required number of decimal places.\r\n xc.length = d;\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (--baseOut; ++xc[--d] > baseOut;) {\r\n xc[d] = 0;\r\n\r\n if (!d) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (k = xc.length; !xc[--k];);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r\n\r\n // Add leading zeros, decimal point and trailing zeros as required.\r\n str = toFixedPoint(str, e, alphabet.charAt(0));\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n };\r\n })();\r\n\r\n\r\n // Perform division in the specified base. Called by div and convertBase.\r\n div = (function () {\r\n\r\n // Assume non-zero x and k.\r\n function multiply(x, k, base) {\r\n var m, temp, xlo, xhi,\r\n carry = 0,\r\n i = x.length,\r\n klo = k % SQRT_BASE,\r\n khi = k / SQRT_BASE | 0;\r\n\r\n for (x = x.slice(); i--;) {\r\n xlo = x[i] % SQRT_BASE;\r\n xhi = x[i] / SQRT_BASE | 0;\r\n m = khi * xlo + xhi * klo;\r\n temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r\n carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r\n x[i] = temp % base;\r\n }\r\n\r\n if (carry) x = [carry].concat(x);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, cmp;\r\n\r\n if (aL != bL) {\r\n cmp = aL > bL ? 1 : -1;\r\n } else {\r\n\r\n for (i = cmp = 0; i < aL; i++) {\r\n\r\n if (a[i] != b[i]) {\r\n cmp = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1; a.splice(0, 1));\r\n }\r\n\r\n // x: dividend, y: divisor.\r\n return function (x, y, dp, rm, base) {\r\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n yL, yz,\r\n s = x.s == y.s ? 1 : -1,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xc || !xc[0] || !yc || !yc[0]) {\r\n\r\n return new BigNumber(\r\n\r\n // Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r\n\r\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n );\r\n }\r\n\r\n q = new BigNumber(s);\r\n qc = q.c = [];\r\n e = x.e - y.e;\r\n s = dp + e + 1;\r\n\r\n if (!base) {\r\n base = BASE;\r\n e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r\n s = s / LOG_BASE | 0;\r\n }\r\n\r\n // Result exponent may be one less then the current value of e.\r\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n for (i = 0; yc[i] == (xc[i] || 0); i++);\r\n\r\n if (yc[i] > (xc[i] || 0)) e--;\r\n\r\n if (s < 0) {\r\n qc.push(1);\r\n more = true;\r\n } else {\r\n xL = xc.length;\r\n yL = yc.length;\r\n i = 0;\r\n s += 2;\r\n\r\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n n = mathfloor(base / (yc[0] + 1));\r\n\r\n // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r\n // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r\n if (n > 1) {\r\n yc = multiply(yc, n, base);\r\n xc = multiply(xc, n, base);\r\n yL = yc.length;\r\n xL = xc.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xc.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL; rem[remL++] = 0);\r\n yz = yc.slice();\r\n yz = [0].concat(yz);\r\n yc0 = yc[0];\r\n if (yc[1] >= base / 2) yc0++;\r\n // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r\n\r\n do {\r\n n = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yc, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, n.\r\n\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // n is how many times the divisor goes into the current remainder.\r\n n = mathfloor(rem0 / yc0);\r\n\r\n // Algorithm:\r\n // product = divisor multiplied by trial digit (n).\r\n // Compare product and remainder.\r\n // If product is greater than remainder:\r\n // Subtract divisor from product, decrement trial digit.\r\n // Subtract product from remainder.\r\n // If product was less than remainder at the last compare:\r\n // Compare new remainder and divisor.\r\n // If remainder is greater than divisor:\r\n // Subtract divisor from remainder, increment trial digit.\r\n\r\n if (n > 1) {\r\n\r\n // n may be > base only when base is 3.\r\n if (n >= base) n = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiply(yc, n, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n // If product > remainder then trial digit n too high.\r\n // n is 1 too high about 5% of the time, and is not known to have\r\n // ever been more than 1 too high.\r\n while (compare(prod, rem, prodL, remL) == 1) {\r\n n--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yc, prodL, base);\r\n prodL = prod.length;\r\n cmp = 1;\r\n }\r\n } else {\r\n\r\n // n is 0 or 1, cmp is -1.\r\n // If n is 0, there is no need to compare yc and rem again below,\r\n // so change cmp to 1 to avoid it.\r\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n if (n == 0) {\r\n\r\n // divisor < remainder, so n must be at least 1.\r\n cmp = n = 1;\r\n }\r\n\r\n // product = divisor\r\n prod = yc.slice();\r\n prodL = prod.length;\r\n }\r\n\r\n if (prodL < remL) prod = [0].concat(prod);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n remL = rem.length;\r\n\r\n // If product was < remainder.\r\n if (cmp == -1) {\r\n\r\n // Compare divisor and new remainder.\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n // Trial digit n too low.\r\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n while (compare(yc, rem, yL, remL) < 1) {\r\n n++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yc, remL, base);\r\n remL = rem.length;\r\n }\r\n }\r\n } else if (cmp === 0) {\r\n n++;\r\n rem = [0];\r\n } // else cmp === 1 and n will be 0\r\n\r\n // Add the next digit, n, to the result array.\r\n qc[i++] = n;\r\n\r\n // Update the remainder.\r\n if (rem[0]) {\r\n rem[remL++] = xc[xi] || 0;\r\n } else {\r\n rem = [xc[xi]];\r\n remL = 1;\r\n }\r\n } while ((xi++ < xL || rem[0] != null) && s--);\r\n\r\n more = rem[0] != null;\r\n\r\n // Leading zero?\r\n if (!qc[0]) qc.splice(0, 1);\r\n }\r\n\r\n if (base == BASE) {\r\n\r\n // To calculate q.e, first get the number of digits of qc[0].\r\n for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r\n\r\n round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r\n\r\n // Caller is convertBase.\r\n } else {\r\n q.e = e;\r\n q.r = +more;\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n * notation rounded to the specified decimal places or significant digits.\r\n *\r\n * n: a BigNumber.\r\n * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n * rm: the rounding mode.\r\n * id: 1 (toExponential) or 2 (toPrecision).\r\n */\r\n function format(n, i, rm, id) {\r\n var c0, e, ne, len, str;\r\n\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n if (!n.c) return n.toString();\r\n\r\n c0 = n.c[0];\r\n ne = n.e;\r\n\r\n if (i == null) {\r\n str = coeffToString(n.c);\r\n str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r\n ? toExponential(str, ne)\r\n : toFixedPoint(str, ne, '0');\r\n } else {\r\n n = round(new BigNumber(n), i, rm);\r\n\r\n // n.e may have changed if the value was rounded up.\r\n e = n.e;\r\n\r\n str = coeffToString(n.c);\r\n len = str.length;\r\n\r\n // toPrecision returns exponential notation if the number of significant digits\r\n // specified is less than the number of digits necessary to represent the integer\r\n // part of the value in fixed-point notation.\r\n\r\n // Exponential notation.\r\n if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r\n\r\n // Append zeros?\r\n for (; len < i; str += '0', len++);\r\n str = toExponential(str, e);\r\n\r\n // Fixed-point notation.\r\n } else {\r\n i -= ne;\r\n str = toFixedPoint(str, e, '0');\r\n\r\n // Append zeros?\r\n if (e + 1 > len) {\r\n if (--i > 0) for (str += '.'; i--; str += '0');\r\n } else {\r\n i += e - len;\r\n if (i > 0) {\r\n if (e + 1 == len) str += '.';\r\n for (; i--; str += '0');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return n.s < 0 && c0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Handle BigNumber.max and BigNumber.min.\r\n function maxOrMin(args, method) {\r\n var n,\r\n i = 1,\r\n m = new BigNumber(args[0]);\r\n\r\n for (; i < args.length; i++) {\r\n n = new BigNumber(args[i]);\r\n\r\n // If any number is NaN, return NaN.\r\n if (!n.s) {\r\n m = n;\r\n break;\r\n } else if (method.call(m, n)) {\r\n m = n;\r\n }\r\n }\r\n\r\n return m;\r\n }\r\n\r\n\r\n /*\r\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n * Called by minus, plus and times.\r\n */\r\n function normalise(n, c, e) {\r\n var i = 1,\r\n j = c.length;\r\n\r\n // Remove trailing zeros.\r\n for (; !c[--j]; c.pop());\r\n\r\n // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n for (j = c[0]; j >= 10; j /= 10, i++);\r\n\r\n // Overflow?\r\n if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n n.c = n.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n n.c = [n.e = 0];\r\n } else {\r\n n.e = e;\r\n n.c = c;\r\n }\r\n\r\n return n;\r\n }\r\n\r\n\r\n // Handle values that fail the validity test in BigNumber.\r\n parseNumeric = (function () {\r\n var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n dotAfter = /^([^.]+)\\.$/,\r\n dotBefore = /^\\.([^.]+)$/,\r\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n return function (x, str, isNum, b) {\r\n var base,\r\n s = isNum ? str : str.replace(whitespaceOrPlus, '');\r\n\r\n // No exception on ±Infinity or NaN.\r\n if (isInfinityOrNaN.test(s)) {\r\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n } else {\r\n if (!isNum) {\r\n\r\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n s = s.replace(basePrefix, function (m, p1, p2) {\r\n base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n return !b || b == base ? p1 : m;\r\n });\r\n\r\n if (b) {\r\n base = b;\r\n\r\n // E.g. '1.' to '1', '.1' to '0.1'\r\n s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r\n }\r\n\r\n if (str != s) return new BigNumber(s, base);\r\n }\r\n\r\n // '[BigNumber Error] Not a number: {n}'\r\n // '[BigNumber Error] Not a base {b} number: {n}'\r\n if (BigNumber.DEBUG) {\r\n throw Error\r\n (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r\n }\r\n\r\n // NaN\r\n x.s = null;\r\n }\r\n\r\n x.c = x.e = null;\r\n }\r\n })();\r\n\r\n\r\n /*\r\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n * If r is truthy, it is known that there are more digits after the rounding digit.\r\n */\r\n function round(x, sd, rm, r) {\r\n var d, i, j, k, n, ni, rd,\r\n xc = x.c,\r\n pows10 = POWS_TEN;\r\n\r\n // if x is not Infinity or NaN...\r\n if (xc) {\r\n\r\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n // ni is the index of n within x.c.\r\n // d is the number of digits of n.\r\n // i is the index of rd within n including leading zeros.\r\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n out: {\r\n\r\n // Get the number of digits of the first element of xc.\r\n for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r\n i = sd - d;\r\n\r\n // If the rounding digit is in the first element of xc...\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n n = xc[ni = 0];\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = n / pows10[d - j - 1] % 10 | 0;\r\n } else {\r\n ni = mathceil((i + 1) / LOG_BASE);\r\n\r\n if (ni >= xc.length) {\r\n\r\n if (r) {\r\n\r\n // Needed by sqrt.\r\n for (; xc.length <= ni; xc.push(0));\r\n n = rd = 0;\r\n d = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n n = k = xc[ni];\r\n\r\n // Get the number of digits of n.\r\n for (d = 1; k >= 10; k /= 10, d++);\r\n\r\n // Get the index of rd within n.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within n, adjusted for leading zeros.\r\n // The number of leading zeros of n is given by LOG_BASE - d.\r\n j = i - LOG_BASE + d;\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;\r\n }\r\n }\r\n\r\n r = r || sd < 0 ||\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n // The expression n % pows10[d - j - 1] returns all digits of n to the right\r\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r\n\r\n r = rm < 4\r\n ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xc[0]) {\r\n xc.length = 0;\r\n\r\n if (r) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xc.length = ni;\r\n k = 1;\r\n ni--;\r\n } else {\r\n xc.length = ni + 1;\r\n k = pows10[LOG_BASE - i];\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of n.\r\n xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r\n }\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n for (; ;) {\r\n\r\n // If the digit to be rounded up is in the first element of xc...\r\n if (ni == 0) {\r\n\r\n // i will be the length of xc[0] before k is added.\r\n for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r\n j = xc[0] += k;\r\n for (k = 1; j >= 10; j /= 10, k++);\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xc[0] == BASE) xc[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xc[ni] += k;\r\n if (xc[ni] != BASE) break;\r\n xc[ni--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; xc[--i] === 0; xc.pop());\r\n }\r\n\r\n // Overflow? Infinity.\r\n if (x.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n\r\n // Underflow? Zero.\r\n } else if (x.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function valueOf(n) {\r\n var str,\r\n e = n.e;\r\n\r\n if (e === null) return n.toString();\r\n\r\n str = coeffToString(n.c);\r\n\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(str, e)\r\n : toFixedPoint(str, e, '0');\r\n\r\n return n.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new BigNumber(this);\r\n if (x.s < 0) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * 0 if they have the same value,\r\n * or null if the value of either is NaN.\r\n */\r\n P.comparedTo = function (y, b) {\r\n return compare(this, new BigNumber(y, b));\r\n };\r\n\r\n\r\n /*\r\n * If dp is undefined or null or true or false, return the number of decimal places of the\r\n * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n *\r\n * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.decimalPlaces = P.dp = function (dp, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), dp + x.e + 1, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last number.\r\n if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r\n if (n < 0) n = 0;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.dividedBy = P.div = function (y, b) {\r\n return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n * BigNumber by the value of BigNumber(y, b).\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y, b) {\r\n return div(this, new BigNumber(y, b), 0, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n *\r\n * If m is present, return the result modulo m.\r\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n *\r\n * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r\n * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n *\r\n * n {number|string|BigNumber} The exponent. An integer.\r\n * [m] {number|string|BigNumber} The modulus.\r\n *\r\n * '[BigNumber Error] Exponent not an integer: {n}'\r\n */\r\n P.exponentiatedBy = P.pow = function (n, m) {\r\n var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r\n x = this;\r\n\r\n n = new BigNumber(n);\r\n\r\n // Allow NaN and ±Infinity, but not other non-integers.\r\n if (n.c && !n.isInteger()) {\r\n throw Error\r\n (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r\n }\r\n\r\n if (m != null) m = new BigNumber(m);\r\n\r\n // Exponent of MAX_SAFE_INTEGER is 15.\r\n nIsBig = n.e > 14;\r\n\r\n // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r\n if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r\n\r\n // The sign of the result of pow when x is negative depends on the evenness of n.\r\n // If +n overflows to ±Infinity, the evenness of n would be not be known.\r\n y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));\r\n return m ? y.mod(m) : y;\r\n }\r\n\r\n nIsNeg = n.s < 0;\r\n\r\n if (m) {\r\n\r\n // x % m returns NaN if abs(m) is zero, or m is NaN.\r\n if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r\n\r\n isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r\n\r\n if (isModExp) x = x.mod(m);\r\n\r\n // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r\n // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r\n } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r\n // [1, 240000000]\r\n ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r\n // [80000000000000] [99999750000000]\r\n : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r\n\r\n // If x is negative and n is odd, k = -0, else k = 0.\r\n k = x.s < 0 && isOdd(n) ? -0 : 0;\r\n\r\n // If x >= 1, k = ±Infinity.\r\n if (x.e > -1) k = 1 / k;\r\n\r\n // If n is negative return ±0, else return ±Infinity.\r\n return new BigNumber(nIsNeg ? 1 / k : k);\r\n\r\n } else if (POW_PRECISION) {\r\n\r\n // Truncating each coefficient array to a length of k after each multiplication\r\n // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n // i.e. there will be a minimum of 28 guard digits retained.\r\n k = mathceil(POW_PRECISION / LOG_BASE + 2);\r\n }\r\n\r\n if (nIsBig) {\r\n half = new BigNumber(0.5);\r\n if (nIsNeg) n.s = 1;\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = Math.abs(+valueOf(n));\r\n nIsOdd = i % 2;\r\n }\r\n\r\n y = new BigNumber(ONE);\r\n\r\n // Performs 54 loop iterations for n of 9007199254740991.\r\n for (; ;) {\r\n\r\n if (nIsOdd) {\r\n y = y.times(x);\r\n if (!y.c) break;\r\n\r\n if (k) {\r\n if (y.c.length > k) y.c.length = k;\r\n } else if (isModExp) {\r\n y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (i) {\r\n i = mathfloor(i / 2);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n } else {\r\n n = n.times(half);\r\n round(n, n.e + 1, 1);\r\n\r\n if (n.e > 14) {\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = +valueOf(n);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n }\r\n }\r\n\r\n x = x.times(x);\r\n\r\n if (k) {\r\n if (x.c && x.c.length > k) x.c.length = k;\r\n } else if (isModExp) {\r\n x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (isModExp) return y;\r\n if (nIsNeg) y = ONE.div(y);\r\n\r\n return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n */\r\n P.integerValue = function (rm) {\r\n var n = new BigNumber(this);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n return round(n, n.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isEqualTo = P.eq = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n */\r\n P.isFinite = function () {\r\n return !!this.c;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isGreaterThan = P.gt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r\n\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n */\r\n P.isInteger = function () {\r\n return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isLessThan = P.lt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isLessThanOrEqualTo = P.lte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is negative, otherwise return false.\r\n */\r\n P.isNegative = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is positive, otherwise return false.\r\n */\r\n P.isPositive = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n */\r\n P.isZero = function () {\r\n return !!this.c && this.c[0] == 0;\r\n };\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.minus = function (y, b) {\r\n var i, j, t, xLTy,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r\n\r\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n ROUNDING_MODE == 3 ? -0 : 0);\r\n }\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Determine which is the bigger number.\r\n if (a = xe - ye) {\r\n\r\n if (xLTy = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n\r\n // Prepend zeros to equalise exponents.\r\n for (b = a; b--; t.push(0));\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n\r\n if (xc[b] != yc[b]) {\r\n xLTy = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\r\n\r\n b = (j = yc.length) - (i = xc.length);\r\n\r\n // Append zeros to xc if shorter.\r\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n if (b > 0) for (; b--; xc[i++] = 0);\r\n b = BASE - 1;\r\n\r\n // Subtract yc from xc.\r\n for (; j > a;) {\r\n\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i]; xc[i] = b);\r\n --xc[i];\r\n xc[j] += BASE;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] == 0; xc.splice(0, 1), --ye);\r\n\r\n // Zero?\r\n if (!xc[0]) {\r\n\r\n // Following IEEE 754 (2008) 6.3,\r\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\r\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n // for finite x and y.\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n */\r\n P.modulo = P.mod = function (y, b) {\r\n var q, s,\r\n x = this;\r\n\r\n y = new BigNumber(y, b);\r\n\r\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n if (!x.c || !y.s || y.c && !y.c[0]) {\r\n return new BigNumber(NaN);\r\n\r\n // Return x if y is Infinity or x is zero.\r\n } else if (!y.c || x.c && !x.c[0]) {\r\n return new BigNumber(x);\r\n }\r\n\r\n if (MODULO_MODE == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // r = x - qy where 0 <= r < abs(y)\r\n s = y.s;\r\n y.s = 1;\r\n q = div(x, y, 0, 3);\r\n y.s = s;\r\n q.s *= s;\r\n } else {\r\n q = div(x, y, 0, MODULO_MODE);\r\n }\r\n\r\n y = x.minus(q.times(y));\r\n\r\n // To match JavaScript %, ensure sign of zero is sign of dividend.\r\n if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n * of BigNumber(y, b).\r\n */\r\n P.multipliedBy = P.times = function (y, b) {\r\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n base, sqrtBase,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new BigNumber(y, b)).c;\r\n\r\n // Either NaN, ±Infinity or ±0?\r\n if (!xc || !yc || !xc[0] || !yc[0]) {\r\n\r\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r\n y.c = y.e = y.s = null;\r\n } else {\r\n y.s *= x.s;\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n if (!xc || !yc) {\r\n y.c = y.e = null;\r\n\r\n // Return ±0 if either is ±0.\r\n } else {\r\n y.c = [0];\r\n y.e = 0;\r\n }\r\n }\r\n\r\n return y;\r\n }\r\n\r\n e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r\n y.s *= x.s;\r\n xcL = xc.length;\r\n ycL = yc.length;\r\n\r\n // Ensure xc points to longer array and xcL to its length.\r\n if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\r\n\r\n // Initialise the result array with zeros.\r\n for (i = xcL + ycL, zc = []; i--; zc.push(0));\r\n\r\n base = BASE;\r\n sqrtBase = SQRT_BASE;\r\n\r\n for (i = ycL; --i >= 0;) {\r\n c = 0;\r\n ylo = yc[i] % sqrtBase;\r\n yhi = yc[i] / sqrtBase | 0;\r\n\r\n for (k = xcL, j = i + k; j > i;) {\r\n xlo = xc[--k] % sqrtBase;\r\n xhi = xc[k] / sqrtBase | 0;\r\n m = yhi * xlo + xhi * ylo;\r\n xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r\n c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r\n zc[j--] = xlo % base;\r\n }\r\n\r\n zc[j] = c;\r\n }\r\n\r\n if (c) {\r\n ++e;\r\n } else {\r\n zc.splice(0, 1);\r\n }\r\n\r\n return normalise(y, zc, e);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n * i.e. multiplied by -1.\r\n */\r\n P.negated = function () {\r\n var x = new BigNumber(this);\r\n x.s = -x.s || null;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.plus = function (y, b) {\r\n var t,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Return ±Infinity if either ±Infinity.\r\n if (!xc || !yc) return new BigNumber(a / 0);\r\n\r\n // Either zero?\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--; t.push(0));\r\n t.reverse();\r\n }\r\n\r\n a = xc.length;\r\n b = yc.length;\r\n\r\n // Point xc to the longer array, and b to the shorter length.\r\n if (a - b < 0) t = yc, yc = xc, xc = t, b = a;\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n for (a = 0; b;) {\r\n a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r\n xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n }\r\n\r\n if (a) {\r\n xc = [a].concat(xc);\r\n ++ye;\r\n }\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n // ye = MAX_EXP + 1 possible\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * If sd is undefined or null or true or false, return the number of significant digits of\r\n * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n * If sd is true include integer-part trailing zeros in the count.\r\n *\r\n * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n * boolean: whether to count integer-part trailing zeros: true or false.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.precision = P.sd = function (sd, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (sd != null && sd !== !!sd) {\r\n intCheck(sd, 1, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), sd, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n v = c.length - 1;\r\n n = v * LOG_BASE + 1;\r\n\r\n if (v = c[v]) {\r\n\r\n // Subtract the number of trailing zeros of the last element.\r\n for (; v % 10 == 0; v /= 10, n--);\r\n\r\n // Add the number of digits of the first element.\r\n for (v = c[0]; v >= 10; v /= 10, n++);\r\n }\r\n\r\n if (sd && x.e + 1 > n) n = x.e + 1;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n *\r\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n */\r\n P.shiftedBy = function (k) {\r\n intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r\n return this.times('1e' + k);\r\n };\r\n\r\n\r\n /*\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, r, rep, t,\r\n x = this,\r\n c = x.c,\r\n s = x.s,\r\n e = x.e,\r\n dp = DECIMAL_PLACES + 4,\r\n half = new BigNumber('0.5');\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !c || !c[0]) {\r\n return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r\n }\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+valueOf(x));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = coeffToString(c);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(+n);\r\n e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '1e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new BigNumber(n);\r\n } else {\r\n r = new BigNumber(s + '');\r\n }\r\n\r\n // Check for zero.\r\n // r could be zero if MIN_EXP is changed after the this value was created.\r\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n // coeffToString to throw.\r\n if (r.c[0]) {\r\n e = r.e;\r\n s = e + dp;\r\n if (s < 3) s = 0;\r\n\r\n // Newton-Raphson iteration.\r\n for (; ;) {\r\n t = r;\r\n r = half.times(t.plus(div(x, t, dp, 1)));\r\n\r\n if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r\n\r\n // The exponent of r may here be one less than the final result exponent,\r\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r\n // are indexed correctly.\r\n if (r.e < e) --s;\r\n n = n.slice(s - 3, s + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n // iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the\r\n // exact result as the nines may infinitely repeat.\r\n if (!rep) {\r\n round(t, t.e + DECIMAL_PLACES + 2, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n dp += 4;\r\n s += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n // result. If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n round(r, r.e + DECIMAL_PLACES + 2, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in exponential notation and\r\n * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toExponential = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp++;\r\n }\r\n return format(this, dp, rm, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toFixed = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp = dp + this.e + 1;\r\n }\r\n return format(this, dp, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n * of the format or FORMAT object (see BigNumber.set).\r\n *\r\n * The formatting object may contain some or all of the properties shown below.\r\n *\r\n * FORMAT = {\r\n * prefix: '',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * groupSeparator: ',',\r\n * decimalSeparator: '.',\r\n * fractionGroupSize: 0,\r\n * fractionGroupSeparator: '\\xA0', // non-breaking space\r\n * suffix: ''\r\n * };\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n * [format] {object} Formatting options. See FORMAT pbject above.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n * '[BigNumber Error] Argument not an object: {format}'\r\n */\r\n P.toFormat = function (dp, rm, format) {\r\n var str,\r\n x = this;\r\n\r\n if (format == null) {\r\n if (dp != null && rm && typeof rm == 'object') {\r\n format = rm;\r\n rm = null;\r\n } else if (dp && typeof dp == 'object') {\r\n format = dp;\r\n dp = rm = null;\r\n } else {\r\n format = FORMAT;\r\n }\r\n } else if (typeof format != 'object') {\r\n throw Error\r\n (bignumberError + 'Argument not an object: ' + format);\r\n }\r\n\r\n str = x.toFixed(dp, rm);\r\n\r\n if (x.c) {\r\n var i,\r\n arr = str.split('.'),\r\n g1 = +format.groupSize,\r\n g2 = +format.secondaryGroupSize,\r\n groupSeparator = format.groupSeparator || '',\r\n intPart = arr[0],\r\n fractionPart = arr[1],\r\n isNeg = x.s < 0,\r\n intDigits = isNeg ? intPart.slice(1) : intPart,\r\n len = intDigits.length;\r\n\r\n if (g2) i = g1, g1 = g2, g2 = i, len -= i;\r\n\r\n if (g1 > 0 && len > 0) {\r\n i = len % g1 || g1;\r\n intPart = intDigits.substr(0, i);\r\n for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r\n if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r\n if (isNeg) intPart = '-' + intPart;\r\n }\r\n\r\n str = fractionPart\r\n ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r\n ? fractionPart.replace(new RegExp('\\\\d{' + g2 + '}\\\\B', 'g'),\r\n '$&' + (format.fractionGroupSeparator || ''))\r\n : fractionPart)\r\n : intPart;\r\n }\r\n\r\n return (format.prefix || '') + str + (format.suffix || '');\r\n };\r\n\r\n\r\n /*\r\n * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r\n * fraction with an integer numerator and an integer denominator.\r\n * The denominator will be a positive non-zero value less than or equal to the specified\r\n * maximum denominator. If a maximum denominator is not specified, the denominator will be\r\n * the lowest value necessary to represent the number exactly.\r\n *\r\n * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r\n *\r\n * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n */\r\n P.toFraction = function (md) {\r\n var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r\n x = this,\r\n xc = x.c;\r\n\r\n if (md != null) {\r\n n = new BigNumber(md);\r\n\r\n // Throw if md is less than one or is not an integer, unless it is Infinity.\r\n if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r\n throw Error\r\n (bignumberError + 'Argument ' +\r\n (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r\n }\r\n }\r\n\r\n if (!xc) return new BigNumber(x);\r\n\r\n d = new BigNumber(ONE);\r\n n1 = d0 = new BigNumber(ONE);\r\n d1 = n0 = new BigNumber(ONE);\r\n s = coeffToString(xc);\r\n\r\n // Determine initial denominator.\r\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n e = d.e = s.length - x.e - 1;\r\n d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r\n md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r\n\r\n exp = MAX_EXP;\r\n MAX_EXP = 1 / 0;\r\n n = new BigNumber(s);\r\n\r\n // n0 = d1 = 0\r\n n0.c[0] = 0;\r\n\r\n for (; ;) {\r\n q = div(n, d, 0, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.comparedTo(md) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n n1 = n0.plus(q.times(d2 = n1));\r\n n0 = d2;\r\n d = n.minus(q.times(d2 = d));\r\n n = d2;\r\n }\r\n\r\n d2 = div(md.minus(d0), d1, 0, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n e = e * 2;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r\n div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r\n\r\n MAX_EXP = exp;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this BigNumber converted to a number primitive.\r\n */\r\n P.toNumber = function () {\r\n return +valueOf(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n * necessary to represent the integer part of the value in fixed-point notation, then use\r\n * exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n if (sd != null) intCheck(sd, 1, MAX);\r\n return format(this, sd, rm, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n * TO_EXP_NEG, return exponential notation.\r\n *\r\n * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n *\r\n * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n */\r\n P.toString = function (b) {\r\n var str,\r\n n = this,\r\n s = n.s,\r\n e = n.e;\r\n\r\n // Infinity or NaN?\r\n if (e === null) {\r\n if (s) {\r\n str = 'Infinity';\r\n if (s < 0) str = '-' + str;\r\n } else {\r\n str = 'NaN';\r\n }\r\n } else {\r\n if (b == null) {\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(coeffToString(n.c), e)\r\n : toFixedPoint(coeffToString(n.c), e, '0');\r\n } else if (b === 10) {\r\n n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r\n str = toFixedPoint(coeffToString(n.c), n.e, '0');\r\n } else {\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r\n }\r\n\r\n if (s < 0 && n.c[0]) str = '-' + str;\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return as toString, but do not accept a base argument, and include the minus sign for\r\n * negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return valueOf(this);\r\n };\r\n\r\n\r\n P._isBigNumber = true;\r\n\r\n if (hasSymbol) {\r\n P[Symbol.toStringTag] = 'BigNumber';\r\n\r\n // Node.js v10.12.0+\r\n P[Symbol.for('nodejs.util.inspect.custom')] = P.valueOf;\r\n }\r\n\r\n if (configObject != null) BigNumber.set(configObject);\r\n\r\n return BigNumber;\r\n }\r\n\r\n\r\n // PRIVATE HELPER FUNCTIONS\r\n\r\n // These functions don't need access to variables,\r\n // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r\n\r\n\r\n function bitFloor(n) {\r\n var i = n | 0;\r\n return n > 0 || n === i ? i : i - 1;\r\n }\r\n\r\n\r\n // Return a coefficient array as a string of base 10 digits.\r\n function coeffToString(a) {\r\n var s, z,\r\n i = 1,\r\n j = a.length,\r\n r = a[0] + '';\r\n\r\n for (; i < j;) {\r\n s = a[i++] + '';\r\n z = LOG_BASE - s.length;\r\n for (; z--; s = '0' + s);\r\n r += s;\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (j = r.length; r.charCodeAt(--j) === 48;);\r\n\r\n return r.slice(0, j + 1 || 1);\r\n }\r\n\r\n\r\n // Compare the value of BigNumbers x and y.\r\n function compare(x, y) {\r\n var a, b,\r\n xc = x.c,\r\n yc = y.c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either NaN?\r\n if (!i || !j) return null;\r\n\r\n a = xc && !xc[0];\r\n b = yc && !yc[0];\r\n\r\n // Either zero?\r\n if (a || b) return a ? b ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n a = i < 0;\r\n b = k == l;\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n // Compare exponents.\r\n if (!b) return k > l ^ a ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n }\r\n\r\n\r\n /*\r\n * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n */\r\n function intCheck(n, min, max, name) {\r\n if (n < min || n > max || n !== mathfloor(n)) {\r\n throw Error\r\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\r\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n : ' not a primitive number: ') + String(n));\r\n }\r\n }\r\n\r\n\r\n // Assumes finite n.\r\n function isOdd(n) {\r\n var k = n.c.length - 1;\r\n return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r\n }\r\n\r\n\r\n function toExponential(str, e) {\r\n return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r\n (e < 0 ? 'e' : 'e+') + e;\r\n }\r\n\r\n\r\n function toFixedPoint(str, e, z) {\r\n var len, zs;\r\n\r\n // Negative exponent?\r\n if (e < 0) {\r\n\r\n // Prepend zeros.\r\n for (zs = z + '.'; ++e; zs += z);\r\n str = zs + str;\r\n\r\n // Positive exponent\r\n } else {\r\n len = str.length;\r\n\r\n // Append zeros.\r\n if (++e > len) {\r\n for (zs = z, e -= len; --e; zs += z);\r\n str += zs;\r\n } else if (e < len) {\r\n str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // EXPORT\r\n\r\n\r\n BigNumber = clone();\r\n BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n // AMD.\r\n if (true) {\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return BigNumber; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\r\n // Node.js and other environments that support module.exports.\r\n } else {}\r\n})(this);\r\n\n\n//# sourceURL=webpack:///./node_modules/bignumber.js/bignumber.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/binary-search/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/binary-search/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function(haystack, needle, comparator, low, high) {\n var mid, cmp;\n\n if(low === undefined)\n low = 0;\n\n else {\n low = low|0;\n if(low < 0 || low >= haystack.length)\n throw new RangeError(\"invalid lower bound\");\n }\n\n if(high === undefined)\n high = haystack.length - 1;\n\n else {\n high = high|0;\n if(high < low || high >= haystack.length)\n throw new RangeError(\"invalid upper bound\");\n }\n\n while(low <= high) {\n /* Note that \"(low + high) >>> 1\" may overflow, and results in a typecast\n * to double (which gives the wrong results). */\n mid = low + (high - low >> 1);\n cmp = +comparator(haystack[mid], needle, mid, haystack);\n\n /* Too low. */\n if(cmp < 0.0)\n low = mid + 1;\n\n /* Too high. */\n else if(cmp > 0.0)\n high = mid - 1;\n\n /* Key found. */\n else\n return mid;\n }\n\n /* Key not found. */\n return ~low;\n}\n\n\n//# sourceURL=webpack:///./node_modules/binary-search/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bip66/index.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/bip66/index.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki\n// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n// NOTE: SIGHASH byte ignored AND restricted, truncate before use\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nfunction check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}\n\nfunction decode (buffer) {\n if (buffer.length < 8) throw new Error('DER sequence length is too short')\n if (buffer.length > 72) throw new Error('DER sequence length is too long')\n if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')\n if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')\n if (buffer[2] !== 0x02) throw new Error('Expected DER integer')\n\n var lenR = buffer[3]\n if (lenR === 0) throw new Error('R length is zero')\n if (5 + lenR >= buffer.length) throw new Error('R length is too long')\n if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) throw new Error('S length is zero')\n if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')\n\n if (buffer[4] & 0x80) throw new Error('R value is negative')\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')\n\n if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')\n\n // non-BIP66 - extract R, S values\n return {\n r: buffer.slice(4, 4 + lenR),\n s: buffer.slice(6 + lenR)\n }\n}\n\n/*\n * Expects r and s to be positive DER integers.\n *\n * The DER format uses the most significant bit as a sign bit (& 0x80).\n * If the significant bit is set AND the integer is positive, a 0x00 is prepended.\n *\n * Examples:\n *\n * 0 => 0x00\n * 1 => 0x01\n * -1 => 0xff\n * 127 => 0x7f\n * -127 => 0x81\n * 128 => 0x0080\n * -128 => 0x80\n * 255 => 0x00ff\n * -255 => 0xff01\n * 16300 => 0x3fac\n * -16300 => 0xc054\n * 62300 => 0x00f35c\n * -62300 => 0xff0ca4\n*/\nfunction encode (r, s) {\n var lenR = r.length\n var lenS = s.length\n if (lenR === 0) throw new Error('R length is zero')\n if (lenS === 0) throw new Error('S length is zero')\n if (lenR > 33) throw new Error('R length is too long')\n if (lenS > 33) throw new Error('S length is too long')\n if (r[0] & 0x80) throw new Error('R value is negative')\n if (s[0] & 0x80) throw new Error('S value is negative')\n if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')\n if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')\n\n var signature = Buffer.allocUnsafe(6 + lenR + lenS)\n\n // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n signature[0] = 0x30\n signature[1] = signature.length - 2\n signature[2] = 0x02\n signature[3] = r.length\n r.copy(signature, 4)\n signature[4 + lenR] = 0x02\n signature[5 + lenR] = s.length\n s.copy(signature, 6 + lenR)\n\n return signature\n}\n\nmodule.exports = {\n check: check,\n decode: decode,\n encode: encode\n}\n\n\n//# sourceURL=webpack:///./node_modules/bip66/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bitfield/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/bitfield/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var Container = typeof Buffer !== 'undefined'\r\n ? Buffer // in node, use buffers\r\n : Uint8Array // in browsers, use typed arrays\r\n\r\nfunction BitField (data, opts) {\r\n if (!(this instanceof BitField)) {\r\n return new BitField(data, opts)\r\n }\r\n\r\n if (arguments.length === 0) {\r\n data = 0\r\n }\r\n\r\n this.grow = (opts && ((isFinite(opts.grow) && getByteSize(opts.grow)) || opts.grow)) || 0\r\n\r\n if (typeof data === 'number' || data === undefined) {\r\n data = new Container(getByteSize(data)) // eslint-disable-line node/no-deprecated-api\r\n if (data.fill && !data._isBuffer) data.fill(0) // clear node buffers of garbage\r\n }\r\n this.buffer = data\r\n}\r\n\r\nfunction getByteSize (num) {\r\n var out = num >> 3\r\n if (num % 8 !== 0) out++\r\n return out\r\n}\r\n\r\nBitField.prototype.get = function (i) {\r\n var j = i >> 3\r\n return (j < this.buffer.length) &&\r\n !!(this.buffer[j] & (128 >> (i % 8)))\r\n}\r\n\r\nBitField.prototype.set = function (i, b) {\r\n var j = i >> 3\r\n if (b || arguments.length === 1) {\r\n if (this.buffer.length < j + 1) {\r\n this._grow(Math.max(j + 1, Math.min(2 * this.buffer.length, this.grow)))\r\n }\r\n // Set\r\n this.buffer[j] |= 128 >> (i % 8)\r\n } else if (j < this.buffer.length) {\r\n // Clear\r\n this.buffer[j] &= ~(128 >> (i % 8))\r\n }\r\n}\r\n\r\nBitField.prototype._grow = function (length) {\r\n if (this.buffer.length < length && length <= this.grow) {\r\n var newBuffer = new Container(length) // eslint-disable-line node/no-deprecated-api\r\n if (newBuffer.fill) newBuffer.fill(0)\r\n if (this.buffer.copy) {\r\n this.buffer.copy(newBuffer, 0)\r\n } else {\r\n for (var i = 0; i < this.buffer.length; i++) {\r\n newBuffer[i] = this.buffer[i]\r\n }\r\n }\r\n this.buffer = newBuffer\r\n }\r\n}\r\n\r\nif (true) module.exports = BitField\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/bitfield/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const arrayRemove = __webpack_require__(/*! unordered-array-remove */ \"./node_modules/unordered-array-remove/index.js\")\nconst bencode = __webpack_require__(/*! bencode */ \"./node_modules/bencode/lib/index.js\")\nconst BitField = __webpack_require__(/*! bitfield */ \"./node_modules/bitfield/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/bittorrent-protocol/node_modules/debug/src/browser.js\")('bittorrent-protocol')\nconst extend = __webpack_require__(/*! xtend */ \"./node_modules/xtend/immutable.js\")\nconst randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nconst speedometer = __webpack_require__(/*! speedometer */ \"./node_modules/speedometer/index.js\")\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/readable-browser.js\")\n\nconst BITFIELD_GROW = 400000\nconst KEEP_ALIVE_TIMEOUT = 55000\n\nconst MESSAGE_PROTOCOL = Buffer.from('\\u0013BitTorrent protocol')\nconst MESSAGE_KEEP_ALIVE = Buffer.from([0x00, 0x00, 0x00, 0x00])\nconst MESSAGE_CHOKE = Buffer.from([0x00, 0x00, 0x00, 0x01, 0x00])\nconst MESSAGE_UNCHOKE = Buffer.from([0x00, 0x00, 0x00, 0x01, 0x01])\nconst MESSAGE_INTERESTED = Buffer.from([0x00, 0x00, 0x00, 0x01, 0x02])\nconst MESSAGE_UNINTERESTED = Buffer.from([0x00, 0x00, 0x00, 0x01, 0x03])\n\nconst MESSAGE_RESERVED = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]\nconst MESSAGE_PORT = [0x00, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00]\n\nclass Request {\n constructor (piece, offset, length, callback) {\n this.piece = piece\n this.offset = offset\n this.length = length\n this.callback = callback\n }\n}\n\nclass Wire extends stream.Duplex {\n constructor () {\n super()\n\n this._debugId = randombytes(4).toString('hex')\n this._debug('new wire')\n\n this.peerId = null // remote peer id (hex string)\n this.peerIdBuffer = null // remote peer id (buffer)\n this.type = null // connection type ('webrtc', 'tcpIncoming', 'tcpOutgoing', 'webSeed')\n\n this.amChoking = true // are we choking the peer?\n this.amInterested = false // are we interested in the peer?\n\n this.peerChoking = true // is the peer choking us?\n this.peerInterested = false // is the peer interested in us?\n\n // The largest torrent that I know of (the Geocities archive) is ~641 GB and has\n // ~41,000 pieces. Therefore, cap bitfield to 10x larger (400,000 bits) to support all\n // possible torrents but prevent malicious peers from growing bitfield to fill memory.\n this.peerPieces = new BitField(0, { grow: BITFIELD_GROW })\n\n this.peerExtensions = {}\n\n this.requests = [] // outgoing\n this.peerRequests = [] // incoming\n\n this.extendedMapping = {} // number -> string, ex: 1 -> 'ut_metadata'\n this.peerExtendedMapping = {} // string -> number, ex: 9 -> 'ut_metadata'\n\n // The extended handshake to send, minus the \"m\" field, which gets automatically\n // filled from `this.extendedMapping`\n this.extendedHandshake = {}\n\n this.peerExtendedHandshake = {} // remote peer's extended handshake\n\n this._ext = {} // string -> function, ex 'ut_metadata' -> ut_metadata()\n this._nextExt = 1\n\n this.uploaded = 0\n this.downloaded = 0\n this.uploadSpeed = speedometer()\n this.downloadSpeed = speedometer()\n\n this._keepAliveInterval = null\n this._timeout = null\n this._timeoutMs = 0\n\n this.destroyed = false // was the wire ended by calling `destroy`?\n this._finished = false\n\n this._parserSize = 0 // number of needed bytes to parse next message from remote peer\n this._parser = null // function to call once `this._parserSize` bytes are available\n\n this._buffer = [] // incomplete message data\n this._bufferSize = 0 // cached total length of buffers in `this._buffer`\n\n this.on('finish', this._onFinish)\n\n this._parseHandshake()\n }\n\n /**\n * Set whether to send a \"keep-alive\" ping (sent every 55s)\n * @param {boolean} enable\n */\n setKeepAlive (enable) {\n this._debug('setKeepAlive %s', enable)\n clearInterval(this._keepAliveInterval)\n if (enable === false) return\n this._keepAliveInterval = setInterval(() => {\n this.keepAlive()\n }, KEEP_ALIVE_TIMEOUT)\n }\n\n /**\n * Set the amount of time to wait before considering a request to be \"timed out\"\n * @param {number} ms\n * @param {boolean=} unref (should the timer be unref'd? default: false)\n */\n setTimeout (ms, unref) {\n this._debug('setTimeout ms=%d unref=%s', ms, unref)\n this._clearTimeout()\n this._timeoutMs = ms\n this._timeoutUnref = !!unref\n this._updateTimeout()\n }\n\n destroy () {\n if (this.destroyed) return\n this.destroyed = true\n this._debug('destroy')\n this.emit('close')\n this.end()\n }\n\n end (...args) {\n this._debug('end')\n this._onUninterested()\n this._onChoke()\n super.end(...args)\n }\n\n /**\n * Use the specified protocol extension.\n * @param {function} Extension\n */\n use (Extension) {\n const name = Extension.prototype.name\n if (!name) {\n throw new Error('Extension class requires a \"name\" property on the prototype')\n }\n this._debug('use extension.name=%s', name)\n\n const ext = this._nextExt\n const handler = new Extension(this)\n\n function noop () {}\n\n if (typeof handler.onHandshake !== 'function') {\n handler.onHandshake = noop\n }\n if (typeof handler.onExtendedHandshake !== 'function') {\n handler.onExtendedHandshake = noop\n }\n if (typeof handler.onMessage !== 'function') {\n handler.onMessage = noop\n }\n\n this.extendedMapping[ext] = name\n this._ext[name] = handler\n this[name] = handler\n\n this._nextExt += 1\n }\n\n //\n // OUTGOING MESSAGES\n //\n\n /**\n * Message \"keep-alive\": <len=0000>\n */\n keepAlive () {\n this._debug('keep-alive')\n this._push(MESSAGE_KEEP_ALIVE)\n }\n\n /**\n * Message: \"handshake\" <pstrlen><pstr><reserved><info_hash><peer_id>\n * @param {Buffer|string} infoHash (as Buffer or *hex* string)\n * @param {Buffer|string} peerId\n * @param {Object} extensions\n */\n handshake (infoHash, peerId, extensions) {\n let infoHashBuffer\n let peerIdBuffer\n if (typeof infoHash === 'string') {\n infoHash = infoHash.toLowerCase()\n infoHashBuffer = Buffer.from(infoHash, 'hex')\n } else {\n infoHashBuffer = infoHash\n infoHash = infoHashBuffer.toString('hex')\n }\n if (typeof peerId === 'string') {\n peerIdBuffer = Buffer.from(peerId, 'hex')\n } else {\n peerIdBuffer = peerId\n peerId = peerIdBuffer.toString('hex')\n }\n\n if (infoHashBuffer.length !== 20 || peerIdBuffer.length !== 20) {\n throw new Error('infoHash and peerId MUST have length 20')\n }\n\n this._debug('handshake i=%s p=%s exts=%o', infoHash, peerId, extensions)\n\n const reserved = Buffer.from(MESSAGE_RESERVED)\n\n // enable extended message\n reserved[5] |= 0x10\n\n if (extensions && extensions.dht) reserved[7] |= 1\n\n this._push(Buffer.concat([MESSAGE_PROTOCOL, reserved, infoHashBuffer, peerIdBuffer]))\n this._handshakeSent = true\n\n if (this.peerExtensions.extended && !this._extendedHandshakeSent) {\n // Peer's handshake indicated support already\n // (incoming connection)\n this._sendExtendedHandshake()\n }\n }\n\n /* Peer supports BEP-0010, send extended handshake.\n *\n * This comes after the 'handshake' event to give the user a chance to populate\n * `this.extendedHandshake` and `this.extendedMapping` before the extended handshake\n * is sent to the remote peer.\n */\n _sendExtendedHandshake () {\n // Create extended message object from registered extensions\n const msg = extend(this.extendedHandshake)\n msg.m = {}\n for (const ext in this.extendedMapping) {\n const name = this.extendedMapping[ext]\n msg.m[name] = Number(ext)\n }\n\n // Send extended handshake\n this.extended(0, bencode.encode(msg))\n this._extendedHandshakeSent = true\n }\n\n /**\n * Message \"choke\": <len=0001><id=0>\n */\n choke () {\n if (this.amChoking) return\n this.amChoking = true\n this._debug('choke')\n while (this.peerRequests.length) {\n this.peerRequests.pop()\n }\n this._push(MESSAGE_CHOKE)\n }\n\n /**\n * Message \"unchoke\": <len=0001><id=1>\n */\n unchoke () {\n if (!this.amChoking) return\n this.amChoking = false\n this._debug('unchoke')\n this._push(MESSAGE_UNCHOKE)\n }\n\n /**\n * Message \"interested\": <len=0001><id=2>\n */\n interested () {\n if (this.amInterested) return\n this.amInterested = true\n this._debug('interested')\n this._push(MESSAGE_INTERESTED)\n }\n\n /**\n * Message \"uninterested\": <len=0001><id=3>\n */\n uninterested () {\n if (!this.amInterested) return\n this.amInterested = false\n this._debug('uninterested')\n this._push(MESSAGE_UNINTERESTED)\n }\n\n /**\n * Message \"have\": <len=0005><id=4><piece index>\n * @param {number} index\n */\n have (index) {\n this._debug('have %d', index)\n this._message(4, [index], null)\n }\n\n /**\n * Message \"bitfield\": <len=0001+X><id=5><bitfield>\n * @param {BitField|Buffer} bitfield\n */\n bitfield (bitfield) {\n this._debug('bitfield')\n if (!Buffer.isBuffer(bitfield)) bitfield = bitfield.buffer\n this._message(5, [], bitfield)\n }\n\n /**\n * Message \"request\": <len=0013><id=6><index><begin><length>\n * @param {number} index\n * @param {number} offset\n * @param {number} length\n * @param {function} cb\n */\n request (index, offset, length, cb) {\n if (!cb) cb = () => {}\n if (this._finished) return cb(new Error('wire is closed'))\n if (this.peerChoking) return cb(new Error('peer is choking'))\n\n this._debug('request index=%d offset=%d length=%d', index, offset, length)\n\n this.requests.push(new Request(index, offset, length, cb))\n this._updateTimeout()\n this._message(6, [index, offset, length], null)\n }\n\n /**\n * Message \"piece\": <len=0009+X><id=7><index><begin><block>\n * @param {number} index\n * @param {number} offset\n * @param {Buffer} buffer\n */\n piece (index, offset, buffer) {\n this._debug('piece index=%d offset=%d', index, offset)\n this.uploaded += buffer.length\n this.uploadSpeed(buffer.length)\n this.emit('upload', buffer.length)\n this._message(7, [index, offset], buffer)\n }\n\n /**\n * Message \"cancel\": <len=0013><id=8><index><begin><length>\n * @param {number} index\n * @param {number} offset\n * @param {number} length\n */\n cancel (index, offset, length) {\n this._debug('cancel index=%d offset=%d length=%d', index, offset, length)\n this._callback(\n this._pull(this.requests, index, offset, length),\n new Error('request was cancelled'),\n null\n )\n this._message(8, [index, offset, length], null)\n }\n\n /**\n * Message: \"port\" <len=0003><id=9><listen-port>\n * @param {Number} port\n */\n port (port) {\n this._debug('port %d', port)\n const message = Buffer.from(MESSAGE_PORT)\n message.writeUInt16BE(port, 5)\n this._push(message)\n }\n\n /**\n * Message: \"extended\" <len=0005+X><id=20><ext-number><payload>\n * @param {number|string} ext\n * @param {Object} obj\n */\n extended (ext, obj) {\n this._debug('extended ext=%s', ext)\n if (typeof ext === 'string' && this.peerExtendedMapping[ext]) {\n ext = this.peerExtendedMapping[ext]\n }\n if (typeof ext === 'number') {\n const extId = Buffer.from([ext])\n const buf = Buffer.isBuffer(obj) ? obj : bencode.encode(obj)\n\n this._message(20, [], Buffer.concat([extId, buf]))\n } else {\n throw new Error(`Unrecognized extension: ${ext}`)\n }\n }\n\n /**\n * Duplex stream method. Called whenever the remote peer stream wants data. No-op\n * since we'll just push data whenever we get it.\n */\n _read () {}\n\n /**\n * Send a message to the remote peer.\n */\n _message (id, numbers, data) {\n const dataLength = data ? data.length : 0\n const buffer = Buffer.allocUnsafe(5 + (4 * numbers.length))\n\n buffer.writeUInt32BE(buffer.length + dataLength - 4, 0)\n buffer[4] = id\n for (let i = 0; i < numbers.length; i++) {\n buffer.writeUInt32BE(numbers[i], 5 + (4 * i))\n }\n\n this._push(buffer)\n if (data) this._push(data)\n }\n\n _push (data) {\n if (this._finished) return\n return this.push(data)\n }\n\n //\n // INCOMING MESSAGES\n //\n\n _onKeepAlive () {\n this._debug('got keep-alive')\n this.emit('keep-alive')\n }\n\n _onHandshake (infoHashBuffer, peerIdBuffer, extensions) {\n const infoHash = infoHashBuffer.toString('hex')\n const peerId = peerIdBuffer.toString('hex')\n\n this._debug('got handshake i=%s p=%s exts=%o', infoHash, peerId, extensions)\n\n this.peerId = peerId\n this.peerIdBuffer = peerIdBuffer\n this.peerExtensions = extensions\n\n this.emit('handshake', infoHash, peerId, extensions)\n\n let name\n for (name in this._ext) {\n this._ext[name].onHandshake(infoHash, peerId, extensions)\n }\n\n if (extensions.extended && this._handshakeSent &&\n !this._extendedHandshakeSent) {\n // outgoing connection\n this._sendExtendedHandshake()\n }\n }\n\n _onChoke () {\n this.peerChoking = true\n this._debug('got choke')\n this.emit('choke')\n while (this.requests.length) {\n this._callback(this.requests.pop(), new Error('peer is choking'), null)\n }\n }\n\n _onUnchoke () {\n this.peerChoking = false\n this._debug('got unchoke')\n this.emit('unchoke')\n }\n\n _onInterested () {\n this.peerInterested = true\n this._debug('got interested')\n this.emit('interested')\n }\n\n _onUninterested () {\n this.peerInterested = false\n this._debug('got uninterested')\n this.emit('uninterested')\n }\n\n _onHave (index) {\n if (this.peerPieces.get(index)) return\n this._debug('got have %d', index)\n\n this.peerPieces.set(index, true)\n this.emit('have', index)\n }\n\n _onBitField (buffer) {\n this.peerPieces = new BitField(buffer)\n this._debug('got bitfield')\n this.emit('bitfield', this.peerPieces)\n }\n\n _onRequest (index, offset, length) {\n if (this.amChoking) return\n this._debug('got request index=%d offset=%d length=%d', index, offset, length)\n\n const respond = (err, buffer) => {\n if (request !== this._pull(this.peerRequests, index, offset, length)) return\n if (err) return this._debug('error satisfying request index=%d offset=%d length=%d (%s)', index, offset, length, err.message)\n this.piece(index, offset, buffer)\n }\n\n var request = new Request(index, offset, length, respond)\n this.peerRequests.push(request)\n this.emit('request', index, offset, length, respond)\n }\n\n _onPiece (index, offset, buffer) {\n this._debug('got piece index=%d offset=%d', index, offset)\n this._callback(this._pull(this.requests, index, offset, buffer.length), null, buffer)\n this.downloaded += buffer.length\n this.downloadSpeed(buffer.length)\n this.emit('download', buffer.length)\n this.emit('piece', index, offset, buffer)\n }\n\n _onCancel (index, offset, length) {\n this._debug('got cancel index=%d offset=%d length=%d', index, offset, length)\n this._pull(this.peerRequests, index, offset, length)\n this.emit('cancel', index, offset, length)\n }\n\n _onPort (port) {\n this._debug('got port %d', port)\n this.emit('port', port)\n }\n\n _onExtended (ext, buf) {\n if (ext === 0) {\n let info\n try {\n info = bencode.decode(buf)\n } catch (err) {\n this._debug('ignoring invalid extended handshake: %s', err.message || err)\n }\n\n if (!info) return\n this.peerExtendedHandshake = info\n\n let name\n if (typeof info.m === 'object') {\n for (name in info.m) {\n this.peerExtendedMapping[name] = Number(info.m[name].toString())\n }\n }\n for (name in this._ext) {\n if (this.peerExtendedMapping[name]) {\n this._ext[name].onExtendedHandshake(this.peerExtendedHandshake)\n }\n }\n this._debug('got extended handshake')\n this.emit('extended', 'handshake', this.peerExtendedHandshake)\n } else {\n if (this.extendedMapping[ext]) {\n ext = this.extendedMapping[ext] // friendly name for extension\n if (this._ext[ext]) {\n // there is an registered extension handler, so call it\n this._ext[ext].onMessage(buf)\n }\n }\n this._debug('got extended message ext=%s', ext)\n this.emit('extended', ext, buf)\n }\n }\n\n _onTimeout () {\n this._debug('request timed out')\n this._callback(this.requests.shift(), new Error('request has timed out'), null)\n this.emit('timeout')\n }\n\n /**\n * Duplex stream method. Called whenever the remote peer has data for us. Data that the\n * remote peer sends gets buffered (i.e. not actually processed) until the right number\n * of bytes have arrived, determined by the last call to `this._parse(number, callback)`.\n * Once enough bytes have arrived to process the message, the callback function\n * (i.e. `this._parser`) gets called with the full buffer of data.\n * @param {Buffer} data\n * @param {string} encoding\n * @param {function} cb\n */\n _write (data, encoding, cb) {\n this._bufferSize += data.length\n this._buffer.push(data)\n\n while (this._bufferSize >= this._parserSize) {\n const buffer = (this._buffer.length === 1)\n ? this._buffer[0]\n : Buffer.concat(this._buffer)\n this._bufferSize -= this._parserSize\n this._buffer = this._bufferSize\n ? [buffer.slice(this._parserSize)]\n : []\n this._parser(buffer.slice(0, this._parserSize))\n }\n\n cb(null) // Signal that we're ready for more data\n }\n\n _callback (request, err, buffer) {\n if (!request) return\n\n this._clearTimeout()\n\n if (!this.peerChoking && !this._finished) this._updateTimeout()\n request.callback(err, buffer)\n }\n\n _clearTimeout () {\n if (!this._timeout) return\n\n clearTimeout(this._timeout)\n this._timeout = null\n }\n\n _updateTimeout () {\n if (!this._timeoutMs || !this.requests.length || this._timeout) return\n\n this._timeout = setTimeout(() => this._onTimeout(), this._timeoutMs)\n if (this._timeoutUnref && this._timeout.unref) this._timeout.unref()\n }\n\n /**\n * Takes a number of bytes that the local peer is waiting to receive from the remote peer\n * in order to parse a complete message, and a callback function to be called once enough\n * bytes have arrived.\n * @param {number} size\n * @param {function} parser\n */\n _parse (size, parser) {\n this._parserSize = size\n this._parser = parser\n }\n\n /**\n * Handle the first 4 bytes of a message, to determine the length of bytes that must be\n * waited for in order to have the whole message.\n * @param {Buffer} buffer\n */\n _onMessageLength (buffer) {\n const length = buffer.readUInt32BE(0)\n if (length > 0) {\n this._parse(length, this._onMessage)\n } else {\n this._onKeepAlive()\n this._parse(4, this._onMessageLength)\n }\n }\n\n /**\n * Handle a message from the remote peer.\n * @param {Buffer} buffer\n */\n _onMessage (buffer) {\n this._parse(4, this._onMessageLength)\n switch (buffer[0]) {\n case 0:\n return this._onChoke()\n case 1:\n return this._onUnchoke()\n case 2:\n return this._onInterested()\n case 3:\n return this._onUninterested()\n case 4:\n return this._onHave(buffer.readUInt32BE(1))\n case 5:\n return this._onBitField(buffer.slice(1))\n case 6:\n return this._onRequest(\n buffer.readUInt32BE(1),\n buffer.readUInt32BE(5),\n buffer.readUInt32BE(9)\n )\n case 7:\n return this._onPiece(\n buffer.readUInt32BE(1),\n buffer.readUInt32BE(5),\n buffer.slice(9)\n )\n case 8:\n return this._onCancel(\n buffer.readUInt32BE(1),\n buffer.readUInt32BE(5),\n buffer.readUInt32BE(9)\n )\n case 9:\n return this._onPort(buffer.readUInt16BE(1))\n case 20:\n return this._onExtended(buffer.readUInt8(1), buffer.slice(2))\n default:\n this._debug('got unknown message')\n return this.emit('unknownmessage', buffer)\n }\n }\n\n _parseHandshake () {\n this._parse(1, buffer => {\n const pstrlen = buffer.readUInt8(0)\n this._parse(pstrlen + 48, handshake => {\n const protocol = handshake.slice(0, pstrlen)\n if (protocol.toString() !== 'BitTorrent protocol') {\n this._debug('Error: wire not speaking BitTorrent protocol (%s)', protocol.toString())\n this.end()\n return\n }\n handshake = handshake.slice(pstrlen)\n this._onHandshake(handshake.slice(8, 28), handshake.slice(28, 48), {\n dht: !!(handshake[7] & 0x01), // see bep_0005\n extended: !!(handshake[5] & 0x10) // see bep_0010\n })\n this._parse(4, this._onMessageLength)\n })\n })\n }\n\n _onFinish () {\n this._finished = true\n\n this.push(null) // stream cannot be half open, so signal the end of it\n while (this.read()) {} // consume and discard the rest of the stream data\n\n clearInterval(this._keepAliveInterval)\n this._parse(Number.MAX_VALUE, () => {})\n while (this.peerRequests.length) {\n this.peerRequests.pop()\n }\n while (this.requests.length) {\n this._callback(this.requests.pop(), new Error('wire was closed'), null)\n }\n }\n\n _debug (...args) {\n args[0] = `[${this._debugId}] ${args[0]}`\n debug(...args)\n }\n\n _pull (requests, piece, offset, length) {\n for (let i = 0; i < requests.length; i++) {\n const req = requests[i]\n if (req.piece === piece && req.offset === offset && req.length === length) {\n arrayRemove(requests, i)\n return req\n }\n }\n return null\n }\n}\n\nmodule.exports = Wire\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/debug/src/browser.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/debug/src/browser.js ***!
|
||
\****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/bittorrent-protocol/node_modules/debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/debug/src/common.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/debug/src/common.js ***!
|
||
\***************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!*********************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\*********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!**************************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\**************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!***********************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\***********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 35);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!************************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!***********************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\***********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!**********************************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\**********************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 36);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!*******************************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\*******************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!**************************************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\**************************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-protocol/node_modules/readable-stream/readable-browser.js":
|
||
/*!*******************************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-protocol/node_modules/readable-stream/readable-browser.js ***!
|
||
\*******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/bittorrent-protocol/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-tracker/client.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/bittorrent-tracker/client.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {const { Buffer } = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('bittorrent-tracker:client')\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst parallel = __webpack_require__(/*! run-parallel */ \"./node_modules/run-parallel/index.js\")\nconst Peer = __webpack_require__(/*! simple-peer */ \"./node_modules/simple-peer/index.js\")\nconst uniq = __webpack_require__(/*! uniq */ \"./node_modules/uniq/uniq.js\")\nconst url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\n\nconst common = __webpack_require__(/*! ./lib/common */ \"./node_modules/bittorrent-tracker/lib/common.js\")\nconst HTTPTracker = __webpack_require__(/*! ./lib/client/http-tracker */ 25) // empty object in browser\nconst UDPTracker = __webpack_require__(/*! ./lib/client/udp-tracker */ 26) // empty object in browser\nconst WebSocketTracker = __webpack_require__(/*! ./lib/client/websocket-tracker */ \"./node_modules/bittorrent-tracker/lib/client/websocket-tracker.js\")\n\n/**\n * BitTorrent tracker client.\n *\n * Find torrent peers, to help a torrent client participate in a torrent swarm.\n *\n * @param {Object} opts options object\n * @param {string|Buffer} opts.infoHash torrent info hash\n * @param {string|Buffer} opts.peerId peer id\n * @param {string|Array.<string>} opts.announce announce\n * @param {number} opts.port torrent client listening port\n * @param {function} opts.getAnnounceOpts callback to provide data to tracker\n * @param {number} opts.rtcConfig RTCPeerConnection configuration object\n * @param {number} opts.userAgent User-Agent header for http requests\n * @param {number} opts.wrtc custom webrtc impl (useful in node.js)\n */\nclass Client extends EventEmitter {\n constructor (opts = {}) {\n super()\n\n if (!opts.peerId) throw new Error('Option `peerId` is required')\n if (!opts.infoHash) throw new Error('Option `infoHash` is required')\n if (!opts.announce) throw new Error('Option `announce` is required')\n if (!process.browser && !opts.port) throw new Error('Option `port` is required')\n\n this.peerId = typeof opts.peerId === 'string'\n ? opts.peerId\n : opts.peerId.toString('hex')\n this._peerIdBuffer = Buffer.from(this.peerId, 'hex')\n this._peerIdBinary = this._peerIdBuffer.toString('binary')\n\n this.infoHash = typeof opts.infoHash === 'string'\n ? opts.infoHash.toLowerCase()\n : opts.infoHash.toString('hex')\n this._infoHashBuffer = Buffer.from(this.infoHash, 'hex')\n this._infoHashBinary = this._infoHashBuffer.toString('binary')\n\n debug('new client %s', this.infoHash)\n\n this.destroyed = false\n\n this._port = opts.port\n this._getAnnounceOpts = opts.getAnnounceOpts\n this._rtcConfig = opts.rtcConfig\n this._userAgent = opts.userAgent\n\n // Support lazy 'wrtc' module initialization\n // See: https://github.com/webtorrent/webtorrent-hybrid/issues/46\n this._wrtc = typeof opts.wrtc === 'function' ? opts.wrtc() : opts.wrtc\n\n let announce = typeof opts.announce === 'string'\n ? [ opts.announce ]\n : opts.announce == null ? [] : opts.announce\n\n // Remove trailing slash from trackers to catch duplicates\n announce = announce.map(announceUrl => {\n announceUrl = announceUrl.toString()\n if (announceUrl[announceUrl.length - 1] === '/') {\n announceUrl = announceUrl.substring(0, announceUrl.length - 1)\n }\n return announceUrl\n })\n announce = uniq(announce)\n\n const webrtcSupport = this._wrtc !== false && (!!this._wrtc || Peer.WEBRTC_SUPPORT)\n\n const nextTickWarn = err => {\n process.nextTick(() => {\n this.emit('warning', err)\n })\n }\n\n this._trackers = announce\n .map(announceUrl => {\n const parsedUrl = url.parse(announceUrl)\n const port = parsedUrl.port\n if (port < 0 || port > 65535) {\n nextTickWarn(new Error(`Invalid tracker port: ${announceUrl}`))\n return null\n }\n\n const protocol = parsedUrl.protocol\n if ((protocol === 'http:' || protocol === 'https:') &&\n typeof HTTPTracker === 'function') {\n return new HTTPTracker(this, announceUrl)\n } else if (protocol === 'udp:' && typeof UDPTracker === 'function') {\n return new UDPTracker(this, announceUrl)\n } else if ((protocol === 'ws:' || protocol === 'wss:') && webrtcSupport) {\n // Skip ws:// trackers on https:// sites because they throw SecurityError\n if (protocol === 'ws:' && typeof window !== 'undefined' &&\n window.location.protocol === 'https:') {\n nextTickWarn(new Error(`Unsupported tracker protocol: ${announceUrl}`))\n return null\n }\n return new WebSocketTracker(this, announceUrl)\n } else {\n nextTickWarn(new Error(`Unsupported tracker protocol: ${announceUrl}`))\n return null\n }\n })\n .filter(Boolean)\n }\n\n /**\n * Send a `start` announce to the trackers.\n * @param {Object} opts\n * @param {number=} opts.uploaded\n * @param {number=} opts.downloaded\n * @param {number=} opts.left (if not set, calculated automatically)\n */\n start (opts) {\n debug('send `start`')\n opts = this._defaultAnnounceOpts(opts)\n opts.event = 'started'\n this._announce(opts)\n\n // start announcing on intervals\n this._trackers.forEach(tracker => {\n tracker.setInterval()\n })\n }\n\n /**\n * Send a `stop` announce to the trackers.\n * @param {Object} opts\n * @param {number=} opts.uploaded\n * @param {number=} opts.downloaded\n * @param {number=} opts.numwant\n * @param {number=} opts.left (if not set, calculated automatically)\n */\n stop (opts) {\n debug('send `stop`')\n opts = this._defaultAnnounceOpts(opts)\n opts.event = 'stopped'\n this._announce(opts)\n }\n\n /**\n * Send a `complete` announce to the trackers.\n * @param {Object} opts\n * @param {number=} opts.uploaded\n * @param {number=} opts.downloaded\n * @param {number=} opts.numwant\n * @param {number=} opts.left (if not set, calculated automatically)\n */\n complete (opts) {\n debug('send `complete`')\n if (!opts) opts = {}\n opts = this._defaultAnnounceOpts(opts)\n opts.event = 'completed'\n this._announce(opts)\n }\n\n /**\n * Send a `update` announce to the trackers.\n * @param {Object} opts\n * @param {number=} opts.uploaded\n * @param {number=} opts.downloaded\n * @param {number=} opts.numwant\n * @param {number=} opts.left (if not set, calculated automatically)\n */\n update (opts) {\n debug('send `update`')\n opts = this._defaultAnnounceOpts(opts)\n if (opts.event) delete opts.event\n this._announce(opts)\n }\n\n _announce (opts) {\n this._trackers.forEach(tracker => {\n // tracker should not modify `opts` object, it's passed to all trackers\n tracker.announce(opts)\n })\n }\n\n /**\n * Send a scrape request to the trackers.\n * @param {Object} opts\n */\n scrape (opts) {\n debug('send `scrape`')\n if (!opts) opts = {}\n this._trackers.forEach(tracker => {\n // tracker should not modify `opts` object, it's passed to all trackers\n tracker.scrape(opts)\n })\n }\n\n setInterval (intervalMs) {\n debug('setInterval %d', intervalMs)\n this._trackers.forEach(tracker => {\n tracker.setInterval(intervalMs)\n })\n }\n\n destroy (cb) {\n if (this.destroyed) return\n this.destroyed = true\n debug('destroy')\n\n const tasks = this._trackers.map(tracker => cb => {\n tracker.destroy(cb)\n })\n\n parallel(tasks, cb)\n\n this._trackers = []\n this._getAnnounceOpts = null\n }\n\n _defaultAnnounceOpts (opts = {}) {\n if (opts.numwant == null) opts.numwant = common.DEFAULT_ANNOUNCE_PEERS\n\n if (opts.uploaded == null) opts.uploaded = 0\n if (opts.downloaded == null) opts.downloaded = 0\n\n if (this._getAnnounceOpts) opts = Object.assign({}, opts, this._getAnnounceOpts())\n\n return opts\n }\n}\n\n/**\n * Simple convenience function to scrape a tracker for an info hash without needing to\n * create a Client, pass it a parsed torrent, etc. Support scraping a tracker for multiple\n * torrents at the same time.\n * @params {Object} opts\n * @param {string|Array.<string>} opts.infoHash\n * @param {string} opts.announce\n * @param {function} cb\n */\nClient.scrape = (opts, cb) => {\n cb = once(cb)\n\n if (!opts.infoHash) throw new Error('Option `infoHash` is required')\n if (!opts.announce) throw new Error('Option `announce` is required')\n\n const clientOpts = Object.assign({}, opts, {\n infoHash: Array.isArray(opts.infoHash) ? opts.infoHash[0] : opts.infoHash,\n peerId: Buffer.from('01234567890123456789'), // dummy value\n port: 6881 // dummy value\n })\n\n const client = new Client(clientOpts)\n client.once('error', cb)\n client.once('warning', cb)\n\n let len = Array.isArray(opts.infoHash) ? opts.infoHash.length : 1\n const results = {}\n client.on('scrape', data => {\n len -= 1\n results[data.infoHash] = data\n if (len === 0) {\n client.destroy()\n const keys = Object.keys(results)\n if (keys.length === 1) {\n cb(null, results[keys[0]])\n } else {\n cb(null, results)\n }\n }\n })\n\n opts.infoHash = Array.isArray(opts.infoHash)\n ? opts.infoHash.map(infoHash => {\n return Buffer.from(infoHash, 'hex')\n })\n : Buffer.from(opts.infoHash, 'hex')\n client.scrape({ infoHash: opts.infoHash })\n return client\n}\n\nmodule.exports = Client\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/bittorrent-tracker/client.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-tracker/lib/client/tracker.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/bittorrent-tracker/lib/client/tracker.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\n\nclass Tracker extends EventEmitter {\n constructor (client, announceUrl) {\n super()\n\n this.client = client\n this.announceUrl = announceUrl\n\n this.interval = null\n this.destroyed = false\n }\n\n setInterval (intervalMs) {\n if (intervalMs == null) intervalMs = this.DEFAULT_ANNOUNCE_INTERVAL\n\n clearInterval(this.interval)\n\n if (intervalMs) {\n this.interval = setInterval(() => {\n this.announce(this.client._defaultAnnounceOpts())\n }, intervalMs)\n if (this.interval.unref) this.interval.unref()\n }\n }\n}\n\nmodule.exports = Tracker\n\n\n//# sourceURL=webpack:///./node_modules/bittorrent-tracker/lib/client/tracker.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-tracker/lib/client/websocket-tracker.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/bittorrent-tracker/lib/client/websocket-tracker.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('bittorrent-tracker:websocket-tracker')\nconst Peer = __webpack_require__(/*! simple-peer */ \"./node_modules/simple-peer/index.js\")\nconst randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nconst Socket = __webpack_require__(/*! simple-websocket */ \"./node_modules/simple-websocket/index.js\")\n\nconst common = __webpack_require__(/*! ../common */ \"./node_modules/bittorrent-tracker/lib/common.js\")\nconst Tracker = __webpack_require__(/*! ./tracker */ \"./node_modules/bittorrent-tracker/lib/client/tracker.js\")\n\n// Use a socket pool, so tracker clients share WebSocket objects for the same server.\n// In practice, WebSockets are pretty slow to establish, so this gives a nice performance\n// boost, and saves browser resources.\nconst socketPool = {}\n\nconst RECONNECT_MINIMUM = 10 * 1000\nconst RECONNECT_MAXIMUM = 30 * 60 * 1000\nconst RECONNECT_VARIANCE = 2 * 60 * 1000\nconst OFFER_TIMEOUT = 50 * 1000\n\nclass WebSocketTracker extends Tracker {\n constructor (client, announceUrl, opts) {\n super(client, announceUrl)\n debug('new websocket tracker %s', announceUrl)\n\n this.peers = {} // peers (offer id -> peer)\n this.socket = null\n\n this.reconnecting = false\n this.retries = 0\n this.reconnectTimer = null\n\n // Simple boolean flag to track whether the socket has received data from\n // the websocket server since the last time socket.send() was called.\n this.expectingResponse = false\n\n this._openSocket()\n }\n\n announce (opts) {\n if (this.destroyed || this.reconnecting) return\n if (!this.socket.connected) {\n this.socket.once('connect', () => {\n this.announce(opts)\n })\n return\n }\n\n const params = Object.assign({}, opts, {\n action: 'announce',\n info_hash: this.client._infoHashBinary,\n peer_id: this.client._peerIdBinary\n })\n if (this._trackerId) params.trackerid = this._trackerId\n\n if (opts.event === 'stopped' || opts.event === 'completed') {\n // Don't include offers with 'stopped' or 'completed' event\n this._send(params)\n } else {\n // Limit the number of offers that are generated, since it can be slow\n const numwant = Math.min(opts.numwant, 10)\n\n this._generateOffers(numwant, offers => {\n params.numwant = numwant\n params.offers = offers\n this._send(params)\n })\n }\n }\n\n scrape (opts) {\n if (this.destroyed || this.reconnecting) return\n if (!this.socket.connected) {\n this.socket.once('connect', () => {\n this.scrape(opts)\n })\n return\n }\n\n const infoHashes = (Array.isArray(opts.infoHash) && opts.infoHash.length > 0)\n ? opts.infoHash.map(infoHash => {\n return infoHash.toString('binary')\n })\n : (opts.infoHash && opts.infoHash.toString('binary')) || this.client._infoHashBinary\n const params = {\n action: 'scrape',\n info_hash: infoHashes\n }\n\n this._send(params)\n }\n\n destroy (cb = noop) {\n if (this.destroyed) return cb(null)\n\n this.destroyed = true\n\n clearInterval(this.interval)\n clearTimeout(this.reconnectTimer)\n\n // Destroy peers\n for (const peerId in this.peers) {\n const peer = this.peers[peerId]\n clearTimeout(peer.trackerTimeout)\n peer.destroy()\n }\n this.peers = null\n\n if (this.socket) {\n this.socket.removeListener('connect', this._onSocketConnectBound)\n this.socket.removeListener('data', this._onSocketDataBound)\n this.socket.removeListener('close', this._onSocketCloseBound)\n this.socket.removeListener('error', this._onSocketErrorBound)\n this.socket = null\n }\n\n this._onSocketConnectBound = null\n this._onSocketErrorBound = null\n this._onSocketDataBound = null\n this._onSocketCloseBound = null\n\n if (socketPool[this.announceUrl]) {\n socketPool[this.announceUrl].consumers -= 1\n }\n\n // Other instances are using the socket, so there's nothing left to do here\n if (socketPool[this.announceUrl].consumers > 0) return cb()\n\n let socket = socketPool[this.announceUrl]\n delete socketPool[this.announceUrl]\n socket.on('error', noop) // ignore all future errors\n socket.once('close', cb)\n\n // If there is no data response expected, destroy immediately.\n if (!this.expectingResponse) return destroyCleanup()\n\n // Otherwise, wait a short time for potential responses to come in from the\n // server, then force close the socket.\n var timeout = setTimeout(destroyCleanup, common.DESTROY_TIMEOUT)\n\n // But, if a response comes from the server before the timeout fires, do cleanup\n // right away.\n socket.once('data', destroyCleanup)\n\n function destroyCleanup () {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n socket.removeListener('data', destroyCleanup)\n socket.destroy()\n socket = null\n }\n }\n\n _openSocket () {\n this.destroyed = false\n\n if (!this.peers) this.peers = {}\n\n this._onSocketConnectBound = () => {\n this._onSocketConnect()\n }\n this._onSocketErrorBound = err => {\n this._onSocketError(err)\n }\n this._onSocketDataBound = data => {\n this._onSocketData(data)\n }\n this._onSocketCloseBound = () => {\n this._onSocketClose()\n }\n\n this.socket = socketPool[this.announceUrl]\n if (this.socket) {\n socketPool[this.announceUrl].consumers += 1\n } else {\n this.socket = socketPool[this.announceUrl] = new Socket(this.announceUrl)\n this.socket.consumers = 1\n this.socket.once('connect', this._onSocketConnectBound)\n }\n\n this.socket.on('data', this._onSocketDataBound)\n this.socket.once('close', this._onSocketCloseBound)\n this.socket.once('error', this._onSocketErrorBound)\n }\n\n _onSocketConnect () {\n if (this.destroyed) return\n\n if (this.reconnecting) {\n this.reconnecting = false\n this.retries = 0\n this.announce(this.client._defaultAnnounceOpts())\n }\n }\n\n _onSocketData (data) {\n if (this.destroyed) return\n\n this.expectingResponse = false\n\n try {\n data = JSON.parse(data)\n } catch (err) {\n this.client.emit('warning', new Error('Invalid tracker response'))\n return\n }\n\n if (data.action === 'announce') {\n this._onAnnounceResponse(data)\n } else if (data.action === 'scrape') {\n this._onScrapeResponse(data)\n } else {\n this._onSocketError(new Error(`invalid action in WS response: ${data.action}`))\n }\n }\n\n _onAnnounceResponse (data) {\n if (data.info_hash !== this.client._infoHashBinary) {\n debug(\n 'ignoring websocket data from %s for %s (looking for %s: reused socket)',\n this.announceUrl, common.binaryToHex(data.info_hash), this.client.infoHash\n )\n return\n }\n\n if (data.peer_id && data.peer_id === this.client._peerIdBinary) {\n // ignore offers/answers from this client\n return\n }\n\n debug(\n 'received %s from %s for %s',\n JSON.stringify(data), this.announceUrl, this.client.infoHash\n )\n\n const failure = data['failure reason']\n if (failure) return this.client.emit('warning', new Error(failure))\n\n const warning = data['warning message']\n if (warning) this.client.emit('warning', new Error(warning))\n\n const interval = data.interval || data['min interval']\n if (interval) this.setInterval(interval * 1000)\n\n const trackerId = data['tracker id']\n if (trackerId) {\n // If absent, do not discard previous trackerId value\n this._trackerId = trackerId\n }\n\n if (data.complete != null) {\n const response = Object.assign({}, data, {\n announce: this.announceUrl,\n infoHash: common.binaryToHex(data.info_hash)\n })\n this.client.emit('update', response)\n }\n\n let peer\n if (data.offer && data.peer_id) {\n debug('creating peer (from remote offer)')\n peer = this._createPeer()\n peer.id = common.binaryToHex(data.peer_id)\n peer.once('signal', answer => {\n const params = {\n action: 'announce',\n info_hash: this.client._infoHashBinary,\n peer_id: this.client._peerIdBinary,\n to_peer_id: data.peer_id,\n answer,\n offer_id: data.offer_id\n }\n if (this._trackerId) params.trackerid = this._trackerId\n this._send(params)\n })\n peer.signal(data.offer)\n this.client.emit('peer', peer)\n }\n\n if (data.answer && data.peer_id) {\n const offerId = common.binaryToHex(data.offer_id)\n peer = this.peers[offerId]\n if (peer) {\n peer.id = common.binaryToHex(data.peer_id)\n peer.signal(data.answer)\n this.client.emit('peer', peer)\n\n clearTimeout(peer.trackerTimeout)\n peer.trackerTimeout = null\n delete this.peers[offerId]\n } else {\n debug(`got unexpected answer: ${JSON.stringify(data.answer)}`)\n }\n }\n }\n\n _onScrapeResponse (data) {\n data = data.files || {}\n\n const keys = Object.keys(data)\n if (keys.length === 0) {\n this.client.emit('warning', new Error('invalid scrape response'))\n return\n }\n\n keys.forEach(infoHash => {\n // TODO: optionally handle data.flags.min_request_interval\n // (separate from announce interval)\n const response = Object.assign(data[infoHash], {\n announce: this.announceUrl,\n infoHash: common.binaryToHex(infoHash)\n })\n this.client.emit('scrape', response)\n })\n }\n\n _onSocketClose () {\n if (this.destroyed) return\n this.destroy()\n this._startReconnectTimer()\n }\n\n _onSocketError (err) {\n if (this.destroyed) return\n this.destroy()\n // errors will often happen if a tracker is offline, so don't treat it as fatal\n this.client.emit('warning', err)\n this._startReconnectTimer()\n }\n\n _startReconnectTimer () {\n const ms = Math.floor(Math.random() * RECONNECT_VARIANCE) + Math.min(Math.pow(2, this.retries) * RECONNECT_MINIMUM, RECONNECT_MAXIMUM)\n\n this.reconnecting = true\n clearTimeout(this.reconnectTimer)\n this.reconnectTimer = setTimeout(() => {\n this.retries++\n this._openSocket()\n }, ms)\n if (this.reconnectTimer.unref) this.reconnectTimer.unref()\n\n debug('reconnecting socket in %s ms', ms)\n }\n\n _send (params) {\n if (this.destroyed) return\n this.expectingResponse = true\n const message = JSON.stringify(params)\n debug('send %s', message)\n this.socket.send(message)\n }\n\n _generateOffers (numwant, cb) {\n const self = this\n const offers = []\n debug('generating %s offers', numwant)\n\n for (let i = 0; i < numwant; ++i) {\n generateOffer()\n }\n checkDone()\n\n function generateOffer () {\n const offerId = randombytes(20).toString('hex')\n debug('creating peer (from _generateOffers)')\n const peer = self.peers[offerId] = self._createPeer({ initiator: true })\n peer.once('signal', offer => {\n offers.push({\n offer,\n offer_id: common.hexToBinary(offerId)\n })\n checkDone()\n })\n peer.trackerTimeout = setTimeout(() => {\n debug('tracker timeout: destroying peer')\n peer.trackerTimeout = null\n delete self.peers[offerId]\n peer.destroy()\n }, OFFER_TIMEOUT)\n if (peer.trackerTimeout.unref) peer.trackerTimeout.unref()\n }\n\n function checkDone () {\n if (offers.length === numwant) {\n debug('generated %s offers', numwant)\n cb(offers)\n }\n }\n }\n\n _createPeer (opts) {\n const self = this\n\n opts = Object.assign({\n trickle: false,\n config: self.client._rtcConfig,\n wrtc: self.client._wrtc\n }, opts)\n\n const peer = new Peer(opts)\n\n peer.once('error', onError)\n peer.once('connect', onConnect)\n\n return peer\n\n // Handle peer 'error' events that are fired *before* the peer is emitted in\n // a 'peer' event.\n function onError (err) {\n self.client.emit('warning', new Error(`Connection error: ${err.message}`))\n peer.destroy()\n }\n\n // Once the peer is emitted in a 'peer' event, then it's the consumer's\n // responsibility to listen for errors, so the listeners are removed here.\n function onConnect () {\n peer.removeListener('error', onError)\n peer.removeListener('connect', onConnect)\n }\n }\n}\n\nWebSocketTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 30 * 1000 // 30 seconds\n// Normally this shouldn't be accessed but is occasionally useful\nWebSocketTracker._socketPool = socketPool\n\nfunction noop () {}\n\nmodule.exports = WebSocketTracker\n\n\n//# sourceURL=webpack:///./node_modules/bittorrent-tracker/lib/client/websocket-tracker.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bittorrent-tracker/lib/common.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/bittorrent-tracker/lib/common.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Functions/constants needed by both the client and server.\n */\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nexports.DEFAULT_ANNOUNCE_PEERS = 50\nexports.MAX_ANNOUNCE_PEERS = 82\n\nexports.binaryToHex = function (str) {\n if (typeof str !== 'string') {\n str = String(str)\n }\n return Buffer.from(str, 'binary').toString('hex')\n}\n\nexports.hexToBinary = function (str) {\n if (typeof str !== 'string') {\n str = String(str)\n }\n return Buffer.from(str, 'hex').toString('binary')\n}\n\nvar config = __webpack_require__(/*! ./common-node */ 24)\nObject.assign(exports, config)\n\n\n//# sourceURL=webpack:///./node_modules/bittorrent-tracker/lib/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bl/bl.js":
|
||
/*!*******************************!*\
|
||
!*** ./node_modules/bl/bl.js ***!
|
||
\*******************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar DuplexStream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Duplex\n , util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\")\n\nfunction BufferList (callback) {\n if (!(this instanceof BufferList))\n return new BufferList(callback)\n\n this._bufs = []\n this.length = 0\n\n if (typeof callback == 'function') {\n this._callback = callback\n\n var piper = function piper (err) {\n if (this._callback) {\n this._callback(err)\n this._callback = null\n }\n }.bind(this)\n\n this.on('pipe', function onPipe (src) {\n src.on('error', piper)\n })\n this.on('unpipe', function onUnpipe (src) {\n src.removeListener('error', piper)\n })\n } else {\n this.append(callback)\n }\n\n DuplexStream.call(this)\n}\n\n\nutil.inherits(BufferList, DuplexStream)\n\n\nBufferList.prototype._offset = function _offset (offset) {\n var tot = 0, i = 0, _t\n if (offset === 0) return [ 0, 0 ]\n for (; i < this._bufs.length; i++) {\n _t = tot + this._bufs[i].length\n if (offset < _t || i == this._bufs.length - 1) {\n return [ i, offset - tot ]\n }\n tot = _t\n }\n}\n\nBufferList.prototype._reverseOffset = function (blOffset) {\n var bufferId = blOffset[0]\n var offset = blOffset[1]\n for (var i = 0; i < bufferId; i++) {\n offset += this._bufs[i].length\n }\n return offset\n}\n\nBufferList.prototype.append = function append (buf) {\n var i = 0\n\n if (Buffer.isBuffer(buf)) {\n this._appendBuffer(buf)\n } else if (Array.isArray(buf)) {\n for (; i < buf.length; i++)\n this.append(buf[i])\n } else if (buf instanceof BufferList) {\n // unwrap argument into individual BufferLists\n for (; i < buf._bufs.length; i++)\n this.append(buf._bufs[i])\n } else if (buf != null) {\n // coerce number arguments to strings, since Buffer(number) does\n // uninitialized memory allocation\n if (typeof buf == 'number')\n buf = buf.toString()\n\n this._appendBuffer(Buffer.from(buf))\n }\n\n return this\n}\n\n\nBufferList.prototype._appendBuffer = function appendBuffer (buf) {\n this._bufs.push(buf)\n this.length += buf.length\n}\n\n\nBufferList.prototype._write = function _write (buf, encoding, callback) {\n this._appendBuffer(buf)\n\n if (typeof callback == 'function')\n callback()\n}\n\n\nBufferList.prototype._read = function _read (size) {\n if (!this.length)\n return this.push(null)\n\n size = Math.min(size, this.length)\n this.push(this.slice(0, size))\n this.consume(size)\n}\n\n\nBufferList.prototype.end = function end (chunk) {\n DuplexStream.prototype.end.call(this, chunk)\n\n if (this._callback) {\n this._callback(null, this.slice())\n this._callback = null\n }\n}\n\n\nBufferList.prototype.get = function get (index) {\n if (index > this.length || index < 0) {\n return undefined\n }\n var offset = this._offset(index)\n return this._bufs[offset[0]][offset[1]]\n}\n\n\nBufferList.prototype.slice = function slice (start, end) {\n if (typeof start == 'number' && start < 0)\n start += this.length\n if (typeof end == 'number' && end < 0)\n end += this.length\n return this.copy(null, 0, start, end)\n}\n\n\nBufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {\n if (typeof srcStart != 'number' || srcStart < 0)\n srcStart = 0\n if (typeof srcEnd != 'number' || srcEnd > this.length)\n srcEnd = this.length\n if (srcStart >= this.length)\n return dst || Buffer.alloc(0)\n if (srcEnd <= 0)\n return dst || Buffer.alloc(0)\n\n var copy = !!dst\n , off = this._offset(srcStart)\n , len = srcEnd - srcStart\n , bytes = len\n , bufoff = (copy && dstStart) || 0\n , start = off[1]\n , l\n , i\n\n // copy/slice everything\n if (srcStart === 0 && srcEnd == this.length) {\n if (!copy) { // slice, but full concat if multiple buffers\n return this._bufs.length === 1\n ? this._bufs[0]\n : Buffer.concat(this._bufs, this.length)\n }\n\n // copy, need to copy individual buffers\n for (i = 0; i < this._bufs.length; i++) {\n this._bufs[i].copy(dst, bufoff)\n bufoff += this._bufs[i].length\n }\n\n return dst\n }\n\n // easy, cheap case where it's a subset of one of the buffers\n if (bytes <= this._bufs[off[0]].length - start) {\n return copy\n ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)\n : this._bufs[off[0]].slice(start, start + bytes)\n }\n\n if (!copy) // a slice, we need something to copy in to\n dst = Buffer.allocUnsafe(len)\n\n for (i = off[0]; i < this._bufs.length; i++) {\n l = this._bufs[i].length - start\n\n if (bytes > l) {\n this._bufs[i].copy(dst, bufoff, start)\n } else {\n this._bufs[i].copy(dst, bufoff, start, start + bytes)\n break\n }\n\n bufoff += l\n bytes -= l\n\n if (start)\n start = 0\n }\n\n return dst\n}\n\nBufferList.prototype.shallowSlice = function shallowSlice (start, end) {\n start = start || 0\n end = typeof end !== 'number' ? this.length : end\n\n if (start < 0)\n start += this.length\n if (end < 0)\n end += this.length\n\n if (start === end) {\n return new BufferList()\n }\n var startOffset = this._offset(start)\n , endOffset = this._offset(end)\n , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)\n\n if (endOffset[1] == 0)\n buffers.pop()\n else\n buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])\n\n if (startOffset[1] != 0)\n buffers[0] = buffers[0].slice(startOffset[1])\n\n return new BufferList(buffers)\n}\n\nBufferList.prototype.toString = function toString (encoding, start, end) {\n return this.slice(start, end).toString(encoding)\n}\n\nBufferList.prototype.consume = function consume (bytes) {\n while (this._bufs.length) {\n if (bytes >= this._bufs[0].length) {\n bytes -= this._bufs[0].length\n this.length -= this._bufs[0].length\n this._bufs.shift()\n } else {\n this._bufs[0] = this._bufs[0].slice(bytes)\n this.length -= bytes\n break\n }\n }\n return this\n}\n\n\nBufferList.prototype.duplicate = function duplicate () {\n var i = 0\n , copy = new BufferList()\n\n for (; i < this._bufs.length; i++)\n copy.append(this._bufs[i])\n\n return copy\n}\n\n\nBufferList.prototype._destroy = function _destroy (err, cb) {\n this._bufs.length = 0\n this.length = 0\n cb(err)\n}\n\n\nBufferList.prototype.indexOf = function (search, offset, encoding) {\n if (encoding === undefined && typeof offset === 'string') {\n encoding = offset\n offset = undefined\n }\n if (typeof search === 'function' || Array.isArray(search)) {\n throw new TypeError('The \"value\" argument must be one of type string, Buffer, BufferList, or Uint8Array.')\n } else if (typeof search === 'number') {\n search = Buffer.from([search])\n } else if (typeof search === 'string') {\n search = Buffer.from(search, encoding)\n } else if (search instanceof BufferList) {\n search = search.slice()\n } else if (!Buffer.isBuffer(search)) {\n search = Buffer.from(search)\n }\n\n offset = Number(offset || 0)\n if (isNaN(offset)) {\n offset = 0\n }\n\n if (offset < 0) {\n offset = this.length + offset\n }\n\n if (offset < 0) {\n offset = 0\n }\n\n if (search.length === 0) {\n return offset > this.length ? this.length : offset\n }\n\n var blOffset = this._offset(offset)\n var blIndex = blOffset[0] // index of which internal buffer we're working on\n var buffOffset = blOffset[1] // offset of the internal buffer we're working on\n\n // scan over each buffer\n for (blIndex; blIndex < this._bufs.length; blIndex++) {\n var buff = this._bufs[blIndex]\n while(buffOffset < buff.length) {\n var availableWindow = buff.length - buffOffset\n if (availableWindow >= search.length) {\n var nativeSearchResult = buff.indexOf(search, buffOffset)\n if (nativeSearchResult !== -1) {\n return this._reverseOffset([blIndex, nativeSearchResult])\n }\n buffOffset = buff.length - search.length + 1 // end of native search window\n } else {\n var revOffset = this._reverseOffset([blIndex, buffOffset])\n if (this._match(revOffset, search)) {\n return revOffset\n }\n buffOffset++\n }\n }\n buffOffset = 0\n }\n return -1\n}\n\nBufferList.prototype._match = function(offset, search) {\n if (this.length - offset < search.length) {\n return false\n }\n for (var searchOffset = 0; searchOffset < search.length ; searchOffset++) {\n if(this.get(offset + searchOffset) !== search[searchOffset]){\n return false\n }\n }\n return true\n}\n\n\n;(function () {\n var methods = {\n 'readDoubleBE' : 8\n , 'readDoubleLE' : 8\n , 'readFloatBE' : 4\n , 'readFloatLE' : 4\n , 'readInt32BE' : 4\n , 'readInt32LE' : 4\n , 'readUInt32BE' : 4\n , 'readUInt32LE' : 4\n , 'readInt16BE' : 2\n , 'readInt16LE' : 2\n , 'readUInt16BE' : 2\n , 'readUInt16LE' : 2\n , 'readInt8' : 1\n , 'readUInt8' : 1\n , 'readIntBE' : null\n , 'readIntLE' : null\n , 'readUIntBE' : null\n , 'readUIntLE' : null\n }\n\n for (var m in methods) {\n (function (m) {\n if (methods[m] === null) {\n BufferList.prototype[m] = function (offset, byteLength) {\n return this.slice(offset, offset + byteLength)[m](0, byteLength)\n }\n }\n else {\n BufferList.prototype[m] = function (offset) {\n return this.slice(offset, offset + methods[m])[m](0)\n }\n }\n }(m))\n }\n}())\n\n\nmodule.exports = BufferList\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/bl/bl.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/blakejs/blake2b.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/blakejs/blake2b.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Blake2B in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/blakejs/util.js\")\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += v[b,b+1]\n// v should be a Uint32Array\nfunction ADD64AA (v, a, b) {\n var o0 = v[a] + v[b]\n var o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += b\n// b0 is the low 32 bits of b, b1 represents the high 32 bits\nfunction ADD64AC (v, a, b0, b1) {\n var o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n var o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// Little-endian byte access\nfunction B2B_GET32 (arr, i) {\n return (arr[i] ^\n (arr[i + 1] << 8) ^\n (arr[i + 2] << 16) ^\n (arr[i + 3] << 24))\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction B2B_G (a, b, c, d, ix, iy) {\n var x0 = m[ix]\n var x1 = m[ix + 1]\n var y0 = m[iy]\n var y1 = m[iy + 1]\n\n ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n var xor0 = v[d] ^ v[a]\n var xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64AA(v, a, b)\n ADD64AC(v, a, y0, y1)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nvar BLAKE2B_IV32 = new Uint32Array([\n 0xF3BCC908, 0x6A09E667, 0x84CAA73B, 0xBB67AE85,\n 0xFE94F82B, 0x3C6EF372, 0x5F1D36F1, 0xA54FF53A,\n 0xADE682D1, 0x510E527F, 0x2B3E6C1F, 0x9B05688C,\n 0xFB41BD6B, 0x1F83D9AB, 0x137E2179, 0x5BE0CD19\n])\n\nvar SIGMA8 = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0,\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3\n]\n\n// These are offsets into a uint64 buffer.\n// Multiply them all by 2 to make them offsets into a uint32 buffer,\n// because this is Javascript and we don't have uint64s\nvar SIGMA82 = new Uint8Array(SIGMA8.map(function (x) { return x * 2 }))\n\n// Compression function. 'last' flag indicates last block.\n// Note we're representing 16 uint64s as 32 uint32s\nvar v = new Uint32Array(32)\nvar m = new Uint32Array(32)\nfunction blake2bCompress (ctx, last) {\n var i = 0\n\n // init work variables\n for (i = 0; i < 16; i++) {\n v[i] = ctx.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] = v[24] ^ ctx.t\n v[25] = v[25] ^ (ctx.t / 0x100000000)\n // high 64 bits not supported, offset may not be higher than 2**53-1\n\n // last block flag set ?\n if (last) {\n v[28] = ~v[28]\n v[29] = ~v[29]\n }\n\n // get little-endian words\n for (i = 0; i < 32; i++) {\n m[i] = B2B_GET32(ctx.b, 4 * i)\n }\n\n // twelve rounds of mixing\n // uncomment the DebugPrint calls to log the computation\n // and match the RFC sample documentation\n // util.debugPrint(' m[16]', m, 64)\n for (i = 0; i < 12; i++) {\n // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64)\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1])\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3])\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5])\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7])\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9])\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11])\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13])\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15])\n }\n // util.debugPrint(' (i=12) v[16]', v, 64)\n\n for (i = 0; i < 16; i++) {\n ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]\n }\n // util.debugPrint('h[8]', ctx.h, 64)\n}\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\nfunction blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}\n\n// Updates a BLAKE2b streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2bUpdate (ctx, input) {\n for (var i = 0; i < input.length; i++) {\n if (ctx.c === 128) { // buffer full ?\n ctx.t += ctx.c // add counters\n blake2bCompress(ctx, false) // compress (not last)\n ctx.c = 0 // counter to zero\n }\n ctx.b[ctx.c++] = input[i]\n }\n}\n\n// Completes a BLAKE2b streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2bFinal (ctx) {\n ctx.t += ctx.c // mark last block offset\n\n while (ctx.c < 128) { // fill up with zeros\n ctx.b[ctx.c++] = 0\n }\n blake2bCompress(ctx, true) // final block flag = 1\n\n // little endian convert and store\n var out = new Uint8Array(ctx.outlen)\n for (var i = 0; i < ctx.outlen; i++) {\n out[i] = ctx.h[i >> 2] >> (8 * (i & 3))\n }\n return out\n}\n\n// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2b (input, key, outlen) {\n // preprocess inputs\n outlen = outlen || 64\n input = util.normalizeInput(input)\n\n // do the math\n var ctx = blake2bInit(outlen, key)\n blake2bUpdate(ctx, input)\n return blake2bFinal(ctx)\n}\n\n// Computes the BLAKE2B hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2bHex (input, key, outlen) {\n var output = blake2b(input, key, outlen)\n return util.toHex(output)\n}\n\nmodule.exports = {\n blake2b: blake2b,\n blake2bHex: blake2bHex,\n blake2bInit: blake2bInit,\n blake2bUpdate: blake2bUpdate,\n blake2bFinal: blake2bFinal\n}\n\n\n//# sourceURL=webpack:///./node_modules/blakejs/blake2b.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/blakejs/blake2s.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/blakejs/blake2s.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// BLAKE2s hash function in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/blakejs/util.js\")\n\n// Little-endian byte access.\n// Expects a Uint8Array and an index\n// Returns the little-endian uint32 at v[i..i+3]\nfunction B2S_GET32 (v, i) {\n return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}\n\n// Mixing function G.\nfunction B2S_G (a, b, c, d, x, y) {\n v[a] = v[a] + v[b] + x\n v[d] = ROTR32(v[d] ^ v[a], 16)\n v[c] = v[c] + v[d]\n v[b] = ROTR32(v[b] ^ v[c], 12)\n v[a] = v[a] + v[b] + y\n v[d] = ROTR32(v[d] ^ v[a], 8)\n v[c] = v[c] + v[d]\n v[b] = ROTR32(v[b] ^ v[c], 7)\n}\n\n// 32-bit right rotation\n// x should be a uint32\n// y must be between 1 and 31, inclusive\nfunction ROTR32 (x, y) {\n return (x >>> y) ^ (x << (32 - y))\n}\n\n// Initialization Vector.\nvar BLAKE2S_IV = new Uint32Array([\n 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,\n 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19])\n\nvar SIGMA = new Uint8Array([\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0])\n\n// Compression function. \"last\" flag indicates last block\nvar v = new Uint32Array(16)\nvar m = new Uint32Array(16)\nfunction blake2sCompress (ctx, last) {\n var i = 0\n for (i = 0; i < 8; i++) { // init work variables\n v[i] = ctx.h[i]\n v[i + 8] = BLAKE2S_IV[i]\n }\n\n v[12] ^= ctx.t // low 32 bits of offset\n v[13] ^= (ctx.t / 0x100000000) // high 32 bits\n if (last) { // last block flag set ?\n v[14] = ~v[14]\n }\n\n for (i = 0; i < 16; i++) { // get little-endian words\n m[i] = B2S_GET32(ctx.b, 4 * i)\n }\n\n // ten rounds of mixing\n // uncomment the DebugPrint calls to log the computation\n // and match the RFC sample documentation\n // util.debugPrint(' m[16]', m, 32)\n for (i = 0; i < 10; i++) {\n // util.debugPrint(' (i=' + i + ') v[16]', v, 32)\n B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]])\n B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]])\n B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]])\n B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]])\n B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]])\n B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]])\n B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]])\n B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]])\n }\n // util.debugPrint(' (i=10) v[16]', v, 32)\n\n for (i = 0; i < 8; i++) {\n ctx.h[i] ^= v[i] ^ v[i + 8]\n }\n // util.debugPrint('h[8]', ctx.h, 32)\n}\n\n// Creates a BLAKE2s hashing context\n// Requires an output length between 1 and 32 bytes\n// Takes an optional Uint8Array key\nfunction blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}\n\n// Updates a BLAKE2s streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2sUpdate (ctx, input) {\n for (var i = 0; i < input.length; i++) {\n if (ctx.c === 64) { // buffer full ?\n ctx.t += ctx.c // add counters\n blake2sCompress(ctx, false) // compress (not last)\n ctx.c = 0 // counter to zero\n }\n ctx.b[ctx.c++] = input[i]\n }\n}\n\n// Completes a BLAKE2s streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2sFinal (ctx) {\n ctx.t += ctx.c // mark last block offset\n while (ctx.c < 64) { // fill up with zeros\n ctx.b[ctx.c++] = 0\n }\n blake2sCompress(ctx, true) // final block flag = 1\n\n // little endian convert and store\n var out = new Uint8Array(ctx.outlen)\n for (var i = 0; i < ctx.outlen; i++) {\n out[i] = (ctx.h[i >> 2] >> (8 * (i & 3))) & 0xFF\n }\n return out\n}\n\n// Computes the BLAKE2S hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 32 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2s (input, key, outlen) {\n // preprocess inputs\n outlen = outlen || 32\n input = util.normalizeInput(input)\n\n // do the math\n var ctx = blake2sInit(outlen, key)\n blake2sUpdate(ctx, input)\n return blake2sFinal(ctx)\n}\n\n// Computes the BLAKE2S hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 32 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2sHex (input, key, outlen) {\n var output = blake2s(input, key, outlen)\n return util.toHex(output)\n}\n\nmodule.exports = {\n blake2s: blake2s,\n blake2sHex: blake2sHex,\n blake2sInit: blake2sInit,\n blake2sUpdate: blake2sUpdate,\n blake2sFinal: blake2sFinal\n}\n\n\n//# sourceURL=webpack:///./node_modules/blakejs/blake2s.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/blakejs/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/blakejs/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var b2b = __webpack_require__(/*! ./blake2b */ \"./node_modules/blakejs/blake2b.js\")\nvar b2s = __webpack_require__(/*! ./blake2s */ \"./node_modules/blakejs/blake2s.js\")\n\nmodule.exports = {\n blake2b: b2b.blake2b,\n blake2bHex: b2b.blake2bHex,\n blake2bInit: b2b.blake2bInit,\n blake2bUpdate: b2b.blake2bUpdate,\n blake2bFinal: b2b.blake2bFinal,\n blake2s: b2s.blake2s,\n blake2sHex: b2s.blake2sHex,\n blake2sInit: b2s.blake2sInit,\n blake2sUpdate: b2s.blake2sUpdate,\n blake2sFinal: b2s.blake2sFinal\n}\n\n\n//# sourceURL=webpack:///./node_modules/blakejs/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/blakejs/util.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/blakejs/util.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array'\n\n// For convenience, let people hash a string, not just a Uint8Array\nfunction normalizeInput (input) {\n var ret\n if (input instanceof Uint8Array) {\n ret = input\n } else if (input instanceof Buffer) {\n ret = new Uint8Array(input)\n } else if (typeof (input) === 'string') {\n ret = new Uint8Array(Buffer.from(input, 'utf8'))\n } else {\n throw new Error(ERROR_MSG_INPUT)\n }\n return ret\n}\n\n// Converts a Uint8Array to a hexadecimal string\n// For example, toHex([255, 0, 255]) returns \"ff00ff\"\nfunction toHex (bytes) {\n return Array.prototype.map.call(bytes, function (n) {\n return (n < 16 ? '0' : '') + n.toString(16)\n }).join('')\n}\n\n// Converts any value in [0...2^32-1] to an 8-character hex string\nfunction uint32ToHex (val) {\n return (0x100000000 + val).toString(16).substring(1)\n}\n\n// For debugging: prints out hash state in the same format as the RFC\n// sample computation exactly, so that you can diff\nfunction debugPrint (label, arr, size) {\n var msg = '\\n' + label + ' = '\n for (var i = 0; i < arr.length; i += 2) {\n if (size === 32) {\n msg += uint32ToHex(arr[i]).toUpperCase()\n msg += ' '\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n } else if (size === 64) {\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n msg += uint32ToHex(arr[i]).toUpperCase()\n } else throw new Error('Invalid size ' + size)\n if (i % 6 === 4) {\n msg += '\\n' + new Array(label.length + 4).join(' ')\n } else if (i < arr.length - 2) {\n msg += ' '\n }\n }\n console.log(msg)\n}\n\n// For performance testing: generates N bytes of input, hashes M times\n// Measures and prints MB/second hash performance each time\nfunction testSpeed (hashFn, N, M) {\n var startMs = new Date().getTime()\n\n var input = new Uint8Array(N)\n for (var i = 0; i < N; i++) {\n input[i] = i % 256\n }\n var genMs = new Date().getTime()\n console.log('Generated random input in ' + (genMs - startMs) + 'ms')\n startMs = genMs\n\n for (i = 0; i < M; i++) {\n var hashHex = hashFn(input)\n var hashMs = new Date().getTime()\n var ms = hashMs - startMs\n startMs = hashMs\n console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...')\n console.log(Math.round(N / (1 << 20) / (ms / 1000) * 100) / 100 + ' MB PER SECOND')\n }\n}\n\nmodule.exports = {\n normalizeInput: normalizeInput,\n toHex: toHex,\n debugPrint: debugPrint,\n testSpeed: testSpeed\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/blakejs/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/blob-to-buffer/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/blob-to-buffer/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* global Blob, FileReader */\n\nmodule.exports = function blobToBuffer (blob, cb) {\n if (typeof Blob === 'undefined' || !(blob instanceof Blob)) {\n throw new Error('first argument must be a Blob')\n }\n if (typeof cb !== 'function') {\n throw new Error('second argument must be a function')\n }\n\n var reader = new FileReader()\n\n function onLoadEnd (e) {\n reader.removeEventListener('loadend', onLoadEnd, false)\n if (e.error) cb(e.error)\n else cb(null, Buffer.from(reader.result))\n }\n\n reader.addEventListener('loadend', onLoadEnd, false)\n reader.readAsArrayBuffer(blob)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/blob-to-buffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/block-stream2/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nvar Transform = __webpack_require__(/*! readable-stream */ \"./node_modules/block-stream2/node_modules/readable-stream/readable-browser.js\").Transform;\nvar defined = __webpack_require__(/*! defined */ \"./node_modules/defined/index.js\");\n\nmodule.exports = Block;\ninherits(Block, Transform);\n\nfunction Block (size, opts) {\n if (!(this instanceof Block)) return new Block(size, opts);\n Transform.call(this);\n if (!opts) opts = {};\n if (typeof size === 'object') {\n opts = size;\n size = opts.size;\n }\n this.size = size || 512;\n \n if (opts.nopad) this._zeroPadding = false;\n else this._zeroPadding = defined(opts.zeroPadding, true);\n \n this._buffered = [];\n this._bufferedBytes = 0;\n}\n\nBlock.prototype._transform = function (buf, enc, next) {\n this._bufferedBytes += buf.length;\n this._buffered.push(buf);\n \n while (this._bufferedBytes >= this.size) {\n var b = Buffer.concat(this._buffered);\n this._bufferedBytes -= this.size;\n this.push(b.slice(0, this.size));\n this._buffered = [ b.slice(this.size, b.length) ];\n }\n next();\n};\n\nBlock.prototype._flush = function () {\n if (this._bufferedBytes && this._zeroPadding) {\n var zeroes = new Buffer(this.size - this._bufferedBytes);\n zeroes.fill(0);\n this._buffered.push(zeroes);\n this.push(Buffer.concat(this._buffered));\n this._buffered = null;\n }\n else if (this._bufferedBytes) {\n this.push(Buffer.concat(this._buffered));\n this._buffered = null;\n }\n this.push(null);\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/block-stream2/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!********************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\*****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 11);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!******************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\*****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!****************************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\****************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 12);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!*************************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\*************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!********************************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\********************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/block-stream2/node_modules/readable-stream/readable-browser.js":
|
||
/*!*************************************************************************************!*\
|
||
!*** ./node_modules/block-stream2/node_modules/readable-stream/readable-browser.js ***!
|
||
\*************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/block-stream2/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/block-stream2/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bluebird/js/browser/bluebird.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/bluebird/js/browser/bluebird.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {/* @preserve\n * The MIT License (MIT)\n * \n * Copyright (c) 2013-2018 Petka Antonov\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n * \n */\n/**\n * bluebird build version 3.5.5\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n*/\n!function(e){if(true)module.exports=e();else { var f; }}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_==\"function\"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_==\"function\"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar SomePromiseArray = Promise._SomePromiseArray;\nfunction any(promises) {\n var ret = new SomePromiseArray(promises);\n var promise = ret.promise();\n ret.setHowMany(1);\n ret.setUnwrap();\n ret.init();\n return promise;\n}\n\nPromise.any = function (promises) {\n return any(promises);\n};\n\nPromise.prototype.any = function () {\n return any(this);\n};\n\n};\n\n},{}],2:[function(_dereq_,module,exports){\n\"use strict\";\nvar firstLineError;\ntry {throw new Error(); } catch (e) {firstLineError = e;}\nvar schedule = _dereq_(\"./schedule\");\nvar Queue = _dereq_(\"./queue\");\nvar util = _dereq_(\"./util\");\n\nfunction Async() {\n this._customScheduler = false;\n this._isTickUsed = false;\n this._lateQueue = new Queue(16);\n this._normalQueue = new Queue(16);\n this._haveDrainedQueues = false;\n this._trampolineEnabled = true;\n var self = this;\n this.drainQueues = function () {\n self._drainQueues();\n };\n this._schedule = schedule;\n}\n\nAsync.prototype.setScheduler = function(fn) {\n var prev = this._schedule;\n this._schedule = fn;\n this._customScheduler = true;\n return prev;\n};\n\nAsync.prototype.hasCustomScheduler = function() {\n return this._customScheduler;\n};\n\nAsync.prototype.enableTrampoline = function() {\n this._trampolineEnabled = true;\n};\n\nAsync.prototype.disableTrampolineIfNecessary = function() {\n if (util.hasDevTools) {\n this._trampolineEnabled = false;\n }\n};\n\nAsync.prototype.haveItemsQueued = function () {\n return this._isTickUsed || this._haveDrainedQueues;\n};\n\n\nAsync.prototype.fatalError = function(e, isNode) {\n if (isNode) {\n process.stderr.write(\"Fatal \" + (e instanceof Error ? e.stack : e) +\n \"\\n\");\n process.exit(2);\n } else {\n this.throwLater(e);\n }\n};\n\nAsync.prototype.throwLater = function(fn, arg) {\n if (arguments.length === 1) {\n arg = fn;\n fn = function () { throw arg; };\n }\n if (typeof setTimeout !== \"undefined\") {\n setTimeout(function() {\n fn(arg);\n }, 0);\n } else try {\n this._schedule(function() {\n fn(arg);\n });\n } catch (e) {\n throw new Error(\"No async scheduler available\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n};\n\nfunction AsyncInvokeLater(fn, receiver, arg) {\n this._lateQueue.push(fn, receiver, arg);\n this._queueTick();\n}\n\nfunction AsyncInvoke(fn, receiver, arg) {\n this._normalQueue.push(fn, receiver, arg);\n this._queueTick();\n}\n\nfunction AsyncSettlePromises(promise) {\n this._normalQueue._pushOne(promise);\n this._queueTick();\n}\n\nif (!util.hasDevTools) {\n Async.prototype.invokeLater = AsyncInvokeLater;\n Async.prototype.invoke = AsyncInvoke;\n Async.prototype.settlePromises = AsyncSettlePromises;\n} else {\n Async.prototype.invokeLater = function (fn, receiver, arg) {\n if (this._trampolineEnabled) {\n AsyncInvokeLater.call(this, fn, receiver, arg);\n } else {\n this._schedule(function() {\n setTimeout(function() {\n fn.call(receiver, arg);\n }, 100);\n });\n }\n };\n\n Async.prototype.invoke = function (fn, receiver, arg) {\n if (this._trampolineEnabled) {\n AsyncInvoke.call(this, fn, receiver, arg);\n } else {\n this._schedule(function() {\n fn.call(receiver, arg);\n });\n }\n };\n\n Async.prototype.settlePromises = function(promise) {\n if (this._trampolineEnabled) {\n AsyncSettlePromises.call(this, promise);\n } else {\n this._schedule(function() {\n promise._settlePromises();\n });\n }\n };\n}\n\nfunction _drainQueue(queue) {\n while (queue.length() > 0) {\n _drainQueueStep(queue);\n }\n}\n\nfunction _drainQueueStep(queue) {\n var fn = queue.shift();\n if (typeof fn !== \"function\") {\n fn._settlePromises();\n } else {\n var receiver = queue.shift();\n var arg = queue.shift();\n fn.call(receiver, arg);\n }\n}\n\nAsync.prototype._drainQueues = function () {\n _drainQueue(this._normalQueue);\n this._reset();\n this._haveDrainedQueues = true;\n _drainQueue(this._lateQueue);\n};\n\nAsync.prototype._queueTick = function () {\n if (!this._isTickUsed) {\n this._isTickUsed = true;\n this._schedule(this.drainQueues);\n }\n};\n\nAsync.prototype._reset = function () {\n this._isTickUsed = false;\n};\n\nmodule.exports = Async;\nmodule.exports.firstLineError = firstLineError;\n\n},{\"./queue\":26,\"./schedule\":29,\"./util\":36}],3:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\nvar calledBind = false;\nvar rejectThis = function(_, e) {\n this._reject(e);\n};\n\nvar targetRejected = function(e, context) {\n context.promiseRejectionQueued = true;\n context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\n};\n\nvar bindingResolved = function(thisArg, context) {\n if (((this._bitField & 50397184) === 0)) {\n this._resolveCallback(context.target);\n }\n};\n\nvar bindingRejected = function(e, context) {\n if (!context.promiseRejectionQueued) this._reject(e);\n};\n\nPromise.prototype.bind = function (thisArg) {\n if (!calledBind) {\n calledBind = true;\n Promise.prototype._propagateFrom = debug.propagateFromFunction();\n Promise.prototype._boundValue = debug.boundValueFunction();\n }\n var maybePromise = tryConvertToPromise(thisArg);\n var ret = new Promise(INTERNAL);\n ret._propagateFrom(this, 1);\n var target = this._target();\n ret._setBoundTo(maybePromise);\n if (maybePromise instanceof Promise) {\n var context = {\n promiseRejectionQueued: false,\n promise: ret,\n target: target,\n bindingPromise: maybePromise\n };\n target._then(INTERNAL, targetRejected, undefined, ret, context);\n maybePromise._then(\n bindingResolved, bindingRejected, undefined, ret, context);\n ret._setOnCancel(maybePromise);\n } else {\n ret._resolveCallback(target);\n }\n return ret;\n};\n\nPromise.prototype._setBoundTo = function (obj) {\n if (obj !== undefined) {\n this._bitField = this._bitField | 2097152;\n this._boundTo = obj;\n } else {\n this._bitField = this._bitField & (~2097152);\n }\n};\n\nPromise.prototype._isBound = function () {\n return (this._bitField & 2097152) === 2097152;\n};\n\nPromise.bind = function (thisArg, value) {\n return Promise.resolve(value).bind(thisArg);\n};\n};\n\n},{}],4:[function(_dereq_,module,exports){\n\"use strict\";\nvar old;\nif (typeof Promise !== \"undefined\") old = Promise;\nfunction noConflict() {\n try { if (Promise === bluebird) Promise = old; }\n catch (e) {}\n return bluebird;\n}\nvar bluebird = _dereq_(\"./promise\")();\nbluebird.noConflict = noConflict;\nmodule.exports = bluebird;\n\n},{\"./promise\":22}],5:[function(_dereq_,module,exports){\n\"use strict\";\nvar cr = Object.create;\nif (cr) {\n var callerCache = cr(null);\n var getterCache = cr(null);\n callerCache[\" size\"] = getterCache[\" size\"] = 0;\n}\n\nmodule.exports = function(Promise) {\nvar util = _dereq_(\"./util\");\nvar canEvaluate = util.canEvaluate;\nvar isIdentifier = util.isIdentifier;\n\nvar getMethodCaller;\nvar getGetter;\nif (false) { var getCompiled, makeGetter, makeMethodCaller; }\n\nfunction ensureMethod(obj, methodName) {\n var fn;\n if (obj != null) fn = obj[methodName];\n if (typeof fn !== \"function\") {\n var message = \"Object \" + util.classString(obj) + \" has no method '\" +\n util.toString(methodName) + \"'\";\n throw new Promise.TypeError(message);\n }\n return fn;\n}\n\nfunction caller(obj) {\n var methodName = this.pop();\n var fn = ensureMethod(obj, methodName);\n return fn.apply(obj, this);\n}\nPromise.prototype.call = function (methodName) {\n var args = [].slice.call(arguments, 1);;\n if (false) { var maybeCaller; }\n args.push(methodName);\n return this._then(caller, undefined, undefined, args, undefined);\n};\n\nfunction namedGetter(obj) {\n return obj[this];\n}\nfunction indexedGetter(obj) {\n var index = +this;\n if (index < 0) index = Math.max(0, index + obj.length);\n return obj[index];\n}\nPromise.prototype.get = function (propertyName) {\n var isIndex = (typeof propertyName === \"number\");\n var getter;\n if (!isIndex) {\n if (canEvaluate) {\n var maybeGetter = getGetter(propertyName);\n getter = maybeGetter !== null ? maybeGetter : namedGetter;\n } else {\n getter = namedGetter;\n }\n } else {\n getter = indexedGetter;\n }\n return this._then(getter, undefined, undefined, propertyName, undefined);\n};\n};\n\n},{\"./util\":36}],6:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nPromise.prototype[\"break\"] = Promise.prototype.cancel = function() {\n if (!debug.cancellation()) return this._warn(\"cancellation is disabled\");\n\n var promise = this;\n var child = promise;\n while (promise._isCancellable()) {\n if (!promise._cancelBy(child)) {\n if (child._isFollowing()) {\n child._followee().cancel();\n } else {\n child._cancelBranched();\n }\n break;\n }\n\n var parent = promise._cancellationParent;\n if (parent == null || !parent._isCancellable()) {\n if (promise._isFollowing()) {\n promise._followee().cancel();\n } else {\n promise._cancelBranched();\n }\n break;\n } else {\n if (promise._isFollowing()) promise._followee().cancel();\n promise._setWillBeCancelled();\n child = promise;\n promise = parent;\n }\n }\n};\n\nPromise.prototype._branchHasCancelled = function() {\n this._branchesRemainingToCancel--;\n};\n\nPromise.prototype._enoughBranchesHaveCancelled = function() {\n return this._branchesRemainingToCancel === undefined ||\n this._branchesRemainingToCancel <= 0;\n};\n\nPromise.prototype._cancelBy = function(canceller) {\n if (canceller === this) {\n this._branchesRemainingToCancel = 0;\n this._invokeOnCancel();\n return true;\n } else {\n this._branchHasCancelled();\n if (this._enoughBranchesHaveCancelled()) {\n this._invokeOnCancel();\n return true;\n }\n }\n return false;\n};\n\nPromise.prototype._cancelBranched = function() {\n if (this._enoughBranchesHaveCancelled()) {\n this._cancel();\n }\n};\n\nPromise.prototype._cancel = function() {\n if (!this._isCancellable()) return;\n this._setCancelled();\n async.invoke(this._cancelPromises, this, undefined);\n};\n\nPromise.prototype._cancelPromises = function() {\n if (this._length() > 0) this._settlePromises();\n};\n\nPromise.prototype._unsetOnCancel = function() {\n this._onCancelField = undefined;\n};\n\nPromise.prototype._isCancellable = function() {\n return this.isPending() && !this._isCancelled();\n};\n\nPromise.prototype.isCancellable = function() {\n return this.isPending() && !this.isCancelled();\n};\n\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\n if (util.isArray(onCancelCallback)) {\n for (var i = 0; i < onCancelCallback.length; ++i) {\n this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\n }\n } else if (onCancelCallback !== undefined) {\n if (typeof onCancelCallback === \"function\") {\n if (!internalOnly) {\n var e = tryCatch(onCancelCallback).call(this._boundValue());\n if (e === errorObj) {\n this._attachExtraTrace(e.e);\n async.throwLater(e.e);\n }\n }\n } else {\n onCancelCallback._resultCancelled(this);\n }\n }\n};\n\nPromise.prototype._invokeOnCancel = function() {\n var onCancelCallback = this._onCancel();\n this._unsetOnCancel();\n async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\n};\n\nPromise.prototype._invokeInternalOnCancel = function() {\n if (this._isCancellable()) {\n this._doInvokeOnCancel(this._onCancel(), true);\n this._unsetOnCancel();\n }\n};\n\nPromise.prototype._resultCancelled = function() {\n this.cancel();\n};\n\n};\n\n},{\"./util\":36}],7:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(NEXT_FILTER) {\nvar util = _dereq_(\"./util\");\nvar getKeys = _dereq_(\"./es5\").keys;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction catchFilter(instances, cb, promise) {\n return function(e) {\n var boundTo = promise._boundValue();\n predicateLoop: for (var i = 0; i < instances.length; ++i) {\n var item = instances[i];\n\n if (item === Error ||\n (item != null && item.prototype instanceof Error)) {\n if (e instanceof item) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (typeof item === \"function\") {\n var matchesPredicate = tryCatch(item).call(boundTo, e);\n if (matchesPredicate === errorObj) {\n return matchesPredicate;\n } else if (matchesPredicate) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (util.isObject(e)) {\n var keys = getKeys(item);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n if (item[key] != e[key]) {\n continue predicateLoop;\n }\n }\n return tryCatch(cb).call(boundTo, e);\n }\n }\n return NEXT_FILTER;\n };\n}\n\nreturn catchFilter;\n};\n\n},{\"./es5\":13,\"./util\":36}],8:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar longStackTraces = false;\nvar contextStack = [];\n\nPromise.prototype._promiseCreated = function() {};\nPromise.prototype._pushContext = function() {};\nPromise.prototype._popContext = function() {return null;};\nPromise._peekContext = Promise.prototype._peekContext = function() {};\n\nfunction Context() {\n this._trace = new Context.CapturedTrace(peekContext());\n}\nContext.prototype._pushContext = function () {\n if (this._trace !== undefined) {\n this._trace._promiseCreated = null;\n contextStack.push(this._trace);\n }\n};\n\nContext.prototype._popContext = function () {\n if (this._trace !== undefined) {\n var trace = contextStack.pop();\n var ret = trace._promiseCreated;\n trace._promiseCreated = null;\n return ret;\n }\n return null;\n};\n\nfunction createContext() {\n if (longStackTraces) return new Context();\n}\n\nfunction peekContext() {\n var lastIndex = contextStack.length - 1;\n if (lastIndex >= 0) {\n return contextStack[lastIndex];\n }\n return undefined;\n}\nContext.CapturedTrace = null;\nContext.create = createContext;\nContext.deactivateLongStackTraces = function() {};\nContext.activateLongStackTraces = function() {\n var Promise_pushContext = Promise.prototype._pushContext;\n var Promise_popContext = Promise.prototype._popContext;\n var Promise_PeekContext = Promise._peekContext;\n var Promise_peekContext = Promise.prototype._peekContext;\n var Promise_promiseCreated = Promise.prototype._promiseCreated;\n Context.deactivateLongStackTraces = function() {\n Promise.prototype._pushContext = Promise_pushContext;\n Promise.prototype._popContext = Promise_popContext;\n Promise._peekContext = Promise_PeekContext;\n Promise.prototype._peekContext = Promise_peekContext;\n Promise.prototype._promiseCreated = Promise_promiseCreated;\n longStackTraces = false;\n };\n longStackTraces = true;\n Promise.prototype._pushContext = Context.prototype._pushContext;\n Promise.prototype._popContext = Context.prototype._popContext;\n Promise._peekContext = Promise.prototype._peekContext = peekContext;\n Promise.prototype._promiseCreated = function() {\n var ctx = this._peekContext();\n if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\n };\n};\nreturn Context;\n};\n\n},{}],9:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, Context) {\nvar getDomain = Promise._getDomain;\nvar async = Promise._async;\nvar Warning = _dereq_(\"./errors\").Warning;\nvar util = _dereq_(\"./util\");\nvar es5 = _dereq_(\"./es5\");\nvar canAttachTrace = util.canAttachTrace;\nvar unhandledRejectionHandled;\nvar possiblyUnhandledRejection;\nvar bluebirdFramePattern =\n /[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/;\nvar nodeFramePattern = /\\((?:timers\\.js):\\d+:\\d+\\)/;\nvar parseLinePattern = /[\\/<\\(](.+?):(\\d+):(\\d+)\\)?\\s*$/;\nvar stackFramePattern = null;\nvar formatStack = null;\nvar indentStackFrames = false;\nvar printWarning;\nvar debugging = !!(util.env(\"BLUEBIRD_DEBUG\") != 0 &&\n ( true ||\n false));\n\nvar warnings = !!(util.env(\"BLUEBIRD_WARNINGS\") != 0 &&\n (debugging || util.env(\"BLUEBIRD_WARNINGS\")));\n\nvar longStackTraces = !!(util.env(\"BLUEBIRD_LONG_STACK_TRACES\") != 0 &&\n (debugging || util.env(\"BLUEBIRD_LONG_STACK_TRACES\")));\n\nvar wForgottenReturn = util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\") != 0 &&\n (warnings || !!util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\"));\n\nPromise.prototype.suppressUnhandledRejections = function() {\n var target = this._target();\n target._bitField = ((target._bitField & (~1048576)) |\n 524288);\n};\n\nPromise.prototype._ensurePossibleRejectionHandled = function () {\n if ((this._bitField & 524288) !== 0) return;\n this._setRejectionIsUnhandled();\n var self = this;\n setTimeout(function() {\n self._notifyUnhandledRejection();\n }, 1);\n};\n\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\n fireRejectionEvent(\"rejectionHandled\",\n unhandledRejectionHandled, undefined, this);\n};\n\nPromise.prototype._setReturnedNonUndefined = function() {\n this._bitField = this._bitField | 268435456;\n};\n\nPromise.prototype._returnedNonUndefined = function() {\n return (this._bitField & 268435456) !== 0;\n};\n\nPromise.prototype._notifyUnhandledRejection = function () {\n if (this._isRejectionUnhandled()) {\n var reason = this._settledValue();\n this._setUnhandledRejectionIsNotified();\n fireRejectionEvent(\"unhandledRejection\",\n possiblyUnhandledRejection, reason, this);\n }\n};\n\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField | 262144;\n};\n\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField & (~262144);\n};\n\nPromise.prototype._isUnhandledRejectionNotified = function () {\n return (this._bitField & 262144) > 0;\n};\n\nPromise.prototype._setRejectionIsUnhandled = function () {\n this._bitField = this._bitField | 1048576;\n};\n\nPromise.prototype._unsetRejectionIsUnhandled = function () {\n this._bitField = this._bitField & (~1048576);\n if (this._isUnhandledRejectionNotified()) {\n this._unsetUnhandledRejectionIsNotified();\n this._notifyUnhandledRejectionIsHandled();\n }\n};\n\nPromise.prototype._isRejectionUnhandled = function () {\n return (this._bitField & 1048576) > 0;\n};\n\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\n return warn(message, shouldUseOwnTrace, promise || this);\n};\n\nPromise.onPossiblyUnhandledRejection = function (fn) {\n var domain = getDomain();\n possiblyUnhandledRejection =\n typeof fn === \"function\" ? (domain === null ?\n fn : util.domainBind(domain, fn))\n : undefined;\n};\n\nPromise.onUnhandledRejectionHandled = function (fn) {\n var domain = getDomain();\n unhandledRejectionHandled =\n typeof fn === \"function\" ? (domain === null ?\n fn : util.domainBind(domain, fn))\n : undefined;\n};\n\nvar disableLongStackTraces = function() {};\nPromise.longStackTraces = function () {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n if (!config.longStackTraces && longStackTracesIsSupported()) {\n var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\n var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\n var Promise_dereferenceTrace = Promise.prototype._dereferenceTrace;\n config.longStackTraces = true;\n disableLongStackTraces = function() {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n Promise.prototype._captureStackTrace = Promise_captureStackTrace;\n Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\n Promise.prototype._dereferenceTrace = Promise_dereferenceTrace;\n Context.deactivateLongStackTraces();\n async.enableTrampoline();\n config.longStackTraces = false;\n };\n Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\n Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\n Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace;\n Context.activateLongStackTraces();\n async.disableTrampolineIfNecessary();\n }\n};\n\nPromise.hasLongStackTraces = function () {\n return config.longStackTraces && longStackTracesIsSupported();\n};\n\nvar fireDomEvent = (function() {\n try {\n if (typeof CustomEvent === \"function\") {\n var event = new CustomEvent(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function(name, event) {\n var eventData = {\n detail: event,\n cancelable: true\n };\n es5.defineProperty(\n eventData, \"promise\", {value: event.promise});\n es5.defineProperty(eventData, \"reason\", {value: event.reason});\n var domEvent = new CustomEvent(name.toLowerCase(), eventData);\n return !util.global.dispatchEvent(domEvent);\n };\n } else if (typeof Event === \"function\") {\n var event = new Event(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = new Event(name.toLowerCase(), {\n cancelable: true\n });\n domEvent.detail = event;\n es5.defineProperty(domEvent, \"promise\", {value: event.promise});\n es5.defineProperty(domEvent, \"reason\", {value: event.reason});\n return !util.global.dispatchEvent(domEvent);\n };\n } else {\n var event = document.createEvent(\"CustomEvent\");\n event.initCustomEvent(\"testingtheevent\", false, true, {});\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = document.createEvent(\"CustomEvent\");\n domEvent.initCustomEvent(name.toLowerCase(), false, true,\n event);\n return !util.global.dispatchEvent(domEvent);\n };\n }\n } catch (e) {}\n return function() {\n return false;\n };\n})();\n\nvar fireGlobalEvent = (function() {\n if (util.isNode) {\n return function() {\n return process.emit.apply(process, arguments);\n };\n } else {\n if (!util.global) {\n return function() {\n return false;\n };\n }\n return function(name) {\n var methodName = \"on\" + name.toLowerCase();\n var method = util.global[methodName];\n if (!method) return false;\n method.apply(util.global, [].slice.call(arguments, 1));\n return true;\n };\n }\n})();\n\nfunction generatePromiseLifecycleEventObject(name, promise) {\n return {promise: promise};\n}\n\nvar eventToObjectGenerator = {\n promiseCreated: generatePromiseLifecycleEventObject,\n promiseFulfilled: generatePromiseLifecycleEventObject,\n promiseRejected: generatePromiseLifecycleEventObject,\n promiseResolved: generatePromiseLifecycleEventObject,\n promiseCancelled: generatePromiseLifecycleEventObject,\n promiseChained: function(name, promise, child) {\n return {promise: promise, child: child};\n },\n warning: function(name, warning) {\n return {warning: warning};\n },\n unhandledRejection: function (name, reason, promise) {\n return {reason: reason, promise: promise};\n },\n rejectionHandled: generatePromiseLifecycleEventObject\n};\n\nvar activeFireEvent = function (name) {\n var globalEventFired = false;\n try {\n globalEventFired = fireGlobalEvent.apply(null, arguments);\n } catch (e) {\n async.throwLater(e);\n globalEventFired = true;\n }\n\n var domEventFired = false;\n try {\n domEventFired = fireDomEvent(name,\n eventToObjectGenerator[name].apply(null, arguments));\n } catch (e) {\n async.throwLater(e);\n domEventFired = true;\n }\n\n return domEventFired || globalEventFired;\n};\n\nPromise.config = function(opts) {\n opts = Object(opts);\n if (\"longStackTraces\" in opts) {\n if (opts.longStackTraces) {\n Promise.longStackTraces();\n } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\n disableLongStackTraces();\n }\n }\n if (\"warnings\" in opts) {\n var warningsOption = opts.warnings;\n config.warnings = !!warningsOption;\n wForgottenReturn = config.warnings;\n\n if (util.isObject(warningsOption)) {\n if (\"wForgottenReturn\" in warningsOption) {\n wForgottenReturn = !!warningsOption.wForgottenReturn;\n }\n }\n }\n if (\"cancellation\" in opts && opts.cancellation && !config.cancellation) {\n if (async.haveItemsQueued()) {\n throw new Error(\n \"cannot enable cancellation after promises are in use\");\n }\n Promise.prototype._clearCancellationData =\n cancellationClearCancellationData;\n Promise.prototype._propagateFrom = cancellationPropagateFrom;\n Promise.prototype._onCancel = cancellationOnCancel;\n Promise.prototype._setOnCancel = cancellationSetOnCancel;\n Promise.prototype._attachCancellationCallback =\n cancellationAttachCancellationCallback;\n Promise.prototype._execute = cancellationExecute;\n propagateFromFunction = cancellationPropagateFrom;\n config.cancellation = true;\n }\n if (\"monitoring\" in opts) {\n if (opts.monitoring && !config.monitoring) {\n config.monitoring = true;\n Promise.prototype._fireEvent = activeFireEvent;\n } else if (!opts.monitoring && config.monitoring) {\n config.monitoring = false;\n Promise.prototype._fireEvent = defaultFireEvent;\n }\n }\n return Promise;\n};\n\nfunction defaultFireEvent() { return false; }\n\nPromise.prototype._fireEvent = defaultFireEvent;\nPromise.prototype._execute = function(executor, resolve, reject) {\n try {\n executor(resolve, reject);\n } catch (e) {\n return e;\n }\n};\nPromise.prototype._onCancel = function () {};\nPromise.prototype._setOnCancel = function (handler) { ; };\nPromise.prototype._attachCancellationCallback = function(onCancel) {\n ;\n};\nPromise.prototype._captureStackTrace = function () {};\nPromise.prototype._attachExtraTrace = function () {};\nPromise.prototype._dereferenceTrace = function () {};\nPromise.prototype._clearCancellationData = function() {};\nPromise.prototype._propagateFrom = function (parent, flags) {\n ;\n ;\n};\n\nfunction cancellationExecute(executor, resolve, reject) {\n var promise = this;\n try {\n executor(resolve, reject, function(onCancel) {\n if (typeof onCancel !== \"function\") {\n throw new TypeError(\"onCancel must be a function, got: \" +\n util.toString(onCancel));\n }\n promise._attachCancellationCallback(onCancel);\n });\n } catch (e) {\n return e;\n }\n}\n\nfunction cancellationAttachCancellationCallback(onCancel) {\n if (!this._isCancellable()) return this;\n\n var previousOnCancel = this._onCancel();\n if (previousOnCancel !== undefined) {\n if (util.isArray(previousOnCancel)) {\n previousOnCancel.push(onCancel);\n } else {\n this._setOnCancel([previousOnCancel, onCancel]);\n }\n } else {\n this._setOnCancel(onCancel);\n }\n}\n\nfunction cancellationOnCancel() {\n return this._onCancelField;\n}\n\nfunction cancellationSetOnCancel(onCancel) {\n this._onCancelField = onCancel;\n}\n\nfunction cancellationClearCancellationData() {\n this._cancellationParent = undefined;\n this._onCancelField = undefined;\n}\n\nfunction cancellationPropagateFrom(parent, flags) {\n if ((flags & 1) !== 0) {\n this._cancellationParent = parent;\n var branchesRemainingToCancel = parent._branchesRemainingToCancel;\n if (branchesRemainingToCancel === undefined) {\n branchesRemainingToCancel = 0;\n }\n parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\n }\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n}\n\nfunction bindingPropagateFrom(parent, flags) {\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n}\nvar propagateFromFunction = bindingPropagateFrom;\n\nfunction boundValueFunction() {\n var ret = this._boundTo;\n if (ret !== undefined) {\n if (ret instanceof Promise) {\n if (ret.isFulfilled()) {\n return ret.value();\n } else {\n return undefined;\n }\n }\n }\n return ret;\n}\n\nfunction longStackTracesCaptureStackTrace() {\n this._trace = new CapturedTrace(this._peekContext());\n}\n\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\n if (canAttachTrace(error)) {\n var trace = this._trace;\n if (trace !== undefined) {\n if (ignoreSelf) trace = trace._parent;\n }\n if (trace !== undefined) {\n trace.attachExtraTrace(error);\n } else if (!error.__stackCleaned__) {\n var parsed = parseStackAndMessage(error);\n util.notEnumerableProp(error, \"stack\",\n parsed.message + \"\\n\" + parsed.stack.join(\"\\n\"));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n }\n }\n}\n\nfunction longStackTracesDereferenceTrace() {\n this._trace = undefined;\n}\n\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\n parent) {\n if (returnValue === undefined && promiseCreated !== null &&\n wForgottenReturn) {\n if (parent !== undefined && parent._returnedNonUndefined()) return;\n if ((promise._bitField & 65535) === 0) return;\n\n if (name) name = name + \" \";\n var handlerLine = \"\";\n var creatorLine = \"\";\n if (promiseCreated._trace) {\n var traceLines = promiseCreated._trace.stack.split(\"\\n\");\n var stack = cleanStack(traceLines);\n for (var i = stack.length - 1; i >= 0; --i) {\n var line = stack[i];\n if (!nodeFramePattern.test(line)) {\n var lineMatches = line.match(parseLinePattern);\n if (lineMatches) {\n handlerLine = \"at \" + lineMatches[1] +\n \":\" + lineMatches[2] + \":\" + lineMatches[3] + \" \";\n }\n break;\n }\n }\n\n if (stack.length > 0) {\n var firstUserLine = stack[0];\n for (var i = 0; i < traceLines.length; ++i) {\n\n if (traceLines[i] === firstUserLine) {\n if (i > 0) {\n creatorLine = \"\\n\" + traceLines[i - 1];\n }\n break;\n }\n }\n\n }\n }\n var msg = \"a promise was created in a \" + name +\n \"handler \" + handlerLine + \"but was not returned from it, \" +\n \"see http://goo.gl/rRqMUw\" +\n creatorLine;\n promise._warn(msg, true, promiseCreated);\n }\n}\n\nfunction deprecated(name, replacement) {\n var message = name +\n \" is deprecated and will be removed in a future version.\";\n if (replacement) message += \" Use \" + replacement + \" instead.\";\n return warn(message);\n}\n\nfunction warn(message, shouldUseOwnTrace, promise) {\n if (!config.warnings) return;\n var warning = new Warning(message);\n var ctx;\n if (shouldUseOwnTrace) {\n promise._attachExtraTrace(warning);\n } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\n ctx.attachExtraTrace(warning);\n } else {\n var parsed = parseStackAndMessage(warning);\n warning.stack = parsed.message + \"\\n\" + parsed.stack.join(\"\\n\");\n }\n\n if (!activeFireEvent(\"warning\", warning)) {\n formatAndLogError(warning, \"\", true);\n }\n}\n\nfunction reconstructStack(message, stacks) {\n for (var i = 0; i < stacks.length - 1; ++i) {\n stacks[i].push(\"From previous event:\");\n stacks[i] = stacks[i].join(\"\\n\");\n }\n if (i < stacks.length) {\n stacks[i] = stacks[i].join(\"\\n\");\n }\n return message + \"\\n\" + stacks.join(\"\\n\");\n}\n\nfunction removeDuplicateOrEmptyJumps(stacks) {\n for (var i = 0; i < stacks.length; ++i) {\n if (stacks[i].length === 0 ||\n ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\n stacks.splice(i, 1);\n i--;\n }\n }\n}\n\nfunction removeCommonRoots(stacks) {\n var current = stacks[0];\n for (var i = 1; i < stacks.length; ++i) {\n var prev = stacks[i];\n var currentLastIndex = current.length - 1;\n var currentLastLine = current[currentLastIndex];\n var commonRootMeetPoint = -1;\n\n for (var j = prev.length - 1; j >= 0; --j) {\n if (prev[j] === currentLastLine) {\n commonRootMeetPoint = j;\n break;\n }\n }\n\n for (var j = commonRootMeetPoint; j >= 0; --j) {\n var line = prev[j];\n if (current[currentLastIndex] === line) {\n current.pop();\n currentLastIndex--;\n } else {\n break;\n }\n }\n current = prev;\n }\n}\n\nfunction cleanStack(stack) {\n var ret = [];\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n var isTraceLine = \" (No stack trace)\" === line ||\n stackFramePattern.test(line);\n var isInternalFrame = isTraceLine && shouldIgnore(line);\n if (isTraceLine && !isInternalFrame) {\n if (indentStackFrames && line.charAt(0) !== \" \") {\n line = \" \" + line;\n }\n ret.push(line);\n }\n }\n return ret;\n}\n\nfunction stackFramesAsArray(error) {\n var stack = error.stack.replace(/\\s+$/g, \"\").split(\"\\n\");\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n if (\" (No stack trace)\" === line || stackFramePattern.test(line)) {\n break;\n }\n }\n if (i > 0 && error.name != \"SyntaxError\") {\n stack = stack.slice(i);\n }\n return stack;\n}\n\nfunction parseStackAndMessage(error) {\n var stack = error.stack;\n var message = error.toString();\n stack = typeof stack === \"string\" && stack.length > 0\n ? stackFramesAsArray(error) : [\" (No stack trace)\"];\n return {\n message: message,\n stack: error.name == \"SyntaxError\" ? stack : cleanStack(stack)\n };\n}\n\nfunction formatAndLogError(error, title, isSoft) {\n if (typeof console !== \"undefined\") {\n var message;\n if (util.isObject(error)) {\n var stack = error.stack;\n message = title + formatStack(stack, error);\n } else {\n message = title + String(error);\n }\n if (typeof printWarning === \"function\") {\n printWarning(message, isSoft);\n } else if (typeof console.log === \"function\" ||\n typeof console.log === \"object\") {\n console.log(message);\n }\n }\n}\n\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\n var localEventFired = false;\n try {\n if (typeof localHandler === \"function\") {\n localEventFired = true;\n if (name === \"rejectionHandled\") {\n localHandler(promise);\n } else {\n localHandler(reason, promise);\n }\n }\n } catch (e) {\n async.throwLater(e);\n }\n\n if (name === \"unhandledRejection\") {\n if (!activeFireEvent(name, reason, promise) && !localEventFired) {\n formatAndLogError(reason, \"Unhandled rejection \");\n }\n } else {\n activeFireEvent(name, promise);\n }\n}\n\nfunction formatNonError(obj) {\n var str;\n if (typeof obj === \"function\") {\n str = \"[function \" +\n (obj.name || \"anonymous\") +\n \"]\";\n } else {\n str = obj && typeof obj.toString === \"function\"\n ? obj.toString() : util.toString(obj);\n var ruselessToString = /\\[object [a-zA-Z0-9$_]+\\]/;\n if (ruselessToString.test(str)) {\n try {\n var newStr = JSON.stringify(obj);\n str = newStr;\n }\n catch(e) {\n\n }\n }\n if (str.length === 0) {\n str = \"(empty array)\";\n }\n }\n return (\"(<\" + snip(str) + \">, no stack trace)\");\n}\n\nfunction snip(str) {\n var maxChars = 41;\n if (str.length < maxChars) {\n return str;\n }\n return str.substr(0, maxChars - 3) + \"...\";\n}\n\nfunction longStackTracesIsSupported() {\n return typeof captureStackTrace === \"function\";\n}\n\nvar shouldIgnore = function() { return false; };\nvar parseLineInfoRegex = /[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;\nfunction parseLineInfo(line) {\n var matches = line.match(parseLineInfoRegex);\n if (matches) {\n return {\n fileName: matches[1],\n line: parseInt(matches[2], 10)\n };\n }\n}\n\nfunction setBounds(firstLineError, lastLineError) {\n if (!longStackTracesIsSupported()) return;\n var firstStackLines = (firstLineError.stack || \"\").split(\"\\n\");\n var lastStackLines = (lastLineError.stack || \"\").split(\"\\n\");\n var firstIndex = -1;\n var lastIndex = -1;\n var firstFileName;\n var lastFileName;\n for (var i = 0; i < firstStackLines.length; ++i) {\n var result = parseLineInfo(firstStackLines[i]);\n if (result) {\n firstFileName = result.fileName;\n firstIndex = result.line;\n break;\n }\n }\n for (var i = 0; i < lastStackLines.length; ++i) {\n var result = parseLineInfo(lastStackLines[i]);\n if (result) {\n lastFileName = result.fileName;\n lastIndex = result.line;\n break;\n }\n }\n if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\n firstFileName !== lastFileName || firstIndex >= lastIndex) {\n return;\n }\n\n shouldIgnore = function(line) {\n if (bluebirdFramePattern.test(line)) return true;\n var info = parseLineInfo(line);\n if (info) {\n if (info.fileName === firstFileName &&\n (firstIndex <= info.line && info.line <= lastIndex)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction CapturedTrace(parent) {\n this._parent = parent;\n this._promisesCreated = 0;\n var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\n captureStackTrace(this, CapturedTrace);\n if (length > 32) this.uncycle();\n}\nutil.inherits(CapturedTrace, Error);\nContext.CapturedTrace = CapturedTrace;\n\nCapturedTrace.prototype.uncycle = function() {\n var length = this._length;\n if (length < 2) return;\n var nodes = [];\n var stackToIndex = {};\n\n for (var i = 0, node = this; node !== undefined; ++i) {\n nodes.push(node);\n node = node._parent;\n }\n length = this._length = i;\n for (var i = length - 1; i >= 0; --i) {\n var stack = nodes[i].stack;\n if (stackToIndex[stack] === undefined) {\n stackToIndex[stack] = i;\n }\n }\n for (var i = 0; i < length; ++i) {\n var currentStack = nodes[i].stack;\n var index = stackToIndex[currentStack];\n if (index !== undefined && index !== i) {\n if (index > 0) {\n nodes[index - 1]._parent = undefined;\n nodes[index - 1]._length = 1;\n }\n nodes[i]._parent = undefined;\n nodes[i]._length = 1;\n var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\n\n if (index < length - 1) {\n cycleEdgeNode._parent = nodes[index + 1];\n cycleEdgeNode._parent.uncycle();\n cycleEdgeNode._length =\n cycleEdgeNode._parent._length + 1;\n } else {\n cycleEdgeNode._parent = undefined;\n cycleEdgeNode._length = 1;\n }\n var currentChildLength = cycleEdgeNode._length + 1;\n for (var j = i - 2; j >= 0; --j) {\n nodes[j]._length = currentChildLength;\n currentChildLength++;\n }\n return;\n }\n }\n};\n\nCapturedTrace.prototype.attachExtraTrace = function(error) {\n if (error.__stackCleaned__) return;\n this.uncycle();\n var parsed = parseStackAndMessage(error);\n var message = parsed.message;\n var stacks = [parsed.stack];\n\n var trace = this;\n while (trace !== undefined) {\n stacks.push(cleanStack(trace.stack.split(\"\\n\")));\n trace = trace._parent;\n }\n removeCommonRoots(stacks);\n removeDuplicateOrEmptyJumps(stacks);\n util.notEnumerableProp(error, \"stack\", reconstructStack(message, stacks));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n};\n\nvar captureStackTrace = (function stackDetection() {\n var v8stackFramePattern = /^\\s*at\\s*/;\n var v8stackFormatter = function(stack, error) {\n if (typeof stack === \"string\") return stack;\n\n if (error.name !== undefined &&\n error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n\n if (typeof Error.stackTraceLimit === \"number\" &&\n typeof Error.captureStackTrace === \"function\") {\n Error.stackTraceLimit += 6;\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n var captureStackTrace = Error.captureStackTrace;\n\n shouldIgnore = function(line) {\n return bluebirdFramePattern.test(line);\n };\n return function(receiver, ignoreUntil) {\n Error.stackTraceLimit += 6;\n captureStackTrace(receiver, ignoreUntil);\n Error.stackTraceLimit -= 6;\n };\n }\n var err = new Error();\n\n if (typeof err.stack === \"string\" &&\n err.stack.split(\"\\n\")[0].indexOf(\"stackDetection@\") >= 0) {\n stackFramePattern = /@/;\n formatStack = v8stackFormatter;\n indentStackFrames = true;\n return function captureStackTrace(o) {\n o.stack = new Error().stack;\n };\n }\n\n var hasStackAfterThrow;\n try { throw new Error(); }\n catch(e) {\n hasStackAfterThrow = (\"stack\" in e);\n }\n if (!(\"stack\" in err) && hasStackAfterThrow &&\n typeof Error.stackTraceLimit === \"number\") {\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n return function captureStackTrace(o) {\n Error.stackTraceLimit += 6;\n try { throw new Error(); }\n catch(e) { o.stack = e.stack; }\n Error.stackTraceLimit -= 6;\n };\n }\n\n formatStack = function(stack, error) {\n if (typeof stack === \"string\") return stack;\n\n if ((typeof error === \"object\" ||\n typeof error === \"function\") &&\n error.name !== undefined &&\n error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n\n return null;\n\n})([]);\n\nif (typeof console !== \"undefined\" && typeof console.warn !== \"undefined\") {\n printWarning = function (message) {\n console.warn(message);\n };\n if (util.isNode && process.stderr.isTTY) {\n printWarning = function(message, isSoft) {\n var color = isSoft ? \"\\u001b[33m\" : \"\\u001b[31m\";\n console.warn(color + message + \"\\u001b[0m\\n\");\n };\n } else if (!util.isNode && typeof (new Error().stack) === \"string\") {\n printWarning = function(message, isSoft) {\n console.warn(\"%c\" + message,\n isSoft ? \"color: darkorange\" : \"color: red\");\n };\n }\n}\n\nvar config = {\n warnings: warnings,\n longStackTraces: false,\n cancellation: false,\n monitoring: false\n};\n\nif (longStackTraces) Promise.longStackTraces();\n\nreturn {\n longStackTraces: function() {\n return config.longStackTraces;\n },\n warnings: function() {\n return config.warnings;\n },\n cancellation: function() {\n return config.cancellation;\n },\n monitoring: function() {\n return config.monitoring;\n },\n propagateFromFunction: function() {\n return propagateFromFunction;\n },\n boundValueFunction: function() {\n return boundValueFunction;\n },\n checkForgottenReturns: checkForgottenReturns,\n setBounds: setBounds,\n warn: warn,\n deprecated: deprecated,\n CapturedTrace: CapturedTrace,\n fireDomEvent: fireDomEvent,\n fireGlobalEvent: fireGlobalEvent\n};\n};\n\n},{\"./errors\":12,\"./es5\":13,\"./util\":36}],10:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nfunction returner() {\n return this.value;\n}\nfunction thrower() {\n throw this.reason;\n}\n\nPromise.prototype[\"return\"] =\nPromise.prototype.thenReturn = function (value) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(\n returner, undefined, undefined, {value: value}, undefined);\n};\n\nPromise.prototype[\"throw\"] =\nPromise.prototype.thenThrow = function (reason) {\n return this._then(\n thrower, undefined, undefined, {reason: reason}, undefined);\n};\n\nPromise.prototype.catchThrow = function (reason) {\n if (arguments.length <= 1) {\n return this._then(\n undefined, thrower, undefined, {reason: reason}, undefined);\n } else {\n var _reason = arguments[1];\n var handler = function() {throw _reason;};\n return this.caught(reason, handler);\n }\n};\n\nPromise.prototype.catchReturn = function (value) {\n if (arguments.length <= 1) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(\n undefined, returner, undefined, {value: value}, undefined);\n } else {\n var _value = arguments[1];\n if (_value instanceof Promise) _value.suppressUnhandledRejections();\n var handler = function() {return _value;};\n return this.caught(value, handler);\n }\n};\n};\n\n},{}],11:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseReduce = Promise.reduce;\nvar PromiseAll = Promise.all;\n\nfunction promiseAllThis() {\n return PromiseAll(this);\n}\n\nfunction PromiseMapSeries(promises, fn) {\n return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\n}\n\nPromise.prototype.each = function (fn) {\n return PromiseReduce(this, fn, INTERNAL, 0)\n ._then(promiseAllThis, undefined, undefined, this, undefined);\n};\n\nPromise.prototype.mapSeries = function (fn) {\n return PromiseReduce(this, fn, INTERNAL, INTERNAL);\n};\n\nPromise.each = function (promises, fn) {\n return PromiseReduce(promises, fn, INTERNAL, 0)\n ._then(promiseAllThis, undefined, undefined, promises, undefined);\n};\n\nPromise.mapSeries = PromiseMapSeries;\n};\n\n\n},{}],12:[function(_dereq_,module,exports){\n\"use strict\";\nvar es5 = _dereq_(\"./es5\");\nvar Objectfreeze = es5.freeze;\nvar util = _dereq_(\"./util\");\nvar inherits = util.inherits;\nvar notEnumerableProp = util.notEnumerableProp;\n\nfunction subError(nameProperty, defaultMessage) {\n function SubError(message) {\n if (!(this instanceof SubError)) return new SubError(message);\n notEnumerableProp(this, \"message\",\n typeof message === \"string\" ? message : defaultMessage);\n notEnumerableProp(this, \"name\", nameProperty);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n Error.call(this);\n }\n }\n inherits(SubError, Error);\n return SubError;\n}\n\nvar _TypeError, _RangeError;\nvar Warning = subError(\"Warning\", \"warning\");\nvar CancellationError = subError(\"CancellationError\", \"cancellation error\");\nvar TimeoutError = subError(\"TimeoutError\", \"timeout error\");\nvar AggregateError = subError(\"AggregateError\", \"aggregate error\");\ntry {\n _TypeError = TypeError;\n _RangeError = RangeError;\n} catch(e) {\n _TypeError = subError(\"TypeError\", \"type error\");\n _RangeError = subError(\"RangeError\", \"range error\");\n}\n\nvar methods = (\"join pop push shift unshift slice filter forEach some \" +\n \"every map indexOf lastIndexOf reduce reduceRight sort reverse\").split(\" \");\n\nfor (var i = 0; i < methods.length; ++i) {\n if (typeof Array.prototype[methods[i]] === \"function\") {\n AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\n }\n}\n\nes5.defineProperty(AggregateError.prototype, \"length\", {\n value: 0,\n configurable: false,\n writable: true,\n enumerable: true\n});\nAggregateError.prototype[\"isOperational\"] = true;\nvar level = 0;\nAggregateError.prototype.toString = function() {\n var indent = Array(level * 4 + 1).join(\" \");\n var ret = \"\\n\" + indent + \"AggregateError of:\" + \"\\n\";\n level++;\n indent = Array(level * 4 + 1).join(\" \");\n for (var i = 0; i < this.length; ++i) {\n var str = this[i] === this ? \"[Circular AggregateError]\" : this[i] + \"\";\n var lines = str.split(\"\\n\");\n for (var j = 0; j < lines.length; ++j) {\n lines[j] = indent + lines[j];\n }\n str = lines.join(\"\\n\");\n ret += str + \"\\n\";\n }\n level--;\n return ret;\n};\n\nfunction OperationalError(message) {\n if (!(this instanceof OperationalError))\n return new OperationalError(message);\n notEnumerableProp(this, \"name\", \"OperationalError\");\n notEnumerableProp(this, \"message\", message);\n this.cause = message;\n this[\"isOperational\"] = true;\n\n if (message instanceof Error) {\n notEnumerableProp(this, \"message\", message.message);\n notEnumerableProp(this, \"stack\", message.stack);\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n}\ninherits(OperationalError, Error);\n\nvar errorTypes = Error[\"__BluebirdErrorTypes__\"];\nif (!errorTypes) {\n errorTypes = Objectfreeze({\n CancellationError: CancellationError,\n TimeoutError: TimeoutError,\n OperationalError: OperationalError,\n RejectionError: OperationalError,\n AggregateError: AggregateError\n });\n es5.defineProperty(Error, \"__BluebirdErrorTypes__\", {\n value: errorTypes,\n writable: false,\n enumerable: false,\n configurable: false\n });\n}\n\nmodule.exports = {\n Error: Error,\n TypeError: _TypeError,\n RangeError: _RangeError,\n CancellationError: errorTypes.CancellationError,\n OperationalError: errorTypes.OperationalError,\n TimeoutError: errorTypes.TimeoutError,\n AggregateError: errorTypes.AggregateError,\n Warning: Warning\n};\n\n},{\"./es5\":13,\"./util\":36}],13:[function(_dereq_,module,exports){\nvar isES5 = (function(){\n \"use strict\";\n return this === undefined;\n})();\n\nif (isES5) {\n module.exports = {\n freeze: Object.freeze,\n defineProperty: Object.defineProperty,\n getDescriptor: Object.getOwnPropertyDescriptor,\n keys: Object.keys,\n names: Object.getOwnPropertyNames,\n getPrototypeOf: Object.getPrototypeOf,\n isArray: Array.isArray,\n isES5: isES5,\n propertyIsWritable: function(obj, prop) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n return !!(!descriptor || descriptor.writable || descriptor.set);\n }\n };\n} else {\n var has = {}.hasOwnProperty;\n var str = {}.toString;\n var proto = {}.constructor.prototype;\n\n var ObjectKeys = function (o) {\n var ret = [];\n for (var key in o) {\n if (has.call(o, key)) {\n ret.push(key);\n }\n }\n return ret;\n };\n\n var ObjectGetDescriptor = function(o, key) {\n return {value: o[key]};\n };\n\n var ObjectDefineProperty = function (o, key, desc) {\n o[key] = desc.value;\n return o;\n };\n\n var ObjectFreeze = function (obj) {\n return obj;\n };\n\n var ObjectGetPrototypeOf = function (obj) {\n try {\n return Object(obj).constructor.prototype;\n }\n catch (e) {\n return proto;\n }\n };\n\n var ArrayIsArray = function (obj) {\n try {\n return str.call(obj) === \"[object Array]\";\n }\n catch(e) {\n return false;\n }\n };\n\n module.exports = {\n isArray: ArrayIsArray,\n keys: ObjectKeys,\n names: ObjectKeys,\n defineProperty: ObjectDefineProperty,\n getDescriptor: ObjectGetDescriptor,\n freeze: ObjectFreeze,\n getPrototypeOf: ObjectGetPrototypeOf,\n isES5: isES5,\n propertyIsWritable: function() {\n return true;\n }\n };\n}\n\n},{}],14:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseMap = Promise.map;\n\nPromise.prototype.filter = function (fn, options) {\n return PromiseMap(this, fn, options, INTERNAL);\n};\n\nPromise.filter = function (promises, fn, options) {\n return PromiseMap(promises, fn, options, INTERNAL);\n};\n};\n\n},{}],15:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) {\nvar util = _dereq_(\"./util\");\nvar CancellationError = Promise.CancellationError;\nvar errorObj = util.errorObj;\nvar catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\n\nfunction PassThroughHandlerContext(promise, type, handler) {\n this.promise = promise;\n this.type = type;\n this.handler = handler;\n this.called = false;\n this.cancelPromise = null;\n}\n\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\n return this.type === 0;\n};\n\nfunction FinallyHandlerCancelReaction(finallyHandler) {\n this.finallyHandler = finallyHandler;\n}\n\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\n checkCancel(this.finallyHandler);\n};\n\nfunction checkCancel(ctx, reason) {\n if (ctx.cancelPromise != null) {\n if (arguments.length > 1) {\n ctx.cancelPromise._reject(reason);\n } else {\n ctx.cancelPromise._cancel();\n }\n ctx.cancelPromise = null;\n return true;\n }\n return false;\n}\n\nfunction succeed() {\n return finallyHandler.call(this, this.promise._target()._settledValue());\n}\nfunction fail(reason) {\n if (checkCancel(this, reason)) return;\n errorObj.e = reason;\n return errorObj;\n}\nfunction finallyHandler(reasonOrValue) {\n var promise = this.promise;\n var handler = this.handler;\n\n if (!this.called) {\n this.called = true;\n var ret = this.isFinallyHandler()\n ? handler.call(promise._boundValue())\n : handler.call(promise._boundValue(), reasonOrValue);\n if (ret === NEXT_FILTER) {\n return ret;\n } else if (ret !== undefined) {\n promise._setReturnedNonUndefined();\n var maybePromise = tryConvertToPromise(ret, promise);\n if (maybePromise instanceof Promise) {\n if (this.cancelPromise != null) {\n if (maybePromise._isCancelled()) {\n var reason =\n new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n errorObj.e = reason;\n return errorObj;\n } else if (maybePromise.isPending()) {\n maybePromise._attachCancellationCallback(\n new FinallyHandlerCancelReaction(this));\n }\n }\n return maybePromise._then(\n succeed, fail, undefined, this, undefined);\n }\n }\n }\n\n if (promise.isRejected()) {\n checkCancel(this);\n errorObj.e = reasonOrValue;\n return errorObj;\n } else {\n checkCancel(this);\n return reasonOrValue;\n }\n}\n\nPromise.prototype._passThrough = function(handler, type, success, fail) {\n if (typeof handler !== \"function\") return this.then();\n return this._then(success,\n fail,\n undefined,\n new PassThroughHandlerContext(this, type, handler),\n undefined);\n};\n\nPromise.prototype.lastly =\nPromise.prototype[\"finally\"] = function (handler) {\n return this._passThrough(handler,\n 0,\n finallyHandler,\n finallyHandler);\n};\n\n\nPromise.prototype.tap = function (handler) {\n return this._passThrough(handler, 1, finallyHandler);\n};\n\nPromise.prototype.tapCatch = function (handlerOrPredicate) {\n var len = arguments.length;\n if(len === 1) {\n return this._passThrough(handlerOrPredicate,\n 1,\n undefined,\n finallyHandler);\n } else {\n var catchInstances = new Array(len - 1),\n j = 0, i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return Promise.reject(new TypeError(\n \"tapCatch statement predicate: \"\n + \"expecting an object but got \" + util.classString(item)\n ));\n }\n }\n catchInstances.length = j;\n var handler = arguments[i];\n return this._passThrough(catchFilter(catchInstances, handler, this),\n 1,\n undefined,\n finallyHandler);\n }\n\n};\n\nreturn PassThroughHandlerContext;\n};\n\n},{\"./catch_filter\":7,\"./util\":36}],16:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n apiRejection,\n INTERNAL,\n tryConvertToPromise,\n Proxyable,\n debug) {\nvar errors = _dereq_(\"./errors\");\nvar TypeError = errors.TypeError;\nvar util = _dereq_(\"./util\");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nvar yieldHandlers = [];\n\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\n for (var i = 0; i < yieldHandlers.length; ++i) {\n traceParent._pushContext();\n var result = tryCatch(yieldHandlers[i])(value);\n traceParent._popContext();\n if (result === errorObj) {\n traceParent._pushContext();\n var ret = Promise.reject(errorObj.e);\n traceParent._popContext();\n return ret;\n }\n var maybePromise = tryConvertToPromise(result, traceParent);\n if (maybePromise instanceof Promise) return maybePromise;\n }\n return null;\n}\n\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\n if (debug.cancellation()) {\n var internal = new Promise(INTERNAL);\n var _finallyPromise = this._finallyPromise = new Promise(INTERNAL);\n this._promise = internal.lastly(function() {\n return _finallyPromise;\n });\n internal._captureStackTrace();\n internal._setOnCancel(this);\n } else {\n var promise = this._promise = new Promise(INTERNAL);\n promise._captureStackTrace();\n }\n this._stack = stack;\n this._generatorFunction = generatorFunction;\n this._receiver = receiver;\n this._generator = undefined;\n this._yieldHandlers = typeof yieldHandler === \"function\"\n ? [yieldHandler].concat(yieldHandlers)\n : yieldHandlers;\n this._yieldedPromise = null;\n this._cancellationPhase = false;\n}\nutil.inherits(PromiseSpawn, Proxyable);\n\nPromiseSpawn.prototype._isResolved = function() {\n return this._promise === null;\n};\n\nPromiseSpawn.prototype._cleanup = function() {\n this._promise = this._generator = null;\n if (debug.cancellation() && this._finallyPromise !== null) {\n this._finallyPromise._fulfill();\n this._finallyPromise = null;\n }\n};\n\nPromiseSpawn.prototype._promiseCancelled = function() {\n if (this._isResolved()) return;\n var implementsReturn = typeof this._generator[\"return\"] !== \"undefined\";\n\n var result;\n if (!implementsReturn) {\n var reason = new Promise.CancellationError(\n \"generator .return() sentinel\");\n Promise.coroutine.returnSentinel = reason;\n this._promise._attachExtraTrace(reason);\n this._promise._pushContext();\n result = tryCatch(this._generator[\"throw\"]).call(this._generator,\n reason);\n this._promise._popContext();\n } else {\n this._promise._pushContext();\n result = tryCatch(this._generator[\"return\"]).call(this._generator,\n undefined);\n this._promise._popContext();\n }\n this._cancellationPhase = true;\n this._yieldedPromise = null;\n this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\n this._yieldedPromise = null;\n this._promise._pushContext();\n var result = tryCatch(this._generator.next).call(this._generator, value);\n this._promise._popContext();\n this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseRejected = function(reason) {\n this._yieldedPromise = null;\n this._promise._attachExtraTrace(reason);\n this._promise._pushContext();\n var result = tryCatch(this._generator[\"throw\"])\n .call(this._generator, reason);\n this._promise._popContext();\n this._continue(result);\n};\n\nPromiseSpawn.prototype._resultCancelled = function() {\n if (this._yieldedPromise instanceof Promise) {\n var promise = this._yieldedPromise;\n this._yieldedPromise = null;\n promise.cancel();\n }\n};\n\nPromiseSpawn.prototype.promise = function () {\n return this._promise;\n};\n\nPromiseSpawn.prototype._run = function () {\n this._generator = this._generatorFunction.call(this._receiver);\n this._receiver =\n this._generatorFunction = undefined;\n this._promiseFulfilled(undefined);\n};\n\nPromiseSpawn.prototype._continue = function (result) {\n var promise = this._promise;\n if (result === errorObj) {\n this._cleanup();\n if (this._cancellationPhase) {\n return promise.cancel();\n } else {\n return promise._rejectCallback(result.e, false);\n }\n }\n\n var value = result.value;\n if (result.done === true) {\n this._cleanup();\n if (this._cancellationPhase) {\n return promise.cancel();\n } else {\n return promise._resolveCallback(value);\n }\n } else {\n var maybePromise = tryConvertToPromise(value, this._promise);\n if (!(maybePromise instanceof Promise)) {\n maybePromise =\n promiseFromYieldHandler(maybePromise,\n this._yieldHandlers,\n this._promise);\n if (maybePromise === null) {\n this._promiseRejected(\n new TypeError(\n \"A value %s was yielded that could not be treated as a promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\\u000a\".replace(\"%s\", String(value)) +\n \"From coroutine:\\u000a\" +\n this._stack.split(\"\\n\").slice(1, -7).join(\"\\n\")\n )\n );\n return;\n }\n }\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n this._yieldedPromise = maybePromise;\n maybePromise._proxy(this, null);\n } else if (((bitField & 33554432) !== 0)) {\n Promise._async.invoke(\n this._promiseFulfilled, this, maybePromise._value()\n );\n } else if (((bitField & 16777216) !== 0)) {\n Promise._async.invoke(\n this._promiseRejected, this, maybePromise._reason()\n );\n } else {\n this._promiseCancelled();\n }\n }\n};\n\nPromise.coroutine = function (generatorFunction, options) {\n if (typeof generatorFunction !== \"function\") {\n throw new TypeError(\"generatorFunction must be a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var yieldHandler = Object(options).yieldHandler;\n var PromiseSpawn$ = PromiseSpawn;\n var stack = new Error().stack;\n return function () {\n var generator = generatorFunction.apply(this, arguments);\n var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\n stack);\n var ret = spawn.promise();\n spawn._generator = generator;\n spawn._promiseFulfilled(undefined);\n return ret;\n };\n};\n\nPromise.coroutine.addYieldHandler = function(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n yieldHandlers.push(fn);\n};\n\nPromise.spawn = function (generatorFunction) {\n debug.deprecated(\"Promise.spawn()\", \"Promise.coroutine()\");\n if (typeof generatorFunction !== \"function\") {\n return apiRejection(\"generatorFunction must be a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var spawn = new PromiseSpawn(generatorFunction, this);\n var ret = spawn.promise();\n spawn._run(Promise.spawn);\n return ret;\n};\n};\n\n},{\"./errors\":12,\"./util\":36}],17:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async,\n getDomain) {\nvar util = _dereq_(\"./util\");\nvar canEvaluate = util.canEvaluate;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar reject;\n\nif (false) { var i, promiseSetters, thenCallbacks, holderClasses, generateHolderClass, promiseSetter, thenCallback; }\n\nPromise.join = function () {\n var last = arguments.length - 1;\n var fn;\n if (last > 0 && typeof arguments[last] === \"function\") {\n fn = arguments[last];\n if (false) { var domain, bitField, maybePromise, i, callbacks, holder, HolderClass, ret; }\n }\n var args = [].slice.call(arguments);;\n if (fn) args.pop();\n var ret = new PromiseArray(args).promise();\n return fn !== undefined ? ret.spread(fn) : ret;\n};\n\n};\n\n},{\"./util\":36}],18:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n PromiseArray,\n apiRejection,\n tryConvertToPromise,\n INTERNAL,\n debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\n this.constructor$(promises);\n this._promise._captureStackTrace();\n var domain = getDomain();\n this._callback = domain === null ? fn : util.domainBind(domain, fn);\n this._preservedValues = _filter === INTERNAL\n ? new Array(this.length())\n : null;\n this._limit = limit;\n this._inFlight = 0;\n this._queue = [];\n async.invoke(this._asyncInit, this, undefined);\n}\nutil.inherits(MappingPromiseArray, PromiseArray);\n\nMappingPromiseArray.prototype._asyncInit = function() {\n this._init$(undefined, -2);\n};\n\nMappingPromiseArray.prototype._init = function () {};\n\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\n var values = this._values;\n var length = this.length();\n var preservedValues = this._preservedValues;\n var limit = this._limit;\n\n if (index < 0) {\n index = (index * -1) - 1;\n values[index] = value;\n if (limit >= 1) {\n this._inFlight--;\n this._drainQueue();\n if (this._isResolved()) return true;\n }\n } else {\n if (limit >= 1 && this._inFlight >= limit) {\n values[index] = value;\n this._queue.push(index);\n return false;\n }\n if (preservedValues !== null) preservedValues[index] = value;\n\n var promise = this._promise;\n var callback = this._callback;\n var receiver = promise._boundValue();\n promise._pushContext();\n var ret = tryCatch(callback).call(receiver, value, index, length);\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret,\n promiseCreated,\n preservedValues !== null ? \"Promise.filter\" : \"Promise.map\",\n promise\n );\n if (ret === errorObj) {\n this._reject(ret.e);\n return true;\n }\n\n var maybePromise = tryConvertToPromise(ret, this._promise);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n if (limit >= 1) this._inFlight++;\n values[index] = maybePromise;\n maybePromise._proxy(this, (index + 1) * -1);\n return false;\n } else if (((bitField & 33554432) !== 0)) {\n ret = maybePromise._value();\n } else if (((bitField & 16777216) !== 0)) {\n this._reject(maybePromise._reason());\n return true;\n } else {\n this._cancel();\n return true;\n }\n }\n values[index] = ret;\n }\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= length) {\n if (preservedValues !== null) {\n this._filter(values, preservedValues);\n } else {\n this._resolve(values);\n }\n return true;\n }\n return false;\n};\n\nMappingPromiseArray.prototype._drainQueue = function () {\n var queue = this._queue;\n var limit = this._limit;\n var values = this._values;\n while (queue.length > 0 && this._inFlight < limit) {\n if (this._isResolved()) return;\n var index = queue.pop();\n this._promiseFulfilled(values[index], index);\n }\n};\n\nMappingPromiseArray.prototype._filter = function (booleans, values) {\n var len = values.length;\n var ret = new Array(len);\n var j = 0;\n for (var i = 0; i < len; ++i) {\n if (booleans[i]) ret[j++] = values[i];\n }\n ret.length = j;\n this._resolve(ret);\n};\n\nMappingPromiseArray.prototype.preservedValues = function () {\n return this._preservedValues;\n};\n\nfunction map(promises, fn, options, _filter) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n\n var limit = 0;\n if (options !== undefined) {\n if (typeof options === \"object\" && options !== null) {\n if (typeof options.concurrency !== \"number\") {\n return Promise.reject(\n new TypeError(\"'concurrency' must be a number but it is \" +\n util.classString(options.concurrency)));\n }\n limit = options.concurrency;\n } else {\n return Promise.reject(new TypeError(\n \"options argument must be an object but it is \" +\n util.classString(options)));\n }\n }\n limit = typeof limit === \"number\" &&\n isFinite(limit) && limit >= 1 ? limit : 0;\n return new MappingPromiseArray(promises, fn, limit, _filter).promise();\n}\n\nPromise.prototype.map = function (fn, options) {\n return map(this, fn, options, null);\n};\n\nPromise.map = function (promises, fn, options, _filter) {\n return map(promises, fn, options, _filter);\n};\n\n\n};\n\n},{\"./util\":36}],19:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\n\nPromise.method = function (fn) {\n if (typeof fn !== \"function\") {\n throw new Promise.TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return function () {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value = tryCatch(fn).apply(this, arguments);\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(\n value, promiseCreated, \"Promise.method\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n };\n};\n\nPromise.attempt = Promise[\"try\"] = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value;\n if (arguments.length > 1) {\n debug.deprecated(\"calling Promise.try with more than 1 argument\");\n var arg = arguments[1];\n var ctx = arguments[2];\n value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\n : tryCatch(fn).call(ctx, arg);\n } else {\n value = tryCatch(fn)();\n }\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(\n value, promiseCreated, \"Promise.try\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n};\n\nPromise.prototype._resolveFromSyncValue = function (value) {\n if (value === util.errorObj) {\n this._rejectCallback(value.e, false);\n } else {\n this._resolveCallback(value, true);\n }\n};\n};\n\n},{\"./util\":36}],20:[function(_dereq_,module,exports){\n\"use strict\";\nvar util = _dereq_(\"./util\");\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar errors = _dereq_(\"./errors\");\nvar OperationalError = errors.OperationalError;\nvar es5 = _dereq_(\"./es5\");\n\nfunction isUntypedError(obj) {\n return obj instanceof Error &&\n es5.getPrototypeOf(obj) === Error.prototype;\n}\n\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\nfunction wrapAsOperationalError(obj) {\n var ret;\n if (isUntypedError(obj)) {\n ret = new OperationalError(obj);\n ret.name = obj.name;\n ret.message = obj.message;\n ret.stack = obj.stack;\n var keys = es5.keys(obj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!rErrorKey.test(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n }\n util.markAsOriginatingFromRejection(obj);\n return obj;\n}\n\nfunction nodebackForPromise(promise, multiArgs) {\n return function(err, value) {\n if (promise === null) return;\n if (err) {\n var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n promise._attachExtraTrace(wrapped);\n promise._reject(wrapped);\n } else if (!multiArgs) {\n promise._fulfill(value);\n } else {\n var args = [].slice.call(arguments, 1);;\n promise._fulfill(args);\n }\n promise = null;\n };\n}\n\nmodule.exports = nodebackForPromise;\n\n},{\"./errors\":12,\"./es5\":13,\"./util\":36}],21:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar util = _dereq_(\"./util\");\nvar async = Promise._async;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction spreadAdapter(val, nodeback) {\n var promise = this;\n if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\n var ret =\n tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\n\nfunction successAdapter(val, nodeback) {\n var promise = this;\n var receiver = promise._boundValue();\n var ret = val === undefined\n ? tryCatch(nodeback).call(receiver, null)\n : tryCatch(nodeback).call(receiver, null, val);\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\nfunction errorAdapter(reason, nodeback) {\n var promise = this;\n if (!reason) {\n var newReason = new Error(reason + \"\");\n newReason.cause = reason;\n reason = newReason;\n }\n var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\n\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\n options) {\n if (typeof nodeback == \"function\") {\n var adapter = successAdapter;\n if (options !== undefined && Object(options).spread) {\n adapter = spreadAdapter;\n }\n this._then(\n adapter,\n errorAdapter,\n undefined,\n this,\n nodeback\n );\n }\n return this;\n};\n};\n\n},{\"./util\":36}],22:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function() {\nvar makeSelfResolutionError = function () {\n return new TypeError(\"circular promise resolution chain\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n};\nvar reflectHandler = function() {\n return new Promise.PromiseInspection(this._target());\n};\nvar apiRejection = function(msg) {\n return Promise.reject(new TypeError(msg));\n};\nfunction Proxyable() {}\nvar UNDEFINED_BINDING = {};\nvar util = _dereq_(\"./util\");\n\nvar getDomain;\nif (util.isNode) {\n getDomain = function() {\n var ret = process.domain;\n if (ret === undefined) ret = null;\n return ret;\n };\n} else {\n getDomain = function() {\n return null;\n };\n}\nutil.notEnumerableProp(Promise, \"_getDomain\", getDomain);\n\nvar es5 = _dereq_(\"./es5\");\nvar Async = _dereq_(\"./async\");\nvar async = new Async();\nes5.defineProperty(Promise, \"_async\", {value: async});\nvar errors = _dereq_(\"./errors\");\nvar TypeError = Promise.TypeError = errors.TypeError;\nPromise.RangeError = errors.RangeError;\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\nPromise.TimeoutError = errors.TimeoutError;\nPromise.OperationalError = errors.OperationalError;\nPromise.RejectionError = errors.OperationalError;\nPromise.AggregateError = errors.AggregateError;\nvar INTERNAL = function(){};\nvar APPLY = {};\nvar NEXT_FILTER = {};\nvar tryConvertToPromise = _dereq_(\"./thenables\")(Promise, INTERNAL);\nvar PromiseArray =\n _dereq_(\"./promise_array\")(Promise, INTERNAL,\n tryConvertToPromise, apiRejection, Proxyable);\nvar Context = _dereq_(\"./context\")(Promise);\n /*jshint unused:false*/\nvar createContext = Context.create;\nvar debug = _dereq_(\"./debuggability\")(Promise, Context);\nvar CapturedTrace = debug.CapturedTrace;\nvar PassThroughHandlerContext =\n _dereq_(\"./finally\")(Promise, tryConvertToPromise, NEXT_FILTER);\nvar catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\nvar nodebackForPromise = _dereq_(\"./nodeback\");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nfunction check(self, executor) {\n if (self == null || self.constructor !== Promise) {\n throw new TypeError(\"the promise constructor cannot be invoked directly\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n if (typeof executor !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(executor));\n }\n\n}\n\nfunction Promise(executor) {\n if (executor !== INTERNAL) {\n check(this, executor);\n }\n this._bitField = 0;\n this._fulfillmentHandler0 = undefined;\n this._rejectionHandler0 = undefined;\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._resolveFromExecutor(executor);\n this._promiseCreated();\n this._fireEvent(\"promiseCreated\", this);\n}\n\nPromise.prototype.toString = function () {\n return \"[object Promise]\";\n};\n\nPromise.prototype.caught = Promise.prototype[\"catch\"] = function (fn) {\n var len = arguments.length;\n if (len > 1) {\n var catchInstances = new Array(len - 1),\n j = 0, i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return apiRejection(\"Catch statement predicate: \" +\n \"expecting an object but got \" + util.classString(item));\n }\n }\n catchInstances.length = j;\n fn = arguments[i];\n\n if (typeof fn !== \"function\") {\n throw new TypeError(\"The last argument to .catch() \" +\n \"must be a function, got \" + util.toString(fn));\n }\n return this.then(undefined, catchFilter(catchInstances, fn, this));\n }\n return this.then(undefined, fn);\n};\n\nPromise.prototype.reflect = function () {\n return this._then(reflectHandler,\n reflectHandler, undefined, this, undefined);\n};\n\nPromise.prototype.then = function (didFulfill, didReject) {\n if (debug.warnings() && arguments.length > 0 &&\n typeof didFulfill !== \"function\" &&\n typeof didReject !== \"function\") {\n var msg = \".then() only accepts functions but was passed: \" +\n util.classString(didFulfill);\n if (arguments.length > 1) {\n msg += \", \" + util.classString(didReject);\n }\n this._warn(msg);\n }\n return this._then(didFulfill, didReject, undefined, undefined, undefined);\n};\n\nPromise.prototype.done = function (didFulfill, didReject) {\n var promise =\n this._then(didFulfill, didReject, undefined, undefined, undefined);\n promise._setIsFinal();\n};\n\nPromise.prototype.spread = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n return this.all()._then(fn, undefined, undefined, APPLY, undefined);\n};\n\nPromise.prototype.toJSON = function () {\n var ret = {\n isFulfilled: false,\n isRejected: false,\n fulfillmentValue: undefined,\n rejectionReason: undefined\n };\n if (this.isFulfilled()) {\n ret.fulfillmentValue = this.value();\n ret.isFulfilled = true;\n } else if (this.isRejected()) {\n ret.rejectionReason = this.reason();\n ret.isRejected = true;\n }\n return ret;\n};\n\nPromise.prototype.all = function () {\n if (arguments.length > 0) {\n this._warn(\".all() was passed arguments but it does not take any\");\n }\n return new PromiseArray(this).promise();\n};\n\nPromise.prototype.error = function (fn) {\n return this.caught(util.originatesFromRejection, fn);\n};\n\nPromise.getNewLibraryCopy = module.exports;\n\nPromise.is = function (val) {\n return val instanceof Promise;\n};\n\nPromise.fromNode = Promise.fromCallback = function(fn) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\n : false;\n var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\n if (result === errorObj) {\n ret._rejectCallback(result.e, true);\n }\n if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\n return ret;\n};\n\nPromise.all = function (promises) {\n return new PromiseArray(promises).promise();\n};\n\nPromise.cast = function (obj) {\n var ret = tryConvertToPromise(obj);\n if (!(ret instanceof Promise)) {\n ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._setFulfilled();\n ret._rejectionHandler0 = obj;\n }\n return ret;\n};\n\nPromise.resolve = Promise.fulfilled = Promise.cast;\n\nPromise.reject = Promise.rejected = function (reason) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._rejectCallback(reason, true);\n return ret;\n};\n\nPromise.setScheduler = function(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return async.setScheduler(fn);\n};\n\nPromise.prototype._then = function (\n didFulfill,\n didReject,\n _, receiver,\n internalData\n) {\n var haveInternalData = internalData !== undefined;\n var promise = haveInternalData ? internalData : new Promise(INTERNAL);\n var target = this._target();\n var bitField = target._bitField;\n\n if (!haveInternalData) {\n promise._propagateFrom(this, 3);\n promise._captureStackTrace();\n if (receiver === undefined &&\n ((this._bitField & 2097152) !== 0)) {\n if (!((bitField & 50397184) === 0)) {\n receiver = this._boundValue();\n } else {\n receiver = target === this ? undefined : this._boundTo;\n }\n }\n this._fireEvent(\"promiseChained\", this, promise);\n }\n\n var domain = getDomain();\n if (!((bitField & 50397184) === 0)) {\n var handler, value, settler = target._settlePromiseCtx;\n if (((bitField & 33554432) !== 0)) {\n value = target._rejectionHandler0;\n handler = didFulfill;\n } else if (((bitField & 16777216) !== 0)) {\n value = target._fulfillmentHandler0;\n handler = didReject;\n target._unsetRejectionIsUnhandled();\n } else {\n settler = target._settlePromiseLateCancellationObserver;\n value = new CancellationError(\"late cancellation observer\");\n target._attachExtraTrace(value);\n handler = didReject;\n }\n\n async.invoke(settler, target, {\n handler: domain === null ? handler\n : (typeof handler === \"function\" &&\n util.domainBind(domain, handler)),\n promise: promise,\n receiver: receiver,\n value: value\n });\n } else {\n target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\n }\n\n return promise;\n};\n\nPromise.prototype._length = function () {\n return this._bitField & 65535;\n};\n\nPromise.prototype._isFateSealed = function () {\n return (this._bitField & 117506048) !== 0;\n};\n\nPromise.prototype._isFollowing = function () {\n return (this._bitField & 67108864) === 67108864;\n};\n\nPromise.prototype._setLength = function (len) {\n this._bitField = (this._bitField & -65536) |\n (len & 65535);\n};\n\nPromise.prototype._setFulfilled = function () {\n this._bitField = this._bitField | 33554432;\n this._fireEvent(\"promiseFulfilled\", this);\n};\n\nPromise.prototype._setRejected = function () {\n this._bitField = this._bitField | 16777216;\n this._fireEvent(\"promiseRejected\", this);\n};\n\nPromise.prototype._setFollowing = function () {\n this._bitField = this._bitField | 67108864;\n this._fireEvent(\"promiseResolved\", this);\n};\n\nPromise.prototype._setIsFinal = function () {\n this._bitField = this._bitField | 4194304;\n};\n\nPromise.prototype._isFinal = function () {\n return (this._bitField & 4194304) > 0;\n};\n\nPromise.prototype._unsetCancelled = function() {\n this._bitField = this._bitField & (~65536);\n};\n\nPromise.prototype._setCancelled = function() {\n this._bitField = this._bitField | 65536;\n this._fireEvent(\"promiseCancelled\", this);\n};\n\nPromise.prototype._setWillBeCancelled = function() {\n this._bitField = this._bitField | 8388608;\n};\n\nPromise.prototype._setAsyncGuaranteed = function() {\n if (async.hasCustomScheduler()) return;\n this._bitField = this._bitField | 134217728;\n};\n\nPromise.prototype._receiverAt = function (index) {\n var ret = index === 0 ? this._receiver0 : this[\n index * 4 - 4 + 3];\n if (ret === UNDEFINED_BINDING) {\n return undefined;\n } else if (ret === undefined && this._isBound()) {\n return this._boundValue();\n }\n return ret;\n};\n\nPromise.prototype._promiseAt = function (index) {\n return this[\n index * 4 - 4 + 2];\n};\n\nPromise.prototype._fulfillmentHandlerAt = function (index) {\n return this[\n index * 4 - 4 + 0];\n};\n\nPromise.prototype._rejectionHandlerAt = function (index) {\n return this[\n index * 4 - 4 + 1];\n};\n\nPromise.prototype._boundValue = function() {};\n\nPromise.prototype._migrateCallback0 = function (follower) {\n var bitField = follower._bitField;\n var fulfill = follower._fulfillmentHandler0;\n var reject = follower._rejectionHandler0;\n var promise = follower._promise0;\n var receiver = follower._receiverAt(0);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._migrateCallbackAt = function (follower, index) {\n var fulfill = follower._fulfillmentHandlerAt(index);\n var reject = follower._rejectionHandlerAt(index);\n var promise = follower._promiseAt(index);\n var receiver = follower._receiverAt(index);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._addCallbacks = function (\n fulfill,\n reject,\n promise,\n receiver,\n domain\n) {\n var index = this._length();\n\n if (index >= 65535 - 4) {\n index = 0;\n this._setLength(0);\n }\n\n if (index === 0) {\n this._promise0 = promise;\n this._receiver0 = receiver;\n if (typeof fulfill === \"function\") {\n this._fulfillmentHandler0 =\n domain === null ? fulfill : util.domainBind(domain, fulfill);\n }\n if (typeof reject === \"function\") {\n this._rejectionHandler0 =\n domain === null ? reject : util.domainBind(domain, reject);\n }\n } else {\n var base = index * 4 - 4;\n this[base + 2] = promise;\n this[base + 3] = receiver;\n if (typeof fulfill === \"function\") {\n this[base + 0] =\n domain === null ? fulfill : util.domainBind(domain, fulfill);\n }\n if (typeof reject === \"function\") {\n this[base + 1] =\n domain === null ? reject : util.domainBind(domain, reject);\n }\n }\n this._setLength(index + 1);\n return index;\n};\n\nPromise.prototype._proxy = function (proxyable, arg) {\n this._addCallbacks(undefined, undefined, arg, proxyable, null);\n};\n\nPromise.prototype._resolveCallback = function(value, shouldBind) {\n if (((this._bitField & 117506048) !== 0)) return;\n if (value === this)\n return this._rejectCallback(makeSelfResolutionError(), false);\n var maybePromise = tryConvertToPromise(value, this);\n if (!(maybePromise instanceof Promise)) return this._fulfill(value);\n\n if (shouldBind) this._propagateFrom(maybePromise, 2);\n\n var promise = maybePromise._target();\n\n if (promise === this) {\n this._reject(makeSelfResolutionError());\n return;\n }\n\n var bitField = promise._bitField;\n if (((bitField & 50397184) === 0)) {\n var len = this._length();\n if (len > 0) promise._migrateCallback0(this);\n for (var i = 1; i < len; ++i) {\n promise._migrateCallbackAt(this, i);\n }\n this._setFollowing();\n this._setLength(0);\n this._setFollowee(promise);\n } else if (((bitField & 33554432) !== 0)) {\n this._fulfill(promise._value());\n } else if (((bitField & 16777216) !== 0)) {\n this._reject(promise._reason());\n } else {\n var reason = new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n this._reject(reason);\n }\n};\n\nPromise.prototype._rejectCallback =\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\n var trace = util.ensureErrorObject(reason);\n var hasStack = trace === reason;\n if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\n var message = \"a promise was rejected with a non-error: \" +\n util.classString(reason);\n this._warn(message, true);\n }\n this._attachExtraTrace(trace, synchronous ? hasStack : false);\n this._reject(reason);\n};\n\nPromise.prototype._resolveFromExecutor = function (executor) {\n if (executor === INTERNAL) return;\n var promise = this;\n this._captureStackTrace();\n this._pushContext();\n var synchronous = true;\n var r = this._execute(executor, function(value) {\n promise._resolveCallback(value);\n }, function (reason) {\n promise._rejectCallback(reason, synchronous);\n });\n synchronous = false;\n this._popContext();\n\n if (r !== undefined) {\n promise._rejectCallback(r, true);\n }\n};\n\nPromise.prototype._settlePromiseFromHandler = function (\n handler, receiver, value, promise\n) {\n var bitField = promise._bitField;\n if (((bitField & 65536) !== 0)) return;\n promise._pushContext();\n var x;\n if (receiver === APPLY) {\n if (!value || typeof value.length !== \"number\") {\n x = errorObj;\n x.e = new TypeError(\"cannot .spread() a non-array: \" +\n util.classString(value));\n } else {\n x = tryCatch(handler).apply(this._boundValue(), value);\n }\n } else {\n x = tryCatch(handler).call(receiver, value);\n }\n var promiseCreated = promise._popContext();\n bitField = promise._bitField;\n if (((bitField & 65536) !== 0)) return;\n\n if (x === NEXT_FILTER) {\n promise._reject(value);\n } else if (x === errorObj) {\n promise._rejectCallback(x.e, false);\n } else {\n debug.checkForgottenReturns(x, promiseCreated, \"\", promise, this);\n promise._resolveCallback(x);\n }\n};\n\nPromise.prototype._target = function() {\n var ret = this;\n while (ret._isFollowing()) ret = ret._followee();\n return ret;\n};\n\nPromise.prototype._followee = function() {\n return this._rejectionHandler0;\n};\n\nPromise.prototype._setFollowee = function(promise) {\n this._rejectionHandler0 = promise;\n};\n\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\n var isPromise = promise instanceof Promise;\n var bitField = this._bitField;\n var asyncGuaranteed = ((bitField & 134217728) !== 0);\n if (((bitField & 65536) !== 0)) {\n if (isPromise) promise._invokeInternalOnCancel();\n\n if (receiver instanceof PassThroughHandlerContext &&\n receiver.isFinallyHandler()) {\n receiver.cancelPromise = promise;\n if (tryCatch(handler).call(receiver, value) === errorObj) {\n promise._reject(errorObj.e);\n }\n } else if (handler === reflectHandler) {\n promise._fulfill(reflectHandler.call(receiver));\n } else if (receiver instanceof Proxyable) {\n receiver._promiseCancelled(promise);\n } else if (isPromise || promise instanceof PromiseArray) {\n promise._cancel();\n } else {\n receiver.cancel();\n }\n } else if (typeof handler === \"function\") {\n if (!isPromise) {\n handler.call(receiver, value, promise);\n } else {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (receiver instanceof Proxyable) {\n if (!receiver._isResolved()) {\n if (((bitField & 33554432) !== 0)) {\n receiver._promiseFulfilled(value, promise);\n } else {\n receiver._promiseRejected(value, promise);\n }\n }\n } else if (isPromise) {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n if (((bitField & 33554432) !== 0)) {\n promise._fulfill(value);\n } else {\n promise._reject(value);\n }\n }\n};\n\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\n var handler = ctx.handler;\n var promise = ctx.promise;\n var receiver = ctx.receiver;\n var value = ctx.value;\n if (typeof handler === \"function\") {\n if (!(promise instanceof Promise)) {\n handler.call(receiver, value, promise);\n } else {\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (promise instanceof Promise) {\n promise._reject(value);\n }\n};\n\nPromise.prototype._settlePromiseCtx = function(ctx) {\n this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\n};\n\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\n var promise = this._promise0;\n var receiver = this._receiverAt(0);\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._settlePromise(promise, handler, receiver, value);\n};\n\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\n var base = index * 4 - 4;\n this[base + 2] =\n this[base + 3] =\n this[base + 0] =\n this[base + 1] = undefined;\n};\n\nPromise.prototype._fulfill = function (value) {\n var bitField = this._bitField;\n if (((bitField & 117506048) >>> 16)) return;\n if (value === this) {\n var err = makeSelfResolutionError();\n this._attachExtraTrace(err);\n return this._reject(err);\n }\n this._setFulfilled();\n this._rejectionHandler0 = value;\n\n if ((bitField & 65535) > 0) {\n if (((bitField & 134217728) !== 0)) {\n this._settlePromises();\n } else {\n async.settlePromises(this);\n }\n this._dereferenceTrace();\n }\n};\n\nPromise.prototype._reject = function (reason) {\n var bitField = this._bitField;\n if (((bitField & 117506048) >>> 16)) return;\n this._setRejected();\n this._fulfillmentHandler0 = reason;\n\n if (this._isFinal()) {\n return async.fatalError(reason, util.isNode);\n }\n\n if ((bitField & 65535) > 0) {\n async.settlePromises(this);\n } else {\n this._ensurePossibleRejectionHandled();\n }\n};\n\nPromise.prototype._fulfillPromises = function (len, value) {\n for (var i = 1; i < len; i++) {\n var handler = this._fulfillmentHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, value);\n }\n};\n\nPromise.prototype._rejectPromises = function (len, reason) {\n for (var i = 1; i < len; i++) {\n var handler = this._rejectionHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, reason);\n }\n};\n\nPromise.prototype._settlePromises = function () {\n var bitField = this._bitField;\n var len = (bitField & 65535);\n\n if (len > 0) {\n if (((bitField & 16842752) !== 0)) {\n var reason = this._fulfillmentHandler0;\n this._settlePromise0(this._rejectionHandler0, reason, bitField);\n this._rejectPromises(len, reason);\n } else {\n var value = this._rejectionHandler0;\n this._settlePromise0(this._fulfillmentHandler0, value, bitField);\n this._fulfillPromises(len, value);\n }\n this._setLength(0);\n }\n this._clearCancellationData();\n};\n\nPromise.prototype._settledValue = function() {\n var bitField = this._bitField;\n if (((bitField & 33554432) !== 0)) {\n return this._rejectionHandler0;\n } else if (((bitField & 16777216) !== 0)) {\n return this._fulfillmentHandler0;\n }\n};\n\nif (typeof Symbol !== \"undefined\" && Symbol.toStringTag) {\n es5.defineProperty(Promise.prototype, Symbol.toStringTag, {\n get: function () {\n return \"Object\";\n }\n });\n}\n\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\n\nPromise.defer = Promise.pending = function() {\n debug.deprecated(\"Promise.defer\", \"new Promise\");\n var promise = new Promise(INTERNAL);\n return {\n promise: promise,\n resolve: deferResolve,\n reject: deferReject\n };\n};\n\nutil.notEnumerableProp(Promise,\n \"_makeSelfResolutionError\",\n makeSelfResolutionError);\n\n_dereq_(\"./method\")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\n debug);\n_dereq_(\"./bind\")(Promise, INTERNAL, tryConvertToPromise, debug);\n_dereq_(\"./cancel\")(Promise, PromiseArray, apiRejection, debug);\n_dereq_(\"./direct_resolve\")(Promise);\n_dereq_(\"./synchronous_inspection\")(Promise);\n_dereq_(\"./join\")(\n Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain);\nPromise.Promise = Promise;\nPromise.version = \"3.5.5\";\n_dereq_('./call_get.js')(Promise);\n_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\n_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_('./nodeify.js')(Promise);\n_dereq_('./promisify.js')(Promise, INTERNAL);\n_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\n_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\n_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_('./settle.js')(Promise, PromiseArray, debug);\n_dereq_('./some.js')(Promise, PromiseArray, apiRejection);\n_dereq_('./timers.js')(Promise, INTERNAL, debug);\n_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\n_dereq_('./any.js')(Promise);\n_dereq_('./each.js')(Promise, INTERNAL);\n_dereq_('./filter.js')(Promise, INTERNAL);\n \n util.toFastProperties(Promise); \n util.toFastProperties(Promise.prototype); \n function fillTypes(value) { \n var p = new Promise(INTERNAL); \n p._fulfillmentHandler0 = value; \n p._rejectionHandler0 = value; \n p._promise0 = value; \n p._receiver0 = value; \n } \n // Complete slack tracking, opt out of field-type tracking and \n // stabilize map \n fillTypes({a: 1}); \n fillTypes({b: 2}); \n fillTypes({c: 3}); \n fillTypes(1); \n fillTypes(function(){}); \n fillTypes(undefined); \n fillTypes(false); \n fillTypes(new Promise(INTERNAL)); \n debug.setBounds(Async.firstLineError, util.lastLineError); \n return Promise; \n\n};\n\n},{\"./any.js\":1,\"./async\":2,\"./bind\":3,\"./call_get.js\":5,\"./cancel\":6,\"./catch_filter\":7,\"./context\":8,\"./debuggability\":9,\"./direct_resolve\":10,\"./each.js\":11,\"./errors\":12,\"./es5\":13,\"./filter.js\":14,\"./finally\":15,\"./generators.js\":16,\"./join\":17,\"./map.js\":18,\"./method\":19,\"./nodeback\":20,\"./nodeify.js\":21,\"./promise_array\":23,\"./promisify.js\":24,\"./props.js\":25,\"./race.js\":27,\"./reduce.js\":28,\"./settle.js\":30,\"./some.js\":31,\"./synchronous_inspection\":32,\"./thenables\":33,\"./timers.js\":34,\"./using.js\":35,\"./util\":36}],23:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\n apiRejection, Proxyable) {\nvar util = _dereq_(\"./util\");\nvar isArray = util.isArray;\n\nfunction toResolutionValue(val) {\n switch(val) {\n case -2: return [];\n case -3: return {};\n case -6: return new Map();\n }\n}\n\nfunction PromiseArray(values) {\n var promise = this._promise = new Promise(INTERNAL);\n if (values instanceof Promise) {\n promise._propagateFrom(values, 3);\n }\n promise._setOnCancel(this);\n this._values = values;\n this._length = 0;\n this._totalResolved = 0;\n this._init(undefined, -2);\n}\nutil.inherits(PromiseArray, Proxyable);\n\nPromiseArray.prototype.length = function () {\n return this._length;\n};\n\nPromiseArray.prototype.promise = function () {\n return this._promise;\n};\n\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\n var values = tryConvertToPromise(this._values, this._promise);\n if (values instanceof Promise) {\n values = values._target();\n var bitField = values._bitField;\n ;\n this._values = values;\n\n if (((bitField & 50397184) === 0)) {\n this._promise._setAsyncGuaranteed();\n return values._then(\n init,\n this._reject,\n undefined,\n this,\n resolveValueIfEmpty\n );\n } else if (((bitField & 33554432) !== 0)) {\n values = values._value();\n } else if (((bitField & 16777216) !== 0)) {\n return this._reject(values._reason());\n } else {\n return this._cancel();\n }\n }\n values = util.asArray(values);\n if (values === null) {\n var err = apiRejection(\n \"expecting an array or an iterable object but got \" + util.classString(values)).reason();\n this._promise._rejectCallback(err, false);\n return;\n }\n\n if (values.length === 0) {\n if (resolveValueIfEmpty === -5) {\n this._resolveEmptyArray();\n }\n else {\n this._resolve(toResolutionValue(resolveValueIfEmpty));\n }\n return;\n }\n this._iterate(values);\n};\n\nPromiseArray.prototype._iterate = function(values) {\n var len = this.getActualLength(values.length);\n this._length = len;\n this._values = this.shouldCopyValues() ? new Array(len) : this._values;\n var result = this._promise;\n var isResolved = false;\n var bitField = null;\n for (var i = 0; i < len; ++i) {\n var maybePromise = tryConvertToPromise(values[i], result);\n\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n bitField = maybePromise._bitField;\n } else {\n bitField = null;\n }\n\n if (isResolved) {\n if (bitField !== null) {\n maybePromise.suppressUnhandledRejections();\n }\n } else if (bitField !== null) {\n if (((bitField & 50397184) === 0)) {\n maybePromise._proxy(this, i);\n this._values[i] = maybePromise;\n } else if (((bitField & 33554432) !== 0)) {\n isResolved = this._promiseFulfilled(maybePromise._value(), i);\n } else if (((bitField & 16777216) !== 0)) {\n isResolved = this._promiseRejected(maybePromise._reason(), i);\n } else {\n isResolved = this._promiseCancelled(i);\n }\n } else {\n isResolved = this._promiseFulfilled(maybePromise, i);\n }\n }\n if (!isResolved) result._setAsyncGuaranteed();\n};\n\nPromiseArray.prototype._isResolved = function () {\n return this._values === null;\n};\n\nPromiseArray.prototype._resolve = function (value) {\n this._values = null;\n this._promise._fulfill(value);\n};\n\nPromiseArray.prototype._cancel = function() {\n if (this._isResolved() || !this._promise._isCancellable()) return;\n this._values = null;\n this._promise._cancel();\n};\n\nPromiseArray.prototype._reject = function (reason) {\n this._values = null;\n this._promise._rejectCallback(reason, false);\n};\n\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n};\n\nPromiseArray.prototype._promiseCancelled = function() {\n this._cancel();\n return true;\n};\n\nPromiseArray.prototype._promiseRejected = function (reason) {\n this._totalResolved++;\n this._reject(reason);\n return true;\n};\n\nPromiseArray.prototype._resultCancelled = function() {\n if (this._isResolved()) return;\n var values = this._values;\n this._cancel();\n if (values instanceof Promise) {\n values.cancel();\n } else {\n for (var i = 0; i < values.length; ++i) {\n if (values[i] instanceof Promise) {\n values[i].cancel();\n }\n }\n }\n};\n\nPromiseArray.prototype.shouldCopyValues = function () {\n return true;\n};\n\nPromiseArray.prototype.getActualLength = function (len) {\n return len;\n};\n\nreturn PromiseArray;\n};\n\n},{\"./util\":36}],24:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar THIS = {};\nvar util = _dereq_(\"./util\");\nvar nodebackForPromise = _dereq_(\"./nodeback\");\nvar withAppended = util.withAppended;\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar canEvaluate = util.canEvaluate;\nvar TypeError = _dereq_(\"./errors\").TypeError;\nvar defaultSuffix = \"Async\";\nvar defaultPromisified = {__isPromisified__: true};\nvar noCopyProps = [\n \"arity\", \"length\",\n \"name\",\n \"arguments\",\n \"caller\",\n \"callee\",\n \"prototype\",\n \"__isPromisified__\"\n];\nvar noCopyPropsPattern = new RegExp(\"^(?:\" + noCopyProps.join(\"|\") + \")$\");\n\nvar defaultFilter = function(name) {\n return util.isIdentifier(name) &&\n name.charAt(0) !== \"_\" &&\n name !== \"constructor\";\n};\n\nfunction propsFilter(key) {\n return !noCopyPropsPattern.test(key);\n}\n\nfunction isPromisified(fn) {\n try {\n return fn.__isPromisified__ === true;\n }\n catch (e) {\n return false;\n }\n}\n\nfunction hasPromisified(obj, key, suffix) {\n var val = util.getDataPropertyOrDefault(obj, key + suffix,\n defaultPromisified);\n return val ? isPromisified(val) : false;\n}\nfunction checkValid(ret, suffix, suffixRegexp) {\n for (var i = 0; i < ret.length; i += 2) {\n var key = ret[i];\n if (suffixRegexp.test(key)) {\n var keyWithoutAsyncSuffix = key.replace(suffixRegexp, \"\");\n for (var j = 0; j < ret.length; j += 2) {\n if (ret[j] === keyWithoutAsyncSuffix) {\n throw new TypeError(\"Cannot promisify an API that has normal methods with '%s'-suffix\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\"\n .replace(\"%s\", suffix));\n }\n }\n }\n }\n}\n\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\n var keys = util.inheritedDataKeys(obj);\n var ret = [];\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var value = obj[key];\n var passesDefaultFilter = filter === defaultFilter\n ? true : defaultFilter(key, value, obj);\n if (typeof value === \"function\" &&\n !isPromisified(value) &&\n !hasPromisified(obj, key, suffix) &&\n filter(key, value, obj, passesDefaultFilter)) {\n ret.push(key, value);\n }\n }\n checkValid(ret, suffix, suffixRegexp);\n return ret;\n}\n\nvar escapeIdentRegex = function(str) {\n return str.replace(/([$])/, \"\\\\$\");\n};\n\nvar makeNodePromisifiedEval;\nif (false) { var parameterCount, parameterDeclaration, argumentSequence, switchCaseArgumentOrder; }\n\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\n var defaultThis = (function() {return this;})();\n var method = callback;\n if (typeof method === \"string\") {\n callback = fn;\n }\n function promisified() {\n var _receiver = receiver;\n if (receiver === THIS) _receiver = this;\n var promise = new Promise(INTERNAL);\n promise._captureStackTrace();\n var cb = typeof method === \"string\" && this !== defaultThis\n ? this[method] : callback;\n var fn = nodebackForPromise(promise, multiArgs);\n try {\n cb.apply(_receiver, withAppended(arguments, fn));\n } catch(e) {\n promise._rejectCallback(maybeWrapAsError(e), true, true);\n }\n if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\n return promise;\n }\n util.notEnumerableProp(promisified, \"__isPromisified__\", true);\n return promisified;\n}\n\nvar makeNodePromisified = canEvaluate\n ? makeNodePromisifiedEval\n : makeNodePromisifiedClosure;\n\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\n var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + \"$\");\n var methods =\n promisifiableMethods(obj, suffix, suffixRegexp, filter);\n\n for (var i = 0, len = methods.length; i < len; i+= 2) {\n var key = methods[i];\n var fn = methods[i+1];\n var promisifiedKey = key + suffix;\n if (promisifier === makeNodePromisified) {\n obj[promisifiedKey] =\n makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\n } else {\n var promisified = promisifier(fn, function() {\n return makeNodePromisified(key, THIS, key,\n fn, suffix, multiArgs);\n });\n util.notEnumerableProp(promisified, \"__isPromisified__\", true);\n obj[promisifiedKey] = promisified;\n }\n }\n util.toFastProperties(obj);\n return obj;\n}\n\nfunction promisify(callback, receiver, multiArgs) {\n return makeNodePromisified(callback, receiver, undefined,\n callback, null, multiArgs);\n}\n\nPromise.promisify = function (fn, options) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n if (isPromisified(fn)) {\n return fn;\n }\n options = Object(options);\n var receiver = options.context === undefined ? THIS : options.context;\n var multiArgs = !!options.multiArgs;\n var ret = promisify(fn, receiver, multiArgs);\n util.copyDescriptors(fn, ret, propsFilter);\n return ret;\n};\n\nPromise.promisifyAll = function (target, options) {\n if (typeof target !== \"function\" && typeof target !== \"object\") {\n throw new TypeError(\"the target of promisifyAll must be an object or a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n options = Object(options);\n var multiArgs = !!options.multiArgs;\n var suffix = options.suffix;\n if (typeof suffix !== \"string\") suffix = defaultSuffix;\n var filter = options.filter;\n if (typeof filter !== \"function\") filter = defaultFilter;\n var promisifier = options.promisifier;\n if (typeof promisifier !== \"function\") promisifier = makeNodePromisified;\n\n if (!util.isIdentifier(suffix)) {\n throw new RangeError(\"suffix must be a valid identifier\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n\n var keys = util.inheritedDataKeys(target);\n for (var i = 0; i < keys.length; ++i) {\n var value = target[keys[i]];\n if (keys[i] !== \"constructor\" &&\n util.isClass(value)) {\n promisifyAll(value.prototype, suffix, filter, promisifier,\n multiArgs);\n promisifyAll(value, suffix, filter, promisifier, multiArgs);\n }\n }\n\n return promisifyAll(target, suffix, filter, promisifier, multiArgs);\n};\n};\n\n\n},{\"./errors\":12,\"./nodeback\":20,\"./util\":36}],25:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(\n Promise, PromiseArray, tryConvertToPromise, apiRejection) {\nvar util = _dereq_(\"./util\");\nvar isObject = util.isObject;\nvar es5 = _dereq_(\"./es5\");\nvar Es6Map;\nif (typeof Map === \"function\") Es6Map = Map;\n\nvar mapToEntries = (function() {\n var index = 0;\n var size = 0;\n\n function extractEntry(value, key) {\n this[index] = value;\n this[index + size] = key;\n index++;\n }\n\n return function mapToEntries(map) {\n size = map.size;\n index = 0;\n var ret = new Array(map.size * 2);\n map.forEach(extractEntry, ret);\n return ret;\n };\n})();\n\nvar entriesToMap = function(entries) {\n var ret = new Es6Map();\n var length = entries.length / 2 | 0;\n for (var i = 0; i < length; ++i) {\n var key = entries[length + i];\n var value = entries[i];\n ret.set(key, value);\n }\n return ret;\n};\n\nfunction PropertiesPromiseArray(obj) {\n var isMap = false;\n var entries;\n if (Es6Map !== undefined && obj instanceof Es6Map) {\n entries = mapToEntries(obj);\n isMap = true;\n } else {\n var keys = es5.keys(obj);\n var len = keys.length;\n entries = new Array(len * 2);\n for (var i = 0; i < len; ++i) {\n var key = keys[i];\n entries[i] = obj[key];\n entries[i + len] = key;\n }\n }\n this.constructor$(entries);\n this._isMap = isMap;\n this._init$(undefined, isMap ? -6 : -3);\n}\nutil.inherits(PropertiesPromiseArray, PromiseArray);\n\nPropertiesPromiseArray.prototype._init = function () {};\n\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n var val;\n if (this._isMap) {\n val = entriesToMap(this._values);\n } else {\n val = {};\n var keyOffset = this.length();\n for (var i = 0, len = this.length(); i < len; ++i) {\n val[this._values[i + keyOffset]] = this._values[i];\n }\n }\n this._resolve(val);\n return true;\n }\n return false;\n};\n\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\n return false;\n};\n\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\n return len >> 1;\n};\n\nfunction props(promises) {\n var ret;\n var castValue = tryConvertToPromise(promises);\n\n if (!isObject(castValue)) {\n return apiRejection(\"cannot await properties of a non-object\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n } else if (castValue instanceof Promise) {\n ret = castValue._then(\n Promise.props, undefined, undefined, undefined, undefined);\n } else {\n ret = new PropertiesPromiseArray(castValue).promise();\n }\n\n if (castValue instanceof Promise) {\n ret._propagateFrom(castValue, 2);\n }\n return ret;\n}\n\nPromise.prototype.props = function () {\n return props(this);\n};\n\nPromise.props = function (promises) {\n return props(promises);\n};\n};\n\n},{\"./es5\":13,\"./util\":36}],26:[function(_dereq_,module,exports){\n\"use strict\";\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\n for (var j = 0; j < len; ++j) {\n dst[j + dstIndex] = src[j + srcIndex];\n src[j + srcIndex] = void 0;\n }\n}\n\nfunction Queue(capacity) {\n this._capacity = capacity;\n this._length = 0;\n this._front = 0;\n}\n\nQueue.prototype._willBeOverCapacity = function (size) {\n return this._capacity < size;\n};\n\nQueue.prototype._pushOne = function (arg) {\n var length = this.length();\n this._checkCapacity(length + 1);\n var i = (this._front + length) & (this._capacity - 1);\n this[i] = arg;\n this._length = length + 1;\n};\n\nQueue.prototype.push = function (fn, receiver, arg) {\n var length = this.length() + 3;\n if (this._willBeOverCapacity(length)) {\n this._pushOne(fn);\n this._pushOne(receiver);\n this._pushOne(arg);\n return;\n }\n var j = this._front + length - 3;\n this._checkCapacity(length);\n var wrapMask = this._capacity - 1;\n this[(j + 0) & wrapMask] = fn;\n this[(j + 1) & wrapMask] = receiver;\n this[(j + 2) & wrapMask] = arg;\n this._length = length;\n};\n\nQueue.prototype.shift = function () {\n var front = this._front,\n ret = this[front];\n\n this[front] = undefined;\n this._front = (front + 1) & (this._capacity - 1);\n this._length--;\n return ret;\n};\n\nQueue.prototype.length = function () {\n return this._length;\n};\n\nQueue.prototype._checkCapacity = function (size) {\n if (this._capacity < size) {\n this._resizeTo(this._capacity << 1);\n }\n};\n\nQueue.prototype._resizeTo = function (capacity) {\n var oldCapacity = this._capacity;\n this._capacity = capacity;\n var front = this._front;\n var length = this._length;\n var moveItemsCount = (front + length) & (oldCapacity - 1);\n arrayMove(this, 0, this, oldCapacity, moveItemsCount);\n};\n\nmodule.exports = Queue;\n\n},{}],27:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(\n Promise, INTERNAL, tryConvertToPromise, apiRejection) {\nvar util = _dereq_(\"./util\");\n\nvar raceLater = function (promise) {\n return promise.then(function(array) {\n return race(array, promise);\n });\n};\n\nfunction race(promises, parent) {\n var maybePromise = tryConvertToPromise(promises);\n\n if (maybePromise instanceof Promise) {\n return raceLater(maybePromise);\n } else {\n promises = util.asArray(promises);\n if (promises === null)\n return apiRejection(\"expecting an array or an iterable object but got \" + util.classString(promises));\n }\n\n var ret = new Promise(INTERNAL);\n if (parent !== undefined) {\n ret._propagateFrom(parent, 3);\n }\n var fulfill = ret._fulfill;\n var reject = ret._reject;\n for (var i = 0, len = promises.length; i < len; ++i) {\n var val = promises[i];\n\n if (val === undefined && !(i in promises)) {\n continue;\n }\n\n Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\n }\n return ret;\n}\n\nPromise.race = function (promises) {\n return race(promises, undefined);\n};\n\nPromise.prototype.race = function () {\n return race(this, undefined);\n};\n\n};\n\n},{\"./util\":36}],28:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n PromiseArray,\n apiRejection,\n tryConvertToPromise,\n INTERNAL,\n debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\n\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\n this.constructor$(promises);\n var domain = getDomain();\n this._fn = domain === null ? fn : util.domainBind(domain, fn);\n if (initialValue !== undefined) {\n initialValue = Promise.resolve(initialValue);\n initialValue._attachCancellationCallback(this);\n }\n this._initialValue = initialValue;\n this._currentCancellable = null;\n if(_each === INTERNAL) {\n this._eachValues = Array(this._length);\n } else if (_each === 0) {\n this._eachValues = null;\n } else {\n this._eachValues = undefined;\n }\n this._promise._captureStackTrace();\n this._init$(undefined, -5);\n}\nutil.inherits(ReductionPromiseArray, PromiseArray);\n\nReductionPromiseArray.prototype._gotAccum = function(accum) {\n if (this._eachValues !== undefined && \n this._eachValues !== null && \n accum !== INTERNAL) {\n this._eachValues.push(accum);\n }\n};\n\nReductionPromiseArray.prototype._eachComplete = function(value) {\n if (this._eachValues !== null) {\n this._eachValues.push(value);\n }\n return this._eachValues;\n};\n\nReductionPromiseArray.prototype._init = function() {};\n\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\n this._resolve(this._eachValues !== undefined ? this._eachValues\n : this._initialValue);\n};\n\nReductionPromiseArray.prototype.shouldCopyValues = function () {\n return false;\n};\n\nReductionPromiseArray.prototype._resolve = function(value) {\n this._promise._resolveCallback(value);\n this._values = null;\n};\n\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\n if (sender === this._initialValue) return this._cancel();\n if (this._isResolved()) return;\n this._resultCancelled$();\n if (this._currentCancellable instanceof Promise) {\n this._currentCancellable.cancel();\n }\n if (this._initialValue instanceof Promise) {\n this._initialValue.cancel();\n }\n};\n\nReductionPromiseArray.prototype._iterate = function (values) {\n this._values = values;\n var value;\n var i;\n var length = values.length;\n if (this._initialValue !== undefined) {\n value = this._initialValue;\n i = 0;\n } else {\n value = Promise.resolve(values[0]);\n i = 1;\n }\n\n this._currentCancellable = value;\n\n if (!value.isRejected()) {\n for (; i < length; ++i) {\n var ctx = {\n accum: null,\n value: values[i],\n index: i,\n length: length,\n array: this\n };\n value = value._then(gotAccum, undefined, undefined, ctx, undefined);\n }\n }\n\n if (this._eachValues !== undefined) {\n value = value\n ._then(this._eachComplete, undefined, undefined, this, undefined);\n }\n value._then(completed, completed, undefined, value, this);\n};\n\nPromise.prototype.reduce = function (fn, initialValue) {\n return reduce(this, fn, initialValue, null);\n};\n\nPromise.reduce = function (promises, fn, initialValue, _each) {\n return reduce(promises, fn, initialValue, _each);\n};\n\nfunction completed(valueOrReason, array) {\n if (this.isFulfilled()) {\n array._resolve(valueOrReason);\n } else {\n array._reject(valueOrReason);\n }\n}\n\nfunction reduce(promises, fn, initialValue, _each) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\n return array.promise();\n}\n\nfunction gotAccum(accum) {\n this.accum = accum;\n this.array._gotAccum(accum);\n var value = tryConvertToPromise(this.value, this.array._promise);\n if (value instanceof Promise) {\n this.array._currentCancellable = value;\n return value._then(gotValue, undefined, undefined, this, undefined);\n } else {\n return gotValue.call(this, value);\n }\n}\n\nfunction gotValue(value) {\n var array = this.array;\n var promise = array._promise;\n var fn = tryCatch(array._fn);\n promise._pushContext();\n var ret;\n if (array._eachValues !== undefined) {\n ret = fn.call(promise._boundValue(), value, this.index, this.length);\n } else {\n ret = fn.call(promise._boundValue(),\n this.accum, value, this.index, this.length);\n }\n if (ret instanceof Promise) {\n array._currentCancellable = ret;\n }\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret,\n promiseCreated,\n array._eachValues !== undefined ? \"Promise.each\" : \"Promise.reduce\",\n promise\n );\n return ret;\n}\n};\n\n},{\"./util\":36}],29:[function(_dereq_,module,exports){\n\"use strict\";\nvar util = _dereq_(\"./util\");\nvar schedule;\nvar noAsyncScheduler = function() {\n throw new Error(\"No async scheduler available\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n};\nvar NativePromise = util.getNativePromise();\nif (util.isNode && typeof MutationObserver === \"undefined\") {\n var GlobalSetImmediate = global.setImmediate;\n var ProcessNextTick = process.nextTick;\n schedule = util.isRecentNode\n ? function(fn) { GlobalSetImmediate.call(global, fn); }\n : function(fn) { ProcessNextTick.call(process, fn); };\n} else if (typeof NativePromise === \"function\" &&\n typeof NativePromise.resolve === \"function\") {\n var nativePromise = NativePromise.resolve();\n schedule = function(fn) {\n nativePromise.then(fn);\n };\n} else if ((typeof MutationObserver !== \"undefined\") &&\n !(typeof window !== \"undefined\" &&\n window.navigator &&\n (window.navigator.standalone || window.cordova)) &&\n (\"classList\" in document.documentElement)) {\n schedule = (function() {\n var div = document.createElement(\"div\");\n var opts = {attributes: true};\n var toggleScheduled = false;\n var div2 = document.createElement(\"div\");\n var o2 = new MutationObserver(function() {\n div.classList.toggle(\"foo\");\n toggleScheduled = false;\n });\n o2.observe(div2, opts);\n\n var scheduleToggle = function() {\n if (toggleScheduled) return;\n toggleScheduled = true;\n div2.classList.toggle(\"foo\");\n };\n\n return function schedule(fn) {\n var o = new MutationObserver(function() {\n o.disconnect();\n fn();\n });\n o.observe(div, opts);\n scheduleToggle();\n };\n })();\n} else if (typeof setImmediate !== \"undefined\") {\n schedule = function (fn) {\n setImmediate(fn);\n };\n} else if (typeof setTimeout !== \"undefined\") {\n schedule = function (fn) {\n setTimeout(fn, 0);\n };\n} else {\n schedule = noAsyncScheduler;\n}\nmodule.exports = schedule;\n\n},{\"./util\":36}],30:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\n function(Promise, PromiseArray, debug) {\nvar PromiseInspection = Promise.PromiseInspection;\nvar util = _dereq_(\"./util\");\n\nfunction SettledPromiseArray(values) {\n this.constructor$(values);\n}\nutil.inherits(SettledPromiseArray, PromiseArray);\n\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\n this._values[index] = inspection;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n};\n\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\n var ret = new PromiseInspection();\n ret._bitField = 33554432;\n ret._settledValueField = value;\n return this._promiseResolved(index, ret);\n};\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\n var ret = new PromiseInspection();\n ret._bitField = 16777216;\n ret._settledValueField = reason;\n return this._promiseResolved(index, ret);\n};\n\nPromise.settle = function (promises) {\n debug.deprecated(\".settle()\", \".reflect()\");\n return new SettledPromiseArray(promises).promise();\n};\n\nPromise.prototype.settle = function () {\n return Promise.settle(this);\n};\n};\n\n},{\"./util\":36}],31:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, PromiseArray, apiRejection) {\nvar util = _dereq_(\"./util\");\nvar RangeError = _dereq_(\"./errors\").RangeError;\nvar AggregateError = _dereq_(\"./errors\").AggregateError;\nvar isArray = util.isArray;\nvar CANCELLATION = {};\n\n\nfunction SomePromiseArray(values) {\n this.constructor$(values);\n this._howMany = 0;\n this._unwrap = false;\n this._initialized = false;\n}\nutil.inherits(SomePromiseArray, PromiseArray);\n\nSomePromiseArray.prototype._init = function () {\n if (!this._initialized) {\n return;\n }\n if (this._howMany === 0) {\n this._resolve([]);\n return;\n }\n this._init$(undefined, -5);\n var isArrayResolved = isArray(this._values);\n if (!this._isResolved() &&\n isArrayResolved &&\n this._howMany > this._canPossiblyFulfill()) {\n this._reject(this._getRangeError(this.length()));\n }\n};\n\nSomePromiseArray.prototype.init = function () {\n this._initialized = true;\n this._init();\n};\n\nSomePromiseArray.prototype.setUnwrap = function () {\n this._unwrap = true;\n};\n\nSomePromiseArray.prototype.howMany = function () {\n return this._howMany;\n};\n\nSomePromiseArray.prototype.setHowMany = function (count) {\n this._howMany = count;\n};\n\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\n this._addFulfilled(value);\n if (this._fulfilled() === this.howMany()) {\n this._values.length = this.howMany();\n if (this.howMany() === 1 && this._unwrap) {\n this._resolve(this._values[0]);\n } else {\n this._resolve(this._values);\n }\n return true;\n }\n return false;\n\n};\nSomePromiseArray.prototype._promiseRejected = function (reason) {\n this._addRejected(reason);\n return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._promiseCancelled = function () {\n if (this._values instanceof Promise || this._values == null) {\n return this._cancel();\n }\n this._addRejected(CANCELLATION);\n return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._checkOutcome = function() {\n if (this.howMany() > this._canPossiblyFulfill()) {\n var e = new AggregateError();\n for (var i = this.length(); i < this._values.length; ++i) {\n if (this._values[i] !== CANCELLATION) {\n e.push(this._values[i]);\n }\n }\n if (e.length > 0) {\n this._reject(e);\n } else {\n this._cancel();\n }\n return true;\n }\n return false;\n};\n\nSomePromiseArray.prototype._fulfilled = function () {\n return this._totalResolved;\n};\n\nSomePromiseArray.prototype._rejected = function () {\n return this._values.length - this.length();\n};\n\nSomePromiseArray.prototype._addRejected = function (reason) {\n this._values.push(reason);\n};\n\nSomePromiseArray.prototype._addFulfilled = function (value) {\n this._values[this._totalResolved++] = value;\n};\n\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\n return this.length() - this._rejected();\n};\n\nSomePromiseArray.prototype._getRangeError = function (count) {\n var message = \"Input array must contain at least \" +\n this._howMany + \" items but contains only \" + count + \" items\";\n return new RangeError(message);\n};\n\nSomePromiseArray.prototype._resolveEmptyArray = function () {\n this._reject(this._getRangeError(0));\n};\n\nfunction some(promises, howMany) {\n if ((howMany | 0) !== howMany || howMany < 0) {\n return apiRejection(\"expecting a positive integer\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var ret = new SomePromiseArray(promises);\n var promise = ret.promise();\n ret.setHowMany(howMany);\n ret.init();\n return promise;\n}\n\nPromise.some = function (promises, howMany) {\n return some(promises, howMany);\n};\n\nPromise.prototype.some = function (howMany) {\n return some(this, howMany);\n};\n\nPromise._SomePromiseArray = SomePromiseArray;\n};\n\n},{\"./errors\":12,\"./util\":36}],32:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nfunction PromiseInspection(promise) {\n if (promise !== undefined) {\n promise = promise._target();\n this._bitField = promise._bitField;\n this._settledValueField = promise._isFateSealed()\n ? promise._settledValue() : undefined;\n }\n else {\n this._bitField = 0;\n this._settledValueField = undefined;\n }\n}\n\nPromiseInspection.prototype._settledValue = function() {\n return this._settledValueField;\n};\n\nvar value = PromiseInspection.prototype.value = function () {\n if (!this.isFulfilled()) {\n throw new TypeError(\"cannot get fulfillment value of a non-fulfilled promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n return this._settledValue();\n};\n\nvar reason = PromiseInspection.prototype.error =\nPromiseInspection.prototype.reason = function () {\n if (!this.isRejected()) {\n throw new TypeError(\"cannot get rejection reason of a non-rejected promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n return this._settledValue();\n};\n\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\n return (this._bitField & 33554432) !== 0;\n};\n\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\n return (this._bitField & 16777216) !== 0;\n};\n\nvar isPending = PromiseInspection.prototype.isPending = function () {\n return (this._bitField & 50397184) === 0;\n};\n\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\n return (this._bitField & 50331648) !== 0;\n};\n\nPromiseInspection.prototype.isCancelled = function() {\n return (this._bitField & 8454144) !== 0;\n};\n\nPromise.prototype.__isCancelled = function() {\n return (this._bitField & 65536) === 65536;\n};\n\nPromise.prototype._isCancelled = function() {\n return this._target().__isCancelled();\n};\n\nPromise.prototype.isCancelled = function() {\n return (this._target()._bitField & 8454144) !== 0;\n};\n\nPromise.prototype.isPending = function() {\n return isPending.call(this._target());\n};\n\nPromise.prototype.isRejected = function() {\n return isRejected.call(this._target());\n};\n\nPromise.prototype.isFulfilled = function() {\n return isFulfilled.call(this._target());\n};\n\nPromise.prototype.isResolved = function() {\n return isResolved.call(this._target());\n};\n\nPromise.prototype.value = function() {\n return value.call(this._target());\n};\n\nPromise.prototype.reason = function() {\n var target = this._target();\n target._unsetRejectionIsUnhandled();\n return reason.call(target);\n};\n\nPromise.prototype._value = function() {\n return this._settledValue();\n};\n\nPromise.prototype._reason = function() {\n this._unsetRejectionIsUnhandled();\n return this._settledValue();\n};\n\nPromise.PromiseInspection = PromiseInspection;\n};\n\n},{}],33:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar util = _dereq_(\"./util\");\nvar errorObj = util.errorObj;\nvar isObject = util.isObject;\n\nfunction tryConvertToPromise(obj, context) {\n if (isObject(obj)) {\n if (obj instanceof Promise) return obj;\n var then = getThen(obj);\n if (then === errorObj) {\n if (context) context._pushContext();\n var ret = Promise.reject(then.e);\n if (context) context._popContext();\n return ret;\n } else if (typeof then === \"function\") {\n if (isAnyBluebirdPromise(obj)) {\n var ret = new Promise(INTERNAL);\n obj._then(\n ret._fulfill,\n ret._reject,\n undefined,\n ret,\n null\n );\n return ret;\n }\n return doThenable(obj, then, context);\n }\n }\n return obj;\n}\n\nfunction doGetThen(obj) {\n return obj.then;\n}\n\nfunction getThen(obj) {\n try {\n return doGetThen(obj);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n}\n\nvar hasProp = {}.hasOwnProperty;\nfunction isAnyBluebirdPromise(obj) {\n try {\n return hasProp.call(obj, \"_promise0\");\n } catch (e) {\n return false;\n }\n}\n\nfunction doThenable(x, then, context) {\n var promise = new Promise(INTERNAL);\n var ret = promise;\n if (context) context._pushContext();\n promise._captureStackTrace();\n if (context) context._popContext();\n var synchronous = true;\n var result = util.tryCatch(then).call(x, resolve, reject);\n synchronous = false;\n\n if (promise && result === errorObj) {\n promise._rejectCallback(result.e, true, true);\n promise = null;\n }\n\n function resolve(value) {\n if (!promise) return;\n promise._resolveCallback(value);\n promise = null;\n }\n\n function reject(reason) {\n if (!promise) return;\n promise._rejectCallback(reason, synchronous, true);\n promise = null;\n }\n return ret;\n}\n\nreturn tryConvertToPromise;\n};\n\n},{\"./util\":36}],34:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, debug) {\nvar util = _dereq_(\"./util\");\nvar TimeoutError = Promise.TimeoutError;\n\nfunction HandleWrapper(handle) {\n this.handle = handle;\n}\n\nHandleWrapper.prototype._resultCancelled = function() {\n clearTimeout(this.handle);\n};\n\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\nvar delay = Promise.delay = function (ms, value) {\n var ret;\n var handle;\n if (value !== undefined) {\n ret = Promise.resolve(value)\n ._then(afterValue, null, null, ms, undefined);\n if (debug.cancellation() && value instanceof Promise) {\n ret._setOnCancel(value);\n }\n } else {\n ret = new Promise(INTERNAL);\n handle = setTimeout(function() { ret._fulfill(); }, +ms);\n if (debug.cancellation()) {\n ret._setOnCancel(new HandleWrapper(handle));\n }\n ret._captureStackTrace();\n }\n ret._setAsyncGuaranteed();\n return ret;\n};\n\nPromise.prototype.delay = function (ms) {\n return delay(ms, this);\n};\n\nvar afterTimeout = function (promise, message, parent) {\n var err;\n if (typeof message !== \"string\") {\n if (message instanceof Error) {\n err = message;\n } else {\n err = new TimeoutError(\"operation timed out\");\n }\n } else {\n err = new TimeoutError(message);\n }\n util.markAsOriginatingFromRejection(err);\n promise._attachExtraTrace(err);\n promise._reject(err);\n\n if (parent != null) {\n parent.cancel();\n }\n};\n\nfunction successClear(value) {\n clearTimeout(this.handle);\n return value;\n}\n\nfunction failureClear(reason) {\n clearTimeout(this.handle);\n throw reason;\n}\n\nPromise.prototype.timeout = function (ms, message) {\n ms = +ms;\n var ret, parent;\n\n var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\n if (ret.isPending()) {\n afterTimeout(ret, message, parent);\n }\n }, ms));\n\n if (debug.cancellation()) {\n parent = this.then();\n ret = parent._then(successClear, failureClear,\n undefined, handleWrapper, undefined);\n ret._setOnCancel(handleWrapper);\n } else {\n ret = this._then(successClear, failureClear,\n undefined, handleWrapper, undefined);\n }\n\n return ret;\n};\n\n};\n\n},{\"./util\":36}],35:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\n createContext, INTERNAL, debug) {\n var util = _dereq_(\"./util\");\n var TypeError = _dereq_(\"./errors\").TypeError;\n var inherits = _dereq_(\"./util\").inherits;\n var errorObj = util.errorObj;\n var tryCatch = util.tryCatch;\n var NULL = {};\n\n function thrower(e) {\n setTimeout(function(){throw e;}, 0);\n }\n\n function castPreservingDisposable(thenable) {\n var maybePromise = tryConvertToPromise(thenable);\n if (maybePromise !== thenable &&\n typeof thenable._isDisposable === \"function\" &&\n typeof thenable._getDisposer === \"function\" &&\n thenable._isDisposable()) {\n maybePromise._setDisposable(thenable._getDisposer());\n }\n return maybePromise;\n }\n function dispose(resources, inspection) {\n var i = 0;\n var len = resources.length;\n var ret = new Promise(INTERNAL);\n function iterator() {\n if (i >= len) return ret._fulfill();\n var maybePromise = castPreservingDisposable(resources[i++]);\n if (maybePromise instanceof Promise &&\n maybePromise._isDisposable()) {\n try {\n maybePromise = tryConvertToPromise(\n maybePromise._getDisposer().tryDispose(inspection),\n resources.promise);\n } catch (e) {\n return thrower(e);\n }\n if (maybePromise instanceof Promise) {\n return maybePromise._then(iterator, thrower,\n null, null, null);\n }\n }\n iterator();\n }\n iterator();\n return ret;\n }\n\n function Disposer(data, promise, context) {\n this._data = data;\n this._promise = promise;\n this._context = context;\n }\n\n Disposer.prototype.data = function () {\n return this._data;\n };\n\n Disposer.prototype.promise = function () {\n return this._promise;\n };\n\n Disposer.prototype.resource = function () {\n if (this.promise().isFulfilled()) {\n return this.promise().value();\n }\n return NULL;\n };\n\n Disposer.prototype.tryDispose = function(inspection) {\n var resource = this.resource();\n var context = this._context;\n if (context !== undefined) context._pushContext();\n var ret = resource !== NULL\n ? this.doDispose(resource, inspection) : null;\n if (context !== undefined) context._popContext();\n this._promise._unsetDisposable();\n this._data = null;\n return ret;\n };\n\n Disposer.isDisposer = function (d) {\n return (d != null &&\n typeof d.resource === \"function\" &&\n typeof d.tryDispose === \"function\");\n };\n\n function FunctionDisposer(fn, promise, context) {\n this.constructor$(fn, promise, context);\n }\n inherits(FunctionDisposer, Disposer);\n\n FunctionDisposer.prototype.doDispose = function (resource, inspection) {\n var fn = this.data();\n return fn.call(resource, resource, inspection);\n };\n\n function maybeUnwrapDisposer(value) {\n if (Disposer.isDisposer(value)) {\n this.resources[this.index]._setDisposable(value);\n return value.promise();\n }\n return value;\n }\n\n function ResourceList(length) {\n this.length = length;\n this.promise = null;\n this[length-1] = null;\n }\n\n ResourceList.prototype._resultCancelled = function() {\n var len = this.length;\n for (var i = 0; i < len; ++i) {\n var item = this[i];\n if (item instanceof Promise) {\n item.cancel();\n }\n }\n };\n\n Promise.using = function () {\n var len = arguments.length;\n if (len < 2) return apiRejection(\n \"you must pass at least 2 arguments to Promise.using\");\n var fn = arguments[len - 1];\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var input;\n var spreadArgs = true;\n if (len === 2 && Array.isArray(arguments[0])) {\n input = arguments[0];\n len = input.length;\n spreadArgs = false;\n } else {\n input = arguments;\n len--;\n }\n var resources = new ResourceList(len);\n for (var i = 0; i < len; ++i) {\n var resource = input[i];\n if (Disposer.isDisposer(resource)) {\n var disposer = resource;\n resource = resource.promise();\n resource._setDisposable(disposer);\n } else {\n var maybePromise = tryConvertToPromise(resource);\n if (maybePromise instanceof Promise) {\n resource =\n maybePromise._then(maybeUnwrapDisposer, null, null, {\n resources: resources,\n index: i\n }, undefined);\n }\n }\n resources[i] = resource;\n }\n\n var reflectedResources = new Array(resources.length);\n for (var i = 0; i < reflectedResources.length; ++i) {\n reflectedResources[i] = Promise.resolve(resources[i]).reflect();\n }\n\n var resultPromise = Promise.all(reflectedResources)\n .then(function(inspections) {\n for (var i = 0; i < inspections.length; ++i) {\n var inspection = inspections[i];\n if (inspection.isRejected()) {\n errorObj.e = inspection.error();\n return errorObj;\n } else if (!inspection.isFulfilled()) {\n resultPromise.cancel();\n return;\n }\n inspections[i] = inspection.value();\n }\n promise._pushContext();\n\n fn = tryCatch(fn);\n var ret = spreadArgs\n ? fn.apply(undefined, inspections) : fn(inspections);\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret, promiseCreated, \"Promise.using\", promise);\n return ret;\n });\n\n var promise = resultPromise.lastly(function() {\n var inspection = new Promise.PromiseInspection(resultPromise);\n return dispose(resources, inspection);\n });\n resources.promise = promise;\n promise._setOnCancel(resources);\n return promise;\n };\n\n Promise.prototype._setDisposable = function (disposer) {\n this._bitField = this._bitField | 131072;\n this._disposer = disposer;\n };\n\n Promise.prototype._isDisposable = function () {\n return (this._bitField & 131072) > 0;\n };\n\n Promise.prototype._getDisposer = function () {\n return this._disposer;\n };\n\n Promise.prototype._unsetDisposable = function () {\n this._bitField = this._bitField & (~131072);\n this._disposer = undefined;\n };\n\n Promise.prototype.disposer = function (fn) {\n if (typeof fn === \"function\") {\n return new FunctionDisposer(fn, this, createContext());\n }\n throw new TypeError();\n };\n\n};\n\n},{\"./errors\":12,\"./util\":36}],36:[function(_dereq_,module,exports){\n\"use strict\";\nvar es5 = _dereq_(\"./es5\");\nvar canEvaluate = typeof navigator == \"undefined\";\n\nvar errorObj = {e: {}};\nvar tryCatchTarget;\nvar globalObject = typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window :\n typeof global !== \"undefined\" ? global :\n this !== undefined ? this : null;\n\nfunction tryCatcher() {\n try {\n var target = tryCatchTarget;\n tryCatchTarget = null;\n return target.apply(this, arguments);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n}\nfunction tryCatch(fn) {\n tryCatchTarget = fn;\n return tryCatcher;\n}\n\nvar inherits = function(Child, Parent) {\n var hasProp = {}.hasOwnProperty;\n\n function T() {\n this.constructor = Child;\n this.constructor$ = Parent;\n for (var propertyName in Parent.prototype) {\n if (hasProp.call(Parent.prototype, propertyName) &&\n propertyName.charAt(propertyName.length-1) !== \"$\"\n ) {\n this[propertyName + \"$\"] = Parent.prototype[propertyName];\n }\n }\n }\n T.prototype = Parent.prototype;\n Child.prototype = new T();\n return Child.prototype;\n};\n\n\nfunction isPrimitive(val) {\n return val == null || val === true || val === false ||\n typeof val === \"string\" || typeof val === \"number\";\n\n}\n\nfunction isObject(value) {\n return typeof value === \"function\" ||\n typeof value === \"object\" && value !== null;\n}\n\nfunction maybeWrapAsError(maybeError) {\n if (!isPrimitive(maybeError)) return maybeError;\n\n return new Error(safeToString(maybeError));\n}\n\nfunction withAppended(target, appendee) {\n var len = target.length;\n var ret = new Array(len + 1);\n var i;\n for (i = 0; i < len; ++i) {\n ret[i] = target[i];\n }\n ret[i] = appendee;\n return ret;\n}\n\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\n if (es5.isES5) {\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n\n if (desc != null) {\n return desc.get == null && desc.set == null\n ? desc.value\n : defaultValue;\n }\n } else {\n return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\n }\n}\n\nfunction notEnumerableProp(obj, name, value) {\n if (isPrimitive(obj)) return obj;\n var descriptor = {\n value: value,\n configurable: true,\n enumerable: false,\n writable: true\n };\n es5.defineProperty(obj, name, descriptor);\n return obj;\n}\n\nfunction thrower(r) {\n throw r;\n}\n\nvar inheritedDataKeys = (function() {\n var excludedPrototypes = [\n Array.prototype,\n Object.prototype,\n Function.prototype\n ];\n\n var isExcludedProto = function(val) {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (excludedPrototypes[i] === val) {\n return true;\n }\n }\n return false;\n };\n\n if (es5.isES5) {\n var getKeys = Object.getOwnPropertyNames;\n return function(obj) {\n var ret = [];\n var visitedKeys = Object.create(null);\n while (obj != null && !isExcludedProto(obj)) {\n var keys;\n try {\n keys = getKeys(obj);\n } catch (e) {\n return ret;\n }\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (visitedKeys[key]) continue;\n visitedKeys[key] = true;\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n if (desc != null && desc.get == null && desc.set == null) {\n ret.push(key);\n }\n }\n obj = es5.getPrototypeOf(obj);\n }\n return ret;\n };\n } else {\n var hasProp = {}.hasOwnProperty;\n return function(obj) {\n if (isExcludedProto(obj)) return [];\n var ret = [];\n\n /*jshint forin:false */\n enumeration: for (var key in obj) {\n if (hasProp.call(obj, key)) {\n ret.push(key);\n } else {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (hasProp.call(excludedPrototypes[i], key)) {\n continue enumeration;\n }\n }\n ret.push(key);\n }\n }\n return ret;\n };\n }\n\n})();\n\nvar thisAssignmentPattern = /this\\s*\\.\\s*\\S+\\s*=/;\nfunction isClass(fn) {\n try {\n if (typeof fn === \"function\") {\n var keys = es5.names(fn.prototype);\n\n var hasMethods = es5.isES5 && keys.length > 1;\n var hasMethodsOtherThanConstructor = keys.length > 0 &&\n !(keys.length === 1 && keys[0] === \"constructor\");\n var hasThisAssignmentAndStaticMethods =\n thisAssignmentPattern.test(fn + \"\") && es5.names(fn).length > 0;\n\n if (hasMethods || hasMethodsOtherThanConstructor ||\n hasThisAssignmentAndStaticMethods) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n}\n\nfunction toFastProperties(obj) {\n /*jshint -W027,-W055,-W031*/\n function FakeConstructor() {}\n FakeConstructor.prototype = obj;\n var receiver = new FakeConstructor();\n function ic() {\n return typeof receiver.foo;\n }\n ic();\n ic();\n return obj;\n eval(obj);\n}\n\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\nfunction isIdentifier(str) {\n return rident.test(str);\n}\n\nfunction filledRange(count, prefix, suffix) {\n var ret = new Array(count);\n for(var i = 0; i < count; ++i) {\n ret[i] = prefix + i + suffix;\n }\n return ret;\n}\n\nfunction safeToString(obj) {\n try {\n return obj + \"\";\n } catch (e) {\n return \"[no string representation]\";\n }\n}\n\nfunction isError(obj) {\n return obj instanceof Error ||\n (obj !== null &&\n typeof obj === \"object\" &&\n typeof obj.message === \"string\" &&\n typeof obj.name === \"string\");\n}\n\nfunction markAsOriginatingFromRejection(e) {\n try {\n notEnumerableProp(e, \"isOperational\", true);\n }\n catch(ignore) {}\n}\n\nfunction originatesFromRejection(e) {\n if (e == null) return false;\n return ((e instanceof Error[\"__BluebirdErrorTypes__\"].OperationalError) ||\n e[\"isOperational\"] === true);\n}\n\nfunction canAttachTrace(obj) {\n return isError(obj) && es5.propertyIsWritable(obj, \"stack\");\n}\n\nvar ensureErrorObject = (function() {\n if (!(\"stack\" in new Error())) {\n return function(value) {\n if (canAttachTrace(value)) return value;\n try {throw new Error(safeToString(value));}\n catch(err) {return err;}\n };\n } else {\n return function(value) {\n if (canAttachTrace(value)) return value;\n return new Error(safeToString(value));\n };\n }\n})();\n\nfunction classString(obj) {\n return {}.toString.call(obj);\n}\n\nfunction copyDescriptors(from, to, filter) {\n var keys = es5.names(from);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (filter(key)) {\n try {\n es5.defineProperty(to, key, es5.getDescriptor(from, key));\n } catch (ignore) {}\n }\n }\n}\n\nvar asArray = function(v) {\n if (es5.isArray(v)) {\n return v;\n }\n return null;\n};\n\nif (typeof Symbol !== \"undefined\" && Symbol.iterator) {\n var ArrayFrom = typeof Array.from === \"function\" ? function(v) {\n return Array.from(v);\n } : function(v) {\n var ret = [];\n var it = v[Symbol.iterator]();\n var itResult;\n while (!((itResult = it.next()).done)) {\n ret.push(itResult.value);\n }\n return ret;\n };\n\n asArray = function(v) {\n if (es5.isArray(v)) {\n return v;\n } else if (v != null && typeof v[Symbol.iterator] === \"function\") {\n return ArrayFrom(v);\n }\n return null;\n };\n}\n\nvar isNode = typeof process !== \"undefined\" &&\n classString(process).toLowerCase() === \"[object process]\";\n\nvar hasEnvVariables = typeof process !== \"undefined\" &&\n typeof process.env !== \"undefined\";\n\nfunction env(key) {\n return hasEnvVariables ? process.env[key] : undefined;\n}\n\nfunction getNativePromise() {\n if (typeof Promise === \"function\") {\n try {\n var promise = new Promise(function(){});\n if ({}.toString.call(promise) === \"[object Promise]\") {\n return Promise;\n }\n } catch (e) {}\n }\n}\n\nfunction domainBind(self, cb) {\n return self.bind(cb);\n}\n\nvar ret = {\n isClass: isClass,\n isIdentifier: isIdentifier,\n inheritedDataKeys: inheritedDataKeys,\n getDataPropertyOrDefault: getDataPropertyOrDefault,\n thrower: thrower,\n isArray: es5.isArray,\n asArray: asArray,\n notEnumerableProp: notEnumerableProp,\n isPrimitive: isPrimitive,\n isObject: isObject,\n isError: isError,\n canEvaluate: canEvaluate,\n errorObj: errorObj,\n tryCatch: tryCatch,\n inherits: inherits,\n withAppended: withAppended,\n maybeWrapAsError: maybeWrapAsError,\n toFastProperties: toFastProperties,\n filledRange: filledRange,\n toString: safeToString,\n canAttachTrace: canAttachTrace,\n ensureErrorObject: ensureErrorObject,\n originatesFromRejection: originatesFromRejection,\n markAsOriginatingFromRejection: markAsOriginatingFromRejection,\n classString: classString,\n copyDescriptors: copyDescriptors,\n hasDevTools: typeof chrome !== \"undefined\" && chrome &&\n typeof chrome.loadTimes === \"function\",\n isNode: isNode,\n hasEnvVariables: hasEnvVariables,\n env: env,\n global: globalObject,\n getNativePromise: getNativePromise,\n domainBind: domainBind\n};\nret.isRecentNode = ret.isNode && (function() {\n var version;\n if (process.versions && process.versions.node) { \n version = process.versions.node.split(\".\").map(Number);\n } else if (process.version) {\n version = process.version.split(\".\").map(Number);\n }\n return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\n})();\n\nif (ret.isNode) ret.toFastProperties(process);\n\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\nmodule.exports = ret;\n\n},{\"./es5\":13}]},{},[4])(4)\n}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; }\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/bluebird/js/browser/bluebird.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bn.js/lib/bn.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/bn.js/lib/bn.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = __webpack_require__(/*! buffer */ 4).Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})( false || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/bn.js/lib/bn.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/constants.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/borc/src/constants.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Bignumber = __webpack_require__(/*! bignumber.js */ \"./node_modules/bignumber.js/bignumber.js\")\n\nexports.MT = {\n POS_INT: 0,\n NEG_INT: 1,\n BYTE_STRING: 2,\n UTF8_STRING: 3,\n ARRAY: 4,\n MAP: 5,\n TAG: 6,\n SIMPLE_FLOAT: 7\n}\n\nexports.TAG = {\n DATE_STRING: 0,\n DATE_EPOCH: 1,\n POS_BIGINT: 2,\n NEG_BIGINT: 3,\n DECIMAL_FRAC: 4,\n BIGFLOAT: 5,\n BASE64URL_EXPECTED: 21,\n BASE64_EXPECTED: 22,\n BASE16_EXPECTED: 23,\n CBOR: 24,\n URI: 32,\n BASE64URL: 33,\n BASE64: 34,\n REGEXP: 35,\n MIME: 36\n}\n\nexports.NUMBYTES = {\n ZERO: 0,\n ONE: 24,\n TWO: 25,\n FOUR: 26,\n EIGHT: 27,\n INDEFINITE: 31\n}\n\nexports.SIMPLE = {\n FALSE: 20,\n TRUE: 21,\n NULL: 22,\n UNDEFINED: 23\n}\n\nexports.SYMS = {\n NULL: Symbol('null'),\n UNDEFINED: Symbol('undef'),\n PARENT: Symbol('parent'),\n BREAK: Symbol('break'),\n STREAM: Symbol('stream')\n}\n\nexports.SHIFT32 = Math.pow(2, 32)\nexports.SHIFT16 = Math.pow(2, 16)\n\nexports.MAX_SAFE_HIGH = 0x1fffff\nexports.NEG_ONE = new Bignumber(-1)\nexports.TEN = new Bignumber(10)\nexports.TWO = new Bignumber(2)\n\nexports.PARENT = {\n ARRAY: 0,\n OBJECT: 1,\n MAP: 2,\n TAG: 3,\n BYTE_STRING: 4,\n UTF8_STRING: 5\n}\n\n\n//# sourceURL=webpack:///./node_modules/borc/src/constants.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/decoder.asm.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/borc/src/decoder.asm.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function decodeAsm (stdlib, foreign, buffer) {\n 'use asm'\n\n // -- Imports\n\n var heap = new stdlib.Uint8Array(buffer)\n // var log = foreign.log\n var pushInt = foreign.pushInt\n var pushInt32 = foreign.pushInt32\n var pushInt32Neg = foreign.pushInt32Neg\n var pushInt64 = foreign.pushInt64\n var pushInt64Neg = foreign.pushInt64Neg\n var pushFloat = foreign.pushFloat\n var pushFloatSingle = foreign.pushFloatSingle\n var pushFloatDouble = foreign.pushFloatDouble\n var pushTrue = foreign.pushTrue\n var pushFalse = foreign.pushFalse\n var pushUndefined = foreign.pushUndefined\n var pushNull = foreign.pushNull\n var pushInfinity = foreign.pushInfinity\n var pushInfinityNeg = foreign.pushInfinityNeg\n var pushNaN = foreign.pushNaN\n var pushNaNNeg = foreign.pushNaNNeg\n\n var pushArrayStart = foreign.pushArrayStart\n var pushArrayStartFixed = foreign.pushArrayStartFixed\n var pushArrayStartFixed32 = foreign.pushArrayStartFixed32\n var pushArrayStartFixed64 = foreign.pushArrayStartFixed64\n var pushObjectStart = foreign.pushObjectStart\n var pushObjectStartFixed = foreign.pushObjectStartFixed\n var pushObjectStartFixed32 = foreign.pushObjectStartFixed32\n var pushObjectStartFixed64 = foreign.pushObjectStartFixed64\n\n var pushByteString = foreign.pushByteString\n var pushByteStringStart = foreign.pushByteStringStart\n var pushUtf8String = foreign.pushUtf8String\n var pushUtf8StringStart = foreign.pushUtf8StringStart\n\n var pushSimpleUnassigned = foreign.pushSimpleUnassigned\n\n var pushTagStart = foreign.pushTagStart\n var pushTagStart4 = foreign.pushTagStart4\n var pushTagStart8 = foreign.pushTagStart8\n var pushTagUnassigned = foreign.pushTagUnassigned\n\n var pushBreak = foreign.pushBreak\n\n var pow = stdlib.Math.pow\n\n // -- Constants\n\n\n // -- Mutable Variables\n\n var offset = 0\n var inputLength = 0\n var code = 0\n\n // Decode a cbor string represented as Uint8Array\n // which is allocated on the heap from 0 to inputLength\n //\n // input - Int\n //\n // Returns Code - Int,\n // Success = 0\n // Error > 0\n function parse (input) {\n input = input | 0\n\n offset = 0\n inputLength = input\n\n while ((offset | 0) < (inputLength | 0)) {\n code = jumpTable[heap[offset] & 255](heap[offset] | 0) | 0\n\n if ((code | 0) > 0) {\n break\n }\n }\n\n return code | 0\n }\n\n // -- Helper Function\n\n function checkOffset (n) {\n n = n | 0\n\n if ((((offset | 0) + (n | 0)) | 0) < (inputLength | 0)) {\n return 0\n }\n\n return 1\n }\n\n function readUInt16 (n) {\n n = n | 0\n\n return (\n (heap[n | 0] << 8) | heap[(n + 1) | 0]\n ) | 0\n }\n\n function readUInt32 (n) {\n n = n | 0\n\n return (\n (heap[n | 0] << 24) | (heap[(n + 1) | 0] << 16) | (heap[(n + 2) | 0] << 8) | heap[(n + 3) | 0]\n ) | 0\n }\n\n // -- Initial Byte Handlers\n\n function INT_P (octet) {\n octet = octet | 0\n\n pushInt(octet | 0)\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function UINT_P_8 (octet) {\n octet = octet | 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n pushInt(heap[(offset + 1) | 0] | 0)\n\n offset = (offset + 2) | 0\n\n return 0\n }\n\n function UINT_P_16 (octet) {\n octet = octet | 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n pushInt(\n readUInt16((offset + 1) | 0) | 0\n )\n\n offset = (offset + 3) | 0\n\n return 0\n }\n\n function UINT_P_32 (octet) {\n octet = octet | 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n pushInt32(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0\n )\n\n offset = (offset + 5) | 0\n\n return 0\n }\n\n function UINT_P_64 (octet) {\n octet = octet | 0\n\n if (checkOffset(8) | 0) {\n return 1\n }\n\n pushInt64(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0,\n readUInt16((offset + 5) | 0) | 0,\n readUInt16((offset + 7) | 0) | 0\n )\n\n offset = (offset + 9) | 0\n\n return 0\n }\n\n function INT_N (octet) {\n octet = octet | 0\n\n pushInt((-1 - ((octet - 32) | 0)) | 0)\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function UINT_N_8 (octet) {\n octet = octet | 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n pushInt(\n (-1 - (heap[(offset + 1) | 0] | 0)) | 0\n )\n\n offset = (offset + 2) | 0\n\n return 0\n }\n\n function UINT_N_16 (octet) {\n octet = octet | 0\n\n var val = 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n val = readUInt16((offset + 1) | 0) | 0\n pushInt((-1 - (val | 0)) | 0)\n\n offset = (offset + 3) | 0\n\n return 0\n }\n\n function UINT_N_32 (octet) {\n octet = octet | 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n pushInt32Neg(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0\n )\n\n offset = (offset + 5) | 0\n\n return 0\n }\n\n function UINT_N_64 (octet) {\n octet = octet | 0\n\n if (checkOffset(8) | 0) {\n return 1\n }\n\n pushInt64Neg(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0,\n readUInt16((offset + 5) | 0) | 0,\n readUInt16((offset + 7) | 0) | 0\n )\n\n offset = (offset + 9) | 0\n\n return 0\n }\n\n function BYTE_STRING (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var step = 0\n\n step = (octet - 64) | 0\n if (checkOffset(step | 0) | 0) {\n return 1\n }\n\n start = (offset + 1) | 0\n end = (((offset + 1) | 0) + (step | 0)) | 0\n\n pushByteString(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function BYTE_STRING_8 (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var length = 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n length = heap[(offset + 1) | 0] | 0\n start = (offset + 2) | 0\n end = (((offset + 2) | 0) + (length | 0)) | 0\n\n if (checkOffset((length + 1) | 0) | 0) {\n return 1\n }\n\n pushByteString(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function BYTE_STRING_16 (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var length = 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n length = readUInt16((offset + 1) | 0) | 0\n start = (offset + 3) | 0\n end = (((offset + 3) | 0) + (length | 0)) | 0\n\n\n if (checkOffset((length + 2) | 0) | 0) {\n return 1\n }\n\n pushByteString(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function BYTE_STRING_32 (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var length = 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n length = readUInt32((offset + 1) | 0) | 0\n start = (offset + 5) | 0\n end = (((offset + 5) | 0) + (length | 0)) | 0\n\n\n if (checkOffset((length + 4) | 0) | 0) {\n return 1\n }\n\n pushByteString(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function BYTE_STRING_64 (octet) {\n // NOT IMPLEMENTED\n octet = octet | 0\n\n return 1\n }\n\n function BYTE_STRING_BREAK (octet) {\n octet = octet | 0\n\n pushByteStringStart()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function UTF8_STRING (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var step = 0\n\n step = (octet - 96) | 0\n\n if (checkOffset(step | 0) | 0) {\n return 1\n }\n\n start = (offset + 1) | 0\n end = (((offset + 1) | 0) + (step | 0)) | 0\n\n pushUtf8String(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function UTF8_STRING_8 (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var length = 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n length = heap[(offset + 1) | 0] | 0\n start = (offset + 2) | 0\n end = (((offset + 2) | 0) + (length | 0)) | 0\n\n if (checkOffset((length + 1) | 0) | 0) {\n return 1\n }\n\n pushUtf8String(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function UTF8_STRING_16 (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var length = 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n length = readUInt16((offset + 1) | 0) | 0\n start = (offset + 3) | 0\n end = (((offset + 3) | 0) + (length | 0)) | 0\n\n if (checkOffset((length + 2) | 0) | 0) {\n return 1\n }\n\n pushUtf8String(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function UTF8_STRING_32 (octet) {\n octet = octet | 0\n\n var start = 0\n var end = 0\n var length = 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n length = readUInt32((offset + 1) | 0) | 0\n start = (offset + 5) | 0\n end = (((offset + 5) | 0) + (length | 0)) | 0\n\n if (checkOffset((length + 4) | 0) | 0) {\n return 1\n }\n\n pushUtf8String(start | 0, end | 0)\n\n offset = end | 0\n\n return 0\n }\n\n function UTF8_STRING_64 (octet) {\n // NOT IMPLEMENTED\n octet = octet | 0\n\n return 1\n }\n\n function UTF8_STRING_BREAK (octet) {\n octet = octet | 0\n\n pushUtf8StringStart()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function ARRAY (octet) {\n octet = octet | 0\n\n pushArrayStartFixed((octet - 128) | 0)\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function ARRAY_8 (octet) {\n octet = octet | 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n pushArrayStartFixed(heap[(offset + 1) | 0] | 0)\n\n offset = (offset + 2) | 0\n\n return 0\n }\n\n function ARRAY_16 (octet) {\n octet = octet | 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n pushArrayStartFixed(\n readUInt16((offset + 1) | 0) | 0\n )\n\n offset = (offset + 3) | 0\n\n return 0\n }\n\n function ARRAY_32 (octet) {\n octet = octet | 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n pushArrayStartFixed32(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0\n )\n\n offset = (offset + 5) | 0\n\n return 0\n }\n\n function ARRAY_64 (octet) {\n octet = octet | 0\n\n if (checkOffset(8) | 0) {\n return 1\n }\n\n pushArrayStartFixed64(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0,\n readUInt16((offset + 5) | 0) | 0,\n readUInt16((offset + 7) | 0) | 0\n )\n\n offset = (offset + 9) | 0\n\n return 0\n }\n\n function ARRAY_BREAK (octet) {\n octet = octet | 0\n\n pushArrayStart()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function MAP (octet) {\n octet = octet | 0\n\n var step = 0\n\n step = (octet - 160) | 0\n\n if (checkOffset(step | 0) | 0) {\n return 1\n }\n\n pushObjectStartFixed(step | 0)\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function MAP_8 (octet) {\n octet = octet | 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n pushObjectStartFixed(heap[(offset + 1) | 0] | 0)\n\n offset = (offset + 2) | 0\n\n return 0\n }\n\n function MAP_16 (octet) {\n octet = octet | 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n pushObjectStartFixed(\n readUInt16((offset + 1) | 0) | 0\n )\n\n offset = (offset + 3) | 0\n\n return 0\n }\n\n function MAP_32 (octet) {\n octet = octet | 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n pushObjectStartFixed32(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0\n )\n\n offset = (offset + 5) | 0\n\n return 0\n }\n\n function MAP_64 (octet) {\n octet = octet | 0\n\n if (checkOffset(8) | 0) {\n return 1\n }\n\n pushObjectStartFixed64(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0,\n readUInt16((offset + 5) | 0) | 0,\n readUInt16((offset + 7) | 0) | 0\n )\n\n offset = (offset + 9) | 0\n\n return 0\n }\n\n function MAP_BREAK (octet) {\n octet = octet | 0\n\n pushObjectStart()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function TAG_KNOWN (octet) {\n octet = octet | 0\n\n pushTagStart((octet - 192| 0) | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_BIGNUM_POS (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_BIGNUM_NEG (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_FRAC (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_BIGNUM_FLOAT (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_UNASSIGNED (octet) {\n octet = octet | 0\n\n pushTagStart((octet - 192| 0) | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_BASE64_URL (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_BASE64 (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_BASE16 (octet) {\n octet = octet | 0\n\n pushTagStart(octet | 0)\n\n offset = (offset + 1 | 0)\n\n return 0\n }\n\n function TAG_MORE_1 (octet) {\n octet = octet | 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n pushTagStart(heap[(offset + 1) | 0] | 0)\n\n offset = (offset + 2 | 0)\n\n return 0\n }\n\n function TAG_MORE_2 (octet) {\n octet = octet | 0\n\n if (checkOffset(2) | 0) {\n return 1\n }\n\n pushTagStart(\n readUInt16((offset + 1) | 0) | 0\n )\n\n offset = (offset + 3 | 0)\n\n return 0\n }\n\n function TAG_MORE_4 (octet) {\n octet = octet | 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n pushTagStart4(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0\n )\n\n offset = (offset + 5 | 0)\n\n return 0\n }\n\n function TAG_MORE_8 (octet) {\n octet = octet | 0\n\n if (checkOffset(8) | 0) {\n return 1\n }\n\n pushTagStart8(\n readUInt16((offset + 1) | 0) | 0,\n readUInt16((offset + 3) | 0) | 0,\n readUInt16((offset + 5) | 0) | 0,\n readUInt16((offset + 7) | 0) | 0\n )\n\n offset = (offset + 9 | 0)\n\n return 0\n }\n\n function SIMPLE_UNASSIGNED (octet) {\n octet = octet | 0\n\n pushSimpleUnassigned(((octet | 0) - 224) | 0)\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function SIMPLE_FALSE (octet) {\n octet = octet | 0\n\n pushFalse()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function SIMPLE_TRUE (octet) {\n octet = octet | 0\n\n pushTrue()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function SIMPLE_NULL (octet) {\n octet = octet | 0\n\n pushNull()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function SIMPLE_UNDEFINED (octet) {\n octet = octet | 0\n\n pushUndefined()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n function SIMPLE_BYTE (octet) {\n octet = octet | 0\n\n if (checkOffset(1) | 0) {\n return 1\n }\n\n pushSimpleUnassigned(heap[(offset + 1) | 0] | 0)\n\n offset = (offset + 2) | 0\n\n return 0\n }\n\n function SIMPLE_FLOAT_HALF (octet) {\n octet = octet | 0\n\n var f = 0\n var g = 0\n var sign = 1.0\n var exp = 0.0\n var mant = 0.0\n var r = 0.0\n if (checkOffset(2) | 0) {\n return 1\n }\n\n f = heap[(offset + 1) | 0] | 0\n g = heap[(offset + 2) | 0] | 0\n\n if ((f | 0) & 0x80) {\n sign = -1.0\n }\n\n exp = +(((f | 0) & 0x7C) >> 2)\n mant = +((((f | 0) & 0x03) << 8) | g)\n\n if (+exp == 0.0) {\n pushFloat(+(\n (+sign) * +5.9604644775390625e-8 * (+mant)\n ))\n } else if (+exp == 31.0) {\n if (+sign == 1.0) {\n if (+mant > 0.0) {\n pushNaN()\n } else {\n pushInfinity()\n }\n } else {\n if (+mant > 0.0) {\n pushNaNNeg()\n } else {\n pushInfinityNeg()\n }\n }\n } else {\n pushFloat(+(\n +sign * pow(+2, +(+exp - 25.0)) * +(1024.0 + mant)\n ))\n }\n\n offset = (offset + 3) | 0\n\n return 0\n }\n\n function SIMPLE_FLOAT_SINGLE (octet) {\n octet = octet | 0\n\n if (checkOffset(4) | 0) {\n return 1\n }\n\n pushFloatSingle(\n heap[(offset + 1) | 0] | 0,\n heap[(offset + 2) | 0] | 0,\n heap[(offset + 3) | 0] | 0,\n heap[(offset + 4) | 0] | 0\n )\n\n offset = (offset + 5) | 0\n\n return 0\n }\n\n function SIMPLE_FLOAT_DOUBLE (octet) {\n octet = octet | 0\n\n if (checkOffset(8) | 0) {\n return 1\n }\n\n pushFloatDouble(\n heap[(offset + 1) | 0] | 0,\n heap[(offset + 2) | 0] | 0,\n heap[(offset + 3) | 0] | 0,\n heap[(offset + 4) | 0] | 0,\n heap[(offset + 5) | 0] | 0,\n heap[(offset + 6) | 0] | 0,\n heap[(offset + 7) | 0] | 0,\n heap[(offset + 8) | 0] | 0\n )\n\n offset = (offset + 9) | 0\n\n return 0\n }\n\n function ERROR (octet) {\n octet = octet | 0\n\n return 1\n }\n\n function BREAK (octet) {\n octet = octet | 0\n\n pushBreak()\n\n offset = (offset + 1) | 0\n\n return 0\n }\n\n // -- Jump Table\n\n var jumpTable = [\n // Integer 0x00..0x17 (0..23)\n INT_P, // 0x00\n INT_P, // 0x01\n INT_P, // 0x02\n INT_P, // 0x03\n INT_P, // 0x04\n INT_P, // 0x05\n INT_P, // 0x06\n INT_P, // 0x07\n INT_P, // 0x08\n INT_P, // 0x09\n INT_P, // 0x0A\n INT_P, // 0x0B\n INT_P, // 0x0C\n INT_P, // 0x0D\n INT_P, // 0x0E\n INT_P, // 0x0F\n INT_P, // 0x10\n INT_P, // 0x11\n INT_P, // 0x12\n INT_P, // 0x13\n INT_P, // 0x14\n INT_P, // 0x15\n INT_P, // 0x16\n INT_P, // 0x17\n // Unsigned integer (one-byte uint8_t follows)\n UINT_P_8, // 0x18\n // Unsigned integer (two-byte uint16_t follows)\n UINT_P_16, // 0x19\n // Unsigned integer (four-byte uint32_t follows)\n UINT_P_32, // 0x1a\n // Unsigned integer (eight-byte uint64_t follows)\n UINT_P_64, // 0x1b\n ERROR, // 0x1c\n ERROR, // 0x1d\n ERROR, // 0x1e\n ERROR, // 0x1f\n // Negative integer -1-0x00..-1-0x17 (-1..-24)\n INT_N, // 0x20\n INT_N, // 0x21\n INT_N, // 0x22\n INT_N, // 0x23\n INT_N, // 0x24\n INT_N, // 0x25\n INT_N, // 0x26\n INT_N, // 0x27\n INT_N, // 0x28\n INT_N, // 0x29\n INT_N, // 0x2A\n INT_N, // 0x2B\n INT_N, // 0x2C\n INT_N, // 0x2D\n INT_N, // 0x2E\n INT_N, // 0x2F\n INT_N, // 0x30\n INT_N, // 0x31\n INT_N, // 0x32\n INT_N, // 0x33\n INT_N, // 0x34\n INT_N, // 0x35\n INT_N, // 0x36\n INT_N, // 0x37\n // Negative integer -1-n (one-byte uint8_t for n follows)\n UINT_N_8, // 0x38\n // Negative integer -1-n (two-byte uint16_t for n follows)\n UINT_N_16, // 0x39\n // Negative integer -1-n (four-byte uint32_t for nfollows)\n UINT_N_32, // 0x3a\n // Negative integer -1-n (eight-byte uint64_t for n follows)\n UINT_N_64, // 0x3b\n ERROR, // 0x3c\n ERROR, // 0x3d\n ERROR, // 0x3e\n ERROR, // 0x3f\n // byte string (0x00..0x17 bytes follow)\n BYTE_STRING, // 0x40\n BYTE_STRING, // 0x41\n BYTE_STRING, // 0x42\n BYTE_STRING, // 0x43\n BYTE_STRING, // 0x44\n BYTE_STRING, // 0x45\n BYTE_STRING, // 0x46\n BYTE_STRING, // 0x47\n BYTE_STRING, // 0x48\n BYTE_STRING, // 0x49\n BYTE_STRING, // 0x4A\n BYTE_STRING, // 0x4B\n BYTE_STRING, // 0x4C\n BYTE_STRING, // 0x4D\n BYTE_STRING, // 0x4E\n BYTE_STRING, // 0x4F\n BYTE_STRING, // 0x50\n BYTE_STRING, // 0x51\n BYTE_STRING, // 0x52\n BYTE_STRING, // 0x53\n BYTE_STRING, // 0x54\n BYTE_STRING, // 0x55\n BYTE_STRING, // 0x56\n BYTE_STRING, // 0x57\n // byte string (one-byte uint8_t for n, and then n bytes follow)\n BYTE_STRING_8, // 0x58\n // byte string (two-byte uint16_t for n, and then n bytes follow)\n BYTE_STRING_16, // 0x59\n // byte string (four-byte uint32_t for n, and then n bytes follow)\n BYTE_STRING_32, // 0x5a\n // byte string (eight-byte uint64_t for n, and then n bytes follow)\n BYTE_STRING_64, // 0x5b\n ERROR, // 0x5c\n ERROR, // 0x5d\n ERROR, // 0x5e\n // byte string, byte strings follow, terminated by \"break\"\n BYTE_STRING_BREAK, // 0x5f\n // UTF-8 string (0x00..0x17 bytes follow)\n UTF8_STRING, // 0x60\n UTF8_STRING, // 0x61\n UTF8_STRING, // 0x62\n UTF8_STRING, // 0x63\n UTF8_STRING, // 0x64\n UTF8_STRING, // 0x65\n UTF8_STRING, // 0x66\n UTF8_STRING, // 0x67\n UTF8_STRING, // 0x68\n UTF8_STRING, // 0x69\n UTF8_STRING, // 0x6A\n UTF8_STRING, // 0x6B\n UTF8_STRING, // 0x6C\n UTF8_STRING, // 0x6D\n UTF8_STRING, // 0x6E\n UTF8_STRING, // 0x6F\n UTF8_STRING, // 0x70\n UTF8_STRING, // 0x71\n UTF8_STRING, // 0x72\n UTF8_STRING, // 0x73\n UTF8_STRING, // 0x74\n UTF8_STRING, // 0x75\n UTF8_STRING, // 0x76\n UTF8_STRING, // 0x77\n // UTF-8 string (one-byte uint8_t for n, and then n bytes follow)\n UTF8_STRING_8, // 0x78\n // UTF-8 string (two-byte uint16_t for n, and then n bytes follow)\n UTF8_STRING_16, // 0x79\n // UTF-8 string (four-byte uint32_t for n, and then n bytes follow)\n UTF8_STRING_32, // 0x7a\n // UTF-8 string (eight-byte uint64_t for n, and then n bytes follow)\n UTF8_STRING_64, // 0x7b\n // UTF-8 string, UTF-8 strings follow, terminated by \"break\"\n ERROR, // 0x7c\n ERROR, // 0x7d\n ERROR, // 0x7e\n UTF8_STRING_BREAK, // 0x7f\n // array (0x00..0x17 data items follow)\n ARRAY, // 0x80\n ARRAY, // 0x81\n ARRAY, // 0x82\n ARRAY, // 0x83\n ARRAY, // 0x84\n ARRAY, // 0x85\n ARRAY, // 0x86\n ARRAY, // 0x87\n ARRAY, // 0x88\n ARRAY, // 0x89\n ARRAY, // 0x8A\n ARRAY, // 0x8B\n ARRAY, // 0x8C\n ARRAY, // 0x8D\n ARRAY, // 0x8E\n ARRAY, // 0x8F\n ARRAY, // 0x90\n ARRAY, // 0x91\n ARRAY, // 0x92\n ARRAY, // 0x93\n ARRAY, // 0x94\n ARRAY, // 0x95\n ARRAY, // 0x96\n ARRAY, // 0x97\n // array (one-byte uint8_t fo, and then n data items follow)\n ARRAY_8, // 0x98\n // array (two-byte uint16_t for n, and then n data items follow)\n ARRAY_16, // 0x99\n // array (four-byte uint32_t for n, and then n data items follow)\n ARRAY_32, // 0x9a\n // array (eight-byte uint64_t for n, and then n data items follow)\n ARRAY_64, // 0x9b\n // array, data items follow, terminated by \"break\"\n ERROR, // 0x9c\n ERROR, // 0x9d\n ERROR, // 0x9e\n ARRAY_BREAK, // 0x9f\n // map (0x00..0x17 pairs of data items follow)\n MAP, // 0xa0\n MAP, // 0xa1\n MAP, // 0xa2\n MAP, // 0xa3\n MAP, // 0xa4\n MAP, // 0xa5\n MAP, // 0xa6\n MAP, // 0xa7\n MAP, // 0xa8\n MAP, // 0xa9\n MAP, // 0xaA\n MAP, // 0xaB\n MAP, // 0xaC\n MAP, // 0xaD\n MAP, // 0xaE\n MAP, // 0xaF\n MAP, // 0xb0\n MAP, // 0xb1\n MAP, // 0xb2\n MAP, // 0xb3\n MAP, // 0xb4\n MAP, // 0xb5\n MAP, // 0xb6\n MAP, // 0xb7\n // map (one-byte uint8_t for n, and then n pairs of data items follow)\n MAP_8, // 0xb8\n // map (two-byte uint16_t for n, and then n pairs of data items follow)\n MAP_16, // 0xb9\n // map (four-byte uint32_t for n, and then n pairs of data items follow)\n MAP_32, // 0xba\n // map (eight-byte uint64_t for n, and then n pairs of data items follow)\n MAP_64, // 0xbb\n ERROR, // 0xbc\n ERROR, // 0xbd\n ERROR, // 0xbe\n // map, pairs of data items follow, terminated by \"break\"\n MAP_BREAK, // 0xbf\n // Text-based date/time (data item follows; see Section 2.4.1)\n TAG_KNOWN, // 0xc0\n // Epoch-based date/time (data item follows; see Section 2.4.1)\n TAG_KNOWN, // 0xc1\n // Positive bignum (data item \"byte string\" follows)\n TAG_KNOWN, // 0xc2\n // Negative bignum (data item \"byte string\" follows)\n TAG_KNOWN, // 0xc3\n // Decimal Fraction (data item \"array\" follows; see Section 2.4.3)\n TAG_KNOWN, // 0xc4\n // Bigfloat (data item \"array\" follows; see Section 2.4.3)\n TAG_KNOWN, // 0xc5\n // (tagged item)\n TAG_UNASSIGNED, // 0xc6\n TAG_UNASSIGNED, // 0xc7\n TAG_UNASSIGNED, // 0xc8\n TAG_UNASSIGNED, // 0xc9\n TAG_UNASSIGNED, // 0xca\n TAG_UNASSIGNED, // 0xcb\n TAG_UNASSIGNED, // 0xcc\n TAG_UNASSIGNED, // 0xcd\n TAG_UNASSIGNED, // 0xce\n TAG_UNASSIGNED, // 0xcf\n TAG_UNASSIGNED, // 0xd0\n TAG_UNASSIGNED, // 0xd1\n TAG_UNASSIGNED, // 0xd2\n TAG_UNASSIGNED, // 0xd3\n TAG_UNASSIGNED, // 0xd4\n // Expected Conversion (data item follows; see Section 2.4.4.2)\n TAG_UNASSIGNED, // 0xd5\n TAG_UNASSIGNED, // 0xd6\n TAG_UNASSIGNED, // 0xd7\n // (more tagged items, 1/2/4/8 bytes and then a data item follow)\n TAG_MORE_1, // 0xd8\n TAG_MORE_2, // 0xd9\n TAG_MORE_4, // 0xda\n TAG_MORE_8, // 0xdb\n ERROR, // 0xdc\n ERROR, // 0xdd\n ERROR, // 0xde\n ERROR, // 0xdf\n // (simple value)\n SIMPLE_UNASSIGNED, // 0xe0\n SIMPLE_UNASSIGNED, // 0xe1\n SIMPLE_UNASSIGNED, // 0xe2\n SIMPLE_UNASSIGNED, // 0xe3\n SIMPLE_UNASSIGNED, // 0xe4\n SIMPLE_UNASSIGNED, // 0xe5\n SIMPLE_UNASSIGNED, // 0xe6\n SIMPLE_UNASSIGNED, // 0xe7\n SIMPLE_UNASSIGNED, // 0xe8\n SIMPLE_UNASSIGNED, // 0xe9\n SIMPLE_UNASSIGNED, // 0xea\n SIMPLE_UNASSIGNED, // 0xeb\n SIMPLE_UNASSIGNED, // 0xec\n SIMPLE_UNASSIGNED, // 0xed\n SIMPLE_UNASSIGNED, // 0xee\n SIMPLE_UNASSIGNED, // 0xef\n SIMPLE_UNASSIGNED, // 0xf0\n SIMPLE_UNASSIGNED, // 0xf1\n SIMPLE_UNASSIGNED, // 0xf2\n SIMPLE_UNASSIGNED, // 0xf3\n // False\n SIMPLE_FALSE, // 0xf4\n // True\n SIMPLE_TRUE, // 0xf5\n // Null\n SIMPLE_NULL, // 0xf6\n // Undefined\n SIMPLE_UNDEFINED, // 0xf7\n // (simple value, one byte follows)\n SIMPLE_BYTE, // 0xf8\n // Half-Precision Float (two-byte IEEE 754)\n SIMPLE_FLOAT_HALF, // 0xf9\n // Single-Precision Float (four-byte IEEE 754)\n SIMPLE_FLOAT_SINGLE, // 0xfa\n // Double-Precision Float (eight-byte IEEE 754)\n SIMPLE_FLOAT_DOUBLE, // 0xfb\n ERROR, // 0xfc\n ERROR, // 0xfd\n ERROR, // 0xfe\n // \"break\" stop code\n BREAK // 0xff\n ]\n\n // --\n\n return {\n parse: parse\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/borc/src/decoder.asm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/decoder.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/borc/src/decoder.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, global) {\n\nconst ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nconst Bignumber = __webpack_require__(/*! bignumber.js */ \"./node_modules/bignumber.js/bignumber.js\")\n\nconst parser = __webpack_require__(/*! ./decoder.asm */ \"./node_modules/borc/src/decoder.asm.js\")\nconst utils = __webpack_require__(/*! ./utils */ \"./node_modules/borc/src/utils.js\")\nconst c = __webpack_require__(/*! ./constants */ \"./node_modules/borc/src/constants.js\")\nconst Simple = __webpack_require__(/*! ./simple */ \"./node_modules/borc/src/simple.js\")\nconst Tagged = __webpack_require__(/*! ./tagged */ \"./node_modules/borc/src/tagged.js\")\nconst { URL } = __webpack_require__(/*! iso-url */ \"./node_modules/iso-url/index.js\")\n\n/**\n * Transform binary cbor data into JavaScript objects.\n */\nclass Decoder {\n /**\n * @param {Object} [opts={}]\n * @param {number} [opts.size=65536] - Size of the allocated heap.\n */\n constructor (opts) {\n opts = opts || {}\n\n if (!opts.size || opts.size < 0x10000) {\n opts.size = 0x10000\n } else {\n // Ensure the size is a power of 2\n opts.size = utils.nextPowerOf2(opts.size)\n }\n\n // Heap use to share the input with the parser\n this._heap = new ArrayBuffer(opts.size)\n this._heap8 = new Uint8Array(this._heap)\n this._buffer = Buffer.from(this._heap)\n\n this._reset()\n\n // Known tags\n this._knownTags = Object.assign({\n 0: (val) => new Date(val),\n 1: (val) => new Date(val * 1000),\n 2: (val) => utils.arrayBufferToBignumber(val),\n 3: (val) => c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),\n 4: (v) => {\n // const v = new Uint8Array(val)\n return c.TEN.pow(v[0]).times(v[1])\n },\n 5: (v) => {\n // const v = new Uint8Array(val)\n return c.TWO.pow(v[0]).times(v[1])\n },\n 32: (val) => new URL(val),\n 35: (val) => new RegExp(val)\n }, opts.tags)\n\n // Initialize asm based parser\n this.parser = parser(global, {\n log: console.log.bind(console),\n pushInt: this.pushInt.bind(this),\n pushInt32: this.pushInt32.bind(this),\n pushInt32Neg: this.pushInt32Neg.bind(this),\n pushInt64: this.pushInt64.bind(this),\n pushInt64Neg: this.pushInt64Neg.bind(this),\n pushFloat: this.pushFloat.bind(this),\n pushFloatSingle: this.pushFloatSingle.bind(this),\n pushFloatDouble: this.pushFloatDouble.bind(this),\n pushTrue: this.pushTrue.bind(this),\n pushFalse: this.pushFalse.bind(this),\n pushUndefined: this.pushUndefined.bind(this),\n pushNull: this.pushNull.bind(this),\n pushInfinity: this.pushInfinity.bind(this),\n pushInfinityNeg: this.pushInfinityNeg.bind(this),\n pushNaN: this.pushNaN.bind(this),\n pushNaNNeg: this.pushNaNNeg.bind(this),\n pushArrayStart: this.pushArrayStart.bind(this),\n pushArrayStartFixed: this.pushArrayStartFixed.bind(this),\n pushArrayStartFixed32: this.pushArrayStartFixed32.bind(this),\n pushArrayStartFixed64: this.pushArrayStartFixed64.bind(this),\n pushObjectStart: this.pushObjectStart.bind(this),\n pushObjectStartFixed: this.pushObjectStartFixed.bind(this),\n pushObjectStartFixed32: this.pushObjectStartFixed32.bind(this),\n pushObjectStartFixed64: this.pushObjectStartFixed64.bind(this),\n pushByteString: this.pushByteString.bind(this),\n pushByteStringStart: this.pushByteStringStart.bind(this),\n pushUtf8String: this.pushUtf8String.bind(this),\n pushUtf8StringStart: this.pushUtf8StringStart.bind(this),\n pushSimpleUnassigned: this.pushSimpleUnassigned.bind(this),\n pushTagUnassigned: this.pushTagUnassigned.bind(this),\n pushTagStart: this.pushTagStart.bind(this),\n pushTagStart4: this.pushTagStart4.bind(this),\n pushTagStart8: this.pushTagStart8.bind(this),\n pushBreak: this.pushBreak.bind(this)\n }, this._heap)\n }\n\n get _depth () {\n return this._parents.length\n }\n\n get _currentParent () {\n return this._parents[this._depth - 1]\n }\n\n get _ref () {\n return this._currentParent.ref\n }\n\n // Finish the current parent\n _closeParent () {\n var p = this._parents.pop()\n\n if (p.length > 0) {\n throw new Error(`Missing ${p.length} elements`)\n }\n\n switch (p.type) {\n case c.PARENT.TAG:\n this._push(\n this.createTag(p.ref[0], p.ref[1])\n )\n break\n case c.PARENT.BYTE_STRING:\n this._push(this.createByteString(p.ref, p.length))\n break\n case c.PARENT.UTF8_STRING:\n this._push(this.createUtf8String(p.ref, p.length))\n break\n case c.PARENT.MAP:\n if (p.values % 2 > 0) {\n throw new Error('Odd number of elements in the map')\n }\n this._push(this.createMap(p.ref, p.length))\n break\n case c.PARENT.OBJECT:\n if (p.values % 2 > 0) {\n throw new Error('Odd number of elements in the map')\n }\n this._push(this.createObject(p.ref, p.length))\n break\n case c.PARENT.ARRAY:\n this._push(this.createArray(p.ref, p.length))\n break\n default:\n break\n }\n\n if (this._currentParent && this._currentParent.type === c.PARENT.TAG) {\n this._dec()\n }\n }\n\n // Reduce the expected length of the current parent by one\n _dec () {\n const p = this._currentParent\n // The current parent does not know the epxected child length\n\n if (p.length < 0) {\n return\n }\n\n p.length--\n\n // All children were seen, we can close the current parent\n if (p.length === 0) {\n this._closeParent()\n }\n }\n\n // Push any value to the current parent\n _push (val, hasChildren) {\n const p = this._currentParent\n p.values++\n\n switch (p.type) {\n case c.PARENT.ARRAY:\n case c.PARENT.BYTE_STRING:\n case c.PARENT.UTF8_STRING:\n if (p.length > -1) {\n this._ref[this._ref.length - p.length] = val\n } else {\n this._ref.push(val)\n }\n this._dec()\n break\n case c.PARENT.OBJECT:\n if (p.tmpKey != null) {\n this._ref[p.tmpKey] = val\n p.tmpKey = null\n this._dec()\n } else {\n p.tmpKey = val\n\n if (typeof p.tmpKey !== 'string') {\n // too bad, convert to a Map\n p.type = c.PARENT.MAP\n p.ref = utils.buildMap(p.ref)\n }\n }\n break\n case c.PARENT.MAP:\n if (p.tmpKey != null) {\n this._ref.set(p.tmpKey, val)\n p.tmpKey = null\n this._dec()\n } else {\n p.tmpKey = val\n }\n break\n case c.PARENT.TAG:\n this._ref.push(val)\n if (!hasChildren) {\n this._dec()\n }\n break\n default:\n throw new Error('Unknown parent type')\n }\n }\n\n // Create a new parent in the parents list\n _createParent (obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n }\n }\n\n // Reset all state back to the beginning, also used for initiatlization\n _reset () {\n this._res = []\n this._parents = [{\n type: c.PARENT.ARRAY,\n length: -1,\n ref: this._res,\n values: 0,\n tmpKey: null\n }]\n }\n\n // -- Interface to customize deoding behaviour\n createTag (tagNumber, value) {\n const typ = this._knownTags[tagNumber]\n\n if (!typ) {\n return new Tagged(tagNumber, value)\n }\n\n return typ(value)\n }\n\n createMap (obj, len) {\n return obj\n }\n\n createObject (obj, len) {\n return obj\n }\n\n createArray (arr, len) {\n return arr\n }\n\n createByteString (raw, len) {\n return Buffer.concat(raw)\n }\n\n createByteStringFromHeap (start, end) {\n if (start === end) {\n return Buffer.alloc(0)\n }\n\n return Buffer.from(this._heap.slice(start, end))\n }\n\n createInt (val) {\n return val\n }\n\n createInt32 (f, g) {\n return utils.buildInt32(f, g)\n }\n\n createInt64 (f1, f2, g1, g2) {\n return utils.buildInt64(f1, f2, g1, g2)\n }\n\n createFloat (val) {\n return val\n }\n\n createFloatSingle (a, b, c, d) {\n return ieee754.read([a, b, c, d], 0, false, 23, 4)\n }\n\n createFloatDouble (a, b, c, d, e, f, g, h) {\n return ieee754.read([a, b, c, d, e, f, g, h], 0, false, 52, 8)\n }\n\n createInt32Neg (f, g) {\n return -1 - utils.buildInt32(f, g)\n }\n\n createInt64Neg (f1, f2, g1, g2) {\n const f = utils.buildInt32(f1, f2)\n const g = utils.buildInt32(g1, g2)\n\n if (f > c.MAX_SAFE_HIGH) {\n return c.NEG_ONE.minus(new Bignumber(f).times(c.SHIFT32).plus(g))\n }\n\n return -1 - ((f * c.SHIFT32) + g)\n }\n\n createTrue () {\n return true\n }\n\n createFalse () {\n return false\n }\n\n createNull () {\n return null\n }\n\n createUndefined () {\n return void 0\n }\n\n createInfinity () {\n return Infinity\n }\n\n createInfinityNeg () {\n return -Infinity\n }\n\n createNaN () {\n return NaN\n }\n\n createNaNNeg () {\n return -NaN\n }\n\n createUtf8String (raw, len) {\n return raw.join('')\n }\n\n createUtf8StringFromHeap (start, end) {\n if (start === end) {\n return ''\n }\n\n return this._buffer.toString('utf8', start, end)\n }\n\n createSimpleUnassigned (val) {\n return new Simple(val)\n }\n\n // -- Interface for decoder.asm.js\n\n pushInt (val) {\n this._push(this.createInt(val))\n }\n\n pushInt32 (f, g) {\n this._push(this.createInt32(f, g))\n }\n\n pushInt64 (f1, f2, g1, g2) {\n this._push(this.createInt64(f1, f2, g1, g2))\n }\n\n pushFloat (val) {\n this._push(this.createFloat(val))\n }\n\n pushFloatSingle (a, b, c, d) {\n this._push(this.createFloatSingle(a, b, c, d))\n }\n\n pushFloatDouble (a, b, c, d, e, f, g, h) {\n this._push(this.createFloatDouble(a, b, c, d, e, f, g, h))\n }\n\n pushInt32Neg (f, g) {\n this._push(this.createInt32Neg(f, g))\n }\n\n pushInt64Neg (f1, f2, g1, g2) {\n this._push(this.createInt64Neg(f1, f2, g1, g2))\n }\n\n pushTrue () {\n this._push(this.createTrue())\n }\n\n pushFalse () {\n this._push(this.createFalse())\n }\n\n pushNull () {\n this._push(this.createNull())\n }\n\n pushUndefined () {\n this._push(this.createUndefined())\n }\n\n pushInfinity () {\n this._push(this.createInfinity())\n }\n\n pushInfinityNeg () {\n this._push(this.createInfinityNeg())\n }\n\n pushNaN () {\n this._push(this.createNaN())\n }\n\n pushNaNNeg () {\n this._push(this.createNaNNeg())\n }\n\n pushArrayStart () {\n this._createParent([], c.PARENT.ARRAY, -1)\n }\n\n pushArrayStartFixed (len) {\n this._createArrayStartFixed(len)\n }\n\n pushArrayStartFixed32 (len1, len2) {\n const len = utils.buildInt32(len1, len2)\n this._createArrayStartFixed(len)\n }\n\n pushArrayStartFixed64 (len1, len2, len3, len4) {\n const len = utils.buildInt64(len1, len2, len3, len4)\n this._createArrayStartFixed(len)\n }\n\n pushObjectStart () {\n this._createObjectStartFixed(-1)\n }\n\n pushObjectStartFixed (len) {\n this._createObjectStartFixed(len)\n }\n\n pushObjectStartFixed32 (len1, len2) {\n const len = utils.buildInt32(len1, len2)\n this._createObjectStartFixed(len)\n }\n\n pushObjectStartFixed64 (len1, len2, len3, len4) {\n const len = utils.buildInt64(len1, len2, len3, len4)\n this._createObjectStartFixed(len)\n }\n\n pushByteStringStart () {\n this._parents[this._depth] = {\n type: c.PARENT.BYTE_STRING,\n length: -1,\n ref: [],\n values: 0,\n tmpKey: null\n }\n }\n\n pushByteString (start, end) {\n this._push(this.createByteStringFromHeap(start, end))\n }\n\n pushUtf8StringStart () {\n this._parents[this._depth] = {\n type: c.PARENT.UTF8_STRING,\n length: -1,\n ref: [],\n values: 0,\n tmpKey: null\n }\n }\n\n pushUtf8String (start, end) {\n this._push(this.createUtf8StringFromHeap(start, end))\n }\n\n pushSimpleUnassigned (val) {\n this._push(this.createSimpleUnassigned(val))\n }\n\n pushTagStart (tag) {\n this._parents[this._depth] = {\n type: c.PARENT.TAG,\n length: 1,\n ref: [tag]\n }\n }\n\n pushTagStart4 (f, g) {\n this.pushTagStart(utils.buildInt32(f, g))\n }\n\n pushTagStart8 (f1, f2, g1, g2) {\n this.pushTagStart(utils.buildInt64(f1, f2, g1, g2))\n }\n\n pushTagUnassigned (tagNumber) {\n this._push(this.createTag(tagNumber))\n }\n\n pushBreak () {\n if (this._currentParent.length > -1) {\n throw new Error('Unexpected break')\n }\n\n this._closeParent()\n }\n\n _createObjectStartFixed (len) {\n if (len === 0) {\n this._push(this.createObject({}))\n return\n }\n\n this._createParent({}, c.PARENT.OBJECT, len)\n }\n\n _createArrayStartFixed (len) {\n if (len === 0) {\n this._push(this.createArray([]))\n return\n }\n\n this._createParent(new Array(len), c.PARENT.ARRAY, len)\n }\n\n _decode (input) {\n if (input.byteLength === 0) {\n throw new Error('Input too short')\n }\n\n this._reset()\n this._heap8.set(input)\n const code = this.parser.parse(input.byteLength)\n\n if (this._depth > 1) {\n while (this._currentParent.length === 0) {\n this._closeParent()\n }\n if (this._depth > 1) {\n throw new Error('Undeterminated nesting')\n }\n }\n\n if (code > 0) {\n throw new Error('Failed to parse')\n }\n\n if (this._res.length === 0) {\n throw new Error('No valid result')\n }\n }\n\n // -- Public Interface\n\n decodeFirst (input) {\n this._decode(input)\n\n return this._res[0]\n }\n\n decodeAll (input) {\n this._decode(input)\n\n return this._res\n }\n\n /**\n * Decode the first cbor object.\n *\n * @param {Buffer|string} input\n * @param {string} [enc='hex'] - Encoding used if a string is passed.\n * @returns {*}\n */\n static decode (input, enc) {\n if (typeof input === 'string') {\n input = Buffer.from(input, enc || 'hex')\n }\n\n const dec = new Decoder({ size: input.length })\n return dec.decodeFirst(input)\n }\n\n /**\n * Decode all cbor objects.\n *\n * @param {Buffer|string} input\n * @param {string} [enc='hex'] - Encoding used if a string is passed.\n * @returns {Array<*>}\n */\n static decodeAll (input, enc) {\n if (typeof input === 'string') {\n input = Buffer.from(input, enc || 'hex')\n }\n\n const dec = new Decoder({ size: input.length })\n return dec.decodeAll(input)\n }\n}\n\nDecoder.decodeFirst = Decoder.decode\n\nmodule.exports = Decoder\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/borc/src/decoder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/diagnose.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/borc/src/diagnose.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Decoder = __webpack_require__(/*! ./decoder */ \"./node_modules/borc/src/decoder.js\")\nconst utils = __webpack_require__(/*! ./utils */ \"./node_modules/borc/src/utils.js\")\n\n/**\n * Output the diagnostic format from a stream of CBOR bytes.\n *\n */\nclass Diagnose extends Decoder {\n createTag (tagNumber, value) {\n return `${tagNumber}(${value})`\n }\n\n createInt (val) {\n return super.createInt(val).toString()\n }\n\n createInt32 (f, g) {\n return super.createInt32(f, g).toString()\n }\n\n createInt64 (f1, f2, g1, g2) {\n return super.createInt64(f1, f2, g1, g2).toString()\n }\n\n createInt32Neg (f, g) {\n return super.createInt32Neg(f, g).toString()\n }\n\n createInt64Neg (f1, f2, g1, g2) {\n return super.createInt64Neg(f1, f2, g1, g2).toString()\n }\n\n createTrue () {\n return 'true'\n }\n\n createFalse () {\n return 'false'\n }\n\n createFloat (val) {\n const fl = super.createFloat(val)\n if (utils.isNegativeZero(val)) {\n return '-0_1'\n }\n\n return `${fl}_1`\n }\n\n createFloatSingle (a, b, c, d) {\n const fl = super.createFloatSingle(a, b, c, d)\n return `${fl}_2`\n }\n\n createFloatDouble (a, b, c, d, e, f, g, h) {\n const fl = super.createFloatDouble(a, b, c, d, e, f, g, h)\n return `${fl}_3`\n }\n\n createByteString (raw, len) {\n const val = raw.join(', ')\n\n if (len === -1) {\n return `(_ ${val})`\n }\n return `h'${val}`\n }\n\n createByteStringFromHeap (start, end) {\n const val = (Buffer.from(\n super.createByteStringFromHeap(start, end)\n )).toString('hex')\n\n return `h'${val}'`\n }\n\n createInfinity () {\n return 'Infinity_1'\n }\n\n createInfinityNeg () {\n return '-Infinity_1'\n }\n\n createNaN () {\n return 'NaN_1'\n }\n\n createNaNNeg () {\n return '-NaN_1'\n }\n\n createNull () {\n return 'null'\n }\n\n createUndefined () {\n return 'undefined'\n }\n\n createSimpleUnassigned (val) {\n return `simple(${val})`\n }\n\n createArray (arr, len) {\n const val = super.createArray(arr, len)\n\n if (len === -1) {\n // indefinite\n return `[_ ${val.join(', ')}]`\n }\n\n return `[${val.join(', ')}]`\n }\n\n createMap (map, len) {\n const val = super.createMap(map)\n const list = Array.from(val.keys())\n .reduce(collectObject(val), '')\n\n if (len === -1) {\n return `{_ ${list}}`\n }\n\n return `{${list}}`\n }\n\n createObject (obj, len) {\n const val = super.createObject(obj)\n const map = Object.keys(val)\n .reduce(collectObject(val), '')\n\n if (len === -1) {\n return `{_ ${map}}`\n }\n\n return `{${map}}`\n }\n\n createUtf8String (raw, len) {\n const val = raw.join(', ')\n\n if (len === -1) {\n return `(_ ${val})`\n }\n\n return `\"${val}\"`\n }\n\n createUtf8StringFromHeap (start, end) {\n const val = (Buffer.from(\n super.createUtf8StringFromHeap(start, end)\n )).toString('utf8')\n\n return `\"${val}\"`\n }\n\n static diagnose (input, enc) {\n if (typeof input === 'string') {\n input = Buffer.from(input, enc || 'hex')\n }\n\n const dec = new Diagnose()\n return dec.decodeFirst(input)\n }\n}\n\nmodule.exports = Diagnose\n\nfunction collectObject (val) {\n return (acc, key) => {\n if (acc) {\n return `${acc}, ${key}: ${val[key]}`\n }\n return `${key}: ${val[key]}`\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/borc/src/diagnose.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/encoder.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/borc/src/encoder.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst { URL } = __webpack_require__(/*! iso-url */ \"./node_modules/iso-url/index.js\")\nconst Bignumber = __webpack_require__(/*! bignumber.js */ \"./node_modules/bignumber.js/bignumber.js\")\n\nconst utils = __webpack_require__(/*! ./utils */ \"./node_modules/borc/src/utils.js\")\nconst constants = __webpack_require__(/*! ./constants */ \"./node_modules/borc/src/constants.js\")\nconst MT = constants.MT\nconst NUMBYTES = constants.NUMBYTES\nconst SHIFT32 = constants.SHIFT32\nconst SYMS = constants.SYMS\nconst TAG = constants.TAG\nconst HALF = (constants.MT.SIMPLE_FLOAT << 5) | constants.NUMBYTES.TWO\nconst FLOAT = (constants.MT.SIMPLE_FLOAT << 5) | constants.NUMBYTES.FOUR\nconst DOUBLE = (constants.MT.SIMPLE_FLOAT << 5) | constants.NUMBYTES.EIGHT\nconst TRUE = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.TRUE\nconst FALSE = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.FALSE\nconst UNDEFINED = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.UNDEFINED\nconst NULL = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.NULL\n\nconst MAXINT_BN = new Bignumber('0x20000000000000')\nconst BUF_NAN = Buffer.from('f97e00', 'hex')\nconst BUF_INF_NEG = Buffer.from('f9fc00', 'hex')\nconst BUF_INF_POS = Buffer.from('f97c00', 'hex')\n\nfunction toType (obj) {\n // [object Type]\n // --------8---1\n return ({}).toString.call(obj).slice(8, -1)\n}\n\n/**\n * Transform JavaScript values into CBOR bytes\n *\n */\nclass Encoder {\n /**\n * @param {Object} [options={}]\n * @param {function(Buffer)} options.stream\n */\n constructor (options) {\n options = options || {}\n\n this.streaming = typeof options.stream === 'function'\n this.onData = options.stream\n\n this.semanticTypes = [\n [URL, this._pushUrl],\n [Bignumber, this._pushBigNumber]\n ]\n\n const addTypes = options.genTypes || []\n const len = addTypes.length\n for (let i = 0; i < len; i++) {\n this.addSemanticType(\n addTypes[i][0],\n addTypes[i][1]\n )\n }\n\n this._reset()\n }\n\n addSemanticType (type, fun) {\n const len = this.semanticTypes.length\n for (let i = 0; i < len; i++) {\n const typ = this.semanticTypes[i][0]\n if (typ === type) {\n const old = this.semanticTypes[i][1]\n this.semanticTypes[i][1] = fun\n return old\n }\n }\n this.semanticTypes.push([type, fun])\n return null\n }\n\n push (val) {\n if (!val) {\n return true\n }\n\n this.result[this.offset] = val\n this.resultMethod[this.offset] = 0\n this.resultLength[this.offset] = val.length\n this.offset++\n\n if (this.streaming) {\n this.onData(this.finalize())\n }\n\n return true\n }\n\n pushWrite (val, method, len) {\n this.result[this.offset] = val\n this.resultMethod[this.offset] = method\n this.resultLength[this.offset] = len\n this.offset++\n\n if (this.streaming) {\n this.onData(this.finalize())\n }\n\n return true\n }\n\n _pushUInt8 (val) {\n return this.pushWrite(val, 1, 1)\n }\n\n _pushUInt16BE (val) {\n return this.pushWrite(val, 2, 2)\n }\n\n _pushUInt32BE (val) {\n return this.pushWrite(val, 3, 4)\n }\n\n _pushDoubleBE (val) {\n return this.pushWrite(val, 4, 8)\n }\n\n _pushNaN () {\n return this.push(BUF_NAN)\n }\n\n _pushInfinity (obj) {\n const half = (obj < 0) ? BUF_INF_NEG : BUF_INF_POS\n return this.push(half)\n }\n\n _pushFloat (obj) {\n const b2 = Buffer.allocUnsafe(2)\n\n if (utils.writeHalf(b2, obj)) {\n if (utils.parseHalf(b2) === obj) {\n return this._pushUInt8(HALF) && this.push(b2)\n }\n }\n\n const b4 = Buffer.allocUnsafe(4)\n b4.writeFloatBE(obj, 0)\n if (b4.readFloatBE(0) === obj) {\n return this._pushUInt8(FLOAT) && this.push(b4)\n }\n\n return this._pushUInt8(DOUBLE) && this._pushDoubleBE(obj)\n }\n\n _pushInt (obj, mt, orig) {\n const m = mt << 5\n if (obj < 24) {\n return this._pushUInt8(m | obj)\n }\n\n if (obj <= 0xff) {\n return this._pushUInt8(m | NUMBYTES.ONE) && this._pushUInt8(obj)\n }\n\n if (obj <= 0xffff) {\n return this._pushUInt8(m | NUMBYTES.TWO) && this._pushUInt16BE(obj)\n }\n\n if (obj <= 0xffffffff) {\n return this._pushUInt8(m | NUMBYTES.FOUR) && this._pushUInt32BE(obj)\n }\n\n if (obj <= Number.MAX_SAFE_INTEGER) {\n return this._pushUInt8(m | NUMBYTES.EIGHT) &&\n this._pushUInt32BE(Math.floor(obj / SHIFT32)) &&\n this._pushUInt32BE(obj % SHIFT32)\n }\n\n if (mt === MT.NEG_INT) {\n return this._pushFloat(orig)\n }\n\n return this._pushFloat(obj)\n }\n\n _pushIntNum (obj) {\n if (obj < 0) {\n return this._pushInt(-obj - 1, MT.NEG_INT, obj)\n } else {\n return this._pushInt(obj, MT.POS_INT)\n }\n }\n\n _pushNumber (obj) {\n switch (false) {\n case (obj === obj): // eslint-disable-line\n return this._pushNaN(obj)\n case isFinite(obj):\n return this._pushInfinity(obj)\n case ((obj % 1) !== 0):\n return this._pushIntNum(obj)\n default:\n return this._pushFloat(obj)\n }\n }\n\n _pushString (obj) {\n const len = Buffer.byteLength(obj, 'utf8')\n return this._pushInt(len, MT.UTF8_STRING) && this.pushWrite(obj, 5, len)\n }\n\n _pushBoolean (obj) {\n return this._pushUInt8(obj ? TRUE : FALSE)\n }\n\n _pushUndefined (obj) {\n return this._pushUInt8(UNDEFINED)\n }\n\n _pushArray (gen, obj) {\n const len = obj.length\n if (!gen._pushInt(len, MT.ARRAY)) {\n return false\n }\n for (let j = 0; j < len; j++) {\n if (!gen.pushAny(obj[j])) {\n return false\n }\n }\n return true\n }\n\n _pushTag (tag) {\n return this._pushInt(tag, MT.TAG)\n }\n\n _pushDate (gen, obj) {\n // Round date, to get seconds since 1970-01-01 00:00:00 as defined in\n // Sec. 2.4.1 and get a possibly more compact encoding. Note that it is\n // still allowed to encode fractions of seconds which can be achieved by\n // changing overwriting the encode function for Date objects.\n return gen._pushTag(TAG.DATE_EPOCH) && gen.pushAny(Math.round(obj / 1000))\n }\n\n _pushBuffer (gen, obj) {\n return gen._pushInt(obj.length, MT.BYTE_STRING) && gen.push(obj)\n }\n\n _pushNoFilter (gen, obj) {\n return gen._pushBuffer(gen, obj.slice())\n }\n\n _pushRegexp (gen, obj) {\n return gen._pushTag(TAG.REGEXP) && gen.pushAny(obj.source)\n }\n\n _pushSet (gen, obj) {\n if (!gen._pushInt(obj.size, MT.ARRAY)) {\n return false\n }\n for (let x of obj) {\n if (!gen.pushAny(x)) {\n return false\n }\n }\n return true\n }\n\n _pushUrl (gen, obj) {\n return gen._pushTag(TAG.URI) && gen.pushAny(obj.format())\n }\n\n _pushBigint (obj) {\n let tag = TAG.POS_BIGINT\n if (obj.isNegative()) {\n obj = obj.negated().minus(1)\n tag = TAG.NEG_BIGINT\n }\n let str = obj.toString(16)\n if (str.length % 2) {\n str = '0' + str\n }\n const buf = Buffer.from(str, 'hex')\n return this._pushTag(tag) && this._pushBuffer(this, buf)\n }\n\n _pushBigNumber (gen, obj) {\n if (obj.isNaN()) {\n return gen._pushNaN()\n }\n if (!obj.isFinite()) {\n return gen._pushInfinity(obj.isNegative() ? -Infinity : Infinity)\n }\n if (obj.isInteger()) {\n return gen._pushBigint(obj)\n }\n if (!(gen._pushTag(TAG.DECIMAL_FRAC) &&\n gen._pushInt(2, MT.ARRAY))) {\n return false\n }\n\n const dec = obj.decimalPlaces()\n const slide = obj.multipliedBy(new Bignumber(10).pow(dec))\n if (!gen._pushIntNum(-dec)) {\n return false\n }\n if (slide.abs().isLessThan(MAXINT_BN)) {\n return gen._pushIntNum(slide.toNumber())\n } else {\n return gen._pushBigint(slide)\n }\n }\n\n _pushMap (gen, obj) {\n if (!gen._pushInt(obj.size, MT.MAP)) {\n return false\n }\n\n return this._pushRawMap(\n obj.size,\n Array.from(obj)\n )\n }\n\n _pushObject (obj) {\n if (!obj) {\n return this._pushUInt8(NULL)\n }\n\n var len = this.semanticTypes.length\n for (var i = 0; i < len; i++) {\n if (obj instanceof this.semanticTypes[i][0]) {\n return this.semanticTypes[i][1].call(obj, this, obj)\n }\n }\n\n var f = obj.encodeCBOR\n if (typeof f === 'function') {\n return f.call(obj, this)\n }\n\n var keys = Object.keys(obj)\n var keyLength = keys.length\n if (!this._pushInt(keyLength, MT.MAP)) {\n return false\n }\n\n return this._pushRawMap(\n keyLength,\n keys.map((k) => [k, obj[k]])\n )\n }\n\n _pushRawMap (len, map) {\n // Sort keys for canoncialization\n // 1. encode key\n // 2. shorter key comes before longer key\n // 3. same length keys are sorted with lower\n // byte value before higher\n\n map = map.map(function (a) {\n a[0] = Encoder.encode(a[0])\n return a\n }).sort(utils.keySorter)\n\n for (var j = 0; j < len; j++) {\n if (!this.push(map[j][0])) {\n return false\n }\n\n if (!this.pushAny(map[j][1])) {\n return false\n }\n }\n\n return true\n }\n\n /**\n * Alias for `.pushAny`\n *\n * @param {*} obj\n * @returns {boolean} true on success\n */\n write (obj) {\n return this.pushAny(obj)\n }\n\n /**\n * Push any supported type onto the encoded stream\n *\n * @param {any} obj\n * @returns {boolean} true on success\n */\n pushAny (obj) {\n var typ = toType(obj)\n\n switch (typ) {\n case 'Number':\n return this._pushNumber(obj)\n case 'String':\n return this._pushString(obj)\n case 'Boolean':\n return this._pushBoolean(obj)\n case 'Object':\n return this._pushObject(obj)\n case 'Array':\n return this._pushArray(this, obj)\n case 'Uint8Array':\n return this._pushBuffer(this, Buffer.isBuffer(obj) ? obj : Buffer.from(obj))\n case 'Null':\n return this._pushUInt8(NULL)\n case 'Undefined':\n return this._pushUndefined(obj)\n case 'Map':\n return this._pushMap(this, obj)\n case 'Set':\n return this._pushSet(this, obj)\n case 'URL':\n return this._pushUrl(this, obj)\n case 'BigNumber':\n return this._pushBigNumber(this, obj)\n case 'Date':\n return this._pushDate(this, obj)\n case 'RegExp':\n return this._pushRegexp(this, obj)\n case 'Symbol':\n switch (obj) {\n case SYMS.NULL:\n return this._pushObject(null)\n case SYMS.UNDEFINED:\n return this._pushUndefined(void 0)\n // TODO: Add pluggable support for other symbols\n default:\n throw new Error('Unknown symbol: ' + obj.toString())\n }\n default:\n throw new Error('Unknown type: ' + typeof obj + ', ' + (obj ? obj.toString() : ''))\n }\n }\n\n finalize () {\n if (this.offset === 0) {\n return null\n }\n\n var result = this.result\n var resultLength = this.resultLength\n var resultMethod = this.resultMethod\n var offset = this.offset\n\n // Determine the size of the buffer\n var size = 0\n var i = 0\n\n for (; i < offset; i++) {\n size += resultLength[i]\n }\n\n var res = Buffer.allocUnsafe(size)\n var index = 0\n var length = 0\n\n // Write the content into the result buffer\n for (i = 0; i < offset; i++) {\n length = resultLength[i]\n\n switch (resultMethod[i]) {\n case 0:\n result[i].copy(res, index)\n break\n case 1:\n res.writeUInt8(result[i], index, true)\n break\n case 2:\n res.writeUInt16BE(result[i], index, true)\n break\n case 3:\n res.writeUInt32BE(result[i], index, true)\n break\n case 4:\n res.writeDoubleBE(result[i], index, true)\n break\n case 5:\n res.write(result[i], index, length, 'utf8')\n break\n default:\n throw new Error('unkown method')\n }\n\n index += length\n }\n\n var tmp = res\n\n this._reset()\n\n return tmp\n }\n\n _reset () {\n this.result = []\n this.resultMethod = []\n this.resultLength = []\n this.offset = 0\n }\n\n /**\n * Encode the given value\n * @param {*} o\n * @returns {Buffer}\n */\n static encode (o) {\n const enc = new Encoder()\n const ret = enc.pushAny(o)\n if (!ret) {\n throw new Error('Failed to encode input')\n }\n\n return enc.finalize()\n }\n}\n\nmodule.exports = Encoder\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/borc/src/encoder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/borc/src/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// exports.Commented = require('./commented')\nexports.Diagnose = __webpack_require__(/*! ./diagnose */ \"./node_modules/borc/src/diagnose.js\")\nexports.Decoder = __webpack_require__(/*! ./decoder */ \"./node_modules/borc/src/decoder.js\")\nexports.Encoder = __webpack_require__(/*! ./encoder */ \"./node_modules/borc/src/encoder.js\")\nexports.Simple = __webpack_require__(/*! ./simple */ \"./node_modules/borc/src/simple.js\")\nexports.Tagged = __webpack_require__(/*! ./tagged */ \"./node_modules/borc/src/tagged.js\")\n\n// exports.comment = exports.Commented.comment\nexports.decodeAll = exports.Decoder.decodeAll\nexports.decodeFirst = exports.Decoder.decodeFirst\nexports.diagnose = exports.Diagnose.diagnose\nexports.encode = exports.Encoder.encode\nexports.decode = exports.Decoder.decode\n\nexports.leveldb = {\n decode: exports.Decoder.decodeAll,\n encode: exports.Encoder.encode,\n buffer: true,\n name: 'cbor'\n}\n\n\n//# sourceURL=webpack:///./node_modules/borc/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/simple.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/borc/src/simple.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst constants = __webpack_require__(/*! ./constants */ \"./node_modules/borc/src/constants.js\")\nconst MT = constants.MT\nconst SIMPLE = constants.SIMPLE\nconst SYMS = constants.SYMS\n\n/**\n * A CBOR Simple Value that does not map onto a known constant.\n */\nclass Simple {\n /**\n * Creates an instance of Simple.\n *\n * @param {integer} value - the simple value's integer value\n */\n constructor (value) {\n if (typeof value !== 'number') {\n throw new Error('Invalid Simple type: ' + (typeof value))\n }\n if ((value < 0) || (value > 255) || ((value | 0) !== value)) {\n throw new Error('value must be a small positive integer: ' + value)\n }\n this.value = value\n }\n\n /**\n * Debug string for simple value\n *\n * @returns {string} simple(value)\n */\n toString () {\n return 'simple(' + this.value + ')'\n }\n\n /**\n * Debug string for simple value\n *\n * @returns {string} simple(value)\n */\n inspect () {\n return 'simple(' + this.value + ')'\n }\n\n /**\n * Push the simple value onto the CBOR stream\n *\n * @param {cbor.Encoder} gen The generator to push onto\n * @returns {number}\n */\n encodeCBOR (gen) {\n return gen._pushInt(this.value, MT.SIMPLE_FLOAT)\n }\n\n /**\n * Is the given object a Simple?\n *\n * @param {any} obj - object to test\n * @returns {bool} - is it Simple?\n */\n static isSimple (obj) {\n return obj instanceof Simple\n }\n\n /**\n * Decode from the CBOR additional information into a JavaScript value.\n * If the CBOR item has no parent, return a \"safe\" symbol instead of\n * `null` or `undefined`, so that the value can be passed through a\n * stream in object mode.\n *\n * @param {Number} val - the CBOR additional info to convert\n * @param {bool} hasParent - Does the CBOR item have a parent?\n * @returns {(null|undefined|Boolean|Symbol)} - the decoded value\n */\n static decode (val, hasParent) {\n if (hasParent == null) {\n hasParent = true\n }\n switch (val) {\n case SIMPLE.FALSE:\n return false\n case SIMPLE.TRUE:\n return true\n case SIMPLE.NULL:\n if (hasParent) {\n return null\n } else {\n return SYMS.NULL\n }\n case SIMPLE.UNDEFINED:\n if (hasParent) {\n return void 0\n } else {\n return SYMS.UNDEFINED\n }\n case -1:\n if (!hasParent) {\n throw new Error('Invalid BREAK')\n }\n return SYMS.BREAK\n default:\n return new Simple(val)\n }\n }\n}\n\nmodule.exports = Simple\n\n\n//# sourceURL=webpack:///./node_modules/borc/src/simple.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/tagged.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/borc/src/tagged.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * A CBOR tagged item, where the tag does not have semantics specified at the\n * moment, or those semantics threw an error during parsing. Typically this will\n * be an extension point you're not yet expecting.\n */\nclass Tagged {\n /**\n * Creates an instance of Tagged.\n *\n * @param {Number} tag - the number of the tag\n * @param {any} value - the value inside the tag\n * @param {Error} err - the error that was thrown parsing the tag, or null\n */\n constructor (tag, value, err) {\n this.tag = tag\n this.value = value\n this.err = err\n if (typeof this.tag !== 'number') {\n throw new Error('Invalid tag type (' + (typeof this.tag) + ')')\n }\n if ((this.tag < 0) || ((this.tag | 0) !== this.tag)) {\n throw new Error('Tag must be a positive integer: ' + this.tag)\n }\n }\n\n /**\n * Convert to a String\n *\n * @returns {String} string of the form '1(2)'\n */\n toString () {\n return `${this.tag}(${JSON.stringify(this.value)})`\n }\n\n /**\n * Push the simple value onto the CBOR stream\n *\n * @param {cbor.Encoder} gen The generator to push onto\n * @returns {number}\n */\n encodeCBOR (gen) {\n gen._pushTag(this.tag)\n return gen.pushAny(this.value)\n }\n\n /**\n * If we have a converter for this type, do the conversion. Some converters\n * are built-in. Additional ones can be passed in. If you want to remove\n * a built-in converter, pass a converter in whose value is 'null' instead\n * of a function.\n *\n * @param {Object} converters - keys in the object are a tag number, the value\n * is a function that takes the decoded CBOR and returns a JavaScript value\n * of the appropriate type. Throw an exception in the function on errors.\n * @returns {any} - the converted item\n */\n convert (converters) {\n var er, f\n f = converters != null ? converters[this.tag] : void 0\n if (typeof f !== 'function') {\n f = Tagged['_tag' + this.tag]\n if (typeof f !== 'function') {\n return this\n }\n }\n try {\n return f.call(Tagged, this.value)\n } catch (error) {\n er = error\n this.err = er\n return this\n }\n }\n}\n\nmodule.exports = Tagged\n\n\n//# sourceURL=webpack:///./node_modules/borc/src/tagged.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/borc/src/utils.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/borc/src/utils.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Bignumber = __webpack_require__(/*! bignumber.js */ \"./node_modules/bignumber.js/bignumber.js\")\n\nconst constants = __webpack_require__(/*! ./constants */ \"./node_modules/borc/src/constants.js\")\nconst SHIFT32 = constants.SHIFT32\nconst SHIFT16 = constants.SHIFT16\nconst MAX_SAFE_HIGH = 0x1fffff\n\nexports.parseHalf = function parseHalf (buf) {\n var exp, mant, sign\n sign = buf[0] & 0x80 ? -1 : 1\n exp = (buf[0] & 0x7C) >> 2\n mant = ((buf[0] & 0x03) << 8) | buf[1]\n if (!exp) {\n return sign * 5.9604644775390625e-8 * mant\n } else if (exp === 0x1f) {\n return sign * (mant ? 0 / 0 : 2e308)\n } else {\n return sign * Math.pow(2, exp - 25) * (1024 + mant)\n }\n}\n\nfunction toHex (n) {\n if (n < 16) {\n return '0' + n.toString(16)\n }\n\n return n.toString(16)\n}\n\nexports.arrayBufferToBignumber = function (buf) {\n const len = buf.byteLength\n let res = ''\n for (let i = 0; i < len; i++) {\n res += toHex(buf[i])\n }\n\n return new Bignumber(res, 16)\n}\n\n// convert an Object into a Map\nexports.buildMap = (obj) => {\n const res = new Map()\n const keys = Object.keys(obj)\n const length = keys.length\n for (let i = 0; i < length; i++) {\n res.set(keys[i], obj[keys[i]])\n }\n return res\n}\n\nexports.buildInt32 = (f, g) => {\n return f * SHIFT16 + g\n}\n\nexports.buildInt64 = (f1, f2, g1, g2) => {\n const f = exports.buildInt32(f1, f2)\n const g = exports.buildInt32(g1, g2)\n\n if (f > MAX_SAFE_HIGH) {\n return new Bignumber(f).times(SHIFT32).plus(g)\n } else {\n return (f * SHIFT32) + g\n }\n}\n\nexports.writeHalf = function writeHalf (buf, half) {\n // assume 0, -0, NaN, Infinity, and -Infinity have already been caught\n\n // HACK: everyone settle in. This isn't going to be pretty.\n // Translate cn-cbor's C code (from Carsten Borman):\n\n // uint32_t be32;\n // uint16_t be16, u16;\n // union {\n // float f;\n // uint32_t u;\n // } u32;\n // u32.f = float_val;\n\n const u32 = Buffer.allocUnsafe(4)\n u32.writeFloatBE(half, 0)\n const u = u32.readUInt32BE(0)\n\n // if ((u32.u & 0x1FFF) == 0) { /* worth trying half */\n\n // hildjj: If the lower 13 bits are 0, we won't lose anything in the conversion\n if ((u & 0x1FFF) !== 0) {\n return false\n }\n\n // int s16 = (u32.u >> 16) & 0x8000;\n // int exp = (u32.u >> 23) & 0xff;\n // int mant = u32.u & 0x7fffff;\n\n var s16 = (u >> 16) & 0x8000 // top bit is sign\n const exp = (u >> 23) & 0xff // then 5 bits of exponent\n const mant = u & 0x7fffff\n\n // if (exp == 0 && mant == 0)\n // ; /* 0.0, -0.0 */\n\n // hildjj: zeros already handled. Assert if you don't believe me.\n\n // else if (exp >= 113 && exp <= 142) /* normalized */\n // s16 += ((exp - 112) << 10) + (mant >> 13);\n if ((exp >= 113) && (exp <= 142)) {\n s16 += ((exp - 112) << 10) + (mant >> 13)\n\n // else if (exp >= 103 && exp < 113) { /* denorm, exp16 = 0 */\n // if (mant & ((1 << (126 - exp)) - 1))\n // goto float32; /* loss of precision */\n // s16 += ((mant + 0x800000) >> (126 - exp));\n } else if ((exp >= 103) && (exp < 113)) {\n if (mant & ((1 << (126 - exp)) - 1)) {\n return false\n }\n s16 += ((mant + 0x800000) >> (126 - exp))\n\n // } else if (exp == 255 && mant == 0) { /* Inf */\n // s16 += 0x7c00;\n\n // hildjj: Infinity already handled\n\n // } else\n // goto float32; /* loss of range */\n } else {\n return false\n }\n\n // ensure_writable(3);\n // u16 = s16;\n // be16 = hton16p((const uint8_t*)&u16);\n buf.writeUInt16BE(s16, 0)\n return true\n}\n\nexports.keySorter = function (a, b) {\n var lenA = a[0].byteLength\n var lenB = b[0].byteLength\n\n if (lenA > lenB) {\n return 1\n }\n\n if (lenB > lenA) {\n return -1\n }\n\n return a[0].compare(b[0])\n}\n\n// Adapted from http://www.2ality.com/2012/03/signedzero.html\nexports.isNegativeZero = (x) => {\n return x === 0 && (1 / x < 0)\n}\n\nexports.nextPowerOf2 = (n) => {\n let count = 0\n // First n in the below condition is for\n // the case where n is 0\n if (n && !(n & (n - 1))) {\n return n\n }\n\n while (n !== 0) {\n n >>= 1\n count += 1\n }\n\n return 1 << count\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/borc/src/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/browserify-zlib/lib/binding.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/browserify-zlib/lib/binding.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {\n/* eslint camelcase: \"off\" */\n\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\n\nvar Zstream = __webpack_require__(/*! pako/lib/zlib/zstream */ \"./node_modules/pako/lib/zlib/zstream.js\");\nvar zlib_deflate = __webpack_require__(/*! pako/lib/zlib/deflate.js */ \"./node_modules/pako/lib/zlib/deflate.js\");\nvar zlib_inflate = __webpack_require__(/*! pako/lib/zlib/inflate.js */ \"./node_modules/pako/lib/zlib/inflate.js\");\nvar constants = __webpack_require__(/*! pako/lib/zlib/constants */ \"./node_modules/pako/lib/zlib/constants.js\");\n\nfor (var key in constants) {\n exports[key] = constants[key];\n}\n\n// zlib modes\nexports.NONE = 0;\nexports.DEFLATE = 1;\nexports.INFLATE = 2;\nexports.GZIP = 3;\nexports.GUNZIP = 4;\nexports.DEFLATERAW = 5;\nexports.INFLATERAW = 6;\nexports.UNZIP = 7;\n\nvar GZIP_HEADER_ID1 = 0x1f;\nvar GZIP_HEADER_ID2 = 0x8b;\n\n/**\n * Emulate Node's zlib C++ layer for use by the JS layer in index.js\n */\nfunction Zlib(mode) {\n if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) {\n throw new TypeError('Bad argument');\n }\n\n this.dictionary = null;\n this.err = 0;\n this.flush = 0;\n this.init_done = false;\n this.level = 0;\n this.memLevel = 0;\n this.mode = mode;\n this.strategy = 0;\n this.windowBits = 0;\n this.write_in_progress = false;\n this.pending_close = false;\n this.gzip_id_bytes_read = 0;\n}\n\nZlib.prototype.close = function () {\n if (this.write_in_progress) {\n this.pending_close = true;\n return;\n }\n\n this.pending_close = false;\n\n assert(this.init_done, 'close before init');\n assert(this.mode <= exports.UNZIP);\n\n if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {\n zlib_deflate.deflateEnd(this.strm);\n } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) {\n zlib_inflate.inflateEnd(this.strm);\n }\n\n this.mode = exports.NONE;\n\n this.dictionary = null;\n};\n\nZlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) {\n assert.equal(arguments.length, 8);\n\n assert(this.init_done, 'write before init');\n assert(this.mode !== exports.NONE, 'already finalized');\n assert.equal(false, this.write_in_progress, 'write already in progress');\n assert.equal(false, this.pending_close, 'close is pending');\n\n this.write_in_progress = true;\n\n assert.equal(false, flush === undefined, 'must provide flush value');\n\n this.write_in_progress = true;\n\n if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) {\n throw new Error('Invalid flush value');\n }\n\n if (input == null) {\n input = Buffer.alloc(0);\n in_len = 0;\n in_off = 0;\n }\n\n this.strm.avail_in = in_len;\n this.strm.input = input;\n this.strm.next_in = in_off;\n this.strm.avail_out = out_len;\n this.strm.output = out;\n this.strm.next_out = out_off;\n this.flush = flush;\n\n if (!async) {\n // sync version\n this._process();\n\n if (this._checkError()) {\n return this._afterSync();\n }\n return;\n }\n\n // async version\n var self = this;\n process.nextTick(function () {\n self._process();\n self._after();\n });\n\n return this;\n};\n\nZlib.prototype._afterSync = function () {\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n\n this.write_in_progress = false;\n\n return [avail_in, avail_out];\n};\n\nZlib.prototype._process = function () {\n var next_expected_header_byte = null;\n\n // If the avail_out is left at 0, then it means that it ran out\n // of room. If there was avail_out left over, then it means\n // that all of the input was consumed.\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0) {\n next_expected_header_byte = this.strm.next_in;\n }\n\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n this.gzip_id_bytes_read = 1;\n next_expected_header_byte++;\n\n if (this.strm.avail_in === 1) {\n // The only available byte was already read.\n break;\n }\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n\n // fallthrough\n case 1:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {\n this.gzip_id_bytes_read = 2;\n this.mode = exports.GUNZIP;\n } else {\n // There is no actual difference between INFLATE and INFLATERAW\n // (after initialization).\n this.mode = exports.INFLATE;\n }\n\n break;\n default:\n throw new Error('invalid number of gzip magic number bytes read');\n }\n\n // fallthrough\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n this.err = zlib_inflate.inflate(this.strm, this.flush\n\n // If data was encoded with dictionary\n );if (this.err === exports.Z_NEED_DICT && this.dictionary) {\n // Load it\n this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);\n if (this.err === exports.Z_OK) {\n // And try to decode again\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n } else if (this.err === exports.Z_DATA_ERROR) {\n // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR.\n // Make it possible for After() to tell a bad dictionary from bad\n // input.\n this.err = exports.Z_NEED_DICT;\n }\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) {\n // Bytes remain in input buffer. Perhaps this is another compressed\n // member in the same archive, or just trailing garbage.\n // Trailing zero bytes are okay, though, since they are frequently\n // used for padding.\n\n this.reset();\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n }\n break;\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n};\n\nZlib.prototype._checkError = function () {\n // Acceptable error states depend on the type of zlib stream.\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {\n this._error('unexpected end of file');\n return false;\n }\n break;\n case exports.Z_STREAM_END:\n // normal statuses, not fatal\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null) {\n this._error('Missing dictionary');\n } else {\n this._error('Bad dictionary');\n }\n return false;\n default:\n // something else.\n this._error('Zlib error');\n return false;\n }\n\n return true;\n};\n\nZlib.prototype._after = function () {\n if (!this._checkError()) {\n return;\n }\n\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n\n this.write_in_progress = false;\n\n // call the write() cb\n this.callback(avail_in, avail_out);\n\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype._error = function (message) {\n if (this.strm.msg) {\n message = this.strm.msg;\n }\n this.onerror(message, this.err\n\n // no hope of rescue.\n );this.write_in_progress = false;\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])');\n\n assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits');\n assert(level >= -1 && level <= 9, 'invalid compression level');\n\n assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel');\n\n assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy');\n\n this._init(level, windowBits, memLevel, strategy, dictionary);\n this._setDictionary();\n};\n\nZlib.prototype.params = function () {\n throw new Error('deflateParams Not supported');\n};\n\nZlib.prototype.reset = function () {\n this._reset();\n this._setDictionary();\n};\n\nZlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) {\n this.level = level;\n this.windowBits = windowBits;\n this.memLevel = memLevel;\n this.strategy = strategy;\n\n this.flush = exports.Z_NO_FLUSH;\n\n this.err = exports.Z_OK;\n\n if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) {\n this.windowBits += 16;\n }\n\n if (this.mode === exports.UNZIP) {\n this.windowBits += 32;\n }\n\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) {\n this.windowBits = -1 * this.windowBits;\n }\n\n this.strm = new Zstream();\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Init error');\n }\n\n this.dictionary = dictionary;\n\n this.write_in_progress = false;\n this.init_done = true;\n};\n\nZlib.prototype._setDictionary = function () {\n if (this.dictionary == null) {\n return;\n }\n\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to set dictionary');\n }\n};\n\nZlib.prototype._reset = function () {\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to reset stream');\n }\n};\n\nexports.Zlib = Zlib;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/browserify-zlib/lib/binding.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/browserify-zlib/lib/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/browserify-zlib/lib/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\nvar Transform = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform;\nvar binding = __webpack_require__(/*! ./binding */ \"./node_modules/browserify-zlib/lib/binding.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\").ok;\nvar kMaxLength = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").kMaxLength;\nvar kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + 'than 0x' + kMaxLength.toString(16) + ' bytes';\n\n// zlib doesn't provide these, so kludge them in following the same\n// const naming scheme zlib uses.\nbinding.Z_MIN_WINDOWBITS = 8;\nbinding.Z_MAX_WINDOWBITS = 15;\nbinding.Z_DEFAULT_WINDOWBITS = 15;\n\n// fewer than 64 bytes per chunk is stupid.\n// technically it could work with as few as 8, but even 64 bytes\n// is absurdly low. Usually a MB or more is best.\nbinding.Z_MIN_CHUNK = 64;\nbinding.Z_MAX_CHUNK = Infinity;\nbinding.Z_DEFAULT_CHUNK = 16 * 1024;\n\nbinding.Z_MIN_MEMLEVEL = 1;\nbinding.Z_MAX_MEMLEVEL = 9;\nbinding.Z_DEFAULT_MEMLEVEL = 8;\n\nbinding.Z_MIN_LEVEL = -1;\nbinding.Z_MAX_LEVEL = 9;\nbinding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;\n\n// expose all the zlib constants\nvar bkeys = Object.keys(binding);\nfor (var bk = 0; bk < bkeys.length; bk++) {\n var bkey = bkeys[bk];\n if (bkey.match(/^Z/)) {\n Object.defineProperty(exports, bkey, {\n enumerable: true, value: binding[bkey], writable: false\n });\n }\n}\n\n// translation table for return codes.\nvar codes = {\n Z_OK: binding.Z_OK,\n Z_STREAM_END: binding.Z_STREAM_END,\n Z_NEED_DICT: binding.Z_NEED_DICT,\n Z_ERRNO: binding.Z_ERRNO,\n Z_STREAM_ERROR: binding.Z_STREAM_ERROR,\n Z_DATA_ERROR: binding.Z_DATA_ERROR,\n Z_MEM_ERROR: binding.Z_MEM_ERROR,\n Z_BUF_ERROR: binding.Z_BUF_ERROR,\n Z_VERSION_ERROR: binding.Z_VERSION_ERROR\n};\n\nvar ckeys = Object.keys(codes);\nfor (var ck = 0; ck < ckeys.length; ck++) {\n var ckey = ckeys[ck];\n codes[codes[ckey]] = ckey;\n}\n\nObject.defineProperty(exports, 'codes', {\n enumerable: true, value: Object.freeze(codes), writable: false\n});\n\nexports.Deflate = Deflate;\nexports.Inflate = Inflate;\nexports.Gzip = Gzip;\nexports.Gunzip = Gunzip;\nexports.DeflateRaw = DeflateRaw;\nexports.InflateRaw = InflateRaw;\nexports.Unzip = Unzip;\n\nexports.createDeflate = function (o) {\n return new Deflate(o);\n};\n\nexports.createInflate = function (o) {\n return new Inflate(o);\n};\n\nexports.createDeflateRaw = function (o) {\n return new DeflateRaw(o);\n};\n\nexports.createInflateRaw = function (o) {\n return new InflateRaw(o);\n};\n\nexports.createGzip = function (o) {\n return new Gzip(o);\n};\n\nexports.createGunzip = function (o) {\n return new Gunzip(o);\n};\n\nexports.createUnzip = function (o) {\n return new Unzip(o);\n};\n\n// Convenience methods.\n// compress/decompress a string or buffer in one step.\nexports.deflate = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new Deflate(opts), buffer, callback);\n};\n\nexports.deflateSync = function (buffer, opts) {\n return zlibBufferSync(new Deflate(opts), buffer);\n};\n\nexports.gzip = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new Gzip(opts), buffer, callback);\n};\n\nexports.gzipSync = function (buffer, opts) {\n return zlibBufferSync(new Gzip(opts), buffer);\n};\n\nexports.deflateRaw = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new DeflateRaw(opts), buffer, callback);\n};\n\nexports.deflateRawSync = function (buffer, opts) {\n return zlibBufferSync(new DeflateRaw(opts), buffer);\n};\n\nexports.unzip = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new Unzip(opts), buffer, callback);\n};\n\nexports.unzipSync = function (buffer, opts) {\n return zlibBufferSync(new Unzip(opts), buffer);\n};\n\nexports.inflate = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new Inflate(opts), buffer, callback);\n};\n\nexports.inflateSync = function (buffer, opts) {\n return zlibBufferSync(new Inflate(opts), buffer);\n};\n\nexports.gunzip = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new Gunzip(opts), buffer, callback);\n};\n\nexports.gunzipSync = function (buffer, opts) {\n return zlibBufferSync(new Gunzip(opts), buffer);\n};\n\nexports.inflateRaw = function (buffer, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n return zlibBuffer(new InflateRaw(opts), buffer, callback);\n};\n\nexports.inflateRawSync = function (buffer, opts) {\n return zlibBufferSync(new InflateRaw(opts), buffer);\n};\n\nfunction zlibBuffer(engine, buffer, callback) {\n var buffers = [];\n var nread = 0;\n\n engine.on('error', onError);\n engine.on('end', onEnd);\n\n engine.end(buffer);\n flow();\n\n function flow() {\n var chunk;\n while (null !== (chunk = engine.read())) {\n buffers.push(chunk);\n nread += chunk.length;\n }\n engine.once('readable', flow);\n }\n\n function onError(err) {\n engine.removeListener('end', onEnd);\n engine.removeListener('readable', flow);\n callback(err);\n }\n\n function onEnd() {\n var buf;\n var err = null;\n\n if (nread >= kMaxLength) {\n err = new RangeError(kRangeErrorMessage);\n } else {\n buf = Buffer.concat(buffers, nread);\n }\n\n buffers = [];\n engine.close();\n callback(err, buf);\n }\n}\n\nfunction zlibBufferSync(engine, buffer) {\n if (typeof buffer === 'string') buffer = Buffer.from(buffer);\n\n if (!Buffer.isBuffer(buffer)) throw new TypeError('Not a string or buffer');\n\n var flushFlag = engine._finishFlushFlag;\n\n return engine._processChunk(buffer, flushFlag);\n}\n\n// generic zlib\n// minimal 2-byte header\nfunction Deflate(opts) {\n if (!(this instanceof Deflate)) return new Deflate(opts);\n Zlib.call(this, opts, binding.DEFLATE);\n}\n\nfunction Inflate(opts) {\n if (!(this instanceof Inflate)) return new Inflate(opts);\n Zlib.call(this, opts, binding.INFLATE);\n}\n\n// gzip - bigger header, same deflate compression\nfunction Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}\n\nfunction Gunzip(opts) {\n if (!(this instanceof Gunzip)) return new Gunzip(opts);\n Zlib.call(this, opts, binding.GUNZIP);\n}\n\n// raw - no header\nfunction DeflateRaw(opts) {\n if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);\n Zlib.call(this, opts, binding.DEFLATERAW);\n}\n\nfunction InflateRaw(opts) {\n if (!(this instanceof InflateRaw)) return new InflateRaw(opts);\n Zlib.call(this, opts, binding.INFLATERAW);\n}\n\n// auto-detect header.\nfunction Unzip(opts) {\n if (!(this instanceof Unzip)) return new Unzip(opts);\n Zlib.call(this, opts, binding.UNZIP);\n}\n\nfunction isValidFlushFlag(flag) {\n return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;\n}\n\n// the Zlib class they all inherit from\n// This thing manages the queue of requests, and returns\n// true or false if there is anything in the queue when\n// you call the .write() method.\n\nfunction Zlib(opts, mode) {\n var _this = this;\n\n this._opts = opts = opts || {};\n this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;\n\n Transform.call(this, opts);\n\n if (opts.flush && !isValidFlushFlag(opts.flush)) {\n throw new Error('Invalid flush flag: ' + opts.flush);\n }\n if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) {\n throw new Error('Invalid flush flag: ' + opts.finishFlush);\n }\n\n this._flushFlag = opts.flush || binding.Z_NO_FLUSH;\n this._finishFlushFlag = typeof opts.finishFlush !== 'undefined' ? opts.finishFlush : binding.Z_FINISH;\n\n if (opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) {\n throw new Error('Invalid chunk size: ' + opts.chunkSize);\n }\n }\n\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) {\n throw new Error('Invalid windowBits: ' + opts.windowBits);\n }\n }\n\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) {\n throw new Error('Invalid compression level: ' + opts.level);\n }\n }\n\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) {\n throw new Error('Invalid memLevel: ' + opts.memLevel);\n }\n }\n\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) {\n throw new Error('Invalid strategy: ' + opts.strategy);\n }\n }\n\n if (opts.dictionary) {\n if (!Buffer.isBuffer(opts.dictionary)) {\n throw new Error('Invalid dictionary: it should be a Buffer instance');\n }\n }\n\n this._handle = new binding.Zlib(mode);\n\n var self = this;\n this._hadError = false;\n this._handle.onerror = function (message, errno) {\n // there is no way to cleanly recover.\n // continuing only obscures problems.\n _close(self);\n self._hadError = true;\n\n var error = new Error(message);\n error.errno = errno;\n error.code = exports.codes[errno];\n self.emit('error', error);\n };\n\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === 'number') level = opts.level;\n\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === 'number') strategy = opts.strategy;\n\n this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary);\n\n this._buffer = Buffer.allocUnsafe(this._chunkSize);\n this._offset = 0;\n this._level = level;\n this._strategy = strategy;\n\n this.once('end', this.close);\n\n Object.defineProperty(this, '_closed', {\n get: function () {\n return !_this._handle;\n },\n configurable: true,\n enumerable: true\n });\n}\n\nutil.inherits(Zlib, Transform);\n\nZlib.prototype.params = function (level, strategy, callback) {\n if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL) {\n throw new RangeError('Invalid compression level: ' + level);\n }\n if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY) {\n throw new TypeError('Invalid strategy: ' + strategy);\n }\n\n if (this._level !== level || this._strategy !== strategy) {\n var self = this;\n this.flush(binding.Z_SYNC_FLUSH, function () {\n assert(self._handle, 'zlib binding closed');\n self._handle.params(level, strategy);\n if (!self._hadError) {\n self._level = level;\n self._strategy = strategy;\n if (callback) callback();\n }\n });\n } else {\n process.nextTick(callback);\n }\n};\n\nZlib.prototype.reset = function () {\n assert(this._handle, 'zlib binding closed');\n return this._handle.reset();\n};\n\n// This is the _flush function called by the transform class,\n// internally, when the last chunk has been written.\nZlib.prototype._flush = function (callback) {\n this._transform(Buffer.alloc(0), '', callback);\n};\n\nZlib.prototype.flush = function (kind, callback) {\n var _this2 = this;\n\n var ws = this._writableState;\n\n if (typeof kind === 'function' || kind === undefined && !callback) {\n callback = kind;\n kind = binding.Z_FULL_FLUSH;\n }\n\n if (ws.ended) {\n if (callback) process.nextTick(callback);\n } else if (ws.ending) {\n if (callback) this.once('end', callback);\n } else if (ws.needDrain) {\n if (callback) {\n this.once('drain', function () {\n return _this2.flush(kind, callback);\n });\n }\n } else {\n this._flushFlag = kind;\n this.write(Buffer.alloc(0), '', callback);\n }\n};\n\nZlib.prototype.close = function (callback) {\n _close(this, callback);\n process.nextTick(emitCloseNT, this);\n};\n\nfunction _close(engine, callback) {\n if (callback) process.nextTick(callback);\n\n // Caller may invoke .close after a zlib error (which will null _handle).\n if (!engine._handle) return;\n\n engine._handle.close();\n engine._handle = null;\n}\n\nfunction emitCloseNT(self) {\n self.emit('close');\n}\n\nZlib.prototype._transform = function (chunk, encoding, cb) {\n var flushFlag;\n var ws = this._writableState;\n var ending = ws.ending || ws.ended;\n var last = ending && (!chunk || ws.length === chunk.length);\n\n if (chunk !== null && !Buffer.isBuffer(chunk)) return cb(new Error('invalid input'));\n\n if (!this._handle) return cb(new Error('zlib binding closed'));\n\n // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag\n // (or whatever flag was provided using opts.finishFlush).\n // If it's explicitly flushing at some other time, then we use\n // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression\n // goodness.\n if (last) flushFlag = this._finishFlushFlag;else {\n flushFlag = this._flushFlag;\n // once we've flushed the last of the queue, stop flushing and\n // go back to the normal behavior.\n if (chunk.length >= ws.length) {\n this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;\n }\n }\n\n this._processChunk(chunk, flushFlag, cb);\n};\n\nZlib.prototype._processChunk = function (chunk, flushFlag, cb) {\n var availInBefore = chunk && chunk.length;\n var availOutBefore = this._chunkSize - this._offset;\n var inOff = 0;\n\n var self = this;\n\n var async = typeof cb === 'function';\n\n if (!async) {\n var buffers = [];\n var nread = 0;\n\n var error;\n this.on('error', function (er) {\n error = er;\n });\n\n assert(this._handle, 'zlib binding closed');\n do {\n var res = this._handle.writeSync(flushFlag, chunk, // in\n inOff, // in_off\n availInBefore, // in_len\n this._buffer, // out\n this._offset, //out_off\n availOutBefore); // out_len\n } while (!this._hadError && callback(res[0], res[1]));\n\n if (this._hadError) {\n throw error;\n }\n\n if (nread >= kMaxLength) {\n _close(this);\n throw new RangeError(kRangeErrorMessage);\n }\n\n var buf = Buffer.concat(buffers, nread);\n _close(this);\n\n return buf;\n }\n\n assert(this._handle, 'zlib binding closed');\n var req = this._handle.write(flushFlag, chunk, // in\n inOff, // in_off\n availInBefore, // in_len\n this._buffer, // out\n this._offset, //out_off\n availOutBefore); // out_len\n\n req.buffer = chunk;\n req.callback = callback;\n\n function callback(availInAfter, availOutAfter) {\n // When the callback is used in an async write, the callback's\n // context is the `req` object that was created. The req object\n // is === this._handle, and that's why it's important to null\n // out the values after they are done being used. `this._handle`\n // can stay in memory longer than the callback and buffer are needed.\n if (this) {\n this.buffer = null;\n this.callback = null;\n }\n\n if (self._hadError) return;\n\n var have = availOutBefore - availOutAfter;\n assert(have >= 0, 'have should not go down');\n\n if (have > 0) {\n var out = self._buffer.slice(self._offset, self._offset + have);\n self._offset += have;\n // serve some output to the consumer.\n if (async) {\n self.push(out);\n } else {\n buffers.push(out);\n nread += out.length;\n }\n }\n\n // exhausted the output buffer, or used all the input create a new one.\n if (availOutAfter === 0 || self._offset >= self._chunkSize) {\n availOutBefore = self._chunkSize;\n self._offset = 0;\n self._buffer = Buffer.allocUnsafe(self._chunkSize);\n }\n\n if (availOutAfter === 0) {\n // Not actually done. Need to reprocess.\n // Also, update the availInBefore to the availInAfter value,\n // so that if we have to hit it a third (fourth, etc.) time,\n // it'll have the correct byte counts.\n inOff += availInBefore - availInAfter;\n availInBefore = availInAfter;\n\n if (!async) return true;\n\n var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);\n newReq.callback = callback; // this same function\n newReq.buffer = chunk;\n return;\n }\n\n if (!async) return false;\n\n // finished with the chunk.\n cb();\n }\n};\n\nutil.inherits(Deflate, Zlib);\nutil.inherits(Inflate, Zlib);\nutil.inherits(Gzip, Zlib);\nutil.inherits(Gunzip, Zlib);\nutil.inherits(DeflateRaw, Zlib);\nutil.inherits(InflateRaw, Zlib);\nutil.inherits(Unzip, Zlib);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/browserify-zlib/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/bs58/index.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/bs58/index.js ***!
|
||
\************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var basex = __webpack_require__(/*! base-x */ \"./node_modules/base-x/index.js\")\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n\n\n//# sourceURL=webpack:///./node_modules/bs58/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/buffer-alloc-unsafe/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/buffer-alloc-unsafe/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {function allocUnsafe (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n }\n\n if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n\n if (Buffer.allocUnsafe) {\n return Buffer.allocUnsafe(size)\n } else {\n return new Buffer(size)\n }\n}\n\nmodule.exports = allocUnsafe\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/buffer-alloc-unsafe/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/buffer-alloc/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/buffer-alloc/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bufferFill = __webpack_require__(/*! buffer-fill */ \"./node_modules/buffer-fill/index.js\")\nvar allocUnsafe = __webpack_require__(/*! buffer-alloc-unsafe */ \"./node_modules/buffer-alloc-unsafe/index.js\")\n\nmodule.exports = function alloc (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n }\n\n if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n\n if (Buffer.alloc) {\n return Buffer.alloc(size, fill, encoding)\n }\n\n var buffer = allocUnsafe(size)\n\n if (size === 0) {\n return buffer\n }\n\n if (fill === undefined) {\n return bufferFill(buffer, 0)\n }\n\n if (typeof encoding !== 'string') {\n encoding = undefined\n }\n\n return bufferFill(buffer, fill, encoding)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/buffer-alloc/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/buffer-fill/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/buffer-fill/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* Node.js 6.4.0 and up has full support */\nvar hasFullSupport = (function () {\n try {\n if (!Buffer.isEncoding('latin1')) {\n return false\n }\n\n var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4)\n\n buf.fill('ab', 'ucs2')\n\n return (buf.toString('hex') === '61006200')\n } catch (_) {\n return false\n }\n}())\n\nfunction isSingleByte (val) {\n return (val.length === 1 && val.charCodeAt(0) < 256)\n}\n\nfunction fillWithNumber (buffer, val, start, end) {\n if (start < 0 || end > buffer.length) {\n throw new RangeError('Out of range index')\n }\n\n start = start >>> 0\n end = end === undefined ? buffer.length : end >>> 0\n\n if (end > start) {\n buffer.fill(val, start, end)\n }\n\n return buffer\n}\n\nfunction fillWithBuffer (buffer, val, start, end) {\n if (start < 0 || end > buffer.length) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return buffer\n }\n\n start = start >>> 0\n end = end === undefined ? buffer.length : end >>> 0\n\n var pos = start\n var len = val.length\n while (pos <= (end - len)) {\n val.copy(buffer, pos)\n pos += len\n }\n\n if (pos !== end) {\n val.copy(buffer, pos, 0, end - pos)\n }\n\n return buffer\n}\n\nfunction fill (buffer, val, start, end, encoding) {\n if (hasFullSupport) {\n return buffer.fill(val, start, end, encoding)\n }\n\n if (typeof val === 'number') {\n return fillWithNumber(buffer, val, start, end)\n }\n\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = buffer.length\n } else if (typeof end === 'string') {\n encoding = end\n end = buffer.length\n }\n\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n\n if (encoding === 'latin1') {\n encoding = 'binary'\n }\n\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n if (val === '') {\n return fillWithNumber(buffer, 0, start, end)\n }\n\n if (isSingleByte(val)) {\n return fillWithNumber(buffer, val.charCodeAt(0), start, end)\n }\n\n val = new Buffer(val, encoding)\n }\n\n if (Buffer.isBuffer(val)) {\n return fillWithBuffer(buffer, val, start, end)\n }\n\n // Other values (e.g. undefined, boolean, object) results in zero-fill\n return fillWithNumber(buffer, 0, start, end)\n}\n\nmodule.exports = fill\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/buffer-fill/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/buffer-from/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/buffer-from/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var toString = Object.prototype.toString\n\nvar isModern = (\n typeof Buffer.alloc === 'function' &&\n typeof Buffer.allocUnsafe === 'function' &&\n typeof Buffer.from === 'function'\n)\n\nfunction isArrayBuffer (input) {\n return toString.call(input).slice(8, -1) === 'ArrayBuffer'\n}\n\nfunction fromArrayBuffer (obj, byteOffset, length) {\n byteOffset >>>= 0\n\n var maxLength = obj.byteLength - byteOffset\n\n if (maxLength < 0) {\n throw new RangeError(\"'offset' is out of bounds\")\n }\n\n if (length === undefined) {\n length = maxLength\n } else {\n length >>>= 0\n\n if (length > maxLength) {\n throw new RangeError(\"'length' is out of bounds\")\n }\n }\n\n return isModern\n ? Buffer.from(obj.slice(byteOffset, byteOffset + length))\n : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n return isModern\n ? Buffer.from(string, encoding)\n : new Buffer(string, encoding)\n}\n\nfunction bufferFrom (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (isArrayBuffer(value)) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n return isModern\n ? Buffer.from(value)\n : new Buffer(value)\n}\n\nmodule.exports = bufferFrom\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/buffer-from/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/builtin-status-codes/browser.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/builtin-status-codes/browser.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = {\n \"100\": \"Continue\",\n \"101\": \"Switching Protocols\",\n \"102\": \"Processing\",\n \"200\": \"OK\",\n \"201\": \"Created\",\n \"202\": \"Accepted\",\n \"203\": \"Non-Authoritative Information\",\n \"204\": \"No Content\",\n \"205\": \"Reset Content\",\n \"206\": \"Partial Content\",\n \"207\": \"Multi-Status\",\n \"208\": \"Already Reported\",\n \"226\": \"IM Used\",\n \"300\": \"Multiple Choices\",\n \"301\": \"Moved Permanently\",\n \"302\": \"Found\",\n \"303\": \"See Other\",\n \"304\": \"Not Modified\",\n \"305\": \"Use Proxy\",\n \"307\": \"Temporary Redirect\",\n \"308\": \"Permanent Redirect\",\n \"400\": \"Bad Request\",\n \"401\": \"Unauthorized\",\n \"402\": \"Payment Required\",\n \"403\": \"Forbidden\",\n \"404\": \"Not Found\",\n \"405\": \"Method Not Allowed\",\n \"406\": \"Not Acceptable\",\n \"407\": \"Proxy Authentication Required\",\n \"408\": \"Request Timeout\",\n \"409\": \"Conflict\",\n \"410\": \"Gone\",\n \"411\": \"Length Required\",\n \"412\": \"Precondition Failed\",\n \"413\": \"Payload Too Large\",\n \"414\": \"URI Too Long\",\n \"415\": \"Unsupported Media Type\",\n \"416\": \"Range Not Satisfiable\",\n \"417\": \"Expectation Failed\",\n \"418\": \"I'm a teapot\",\n \"421\": \"Misdirected Request\",\n \"422\": \"Unprocessable Entity\",\n \"423\": \"Locked\",\n \"424\": \"Failed Dependency\",\n \"425\": \"Unordered Collection\",\n \"426\": \"Upgrade Required\",\n \"428\": \"Precondition Required\",\n \"429\": \"Too Many Requests\",\n \"431\": \"Request Header Fields Too Large\",\n \"451\": \"Unavailable For Legal Reasons\",\n \"500\": \"Internal Server Error\",\n \"501\": \"Not Implemented\",\n \"502\": \"Bad Gateway\",\n \"503\": \"Service Unavailable\",\n \"504\": \"Gateway Timeout\",\n \"505\": \"HTTP Version Not Supported\",\n \"506\": \"Variant Also Negotiates\",\n \"507\": \"Insufficient Storage\",\n \"508\": \"Loop Detected\",\n \"509\": \"Bandwidth Limit Exceeded\",\n \"510\": \"Not Extended\",\n \"511\": \"Network Authentication Required\"\n}\n\n\n//# sourceURL=webpack:///./node_modules/builtin-status-codes/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/canonical-json/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/canonical-json/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\n/*\nThe original version of this code is taken from Douglas Crockford's json2.js:\nhttps://github.com/douglascrockford/JSON-js/blob/master/json2.js\n\nI made some modifications to ensure a canonical output.\n*/\n\nfunction f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n}\n\nvar cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n rep;\n\n\nfunction quote(string) {\n\n// If the string contains no control characters, no quote characters, and no\n// backslash characters, then we can safely slap some quotes around it.\n// Otherwise we must also replace the offending characters with safe escape\n// sequences.\n\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string'\n ? c\n : '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n}\n\n\nfunction str(key, holder) {\n\n// Produce a string from holder[key].\n\n var i, // The loop counter.\n k, // The member key.\n v, // The member value.\n length,\n mind = gap,\n partial,\n value = holder[key];\n\n// If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n// If we were called with a replacer function, then call the replacer to\n// obtain a replacement value.\n\n if (typeof rep === 'function') {\n value = rep.call(holder, key, value);\n }\n\n// What happens next depends on the value's type.\n\n switch (typeof value) {\n case 'string':\n return quote(value);\n\n case 'number':\n\n// JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n\n// If the value is a boolean or null, convert it to a string. Note:\n// typeof null does not produce 'null'. The case is included here in\n// the remote chance that this gets fixed someday.\n\n return String(value);\n\n// If the type is 'object', we might be dealing with an object or an array or\n// null.\n\n case 'object':\n\n// Due to a specification blunder in ECMAScript, typeof null is 'object',\n// so watch out for that case.\n\n if (!value) {\n return 'null';\n }\n\n// Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n// Is the value an array?\n\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n\n// The value is an array. Stringify every element. Use null as a placeholder\n// for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n// Join all of the elements together, separated with commas, and wrap them in\n// brackets.\n\n v = partial.length === 0\n ? '[]'\n : gap\n ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']'\n : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n// If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === 'object') {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === 'string') {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n } else {\n\n// Otherwise, iterate through all of the keys in the object.\n var keysSorted = Object.keys(value).sort()\n for (i in keysSorted) {\n k = keysSorted[i]\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n }\n\n// Join all of the member texts together, separated with commas,\n// and wrap them in braces.\n\n v = partial.length === 0\n ? '{}'\n : gap\n ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}'\n : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n}\n\n// If the JSON object does not yet have a stringify method, give it one.\nvar stringify = function (value, replacer, space) {\n\n// The stringify method takes a value and an optional replacer, and an optional\n// space parameter, and returns a JSON text. The replacer can be a function\n// that can replace values, or an array of strings that will select the keys.\n// A default replacer method can be provided. Use of the space parameter can\n// produce text that is more easily readable.\n\n var i;\n gap = '';\n indent = '';\n\n// If the space parameter is a number, make an indent string containing that\n// many spaces.\n\n if (typeof space === 'number') {\n for (i = 0; i < space; i += 1) {\n indent += ' ';\n }\n\n// If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === 'string') {\n indent = space;\n }\n\n// If there is a replacer, it must be a function or an array.\n// Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== 'function' &&\n (typeof replacer !== 'object' ||\n typeof replacer.length !== 'number')) {\n throw new Error('JSON.stringify');\n }\n\n// Make a fake root object containing our value under the key of ''.\n// Return the result of stringifying the value.\n\n return str('', {'': value});\n};\n\nmodule.exports = stringify\n\n\n//# sourceURL=webpack:///./node_modules/canonical-json/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/caseless/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/caseless/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function Caseless (dict) {\n this.dict = dict || {}\n}\nCaseless.prototype.set = function (name, value, clobber) {\n if (typeof name === 'object') {\n for (var i in name) {\n this.set(i, name[i], value)\n }\n } else {\n if (typeof clobber === 'undefined') clobber = true\n var has = this.has(name)\n\n if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value\n else this.dict[has || name] = value\n return has\n }\n}\nCaseless.prototype.has = function (name) {\n var keys = Object.keys(this.dict)\n , name = name.toLowerCase()\n ;\n for (var i=0;i<keys.length;i++) {\n if (keys[i].toLowerCase() === name) return keys[i]\n }\n return false\n}\nCaseless.prototype.get = function (name) {\n name = name.toLowerCase()\n var result, _key\n var headers = this.dict\n Object.keys(headers).forEach(function (key) {\n _key = key.toLowerCase()\n if (name === _key) result = headers[key]\n })\n return result\n}\nCaseless.prototype.swap = function (name) {\n var has = this.has(name)\n if (has === name) return\n if (!has) throw new Error('There is no header than matches \"'+name+'\"')\n this.dict[name] = this.dict[has]\n delete this.dict[has]\n}\nCaseless.prototype.del = function (name) {\n var has = this.has(name)\n return delete this.dict[has || name]\n}\n\nmodule.exports = function (dict) {return new Caseless(dict)}\nmodule.exports.httpify = function (resp, headers) {\n var c = new Caseless(headers)\n resp.setHeader = function (key, value, clobber) {\n if (typeof value === 'undefined') return\n return c.set(key, value, clobber)\n }\n resp.hasHeader = function (key) {\n return c.has(key)\n }\n resp.getHeader = function (key) {\n return c.get(key)\n }\n resp.removeHeader = function (key) {\n return c.del(key)\n }\n resp.headers = c.dict\n return c\n}\n\n\n//# sourceURL=webpack:///./node_modules/caseless/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chunk-store-stream/write.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/chunk-store-stream/write.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const BlockStream = __webpack_require__(/*! block-stream2 */ \"./node_modules/block-stream2/index.js\")\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\nclass ChunkStoreWriteStream extends stream.Writable {\n constructor (store, chunkLength, opts = {}) {\n super(opts)\n\n if (!store || !store.put || !store.get) {\n throw new Error('First argument must be an abstract-chunk-store compliant store')\n }\n chunkLength = Number(chunkLength)\n if (!chunkLength) throw new Error('Second argument must be a chunk length')\n\n this._blockstream = new BlockStream(chunkLength, { zeroPadding: false })\n this._outstandingPuts = 0\n\n let index = 0\n const onData = chunk => {\n if (this.destroyed) return\n\n this._outstandingPuts += 1\n store.put(index, chunk, () => {\n this._outstandingPuts -= 1\n if (this._outstandingPuts === 0 && typeof this._finalCb === 'function') {\n this._finalCb(null)\n this._finalCb = null\n }\n })\n index += 1\n }\n\n this._blockstream\n .on('data', onData)\n .on('error', err => { this.destroy(err) })\n }\n\n _write (chunk, encoding, callback) {\n this._blockstream.write(chunk, encoding, callback)\n }\n\n _final (cb) {\n this._blockstream.end()\n this._blockstream.once('end', () => {\n if (this._outstandingPuts === 0) cb(null)\n else this._finalCb = cb\n })\n }\n\n destroy (err) {\n if (this.destroyed) return\n this.destroyed = true\n\n if (err) this.emit('error', err)\n this.emit('close')\n }\n}\n\nmodule.exports = ChunkStoreWriteStream\n\n\n//# sourceURL=webpack:///./node_modules/chunk-store-stream/write.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/cids/src/cid-util.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/cids/src/cid-util.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\n\nvar CIDUtil = {\n /**\n * Test if the given input is a valid CID object.\n * Returns an error message if it is not.\n * Returns undefined if it is a valid CID.\n *\n * @param {any} other\n * @returns {string}\n */\n checkCIDComponents: function (other) {\n if (other == null) {\n return 'null values are not valid CIDs'\n }\n\n if (!(other.version === 0 || other.version === 1)) {\n return 'Invalid version, must be a number equal to 1 or 0'\n }\n\n if (typeof other.codec !== 'string') {\n return 'codec must be string'\n }\n\n if (other.version === 0) {\n if (other.codec !== 'dag-pb') {\n return `codec must be 'dag-pb' for CIDv0`\n }\n if (other.multibaseName !== 'base58btc') {\n return `multibaseName must be 'base58btc' for CIDv0`\n }\n }\n\n if (!Buffer.isBuffer(other.multihash)) {\n return 'multihash must be a Buffer'\n }\n\n try {\n mh.validate(other.multihash)\n } catch (err) {\n let errorMsg = err.message\n if (!errorMsg) { // Just in case mh.validate() throws an error with empty error message\n errorMsg = 'Multihash validation failed'\n }\n return errorMsg\n }\n }\n}\n\nmodule.exports = CIDUtil\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/cids/src/cid-util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/cids/src/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/cids/src/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst multibase = __webpack_require__(/*! multibase */ \"./node_modules/multibase/src/index.js\")\nconst multicodec = __webpack_require__(/*! multicodec */ \"./node_modules/multicodec/src/index.js\")\nconst codecs = __webpack_require__(/*! multicodec/src/base-table */ \"./node_modules/multicodec/src/base-table.js\")\nconst CIDUtil = __webpack_require__(/*! ./cid-util */ \"./node_modules/cids/src/cid-util.js\")\nconst withIs = __webpack_require__(/*! class-is */ \"./node_modules/class-is/index.js\")\n\n/**\n * @typedef {Object} SerializedCID\n * @param {string} codec\n * @param {number} version\n * @param {Buffer} multihash\n */\n\n/**\n * Test if the given input is a CID.\n * @function isCID\n * @memberof CID\n * @static\n * @param {any} other\n * @returns {bool}\n */\n\n/**\n * Class representing a CID `<mbase><version><mcodec><mhash>`\n * , as defined in [ipld/cid](https://github.com/multiformats/cid).\n * @class CID\n */\nclass CID {\n /**\n * Create a new CID.\n *\n * The algorithm for argument input is roughly:\n * ```\n * if (cid)\n * -> create a copy\n * else if (str)\n * if (1st char is on multibase table) -> CID String\n * else -> bs58 encoded multihash\n * else if (Buffer)\n * if (1st byte is 0 or 1) -> CID\n * else -> multihash\n * else if (Number)\n * -> construct CID by parts\n * ```\n *\n * @param {string|Buffer|CID} version\n * @param {string} [codec]\n * @param {Buffer} [multihash]\n * @param {string} [multibaseName]\n *\n * @example\n * new CID(<version>, <codec>, <multihash>, <multibaseName>)\n * new CID(<cidStr>)\n * new CID(<cid.buffer>)\n * new CID(<multihash>)\n * new CID(<bs58 encoded multihash>)\n * new CID(<cid>)\n */\n constructor (version, codec, multihash, multibaseName) {\n if (_CID.isCID(version)) {\n // version is an exising CID instance\n const cid = version\n this.version = cid.version\n this.codec = cid.codec\n this.multihash = Buffer.from(cid.multihash)\n // Default guard for when a CID < 0.7 is passed with no multibaseName\n this.multibaseName = cid.multibaseName || (cid.version === 0 ? 'base58btc' : 'base32')\n return\n }\n\n if (typeof version === 'string') {\n // e.g. 'base32' or false\n const baseName = multibase.isEncoded(version)\n if (baseName) {\n // version is a CID String encoded with multibase, so v1\n const cid = multibase.decode(version)\n this.version = parseInt(cid.slice(0, 1).toString('hex'), 16)\n this.codec = multicodec.getCodec(cid.slice(1))\n this.multihash = multicodec.rmPrefix(cid.slice(1))\n this.multibaseName = baseName\n } else {\n // version is a base58btc string multihash, so v0\n this.version = 0\n this.codec = 'dag-pb'\n this.multihash = mh.fromB58String(version)\n this.multibaseName = 'base58btc'\n }\n CID.validateCID(this)\n Object.defineProperty(this, 'string', { value: version })\n return\n }\n\n if (Buffer.isBuffer(version)) {\n const firstByte = version.slice(0, 1)\n const v = parseInt(firstByte.toString('hex'), 16)\n if (v === 1) {\n // version is a CID buffer\n const cid = version\n this.version = v\n this.codec = multicodec.getCodec(cid.slice(1))\n this.multihash = multicodec.rmPrefix(cid.slice(1))\n this.multibaseName = 'base32'\n } else {\n // version is a raw multihash buffer, so v0\n this.version = 0\n this.codec = 'dag-pb'\n this.multihash = version\n this.multibaseName = 'base58btc'\n }\n CID.validateCID(this)\n return\n }\n\n // otherwise, assemble the CID from the parameters\n\n /**\n * @type {number}\n */\n this.version = version\n\n /**\n * @type {string}\n */\n this.codec = codec\n\n /**\n * @type {Buffer}\n */\n this.multihash = multihash\n\n /**\n * @type {string}\n */\n this.multibaseName = multibaseName || (version === 0 ? 'base58btc' : 'base32')\n\n CID.validateCID(this)\n }\n\n /**\n * The CID as a `Buffer`\n *\n * @return {Buffer}\n * @readonly\n *\n * @memberOf CID\n */\n get buffer () {\n let buffer = this._buffer\n\n if (!buffer) {\n if (this.version === 0) {\n buffer = this.multihash\n } else if (this.version === 1) {\n buffer = Buffer.concat([\n Buffer.from('01', 'hex'),\n multicodec.getCodeVarint(this.codec),\n this.multihash\n ])\n } else {\n throw new Error('unsupported version')\n }\n\n // Cache this buffer so it doesn't have to be recreated\n Object.defineProperty(this, '_buffer', { value: buffer })\n }\n\n return buffer\n }\n\n /**\n * Get the prefix of the CID.\n *\n * @returns {Buffer}\n * @readonly\n */\n get prefix () {\n return Buffer.concat([\n Buffer.from(`0${this.version}`, 'hex'),\n multicodec.getCodeVarint(this.codec),\n mh.prefix(this.multihash)\n ])\n }\n\n /**\n * Convert to a CID of version `0`.\n *\n * @returns {CID}\n */\n toV0 () {\n if (this.codec !== 'dag-pb') {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0')\n }\n\n const { name, length } = mh.decode(this.multihash)\n\n if (name !== 'sha2-256') {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0')\n }\n\n if (length !== 32) {\n throw new Error('Cannot convert non 32 byte multihash CID to CIDv0')\n }\n\n return new _CID(0, this.codec, this.multihash)\n }\n\n /**\n * Convert to a CID of version `1`.\n *\n * @returns {CID}\n */\n toV1 () {\n return new _CID(1, this.codec, this.multihash)\n }\n\n /**\n * Encode the CID into a string.\n *\n * @param {string} [base=this.multibaseName] - Base encoding to use.\n * @returns {string}\n */\n toBaseEncodedString (base = this.multibaseName) {\n if (this.string && base === this.multibaseName) {\n return this.string\n }\n let str = null\n if (this.version === 0) {\n if (base !== 'base58btc') {\n throw new Error('not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()')\n }\n str = mh.toB58String(this.multihash)\n } else if (this.version === 1) {\n str = multibase.encode(base, this.buffer).toString()\n } else {\n throw new Error('unsupported version')\n }\n if (base === this.multibaseName) {\n // cache the string value\n Object.defineProperty(this, 'string', { value: str })\n }\n return str\n }\n\n toString (base) {\n return this.toBaseEncodedString(base)\n }\n\n /**\n * Serialize to a plain object.\n *\n * @returns {SerializedCID}\n */\n toJSON () {\n return {\n codec: this.codec,\n version: this.version,\n hash: this.multihash\n }\n }\n\n /**\n * Compare equality with another CID.\n *\n * @param {CID} other\n * @returns {bool}\n */\n equals (other) {\n return this.codec === other.codec &&\n this.version === other.version &&\n this.multihash.equals(other.multihash)\n }\n\n /**\n * Test if the given input is a valid CID object.\n * Throws if it is not.\n *\n * @param {any} other\n * @returns {void}\n */\n static validateCID (other) {\n let errorMsg = CIDUtil.checkCIDComponents(other)\n if (errorMsg) {\n throw new Error(errorMsg)\n }\n }\n}\n\nconst _CID = withIs(CID, {\n className: 'CID',\n symbolName: '@ipld/js-cid/CID'\n})\n\n_CID.codecs = codecs\n\nmodule.exports = _CID\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/cids/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/cipher-base/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/cipher-base/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar Transform = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform\nvar StringDecoder = __webpack_require__(/*! string_decoder */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n\n\n//# sourceURL=webpack:///./node_modules/cipher-base/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/class-is/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/class-is/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction withIs(Class, { className, symbolName }) {\n const symbol = Symbol.for(symbolName);\n\n const ClassIsWrapper = {\n // The code below assigns the class wrapper to an object to trick\n // JavaScript engines to show the name of the extended class when\n // logging an instances.\n // We are assigning an anonymous class (class wrapper) to the object\n // with key `className` to keep the correct name.\n // If this is not supported it falls back to logging `ClassIsWrapper`.\n [className]: class extends Class {\n constructor(...args) {\n super(...args);\n Object.defineProperty(this, symbol, { value: true });\n }\n\n get [Symbol.toStringTag]() {\n return className;\n }\n },\n }[className];\n\n ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]);\n\n return ClassIsWrapper;\n}\n\nfunction withIsProto(Class, { className, symbolName, withoutNew }) {\n const symbol = Symbol.for(symbolName);\n\n /* eslint-disable object-shorthand */\n const ClassIsWrapper = {\n [className]: function (...args) {\n if (withoutNew && !(this instanceof ClassIsWrapper)) {\n return new ClassIsWrapper(...args);\n }\n\n const _this = Class.call(this, ...args) || this;\n\n if (_this && !_this[symbol]) {\n Object.defineProperty(_this, symbol, { value: true });\n }\n\n return _this;\n },\n }[className];\n /* eslint-enable object-shorthand */\n\n ClassIsWrapper.prototype = Object.create(Class.prototype);\n ClassIsWrapper.prototype.constructor = ClassIsWrapper;\n\n Object.defineProperty(ClassIsWrapper.prototype, Symbol.toStringTag, {\n get() {\n return className;\n },\n });\n\n ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]);\n\n return ClassIsWrapper;\n}\n\nmodule.exports = withIs;\nmodule.exports.proto = withIsProto;\n\n\n//# sourceURL=webpack:///./node_modules/class-is/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/closest-to/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/closest-to/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var abs = Math.abs\n\nmodule.exports = closest\n\nfunction closest (n, arr, rndx) {\n var i, ndx, diff, best = Infinity\n var low = 0, high = arr.length - 1\n while (low <= high) {\n i = low + (high - low >> 1)\n diff = arr[i] - n\n diff < 0 ? low = i + 1 :\n diff > 0 ? high = i - 1 : void 0\n diff = abs(diff)\n if (diff < best) best = diff, ndx = i\n if (arr[i] === n) break\n }\n return rndx ? ndx : arr[ndx]\n}\n\n\n//# sourceURL=webpack:///./node_modules/closest-to/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/combined-stream/lib/combined_stream.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/combined-stream/lib/combined_stream.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar Stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Stream;\nvar DelayedStream = __webpack_require__(/*! delayed-stream */ \"./node_modules/delayed-stream/lib/delayed_stream.js\");\n\nmodule.exports = CombinedStream;\nfunction CombinedStream() {\n this.writable = false;\n this.readable = true;\n this.dataSize = 0;\n this.maxDataSize = 2 * 1024 * 1024;\n this.pauseStreams = true;\n\n this._released = false;\n this._streams = [];\n this._currentStream = null;\n this._insideLoop = false;\n this._pendingNext = false;\n}\nutil.inherits(CombinedStream, Stream);\n\nCombinedStream.create = function(options) {\n var combinedStream = new this();\n\n options = options || {};\n for (var option in options) {\n combinedStream[option] = options[option];\n }\n\n return combinedStream;\n};\n\nCombinedStream.isStreamLike = function(stream) {\n return (typeof stream !== 'function')\n && (typeof stream !== 'string')\n && (typeof stream !== 'boolean')\n && (typeof stream !== 'number')\n && (!Buffer.isBuffer(stream));\n};\n\nCombinedStream.prototype.append = function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n\n if (isStreamLike) {\n if (!(stream instanceof DelayedStream)) {\n var newStream = DelayedStream.create(stream, {\n maxDataSize: Infinity,\n pauseStream: this.pauseStreams,\n });\n stream.on('data', this._checkDataSize.bind(this));\n stream = newStream;\n }\n\n this._handleErrors(stream);\n\n if (this.pauseStreams) {\n stream.pause();\n }\n }\n\n this._streams.push(stream);\n return this;\n};\n\nCombinedStream.prototype.pipe = function(dest, options) {\n Stream.prototype.pipe.call(this, dest, options);\n this.resume();\n return dest;\n};\n\nCombinedStream.prototype._getNext = function() {\n this._currentStream = null;\n\n if (this._insideLoop) {\n this._pendingNext = true;\n return; // defer call\n }\n\n this._insideLoop = true;\n try {\n do {\n this._pendingNext = false;\n this._realGetNext();\n } while (this._pendingNext);\n } finally {\n this._insideLoop = false;\n }\n};\n\nCombinedStream.prototype._realGetNext = function() {\n var stream = this._streams.shift();\n\n\n if (typeof stream == 'undefined') {\n this.end();\n return;\n }\n\n if (typeof stream !== 'function') {\n this._pipeNext(stream);\n return;\n }\n\n var getStream = stream;\n getStream(function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('data', this._checkDataSize.bind(this));\n this._handleErrors(stream);\n }\n\n this._pipeNext(stream);\n }.bind(this));\n};\n\nCombinedStream.prototype._pipeNext = function(stream) {\n this._currentStream = stream;\n\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('end', this._getNext.bind(this));\n stream.pipe(this, {end: false});\n return;\n }\n\n var value = stream;\n this.write(value);\n this._getNext();\n};\n\nCombinedStream.prototype._handleErrors = function(stream) {\n var self = this;\n stream.on('error', function(err) {\n self._emitError(err);\n });\n};\n\nCombinedStream.prototype.write = function(data) {\n this.emit('data', data);\n};\n\nCombinedStream.prototype.pause = function() {\n if (!this.pauseStreams) {\n return;\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();\n this.emit('pause');\n};\n\nCombinedStream.prototype.resume = function() {\n if (!this._released) {\n this._released = true;\n this.writable = true;\n this._getNext();\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();\n this.emit('resume');\n};\n\nCombinedStream.prototype.end = function() {\n this._reset();\n this.emit('end');\n};\n\nCombinedStream.prototype.destroy = function() {\n this._reset();\n this.emit('close');\n};\n\nCombinedStream.prototype._reset = function() {\n this.writable = false;\n this._streams = [];\n this._currentStream = null;\n};\n\nCombinedStream.prototype._checkDataSize = function() {\n this._updateDataSize();\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';\n this._emitError(new Error(message));\n};\n\nCombinedStream.prototype._updateDataSize = function() {\n this.dataSize = 0;\n\n var self = this;\n this._streams.forEach(function(stream) {\n if (!stream.dataSize) {\n return;\n }\n\n self.dataSize += stream.dataSize;\n });\n\n if (this._currentStream && this._currentStream.dataSize) {\n this.dataSize += this._currentStream.dataSize;\n }\n};\n\nCombinedStream.prototype._emitError = function(err) {\n this._reset();\n this.emit('error', err);\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/combined-stream/lib/combined_stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/constants-browserify/constants.json":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/constants-browserify/constants.json ***!
|
||
\**********************************************************/
|
||
/*! exports provided: O_RDONLY, O_WRONLY, O_RDWR, S_IFMT, S_IFREG, S_IFDIR, S_IFCHR, S_IFBLK, S_IFIFO, S_IFLNK, S_IFSOCK, O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, O_DIRECTORY, O_NOFOLLOW, O_SYNC, O_SYMLINK, O_NONBLOCK, S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXG, S_IRGRP, S_IWGRP, S_IXGRP, S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH, E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, EAFNOSUPPORT, EAGAIN, EALREADY, EBADF, EBADMSG, EBUSY, ECANCELED, ECHILD, ECONNABORTED, ECONNREFUSED, ECONNRESET, EDEADLK, EDESTADDRREQ, EDOM, EDQUOT, EEXIST, EFAULT, EFBIG, EHOSTUNREACH, EIDRM, EILSEQ, EINPROGRESS, EINTR, EINVAL, EIO, EISCONN, EISDIR, ELOOP, EMFILE, EMLINK, EMSGSIZE, EMULTIHOP, ENAMETOOLONG, ENETDOWN, ENETRESET, ENETUNREACH, ENFILE, ENOBUFS, ENODATA, ENODEV, ENOENT, ENOEXEC, ENOLCK, ENOLINK, ENOMEM, ENOMSG, ENOPROTOOPT, ENOSPC, ENOSR, ENOSTR, ENOSYS, ENOTCONN, ENOTDIR, ENOTEMPTY, ENOTSOCK, ENOTSUP, ENOTTY, ENXIO, EOPNOTSUPP, EOVERFLOW, EPERM, EPIPE, EPROTO, EPROTONOSUPPORT, EPROTOTYPE, ERANGE, EROFS, ESPIPE, ESRCH, ESTALE, ETIME, ETIMEDOUT, ETXTBSY, EWOULDBLOCK, EXDEV, SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGIOT, SIGBUS, SIGFPE, SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, SIGIO, SIGSYS, SSL_OP_ALL, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION, SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_CISCO_ANYCONNECT, SSL_OP_COOKIE_EXCHANGE, SSL_OP_CRYPTOPRO_TLSEXT_BUG, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS, SSL_OP_EPHEMERAL_RSA, SSL_OP_LEGACY_SERVER_CONNECT, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER, SSL_OP_MICROSOFT_SESS_ID_BUG, SSL_OP_MSIE_SSLV2_RSA_PADDING, SSL_OP_NETSCAPE_CA_DN_BUG, SSL_OP_NETSCAPE_CHALLENGE_BUG, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG, SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG, SSL_OP_NO_COMPRESSION, SSL_OP_NO_QUERY_MTU, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION, SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TICKET, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2, SSL_OP_PKCS1_CHECK_1, SSL_OP_PKCS1_CHECK_2, SSL_OP_SINGLE_DH_USE, SSL_OP_SINGLE_ECDH_USE, SSL_OP_SSLEAY_080_CLIENT_DH_BUG, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG, SSL_OP_TLS_BLOCK_PADDING_BUG, SSL_OP_TLS_D5_BUG, SSL_OP_TLS_ROLLBACK_BUG, ENGINE_METHOD_DSA, ENGINE_METHOD_DH, ENGINE_METHOD_RAND, ENGINE_METHOD_ECDH, ENGINE_METHOD_ECDSA, ENGINE_METHOD_CIPHERS, ENGINE_METHOD_DIGESTS, ENGINE_METHOD_STORE, ENGINE_METHOD_PKEY_METHS, ENGINE_METHOD_PKEY_ASN1_METHS, ENGINE_METHOD_ALL, ENGINE_METHOD_NONE, DH_CHECK_P_NOT_SAFE_PRIME, DH_CHECK_P_NOT_PRIME, DH_UNABLE_TO_CHECK_GENERATOR, DH_NOT_SUITABLE_GENERATOR, NPN_ENABLED, RSA_PKCS1_PADDING, RSA_SSLV23_PADDING, RSA_NO_PADDING, RSA_PKCS1_OAEP_PADDING, RSA_X931_PADDING, RSA_PKCS1_PSS_PADDING, POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_UNCOMPRESSED, POINT_CONVERSION_HYBRID, F_OK, R_OK, W_OK, X_OK, UV_UDP_REUSEADDR, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"O_RDONLY\":0,\"O_WRONLY\":1,\"O_RDWR\":2,\"S_IFMT\":61440,\"S_IFREG\":32768,\"S_IFDIR\":16384,\"S_IFCHR\":8192,\"S_IFBLK\":24576,\"S_IFIFO\":4096,\"S_IFLNK\":40960,\"S_IFSOCK\":49152,\"O_CREAT\":512,\"O_EXCL\":2048,\"O_NOCTTY\":131072,\"O_TRUNC\":1024,\"O_APPEND\":8,\"O_DIRECTORY\":1048576,\"O_NOFOLLOW\":256,\"O_SYNC\":128,\"O_SYMLINK\":2097152,\"O_NONBLOCK\":4,\"S_IRWXU\":448,\"S_IRUSR\":256,\"S_IWUSR\":128,\"S_IXUSR\":64,\"S_IRWXG\":56,\"S_IRGRP\":32,\"S_IWGRP\":16,\"S_IXGRP\":8,\"S_IRWXO\":7,\"S_IROTH\":4,\"S_IWOTH\":2,\"S_IXOTH\":1,\"E2BIG\":7,\"EACCES\":13,\"EADDRINUSE\":48,\"EADDRNOTAVAIL\":49,\"EAFNOSUPPORT\":47,\"EAGAIN\":35,\"EALREADY\":37,\"EBADF\":9,\"EBADMSG\":94,\"EBUSY\":16,\"ECANCELED\":89,\"ECHILD\":10,\"ECONNABORTED\":53,\"ECONNREFUSED\":61,\"ECONNRESET\":54,\"EDEADLK\":11,\"EDESTADDRREQ\":39,\"EDOM\":33,\"EDQUOT\":69,\"EEXIST\":17,\"EFAULT\":14,\"EFBIG\":27,\"EHOSTUNREACH\":65,\"EIDRM\":90,\"EILSEQ\":92,\"EINPROGRESS\":36,\"EINTR\":4,\"EINVAL\":22,\"EIO\":5,\"EISCONN\":56,\"EISDIR\":21,\"ELOOP\":62,\"EMFILE\":24,\"EMLINK\":31,\"EMSGSIZE\":40,\"EMULTIHOP\":95,\"ENAMETOOLONG\":63,\"ENETDOWN\":50,\"ENETRESET\":52,\"ENETUNREACH\":51,\"ENFILE\":23,\"ENOBUFS\":55,\"ENODATA\":96,\"ENODEV\":19,\"ENOENT\":2,\"ENOEXEC\":8,\"ENOLCK\":77,\"ENOLINK\":97,\"ENOMEM\":12,\"ENOMSG\":91,\"ENOPROTOOPT\":42,\"ENOSPC\":28,\"ENOSR\":98,\"ENOSTR\":99,\"ENOSYS\":78,\"ENOTCONN\":57,\"ENOTDIR\":20,\"ENOTEMPTY\":66,\"ENOTSOCK\":38,\"ENOTSUP\":45,\"ENOTTY\":25,\"ENXIO\":6,\"EOPNOTSUPP\":102,\"EOVERFLOW\":84,\"EPERM\":1,\"EPIPE\":32,\"EPROTO\":100,\"EPROTONOSUPPORT\":43,\"EPROTOTYPE\":41,\"ERANGE\":34,\"EROFS\":30,\"ESPIPE\":29,\"ESRCH\":3,\"ESTALE\":70,\"ETIME\":101,\"ETIMEDOUT\":60,\"ETXTBSY\":26,\"EWOULDBLOCK\":35,\"EXDEV\":18,\"SIGHUP\":1,\"SIGINT\":2,\"SIGQUIT\":3,\"SIGILL\":4,\"SIGTRAP\":5,\"SIGABRT\":6,\"SIGIOT\":6,\"SIGBUS\":10,\"SIGFPE\":8,\"SIGKILL\":9,\"SIGUSR1\":30,\"SIGSEGV\":11,\"SIGUSR2\":31,\"SIGPIPE\":13,\"SIGALRM\":14,\"SIGTERM\":15,\"SIGCHLD\":20,\"SIGCONT\":19,\"SIGSTOP\":17,\"SIGTSTP\":18,\"SIGTTIN\":21,\"SIGTTOU\":22,\"SIGURG\":16,\"SIGXCPU\":24,\"SIGXFSZ\":25,\"SIGVTALRM\":26,\"SIGPROF\":27,\"SIGWINCH\":28,\"SIGIO\":23,\"SIGSYS\":12,\"SSL_OP_ALL\":2147486719,\"SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION\":262144,\"SSL_OP_CIPHER_SERVER_PREFERENCE\":4194304,\"SSL_OP_CISCO_ANYCONNECT\":32768,\"SSL_OP_COOKIE_EXCHANGE\":8192,\"SSL_OP_CRYPTOPRO_TLSEXT_BUG\":2147483648,\"SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS\":2048,\"SSL_OP_EPHEMERAL_RSA\":0,\"SSL_OP_LEGACY_SERVER_CONNECT\":4,\"SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER\":32,\"SSL_OP_MICROSOFT_SESS_ID_BUG\":1,\"SSL_OP_MSIE_SSLV2_RSA_PADDING\":0,\"SSL_OP_NETSCAPE_CA_DN_BUG\":536870912,\"SSL_OP_NETSCAPE_CHALLENGE_BUG\":2,\"SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG\":1073741824,\"SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG\":8,\"SSL_OP_NO_COMPRESSION\":131072,\"SSL_OP_NO_QUERY_MTU\":4096,\"SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION\":65536,\"SSL_OP_NO_SSLv2\":16777216,\"SSL_OP_NO_SSLv3\":33554432,\"SSL_OP_NO_TICKET\":16384,\"SSL_OP_NO_TLSv1\":67108864,\"SSL_OP_NO_TLSv1_1\":268435456,\"SSL_OP_NO_TLSv1_2\":134217728,\"SSL_OP_PKCS1_CHECK_1\":0,\"SSL_OP_PKCS1_CHECK_2\":0,\"SSL_OP_SINGLE_DH_USE\":1048576,\"SSL_OP_SINGLE_ECDH_USE\":524288,\"SSL_OP_SSLEAY_080_CLIENT_DH_BUG\":128,\"SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG\":0,\"SSL_OP_TLS_BLOCK_PADDING_BUG\":512,\"SSL_OP_TLS_D5_BUG\":256,\"SSL_OP_TLS_ROLLBACK_BUG\":8388608,\"ENGINE_METHOD_DSA\":2,\"ENGINE_METHOD_DH\":4,\"ENGINE_METHOD_RAND\":8,\"ENGINE_METHOD_ECDH\":16,\"ENGINE_METHOD_ECDSA\":32,\"ENGINE_METHOD_CIPHERS\":64,\"ENGINE_METHOD_DIGESTS\":128,\"ENGINE_METHOD_STORE\":256,\"ENGINE_METHOD_PKEY_METHS\":512,\"ENGINE_METHOD_PKEY_ASN1_METHS\":1024,\"ENGINE_METHOD_ALL\":65535,\"ENGINE_METHOD_NONE\":0,\"DH_CHECK_P_NOT_SAFE_PRIME\":2,\"DH_CHECK_P_NOT_PRIME\":1,\"DH_UNABLE_TO_CHECK_GENERATOR\":4,\"DH_NOT_SUITABLE_GENERATOR\":8,\"NPN_ENABLED\":1,\"RSA_PKCS1_PADDING\":1,\"RSA_SSLV23_PADDING\":2,\"RSA_NO_PADDING\":3,\"RSA_PKCS1_OAEP_PADDING\":4,\"RSA_X931_PADDING\":5,\"RSA_PKCS1_PSS_PADDING\":6,\"POINT_CONVERSION_COMPRESSED\":2,\"POINT_CONVERSION_UNCOMPRESSED\":4,\"POINT_CONVERSION_HYBRID\":6,\"F_OK\":0,\"R_OK\":4,\"W_OK\":2,\"X_OK\":1,\"UV_UDP_REUSEADDR\":4};\n\n//# sourceURL=webpack:///./node_modules/constants-browserify/constants.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/convert-hex/convert-hex.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/convert-hex/convert-hex.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("!function(globals) {\n'use strict'\n\nvar convertHex = {\n bytesToHex: function(bytes) {\n /*if (typeof bytes.byteLength != 'undefined') {\n var newBytes = []\n\n if (typeof bytes.buffer != 'undefined')\n bytes = new DataView(bytes.buffer)\n else\n bytes = new DataView(bytes)\n\n for (var i = 0; i < bytes.byteLength; ++i) {\n newBytes.push(bytes.getUint8(i))\n }\n bytes = newBytes\n }*/\n return arrBytesToHex(bytes)\n },\n hexToBytes: function(hex) {\n if (hex.length % 2 === 1) throw new Error(\"hexToBytes can't have a string with an odd number of characters.\")\n if (hex.indexOf('0x') === 0) hex = hex.slice(2)\n return hex.match(/../g).map(function(x) { return parseInt(x,16) })\n }\n}\n\n\n// PRIVATE\n\nfunction arrBytesToHex(bytes) {\n return bytes.map(function(x) { return padLeft(x.toString(16),2) }).join('')\n}\n\nfunction padLeft(orig, len) {\n if (orig.length > len) return orig\n return Array(len - orig.length + 1).join('0') + orig\n}\n\n\nif ( true && module.exports) { //CommonJS\n module.exports = convertHex\n} else {\n globals.convertHex = convertHex\n}\n\n}(this);\n\n//# sourceURL=webpack:///./node_modules/convert-hex/convert-hex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/convert-string/convert-string.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/convert-string/convert-string.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("!function(globals) {\n'use strict'\n\nvar convertString = {\n bytesToString: function(bytes) {\n return bytes.map(function(x){ return String.fromCharCode(x) }).join('')\n },\n stringToBytes: function(str) {\n return str.split('').map(function(x) { return x.charCodeAt(0) })\n }\n}\n\n//http://hossa.in/2012/07/20/utf-8-in-javascript.html\nconvertString.UTF8 = {\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(convertString.bytesToString(bytes)))\n },\n stringToBytes: function(str) {\n return convertString.stringToBytes(unescape(encodeURIComponent(str)))\n }\n}\n\nif ( true && module.exports) { //CommonJS\n module.exports = convertString\n} else {\n globals.convertString = convertString\n}\n\n}(this);\n\n//# sourceURL=webpack:///./node_modules/convert-string/convert-string.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-util-is/lib/util.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/core-util-is/lib/util.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/core-util-is/lib/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/create-hash/browser.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/create-hash/browser.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\")\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\")\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\")\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\n\nfunction Hash (hash) {\n Base.call(this, 'digest')\n\n this._hash = hash\n}\n\ninherits(Hash, Base)\n\nHash.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHash.prototype._final = function () {\n return this._hash.digest()\n}\n\nmodule.exports = function createHash (alg) {\n alg = alg.toLowerCase()\n if (alg === 'md5') return new MD5()\n if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()\n\n return new Hash(sha(alg))\n}\n\n\n//# sourceURL=webpack:///./node_modules/create-hash/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/create-hash/md5.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/create-hash/md5.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\")\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n\n\n//# sourceURL=webpack:///./node_modules/create-hash/md5.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/create-hmac/browser.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/create-hmac/browser.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Legacy = __webpack_require__(/*! ./legacy */ \"./node_modules/create-hmac/legacy.js\")\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar md5 = __webpack_require__(/*! create-hash/md5 */ \"./node_modules/create-hash/md5.js\")\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\")\n\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\")\n\nvar ZEROS = Buffer.alloc(128)\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n this._alg = alg\n this._key = key\n if (key.length > blocksize) {\n var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n key = hash.update(key).digest()\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n this._hash.update(ipad)\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._hash.digest()\n var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)\n return hash.update(this._opad).update(h).digest()\n}\n\nmodule.exports = function createHmac (alg, key) {\n alg = alg.toLowerCase()\n if (alg === 'rmd160' || alg === 'ripemd160') {\n return new Hmac('rmd160', key)\n }\n if (alg === 'md5') {\n return new Legacy(md5, key)\n }\n return new Hmac(alg, key)\n}\n\n\n//# sourceURL=webpack:///./node_modules/create-hmac/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/create-hmac/legacy.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/create-hmac/legacy.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\n\nvar ZEROS = Buffer.alloc(128)\nvar blocksize = 64\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n this._alg = alg\n this._key = key\n\n if (key.length > blocksize) {\n key = alg(key)\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n this._hash = [ipad]\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.push(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._alg(Buffer.concat(this._hash))\n return this._alg(Buffer.concat([this._opad, h]))\n}\nmodule.exports = Hmac\n\n\n//# sourceURL=webpack:///./node_modules/create-hmac/legacy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/create-torrent/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/create-torrent/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, process, global) {const bencode = __webpack_require__(/*! bencode */ \"./node_modules/bencode/lib/index.js\")\nconst BlockStream = __webpack_require__(/*! block-stream2 */ \"./node_modules/block-stream2/index.js\")\nconst calcPieceLength = __webpack_require__(/*! piece-length */ \"./node_modules/piece-length/index.js\")\nconst corePath = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\nconst FileReadStream = __webpack_require__(/*! filestream/read */ \"./node_modules/filestream/read.js\")\nconst flatten = __webpack_require__(/*! flatten */ \"./node_modules/flatten/index.js\")\nconst fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\")\nconst isFile = __webpack_require__(/*! is-file */ \"./node_modules/is-file/index.js\")\nconst junk = __webpack_require__(/*! junk */ \"./node_modules/junk/index.js\")\nconst MultiStream = __webpack_require__(/*! multistream */ \"./node_modules/create-torrent/node_modules/multistream/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst parallel = __webpack_require__(/*! run-parallel */ \"./node_modules/run-parallel/index.js\")\nconst sha1 = __webpack_require__(/*! simple-sha1 */ \"./node_modules/simple-sha1/browser.js\")\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\nconst announceList = [\n [ 'udp://tracker.leechers-paradise.org:6969' ],\n [ 'udp://tracker.coppersurfer.tk:6969' ],\n [ 'udp://tracker.opentrackr.org:1337' ],\n [ 'udp://explodie.org:6969' ],\n [ 'udp://tracker.empire-js.us:1337' ],\n [ 'wss://tracker.btorrent.xyz' ],\n [ 'wss://tracker.openwebtorrent.com' ],\n [ 'wss://tracker.fastcast.nz' ]\n]\n\n/**\n * Create a torrent.\n * @param {string|File|FileList|Buffer|Stream|Array.<string|File|Buffer|Stream>} input\n * @param {Object} opts\n * @param {string=} opts.name\n * @param {Date=} opts.creationDate\n * @param {string=} opts.comment\n * @param {string=} opts.createdBy\n * @param {boolean|number=} opts.private\n * @param {number=} opts.pieceLength\n * @param {Array.<Array.<string>>=} opts.announceList\n * @param {Array.<string>=} opts.urlList\n * @param {function} cb\n * @return {Buffer} buffer of .torrent file data\n */\nfunction createTorrent (input, opts, cb) {\n if (typeof opts === 'function') [ opts, cb ] = [ cb, opts ]\n opts = opts ? Object.assign({}, opts) : {}\n\n _parseInput(input, opts, (err, files, singleFileTorrent) => {\n if (err) return cb(err)\n opts.singleFileTorrent = singleFileTorrent\n onFiles(files, opts, cb)\n })\n}\n\nfunction parseInput (input, opts, cb) {\n if (typeof opts === 'function') [ opts, cb ] = [ cb, opts ]\n opts = opts ? Object.assign({}, opts) : {}\n _parseInput(input, opts, cb)\n}\n\n/**\n * Parse input file and return file information.\n */\nfunction _parseInput (input, opts, cb) {\n if (isFileList(input)) input = Array.from(input)\n if (!Array.isArray(input)) input = [ input ]\n\n if (input.length === 0) throw new Error('invalid input type')\n\n input.forEach(item => {\n if (item == null) throw new Error(`invalid input type: ${item}`)\n })\n\n // In Electron, use the true file path\n input = input.map(item => {\n if (isBlob(item) && typeof item.path === 'string' && typeof fs.stat === 'function') return item.path\n return item\n })\n\n // If there's just one file, allow the name to be set by `opts.name`\n if (input.length === 1 && typeof input[0] !== 'string' && !input[0].name) input[0].name = opts.name\n\n let commonPrefix = null\n input.forEach((item, i) => {\n if (typeof item === 'string') {\n return\n }\n\n let path = item.fullPath || item.name\n if (!path) {\n path = `Unknown File ${i + 1}`\n item.unknownName = true\n }\n\n item.path = path.split('/')\n\n // Remove initial slash\n if (!item.path[0]) {\n item.path.shift()\n }\n\n if (item.path.length < 2) { // No real prefix\n commonPrefix = null\n } else if (i === 0 && input.length > 1) { // The first file has a prefix\n commonPrefix = item.path[0]\n } else if (item.path[0] !== commonPrefix) { // The prefix doesn't match\n commonPrefix = null\n }\n })\n\n // remove junk files\n input = input.filter(item => {\n if (typeof item === 'string') {\n return true\n }\n const filename = item.path[item.path.length - 1]\n return notHidden(filename) && junk.not(filename)\n })\n\n if (commonPrefix) {\n input.forEach(item => {\n const pathless = (Buffer.isBuffer(item) || isReadable(item)) && !item.path\n if (typeof item === 'string' || pathless) return\n item.path.shift()\n })\n }\n\n if (!opts.name && commonPrefix) {\n opts.name = commonPrefix\n }\n\n if (!opts.name) {\n // use first user-set file name\n input.some(item => {\n if (typeof item === 'string') {\n opts.name = corePath.basename(item)\n return true\n } else if (!item.unknownName) {\n opts.name = item.path[item.path.length - 1]\n return true\n }\n })\n }\n\n if (!opts.name) {\n opts.name = `Unnamed Torrent ${Date.now()}`\n }\n\n const numPaths = input.reduce((sum, item) => sum + Number(typeof item === 'string'), 0)\n\n let isSingleFileTorrent = (input.length === 1)\n\n if (input.length === 1 && typeof input[0] === 'string') {\n if (typeof fs.stat !== 'function') {\n throw new Error('filesystem paths do not work in the browser')\n }\n // If there's a single path, verify it's a file before deciding this is a single\n // file torrent\n isFile(input[0], (err, pathIsFile) => {\n if (err) return cb(err)\n isSingleFileTorrent = pathIsFile\n processInput()\n })\n } else {\n process.nextTick(() => {\n processInput()\n })\n }\n\n function processInput () {\n parallel(input.map(item => cb => {\n const file = {}\n\n if (isBlob(item)) {\n file.getStream = getBlobStream(item)\n file.length = item.size\n } else if (Buffer.isBuffer(item)) {\n file.getStream = getBufferStream(item)\n file.length = item.length\n } else if (isReadable(item)) {\n file.getStream = getStreamStream(item, file)\n file.length = 0\n } else if (typeof item === 'string') {\n if (typeof fs.stat !== 'function') {\n throw new Error('filesystem paths do not work in the browser')\n }\n const keepRoot = numPaths > 1 || isSingleFileTorrent\n getFiles(item, keepRoot, cb)\n return // early return!\n } else {\n throw new Error('invalid input type')\n }\n file.path = item.path\n cb(null, file)\n }), (err, files) => {\n if (err) return cb(err)\n files = flatten(files)\n cb(null, files, isSingleFileTorrent)\n })\n }\n}\n\nfunction getFiles (path, keepRoot, cb) {\n traversePath(path, getFileInfo, (err, files) => {\n if (err) return cb(err)\n\n if (Array.isArray(files)) files = flatten(files)\n else files = [ files ]\n\n path = corePath.normalize(path)\n if (keepRoot) {\n path = path.slice(0, path.lastIndexOf(corePath.sep) + 1)\n }\n if (path[path.length - 1] !== corePath.sep) path += corePath.sep\n\n files.forEach(file => {\n file.getStream = getFilePathStream(file.path)\n file.path = file.path.replace(path, '').split(corePath.sep)\n })\n cb(null, files)\n })\n}\n\nfunction getFileInfo (path, cb) {\n cb = once(cb)\n fs.stat(path, (err, stat) => {\n if (err) return cb(err)\n const info = {\n length: stat.size,\n path\n }\n cb(null, info)\n })\n}\n\nfunction traversePath (path, fn, cb) {\n fs.stat(path, (err, stats) => {\n if (err) return cb(err)\n if (stats.isDirectory()) {\n fs.readdir(path, (err, entries) => {\n if (err) return cb(err)\n parallel(entries.filter(notHidden).filter(junk.not).map(entry => cb => {\n traversePath(corePath.join(path, entry), fn, cb)\n }), cb)\n })\n } else if (stats.isFile()) {\n fn(path, cb)\n }\n // Ignore other types (not a file or directory)\n })\n}\n\nfunction notHidden (file) {\n return file[0] !== '.'\n}\n\nfunction getPieceList (files, pieceLength, cb) {\n cb = once(cb)\n const pieces = []\n let length = 0\n\n const streams = files.map(file => file.getStream)\n\n let remainingHashes = 0\n let pieceNum = 0\n let ended = false\n\n const multistream = new MultiStream(streams)\n const blockstream = new BlockStream(pieceLength, { zeroPadding: false })\n\n multistream.on('error', onError)\n\n multistream\n .pipe(blockstream)\n .on('data', onData)\n .on('end', onEnd)\n .on('error', onError)\n\n function onData (chunk) {\n length += chunk.length\n\n const i = pieceNum\n sha1(chunk, hash => {\n pieces[i] = hash\n remainingHashes -= 1\n maybeDone()\n })\n remainingHashes += 1\n pieceNum += 1\n }\n\n function onEnd () {\n ended = true\n maybeDone()\n }\n\n function onError (err) {\n cleanup()\n cb(err)\n }\n\n function cleanup () {\n multistream.removeListener('error', onError)\n blockstream.removeListener('data', onData)\n blockstream.removeListener('end', onEnd)\n blockstream.removeListener('error', onError)\n }\n\n function maybeDone () {\n if (ended && remainingHashes === 0) {\n cleanup()\n cb(null, Buffer.from(pieces.join(''), 'hex'), length)\n }\n }\n}\n\nfunction onFiles (files, opts, cb) {\n let announceList = opts.announceList\n\n if (!announceList) {\n if (typeof opts.announce === 'string') announceList = [ [ opts.announce ] ]\n else if (Array.isArray(opts.announce)) {\n announceList = opts.announce.map(u => [ u ])\n }\n }\n\n if (!announceList) announceList = []\n\n if (global.WEBTORRENT_ANNOUNCE) {\n if (typeof global.WEBTORRENT_ANNOUNCE === 'string') {\n announceList.push([ [ global.WEBTORRENT_ANNOUNCE ] ])\n } else if (Array.isArray(global.WEBTORRENT_ANNOUNCE)) {\n announceList = announceList.concat(global.WEBTORRENT_ANNOUNCE.map(u => [ u ]))\n }\n }\n\n // When no trackers specified, use some reasonable defaults\n if (opts.announce === undefined && opts.announceList === undefined) {\n announceList = announceList.concat(module.exports.announceList)\n }\n\n if (typeof opts.urlList === 'string') opts.urlList = [ opts.urlList ]\n\n const torrent = {\n info: {\n name: opts.name\n },\n 'creation date': Math.ceil((Number(opts.creationDate) || Date.now()) / 1000),\n encoding: 'UTF-8'\n }\n\n if (announceList.length !== 0) {\n torrent.announce = announceList[0][0]\n torrent['announce-list'] = announceList\n }\n\n if (opts.comment !== undefined) torrent.comment = opts.comment\n\n if (opts.createdBy !== undefined) torrent['created by'] = opts.createdBy\n\n if (opts.private !== undefined) torrent.info.private = Number(opts.private)\n\n // \"ssl-cert\" key is for SSL torrents, see:\n // - http://blog.libtorrent.org/2012/01/bittorrent-over-ssl/\n // - http://www.libtorrent.org/manual-ref.html#ssl-torrents\n // - http://www.libtorrent.org/reference-Create_Torrents.html\n if (opts.sslCert !== undefined) torrent.info['ssl-cert'] = opts.sslCert\n\n if (opts.urlList !== undefined) torrent['url-list'] = opts.urlList\n\n const pieceLength = opts.pieceLength || calcPieceLength(files.reduce(sumLength, 0))\n torrent.info['piece length'] = pieceLength\n\n getPieceList(files, pieceLength, (err, pieces, torrentLength) => {\n if (err) return cb(err)\n torrent.info.pieces = pieces\n\n files.forEach(file => {\n delete file.getStream\n })\n\n if (opts.singleFileTorrent) {\n torrent.info.length = torrentLength\n } else {\n torrent.info.files = files\n }\n\n cb(null, bencode.encode(torrent))\n })\n}\n\n/**\n * Accumulator to sum file lengths\n * @param {number} sum\n * @param {Object} file\n * @return {number}\n */\nfunction sumLength (sum, file) {\n return sum + file.length\n}\n\n/**\n * Check if `obj` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} obj\n * @return {boolean}\n */\nfunction isBlob (obj) {\n return typeof Blob !== 'undefined' && obj instanceof Blob\n}\n\n/**\n * Check if `obj` is a W3C `FileList` object\n * @param {*} obj\n * @return {boolean}\n */\nfunction isFileList (obj) {\n return typeof FileList !== 'undefined' && obj instanceof FileList\n}\n\n/**\n * Check if `obj` is a node Readable stream\n * @param {*} obj\n * @return {boolean}\n */\nfunction isReadable (obj) {\n return typeof obj === 'object' && obj != null && typeof obj.pipe === 'function'\n}\n\n/**\n * Convert a `File` to a lazy readable stream.\n * @param {File|Blob} file\n * @return {function}\n */\nfunction getBlobStream (file) {\n return () => new FileReadStream(file)\n}\n\n/**\n * Convert a `Buffer` to a lazy readable stream.\n * @param {Buffer} buffer\n * @return {function}\n */\nfunction getBufferStream (buffer) {\n return () => {\n const s = new stream.PassThrough()\n s.end(buffer)\n return s\n }\n}\n\n/**\n * Convert a file path to a lazy readable stream.\n * @param {string} path\n * @return {function}\n */\nfunction getFilePathStream (path) {\n return () => fs.createReadStream(path)\n}\n\n/**\n * Convert a readable stream to a lazy readable stream. Adds instrumentation to track\n * the number of bytes in the stream and set `file.length`.\n *\n * @param {Stream} stream\n * @param {Object} file\n * @return {function}\n */\nfunction getStreamStream (readable, file) {\n return () => {\n const counter = new stream.Transform()\n counter._transform = function (buf, enc, done) {\n file.length += buf.length\n this.push(buf)\n done()\n }\n readable.pipe(counter)\n return counter\n }\n}\n\nmodule.exports = createTorrent\nmodule.exports.parseInput = parseInput\nmodule.exports.announceList = announceList\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/create-torrent/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/create-torrent/node_modules/multistream/index.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/create-torrent/node_modules/multistream/index.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = MultiStream\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\ninherits(MultiStream, stream.Readable)\n\nfunction MultiStream (streams, opts) {\n var self = this\n if (!(self instanceof MultiStream)) return new MultiStream(streams, opts)\n stream.Readable.call(self, opts)\n\n self.destroyed = false\n\n self._drained = false\n self._forwarding = false\n self._current = null\n self._toStreams2 = (opts && opts.objectMode) ? toStreams2Obj : toStreams2Buf\n\n if (typeof streams === 'function') {\n self._queue = streams\n } else {\n self._queue = streams.map(self._toStreams2)\n self._queue.forEach(function (stream) {\n if (typeof stream !== 'function') self._attachErrorListener(stream)\n })\n }\n\n self._next()\n}\n\nMultiStream.obj = function (streams) {\n return new MultiStream(streams, { objectMode: true, highWaterMark: 16 })\n}\n\nMultiStream.prototype._read = function () {\n this._drained = true\n this._forward()\n}\n\nMultiStream.prototype._forward = function () {\n if (this._forwarding || !this._drained || !this._current) return\n this._forwarding = true\n\n var chunk\n while ((chunk = this._current.read()) !== null) {\n this._drained = this.push(chunk)\n }\n\n this._forwarding = false\n}\n\nMultiStream.prototype.destroy = function (err) {\n if (this.destroyed) return\n this.destroyed = true\n\n if (this._current && this._current.destroy) this._current.destroy()\n if (typeof this._queue !== 'function') {\n this._queue.forEach(function (stream) {\n if (stream.destroy) stream.destroy()\n })\n }\n\n if (err) this.emit('error', err)\n this.emit('close')\n}\n\nMultiStream.prototype._next = function () {\n var self = this\n self._current = null\n\n if (typeof self._queue === 'function') {\n self._queue(function (err, stream) {\n if (err) return self.destroy(err)\n stream = self._toStreams2(stream)\n self._attachErrorListener(stream)\n self._gotNextStream(stream)\n })\n } else {\n var stream = self._queue.shift()\n if (typeof stream === 'function') {\n stream = self._toStreams2(stream())\n self._attachErrorListener(stream)\n }\n self._gotNextStream(stream)\n }\n}\n\nMultiStream.prototype._gotNextStream = function (stream) {\n var self = this\n\n if (!stream) {\n self.push(null)\n self.destroy()\n return\n }\n\n self._current = stream\n self._forward()\n\n stream.on('readable', onReadable)\n stream.once('end', onEnd)\n stream.once('close', onClose)\n\n function onReadable () {\n self._forward()\n }\n\n function onClose () {\n if (!stream._readableState.ended) {\n self.destroy()\n }\n }\n\n function onEnd () {\n self._current = null\n stream.removeListener('readable', onReadable)\n stream.removeListener('end', onEnd)\n stream.removeListener('close', onClose)\n self._next()\n }\n}\n\nMultiStream.prototype._attachErrorListener = function (stream) {\n var self = this\n if (!stream) return\n\n stream.once('error', onError)\n\n function onError (err) {\n stream.removeListener('error', onError)\n self.destroy(err)\n }\n}\n\nfunction toStreams2Obj (s) {\n return toStreams2(s, { objectMode: true, highWaterMark: 16 })\n}\n\nfunction toStreams2Buf (s) {\n return toStreams2(s)\n}\n\nfunction toStreams2 (s, opts) {\n if (!s || typeof s === 'function' || s._readableState) return s\n\n var wrap = new stream.Readable(opts).wrap(s)\n if (s.destroy) {\n wrap.destroy = s.destroy.bind(s)\n }\n return wrap\n}\n\n\n//# sourceURL=webpack:///./node_modules/create-torrent/node_modules/multistream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/debug/src/browser.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/debug/src/browser.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/debug/src/common.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/debug/src/common.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/defined/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/defined/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function () {\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[i] !== undefined) return arguments[i];\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/defined/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/delayed-stream/lib/delayed_stream.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/delayed-stream/lib/delayed_stream.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Stream;\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n\n\n//# sourceURL=webpack:///./node_modules/delayed-stream/lib/delayed_stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/detect-node/browser.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/detect-node/browser.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = false;\n\n\n\n//# sourceURL=webpack:///./node_modules/detect-node/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/drbg.js/hmac.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/drbg.js/hmac.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar createHmac = __webpack_require__(/*! create-hmac */ \"./node_modules/create-hmac/browser.js\")\nvar hashInfo = __webpack_require__(/*! ./lib/hash-info.json */ \"./node_modules/drbg.js/lib/hash-info.json\")\n\nvar ebuf = new Buffer(0)\nvar b0x00 = new Buffer([ 0x00 ])\nvar b0x01 = new Buffer([ 0x01 ])\n\nfunction HmacDRBG (algo, entropy, nonce, pers) {\n var info = hashInfo[algo]\n if (info === undefined) throw new Error('hash ' + algo + ' is not supported')\n\n this._algo = algo\n this._securityStrength = info.securityStrength / 8\n this._outlen = info.outlen / 8\n this._reseedInterval = 0x1000000000000 // 2**48\n\n this._init(entropy, nonce, pers)\n}\n\nHmacDRBG.prototype._update = function (seed) {\n var kmac = createHmac(this._algo, this._K).update(this._V).update(b0x00)\n if (seed) kmac.update(seed)\n\n this._K = kmac.digest()\n this._V = createHmac(this._algo, this._K).update(this._V).digest()\n if (!seed) return\n\n this._K = createHmac(this._algo, this._K).update(this._V).update(b0x01).update(seed).digest()\n this._V = createHmac(this._algo, this._K).update(this._V).digest()\n}\n\nHmacDRBG.prototype._init = function (entropy, nonce, pers) {\n if (entropy.length < this._securityStrength) throw new Error('Not enough entropy')\n\n this._K = new Buffer(this._outlen)\n this._V = new Buffer(this._outlen)\n for (var i = 0; i < this._K.length; ++i) {\n this._K[i] = 0x00\n this._V[i] = 0x01\n }\n\n this._update(Buffer.concat([ entropy, nonce, pers || ebuf ]))\n this._reseed = 1\n}\n\nHmacDRBG.prototype.reseed = function (entropy, add) {\n if (entropy.length < this._securityStrength) throw new Error('Not enough entropy')\n\n this._update(Buffer.concat([ entropy, add || ebuf ]))\n this._reseed = 1\n}\n\nHmacDRBG.prototype.generate = function (len, add) {\n if (this._reseed > this._reseedInterval) throw new Error('Reseed is required')\n\n if (add && add.length === 0) add = undefined\n if (add) this._update(add)\n\n var temp = new Buffer(0)\n while (temp.length < len) {\n this._V = createHmac(this._algo, this._K).update(this._V).digest()\n temp = Buffer.concat([ temp, this._V ])\n }\n\n this._update(add)\n this._reseed += 1\n return temp.slice(0, len)\n}\n\nmodule.exports = HmacDRBG\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/drbg.js/hmac.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/drbg.js/lib/hash-info.json":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/drbg.js/lib/hash-info.json ***!
|
||
\*************************************************/
|
||
/*! exports provided: sha1, sha224, sha256, sha384, sha512, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"sha1\":{\"securityStrength\":128,\"outlen\":160,\"seedlen\":440},\"sha224\":{\"securityStrength\":192,\"outlen\":224,\"seedlen\":440},\"sha256\":{\"securityStrength\":256,\"outlen\":256,\"seedlen\":440},\"sha384\":{\"securityStrength\":256,\"outlen\":384,\"seedlen\":888},\"sha512\":{\"securityStrength\":256,\"outlen\":512,\"seedlen\":888}};\n\n//# sourceURL=webpack:///./node_modules/drbg.js/lib/hash-info.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ecc-jsbn/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ecc-jsbn/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar BigInteger = __webpack_require__(/*! jsbn */ \"./node_modules/jsbn/index.js\").BigInteger;\nvar ECPointFp = __webpack_require__(/*! ./lib/ec.js */ \"./node_modules/ecc-jsbn/lib/ec.js\").ECPointFp;\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nexports.ECCurves = __webpack_require__(/*! ./lib/sec.js */ \"./node_modules/ecc-jsbn/lib/sec.js\");\n\n// zero prepad\nfunction unstupid(hex,len)\n{\n\treturn (hex.length >= len) ? hex : unstupid(\"0\"+hex,len);\n}\n\nexports.ECKey = function(curve, key, isPublic)\n{\n var priv;\n\tvar c = curve();\n\tvar n = c.getN();\n var bytes = Math.floor(n.bitLength()/8);\n\n if(key)\n {\n if(isPublic)\n {\n var curve = c.getCurve();\n// var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format\n// var y = key.slice(bytes+1);\n// this.P = new ECPointFp(curve,\n// curve.fromBigInteger(new BigInteger(x.toString(\"hex\"), 16)),\n// curve.fromBigInteger(new BigInteger(y.toString(\"hex\"), 16))); \n this.P = curve.decodePointHex(key.toString(\"hex\"));\n }else{\n if(key.length != bytes) return false;\n priv = new BigInteger(key.toString(\"hex\"), 16); \n }\n }else{\n var n1 = n.subtract(BigInteger.ONE);\n var r = new BigInteger(crypto.randomBytes(n.bitLength()));\n priv = r.mod(n1).add(BigInteger.ONE);\n this.P = c.getG().multiply(priv);\n }\n if(this.P)\n {\n// var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2);\n// this.PublicKey = Buffer.from(\"04\"+pubhex,\"hex\");\n this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),\"hex\");\n }\n if(priv)\n {\n this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),\"hex\");\n this.deriveSharedSecret = function(key)\n {\n if(!key || !key.P) return false;\n var S = key.P.multiply(priv);\n return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),\"hex\");\n } \n }\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/ecc-jsbn/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ecc-jsbn/lib/ec.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ecc-jsbn/lib/ec.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Basic Javascript Elliptic Curve implementation\n// Ported loosely from BouncyCastle's Java EC code\n// Only Fp curves implemented for now\n\n// Requires jsbn.js and jsbn2.js\nvar BigInteger = __webpack_require__(/*! jsbn */ \"./node_modules/jsbn/index.js\").BigInteger\nvar Barrett = BigInteger.prototype.Barrett\n\n// ----------------\n// ECFieldElementFp\n\n// constructor\nfunction ECFieldElementFp(q,x) {\n this.x = x;\n // TODO if(x.compareTo(q) >= 0) error\n this.q = q;\n}\n\nfunction feFpEquals(other) {\n if(other == this) return true;\n return (this.q.equals(other.q) && this.x.equals(other.x));\n}\n\nfunction feFpToBigInteger() {\n return this.x;\n}\n\nfunction feFpNegate() {\n return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));\n}\n\nfunction feFpAdd(b) {\n return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpSubtract(b) {\n return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpMultiply(b) {\n return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpSquare() {\n return new ECFieldElementFp(this.q, this.x.square().mod(this.q));\n}\n\nfunction feFpDivide(b) {\n return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));\n}\n\nECFieldElementFp.prototype.equals = feFpEquals;\nECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;\nECFieldElementFp.prototype.negate = feFpNegate;\nECFieldElementFp.prototype.add = feFpAdd;\nECFieldElementFp.prototype.subtract = feFpSubtract;\nECFieldElementFp.prototype.multiply = feFpMultiply;\nECFieldElementFp.prototype.square = feFpSquare;\nECFieldElementFp.prototype.divide = feFpDivide;\n\n// ----------------\n// ECPointFp\n\n// constructor\nfunction ECPointFp(curve,x,y,z) {\n this.curve = curve;\n this.x = x;\n this.y = y;\n // Projective coordinates: either zinv == null or z * zinv == 1\n // z and zinv are just BigIntegers, not fieldElements\n if(z == null) {\n this.z = BigInteger.ONE;\n }\n else {\n this.z = z;\n }\n this.zinv = null;\n //TODO: compression flag\n}\n\nfunction pointFpGetX() {\n if(this.zinv == null) {\n this.zinv = this.z.modInverse(this.curve.q);\n }\n var r = this.x.toBigInteger().multiply(this.zinv);\n this.curve.reduce(r);\n return this.curve.fromBigInteger(r);\n}\n\nfunction pointFpGetY() {\n if(this.zinv == null) {\n this.zinv = this.z.modInverse(this.curve.q);\n }\n var r = this.y.toBigInteger().multiply(this.zinv);\n this.curve.reduce(r);\n return this.curve.fromBigInteger(r);\n}\n\nfunction pointFpEquals(other) {\n if(other == this) return true;\n if(this.isInfinity()) return other.isInfinity();\n if(other.isInfinity()) return this.isInfinity();\n var u, v;\n // u = Y2 * Z1 - Y1 * Z2\n u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);\n if(!u.equals(BigInteger.ZERO)) return false;\n // v = X2 * Z1 - X1 * Z2\n v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);\n return v.equals(BigInteger.ZERO);\n}\n\nfunction pointFpIsInfinity() {\n if((this.x == null) && (this.y == null)) return true;\n return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);\n}\n\nfunction pointFpNegate() {\n return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);\n}\n\nfunction pointFpAdd(b) {\n if(this.isInfinity()) return b;\n if(b.isInfinity()) return this;\n\n // u = Y2 * Z1 - Y1 * Z2\n var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);\n // v = X2 * Z1 - X1 * Z2\n var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);\n\n if(BigInteger.ZERO.equals(v)) {\n if(BigInteger.ZERO.equals(u)) {\n return this.twice(); // this == b, so double\n }\n\treturn this.curve.getInfinity(); // this = -b, so infinity\n }\n\n var THREE = new BigInteger(\"3\");\n var x1 = this.x.toBigInteger();\n var y1 = this.y.toBigInteger();\n var x2 = b.x.toBigInteger();\n var y2 = b.y.toBigInteger();\n\n var v2 = v.square();\n var v3 = v2.multiply(v);\n var x1v2 = x1.multiply(v2);\n var zu2 = u.square().multiply(this.z);\n\n // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)\n var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q);\n // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3\n var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q);\n // z3 = v^3 * z1 * z2\n var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q);\n\n return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);\n}\n\nfunction pointFpTwice() {\n if(this.isInfinity()) return this;\n if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();\n\n // TODO: optimized handling of constants\n var THREE = new BigInteger(\"3\");\n var x1 = this.x.toBigInteger();\n var y1 = this.y.toBigInteger();\n\n var y1z1 = y1.multiply(this.z);\n var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);\n var a = this.curve.a.toBigInteger();\n\n // w = 3 * x1^2 + a * z1^2\n var w = x1.square().multiply(THREE);\n if(!BigInteger.ZERO.equals(a)) {\n w = w.add(this.z.square().multiply(a));\n }\n w = w.mod(this.curve.q);\n //this.curve.reduce(w);\n // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)\n var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);\n // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3\n var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);\n // z3 = 8 * (y1 * z1)^3\n var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);\n\n return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);\n}\n\n// Simple NAF (Non-Adjacent Form) multiplication algorithm\n// TODO: modularize the multiplication algorithm\nfunction pointFpMultiply(k) {\n if(this.isInfinity()) return this;\n if(k.signum() == 0) return this.curve.getInfinity();\n\n var e = k;\n var h = e.multiply(new BigInteger(\"3\"));\n\n var neg = this.negate();\n var R = this;\n\n var i;\n for(i = h.bitLength() - 2; i > 0; --i) {\n\tR = R.twice();\n\n\tvar hBit = h.testBit(i);\n\tvar eBit = e.testBit(i);\n\n\tif (hBit != eBit) {\n\t R = R.add(hBit ? this : neg);\n\t}\n }\n\n return R;\n}\n\n// Compute this*j + x*k (simultaneous multiplication)\nfunction pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}\n\nECPointFp.prototype.getX = pointFpGetX;\nECPointFp.prototype.getY = pointFpGetY;\nECPointFp.prototype.equals = pointFpEquals;\nECPointFp.prototype.isInfinity = pointFpIsInfinity;\nECPointFp.prototype.negate = pointFpNegate;\nECPointFp.prototype.add = pointFpAdd;\nECPointFp.prototype.twice = pointFpTwice;\nECPointFp.prototype.multiply = pointFpMultiply;\nECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;\n\n// ----------------\n// ECCurveFp\n\n// constructor\nfunction ECCurveFp(q,a,b) {\n this.q = q;\n this.a = this.fromBigInteger(a);\n this.b = this.fromBigInteger(b);\n this.infinity = new ECPointFp(this, null, null);\n this.reducer = new Barrett(this.q);\n}\n\nfunction curveFpGetQ() {\n return this.q;\n}\n\nfunction curveFpGetA() {\n return this.a;\n}\n\nfunction curveFpGetB() {\n return this.b;\n}\n\nfunction curveFpEquals(other) {\n if(other == this) return true;\n return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b));\n}\n\nfunction curveFpGetInfinity() {\n return this.infinity;\n}\n\nfunction curveFpFromBigInteger(x) {\n return new ECFieldElementFp(this.q, x);\n}\n\nfunction curveReduce(x) {\n this.reducer.reduce(x);\n}\n\n// for now, work with hex strings because they're easier in JS\nfunction curveFpDecodePointHex(s) {\n switch(parseInt(s.substr(0,2), 16)) { // first byte\n case 0:\n\treturn this.infinity;\n case 2:\n case 3:\n\t// point compression not supported yet\n\treturn null;\n case 4:\n case 6:\n case 7:\n\tvar len = (s.length - 2) / 2;\n\tvar xHex = s.substr(2, len);\n\tvar yHex = s.substr(len+2, len);\n\n\treturn new ECPointFp(this,\n\t\t\t this.fromBigInteger(new BigInteger(xHex, 16)),\n\t\t\t this.fromBigInteger(new BigInteger(yHex, 16)));\n\n default: // unsupported\n\treturn null;\n }\n}\n\nfunction curveFpEncodePointHex(p) {\n\tif (p.isInfinity()) return \"00\";\n\tvar xHex = p.getX().toBigInteger().toString(16);\n\tvar yHex = p.getY().toBigInteger().toString(16);\n\tvar oLen = this.getQ().toString(16).length;\n\tif ((oLen % 2) != 0) oLen++;\n\twhile (xHex.length < oLen) {\n\t\txHex = \"0\" + xHex;\n\t}\n\twhile (yHex.length < oLen) {\n\t\tyHex = \"0\" + yHex;\n\t}\n\treturn \"04\" + xHex + yHex;\n}\n\nECCurveFp.prototype.getQ = curveFpGetQ;\nECCurveFp.prototype.getA = curveFpGetA;\nECCurveFp.prototype.getB = curveFpGetB;\nECCurveFp.prototype.equals = curveFpEquals;\nECCurveFp.prototype.getInfinity = curveFpGetInfinity;\nECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;\nECCurveFp.prototype.reduce = curveReduce;\n//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex;\nECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;\n\n// from: https://github.com/kaielvin/jsbn-ec-point-compression\nECCurveFp.prototype.decodePointHex = function(s)\n{\n\tvar yIsEven;\n switch(parseInt(s.substr(0,2), 16)) { // first byte\n case 0:\n\treturn this.infinity;\n case 2:\n\tyIsEven = false;\n case 3:\n\tif(yIsEven == undefined) yIsEven = true;\n\tvar len = s.length - 2;\n\tvar xHex = s.substr(2, len);\n\tvar x = this.fromBigInteger(new BigInteger(xHex,16));\n\tvar alpha = x.multiply(x.square().add(this.getA())).add(this.getB());\n\tvar beta = alpha.sqrt();\n\n if (beta == null) throw \"Invalid point compression\";\n\n var betaValue = beta.toBigInteger();\n if (betaValue.testBit(0) != yIsEven)\n {\n // Use the other root\n beta = this.fromBigInteger(this.getQ().subtract(betaValue));\n }\n return new ECPointFp(this,x,beta);\n case 4:\n case 6:\n case 7:\n\tvar len = (s.length - 2) / 2;\n\tvar xHex = s.substr(2, len);\n\tvar yHex = s.substr(len+2, len);\n\n\treturn new ECPointFp(this,\n\t\t\t this.fromBigInteger(new BigInteger(xHex, 16)),\n\t\t\t this.fromBigInteger(new BigInteger(yHex, 16)));\n\n default: // unsupported\n\treturn null;\n }\n}\nECCurveFp.prototype.encodeCompressedPointHex = function(p)\n{\n\tif (p.isInfinity()) return \"00\";\n\tvar xHex = p.getX().toBigInteger().toString(16);\n\tvar oLen = this.getQ().toString(16).length;\n\tif ((oLen % 2) != 0) oLen++;\n\twhile (xHex.length < oLen)\n\t\txHex = \"0\" + xHex;\n\tvar yPrefix;\n\tif(p.getY().toBigInteger().isEven()) yPrefix = \"02\";\n\telse yPrefix = \"03\";\n\n\treturn yPrefix + xHex;\n}\n\n\nECFieldElementFp.prototype.getR = function()\n{\n\tif(this.r != undefined) return this.r;\n\n this.r = null;\n var bitLength = this.q.bitLength();\n if (bitLength > 128)\n {\n var firstWord = this.q.shiftRight(bitLength - 64);\n if (firstWord.intValue() == -1)\n {\n this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);\n }\n }\n return this.r;\n}\nECFieldElementFp.prototype.modMult = function(x1,x2)\n{\n return this.modReduce(x1.multiply(x2));\n}\nECFieldElementFp.prototype.modReduce = function(x)\n{\n if (this.getR() != null)\n {\n var qLen = q.bitLength();\n while (x.bitLength() > (qLen + 1))\n {\n var u = x.shiftRight(qLen);\n var v = x.subtract(u.shiftLeft(qLen));\n if (!this.getR().equals(BigInteger.ONE))\n {\n u = u.multiply(this.getR());\n }\n x = u.add(v); \n }\n while (x.compareTo(q) >= 0)\n {\n x = x.subtract(q);\n }\n }\n else\n {\n x = x.mod(q);\n }\n return x;\n}\nECFieldElementFp.prototype.sqrt = function()\n{\n if (!this.q.testBit(0)) throw \"unsupported\";\n\n // p mod 4 == 3\n if (this.q.testBit(1))\n {\n \tvar z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));\n \treturn z.square().equals(this) ? z : null;\n }\n\n // p mod 4 == 1\n var qMinusOne = this.q.subtract(BigInteger.ONE);\n\n var legendreExponent = qMinusOne.shiftRight(1);\n if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)))\n {\n return null;\n }\n\n var u = qMinusOne.shiftRight(2);\n var k = u.shiftLeft(1).add(BigInteger.ONE);\n\n var Q = this.x;\n var fourQ = modDouble(modDouble(Q));\n\n var U, V;\n do\n {\n var P;\n do\n {\n P = new BigInteger(this.q.bitLength(), new SecureRandom());\n }\n while (P.compareTo(this.q) >= 0\n || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)));\n\n var result = this.lucasSequence(P, Q, k);\n U = result[0];\n V = result[1];\n\n if (this.modMult(V, V).equals(fourQ))\n {\n // Integer division by 2, mod q\n if (V.testBit(0))\n {\n V = V.add(q);\n }\n\n V = V.shiftRight(1);\n\n return new ECFieldElementFp(q,V);\n }\n }\n while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));\n\n return null;\n}\nECFieldElementFp.prototype.lucasSequence = function(P,Q,k)\n{\n var n = k.bitLength();\n var s = k.getLowestSetBit();\n\n var Uh = BigInteger.ONE;\n var Vl = BigInteger.TWO;\n var Vh = P;\n var Ql = BigInteger.ONE;\n var Qh = BigInteger.ONE;\n\n for (var j = n - 1; j >= s + 1; --j)\n {\n Ql = this.modMult(Ql, Qh);\n\n if (k.testBit(j))\n {\n Qh = this.modMult(Ql, Q);\n Uh = this.modMult(Uh, Vh);\n Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));\n }\n else\n {\n Qh = Ql;\n Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));\n Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));\n }\n }\n\n Ql = this.modMult(Ql, Qh);\n Qh = this.modMult(Ql, Q);\n Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));\n Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Ql = this.modMult(Ql, Qh);\n\n for (var j = 1; j <= s; ++j)\n {\n Uh = this.modMult(Uh, Vl);\n Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));\n Ql = this.modMult(Ql, Ql);\n }\n\n return [ Uh, Vl ];\n}\n\nvar exports = {\n ECCurveFp: ECCurveFp,\n ECPointFp: ECPointFp,\n ECFieldElementFp: ECFieldElementFp\n}\n\nmodule.exports = exports\n\n\n//# sourceURL=webpack:///./node_modules/ecc-jsbn/lib/ec.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ecc-jsbn/lib/sec.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ecc-jsbn/lib/sec.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Named EC curves\n\n// Requires ec.js, jsbn.js, and jsbn2.js\nvar BigInteger = __webpack_require__(/*! jsbn */ \"./node_modules/jsbn/index.js\").BigInteger\nvar ECCurveFp = __webpack_require__(/*! ./ec.js */ \"./node_modules/ecc-jsbn/lib/ec.js\").ECCurveFp\n\n\n// ----------------\n// X9ECParameters\n\n// constructor\nfunction X9ECParameters(curve,g,n,h) {\n this.curve = curve;\n this.g = g;\n this.n = n;\n this.h = h;\n}\n\nfunction x9getCurve() {\n return this.curve;\n}\n\nfunction x9getG() {\n return this.g;\n}\n\nfunction x9getN() {\n return this.n;\n}\n\nfunction x9getH() {\n return this.h;\n}\n\nX9ECParameters.prototype.getCurve = x9getCurve;\nX9ECParameters.prototype.getG = x9getG;\nX9ECParameters.prototype.getN = x9getN;\nX9ECParameters.prototype.getH = x9getH;\n\n// ----------------\n// SECNamedCurves\n\nfunction fromHex(s) { return new BigInteger(s, 16); }\n\nfunction secp128r1() {\n // p = 2^128 - 2^97 - 1\n var p = fromHex(\"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"E87579C11079F43DD824993C2CEE5ED3\");\n //byte[] S = Hex.decode(\"000E0D4D696E6768756151750CC03A4473D03679\");\n var n = fromHex(\"FFFFFFFE0000000075A30D1B9038A115\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"161FF7528B899B2D0C28607CA52C5B86\"\n\t\t+ \"CF5AC8395BAFEB13C02DA292DDED7A83\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp160k1() {\n // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\n var a = BigInteger.ZERO;\n var b = fromHex(\"7\");\n //byte[] S = null;\n var n = fromHex(\"0100000000000000000001B8FA16DFAB9ACA16B6B3\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"3B4C382CE37AA192A4019E763036F4F5DD4D7EBB\"\n + \"938CF935318FDCED6BC28286531733C3F03C4FEE\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp160r1() {\n // p = 2^160 - 2^31 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC\");\n var b = fromHex(\"1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45\");\n //byte[] S = Hex.decode(\"1053CDE42C14D696E67687561517533BF3F83345\");\n var n = fromHex(\"0100000000000000000001F4C8F927AED3CA752257\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n\t\t+ \"4A96B5688EF573284664698968C38BB913CBFC82\"\n\t\t+ \"23A628553168947D59DCC912042351377AC5FB32\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp192k1() {\n // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\n var a = BigInteger.ZERO;\n var b = fromHex(\"3\");\n //byte[] S = null;\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp192r1() {\n // p = 2^192 - 2^64 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1\");\n //byte[] S = Hex.decode(\"3045AE6FC8422F64ED579528D38120EAE12196D5\");\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012\"\n + \"07192B95FFC8DA78631011ED6B24CDD573F977A11E794811\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp224r1() {\n // p = 2^224 - 2^96 + 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE\");\n var b = fromHex(\"B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4\");\n //byte[] S = Hex.decode(\"BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5\");\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21\"\n + \"BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp256r1() {\n // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1\n var p = fromHex(\"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B\");\n //byte[] S = Hex.decode(\"C49D360886E704936A6678E1139D26B7819F7E90\");\n var n = fromHex(\"FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296\"\n\t\t+ \"4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5\");\n return new X9ECParameters(curve, G, n, h);\n}\n\n// TODO: make this into a proper hashtable\nfunction getSECCurveByName(name) {\n if(name == \"secp128r1\") return secp128r1();\n if(name == \"secp160k1\") return secp160k1();\n if(name == \"secp160r1\") return secp160r1();\n if(name == \"secp192k1\") return secp192k1();\n if(name == \"secp192r1\") return secp192r1();\n if(name == \"secp224r1\") return secp224r1();\n if(name == \"secp256r1\") return secp256r1();\n return null;\n}\n\nmodule.exports = {\n \"secp128r1\":secp128r1,\n \"secp160k1\":secp160k1,\n \"secp160r1\":secp160r1,\n \"secp192k1\":secp192k1,\n \"secp192r1\":secp192r1,\n \"secp224r1\":secp224r1,\n \"secp256r1\":secp256r1\n}\n\n\n//# sourceURL=webpack:///./node_modules/ecc-jsbn/lib/sec.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/end-of-stream/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/end-of-stream/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\");\n\nvar noop = function() {};\n\nvar isRequest = function(stream) {\n\treturn stream.setHeader && typeof stream.abort === 'function';\n};\n\nvar isChildProcess = function(stream) {\n\treturn stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3\n};\n\nvar eos = function(stream, opts, callback) {\n\tif (typeof opts === 'function') return eos(stream, null, opts);\n\tif (!opts) opts = {};\n\n\tcallback = once(callback || noop);\n\n\tvar ws = stream._writableState;\n\tvar rs = stream._readableState;\n\tvar readable = opts.readable || (opts.readable !== false && stream.readable);\n\tvar writable = opts.writable || (opts.writable !== false && stream.writable);\n\n\tvar onlegacyfinish = function() {\n\t\tif (!stream.writable) onfinish();\n\t};\n\n\tvar onfinish = function() {\n\t\twritable = false;\n\t\tif (!readable) callback.call(stream);\n\t};\n\n\tvar onend = function() {\n\t\treadable = false;\n\t\tif (!writable) callback.call(stream);\n\t};\n\n\tvar onexit = function(exitCode) {\n\t\tcallback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);\n\t};\n\n\tvar onerror = function(err) {\n\t\tcallback.call(stream, err);\n\t};\n\n\tvar onclose = function() {\n\t\tif (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));\n\t\tif (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));\n\t};\n\n\tvar onrequest = function() {\n\t\tstream.req.on('finish', onfinish);\n\t};\n\n\tif (isRequest(stream)) {\n\t\tstream.on('complete', onfinish);\n\t\tstream.on('abort', onclose);\n\t\tif (stream.req) onrequest();\n\t\telse stream.on('request', onrequest);\n\t} else if (writable && !ws) { // legacy streams\n\t\tstream.on('end', onlegacyfinish);\n\t\tstream.on('close', onlegacyfinish);\n\t}\n\n\tif (isChildProcess(stream)) stream.on('exit', onexit);\n\n\tstream.on('end', onend);\n\tstream.on('finish', onfinish);\n\tif (opts.error !== false) stream.on('error', onerror);\n\tstream.on('close', onclose);\n\n\treturn function() {\n\t\tstream.removeListener('complete', onfinish);\n\t\tstream.removeListener('abort', onclose);\n\t\tstream.removeListener('request', onrequest);\n\t\tif (stream.req) stream.req.removeListener('finish', onfinish);\n\t\tstream.removeListener('end', onlegacyfinish);\n\t\tstream.removeListener('close', onlegacyfinish);\n\t\tstream.removeListener('finish', onfinish);\n\t\tstream.removeListener('exit', onexit);\n\t\tstream.removeListener('end', onend);\n\t\tstream.removeListener('error', onerror);\n\t\tstream.removeListener('close', onclose);\n\t};\n};\n\nmodule.exports = eos;\n\n\n//# sourceURL=webpack:///./node_modules/end-of-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/err-code/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/err-code/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction createError(msg, code, props) {\n var err = msg instanceof Error ? msg : new Error(msg);\n var key;\n\n if (typeof code === 'object') {\n props = code;\n } else if (code != null) {\n err.code = code;\n }\n\n if (props) {\n for (key in props) {\n err[key] = props[key];\n }\n }\n\n return err;\n}\n\nmodule.exports = createError;\n\n\n//# sourceURL=webpack:///./node_modules/err-code/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/extend/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/extend/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n//# sourceURL=webpack:///./node_modules/extend/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/extsprintf/lib/extsprintf.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/extsprintf/lib/extsprintf.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(fmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\tvar ret = '';\n\tvar argn = 1;\n\n\tmod_assert.equal('string', typeof (fmt));\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0)\n\t\t\tthrow (new Error('too few args to sprintf'));\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/))\n\t\t\tthrow (new Error(\n\t\t\t 'unsupported flags: ' + flags));\n\n\t\tif (precision.length > 0)\n\t\t\tthrow (new Error(\n\t\t\t 'non-zero precision not supported'));\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null)\n\t\t\t\tthrow (new Error('argument ' + argn +\n\t\t\t\t ': attempted to print undefined or null ' +\n\t\t\t\t 'as a string'));\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (new Error('unsupported conversion: ' +\n\t\t\t conversion));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/extsprintf/lib/extsprintf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/fast-deep-equal/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/fast-deep-equal/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!hasProp.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a!==a && b!==b;\n};\n\n\n//# sourceURL=webpack:///./node_modules/fast-deep-equal/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/fast-diff/diff.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/fast-diff/diff.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.<string>} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.<string>} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n\n//# sourceURL=webpack:///./node_modules/fast-diff/diff.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/fast-json-stable-stringify/index.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/fast-json-stable-stringify/index.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n\n\n//# sourceURL=webpack:///./node_modules/fast-json-stable-stringify/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\*****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!**************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\**************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 13);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!**************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\**************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!*************************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\*************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 14);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!**********************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\**********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!*****************************************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\*****************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/node_modules/readable-stream/readable-browser.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/filestream/node_modules/readable-stream/readable-browser.js ***!
|
||
\**********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/filestream/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/filestream/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/filestream/read.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/filestream/read.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Readable = __webpack_require__(/*! readable-stream */ \"./node_modules/filestream/node_modules/readable-stream/readable-browser.js\").Readable;\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nvar reExtension = /^.*\\.(\\w+)$/;\nvar toBuffer = __webpack_require__(/*! typedarray-to-buffer */ \"./node_modules/typedarray-to-buffer/index.js\");\n\nfunction FileReadStream(file, opts) {\n var readStream = this;\n if (! (this instanceof FileReadStream)) {\n return new FileReadStream(file, opts);\n }\n opts = opts || {};\n\n // inherit readable\n Readable.call(this, opts);\n\n // save the read offset\n this._offset = 0;\n this._ready = false;\n this._file = file;\n this._size = file.size;\n this._chunkSize = opts.chunkSize || Math.max(this._size / 1000, 200 * 1024);\n\n // create the reader\n this.reader = new FileReader();\n\n // generate the header blocks that we will send as part of the initial payload\n this._generateHeaderBlocks(file, opts, function(err, blocks) {\n // if we encountered an error, emit it\n if (err) {\n return readStream.emit('error', err);\n }\n\n // push the header blocks out to the stream\n if (Array.isArray(blocks)) {\n blocks.forEach(function (block) {\n readStream.push(block);\n });\n }\n\n readStream._ready = true;\n readStream.emit('_ready');\n });\n}\n\ninherits(FileReadStream, Readable);\nmodule.exports = FileReadStream;\n\nFileReadStream.prototype._generateHeaderBlocks = function(file, opts, callback) {\n callback(null, []);\n};\n\nFileReadStream.prototype._read = function() {\n if (!this._ready) {\n this.once('_ready', this._read.bind(this));\n return;\n }\n var readStream = this;\n var reader = this.reader;\n\n var startOffset = this._offset;\n var endOffset = this._offset + this._chunkSize;\n if (endOffset > this._size) endOffset = this._size;\n\n if (startOffset === this._size) {\n this.destroy();\n this.push(null);\n return;\n }\n\n reader.onload = function() {\n // update the stream offset\n readStream._offset = endOffset;\n\n // get the data chunk\n readStream.push(toBuffer(reader.result));\n }\n reader.onerror = function() {\n readStream.emit('error', reader.error);\n }\n\n reader.readAsArrayBuffer(this._file.slice(startOffset, endOffset));\n};\n\nFileReadStream.prototype.destroy = function() {\n this._file = null;\n if (this.reader) {\n this.reader.onload = null;\n this.reader.onerror = null;\n try { this.reader.abort(); } catch (e) {};\n }\n this.reader = null;\n}\n\n\n//# sourceURL=webpack:///./node_modules/filestream/read.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/flatmap/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/flatmap/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = function(arr, iter, context) {\n var results = [];\n if (!Array.isArray(arr)) return results;\n arr.forEach(function(value, index, list) {\n var res = iter.call(context, value, index, list);\n if (Array.isArray(res)) {\n results.push.apply(results, res);\n } else if (res != null) {\n results.push(res);\n }\n });\n return results;\n};\n\n//# sourceURL=webpack:///./node_modules/flatmap/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/flatten/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/flatten/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function flatten(list, depth) {\n depth = (typeof depth == 'number') ? depth : Infinity;\n\n if (!depth) {\n if (Array.isArray(list)) {\n return list.map(function(i) { return i; });\n }\n return list;\n }\n\n return _flatten(list, 1);\n\n function _flatten(list, d) {\n return list.reduce(function (acc, item) {\n if (Array.isArray(item) && d < depth) {\n return acc.concat(_flatten(item, d + 1));\n }\n else {\n return acc.concat(item);\n }\n }, []);\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/flatten/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/forever-agent/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/forever-agent/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = ForeverAgent\nForeverAgent.SSL = ForeverAgentSSL\n\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\")\n , Agent = __webpack_require__(/*! http */ \"./node_modules/stream-http/index.js\").Agent\n , net = __webpack_require__(/*! net */ \"./node_modules/node-libs-browser/mock/empty.js\")\n , tls = __webpack_require__(/*! tls */ \"./node_modules/node-libs-browser/mock/empty.js\")\n , AgentSSL = __webpack_require__(/*! https */ \"./node_modules/https-browserify/index.js\").Agent\n \nfunction getConnectionName(host, port) { \n var name = ''\n if (typeof host === 'string') {\n name = host + ':' + port\n } else {\n // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.\n name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')\n }\n return name\n} \n\nfunction ForeverAgent(options) {\n var self = this\n self.options = options || {}\n self.requests = {}\n self.sockets = {}\n self.freeSockets = {}\n self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets\n self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets\n self.on('free', function(socket, host, port) {\n var name = getConnectionName(host, port)\n\n if (self.requests[name] && self.requests[name].length) {\n self.requests[name].shift().onSocket(socket)\n } else if (self.sockets[name].length < self.minSockets) {\n if (!self.freeSockets[name]) self.freeSockets[name] = []\n self.freeSockets[name].push(socket)\n \n // if an error happens while we don't use the socket anyway, meh, throw the socket away\n var onIdleError = function() {\n socket.destroy()\n }\n socket._onIdleError = onIdleError\n socket.on('error', onIdleError)\n } else {\n // If there are no pending requests just destroy the\n // socket and it will get removed from the pool. This\n // gets us out of timeout issues and allows us to\n // default to Connection:keep-alive.\n socket.destroy()\n }\n })\n\n}\nutil.inherits(ForeverAgent, Agent)\n\nForeverAgent.defaultMinSockets = 5\n\n\nForeverAgent.prototype.createConnection = net.createConnection\nForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest\nForeverAgent.prototype.addRequest = function(req, host, port) {\n var name = getConnectionName(host, port)\n \n if (typeof host !== 'string') {\n var options = host\n port = options.port\n host = options.host\n }\n\n if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {\n var idleSocket = this.freeSockets[name].pop()\n idleSocket.removeListener('error', idleSocket._onIdleError)\n delete idleSocket._onIdleError\n req._reusedSocket = true\n req.onSocket(idleSocket)\n } else {\n this.addRequestNoreuse(req, host, port)\n }\n}\n\nForeverAgent.prototype.removeSocket = function(s, name, host, port) {\n if (this.sockets[name]) {\n var index = this.sockets[name].indexOf(s)\n if (index !== -1) {\n this.sockets[name].splice(index, 1)\n }\n } else if (this.sockets[name] && this.sockets[name].length === 0) {\n // don't leak\n delete this.sockets[name]\n delete this.requests[name]\n }\n \n if (this.freeSockets[name]) {\n var index = this.freeSockets[name].indexOf(s)\n if (index !== -1) {\n this.freeSockets[name].splice(index, 1)\n if (this.freeSockets[name].length === 0) {\n delete this.freeSockets[name]\n }\n }\n }\n\n if (this.requests[name] && this.requests[name].length) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(name, host, port).emit('free')\n }\n}\n\nfunction ForeverAgentSSL (options) {\n ForeverAgent.call(this, options)\n}\nutil.inherits(ForeverAgentSSL, ForeverAgent)\n\nForeverAgentSSL.prototype.createConnection = createConnectionSSL\nForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest\n\nfunction createConnectionSSL (port, host, options) {\n if (typeof port === 'object') {\n options = port;\n } else if (typeof host === 'object') {\n options = host;\n } else if (typeof options === 'object') {\n options = options;\n } else {\n options = {};\n }\n\n if (typeof port === 'number') {\n options.port = port;\n }\n\n if (typeof host === 'string') {\n options.host = host;\n }\n\n return tls.connect(options);\n}\n\n\n//# sourceURL=webpack:///./node_modules/forever-agent/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/form-data/lib/browser.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/form-data/lib/browser.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* eslint-env browser */\nmodule.exports = typeof self == 'object' ? self.FormData : window.FormData;\n\n\n//# sourceURL=webpack:///./node_modules/form-data/lib/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/fs-constants/browser.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/fs-constants/browser.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! constants */ \"./node_modules/constants-browserify/constants.json\")\n\n\n//# sourceURL=webpack:///./node_modules/fs-constants/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/get-browser-rtc/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/get-browser-rtc/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// originally pulled out of simple-peer\n\nmodule.exports = function getBrowserRTC () {\n if (typeof window === 'undefined') return null\n var wrtc = {\n RTCPeerConnection: window.RTCPeerConnection || window.mozRTCPeerConnection ||\n window.webkitRTCPeerConnection,\n RTCSessionDescription: window.RTCSessionDescription ||\n window.mozRTCSessionDescription || window.webkitRTCSessionDescription,\n RTCIceCandidate: window.RTCIceCandidate || window.mozRTCIceCandidate ||\n window.webkitRTCIceCandidate\n }\n if (!wrtc.RTCPeerConnection) return null\n return wrtc\n}\n\n\n//# sourceURL=webpack:///./node_modules/get-browser-rtc/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun sync recursive":
|
||
/*!*******************************!*\
|
||
!*** ./node_modules/gun sync ***!
|
||
\*******************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = \"./node_modules/gun sync recursive\";\n\n//# sourceURL=webpack:///./node_modules/gun_sync?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/gun.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/gun/gun.js ***!
|
||
\*********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, module) {;(function(){\n\n /* UNBUILD */\n var root;\n if(typeof window !== \"undefined\"){ root = window }\n if(typeof global !== \"undefined\"){ root = global }\n root = root || {};\n var console = root.console || {log: function(){}};\n function USE(arg, req){\n return req? __webpack_require__(\"./node_modules/gun sync recursive\")(arg) : arg.slice? USE[R(arg)] : function(mod, path){\n arg(mod = {exports: {}});\n USE[R(path)] = mod.exports;\n }\n function R(p){\n return p.split('/').slice(-1).toString().replace('.js','');\n }\n }\n if(true){ var common = module }\n /* UNBUILD */\n\n\t;USE(function(module){\n\t\t// Generic javascript utilities.\n\t\tvar Type = {};\n\t\t//Type.fns = Type.fn = {is: function(fn){ return (!!fn && fn instanceof Function) }}\n\t\tType.fn = {is: function(fn){ return (!!fn && 'function' == typeof fn) }}\n\t\tType.bi = {is: function(b){ return (b instanceof Boolean || typeof b == 'boolean') }}\n\t\tType.num = {is: function(n){ return !list_is(n) && ((n - parseFloat(n) + 1) >= 0 || Infinity === n || -Infinity === n) }}\n\t\tType.text = {is: function(t){ return (typeof t == 'string') }}\n\t\tType.text.ify = function(t){\n\t\t\tif(Type.text.is(t)){ return t }\n\t\t\tif(typeof JSON !== \"undefined\"){ return JSON.stringify(t) }\n\t\t\treturn (t && t.toString)? t.toString() : t;\n\t\t}\n\t\tType.text.random = function(l, c){\n\t\t\tvar s = '';\n\t\t\tl = l || 24; // you are not going to make a 0 length random number, so no need to check type\n\t\t\tc = c || '0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz';\n\t\t\twhile(l > 0){ s += c.charAt(Math.floor(Math.random() * c.length)); l-- }\n\t\t\treturn s;\n\t\t}\n\t\tType.text.match = function(t, o){ var tmp, u;\n\t\t\tif('string' !== typeof t){ return false }\n\t\t\tif('string' == typeof o){ o = {'=': o} }\n\t\t\to = o || {};\n\t\t\ttmp = (o['='] || o['*'] || o['>'] || o['<']);\n\t\t\tif(t === tmp){ return true }\n\t\t\tif(u !== o['=']){ return false }\n\t\t\ttmp = (o['*'] || o['>'] || o['<']);\n\t\t\tif(t.slice(0, (tmp||'').length) === tmp){ return true }\n\t\t\tif(u !== o['*']){ return false }\n\t\t\tif(u !== o['>'] && u !== o['<']){\n\t\t\t\treturn (t >= o['>'] && t <= o['<'])? true : false;\n\t\t\t}\n\t\t\tif(u !== o['>'] && t >= o['>']){ return true }\n\t\t\tif(u !== o['<'] && t <= o['<']){ return true }\n\t\t\treturn false;\n\t\t}\n\t\tType.list = {is: function(l){ return (l instanceof Array) }}\n\t\tType.list.slit = Array.prototype.slice;\n\t\tType.list.sort = function(k){ // creates a new sort function based off some key\n\t\t\treturn function(A,B){\n\t\t\t\tif(!A || !B){ return 0 } A = A[k]; B = B[k];\n\t\t\t\tif(A < B){ return -1 }else if(A > B){ return 1 }\n\t\t\t\telse { return 0 }\n\t\t\t}\n\t\t}\n\t\tType.list.map = function(l, c, _){ return obj_map(l, c, _) }\n\t\tType.list.index = 1; // change this to 0 if you want non-logical, non-mathematical, non-matrix, non-convenient array notation\n\t\tType.obj = {is: function(o){ return o? (o instanceof Object && o.constructor === Object) || Object.prototype.toString.call(o).match(/^\\[object (\\w+)\\]$/)[1] === 'Object' : false }}\n\t\tType.obj.put = function(o, k, v){ return (o||{})[k] = v, o }\n\t\tType.obj.has = function(o, k){ return o && Object.prototype.hasOwnProperty.call(o, k) }\n\t\tType.obj.del = function(o, k){\n\t\t\tif(!o){ return }\n\t\t\to[k] = null;\n\t\t\tdelete o[k];\n\t\t\treturn o;\n\t\t}\n\t\tType.obj.as = function(o, k, v, u){ return o[k] = o[k] || (u === v? {} : v) }\n\t\tType.obj.ify = function(o){\n\t\t\tif(obj_is(o)){ return o }\n\t\t\ttry{o = JSON.parse(o);\n\t\t\t}catch(e){o={}};\n\t\t\treturn o;\n\t\t}\n\t\t;(function(){ var u;\n\t\t\tfunction map(v,k){\n\t\t\t\tif(obj_has(this,k) && u !== this[k]){ return }\n\t\t\t\tthis[k] = v;\n\t\t\t}\n\t\t\tType.obj.to = function(from, to){\n\t\t\t\tto = to || {};\n\t\t\t\tobj_map(from, map, to);\n\t\t\t\treturn to;\n\t\t\t}\n\t\t}());\n\t\tType.obj.copy = function(o){ // because http://web.archive.org/web/20140328224025/http://jsperf.com/cloning-an-object/2\n\t\t\treturn !o? o : JSON.parse(JSON.stringify(o)); // is shockingly faster than anything else, and our data has to be a subset of JSON anyways!\n\t\t}\n\t\t;(function(){\n\t\t\tfunction empty(v,i){ var n = this.n;\n\t\t\t\tif(n && (i === n || (obj_is(n) && obj_has(n, i)))){ return }\n\t\t\t\tif(i){ return true }\n\t\t\t}\n\t\t\tType.obj.empty = function(o, n){\n\t\t\t\tif(!o){ return true }\n\t\t\t\treturn obj_map(o,empty,{n:n})? false : true;\n\t\t\t}\n\t\t}());\n\t\t;(function(){\n\t\t\tfunction t(k,v){\n\t\t\t\tif(2 === arguments.length){\n\t\t\t\t\tt.r = t.r || {};\n\t\t\t\t\tt.r[k] = v;\n\t\t\t\t\treturn;\n\t\t\t\t} t.r = t.r || [];\n\t\t\t\tt.r.push(k);\n\t\t\t};\n\t\t\tvar keys = Object.keys, map;\n\t\t\tObject.keys = Object.keys || function(o){ return map(o, function(v,k,t){t(k)}) }\n\t\t\tType.obj.map = map = function(l, c, _){\n\t\t\t\tvar u, i = 0, x, r, ll, lle, f = fn_is(c);\n\t\t\t\tt.r = null;\n\t\t\t\tif(keys && obj_is(l)){\n\t\t\t\t\tll = keys(l); lle = true;\n\t\t\t\t}\n\t\t\t\tif(list_is(l) || ll){\n\t\t\t\t\tx = (ll || l).length;\n\t\t\t\t\tfor(;i < x; i++){\n\t\t\t\t\t\tvar ii = (i + Type.list.index);\n\t\t\t\t\t\tif(f){\n\t\t\t\t\t\t\tr = lle? c.call(_ || this, l[ll[i]], ll[i], t) : c.call(_ || this, l[i], ii, t);\n\t\t\t\t\t\t\tif(r !== u){ return r }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//if(Type.test.is(c,l[i])){ return ii } // should implement deep equality testing!\n\t\t\t\t\t\t\tif(c === l[lle? ll[i] : i]){ return ll? ll[i] : ii } // use this for now\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor(i in l){\n\t\t\t\t\t\tif(f){\n\t\t\t\t\t\t\tif(obj_has(l,i)){\n\t\t\t\t\t\t\t\tr = _? c.call(_, l[i], i, t) : c(l[i], i, t);\n\t\t\t\t\t\t\t\tif(r !== u){ return r }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//if(a.test.is(c,l[i])){ return i } // should implement deep equality testing!\n\t\t\t\t\t\t\tif(c === l[i]){ return i } // use this for now\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn f? t.r : Type.list.index? 0 : -1;\n\t\t\t}\n\t\t}());\n\t\tType.time = {};\n\t\tType.time.is = function(t){ return t? t instanceof Date : (+new Date().getTime()) }\n\n\t\tvar fn_is = Type.fn.is;\n\t\tvar list_is = Type.list.is;\n\t\tvar obj = Type.obj, obj_is = obj.is, obj_has = obj.has, obj_map = obj.map;\n\t\tmodule.exports = Type;\n\t})(USE, './type');\n\n\t;USE(function(module){\n\t\t// On event emitter generic javascript utility.\n\t\tmodule.exports = function onto(tag, arg, as){\n\t\t\tif(!tag){ return {to: onto} }\n\t\t\tvar u, tag = (this.tag || (this.tag = {}))[tag] ||\n\t\t\t(this.tag[tag] = {tag: tag, to: onto._ = {\n\t\t\t\tnext: function(arg){ var tmp;\n\t\t\t\t\tif((tmp = this.to)){\n\t\t\t\t\t\ttmp.next(arg);\n\t\t\t\t}}\n\t\t\t}});\n\t\t\tif(arg instanceof Function){\n\t\t\t\tvar be = {\n\t\t\t\t\toff: onto.off ||\n\t\t\t\t\t(onto.off = function(){\n\t\t\t\t\t\tif(this.next === onto._.next){ return !0 }\n\t\t\t\t\t\tif(this === this.the.last){\n\t\t\t\t\t\t\tthis.the.last = this.back;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.to.back = this.back;\n\t\t\t\t\t\tthis.next = onto._.next;\n\t\t\t\t\t\tthis.back.to = this.to;\n\t\t\t\t\t\tif(this.the.last === this.the){\n\t\t\t\t\t\t\tdelete this.on.tag[this.the.tag];\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tto: onto._,\n\t\t\t\t\tnext: arg,\n\t\t\t\t\tthe: tag,\n\t\t\t\t\ton: this,\n\t\t\t\t\tas: as,\n\t\t\t\t};\n\t\t\t\t(be.back = tag.last || tag).to = be;\n\t\t\t\treturn tag.last = be;\n\t\t\t}\n\t\t\tif((tag = tag.to) && u !== arg){ tag.next(arg) }\n\t\t\treturn tag;\n\t\t};\n\t})(USE, './onto');\n\n\t;USE(function(module){\n\t\t/* Based on the Hypothetical Amnesia Machine thought experiment */\n\t\tfunction HAM(machineState, incomingState, currentState, incomingValue, currentValue){\n\t\t\tif(machineState < incomingState){\n\t\t\t\treturn {defer: true}; // the incoming value is outside the boundary of the machine's state, it must be reprocessed in another state.\n\t\t\t}\n\t\t\tif(incomingState < currentState){\n\t\t\t\treturn {historical: true}; // the incoming value is within the boundary of the machine's state, but not within the range.\n\n\t\t\t}\n\t\t\tif(currentState < incomingState){\n\t\t\t\treturn {converge: true, incoming: true}; // the incoming value is within both the boundary and the range of the machine's state.\n\n\t\t\t}\n\t\t\tif(incomingState === currentState){\n\t\t\t\tincomingValue = Lexical(incomingValue) || \"\";\n\t\t\t\tcurrentValue = Lexical(currentValue) || \"\";\n\t\t\t\tif(incomingValue === currentValue){ // Note: while these are practically the same, the deltas could be technically different\n\t\t\t\t\treturn {state: true};\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t\tThe following is a naive implementation, but will always work.\n\t\t\t\t\tNever change it unless you have specific needs that absolutely require it.\n\t\t\t\t\tIf changed, your data will diverge unless you guarantee every peer's algorithm has also been changed to be the same.\n\t\t\t\t\tAs a result, it is highly discouraged to modify despite the fact that it is naive,\n\t\t\t\t\tbecause convergence (data integrity) is generally more important.\n\t\t\t\t\tAny difference in this algorithm must be given a new and different name.\n\t\t\t\t*/\n\t\t\t\tif(incomingValue < currentValue){ // Lexical only works on simple value types!\n\t\t\t\t\treturn {converge: true, current: true};\n\t\t\t\t}\n\t\t\t\tif(currentValue < incomingValue){ // Lexical only works on simple value types!\n\t\t\t\t\treturn {converge: true, incoming: true};\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {err: \"Invalid CRDT Data: \"+ incomingValue +\" to \"+ currentValue +\" at \"+ incomingState +\" to \"+ currentState +\"!\"};\n\t\t}\n\t\tif(typeof JSON === 'undefined'){\n\t\t\tthrow new Error(\n\t\t\t\t'JSON is not included in this browser. Please load it first: ' +\n\t\t\t\t'ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js'\n\t\t\t);\n\t\t}\n\t\tvar Lexical = JSON.stringify, undefined;\n\t\tmodule.exports = HAM;\n\t})(USE, './HAM');\n\n\t;USE(function(module){\n\t\tvar Type = USE('./type');\n\t\tvar Val = {};\n\t\tVal.is = function(v){ // Valid values are a subset of JSON: null, binary, number (!Infinity), text, or a soul relation. Arrays need special algorithms to handle concurrency, so they are not supported directly. Use an extension that supports them if needed but research their problems first.\n\t\t\tif(v === u){ return false }\n\t\t\tif(v === null){ return true } // \"deletes\", nulling out keys.\n\t\t\tif(v === Infinity){ return false } // we want this to be, but JSON does not support it, sad face.\n\t\t\tif(text_is(v) // by \"text\" we mean strings.\n\t\t\t|| bi_is(v) // by \"binary\" we mean boolean.\n\t\t\t|| num_is(v)){ // by \"number\" we mean integers or decimals.\n\t\t\t\treturn true; // simple values are valid.\n\t\t\t}\n\t\t\treturn Val.link.is(v) || false; // is the value a soul relation? Then it is valid and return it. If not, everything else remaining is an invalid data type. Custom extensions can be built on top of these primitives to support other types.\n\t\t}\n\t\tVal.link = Val.rel = {_: '#'};\n\t\t;(function(){\n\t\t\tVal.link.is = function(v){ // this defines whether an object is a soul relation or not, they look like this: {'#': 'UUID'}\n\t\t\t\tif(v && v[rel_] && !v._ && obj_is(v)){ // must be an object.\n\t\t\t\t\tvar o = {};\n\t\t\t\t\tobj_map(v, map, o);\n\t\t\t\t\tif(o.id){ // a valid id was found.\n\t\t\t\t\t\treturn o.id; // yay! Return it.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false; // the value was not a valid soul relation.\n\t\t\t}\n\t\t\tfunction map(s, k){ var o = this; // map over the object...\n\t\t\t\tif(o.id){ return o.id = false } // if ID is already defined AND we're still looping through the object, it is considered invalid.\n\t\t\t\tif(k == rel_ && text_is(s)){ // the key should be '#' and have a text value.\n\t\t\t\t\to.id = s; // we found the soul!\n\t\t\t\t} else {\n\t\t\t\t\treturn o.id = false; // if there exists anything else on the object that isn't the soul, then it is considered invalid.\n\t\t\t\t}\n\t\t\t}\n\t\t}());\n\t\tVal.link.ify = function(t){ return obj_put({}, rel_, t) } // convert a soul into a relation and return it.\n\t\tType.obj.has._ = '.';\n\t\tvar rel_ = Val.link._, u;\n\t\tvar bi_is = Type.bi.is;\n\t\tvar num_is = Type.num.is;\n\t\tvar text_is = Type.text.is;\n\t\tvar obj = Type.obj, obj_is = obj.is, obj_put = obj.put, obj_map = obj.map;\n\t\tmodule.exports = Val;\n\t})(USE, './val');\n\n\t;USE(function(module){\n\t\tvar Type = USE('./type');\n\t\tvar Val = USE('./val');\n\t\tvar Node = {_: '_'};\n\t\tNode.soul = function(n, o){ return (n && n._ && n._[o || soul_]) } // convenience function to check to see if there is a soul on a node and return it.\n\t\tNode.soul.ify = function(n, o){ // put a soul on an object.\n\t\t\to = (typeof o === 'string')? {soul: o} : o || {};\n\t\t\tn = n || {}; // make sure it exists.\n\t\t\tn._ = n._ || {}; // make sure meta exists.\n\t\t\tn._[soul_] = o.soul || n._[soul_] || text_random(); // put the soul on it.\n\t\t\treturn n;\n\t\t}\n\t\tNode.soul._ = Val.link._;\n\t\t;(function(){\n\t\t\tNode.is = function(n, cb, as){ var s; // checks to see if an object is a valid node.\n\t\t\t\tif(!obj_is(n)){ return false } // must be an object.\n\t\t\t\tif(s = Node.soul(n)){ // must have a soul on it.\n\t\t\t\t\treturn !obj_map(n, map, {as:as,cb:cb,s:s,n:n});\n\t\t\t\t}\n\t\t\t\treturn false; // nope! This was not a valid node.\n\t\t\t}\n\t\t\tfunction map(v, k){ // we invert this because the way we check for this is via a negation.\n\t\t\t\tif(k === Node._){ return } // skip over the metadata.\n\t\t\t\tif(!Val.is(v)){ return true } // it is true that this is an invalid node.\n\t\t\t\tif(this.cb){ this.cb.call(this.as, v, k, this.n, this.s) } // optionally callback each key/value.\n\t\t\t}\n\t\t}());\n\t\t;(function(){\n\t\t\tNode.ify = function(obj, o, as){ // returns a node from a shallow object.\n\t\t\t\tif(!o){ o = {} }\n\t\t\t\telse if(typeof o === 'string'){ o = {soul: o} }\n\t\t\t\telse if(o instanceof Function){ o = {map: o} }\n\t\t\t\tif(o.map){ o.node = o.map.call(as, obj, u, o.node || {}) }\n\t\t\t\tif(o.node = Node.soul.ify(o.node || {}, o)){\n\t\t\t\t\tobj_map(obj, map, {o:o,as:as});\n\t\t\t\t}\n\t\t\t\treturn o.node; // This will only be a valid node if the object wasn't already deep!\n\t\t\t}\n\t\t\tfunction map(v, k){ var o = this.o, tmp, u; // iterate over each key/value.\n\t\t\t\tif(o.map){\n\t\t\t\t\ttmp = o.map.call(this.as, v, ''+k, o.node);\n\t\t\t\t\tif(u === tmp){\n\t\t\t\t\t\tobj_del(o.node, k);\n\t\t\t\t\t} else\n\t\t\t\t\tif(o.node){ o.node[k] = tmp }\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(Val.is(v)){\n\t\t\t\t\to.node[k] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t}());\n\t\tvar obj = Type.obj, obj_is = obj.is, obj_del = obj.del, obj_map = obj.map;\n\t\tvar text = Type.text, text_random = text.random;\n\t\tvar soul_ = Node.soul._;\n\t\tvar u;\n\t\tmodule.exports = Node;\n\t})(USE, './node');\n\n\t;USE(function(module){\n\t\tvar Type = USE('./type');\n\t\tvar Node = USE('./node');\n\t\tfunction State(){\n\t\t\tvar t;\n\t\t\t/*if(perf){\n\t\t\t\tt = start + perf.now(); // Danger: Accuracy decays significantly over time, even if precise.\n\t\t\t} else {*/\n\t\t\t\tt = time();\n\t\t\t//}\n\t\t\tif(last < t){\n\t\t\t\treturn N = 0, last = t + State.drift;\n\t\t\t}\n\t\t\treturn last = t + ((N += 1) / D) + State.drift;\n\t\t}\n\t\tvar time = Type.time.is, last = -Infinity, N = 0, D = 1000; // WARNING! In the future, on machines that are D times faster than 2016AD machines, you will want to increase D by another several orders of magnitude so the processing speed never out paces the decimal resolution (increasing an integer effects the state accuracy).\n\t\tvar perf = (typeof performance !== 'undefined')? (performance.timing && performance) : false, start = (perf && perf.timing && perf.timing.navigationStart) || (perf = false);\n\t\tState._ = '>';\n\t\tState.drift = 0;\n\t\tState.is = function(n, k, o){ // convenience function to get the state on a key on a node and return it.\n\t\t\tvar tmp = (k && n && n[N_] && n[N_][State._]) || o;\n\t\t\tif(!tmp){ return }\n\t\t\treturn num_is(tmp = tmp[k])? tmp : -Infinity;\n\t\t}\n\t\tState.lex = function(){ return State().toString(36).replace('.','') }\n\t\tState.ify = function(n, k, s, v, soul){ // put a key's state on a node.\n\t\t\tif(!n || !n[N_]){ // reject if it is not node-like.\n\t\t\t\tif(!soul){ // unless they passed a soul\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tn = Node.soul.ify(n, soul); // then make it so!\n\t\t\t}\n\t\t\tvar tmp = obj_as(n[N_], State._); // grab the states data.\n\t\t\tif(u !== k && k !== N_){\n\t\t\t\tif(num_is(s)){\n\t\t\t\t\ttmp[k] = s; // add the valid state.\n\t\t\t\t}\n\t\t\t\tif(u !== v){ // Note: Not its job to check for valid values!\n\t\t\t\t\tn[k] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn n;\n\t\t}\n\t\tState.to = function(from, k, to){\n\t\t\tvar val = (from||{})[k];\n\t\t\tif(obj_is(val)){\n\t\t\t\tval = obj_copy(val);\n\t\t\t}\n\t\t\treturn State.ify(to, k, State.is(from, k), val, Node.soul(from));\n\t\t}\n\t\t;(function(){\n\t\t\tState.map = function(cb, s, as){ var u; // for use with Node.ify\n\t\t\t\tvar o = obj_is(o = cb || s)? o : null;\n\t\t\t\tcb = fn_is(cb = cb || s)? cb : null;\n\t\t\t\tif(o && !cb){\n\t\t\t\t\ts = num_is(s)? s : State();\n\t\t\t\t\to[N_] = o[N_] || {};\n\t\t\t\t\tobj_map(o, map, {o:o,s:s});\n\t\t\t\t\treturn o;\n\t\t\t\t}\n\t\t\t\tas = as || obj_is(s)? s : u;\n\t\t\t\ts = num_is(s)? s : State();\n\t\t\t\treturn function(v, k, o, opt){\n\t\t\t\t\tif(!cb){\n\t\t\t\t\t\tmap.call({o: o, s: s}, v,k);\n\t\t\t\t\t\treturn v;\n\t\t\t\t\t}\n\t\t\t\t\tcb.call(as || this || {}, v, k, o, opt);\n\t\t\t\t\tif(obj_has(o,k) && u === o[k]){ return }\n\t\t\t\t\tmap.call({o: o, s: s}, v,k);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction map(v,k){\n\t\t\t\tif(N_ === k){ return }\n\t\t\t\tState.ify(this.o, k, this.s) ;\n\t\t\t}\n\t\t}());\n\t\tvar obj = Type.obj, obj_as = obj.as, obj_has = obj.has, obj_is = obj.is, obj_map = obj.map, obj_copy = obj.copy;\n\t\tvar num = Type.num, num_is = num.is;\n\t\tvar fn = Type.fn, fn_is = fn.is;\n\t\tvar N_ = Node._, u;\n\t\tmodule.exports = State;\n\t})(USE, './state');\n\n\t;USE(function(module){\n\t\tvar Type = USE('./type');\n\t\tvar Val = USE('./val');\n\t\tvar Node = USE('./node');\n\t\tvar Graph = {};\n\t\t;(function(){\n\t\t\tGraph.is = function(g, cb, fn, as){ // checks to see if an object is a valid graph.\n\t\t\t\tif(!g || !obj_is(g) || obj_empty(g)){ return false } // must be an object.\n\t\t\t\treturn !obj_map(g, map, {cb:cb,fn:fn,as:as}); // makes sure it wasn't an empty object.\n\t\t\t}\n\t\t\tfunction map(n, s){ // we invert this because the way'? we check for this is via a negation.\n\t\t\t\tif(!n || s !== Node.soul(n) || !Node.is(n, this.fn, this.as)){ return true } // it is true that this is an invalid graph.\n\t\t\t\tif(!this.cb){ return }\n\t\t\t\tnf.n = n; nf.as = this.as; // sequential race conditions aren't races.\n\t\t\t\tthis.cb.call(nf.as, n, s, nf);\n\t\t\t}\n\t\t\tfunction nf(fn){ // optional callback for each node.\n\t\t\t\tif(fn){ Node.is(nf.n, fn, nf.as) } // where we then have an optional callback for each key/value.\n\t\t\t}\n\t\t}());\n\t\t;(function(){\n\t\t\tGraph.ify = function(obj, env, as){\n\t\t\t\tvar at = {path: [], obj: obj};\n\t\t\t\tif(!env){\n\t\t\t\t\tenv = {};\n\t\t\t\t} else\n\t\t\t\tif(typeof env === 'string'){\n\t\t\t\t\tenv = {soul: env};\n\t\t\t\t} else\n\t\t\t\tif(env instanceof Function){\n\t\t\t\t\tenv.map = env;\n\t\t\t\t}\n\t\t\t\tif(env.soul){\n\t\t\t\t\tat.link = Val.link.ify(env.soul);\n\t\t\t\t}\n\t\t\t\tenv.shell = (as||{}).shell;\n\t\t\t\tenv.graph = env.graph || {};\n\t\t\t\tenv.seen = env.seen || [];\n\t\t\t\tenv.as = env.as || as;\n\t\t\t\tnode(env, at);\n\t\t\t\tenv.root = at.node;\n\t\t\t\treturn env.graph;\n\t\t\t}\n\t\t\tfunction node(env, at){ var tmp;\n\t\t\t\tif(tmp = seen(env, at)){ return tmp }\n\t\t\t\tat.env = env;\n\t\t\t\tat.soul = soul;\n\t\t\t\tif(Node.ify(at.obj, map, at)){\n\t\t\t\t\tat.link = at.link || Val.link.ify(Node.soul(at.node));\n\t\t\t\t\tif(at.obj !== env.shell){\n\t\t\t\t\t\tenv.graph[Val.link.is(at.link)] = at.node;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn at;\n\t\t\t}\n\t\t\tfunction map(v,k,n){\n\t\t\t\tvar at = this, env = at.env, is, tmp;\n\t\t\t\tif(Node._ === k && obj_has(v,Val.link._)){\n\t\t\t\t\treturn n._; // TODO: Bug?\n\t\t\t\t}\n\t\t\t\tif(!(is = valid(v,k,n, at,env))){ return }\n\t\t\t\tif(!k){\n\t\t\t\t\tat.node = at.node || n || {};\n\t\t\t\t\tif(obj_has(v, Node._) && Node.soul(v)){ // ? for safety ?\n\t\t\t\t\t\tat.node._ = obj_copy(v._);\n\t\t\t\t\t}\n\t\t\t\t\tat.node = Node.soul.ify(at.node, Val.link.is(at.link));\n\t\t\t\t\tat.link = at.link || Val.link.ify(Node.soul(at.node));\n\t\t\t\t}\n\t\t\t\tif(tmp = env.map){\n\t\t\t\t\ttmp.call(env.as || {}, v,k,n, at);\n\t\t\t\t\tif(obj_has(n,k)){\n\t\t\t\t\t\tv = n[k];\n\t\t\t\t\t\tif(u === v){\n\t\t\t\t\t\t\tobj_del(n, k);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!(is = valid(v,k,n, at,env))){ return }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!k){ return at.node }\n\t\t\t\tif(true === is){\n\t\t\t\t\treturn v;\n\t\t\t\t}\n\t\t\t\ttmp = node(env, {obj: v, path: at.path.concat(k)});\n\t\t\t\tif(!tmp.node){ return }\n\t\t\t\treturn tmp.link; //{'#': Node.soul(tmp.node)};\n\t\t\t}\n\t\t\tfunction soul(id){ var at = this;\n\t\t\t\tvar prev = Val.link.is(at.link), graph = at.env.graph;\n\t\t\t\tat.link = at.link || Val.link.ify(id);\n\t\t\t\tat.link[Val.link._] = id;\n\t\t\t\tif(at.node && at.node[Node._]){\n\t\t\t\t\tat.node[Node._][Val.link._] = id;\n\t\t\t\t}\n\t\t\t\tif(obj_has(graph, prev)){\n\t\t\t\t\tgraph[id] = graph[prev];\n\t\t\t\t\tobj_del(graph, prev);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction valid(v,k,n, at,env){ var tmp;\n\t\t\t\tif(Val.is(v)){ return true }\n\t\t\t\tif(obj_is(v)){ return 1 }\n\t\t\t\tif(tmp = env.invalid){\n\t\t\t\t\tv = tmp.call(env.as || {}, v,k,n);\n\t\t\t\t\treturn valid(v,k,n, at,env);\n\t\t\t\t}\n\t\t\t\tenv.err = \"Invalid value at '\" + at.path.concat(k).join('.') + \"'!\";\n\t\t\t\tif(Type.list.is(v)){ env.err += \" Use `.set(item)` instead of an Array.\" }\n\t\t\t}\n\t\t\tfunction seen(env, at){\n\t\t\t\tvar arr = env.seen, i = arr.length, has;\n\t\t\t\twhile(i--){ has = arr[i];\n\t\t\t\t\tif(at.obj === has.obj){ return has }\n\t\t\t\t}\n\t\t\t\tarr.push(at);\n\t\t\t}\n\t\t}());\n\t\tGraph.node = function(node){\n\t\t\tvar soul = Node.soul(node);\n\t\t\tif(!soul){ return }\n\t\t\treturn obj_put({}, soul, node);\n\t\t}\n\t\t;(function(){\n\t\t\tGraph.to = function(graph, root, opt){\n\t\t\t\tif(!graph){ return }\n\t\t\t\tvar obj = {};\n\t\t\t\topt = opt || {seen: {}};\n\t\t\t\tobj_map(graph[root], map, {obj:obj, graph: graph, opt: opt});\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\tfunction map(v,k){ var tmp, obj;\n\t\t\t\tif(Node._ === k){\n\t\t\t\t\tif(obj_empty(v, Val.link._)){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.obj[k] = obj_copy(v);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(!(tmp = Val.link.is(v))){\n\t\t\t\t\tthis.obj[k] = v;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(obj = this.opt.seen[tmp]){\n\t\t\t\t\tthis.obj[k] = obj;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.obj[k] = this.opt.seen[tmp] = Graph.to(this.graph, tmp, this.opt);\n\t\t\t}\n\t\t}());\n\t\tvar fn_is = Type.fn.is;\n\t\tvar obj = Type.obj, obj_is = obj.is, obj_del = obj.del, obj_has = obj.has, obj_empty = obj.empty, obj_put = obj.put, obj_map = obj.map, obj_copy = obj.copy;\n\t\tvar u;\n\t\tmodule.exports = Graph;\n\t})(USE, './graph');\n\n\t;USE(function(module){\n\t\t// request / response module, for asking and acking messages.\n\t\tUSE('./onto'); // depends upon onto!\n\t\tmodule.exports = function ask(cb, as){\n\t\t\tif(!this.on){ return }\n\t\t\tif(!(cb instanceof Function)){\n\t\t\t\tif(!cb || !as){ return }\n\t\t\t\tvar id = cb['#'] || cb, tmp = (this.tag||empty)[id];\n\t\t\t\tif(!tmp){ return }\n\t\t\t\ttmp = this.on(id, as);\n\t\t\t\tclearTimeout(tmp.err);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tvar id = (as && as['#']) || Math.random().toString(36).slice(2);\n\t\t\tif(!cb){ return id }\n\t\t\tvar to = this.on(id, cb, as);\n\t\t\tto.err = to.err || setTimeout(function(){\n\t\t\t\tto.next({err: \"Error: No ACK received yet.\", lack: true});\n\t\t\t\tto.off();\n\t\t\t}, (this.opt||{}).lack || 9000);\n\t\t\treturn id;\n\t\t}\n\t})(USE, './ask');\n\n\t;USE(function(module){\n\t\tvar Type = USE('./type');\n\t\tfunction Dup(opt){\n\t\t\tvar dup = {s:{}};\n\t\t\topt = opt || {max: 1000, age: 1000 * 9};//1000 * 60 * 2};\n\t\t\tdup.check = function(id){ var tmp;\n\t\t\t\tif(!(tmp = dup.s[id])){ return false }\n\t\t\t\tif(tmp.pass){ return tmp.pass = false }\n\t\t\t\treturn dup.track(id);\n\t\t\t}\n\t\t\tdup.track = function(id, pass){\n\t\t\t\tvar it = dup.s[id] || (dup.s[id] = {});\n\t\t\t\tit.was = time_is();\n\t\t\t\tif(pass){ it.pass = true }\n\t\t\t\tif(!dup.to){\n\t\t\t\t\tdup.to = setTimeout(function(){\n\t\t\t\t\t\tvar now = time_is();\n\t\t\t\t\t\tType.obj.map(dup.s, function(it, id){\n\t\t\t\t\t\t\tif(it && opt.age > (now - it.was)){ return }\n\t\t\t\t\t\t\tType.obj.del(dup.s, id);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdup.to = null;\n\t\t\t\t\t}, opt.age + 9);\n\t\t\t\t}\n\t\t\t\treturn it;\n\t\t\t}\n\t\t\treturn dup;\n\t\t}\n\t\tvar time_is = Type.time.is;\n\t\tmodule.exports = Dup;\n\t})(USE, './dup');\n\n\t;USE(function(module){\n\n\t\tfunction Gun(o){\n\t\t\tif(o instanceof Gun){ return (this._ = {gun: this, $: this}).$ }\n\t\t\tif(!(this instanceof Gun)){ return new Gun(o) }\n\t\t\treturn Gun.create(this._ = {gun: this, $: this, opt: o});\n\t\t}\n\n\t\tGun.is = function($){ return ($ instanceof Gun) || ($ && $._ && ($ === $._.$)) || false }\n\n\t\tGun.version = 0.9;\n\n\t\tGun.chain = Gun.prototype;\n\t\tGun.chain.toJSON = function(){};\n\n\t\tvar Type = USE('./type');\n\t\tType.obj.to(Type, Gun);\n\t\tGun.HAM = USE('./HAM');\n\t\tGun.val = USE('./val');\n\t\tGun.node = USE('./node');\n\t\tGun.state = USE('./state');\n\t\tGun.graph = USE('./graph');\n\t\tGun.on = USE('./onto');\n\t\tGun.ask = USE('./ask');\n\t\tGun.dup = USE('./dup');\n\n\t\t;(function(){\n\t\t\tGun.create = function(at){\n\t\t\t\tat.root = at.root || at;\n\t\t\t\tat.graph = at.graph || {};\n\t\t\t\tat.on = at.on || Gun.on;\n\t\t\t\tat.ask = at.ask || Gun.ask;\n\t\t\t\tat.dup = at.dup || Gun.dup();\n\t\t\t\tvar gun = at.$.opt(at.opt);\n\t\t\t\tif(!at.once){\n\t\t\t\t\tat.on('in', root, at);\n\t\t\t\t\tat.on('out', root, {at: at, out: root});\n\t\t\t\t\tGun.on('create', at);\n\t\t\t\t\tat.on('create', at);\n\t\t\t\t}\n\t\t\t\tat.once = 1;\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t\tfunction root(msg){\n\t\t\t\t//add to.next(at); // TODO: MISSING FEATURE!!!\n\t\t\t\tvar ev = this, as = ev.as, at = as.at || as, gun = at.$, dup, tmp;\n\t\t\t\tif(!(tmp = msg['#'])){ tmp = msg['#'] = text_rand(9) }\n\t\t\t\tif((dup = at.dup).check(tmp)){\n\t\t\t\t\tif(as.out === msg.out){\n\t\t\t\t\t\tmsg.out = u;\n\t\t\t\t\t\tev.to.next(msg);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdup.track(tmp);\n\t\t\t\tif(!at.ask(msg['@'], msg)){\n\t\t\t\t\tif(msg.get){\n\t\t\t\t\t\tGun.on.get(msg, gun); //at.on('get', get(msg));\n\t\t\t\t\t}\n\t\t\t\t\tif(msg.put){\n\t\t\t\t\t\tGun.on.put(msg, gun); //at.on('put', put(msg));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tev.to.next(msg);\n\t\t\t\tif(!as.out){\n\t\t\t\t\tmsg.out = root;\n\t\t\t\t\tat.on('out', msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}());\n\n\t\t;(function(){\n\t\t\tGun.on.put = function(msg, gun){\n\t\t\t\tvar at = gun._, ctx = {$: gun, graph: at.graph, put: {}, map: {}, souls: {}, machine: Gun.state(), ack: msg['@'], cat: at, stop: {}};\n\t\t\t\tif(!Gun.graph.is(msg.put, null, verify, ctx)){ ctx.err = \"Error: Invalid graph!\" }\n\t\t\t\tif(ctx.err){ return at.on('in', {'@': msg['#'], err: Gun.log(ctx.err) }) }\n\t\t\t\tobj_map(ctx.put, merge, ctx);\n\t\t\t\tif(!ctx.async){ obj_map(ctx.map, map, ctx) }\n\t\t\t\tif(u !== ctx.defer){\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tGun.on.put(msg, gun);\n\t\t\t\t\t}, ctx.defer - ctx.machine);\n\t\t\t\t}\n\t\t\t\tif(!ctx.diff){ return }\n\t\t\t\tat.on('put', obj_to(msg, {put: ctx.diff}));\n\t\t\t};\n\t\t\tfunction verify(val, key, node, soul){ var ctx = this;\n\t\t\t\tvar state = Gun.state.is(node, key), tmp;\n\t\t\t\tif(!state){ return ctx.err = \"Error: No state on '\"+key+\"' in node '\"+soul+\"'!\" }\n\t\t\t\tvar vertex = ctx.graph[soul] || empty, was = Gun.state.is(vertex, key, true), known = vertex[key];\n\t\t\t\tvar HAM = Gun.HAM(ctx.machine, state, was, val, known);\n\t\t\t\tif(!HAM.incoming){\n\t\t\t\t\tif(HAM.defer){ // pick the lowest\n\t\t\t\t\t\tctx.defer = (state < (ctx.defer || Infinity))? state : ctx.defer;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tctx.put[soul] = Gun.state.to(node, key, ctx.put[soul]);\n\t\t\t\t(ctx.diff || (ctx.diff = {}))[soul] = Gun.state.to(node, key, ctx.diff[soul]);\n\t\t\t\tctx.souls[soul] = true;\n\t\t\t}\n\t\t\tfunction merge(node, soul){\n\t\t\t\tvar ctx = this, cat = ctx.$._, at = (cat.next || empty)[soul];\n\t\t\t\tif(!at){\n\t\t\t\t\tif(!(cat.opt||empty).super){\n\t\t\t\t\t\tctx.souls[soul] = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tat = (ctx.$.get(soul)._);\n\t\t\t\t}\n\t\t\t\tvar msg = ctx.map[soul] = {\n\t\t\t\t\tput: node,\n\t\t\t\t\tget: soul,\n\t\t\t\t\t$: at.$\n\t\t\t\t}, as = {ctx: ctx, msg: msg};\n\t\t\t\tctx.async = !!cat.tag.node;\n\t\t\t\tif(ctx.ack){ msg['@'] = ctx.ack }\n\t\t\t\tobj_map(node, each, as);\n\t\t\t\tif(!ctx.async){ return }\n\t\t\t\tif(!ctx.and){\n\t\t\t\t\t// If it is async, we only need to setup one listener per context (ctx)\n\t\t\t\t\tcat.on('node', function(m){\n\t\t\t\t\t\tthis.to.next(m); // make sure to call other context's listeners.\n\t\t\t\t\t\tif(m !== ctx.map[m.get]){ return } // filter out events not from this context!\n\t\t\t\t\t\tctx.souls[m.get] = false; // set our many-async flag\n\t\t\t\t\t\tobj_map(m.put, patch, m); // merge into view\n\t\t\t\t\t\tif(obj_map(ctx.souls, function(v){ if(v){ return v } })){ return } // if flag still outstanding, keep waiting.\n\t\t\t\t\t\tif(ctx.c){ return } ctx.c = 1; // failsafe for only being called once per context.\n\t\t\t\t\t\tthis.off();\n\t\t\t\t\t\tobj_map(ctx.map, map, ctx); // all done, trigger chains.\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tctx.and = true;\n\t\t\t\tcat.on('node', msg); // each node on the current context's graph needs to be emitted though.\n\t\t\t}\n\t\t\tfunction each(val, key){\n\t\t\t\tvar ctx = this.ctx, graph = ctx.graph, msg = this.msg, soul = msg.get, node = msg.put, at = (msg.$._), tmp;\n\t\t\t\tgraph[soul] = Gun.state.to(node, key, graph[soul]);\n\t\t\t\tif(ctx.async){ return }\n\t\t\t\tat.put = Gun.state.to(node, key, at.put);\n\t\t\t}\n\t\t\tfunction patch(val, key){\n\t\t\t\tvar msg = this, node = msg.put, at = (msg.$._);\n\t\t\t\tat.put = Gun.state.to(node, key, at.put);\n\t\t\t}\n\t\t\tfunction map(msg, soul){\n\t\t\t\tif(!msg.$){ return }\n\t\t\t\tthis.cat.stop = this.stop; // temporary fix till a better solution?\n\t\t\t\t(msg.$._).on('in', msg);\n\t\t\t\tthis.cat.stop = null; // temporary fix till a better solution?\n\t\t\t}\n\n\t\t\tGun.on.get = function(msg, gun){\n\t\t\t\tvar root = gun._, get = msg.get, soul = get[_soul], node = root.graph[soul], has = get[_has], tmp;\n\t\t\t\tvar next = root.next || (root.next = {}), at = next[soul];\n\t\t\t\t// queue concurrent GETs?\n\t\t\t\tif(!node){ return root.on('get', msg) }\n\t\t\t\tif(has){\n\t\t\t\t\tif('string' != typeof has || !obj_has(node, has)){ return root.on('get', msg) }\n\t\t\t\t\tnode = Gun.state.to(node, has);\n\t\t\t\t\t// If we have a key in-memory, do we really need to fetch?\n\t\t\t\t\t// Maybe... in case the in-memory key we have is a local write\n\t\t\t\t\t// we still need to trigger a pull/merge from peers.\n\t\t\t\t} else {\n\t\t\t\t\tnode = Gun.obj.copy(node);\n\t\t\t\t}\n\t\t\t\tnode = Gun.graph.node(node);\n\t\t\t\ttmp = (at||empty).ack;\n\t\t\t\troot.on('in', {\n\t\t\t\t\t'@': msg['#'],\n\t\t\t\t\thow: 'mem',\n\t\t\t\t\tput: node,\n\t\t\t\t\t$: gun\n\t\t\t\t});\n\t\t\t\t//if(0 < tmp){ return }\n\t\t\t\troot.on('get', msg);\n\t\t\t}\n\t\t}());\n\n\t\t;(function(){\n\t\t\tGun.chain.opt = function(opt){\n\t\t\t\topt = opt || {};\n\t\t\t\tvar gun = this, at = gun._, tmp = opt.peers || opt;\n\t\t\t\tif(!obj_is(opt)){ opt = {} }\n\t\t\t\tif(!obj_is(at.opt)){ at.opt = opt }\n\t\t\t\tif(text_is(tmp)){ tmp = [tmp] }\n\t\t\t\tif(list_is(tmp)){\n\t\t\t\t\ttmp = obj_map(tmp, function(url, i, map){\n\t\t\t\t\t\ti = {}; i.id = i.url = url; map(url, i);\n\t\t\t\t\t});\n\t\t\t\t\tif(!obj_is(at.opt.peers)){ at.opt.peers = {}}\n\t\t\t\t\tat.opt.peers = obj_to(tmp, at.opt.peers);\n\t\t\t\t}\n\t\t\t\tat.opt.peers = at.opt.peers || {};\n\t\t\t\tobj_map(opt, function each(v,k){\n\t\t\t\t\tif(!obj_has(this, k) || text.is(v) || obj.empty(v)){ this[k] = v ; return }\n\t\t\t\t\tif(v && v.constructor !== Object && !list_is(v)){ return }\n\t\t\t\t\tobj_map(v, each, this[k]);\n\t\t\t\t}, at.opt);\n\t\t\t\tGun.on('opt', at);\n\t\t\t\tat.opt.uuid = at.opt.uuid || function(){ return state_lex() + text_rand(12) }\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t}());\n\n\t\tvar list_is = Gun.list.is;\n\t\tvar text = Gun.text, text_is = text.is, text_rand = text.random;\n\t\tvar obj = Gun.obj, obj_is = obj.is, obj_has = obj.has, obj_to = obj.to, obj_map = obj.map, obj_copy = obj.copy;\n\t\tvar state_lex = Gun.state.lex, _soul = Gun.val.link._, _has = '.', node_ = Gun.node._, rel_is = Gun.val.link.is;\n\t\tvar empty = {}, u;\n\n\t\tconsole.debug = function(i, s){ return (console.debug.i && i === console.debug.i && console.debug.i++) && (console.log.apply(console, arguments) || s) };\n\n\t\tGun.log = function(){ return (!Gun.log.off && console.log.apply(console, arguments)), [].slice.call(arguments).join(' ') }\n\t\tGun.log.once = function(w,s,o){ return (o = Gun.log.once)[w] = o[w] || 0, o[w]++ || Gun.log(s) }\n\n\t\t;\"Please do not remove these messages unless you are paying for a monthly sponsorship, thanks!\";\n\t\tGun.log.once(\"welcome\", \"Hello wonderful person! :) Thanks for using GUN, feel free to ask for help on https://gitter.im/amark/gun and ask StackOverflow questions tagged with 'gun'!\");\n\t\t;\"Please do not remove these messages unless you are paying for a monthly sponsorship, thanks!\";\n\n\t\tif(typeof window !== \"undefined\"){ (window.GUN = window.Gun = Gun).window = window }\n\t\ttry{ if(typeof common !== \"undefined\"){ common.exports = Gun } }catch(e){}\n\t\tmodule.exports = Gun;\n\n\t\t/*Gun.on('opt', function(ctx){ // FOR TESTING PURPOSES\n\t\t\tthis.to.next(ctx);\n\t\t\tif(ctx.once){ return }\n\t\t\tctx.on('node', function(msg){\n\t\t\t\tvar to = this.to;\n\t\t\t\t//Gun.node.is(msg.put, function(v,k){ msg.put[k] = v + v });\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tto.next(msg);\n\t\t\t\t},1);\n\t\t\t});\n\t\t});*/\n\t})(USE, './root');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./root');\n\t\tGun.chain.back = function(n, opt){ var tmp;\n\t\t\tn = n || 1;\n\t\t\tif(-1 === n || Infinity === n){\n\t\t\t\treturn this._.root.$;\n\t\t\t} else\n\t\t\tif(1 === n){\n\t\t\t\treturn (this._.back || this._).$;\n\t\t\t}\n\t\t\tvar gun = this, at = gun._;\n\t\t\tif(typeof n === 'string'){\n\t\t\t\tn = n.split('.');\n\t\t\t}\n\t\t\tif(n instanceof Array){\n\t\t\t\tvar i = 0, l = n.length, tmp = at;\n\t\t\t\tfor(i; i < l; i++){\n\t\t\t\t\ttmp = (tmp||empty)[n[i]];\n\t\t\t\t}\n\t\t\t\tif(u !== tmp){\n\t\t\t\t\treturn opt? gun : tmp;\n\t\t\t\t} else\n\t\t\t\tif((tmp = at.back)){\n\t\t\t\t\treturn tmp.$.back(n, opt);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(n instanceof Function){\n\t\t\t\tvar yes, tmp = {back: at};\n\t\t\t\twhile((tmp = tmp.back)\n\t\t\t\t&& u === (yes = n(tmp, opt))){}\n\t\t\t\treturn yes;\n\t\t\t}\n\t\t\tif(Gun.num.is(n)){\n\t\t\t\treturn (at.back || at).$.back(n - 1);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tvar empty = {}, u;\n\t})(USE, './back');\n\n\t;USE(function(module){\n\t\t// WARNING: GUN is very simple, but the JavaScript chaining API around GUN\n\t\t// is complicated and was extremely hard to build. If you port GUN to another\n\t\t// language, consider implementing an easier API to build.\n\t\tvar Gun = USE('./root');\n\t\tGun.chain.chain = function(sub){\n\t\t\tvar gun = this, at = gun._, chain = new (sub || gun).constructor(gun), cat = chain._, root;\n\t\t\tcat.root = root = at.root;\n\t\t\tcat.id = ++root.once;\n\t\t\tcat.back = gun._;\n\t\t\tcat.on = Gun.on;\n\t\t\tcat.on('in', input, cat); // For 'in' if I add my own listeners to each then I MUST do it before in gets called. If I listen globally for all incoming data instead though, regardless of individual listeners, I can transform the data there and then as well.\n\t\t\tcat.on('out', output, cat); // However for output, there isn't really the global option. I must listen by adding my own listener individually BEFORE this one is ever called.\n\t\t\treturn chain;\n\t\t}\n\n\t\tfunction output(msg){\n\t\t\tvar put, get, at = this.as, back = at.back, root = at.root, tmp;\n\t\t\tif(!msg.$){ msg.$ = at.$ }\n\t\t\tthis.to.next(msg);\n\t\t\tif(get = msg.get){\n\t\t\t\t/*if(u !== at.put){\n\t\t\t\t\tat.on('in', at);\n\t\t\t\t\treturn;\n\t\t\t\t}*/\n\t\t\t\tif(at.lex){ msg.get = obj_to(at.lex, msg.get) }\n\t\t\t\tif(get['#'] || at.soul){\n\t\t\t\t\tget['#'] = get['#'] || at.soul;\n\t\t\t\t\tmsg['#'] || (msg['#'] = text_rand(9));\n\t\t\t\t\tback = (root.$.get(get['#'])._);\n\t\t\t\t\tif(!(get = get['.'])){\n\t\t\t\t\t\ttmp = back.ack;\n\t\t\t\t\t\tif(!tmp){ back.ack = -1 }\n\t\t\t\t\t\tif(obj_has(back, 'put')){\n\t\t\t\t\t\t\tback.on('in', back);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(tmp){ return }\n\t\t\t\t\t\tmsg.$ = back.$;\n\t\t\t\t\t} else\n\t\t\t\t\tif(obj_has(back.put, get)){ // TODO: support #LEX !\n\t\t\t\t\t\tput = (back.$.get(get)._);\n\t\t\t\t\t\tif(!(tmp = put.ack)){ put.ack = -1 }\n\t\t\t\t\t\tback.on('in', {\n\t\t\t\t\t\t\t$: back.$,\n\t\t\t\t\t\t\tput: Gun.state.to(back.put, get),\n\t\t\t\t\t\t\tget: back.get\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif(tmp){ return }\n\t\t\t\t\t} else\n\t\t\t\t\tif('string' != typeof get){\n\t\t\t\t\t\tvar put = {}, meta = (back.put||{})._;\n\t\t\t\t\t\tGun.obj.map(back.put, function(v,k){\n\t\t\t\t\t\t\tif(!Gun.text.match(k, get)){ return }\n\t\t\t\t\t\t\tput[k] = v;\n\t\t\t\t\t\t})\n\t\t\t\t\t\tif(!Gun.obj.empty(put)){\n\t\t\t\t\t\t\tput._ = meta;\n\t\t\t\t\t\t\tback.on('in', {$: back.$, put: put, get: back.get})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\troot.ask(ack, msg);\n\t\t\t\t\treturn root.on('in', msg);\n\t\t\t\t}\n\t\t\t\tif(root.now){ root.now[at.id] = root.now[at.id] || true; at.pass = {} }\n\t\t\t\tif(get['.']){\n\t\t\t\t\tif(at.get){\n\t\t\t\t\t\tmsg = {get: {'.': at.get}, $: at.$};\n\t\t\t\t\t\t//if(back.ask || (back.ask = {})[at.get]){ return }\n\t\t\t\t\t\t(back.ask || (back.ask = {}));\n\t\t\t\t\t\tback.ask[at.get] = msg.$._; // TODO: PERFORMANCE? More elegant way?\n\t\t\t\t\t\treturn back.on('out', msg);\n\t\t\t\t\t}\n\t\t\t\t\tmsg = {get: {}, $: at.$};\n\t\t\t\t\treturn back.on('out', msg);\n\t\t\t\t}\n\t\t\t\tat.ack = at.ack || -1;\n\t\t\t\tif(at.get){\n\t\t\t\t\tmsg.$ = at.$;\n\t\t\t\t\tget['.'] = at.get;\n\t\t\t\t\t(back.ask || (back.ask = {}))[at.get] = msg.$._; // TODO: PERFORMANCE? More elegant way?\n\t\t\t\t\treturn back.on('out', msg);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn back.on('out', msg);\n\t\t}\n\n\t\tfunction input(msg){\n\t\t\tvar eve = this, cat = eve.as, root = cat.root, gun = msg.$, at = (gun||empty)._ || empty, change = msg.put, rel, tmp;\n\t\t\tif(cat.get && msg.get !== cat.get){\n\t\t\t\tmsg = obj_to(msg, {get: cat.get});\n\t\t\t}\n\t\t\tif(cat.has && at !== cat){\n\t\t\t\tmsg = obj_to(msg, {$: cat.$});\n\t\t\t\tif(at.ack){\n\t\t\t\t\tcat.ack = at.ack;\n\t\t\t\t\t//cat.ack = cat.ack || at.ack;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(u === change){\n\t\t\t\ttmp = at.put;\n\t\t\t\teve.to.next(msg);\n\t\t\t\tif(cat.soul){ return } // TODO: BUG, I believee the fresh input refactor caught an edge case that a `gun.get('soul').get('key')` that points to a soul that doesn't exist will not trigger val/get etc.\n\t\t\t\tif(u === tmp && u !== at.put){ return }\n\t\t\t\techo(cat, msg, eve);\n\t\t\t\tif(cat.has){\n\t\t\t\t\tnot(cat, msg);\n\t\t\t\t}\n\t\t\t\tobj_del(at.echo, cat.id);\n\t\t\t\tobj_del(cat.map, at.id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(cat.soul){\n\t\t\t\teve.to.next(msg);\n\t\t\t\techo(cat, msg, eve);\n\t\t\t\tif(cat.next){ obj_map(change, map, {msg: msg, cat: cat}) }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!(rel = Gun.val.link.is(change))){\n\t\t\t\tif(Gun.val.is(change)){\n\t\t\t\t\tif(cat.has || cat.soul){\n\t\t\t\t\t\tnot(cat, msg);\n\t\t\t\t\t} else\n\t\t\t\t\tif(at.has || at.soul){\n\t\t\t\t\t\t(at.echo || (at.echo = {}))[cat.id] = at.echo[at.id] || cat;\n\t\t\t\t\t\t(cat.map || (cat.map = {}))[at.id] = cat.map[at.id] || {at: at};\n\t\t\t\t\t\t//if(u === at.put){ return } // Not necessary but improves performance. If we have it but at does not, that means we got things out of order and at will get it. Once at gets it, it will tell us again.\n\t\t\t\t\t}\n\t\t\t\t\teve.to.next(msg);\n\t\t\t\t\techo(cat, msg, eve);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(cat.has && at !== cat && obj_has(at, 'put')){\n\t\t\t\t\tcat.put = at.put;\n\t\t\t\t};\n\t\t\t\tif((rel = Gun.node.soul(change)) && at.has){\n\t\t\t\t\tat.put = (cat.root.$.get(rel)._).put;\n\t\t\t\t}\n\t\t\t\ttmp = (root.stop || {})[at.id];\n\t\t\t\t//if(tmp && tmp[cat.id]){ } else {\n\t\t\t\t\teve.to.next(msg);\n\t\t\t\t//}\n\t\t\t\trelate(cat, msg, at, rel);\n\t\t\t\techo(cat, msg, eve);\n\t\t\t\tif(cat.next){ obj_map(change, map, {msg: msg, cat: cat}) }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar was = root.stop;\n\t\t\ttmp = root.stop || {};\n\t\t\ttmp = tmp[at.id] || (tmp[at.id] = {});\n\t\t\t//if(tmp[cat.id]){ return }\n\t\t\ttmp.is = tmp.is || at.put;\n\t\t\ttmp[cat.id] = at.put || true;\n\t\t\t//if(root.stop){\n\t\t\t\teve.to.next(msg)\n\t\t\t//}\n\t\t\trelate(cat, msg, at, rel);\n\t\t\techo(cat, msg, eve);\n\t\t}\n\n\t\tfunction relate(at, msg, from, rel){\n\t\t\tif(!rel || node_ === at.get){ return }\n\t\t\tvar tmp = (at.root.$.get(rel)._);\n\t\t\tif(at.has){\n\t\t\t\tfrom = tmp;\n\t\t\t} else\n\t\t\tif(from.has){\n\t\t\t\trelate(from, msg, from, rel);\n\t\t\t}\n\t\t\tif(from === at){ return }\n\t\t\tif(!from.$){ from = {} }\n\t\t\t(from.echo || (from.echo = {}))[at.id] = from.echo[at.id] || at;\n\t\t\tif(at.has && !(at.map||empty)[from.id]){ // if we haven't seen this before.\n\t\t\t\tnot(at, msg);\n\t\t\t}\n\t\t\ttmp = from.id? ((at.map || (at.map = {}))[from.id] = at.map[from.id] || {at: from}) : {};\n\t\t\tif(rel === tmp.link){\n\t\t\t\tif(!(tmp.pass || at.pass)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(at.pass){\n\t\t\t\tGun.obj.map(at.map, function(tmp){ tmp.pass = true })\n\t\t\t\tobj_del(at, 'pass');\n\t\t\t}\n\t\t\tif(tmp.pass){ obj_del(tmp, 'pass') }\n\t\t\tif(at.has){ at.link = rel }\n\t\t\task(at, tmp.link = rel);\n\t\t}\n\t\tfunction echo(at, msg, ev){\n\t\t\tif(!at.echo){ return } // || node_ === at.get ?\n\t\t\t//if(at.has){ msg = obj_to(msg, {event: ev}) }\n\t\t\tobj_map(at.echo, reverb, msg);\n\t\t}\n\t\tfunction reverb(to){\n\t\t\tif(!to || !to.on){ return }\n\t\t\tto.on('in', this);\n\t\t}\n\t\tfunction map(data, key){ // Map over only the changes on every update.\n\t\t\tvar cat = this.cat, next = cat.next || empty, via = this.msg, chain, at, tmp;\n\t\t\tif(node_ === key && !next[key]){ return }\n\t\t\tif(!(at = next[key])){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//if(data && data[_soul] && (tmp = Gun.val.link.is(data)) && (tmp = (cat.root.$.get(tmp)._)) && obj_has(tmp, 'put')){\n\t\t\t//\tdata = tmp.put;\n\t\t\t//}\n\t\t\tif(at.has){\n\t\t\t\t//if(!(data && data[_soul] && Gun.val.link.is(data) === Gun.node.soul(at.put))){\n\t\t\t\tif(u === at.put || !Gun.val.link.is(data)){\n\t\t\t\t\tat.put = data;\n\t\t\t\t}\n\t\t\t\tchain = at.$;\n\t\t\t} else\n\t\t\tif(tmp = via.$){\n\t\t\t\ttmp = (chain = via.$.get(key))._;\n\t\t\t\tif(u === tmp.put || !Gun.val.link.is(data)){\n\t\t\t\t\ttmp.put = data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tat.on('in', {\n\t\t\t\tput: data,\n\t\t\t\tget: key,\n\t\t\t\t$: chain,\n\t\t\t\tvia: via\n\t\t\t});\n\t\t}\n\t\tfunction not(at, msg){\n\t\t\tif(!(at.has || at.soul)){ return }\n\t\t\tvar tmp = at.map, root = at.root;\n\t\t\tat.map = null;\n\t\t\tif(at.has){\n\t\t\t\tif(at.dub && at.root.stop){ at.dub = null }\n\t\t\t\tat.link = null;\n\t\t\t}\n\t\t\t//if(!root.now || !root.now[at.id]){\n\t\t\tif(!at.pass){\n\t\t\t\tif((!msg['@']) && null === tmp){ return }\n\t\t\t\t//obj_del(at, 'pass');\n\t\t\t}\n\t\t\tif(u === tmp && Gun.val.link.is(at.put)){ return } // This prevents the very first call of a thing from triggering a \"clean up\" call. // TODO: link.is(at.put) || !val.is(at.put) ?\n\t\t\tobj_map(tmp, function(proxy){\n\t\t\t\tif(!(proxy = proxy.at)){ return }\n\t\t\t\tobj_del(proxy.echo, at.id);\n\t\t\t});\n\t\t\ttmp = at.put;\n\t\t\tobj_map(at.next, function(neat, key){\n\t\t\t\tif(u === tmp && u !== at.put){ return true }\n\t\t\t\tneat.put = u;\n\t\t\t\tif(neat.ack){\n\t\t\t\t\tneat.ack = -1; // TODO: BUG? Should this be 0?\n\t\t\t\t}\n\t\t\t\tneat.on('in', {\n\t\t\t\t\tget: key,\n\t\t\t\t\t$: neat.$,\n\t\t\t\t\tput: u\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tfunction ask(at, soul){\n\t\t\tvar tmp = (at.root.$.get(soul)._), lex = at.lex;\n\t\t\tif(at.ack || lex){\n\t\t\t\t(lex = lex||{})['#'] = soul;\n\t\t\t\ttmp.on('out', {get: lex});\n\t\t\t\tif(!at.ask){ return } // TODO: PERFORMANCE? More elegant way?\n\t\t\t}\n\t\t\ttmp = at.ask; Gun.obj.del(at, 'ask');\n\t\t\tobj_map(tmp || at.next, function(neat, key){\n\t\t\t\tvar lex = neat.lex || {}; lex['#'] = soul; lex['.'] = lex['.'] || key;\n\t\t\t\tneat.on('out', {get: lex});\n\t\t\t});\n\t\t\tGun.obj.del(at, 'ask'); // TODO: PERFORMANCE? More elegant way?\n\t\t}\n\t\tfunction ack(msg, ev){\n\t\t\tvar as = this.as, get = as.get || empty, at = as.$._, tmp = (msg.put||empty)[get['#']];\n\t\t\tif(at.ack){ at.ack = (at.ack + 1) || 1; }\n\t\t\tif(!msg.put || ('string' == typeof get['.'] && !obj_has(tmp, at.get))){\n\t\t\t\tif(at.put !== u){ return }\n\t\t\t\tat.on('in', {\n\t\t\t\t\tget: at.get,\n\t\t\t\t\tput: at.put = u,\n\t\t\t\t\t$: at.$,\n\t\t\t\t\t'@': msg['@']\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(node_ == get['.']){ // is this a security concern?\n\t\t\t\tat.on('in', {get: at.get, put: Gun.val.link.ify(get['#']), $: at.$, '@': msg['@']});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tGun.on.put(msg, at.root.$);\n\t\t}\n\t\tvar empty = {}, u;\n\t\tvar obj = Gun.obj, obj_has = obj.has, obj_put = obj.put, obj_del = obj.del, obj_to = obj.to, obj_map = obj.map;\n\t\tvar text_rand = Gun.text.random;\n\t\tvar _soul = Gun.val.link._, node_ = Gun.node._;\n\t})(USE, './chain');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./root');\n\t\tGun.chain.get = function(key, cb, as){\n\t\t\tvar gun, tmp;\n\t\t\tif(typeof key === 'string'){\n\t\t\t\tvar back = this, cat = back._;\n\t\t\t\tvar next = cat.next || empty;\n\t\t\t\tif(!(gun = next[key])){\n\t\t\t\t\tgun = cache(key, back);\n\t\t\t\t}\n\t\t\t\tgun = gun.$;\n\t\t\t} else\n\t\t\tif(key instanceof Function){\n\t\t\t\tif(true === cb){ return soul(this, key, cb, as) }\n\t\t\t\tgun = this;\n\t\t\t\tvar at = gun._, root = at.root, tmp = root.now, ev;\n\t\t\t\tas = cb || {};\n\t\t\t\tas.at = at;\n\t\t\t\tas.use = key;\n\t\t\t\tas.out = as.out || {};\n\t\t\t\tas.out.get = as.out.get || {};\n\t\t\t\t(ev = at.on('in', use, as)).rid = rid;\n\t\t\t\t(root.now = {$:1})[as.now = at.id] = ev;\n\t\t\t\tvar mum = root.mum; root.mum = {};\n\t\t\t\tat.on('out', as.out);\n\t\t\t\troot.mum = mum;\n\t\t\t\troot.now = tmp;\n\t\t\t\treturn gun;\n\t\t\t} else\n\t\t\tif(num_is(key)){\n\t\t\t\treturn this.get(''+key, cb, as);\n\t\t\t} else\n\t\t\tif(tmp = rel.is(key)){\n\t\t\t\treturn this.get(tmp, cb, as);\n\t\t\t} else\n\t\t\tif(obj.is(key)){\n\t\t\t\tgun = this;\n\t\t\t\tif(tmp = ((tmp = key['#'])||empty)['='] || tmp){ gun = gun.get(tmp) }\n\t\t\t\tgun._.lex = key;\n\t\t\t\treturn gun;\n\t\t\t} else {\n\t\t\t\t(as = this.chain())._.err = {err: Gun.log('Invalid get request!', key)}; // CLEAN UP\n\t\t\t\tif(cb){ cb.call(as, as._.err) }\n\t\t\t\treturn as;\n\t\t\t}\n\t\t\tif(tmp = this._.stun){ // TODO: Refactor?\n\t\t\t\tgun._.stun = gun._.stun || tmp;\n\t\t\t}\n\t\t\tif(cb && cb instanceof Function){\n\t\t\t\tgun.get(cb, as);\n\t\t\t}\n\t\t\treturn gun;\n\t\t}\n\t\tfunction cache(key, back){\n\t\t\tvar cat = back._, next = cat.next, gun = back.chain(), at = gun._;\n\t\t\tif(!next){ next = cat.next = {} }\n\t\t\tnext[at.get = key] = at;\n\t\t\tif(back === cat.root.$){\n\t\t\t\tat.soul = key;\n\t\t\t} else\n\t\t\tif(cat.soul || cat.has){\n\t\t\t\tat.has = key;\n\t\t\t\t//if(obj_has(cat.put, key)){\n\t\t\t\t\t//at.put = cat.put[key];\n\t\t\t\t//}\n\t\t\t}\n\t\t\treturn at;\n\t\t}\n\t\tfunction soul(gun, cb, opt, as){\n\t\t\tvar cat = gun._, acks = 0, tmp;\n\t\t\tif(tmp = cat.soul || cat.link || cat.dub){ return cb(tmp, as, cat), gun }\n\t\t\tgun.get(function(msg, ev){\n\t\t\t\tif(u === msg.put && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks < tmp){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tev.rid(msg);\n\t\t\t\tvar at = ((at = msg.$) && at._) || {};\n\t\t\t\ttmp = at.link || at.soul || rel.is(msg.put) || node_soul(msg.put) || at.dub;\n\t\t\t\tcb(tmp, as, msg, ev);\n\t\t\t}, {out: {get: {'.':true}}});\n\t\t\treturn gun;\n\t\t}\n\t\tfunction use(msg){\n\t\t\tvar eve = this, as = eve.as, cat = as.at, root = cat.root, gun = msg.$, at = (gun||{})._ || {}, data = msg.put || at.put, tmp;\n\t\t\tif((tmp = root.now) && eve !== tmp[as.now]){ return eve.to.next(msg) }\n\t\t\t//console.log(\"USE:\", cat.id, cat.soul, cat.has, cat.get, msg, root.mum);\n\t\t\t//if(at.async && msg.root){ return }\n\t\t\t//if(at.async === 1 && cat.async !== true){ return }\n\t\t\t//if(root.stop && root.stop[at.id]){ return } root.stop && (root.stop[at.id] = true);\n\t\t\t//if(!at.async && !cat.async && at.put && msg.put === at.put){ return }\n\t\t\t//else if(!cat.async && msg.put !== at.put && root.stop && root.stop[at.id]){ return } root.stop && (root.stop[at.id] = true);\n\n\n\t\t\t//root.stop && (root.stop.id = root.stop.id || Gun.text.random(2));\n\t\t\t//if((tmp = root.stop) && (tmp = tmp[at.id] || (tmp[at.id] = {})) && tmp[cat.id]){ return } tmp && (tmp[cat.id] = true);\n\t\t\tif(eve.seen && at.id && eve.seen[at.id]){ return eve.to.next(msg) }\n\t\t\t//if((tmp = root.stop)){ if(tmp[at.id]){ return } tmp[at.id] = msg.root; } // temporary fix till a better solution?\n\t\t\tif((tmp = data) && tmp[rel._] && (tmp = rel.is(tmp))){\n\t\t\t\ttmp = ((msg.$$ = at.root.gun.get(tmp))._);\n\t\t\t\tif(u !== tmp.put){\n\t\t\t\t\tmsg = obj_to(msg, {put: data = tmp.put});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((tmp = root.mum) && at.id){ // TODO: can we delete mum entirely now?\n\t\t\t\tvar id = at.id + (eve.id || (eve.id = Gun.text.random(9)));\n\t\t\t\tif(tmp[id]){ return }\n\t\t\t\tif(u !== data && !rel.is(data)){ tmp[id] = true; }\n\t\t\t}\n\t\t\tas.use(msg, eve);\n\t\t\tif(eve.stun){\n\t\t\t\teve.stun = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\teve.to.next(msg);\n\t\t}\n\t\tfunction rid(at){\n\t\t\tvar cat = this.on;\n\t\t\tif(!at || cat.soul || cat.has){ return this.off() }\n\t\t\tif(!(at = (at = (at = at.$ || at)._ || at).id)){ return }\n\t\t\tvar map = cat.map, tmp, seen;\n\t\t\t//if(!map || !(tmp = map[at]) || !(tmp = tmp.at)){ return }\n\t\t\tif(tmp = (seen = this.seen || (this.seen = {}))[at]){ return true }\n\t\t\tseen[at] = true;\n\t\t\treturn;\n\t\t\t//tmp.echo[cat.id] = {}; // TODO: Warning: This unsubscribes ALL of this chain's listeners from this link, not just the one callback event.\n\t\t\t//obj.del(map, at); // TODO: Warning: This unsubscribes ALL of this chain's listeners from this link, not just the one callback event.\n\t\t\treturn;\n\t\t}\n\t\tvar obj = Gun.obj, obj_map = obj.map, obj_has = obj.has, obj_to = Gun.obj.to;\n\t\tvar num_is = Gun.num.is;\n\t\tvar rel = Gun.val.link, node_soul = Gun.node.soul, node_ = Gun.node._;\n\t\tvar empty = {}, u;\n\t})(USE, './get');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./root');\n\t\tGun.chain.put = function(data, cb, as){\n\t\t\t// #soul.has=value>state\n\t\t\t// ~who#where.where=what>when@was\n\t\t\t// TODO: BUG! Put probably cannot handle plural chains!\n\t\t\tvar gun = this, at = (gun._), root = at.root.$, ctx = root._, M = 100, tmp;\n\t\t\tif(!ctx.puta){ if(tmp = ctx.puts){ if(tmp > M){ // without this, when synchronous, writes to a 'not found' pile up, when 'not found' resolves it recursively calls `put` which incrementally resolves each write. Stack overflow limits can be as low as 10K, so this limit is hardcoded to 1% of 10K.\n\t\t\t\t(ctx.stack || (ctx.stack = [])).push([gun, data, cb, as]);\n\t\t\t\tif(ctx.puto){ return }\n\t\t\t\tctx.puto = setTimeout(function drain(){\n\t\t\t\t\tvar d = ctx.stack.splice(0,M), i = 0, at; ctx.puta = true;\n\t\t\t\t\twhile(at = d[i++]){ at[0].put(at[1], at[2], at[3]) } delete ctx.puta;\n\t\t\t\t\tif(ctx.stack.length){ return ctx.puto = setTimeout(drain, 0) }\n\t\t\t\t\tctx.stack = ctx.puts = ctx.puto = null;\n\t\t\t\t}, 0);\n\t\t\t\treturn gun;\n\t\t\t} ++ctx.puts } else { ctx.puts = 1 } }\n\t\t\tas = as || {};\n\t\t\tas.data = data;\n\t\t\tas.via = as.$ = as.via || as.$ || gun;\n\t\t\tif(typeof cb === 'string'){\n\t\t\t\tas.soul = cb;\n\t\t\t} else {\n\t\t\t\tas.ack = as.ack || cb;\n\t\t\t}\n\t\t\tif(at.soul){\n\t\t\t\tas.soul = at.soul;\n\t\t\t}\n\t\t\tif(as.soul || root === gun){\n\t\t\t\tif(!obj_is(as.data)){\n\t\t\t\t\t(as.ack||noop).call(as, as.out = {err: Gun.log(\"Data saved to the root level of the graph must be a node (an object), not a\", (typeof as.data), 'of \"' + as.data + '\"!')});\n\t\t\t\t\tif(as.res){ as.res() }\n\t\t\t\t\treturn gun;\n\t\t\t\t}\n\t\t\t\tas.soul = as.soul || (as.not = Gun.node.soul(as.data) || (as.via.back('opt.uuid') || Gun.text.random)());\n\t\t\t\tif(!as.soul){ // polyfill async uuid for SEA\n\t\t\t\t\tas.via.back('opt.uuid')(function(err, soul){ // TODO: improve perf without anonymous callback\n\t\t\t\t\t\tif(err){ return Gun.log(err) } // TODO: Handle error!\n\t\t\t\t\t\t(as.ref||as.$).put(as.data, as.soul = soul, as);\n\t\t\t\t\t});\n\t\t\t\t\treturn gun;\n\t\t\t\t}\n\t\t\t\tas.$ = root.get(as.soul);\n\t\t\t\tas.ref = as.$;\n\t\t\t\tify(as);\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t\tif(Gun.is(data)){\n\t\t\t\tdata.get(function(soul, o, msg){\n\t\t\t\t\tif(!soul){\n\t\t\t\t\t\treturn Gun.log(\"The reference you are saving is a\", typeof msg.put, '\"'+ msg.put +'\", not a node (object)!');\n\t\t\t\t\t}\n\t\t\t\t\tgun.put(Gun.val.link.ify(soul), cb, as);\n\t\t\t\t}, true);\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t\tif(at.has && (tmp = Gun.val.link.is(data))){ at.dub = tmp }\n\t\t\tas.ref = as.ref || (root._ === (tmp = at.back))? gun : tmp.$;\n\t\t\tif(as.ref._.soul && Gun.val.is(as.data) && at.get){\n\t\t\t\tas.data = obj_put({}, at.get, as.data);\n\t\t\t\tas.ref.put(as.data, as.soul, as);\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t\tas.ref.get(any, true, {as: as});\n\t\t\tif(!as.out){\n\t\t\t\t// TODO: Perf idea! Make a global lock, that blocks everything while it is on, but if it is on the lock it does the expensive lookup to see if it is a dependent write or not and if not then it proceeds full speed. Meh? For write heavy async apps that would be terrible.\n\t\t\t\tas.res = as.res || stun; // Gun.on.stun(as.ref); // TODO: BUG! Deal with locking?\n\t\t\t\tas.$._.stun = as.ref._.stun;\n\t\t\t}\n\t\t\treturn gun;\n\t\t};\n\n\t\tfunction ify(as){\n\t\t\tas.batch = batch;\n\t\t\tvar opt = as.opt||{}, env = as.env = Gun.state.map(map, opt.state);\n\t\t\tenv.soul = as.soul;\n\t\t\tas.graph = Gun.graph.ify(as.data, env, as);\n\t\t\tif(env.err){\n\t\t\t\t(as.ack||noop).call(as, as.out = {err: Gun.log(env.err)});\n\t\t\t\tif(as.res){ as.res() }\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tas.batch();\n\t\t}\n\n\t\tfunction stun(cb){\n\t\t\tif(cb){ cb() }\n\t\t\treturn;\n\t\t\tvar as = this;\n\t\t\tif(!as.ref){ return }\n\t\t\tif(cb){\n\t\t\t\tas.after = as.ref._.tag;\n\t\t\t\tas.now = as.ref._.tag = {};\n\t\t\t\tcb();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(as.after){\n\t\t\t\tas.ref._.tag = as.after;\n\t\t\t}\n\t\t}\n\n\t\tfunction batch(){ var as = this;\n\t\t\tif(!as.graph || obj_map(as.stun, no)){ return }\n\t\t\tas.res = as.res || function(cb){ if(cb){ cb() } };\n\t\t\tas.res(function(){\n\t\t\t\tvar cat = (as.$.back(-1)._), ask = cat.ask(function(ack){\n\t\t\t\t\tcat.root.on('ack', ack);\n\t\t\t\t\tif(ack.err){ Gun.log(ack) }\n\t\t\t\t\tif(++acks > (as.acks || 0)){ this.off() } // Adjustable ACKs! Only 1 by default.\n\t\t\t\t\tif(!as.ack){ return }\n\t\t\t\t\tas.ack(ack, this);\n\t\t\t\t\t//--C;\n\t\t\t\t}, as.opt), acks = 0;\n\t\t\t\t//C++;\n\t\t\t\t// NOW is a hack to get synchronous replies to correctly call.\n\t\t\t\t// and STOP is a hack to get async behavior to correctly call.\n\t\t\t\t// neither of these are ideal, need to be fixed without hacks,\n\t\t\t\t// but for now, this works for current tests. :/\n\t\t\t\tvar tmp = cat.root.now; obj.del(cat.root, 'now');\n\t\t\t\tvar mum = cat.root.mum; cat.root.mum = {};\n\t\t\t\t(as.ref._).on('out', {\n\t\t\t\t\t$: as.ref, put: as.out = as.env.graph, opt: as.opt, '#': ask\n\t\t\t\t});\n\t\t\t\tcat.root.mum = mum? obj.to(mum, cat.root.mum) : mum;\n\t\t\t\tcat.root.now = tmp;\n\t\t\t}, as);\n\t\t\tif(as.res){ as.res() }\n\t\t} function no(v,k){ if(v){ return true } }\n\n\t\tfunction map(v,k,n, at){ var as = this;\n\t\t\tvar is = Gun.is(v);\n\t\t\tif(k || !at.path.length){ return }\n\t\t\t(as.res||iife)(function(){\n\t\t\t\tvar path = at.path, ref = as.ref, opt = as.opt;\n\t\t\t\tvar i = 0, l = path.length;\n\t\t\t\tfor(i; i < l; i++){\n\t\t\t\t\tref = ref.get(path[i]);\n\t\t\t\t}\n\t\t\t\tif(is){ ref = v }\n\t\t\t\tvar id = (ref._).dub;\n\t\t\t\tif(id || (id = Gun.node.soul(at.obj))){\n\t\t\t\t\tref.back(-1).get(id);\n\t\t\t\t\tat.soul(id);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t(as.stun = as.stun || {})[path] = true;\n\t\t\t\tref.get(soul, true, {as: {at: at, as: as, p:path}});\n\t\t\t}, {as: as, at: at});\n\t\t\t//if(is){ return {} }\n\t\t}\n\n\t\tfunction soul(id, as, msg, eve){\n\t\t\tvar as = as.as, cat = as.at; as = as.as;\n\t\t\tvar at = ((msg || {}).$ || {})._ || {};\n\t\t\tid = at.dub = at.dub || id || Gun.node.soul(cat.obj) || Gun.node.soul(msg.put || at.put) || Gun.val.link.is(msg.put || at.put) || (as.via.back('opt.uuid') || Gun.text.random)(); // TODO: BUG!? Do we really want the soul of the object given to us? Could that be dangerous?\n\t\t\tif(eve){ eve.stun = true }\n\t\t\tif(!id){ // polyfill async uuid for SEA\n\t\t\t\tas.via.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback\n\t\t\t\t\tif(err){ return Gun.log(err) } // TODO: Handle error.\n\t\t\t\t\tsolve(at, at.dub = at.dub || id, cat, as);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsolve(at, at.dub = id, cat, as);\n\t\t}\n\n\t\tfunction solve(at, id, cat, as){\n\t\t\tat.$.back(-1).get(id);\n\t\t\tcat.soul(id);\n\t\t\tas.stun[cat.path] = false;\n\t\t\tas.batch();\n\t\t}\n\n\t\tfunction any(soul, as, msg, eve){\n\t\t\tas = as.as;\n\t\t\tif(!msg.$ || !msg.$._){ return } // TODO: Handle\n\t\t\tif(msg.err){ // TODO: Handle\n\t\t\t\tconsole.log(\"Please report this as an issue! Put.any.err\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar at = (msg.$._), data = at.put, opt = as.opt||{}, root, tmp;\n\t\t\tif((tmp = as.ref) && tmp._.now){ return }\n\t\t\tif(eve){ eve.stun = true }\n\t\t\tif(as.ref !== as.$){\n\t\t\t\ttmp = (as.$._).get || at.get;\n\t\t\t\tif(!tmp){ // TODO: Handle\n\t\t\t\t\tconsole.log(\"Please report this as an issue! Put.no.get\"); // TODO: BUG!??\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tas.data = obj_put({}, tmp, as.data);\n\t\t\t\ttmp = null;\n\t\t\t}\n\t\t\tif(u === data){\n\t\t\t\tif(!at.get){ return } // TODO: Handle\n\t\t\t\tif(!soul){\n\t\t\t\t\ttmp = at.$.back(function(at){\n\t\t\t\t\t\tif(at.link || at.soul){ return at.link || at.soul }\n\t\t\t\t\t\tas.data = obj_put({}, at.get, as.data);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\ttmp = tmp || at.soul || at.link || at.dub;// || at.get;\n\t\t\t\tat = tmp? (at.root.$.get(tmp)._) : at;\n\t\t\t\tas.soul = tmp;\n\t\t\t\tdata = as.data;\n\t\t\t}\n\t\t\tif(!as.not && !(as.soul = as.soul || soul)){\n\t\t\t\tif(as.path && obj_is(as.data)){\n\t\t\t\t\tas.soul = (opt.uuid || as.via.back('opt.uuid') || Gun.text.random)();\n\t\t\t\t} else {\n\t\t\t\t\t//as.data = obj_put({}, as.$._.get, as.data);\n\t\t\t\t\tif(node_ == at.get){\n\t\t\t\t\t\tas.soul = (at.put||empty)['#'] || at.dub;\n\t\t\t\t\t}\n\t\t\t\t\tas.soul = as.soul || at.soul || at.link || (opt.uuid || as.via.back('opt.uuid') || Gun.text.random)();\n\t\t\t\t}\n\t\t\t\tif(!as.soul){ // polyfill async uuid for SEA\n\t\t\t\t\tas.via.back('opt.uuid')(function(err, soul){ // TODO: improve perf without anonymous callback\n\t\t\t\t\t\tif(err){ return Gun.log(err) } // Handle error.\n\t\t\t\t\t\tas.ref.put(as.data, as.soul = soul, as);\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tas.ref.put(as.data, as.soul, as);\n\t\t}\n\t\tvar obj = Gun.obj, obj_is = obj.is, obj_put = obj.put, obj_map = obj.map;\n\t\tvar u, empty = {}, noop = function(){}, iife = function(fn,as){fn.call(as||empty)};\n\t\tvar node_ = Gun.node._;\n\t})(USE, './put');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./root');\n\t\tUSE('./chain');\n\t\tUSE('./back');\n\t\tUSE('./put');\n\t\tUSE('./get');\n\t\tmodule.exports = Gun;\n\t})(USE, './index');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./index');\n\t\tGun.chain.on = function(tag, arg, eas, as){\n\t\t\tvar gun = this, at = gun._, tmp, act, off;\n\t\t\tif(typeof tag === 'string'){\n\t\t\t\tif(!arg){ return at.on(tag) }\n\t\t\t\tact = at.on(tag, arg, eas || at, as);\n\t\t\t\tif(eas && eas.$){\n\t\t\t\t\t(eas.subs || (eas.subs = [])).push(act);\n\t\t\t\t}\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t\tvar opt = arg;\n\t\t\topt = (true === opt)? {change: true} : opt || {};\n\t\t\topt.at = at;\n\t\t\topt.ok = tag;\n\t\t\t//opt.last = {};\n\t\t\tgun.get(ok, opt); // TODO: PERF! Event listener leak!!!?\n\t\t\treturn gun;\n\t\t}\n\n\t\tfunction ok(msg, ev){ var opt = this;\n\t\t\tvar gun = msg.$, at = (gun||{})._ || {}, data = at.put || msg.put, cat = opt.at, tmp;\n\t\t\tif(u === data){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tmp = msg.$$){\n\t\t\t\ttmp = (msg.$$._);\n\t\t\t\tif(u === tmp.put){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata = tmp.put;\n\t\t\t}\n\t\t\tif(opt.change){ // TODO: BUG? Move above the undef checks?\n\t\t\t\tdata = msg.put;\n\t\t\t}\n\t\t\t// DEDUPLICATE // TODO: NEEDS WORK! BAD PROTOTYPE\n\t\t\t//if(tmp.put === data && tmp.get === id && !Gun.node.soul(data)){ return }\n\t\t\t//tmp.put = data;\n\t\t\t//tmp.get = id;\n\t\t\t// DEDUPLICATE // TODO: NEEDS WORK! BAD PROTOTYPE\n\t\t\t//at.last = data;\n\t\t\tif(opt.as){\n\t\t\t\topt.ok.call(opt.as, msg, ev);\n\t\t\t} else {\n\t\t\t\topt.ok.call(gun, data, msg.get, msg, ev);\n\t\t\t}\n\t\t}\n\n\t\tGun.chain.val = function(cb, opt){\n\t\t\tGun.log.once(\"onceval\", \"Future Breaking API Change: .val -> .once, apologies unexpected.\");\n\t\t\treturn this.once(cb, opt);\n\t\t}\n\t\tGun.chain.once = function(cb, opt){\n\t\t\tvar gun = this, at = gun._, data = at.put;\n\t\t\tif(0 < at.ack && u !== data){\n\t\t\t\t(cb || noop).call(gun, data, at.get);\n\t\t\t\treturn gun;\n\t\t\t}\n\t\t\tif(cb){\n\t\t\t\t(opt = opt || {}).ok = cb;\n\t\t\t\topt.at = at;\n\t\t\t\topt.out = {'#': Gun.text.random(9)};\n\t\t\t\tgun.get(val, {as: opt});\n\t\t\t\topt.async = true; //opt.async = at.stun? 1 : true;\n\t\t\t} else {\n\t\t\t\tGun.log.once(\"valonce\", \"Chainable val is experimental, its behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it.\");\n\t\t\t\tvar chain = gun.chain();\n\t\t\t\tchain._.nix = gun.once(function(){\n\t\t\t\t\tchain._.on('in', gun._);\n\t\t\t\t});\n\t\t\t\treturn chain;\n\t\t\t}\n\t\t\treturn gun;\n\t\t}\n\n\t\tfunction val(msg, eve, to){\n\t\t\tif(!msg.$){ eve.off(); return }\n\t\t\tvar opt = this.as, cat = opt.at, gun = msg.$, at = gun._, data = at.put || msg.put, link, tmp;\n\t\t\tif(tmp = msg.$$){\n\t\t\t\tlink = tmp = (msg.$$._);\n\t\t\t\tif(u !== link.put){\n\t\t\t\t\tdata = link.put;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((tmp = eve.wait) && (tmp = tmp[at.id])){ clearTimeout(tmp) }\n\t\t\teve.ack = (eve.ack||0)+1;\n\t\t\tif(!to && u === data && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return }\n\t\t\tif((!to && (u === data || at.soul || at.link || (link && !(0 < link.ack))))\n\t\t\t|| (u === data && (tmp = Object.keys(at.root.opt.peers).length) && (!to && (link||at).ack < tmp))){\n\t\t\t\ttmp = (eve.wait = {})[at.id] = setTimeout(function(){\n\t\t\t\t\tval.call({as:opt}, msg, eve, tmp || 1);\n\t\t\t\t}, opt.wait || 99);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(link && u === link.put && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) }\n\t\t\teve.rid(msg);\n\t\t\topt.ok.call(gun || opt.$, data, msg.get);\n\t\t}\n\n\t\tGun.chain.off = function(){\n\t\t\t// make off more aggressive. Warning, it might backfire!\n\t\t\tvar gun = this, at = gun._, tmp;\n\t\t\tvar cat = at.back;\n\t\t\tif(!cat){ return }\n\t\t\tat.ack = 0; // so can resubscribe.\n\t\t\tif(tmp = cat.next){\n\t\t\t\tif(tmp[at.get]){\n\t\t\t\t\tobj_del(tmp, at.get);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tmp = cat.ask){\n\t\t\t\tobj_del(tmp, at.get);\n\t\t\t}\n\t\t\tif(tmp = cat.put){\n\t\t\t\tobj_del(tmp, at.get);\n\t\t\t}\n\t\t\tif(tmp = at.soul){\n\t\t\t\tobj_del(cat.root.graph, tmp);\n\t\t\t}\n\t\t\tif(tmp = at.map){\n\t\t\t\tobj_map(tmp, function(at){\n\t\t\t\t\tif(at.link){\n\t\t\t\t\t\tcat.root.$.get(at.link).off();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tif(tmp = at.next){\n\t\t\t\tobj_map(tmp, function(neat){\n\t\t\t\t\tneat.$.off();\n\t\t\t\t});\n\t\t\t}\n\t\t\tat.on('off', {});\n\t\t\treturn gun;\n\t\t}\n\t\tvar obj = Gun.obj, obj_map = obj.map, obj_has = obj.has, obj_del = obj.del, obj_to = obj.to;\n\t\tvar rel = Gun.val.link;\n\t\tvar empty = {}, noop = function(){}, u;\n\t})(USE, './on');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./index');\n\t\tGun.chain.map = function(cb, opt, t){\n\t\t\tvar gun = this, cat = gun._, chain;\n\t\t\tif(!cb){\n\t\t\t\tif(chain = cat.each){ return chain }\n\t\t\t\tcat.each = chain = gun.chain();\n\t\t\t\tchain._.nix = gun.back('nix');\n\t\t\t\tgun.on('in', map, chain._);\n\t\t\t\treturn chain;\n\t\t\t}\n\t\t\tGun.log.once(\"mapfn\", \"Map functions are experimental, their behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it.\");\n\t\t\tchain = gun.chain();\n\t\t\tgun.map().on(function(data, key, at, ev){\n\t\t\t\tvar next = (cb||noop).call(this, data, key, at, ev);\n\t\t\t\tif(u === next){ return }\n\t\t\t\tif(data === next){ return chain._.on('in', at) }\n\t\t\t\tif(Gun.is(next)){ return chain._.on('in', next._) }\n\t\t\t\tchain._.on('in', {get: key, put: next});\n\t\t\t});\n\t\t\treturn chain;\n\t\t}\n\t\tfunction map(msg){\n\t\t\tif(!msg.put || Gun.val.is(msg.put)){ return this.to.next(msg) }\n\t\t\tif(this.as.nix){ this.off() } // TODO: Ugly hack!\n\t\t\tobj_map(msg.put, each, {at: this.as, msg: msg});\n\t\t\tthis.to.next(msg);\n\t\t}\n\t\tfunction each(v,k){\n\t\t\tif(n_ === k){ return }\n\t\t\tvar msg = this.msg, gun = msg.$, at = gun._, cat = this.at, tmp = at.lex;\n\t\t\tif(tmp && !Gun.text.match(k, tmp['.'] || tmp['#'] || tmp)){ return } // review?\n\t\t\t((tmp = gun.get(k)._).echo || (tmp.echo = {}))[cat.id] = tmp.echo[cat.id] || cat;\n\t\t}\n\t\tvar obj_map = Gun.obj.map, noop = function(){}, event = {stun: noop, off: noop}, n_ = Gun.node._, u;\n\t})(USE, './map');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('./index');\n\t\tGun.chain.set = function(item, cb, opt){\n\t\t\tvar gun = this, soul;\n\t\t\tcb = cb || function(){};\n\t\t\topt = opt || {}; opt.item = opt.item || item;\n\t\t\tif(soul = Gun.node.soul(item)){ item = Gun.obj.put({}, soul, Gun.val.link.ify(soul)) }\n\t\t\tif(!Gun.is(item)){\n\t\t\t\tif(Gun.obj.is(item)){;\n\t\t\t\t\titem = gun.back(-1).get(soul = soul || Gun.node.soul(item) || gun.back('opt.uuid')()).put(item);\n\t\t\t\t}\n\t\t\t\treturn gun.get(soul || (Gun.state.lex() + Gun.text.random(7))).put(item, cb, opt);\n\t\t\t}\n\t\t\titem.get(function(soul, o, msg){\n\t\t\t\tif(!soul){ return cb.call(gun, {err: Gun.log('Only a node can be linked! Not \"' + msg.put + '\"!')}) }\n\t\t\t\tgun.put(Gun.obj.put({}, soul, Gun.val.link.ify(soul)), cb, opt);\n\t\t\t},true);\n\t\t\treturn item;\n\t\t}\n\t})(USE, './set');\n\n\t;USE(function(module){\n\t\tif(typeof Gun === 'undefined'){ return } // TODO: localStorage is Browser only. But it would be nice if it could somehow plugin into NodeJS compatible localStorage APIs?\n\n\t\tvar root, noop = function(){}, store, u;\n\t\ttry{store = (Gun.window||noop).localStorage}catch(e){}\n\t\tif(!store){\n\t\t\tconsole.log(\"Warning: No localStorage exists to persist data to!\");\n\t\t\tstore = {setItem: function(k,v){this[k]=v}, removeItem: function(k){delete this[k]}, getItem: function(k){return this[k]}};\n\t\t}\n\t\t/*\n\t\t\tNOTE: Both `lib/file.js` and `lib/memdisk.js` are based on this design!\n\t\t\tIf you update anything here, consider updating the other adapters as well.\n\t\t*/\n\n\t\tGun.on('create', function(root){\n\t\t\t// This code is used to queue offline writes for resync.\n\t\t\t// See the next 'opt' code below for actual saving of data.\n\t\t\tvar ev = this.to, opt = root.opt;\n\t\t\tif(root.once){ return ev.next(root) }\n\t\t\t//if(false === opt.localStorage){ return ev.next(root) } // we want offline resynce queue regardless!\n\t\t\topt.prefix = opt.file || 'gun/';\n\t\t\tvar gap = Gun.obj.ify(store.getItem('gap/'+opt.prefix)) || {};\n\t\t\tvar empty = Gun.obj.empty, id, to, go;\n\t\t\t// add re-sync command.\n\t\t\tif(!empty(gap)){\n\t\t\t\tvar disk = Gun.obj.ify(store.getItem(opt.prefix)) || {}, send = {};\n\t\t\t\tGun.obj.map(gap, function(node, soul){\n\t\t\t\t\tGun.obj.map(node, function(val, key){\n\t\t\t\t\t\tsend[soul] = Gun.state.to(disk[soul], key, send[soul]);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t// TODO: Holy Grail dangling by this thread! If gap / offline resync doesn't trigger, it doesn't work. Ouch, and this is a localStorage specific adapter. :(\n\t\t\t\t\troot.on('out', {put: send, '#': root.ask(ack)});\n\t\t\t\t},1);\n\t\t\t}\n\n\t\t\troot.on('out', function(msg){\n\t\t\t\tif(msg.lS){ return } // TODO: for IndexedDB and others, shouldn't send to peers ACKs to our own GETs.\n\t\t\t\tif(Gun.is(msg.$) && msg.put && !msg['@']){\n\t\t\t\t\tid = msg['#'];\n\t\t\t\t\tGun.graph.is(msg.put, null, map);\n\t\t\t\t\tif(!to){ to = setTimeout(flush, opt.wait || 1) }\n\t\t\t\t}\n\t\t\t\tthis.to.next(msg);\n\t\t\t});\n\t\t\troot.on('ack', ack);\n\n\t\t\tfunction ack(ack){ // TODO: This is experimental, not sure if we should keep this type of event hook.\n\t\t\t\tif(ack.err || !ack.ok){ return }\n\t\t\t\tvar id = ack['@'];\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tGun.obj.map(gap, function(node, soul){\n\t\t\t\t\t\tGun.obj.map(node, function(val, key){\n\t\t\t\t\t\t\tif(id !== val){ return }\n\t\t\t\t\t\t\tdelete node[key];\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif(empty(node)){\n\t\t\t\t\t\t\tdelete gap[soul];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tflush();\n\t\t\t\t}, opt.wait || 1);\n\t\t\t};\n\t\t\tev.next(root);\n\n\t\t\tvar map = function(val, key, node, soul){\n\t\t\t\t(gap[soul] || (gap[soul] = {}))[key] = id;\n\t\t\t}\n\t\t\tvar flush = function(){\n\t\t\t\tclearTimeout(to);\n\t\t\t\tto = false;\n\t\t\t\ttry{store.setItem('gap/'+opt.prefix, JSON.stringify(gap));\n\t\t\t\t}catch(e){ Gun.log(err = e || \"localStorage failure\") }\n\t\t\t}\n\t\t});\n\n\t\tGun.on('create', function(root){\n\t\t\tthis.to.next(root);\n\t\t\tvar opt = root.opt;\n\t\t\tif(root.once){ return }\n\t\t\tif(false === opt.localStorage){ return }\n\t\t\topt.prefix = opt.file || 'gun/';\n\t\t\tvar graph = root.graph, acks = {}, count = 0, to;\n\t\t\tvar disk = Gun.obj.ify(store.getItem(opt.prefix)) || {};\n\t\t\tvar lS = function(){}, u;\n\t\t\troot.on('localStorage', disk); // NON-STANDARD EVENT!\n\n\t\t\troot.on('put', function(at){\n\t\t\t\tthis.to.next(at);\n\t\t\t\tGun.graph.is(at.put, null, map);\n\t\t\t\tif(!at['@']){ acks[at['#']] = true; } // only ack non-acks.\n\t\t\t\tcount += 1;\n\t\t\t\tif(count >= (opt.batch || 1000)){\n\t\t\t\t\treturn flush();\n\t\t\t\t}\n\t\t\t\tif(to){ return }\n\t\t\t\tto = setTimeout(flush, opt.wait || 1);\n\t\t\t});\n\n\t\t\troot.on('get', function(msg){\n\t\t\t\tthis.to.next(msg);\n\t\t\t\tvar lex = msg.get, soul, data, u;\n\t\t\t\tfunction to(){\n\t\t\t\tif(!lex || !(soul = lex['#'])){ return }\n\t\t\t\t//if(0 >= msg.cap){ return }\n\t\t\t\tvar has = lex['.'];\n\t\t\t\tdata = disk[soul] || u;\n\t\t\t\tif(data && has){\n\t\t\t\t\tdata = Gun.state.to(data, has);\n\t\t\t\t}\n\t\t\t\t//if(!data && !Gun.obj.empty(opt.peers)){ return } // if data not found, don't ack if there are peers. // Hmm, what if we have peers but we are disconnected?\n\t\t\t\t//console.log(\"lS get\", lex, data);\n\t\t\t\troot.on('in', {'@': msg['#'], put: Gun.graph.node(data), how: 'lS', lS: msg.$});// || root.$});\n\t\t\t\t};\n\t\t\t\tGun.debug? setTimeout(to,1) : to();\n\t\t\t});\n\n\t\t\tvar map = function(val, key, node, soul){\n\t\t\t\tdisk[soul] = Gun.state.to(node, key, disk[soul]);\n\t\t\t}\n\n\t\t\tvar flush = function(data){\n\t\t\t\tvar err;\n\t\t\t\tcount = 0;\n\t\t\t\tclearTimeout(to);\n\t\t\t\tto = false;\n\t\t\t\tvar ack = acks;\n\t\t\t\tacks = {};\n\t\t\t\tif(data){ disk = data }\n\t\t\t\ttry{store.setItem(opt.prefix, JSON.stringify(disk));\n\t\t\t\t}catch(e){\n\t\t\t\t\tGun.log(err = (e || \"localStorage failure\") + \" Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install\");\n\t\t\t\t\troot.on('localStorage:error', {err: err, file: opt.prefix, flush: disk, retry: flush});\n\t\t\t\t}\n\t\t\t\tif(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers.\n\t\t\t\tGun.obj.map(ack, function(yes, id){\n\t\t\t\t\troot.on('in', {\n\t\t\t\t\t\t'@': id,\n\t\t\t\t\t\terr: err,\n\t\t\t\t\t\tok: 0 // localStorage isn't reliable, so make its `ok` code be a low number.\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t})(USE, './adapters/localStorage');\n\n\t;USE(function(module){\n\t\tvar Type = USE('../type');\n\n\t\tfunction Mesh(root){\n\t\t\tvar mesh = function(){};\n\t\t\tvar opt = root.opt || {};\n\t\t\topt.log = opt.log || console.log;\n\t\t\topt.gap = opt.gap || opt.wait || 1;\n\t\t\topt.pack = opt.pack || (opt.memory? (opt.memory * 1000 * 1000) : 1399000000) * 0.3; // max_old_space_size defaults to 1400 MB.\n\n\t\t\tvar dup = root.dup;\n\n\t\t\tmesh.hear = function(raw, peer){\n\t\t\t\tif(!raw){ return }\n\t\t\t\tvar msg, id, hash, tmp = raw[0];\n\t\t\t\tif(opt.pack <= raw.length){ return mesh.say({dam: '!', err: \"Message too big!\"}, peer) }\n\t\t\t\tif('{' != raw[2]){ mesh.hear.d += raw.length||0; ++mesh.hear.c; } // STATS! // ugh, stupid double JSON encoding\n\t\t\t\tif('[' === tmp){\n\t\t\t\t\ttry{msg = JSON.parse(raw);}catch(e){opt.log('DAM JSON parse error', e)}\n\t\t\t\t\tif(!msg){ return }\n\t\t\t\t\tvar i = 0, m;\n\t\t\t\t\twhile(m = msg[i++]){\n\t\t\t\t\t\tmesh.hear(m, peer);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif('{' === tmp || (Type.obj.is(raw) && (msg = raw))){\n\t\t\t\t\ttry{msg = msg || JSON.parse(raw);\n\t\t\t\t\t}catch(e){return opt.log('DAM JSON parse error', e)}\n\t\t\t\t\tif(!msg){ return }\n\t\t\t\t\tif(!(id = msg['#'])){ id = msg['#'] = Type.text.random(9) }\n\t\t\t\t\tif(dup.check(id)){ return }\n\t\t\t\t\tdup.track(id, true).it = msg; // GUN core also dedups, so `true` is needed. // Does GUN core need to dedup anymore?\n\t\t\t\t\tif(!(hash = msg['##']) && u !== msg.put){ hash = msg['##'] = Type.obj.hash(msg.put) }\n\t\t\t\t\tif(hash && (tmp = msg['@'] || (msg.get && id))){ // Reduces backward daisy in case varying hashes at different daisy depths are the same.\n\t\t\t\t\t\tif(dup.check(tmp+hash)){ return }\n\t\t\t\t\t\tdup.track(tmp+hash, true).it = msg; // GUN core also dedups, so `true` is needed. // Does GUN core need to dedup anymore?\n\t\t\t\t\t}\n\t\t\t\t\t(msg._ = function(){}).via = peer;\n\t\t\t\t\tif(tmp = msg['><']){ (msg._).to = Type.obj.map(tmp.split(','), tomap) }\n\t\t\t\t\tif(msg.dam){\n\t\t\t\t\t\tif(tmp = mesh.hear[msg.dam]){\n\t\t\t\t\t\t\ttmp(msg, peer, root);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\troot.on('in', msg);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar tomap = function(k,i,m){m(k,true)};\n\t\t\tmesh.hear.c = mesh.hear.d = 0;\n\n\t\t\t;(function(){\n\t\t\t\tvar message;\n\t\t\t\tfunction each(peer){ mesh.say(message, peer) }\n\t\t\t\tmesh.say = function(msg, peer){\n\t\t\t\t\tif(this.to){ this.to.next(msg) } // compatible with middleware adapters.\n\t\t\t\t\tif(!msg){ return false }\n\t\t\t\t\tvar id, hash, tmp, raw;\n\t\t\t\t\tvar meta = msg._||(msg._=function(){});\n\t\t\t\t\tif(!(id = msg['#'])){ id = msg['#'] = Type.text.random(9) }\n\t\t\t\t\tif(!(hash = msg['##']) && u !== msg.put){ hash = msg['##'] = Type.obj.hash(msg.put) }\n\t\t\t\t\tif(!(raw = meta.raw)){\n\t\t\t\t\t\traw = meta.raw = mesh.raw(msg);\n\t\t\t\t\t\tif(hash && (tmp = msg['@'])){\n\t\t\t\t\t\t\tdup.track(tmp+hash).it = msg;\n\t\t\t\t\t\t\tif(tmp = (dup.s[tmp]||ok).it){\n\t\t\t\t\t\t\t\tif(hash === tmp['##']){ return false }\n\t\t\t\t\t\t\t\ttmp['##'] = hash;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdup.track(id).it = msg; // track for 9 seconds, default. Earth<->Mars would need more!\n\t\t\t\t\tif(!peer){ peer = (tmp = dup.s[msg['@']]) && (tmp = tmp.it) && (tmp = tmp._) && (tmp = tmp.via) }\n\t\t\t\t\tif(!peer && mesh.way){ return mesh.way(msg) }\n\t\t\t\t\tif(!peer || !peer.id){ message = msg;\n\t\t\t\t\t\tif(!Type.obj.is(peer || opt.peers)){ return false }\n\t\t\t\t\t\tType.obj.map(peer || opt.peers, each); // in case peer is a peer list.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif(!peer.wire && mesh.wire){ mesh.wire(peer) }\n\t\t\t\t\tif(id === peer.last){ return } peer.last = id; // was it just sent?\n\t\t\t\t\tif(peer === meta.via){ return false }\n\t\t\t\t\tif((tmp = meta.to) && (tmp[peer.url] || tmp[peer.pid] || tmp[peer.id]) /*&& !o*/){ return false }\n\t\t\t\t\tif(peer.batch){\n\t\t\t\t\t\tpeer.tail = (tmp = peer.tail || 0) + raw.length;\n\t\t\t\t\t\tif(peer.tail <= opt.pack){\n\t\t\t\t\t\t\tpeer.batch.push(raw); // peer.batch += (tmp?'':',')+raw; // TODO: Prevent double JSON! // FOR v1.0 !?\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tflush(peer);\n\t\t\t\t\t}\n\t\t\t\t\tpeer.batch = []; // peer.batch = '['; // TODO: Prevent double JSON!\n\t\t\t\t\tsetTimeout(function(){flush(peer)}, opt.gap);\n\t\t\t\t\tsend(raw, peer);\n\t\t\t\t}\n\t\t\t\tfunction flush(peer){\n\t\t\t\t\tvar tmp = peer.batch; // var tmp = peer.batch + ']'; // TODO: Prevent double JSON!\n\t\t\t\t\tpeer.batch = peer.tail = null;\n\t\t\t\t\tif(!tmp){ return }\n\t\t\t\t\tif(!tmp.length){ return } // if(3 > tmp.length){ return } // TODO: ^\n\t\t\t\t\ttry{tmp = (1 === tmp.length? tmp[0] : JSON.stringify(tmp));\n\t\t\t\t\t}catch(e){return opt.log('DAM JSON stringify error', e)}\n\t\t\t\t\tif(!tmp){ return }\n\t\t\t\t\tsend(tmp, peer);\n\t\t\t\t}\n\t\t\t\tmesh.say.c = mesh.say.d = 0;\n\t\t\t}());\n\t\t\t\n\t\t\t// for now - find better place later.\n\t\t\tfunction send(raw, peer){ try{\n\t\t\t\tvar wire = peer.wire;\n\t\t\t\tif(peer.say){\n\t\t\t\t\tpeer.say(raw);\n\t\t\t\t} else\n\t\t\t\tif(wire.send){\n\t\t\t\t\twire.send(raw);\n\t\t\t\t}\n\t\t\t\tmesh.say.d += raw.length||0; ++mesh.say.c; // STATS!\n\t\t\t}catch(e){\n\t\t\t\t(peer.queue = peer.queue || []).push(raw);\n\t\t\t}}\n\n\t\t\t;(function(){\n\t\t\t\tmesh.raw = function(msg){ // TODO: Clean this up / delete it / move logic out!\n\t\t\t\t\tif(!msg){ return '' }\n\t\t\t\t\tvar meta = (msg._) || {}, put, hash, tmp;\n\t\t\t\t\tif(tmp = meta.raw){ return tmp }\n\t\t\t\t\tif(typeof msg === 'string'){ return msg }\n\t\t\t\t\tif(!msg.dam){\n\t\t\t\t\t\tvar i = 0, to = []; Type.obj.map(opt.peers, function(p){\n\t\t\t\t\t\t\tto.push(p.url || p.pid || p.id); if(++i > 9){ return true } // limit server, fast fix, improve later! // For \"tower\" peer, MUST include 6 surrounding ids.\n\t\t\t\t\t\t}); if(i > 1){ msg['><'] = to.join() }\n\t\t\t\t\t}\n\t\t\t\t\tvar raw = $(msg); // optimize by reusing put = the JSON.stringify from .hash?\n\t\t\t\t\t/*if(u !== put){\n\t\t\t\t\t\ttmp = raw.indexOf(_, raw.indexOf('put'));\n\t\t\t\t\t\traw = raw.slice(0, tmp-1) + put + raw.slice(tmp + _.length + 1);\n\t\t\t\t\t\t//raw = raw.replace('\"'+ _ +'\"', put); // NEVER USE THIS! ALSO NEVER DELETE IT TO NOT MAKE SAME MISTAKE! https://github.com/amark/gun/wiki/@$$ Heisenbug\n\t\t\t\t\t}*/\n\t\t\t\t\tif(meta){ meta.raw = raw }\n\t\t\t\t\treturn raw;\n\t\t\t\t}\n\t\t\t\tvar $ = JSON.stringify, _ = ':])([:';\n\n\t\t\t}());\n\n\t\t\tmesh.hi = function(peer){\n\t\t\t\tvar tmp = peer.wire || {};\n\t\t\t\tif(peer.id){\n\t\t\t\t\topt.peers[peer.url || peer.id] = peer;\n\t\t\t\t} else {\n\t\t\t\t\ttmp = peer.id = peer.id || Type.text.random(9);\n\t\t\t\t\tmesh.say({dam: '?'}, opt.peers[tmp] = peer);\n\t\t\t\t}\n\t\t\t\tpeer.met = peer.met || +(new Date);\n\t\t\t\tif(!tmp.hied){ root.on(tmp.hied = 'hi', peer) }\n\t\t\t\t// @rogowski I need this here by default for now to fix go1dfish's bug\n\t\t\t\ttmp = peer.queue; peer.queue = [];\n\t\t\t\tType.obj.map(tmp, function(msg){\n\t\t\t\t\tsend(msg, peer);\n\t\t\t\t});\n\t\t\t}\n\t\t\tmesh.bye = function(peer){\n\t\t\t\troot.on('bye', peer);\n\t\t\t\tvar tmp = +(new Date); tmp = (tmp - (peer.met||tmp));\n\t\t\t\tmesh.bye.time = ((mesh.bye.time || tmp) + tmp) / 2;\n\t\t\t}\n\t\t\tmesh.hear['!'] = function(msg, peer){ opt.log('Error:', msg.err) }\n\t\t\tmesh.hear['?'] = function(msg, peer){\n\t\t\t\tif(!msg.pid){\n\t\t\t\t\tmesh.say({dam: '?', pid: opt.pid, '@': msg['#']}, peer);\n\t\t\t\t\t// @rogowski I want to re-enable this AXE logic with some fix/merge later.\n\t\t\t\t\t/* var tmp = peer.queue; peer.queue = [];\n\t\t\t\t\tType.obj.map(tmp, function(msg){\n\t\t\t\t\t\tmesh.say(msg, peer);\n\t\t\t\t\t}); */\n\t\t\t\t\t// @rogowski 2: I think with my PID fix we can delete this and use the original. \n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(peer.pid){ return }\n\t\t\t\tpeer.pid = msg.pid;\n\t\t\t}\n\n\t\t\troot.on('create', function(root){\n\t\t\t\troot.opt.pid = root.opt.pid || Type.text.random(9);\n\t\t\t\tthis.to.next(root);\n\t\t\t\troot.on('out', mesh.say);\n\t\t\t});\n\n\t\t\troot.on('bye', function(peer, tmp){\n\t\t\t\tpeer = opt.peers[peer.id || peer] || peer; \n\t\t\t\tthis.to.next(peer);\n\t\t\t\tpeer.bye? peer.bye() : (tmp = peer.wire) && tmp.close && tmp.close();\n\t\t\t\tType.obj.del(opt.peers, peer.id);\n\t\t\t\tpeer.wire = null;\n\t\t\t});\n\n\t\t\tvar gets = {};\n\t\t\troot.on('bye', function(peer, tmp){ this.to.next(peer);\n\t\t\t\tif(!(tmp = peer.url)){ return } gets[tmp] = true;\n\t\t\t\tsetTimeout(function(){ delete gets[tmp] },opt.lack || 9000);\n\t\t\t});\n\t\t\troot.on('hi', function(peer, tmp){ this.to.next(peer);\n\t\t\t\tif(!(tmp = peer.url) || !gets[tmp]){ return } delete gets[tmp];\n\t\t\t\tType.obj.map(root.next, function(node, soul){\n\t\t\t\t\ttmp = {}; tmp[soul] = root.graph[soul];\n\t\t\t\t\tmesh.say({'##': Type.obj.hash(tmp), get: {'#': soul}}, peer);\n\t\t\t\t})\n\t\t\t});\n\n\t\t\treturn mesh;\n\t\t}\n\n\t\t;(function(){\n\t\t\tType.text.hash = function(s){ // via SO\n\t\t\t\tif(typeof s !== 'string'){ return {err: 1} }\n\t\t var c = 0;\n\t\t if(!s.length){ return c }\n\t\t for(var i=0,l=s.length,n; i<l; ++i){\n\t\t n = s.charCodeAt(i);\n\t\t c = ((c<<5)-c)+n;\n\t\t c |= 0;\n\t\t }\n\t\t return c; // Math.abs(c);\n\t\t }\n\t\t\t\n\t\t\tvar $ = JSON.stringify, u;\n\n\t\t\tType.obj.hash = function(obj, hash){\n\t\t\t\tif(!hash && u === (obj = $(obj, sort))){ return }\n\t\t\t\treturn Type.text.hash(hash || obj || '');\n\t\t\t}\n\n\t\t\tfunction sort(k, v){ var tmp;\n\t\t\t\tif(!(v instanceof Object)){ return v }\n\t\t\t\tType.obj.map(Object.keys(v).sort(), map, {to: tmp = {}, on: v});\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\tType.obj.hash.sort = sort;\n\n\t\t\tfunction map(k){\n\t\t\t\tthis.to[k] = this.on[k];\n\t\t\t}\n\t\t}());\n\n\t var empty = {}, ok = true, u;\n\n\t try{ module.exports = Mesh }catch(e){}\n\n\t})(USE, './adapters/mesh');\n\n\t;USE(function(module){\n\t\tvar Gun = USE('../index');\n\t\tGun.Mesh = USE('./mesh');\n\n\t\tGun.on('opt', function(root){\n\t\t\tthis.to.next(root);\n\t\t\tvar opt = root.opt;\n\t\t\tif(root.once){ return }\n\t\t\tif(false === opt.WebSocket){ return }\n\n\t\t\tvar env;\n\t\t\tif(typeof window !== \"undefined\"){ env = window }\n\t\t\tif(typeof global !== \"undefined\"){ env = global }\n\t\t\tenv = env || {};\n\n\t\t\tvar websocket = opt.WebSocket || env.WebSocket || env.webkitWebSocket || env.mozWebSocket;\n\t\t\tif(!websocket){ return }\n\t\t\topt.WebSocket = websocket;\n\n\t\t\tvar mesh = opt.mesh = opt.mesh || Gun.Mesh(root);\n\n\t\t\tvar wire = mesh.wire || opt.wire;\n\t\t\tmesh.wire = opt.wire = open;\n\t\t\tfunction open(peer){ try{\n\t\t\t\tif(!peer || !peer.url){ return wire && wire(peer) }\n\t\t\t\tvar url = peer.url.replace('http', 'ws');\n\t\t\t\tvar wire = peer.wire = new opt.WebSocket(url);\n\t\t\t\twire.onclose = function(){\n\t\t\t\t\topt.mesh.bye(peer);\n\t\t\t\t\treconnect(peer);\n\t\t\t\t};\n\t\t\t\twire.onerror = function(error){\n\t\t\t\t\treconnect(peer);\n\t\t\t\t};\n\t\t\t\twire.onopen = function(){\n\t\t\t\t\topt.mesh.hi(peer);\n\t\t\t\t}\n\t\t\t\twire.onmessage = function(msg){\n\t\t\t\t\tif(!msg){ return }\n\t\t\t\t\topt.mesh.hear(msg.data || msg, peer);\n\t\t\t\t};\n\t\t\t\treturn wire;\n\t\t\t}catch(e){}}\n\n\t\t\tvar wait = 2 * 1000;\n\t\t\tfunction reconnect(peer){\n\t\t\t\tclearTimeout(peer.defer);\n\t\t\t\tif(doc && peer.retry <= 0){ return } peer.retry = (peer.retry || opt.retry || 60) - 1;\n\t\t\t\tpeer.defer = setTimeout(function to(){\n\t\t\t\t\tif(doc && doc.hidden){ return setTimeout(to,wait) }\n\t\t\t\t\topen(peer);\n\t\t\t\t}, wait);\n\t\t\t}\n\t\t\tvar doc = 'undefined' !== typeof document && document;\n\t\t});\n\t\tvar noop = function(){};\n\t})(USE, './adapters/websocket');\n\n}());\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/gun/gun.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/lib/path.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/gun/lib/path.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Gun = (typeof window !== \"undefined\")? window.Gun : __webpack_require__(/*! ../gun */ \"./node_modules/gun/gun.js\");\n\nGun.chain.path = function(field, opt){\n\tvar back = this, gun = back, tmp;\n\tif(typeof field === 'string'){\n\t\ttmp = field.split(opt || '.');\n\t\tif(1 === tmp.length){\n\t\t\tgun = back.get(field);\n\t\t\treturn gun;\n\t\t}\n\t\tfield = tmp;\n\t}\n\tif(field instanceof Array){\n\t\tif(field.length > 1){\n\t\t\tgun = back;\n\t\t\tvar i = 0, l = field.length;\n\t\t\tfor(i; i < l; i++){\n\t\t\t\t//gun = gun.get(field[i], (i+1 === l)? cb : null, opt);\n\t\t\t\tgun = gun.get(field[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tgun = back.get(field[0]);\n\t\t}\n\t\treturn gun;\n\t}\n\tif(!field && 0 != field){\n\t\treturn back;\n\t}\n\tgun = back.get(''+field);\n\treturn gun;\n}\n\n//# sourceURL=webpack:///./node_modules/gun/lib/path.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/lib/radisk.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/gun/lib/radisk.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval(";(function(){\n\n\tfunction Radisk(opt){\n\n\t\topt = opt || {};\n\t\topt.log = opt.log || console.log;\n\t\topt.file = String(opt.file || 'radata');\n\t\tvar has = (Radisk.has || (Radisk.has = {}))[opt.file];\n\t\tif(has){ return has }\n\n\t\topt.pack = opt.pack || (opt.memory? (opt.memory * 1000 * 1000) : 1399000000) * 0.3; // max_old_space_size defaults to 1400 MB.\n\t\topt.until = opt.until || opt.wait || 250;\n\t\topt.batch = opt.batch || (10 * 1000);\n\t\topt.chunk = opt.chunk || (1024 * 1024 * 10); // 10MB\n\t\topt.code = opt.code || {};\n\t\topt.code.from = opt.code.from || '!';\n\t\t//opt.jsonify = true; // TODO: REMOVE!!!!\n\n\t\tfunction ename(t){ return encodeURIComponent(t).replace(/\\*/g, '%2A') }\n\t\tfunction atomic(v){ return u !== v && (!v || 'object' != typeof v) }\n\t\tvar map = Gun.obj.map;\n\t\tvar LOG = false;\n\n\t\tif(!opt.store){\n\t\t\treturn opt.log(\"ERROR: Radisk needs `opt.store` interface with `{get: fn, put: fn (, list: fn)}`!\");\n\t\t}\n\t\tif(!opt.store.put){\n\t\t\treturn opt.log(\"ERROR: Radisk needs `store.put` interface with `(file, data, cb)`!\");\n\t\t}\n\t\tif(!opt.store.get){\n\t\t\treturn opt.log(\"ERROR: Radisk needs `store.get` interface with `(file, cb)`!\");\n\t\t}\n\t\tif(!opt.store.list){\n\t\t\t//opt.log(\"WARNING: `store.list` interface might be needed!\");\n\t\t}\n\n\t\t/*\n\t\t\tAny and all storage adapters should...\n\t\t\t1. Because writing to disk takes time, we should batch data to disk. This improves performance, and reduces potential disk corruption.\n\t\t\t2. If a batch exceeds a certain number of writes, we should immediately write to disk when physically possible. This caps total performance, but reduces potential loss.\n\t\t*/\n\t\tvar r = function(key, val, cb){\n\t\t\tkey = ''+key;\n\t\t\tif(val instanceof Function){\n\t\t\t\tvar o = cb || {};\n\t\t\t\tcb = val;\n\t\t\t\tval = r.batch(key);\n\t\t\t\tif(u !== val){\n\t\t\t\t\tcb(u, r.range(val, o), o);\n\t\t\t\t\tif(atomic(val)){ return }\n\t\t\t\t\t// if a node is requested and some of it is cached... the other parts might not be.\n\t\t\t\t}\n\t\t\t\tif(r.thrash.at){\n\t\t\t\t\tval = r.thrash.at(key);\n\t\t\t\t\tif(u !== val){\n\t\t\t\t\t\tcb(u, r.range(val, o), o);\n\t\t\t\t\t\tif(atomic(val)){ cb(u, val, o); return }\n\t\t\t\t\t\t// if a node is requested and some of it is cached... the other parts might not be.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn r.read(key, cb, o);\n\t\t\t}\n\t\t\tr.batch(key, val);\n\t\t\tif(cb){ r.batch.acks.push(cb) }\n\t\t\tif(++r.batch.ed >= opt.batch){ return r.thrash() } // (2)\n\t\t\tif(r.batch.to){ return }\n\t\t\t//clearTimeout(r.batch.to); // (1) // THIS LINE IS EVIL! NEVER USE IT! ALSO NEVER DELETE THIS SO WE NEVER MAKE THE SAME MISTAKE AGAIN!\n\t\t\tr.batch.to = setTimeout(r.thrash, opt.until || 1);\n\t\t}\n\n\t\tr.batch = Radix();\n\t\tr.batch.acks = [];\n\t\tr.batch.ed = 0;\n\n\t\tr.thrash = function(){\n\t\t\tvar thrash = r.thrash;\n\t\t\tif(thrash.ing){ return thrash.more = true }\n\t\t\tthrash.more = false;\n\t\t\tthrash.ing = true;\n\t\t\tvar batch = thrash.at = r.batch, i = 0;\n\t\t\tclearTimeout(r.batch.to);\n\t\t\tr.batch = null;\n\t\t\tr.batch = Radix();\n\t\t\tr.batch.acks = [];\n\t\t\tr.batch.ed = 0;\n\t\t\t//var id = Gun.text.random(2), S = (+new Date); console.log(\"<<<<<<<<<<<<\", id);\n\t\t\tr.save(batch, function(err, ok){\n\t\t\t\tif(++i > 1){ opt.log('RAD ERR: Radisk has callbacked multiple times, please report this as a BUG at github.com/amark/gun/issues ! ' + i); return }\n\t\t\t\tif(err){ opt.log('err', err) }\n\t\t\t\t//console.log(\">>>>>>>>>>>>\", id, ((+new Date) - S), batch.acks.length);\n\t\t\t\tmap(batch.acks, function(cb){ cb(err, ok) });\n\t\t\t\tthrash.at = null;\n\t\t\t\tthrash.ing = false;\n\t\t\t\tif(thrash.more){ thrash() }\n\t\t\t});\n\t\t}\n\n\t\t/*\n\t\t\t1. Find the first radix item in memory.\n\t\t\t2. Use that as the starting index in the directory of files.\n\t\t\t3. Find the first file that is lexically larger than it,\n\t\t\t4. Read the previous file to that into memory\n\t\t\t5. Scan through the in memory radix for all values lexically less than the limit.\n\t\t\t6. Merge and write all of those to the in-memory file and back to disk.\n\t\t\t7. If file too large, split. More details needed here.\n\t\t*/\n\t\tr.save = function(rad, cb){\n\t\t\tvar s = function Span(){};\n\t\t\ts.find = function(tree, key){\n\t\t\t\tif(key < s.start){ return }\n\t\t\t\ts.start = key;\n\t\t\t\tr.list(s.lex);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\ts.lex = function(file){\n\t\t\t\tfile = (u === file)? u : decodeURIComponent(file);\n\t\t\t\tif(!file || file > s.start){\n\t\t\t\t\ts.mix(s.file || opt.code.from, s.start, s.end = file);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\ts.file = file;\n\t\t\t}\n\t\t\ts.mix = function(file, start, end){\n\t\t\t\ts.start = s.end = s.file = u;\n\t\t\t\tr.parse(file, function(err, disk){\n\t\t\t\t\tif(err){ return cb(err) }\n\t\t\t\t\tdisk = disk || Radix();\n\t\t\t\t\tRadix.map(rad, function(val, key){\n\t\t\t\t\t\tif(key < start){ return }\n\t\t\t\t\t\tif(end && end < key){ return s.start = key }\n\t\t\t\t\t\t// PLUGIN: consider adding HAM as an extra layer of protection\n\t\t\t\t\t\tdisk(key, val); // merge batch[key] -> disk[key]\n\t\t\t\t\t});\n\t\t\t\t\tr.write(file, disk, s.next);\n\t\t\t\t});\n\t\t\t}\n\t\t\ts.next = function(err, ok){\n\t\t\t\tif(s.err = err){ return cb(err) }\n\t\t\t\tif(s.start){ return Radix.map(rad, s.find) }\n\t\t\t\tcb(err, ok);\n\t\t\t}\n\t\t\tRadix.map(rad, s.find);\n\t\t}\n\n\t\t/*\n\t\t\tAny storage engine at some point will have to do a read in order to write.\n\t\t\tThis is true of even systems that use an append only log, if they support updates.\n\t\t\tTherefore it is unavoidable that a read will have to happen,\n\t\t\tthe question is just how long you delay it.\n\t\t*/\n\t\tr.write = function(file, rad, cb, o){\n\t\t\to = ('object' == typeof o)? o : {force: o};\n\t\t\tvar f = function Fractal(){};\n\t\t\tf.text = '';\n\t\t\tf.count = 0;\n\t\t\tf.file = file;\n\t\t\tf.each = function(val, key, k, pre){\n\t\t\t\t//console.log(\"RAD:::\", JSON.stringify([val, key, k, pre]));\n\t\t\t\tif(u !== val){ f.count++ }\n\t\t\t\tif(opt.pack <= (val||'').length){ return cb(\"Record too big!\"), true }\n\t\t\t\tvar enc = Radisk.encode(pre.length) +'#'+ Radisk.encode(k) + (u === val? '' : ':'+ Radisk.encode(val)) +'\\n';\n\t\t\t\tif((opt.chunk < f.text.length + enc.length) && (1 < f.count) && !o.force){\n\t\t\t\t\tf.text = '';\n\t\t\t\t\tf.limit = Math.ceil(f.count/2);\n\t\t\t\t\tf.count = 0;\n\t\t\t\t\tf.sub = Radix();\n\t\t\t\t\tRadix.map(rad, f.slice);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tf.text += enc;\n\t\t\t}\n\t\t\tf.write = function(){\n\t\t\t\tvar tmp = ename(file);\n\t\t\t\tvar start; LOG && (start = (+new Date)); // comment this out!\n\t\t\t\topt.store.put(tmp, f.text, function(err){\n\t\t\t\t\tLOG && console.log(\"wrote JSON in\", (+new Date) - start); // comment this out!\n\t\t\t\t\tif(err){ return cb(err) }\n\t\t\t\t\tr.list.add(tmp, cb);\n\t\t\t\t});\n\t\t\t}\n\t\t\tf.slice = function(val, key){\n\t\t\t\tif(key < f.file){ return }\n\t\t\t\tif(f.limit < (++f.count)){\n\t\t\t\t\tvar name = f.file;\n\t\t\t\t\tf.file = key;\n\t\t\t\t\tf.count = 0;\n\t\t\t\t\tr.write(name, f.sub, f.next, o);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tf.sub(key, val);\n\t\t\t}\n\t\t\tf.next = function(err){\n\t\t\t\tif(err){ return cb(err) }\n\t\t\t\tf.sub = Radix();\n\t\t\t\tif(!Radix.map(rad, f.slice)){\n\t\t\t\t\tr.write(f.file, f.sub, cb, o);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(opt.jsonify){ return r.write.jsonify(f, file, rad, cb, o) } // temporary testing idea\n\t\t\tif(!Radix.map(rad, f.each, true)){ f.write() }\n\t\t}\n\n\t\tr.write.jsonify = function(f, file, rad, cb, o){\n\t\t\tvar raw;\n\t\t\tvar start; LOG && (start = (+new Date)); // comment this out!\n\t\t\ttry{raw = JSON.stringify(rad.$);\n\t\t\t}catch(e){ return cb(\"Record too big!\") }\n\t\t\tLOG && console.log(\"stringified JSON in\", (+new Date) - start); // comment this out!\n\t\t\tif(opt.chunk < raw.length && !o.force){\n\t\t\t\tif(Radix.map(rad, f.each, true)){ return }\n\t\t\t}\n\t\t\tf.text = raw;\n\t\t\tf.write();\n\t\t}\n\n\t\tr.range = function(tree, o){\n\t\t\tif(!tree || !o){ return }\n\t\t\tif(u === o.start && u === o.end){ return tree }\n\t\t\tif(atomic(tree)){ return tree }\n\t\t\tvar sub = Radix();\n\t\t\tRadix.map(tree, function(v,k){\n\t\t\t\tsub(k,v);\n\t\t\t}, o)\n\t\t\treturn sub('');\n\t\t}\n\n\t\t;(function(){\n\t\t\tvar Q = {};\n\t\t\tr.read = function(key, cb, o){\n\t\t\t\to = o || {};\n\t\t\t\tif(RAD && !o.next){ // cache\n\t\t\t\t\tvar val = RAD(key);\n\t\t\t\t\t//if(u !== val){\n\t\t\t\t\t\t//cb(u, val, o);\n\t\t\t\t\t\tif(atomic(val)){ cb(u, val, o); return }\n\t\t\t\t\t\t// if a node is requested and some of it is cached... the other parts might not be.\n\t\t\t\t\t//}\n\t\t\t\t}\n\t\t\t\to.span = (u !== o.start) || (u !== o.end);\n\t\t\t\tvar g = function Get(){};\n\t\t\t\tg.lex = function(file){ var tmp;\n\t\t\t\t\tfile = (u === file)? u : decodeURIComponent(file);\n\t\t\t\t\ttmp = o.next || key || (o.reverse? o.end || '\\uffff' : o.start || '');\n\t\t\t\t\tif(!file || (o.reverse? file < tmp : file > tmp)){\n\t\t\t\t\t\tif(o.next || o.reverse){ g.file = file }\n\t\t\t\t\t\tif(tmp = Q[g.file]){\n\t\t\t\t\t\t\ttmp.push({key: key, ack: cb, file: g.file, opt: o});\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tQ[g.file] = [{key: key, ack: cb, file: g.file, opt: o}];\n\t\t\t\t\t\tif(!g.file){\n\t\t\t\t\t\t\tg.it(null, u, {});\n\t\t\t\t\t\t\treturn true; \n\t\t\t\t\t\t}\n\t\t\t\t\t\tr.parse(g.file, g.it);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tg.file = file;\n\t\t\t\t}\n\t\t\t\tg.it = function(err, disk, info){\n\t\t\t\t\tif(g.err = err){ opt.log('err', err) }\n\t\t\t\t\tg.info = info;\n\t\t\t\t\tif(disk){ RAD = g.disk = disk }\n\t\t\t\t\tdisk = Q[g.file]; delete Q[g.file];\n\t\t\t\t\tmap(disk, g.ack);\n\t\t\t\t}\n\t\t\t\tg.ack = function(as){\n\t\t\t\t\tif(!as.ack){ return }\n\t\t\t\t\tvar tmp = as.key, o = as.opt, info = g.info, rad = g.disk || noop, data = r.range(rad(tmp), o), last = rad.last;\n\t\t\t\t\to.parsed = (o.parsed || 0) + (info.parsed||0);\n\t\t\t\t\to.chunks = (o.chunks || 0) + 1;\n\t\t\t\t\tif(!o.some){ o.some = (u !== data) }\n\t\t\t\t\tif(u !== data){ as.ack(g.err, data, o) }\n\t\t\t\t\telse if(!as.file){ !o.some && as.ack(g.err, u, o); return }\n\t\t\t\t\tif(!o.span){\n\t\t\t\t\t\tif(/*!last || */last === tmp){ !o.some && as.ack(g.err, u, o); return }\n\t\t\t\t\t\tif(last && last > tmp && 0 != last.indexOf(tmp)){ !o.some && as.ack(g.err, u, o); return }\n\t\t\t\t\t}\n\t\t\t\t\tif(o.some && o.parsed >= o.limit){ return }\n\t\t\t\t\to.next = as.file;\n\t\t\t\t\tr.read(tmp, as.ack, o);\n\t\t\t\t}\n\t\t\t\tif(o.reverse){ g.lex.reverse = true }\n\t\t\t\tr.list(g.lex);\n\t\t\t}\n\t\t}());\n\n\t\t;(function(){\n\t\t\t/*\n\t\t\t\tLet us start by assuming we are the only process that is\n\t\t\t\tchanging the directory or bucket. Not because we do not want\n\t\t\t\tto be multi-process/machine, but because we want to experiment\n\t\t\t\twith how much performance and scale we can get out of only one.\n\t\t\t\tThen we can work on the harder problem of being multi-process.\n\t\t\t*/\n\t\t\tvar Q = {}, s = String.fromCharCode(31);\n\t\t\tr.parse = function(file, cb, raw){ var q;\n\t\t\t\tif(q = Q[file]){ return q.push(cb) } q = Q[file] = [cb];\n\t\t\t\tvar p = function Parse(){}, info = {};\n\t\t\t\tp.disk = Radix();\n\t\t\t\tp.read = function(err, data){ var tmp;\n\t\t\t\t\tdelete Q[file];\n\t\t\t\t\tif((p.err = err) || (p.not = !data)){\n\t\t\t\t\t\treturn map(q, p.ack);\n\t\t\t\t\t}\n\t\t\t\t\tif(typeof data !== 'string'){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tif(opt.pack <= data.length){\n\t\t\t\t\t\t\t\tp.err = \"Chunk too big!\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdata = data.toString(); // If it crashes, it crashes here. How!?? We check size first!\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}catch(e){ p.err = e }\n\t\t\t\t\t\tif(p.err){ return map(q, p.ack) }\n\t\t\t\t\t}\n\t\t\t\t\tinfo.parsed = data.length;\n\n\t\t\t\t\tvar start; LOG && (start = (+new Date)); // keep this commented out in production!\n\t\t\t\t\tif(opt.jsonify){ // temporary testing idea\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tvar json = JSON.parse(data);\n\t\t\t\t\t\t\tp.disk.$ = json;\n\t\t\t\t\t\t\tLOG && console.log('parsed JSON in', (+new Date) - start); // keep this commented out in production!\n\t\t\t\t\t\t\tmap(q, p.ack);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}catch(e){ tmp = e }\n\t\t\t\t\t\tif('{' === data[0]){\n\t\t\t\t\t\t\tp.err = tmp || \"JSON error!\";\n\t\t\t\t\t\t\treturn map(q, p.ack);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar start; LOG && (start = (+new Date)); // keep this commented out in production!\n\t\t\t\t\tvar tmp = p.split(data), pre = [], i, k, v;\n\t\t\t\t\tif(!tmp || 0 !== tmp[1]){\n\t\t\t\t\t\tp.err = \"File '\"+file+\"' does not have root radix! \";\n\t\t\t\t\t\treturn map(q, p.ack);\n\t\t\t\t\t}\n\t\t\t\t\twhile(tmp){\n\t\t\t\t\t\tk = v = u;\n\t\t\t\t\t\ti = tmp[1];\n\t\t\t\t\t\ttmp = p.split(tmp[2])||'';\n\t\t\t\t\t\tif('#' == tmp[0]){\n\t\t\t\t\t\t\tk = tmp[1];\n\t\t\t\t\t\t\tpre = pre.slice(0,i);\n\t\t\t\t\t\t\tif(i <= pre.length){\n\t\t\t\t\t\t\t\tpre.push(k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttmp = p.split(tmp[2])||'';\n\t\t\t\t\t\tif('\\n' == tmp[0]){ continue }\n\t\t\t\t\t\tif('=' == tmp[0] || ':' == tmp[0]){ v = tmp[1] }\n\t\t\t\t\t\tif(u !== k && u !== v){ p.disk(pre.join(''), v) }\n\t\t\t\t\t\ttmp = p.split(tmp[2]);\n\t\t\t\t\t}\n\t\t\t\t\tLOG && console.log('parsed JSON in', (+new Date) - start); // keep this commented out in production!\n\t\t\t\t\t//cb(err, p.disk);\n\t\t\t\t\tmap(q, p.ack);\n\t\t\t\t};\n\t\t\t\tp.split = function(t){\n\t\t\t\t\tif(!t){ return }\n\t\t\t\t\tvar l = [], o = {}, i = -1, a = '', b, c;\n\t\t\t\t\ti = t.indexOf(s);\n\t\t\t\t\tif(!t[i]){ return }\n\t\t\t\t\ta = t.slice(0, i);\n\t\t\t\t\tl[0] = a;\n\t\t\t\t\tl[1] = b = Radisk.decode(t.slice(i), o);\n\t\t\t\t\tl[2] = t.slice(i + o.i);\n\t\t\t\t\treturn l;\n\t\t\t\t}\n\t\t\t\tp.ack = function(cb){ \n\t\t\t\t\tif(!cb){ return }\n\t\t\t\t\tif(p.err || p.not){ return cb(p.err, u, info) }\n\t\t\t\t\tcb(u, p.disk, info);\n\t\t\t\t}\n\t\t\t\tif(raw){ return p.read(null, raw) }\n\t\t\t\topt.store.get(ename(file), p.read);\n\t\t\t}\n\t\t}());\n\n\t\t;(function(){\n\t\t\tvar dir, q, f = String.fromCharCode(28), ef = ename(f);\n\t\t\tr.list = function(cb){\n\t\t\t\tif(dir){\n\t\t\t\t\tvar tmp = {reverse: (cb.reverse)? 1 : 0};\n\t\t\t\t\tRadix.map(dir, function(val, key){\n\t\t\t\t\t\treturn cb(key);\n\t\t\t\t\t}, tmp) || cb();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(q){ return q.push(cb) } q = [cb];\n\t\t\t\tr.parse(f, r.list.init);\n\t\t\t}\n\t\t\tr.list.add = function(file, cb){\n\t\t\t\tvar has = dir(file);\n\t\t\t\tif(has || file === ef){\n\t\t\t\t\treturn cb(u, 1);\n\t\t\t\t}\n\t\t\t\tdir(file, true);\n\t\t\t\tcb.listed = (cb.listed || 0) + 1;\n\t\t\t\tr.write(f, dir, function(err, ok){\n\t\t\t\t\tif(err){ return cb(err) }\n\t\t\t\t\tcb.listed = (cb.listed || 0) - 1;\n\t\t\t\t\tif(cb.listed !== 0){ return }\n\t\t\t\t\tcb(u, 1);\n\t\t\t\t}, true);\n\t\t\t}\n\t\t\tr.list.init = function(err, disk){\n\t\t\t\tif(err){\n\t\t\t\t\topt.log('list', err);\n\t\t\t\t\tsetTimeout(function(){ r.parse(f, r.list.init) }, 1000);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(disk){\n\t\t\t\t\tr.list.drain(disk);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(!opt.store.list){\n\t\t\t\t\tr.list.drain(Radix());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// import directory.\n\t\t\t\topt.store.list(function(file){\n\t\t\t\t\tdir = dir || Radix();\n\t\t\t\t\tif(!file){ return r.list.drain(dir) }\n\t\t\t\t\tr.list.add(file, noop);\n\t\t\t\t});\n\t\t\t}\n\t\t\tr.list.drain = function(rad, tmp){\n\t\t\t\tr.list.dir = dir = rad;\n\t\t\t\ttmp = q; q = null;\n\t\t\t\tGun.list.map(tmp, function(cb){\n\t\t\t\t\tr.list(cb);\n\t\t\t\t});\n\t\t\t}\n\t\t}());\n\n\t\tvar noop = function(){}, RAD, u;\n\t\tRadisk.has[opt.file] = r;\n\t\treturn r;\n\t}\n\n\n\n\t;(function(){\n\t\tvar _ = String.fromCharCode(31), u;\n\t\tRadisk.encode = function(d, o, s){ s = s || _;\n\t\t\tvar t = s, tmp;\n\t\t\tif(typeof d == 'string'){\n\t\t\t\tvar i = d.indexOf(s);\n\t\t\t\twhile(i != -1){ t += s; i = d.indexOf(s, i+1) }\n\t\t\t\treturn t + '\"' + d + s;\n\t\t\t} else\n\t\t\tif(d && d['#'] && (tmp = Gun.val.link.is(d))){\n\t\t\t\treturn t + '#' + tmp + t;\n\t\t\t} else\n\t\t\tif(Gun.num.is(d)){\n\t\t\t\treturn t + '+' + (d||0) + t;\n\t\t\t} else\n\t\t\tif(null === d){\n\t\t\t\treturn t + ' ' + t;\n\t\t\t} else\n\t\t\tif(true === d){\n\t\t\t\treturn t + '+' + t;\n\t\t\t} else\n\t\t\tif(false === d){\n\t\t\t\treturn t + '-' + t;\n\t\t\t}// else\n\t\t\t//if(binary){}\n\t\t}\n\t\tRadisk.decode = function(t, o, s){ s = s || _;\n\t\t\tvar d = '', i = -1, n = 0, c, p;\n\t\t\tif(s !== t[0]){ return }\n\t\t\twhile(s === t[++i]){ ++n }\n\t\t\tp = t[c = n] || true;\n\t\t\twhile(--n >= 0){ i = t.indexOf(s, i+1) }\n\t\t\tif(i == -1){ i = t.length }\n\t\t\td = t.slice(c+1, i);\n\t\t\tif(o){ o.i = i+1 }\n\t\t\tif('\"' === p){\n\t\t\t\treturn d;\n\t\t\t} else\n\t\t\tif('#' === p){\n\t\t\t\treturn Gun.val.link.ify(d);\n\t\t\t} else\n\t\t\tif('+' === p){\n\t\t\t\tif(0 === d.length){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn parseFloat(d);\n\t\t\t} else\n\t\t\tif(' ' === p){\n\t\t\t\treturn null;\n\t\t\t} else\n\t\t\tif('-' === p){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}());\n\n\tif(typeof window !== \"undefined\"){\n\t var Gun = window.Gun;\n\t var Radix = window.Radix;\n\t window.Radisk = Radisk;\n\t} else { \n\t var Gun = __webpack_require__(/*! ../gun */ \"./node_modules/gun/gun.js\");\n\t\tvar Radix = __webpack_require__(/*! ./radix */ \"./node_modules/gun/lib/radix.js\");\n\t\ttry{ module.exports = Radisk }catch(e){}\n\t}\n\n\tRadisk.Radix = Radix;\n\n}());\n\n//# sourceURL=webpack:///./node_modules/gun/lib/radisk.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/lib/radix.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/gun/lib/radix.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval(";(function(){\n\n\tfunction Radix(){\n\t\tvar radix = function(key, val, t){\n\t\t\tkey = ''+key;\n\t\t\tif(!t && u !== val){ \n\t\t\t\tradix.last = (key < radix.last)? radix.last : key;\n\t\t\t\tdelete (radix.$||{})[_];\n\t\t\t}\n\t\t\tt = t || radix.$ || (radix.$ = {});\n\t\t\tif(!key && Object.keys(t).length){ return t }\n\t\t\tvar i = 0, l = key.length-1, k = key[i], at, tmp;\n\t\t\twhile(!(at = t[k]) && i < l){\n\t\t\t\tk += key[++i];\n\t\t\t}\n\t\t\tif(!at){\n\t\t\t\tif(!map(t, function(r, s){\n\t\t\t\t\tvar ii = 0, kk = '';\n\t\t\t\t\tif((s||'').length){ while(s[ii] == key[ii]){\n\t\t\t\t\t\tkk += s[ii++];\n\t\t\t\t\t} }\n\t\t\t\t\tif(kk){\n\t\t\t\t\t\tif(u === val){\n\t\t\t\t\t\t\tif(ii <= l){ return }\n\t\t\t\t\t\t\treturn (tmp || (tmp = {}))[s.slice(ii)] = r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar __ = {};\n\t\t\t\t\t\t__[s.slice(ii)] = r;\n\t\t\t\t\t\tii = key.slice(ii);\n\t\t\t\t\t\t('' === ii)? (__[''] = val) : ((__[ii] = {})[''] = val);\n\t\t\t\t\t\tt[kk] = __;\n\t\t\t\t\t\tdelete t[s];\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t})){\n\t\t\t\t\tif(u === val){ return; }\n\t\t\t\t\t(t[k] || (t[k] = {}))[''] = val;\n\t\t\t\t}\n\t\t\t\tif(u === val){\n\t\t\t\t\treturn tmp;\n\t\t\t\t}\n\t\t\t} else \n\t\t\tif(i == l){\n\t\t\t\tif(u === val){ return (u === (tmp = at['']))? at : tmp }\n\t\t\t\tat[''] = val;\n\t\t\t} else {\n\t\t\t\tif(u !== val){ delete at[_] }\n\t\t\t\treturn radix(key.slice(++i), val, at || (at = {}));\n\t\t\t}\n\t\t}\n\t\treturn radix;\n\t};\n\n\tRadix.map = function map(radix, cb, opt, pre){ pre = pre || [];\n\t\tvar t = ('function' == typeof radix)? radix.$ || {} : radix;\n\t\tif(!t){ return }\n\t\tvar keys = (t[_]||no).sort || (t[_] = function $(){ $.sort = Object.keys(t).sort(); return $ }()).sort;\n\t\t//var keys = Object.keys(t).sort();\n\t\topt = (true === opt)? {branch: true} : (opt || {});\n\t\tif(opt.reverse){ keys = keys.slice().reverse() }\n\t\tvar start = opt.start, end = opt.end;\n\t\tvar i = 0, l = keys.length;\n\t\tfor(;i < l; i++){ var key = keys[i], tree = t[key], tmp, p, pt;\n\t\t\tif(!tree || '' === key || _ === key){ continue }\n\t\t\tp = pre.slice(); p.push(key);\n\t\t\tpt = p.join('');\n\t\t\tif(u !== start && pt < (start||'').slice(0,pt.length)){ continue }\n\t\t\tif(u !== end && (end || '\\uffff') < pt){ continue }\n\t\t\tif(u !== (tmp = tree[''])){\n\t\t\t\ttmp = cb(tmp, pt, key, pre);\n\t\t\t\tif(u !== tmp){ return tmp }\n\t\t\t} else\n\t\t\tif(opt.branch){\n\t\t\t\ttmp = cb(u, pt, key, pre);\n\t\t\t\tif(u !== tmp){ return tmp }\n\t\t\t}\n\t\t\tpre = p;\n\t\t\ttmp = map(tree, cb, opt, pre);\n\t\t\tif(u !== tmp){ return tmp }\n\t\t\tpre.pop();\n\t\t}\n\t};\n\n\tObject.keys = Object.keys || function(o){ return map(o, function(v,k,t){t(k)}) }\n\n\tif(typeof window !== \"undefined\"){\n\t var Gun = window.Gun;\n\t window.Radix = Radix;\n\t} else { \n\t var Gun = __webpack_require__(/*! ../gun */ \"./node_modules/gun/gun.js\");\n\t\ttry{ module.exports = Radix }catch(e){}\n\t}\n\t\n\tvar map = Gun.obj.map, no = {}, u;\n\tvar _ = String.fromCharCode(24);\n\t\n}());\n\n//# sourceURL=webpack:///./node_modules/gun/lib/radix.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/lib/rfs.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/gun/lib/rfs.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("function Store(opt){\n\topt = opt || {};\n\topt.log = opt.log || console.log;\n\topt.file = String(opt.file || 'radata');\n\tvar fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\"), u;\n\n\tvar store = function Store(){};\n\tif(Store[opt.file]){\n\t\tconsole.log(\"Warning: reusing same fs store and options as 1st.\");\n\t\treturn Store[opt.file];\n\t}\n\tStore[opt.file] = store;\n\n\tstore.put = function(file, data, cb){\n\t\tvar random = Math.random().toString(36).slice(-3);\n\t\tvar tmp = opt.file+'-'+file+'-'+random+'.tmp';\n\t\tfs.writeFile(tmp, data, function(err, ok){\n\t\t\tif(err){ return cb(err) }\n\t\t\tmove(tmp, opt.file+'/'+file, cb);\n\t\t});\n\t};\n\tstore.get = function(file, cb){\n\t\tfs.readFile(opt.file+'/'+file, function(err, data){\n\t\t\tif(err){\n\t\t\t\tif('ENOENT' === (err.code||'').toUpperCase()){\n\t\t\t\t\treturn cb(null);\n\t\t\t\t}\n\t\t\t\topt.log(\"ERROR:\", err)\n\t\t\t}\n\t\t\tcb(err, data);\n\t\t});\n\t};\n\n\tif(!fs.existsSync(opt.file)){ fs.mkdirSync(opt.file) }\n\n\tfunction move(oldPath, newPath, cb) {\n\t\tfs.rename(oldPath, newPath, function (err) {\n\t\t\tif (err) {\n\t\t\t\tif (err.code === 'EXDEV') {\n\t\t\t\t\tvar readStream = fs.createReadStream(oldPath);\n\t\t\t\t\tvar writeStream = fs.createWriteStream(newPath);\n\n\t\t\t\t\treadStream.on('error', cb);\n\t\t\t\t\twriteStream.on('error', cb);\n\n\t\t\t\t\treadStream.on('close', function () {\n\t\t\t\t\t\tfs.unlink(oldPath, cb);\n\t\t\t\t\t});\n\n\t\t\t\t\treadStream.pipe(writeStream);\n\t\t\t\t} else {\n\t\t\t\t\tcb(err);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcb();\n\t\t\t}\n\t\t});\n\t};\n\t\n\treturn store;\n}\n\nmodule.exports = Store;\n\n//# sourceURL=webpack:///./node_modules/gun/lib/rfs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/lib/rindexed.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/gun/lib/rindexed.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval(";(function(){\n\n function Store(opt){\n opt = opt || {};\n opt.file = String(opt.file || 'radata');\n opt.chunk = opt.chunk || (1024 * 1024); // 1MB\n var db = null, u;\n\n try{opt.indexedDB = opt.indexedDB || indexedDB}catch(e){}\n try{if(!opt.indexedDB || 'file:' == location.protocol){\n var store = {}, s = {};\n store.put = function(f, d, cb){ s[f] = d; cb(null, 1) };\n store.get = function(f, cb){ cb(null, s[f] || u) };\n console.log('Warning: No indexedDB exists to persist data to!');\n return store;\n }}catch(e){}\n \n var store = function Store(){};\n if(Store[opt.file]){\n console.log(\"Warning: reusing same IndexedDB store and options as 1st.\");\n return Store[opt.file];\n }\n Store[opt.file] = store;\n\n store.start = function(){\n var o = indexedDB.open(opt.file, 1);\n o.onupgradeneeded = function(eve){ (eve.target.result).createObjectStore(opt.file) }\n o.onsuccess = function(){ db = o.result }\n o.onerror = function(eve){ console.log(eve||1); }\n }; store.start();\n\n store.put = function(key, data, cb){\n if(!db){ setTimeout(function(){ store.put(key, data, cb) },1); return }\n var tx = db.transaction([opt.file], 'readwrite');\n var obj = tx.objectStore(opt.file);\n var req = obj.put(data, ''+key);\n req.onsuccess = obj.onsuccess = tx.onsuccess = function(){ cb(null, 1) }\n req.onabort = obj.onabort = tx.onabort = function(eve){ cb(eve||'put.tx.abort') }\n req.onerror = obj.onerror = tx.onerror = function(eve){ cb(eve||'put.tx.error') }\n }\n\n store.get = function(key, cb){\n if(!db){ setTimeout(function(){ store.get(key, cb) },9); return }\n var tx = db.transaction([opt.file], 'readonly');\n var obj = tx.objectStore(opt.file);\n var req = obj.get(''+key);\n req.onsuccess = function(){ cb(null, req.result) }\n req.onabort = function(eve){ cb(eve||4) }\n req.onerror = function(eve){ cb(eve||5) }\n }\n setInterval(function(){ db && db.close(); db = null; store.start() }, 1000 * 15); // reset webkit bug?\n return store;\n }\n\n if(typeof window !== \"undefined\"){\n (Store.window = window).RindexedDB = Store;\n } else {\n try{ module.exports = Store }catch(e){}\n }\n\n try{\n var Gun = Store.window.Gun || __webpack_require__(/*! ../gun */ \"./node_modules/gun/gun.js\");\n Gun.on('create', function(root){\n this.to.next(root);\n root.opt.store = root.opt.store || Store(root.opt);\n });\n }catch(e){}\n\n}());\n\n//# sourceURL=webpack:///./node_modules/gun/lib/rindexed.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/gun/lib/store.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/gun/lib/store.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Gun = (typeof window !== \"undefined\")? window.Gun : __webpack_require__(/*! ../gun */ \"./node_modules/gun/gun.js\");\n \nGun.on('create', function(root){\n if(Gun.TESTING){ root.opt.file = 'radatatest' }\n this.to.next(root);\n var opt = root.opt, u;\n if(false === opt.radisk){ return }\n var Radisk = (Gun.window && Gun.window.Radisk) || __webpack_require__(/*! ./radisk */ \"./node_modules/gun/lib/radisk.js\");\n var Radix = Radisk.Radix;\n \n opt.store = opt.store || (!Gun.window && __webpack_require__(/*! ./rfs */ \"./node_modules/gun/lib/rfs.js\")(opt));\n var rad = Radisk(opt), esc = String.fromCharCode(27);\n \n root.on('put', function(msg){\n this.to.next(msg);\n var id = msg['#'] || Gun.text.random(3), track = !msg['@'], acks = track? 0 : u; // only ack non-acks.\n if(msg.rad && !track){ return } // don't save our own acks\n var start = (+new Date); // STATS!\n Gun.graph.is(msg.put, null, function(val, key, node, soul){\n if(track){ ++acks }\n //console.log('put:', soul, key, val);\n val = Radisk.encode(val, null, esc)+'>'+Radisk.encode(Gun.state.is(node, key), null, esc);\n rad(soul+esc+key, val, (track? ack : u));\n });\n function ack(err, ok){\n acks--;\n if(ack.err){ return }\n if(ack.err = err){\n try{opt.store.stats.put.err = err}catch(e){} // STATS!\n root.on('in', {'@': id, err: err});\n return;\n }\n if(acks){ return }\n try{opt.store.stats.put.time[statp % 50] = (+new Date) - start; ++statp;\n opt.store.stats.put.count++;\n }catch(e){} // STATS!\n //console.log(\"PAT!\", id);\n root.on('in', {'@': id, ok: 1});\n }\n });\n \n root.on('get', function(msg){\n this.to.next(msg);\n var id = msg['#'], get = msg.get, soul = msg.get['#'], has = msg.get['.']||'', o = {}, graph, lex, key, tmp, force;\n if('string' == typeof soul){\n key = soul;\n } else \n if(soul){\n if(u !== (tmp = soul['*'])){ o.limit = force = 1 }\n if(u !== soul['>']){ o.start = soul['>'] }\n if(u !== soul['<']){ o.end = soul['<'] }\n key = force? (''+tmp) : tmp || soul['='];\n force = null;\n }\n if(key && !o.limit){ // a soul.has must be on a soul, and not during soul*\n if('string' == typeof has){\n key = key+esc+(o.atom = has);\n } else \n if(has){\n if(u !== has['>']){ o.start = has['>']; o.limit = 1 }\n if(u !== has['<']){ o.end = has['<']; o.limit = 1 }\n if(u !== (tmp = has['*'])){ o.limit = force = 1 }\n if(key){ key = key+esc + (force? (''+(tmp||'')) : tmp || (o.atom = has['='] || '')) }\n }\n }\n if((tmp = get['%']) || o.limit){\n o.limit = (tmp <= (o.pack || (1000 * 100)))? tmp : 1;\n }\n if(has['-'] || (soul||{})['-']){ o.reverse = true }\n //console.log(\"RAD get:\", key, o);\n var start = (+new Date); // STATS! // console.log(\"GET!\", id, JSON.stringify(key));\n rad(key||'', function(err, data, o){\n try{opt.store.stats.get.time[statg % 50] = (+new Date) - start; ++statg;\n opt.store.stats.get.count++;\n if(err){ opt.store.stats.get.err = err }\n }catch(e){} // STATS!\n //console.log(\"RAD gat:\", err, data, o);\n if(data){\n if(typeof data !== 'string'){\n if(o.atom){\n data = u;\n } else {\n Radix.map(data, each) \n }\n }\n if(!graph && data){ each(data, '') }\n }\n //console.log(\"GOT!\", id, JSON.stringify(key), ((+new Date) - start));\n root.on('in', {'@': id, put: graph, err: err? err : u, rad: Radix});\n }, o);\n function each(val, has, a,b){\n if(!val){ return }\n has = (key+has).split(esc);\n var soul = has.slice(0,1)[0];\n has = has.slice(-1)[0];\n o.count = (o.count || 0) + val.length;\n tmp = val.lastIndexOf('>');\n var state = Radisk.decode(val.slice(tmp+1), null, esc);\n val = Radisk.decode(val.slice(0,tmp), null, esc);\n (graph = graph || {})[soul] = Gun.state.ify(graph[soul], has, state, val, soul);\n if(o.limit && o.limit <= o.count){ return true }\n }\n });\n opt.store.stats = {get:{time:{}, count:0}, put: {time:{}, count:0}}; // STATS!\n var statg = 0, statp = 0; // STATS!\n});\n\n//# sourceURL=webpack:///./node_modules/gun/lib/store.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/afterRequest.json":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/afterRequest.json ***!
|
||
\*******************************************************/
|
||
/*! exports provided: $id, $schema, type, optional, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"afterRequest.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"lastAccess\",\"eTag\",\"hitCount\"],\"properties\":{\"expires\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"lastAccess\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"eTag\":{\"type\":\"string\"},\"hitCount\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/afterRequest.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/beforeRequest.json":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/beforeRequest.json ***!
|
||
\********************************************************/
|
||
/*! exports provided: $id, $schema, type, optional, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"beforeRequest.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"lastAccess\",\"eTag\",\"hitCount\"],\"properties\":{\"expires\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"lastAccess\":{\"type\":\"string\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))?\"},\"eTag\":{\"type\":\"string\"},\"hitCount\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/beforeRequest.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/browser.json":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/browser.json ***!
|
||
\**************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"browser.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"version\"],\"properties\":{\"name\":{\"type\":\"string\"},\"version\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/browser.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/cache.json":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/cache.json ***!
|
||
\************************************************/
|
||
/*! exports provided: $id, $schema, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"cache.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"properties\":{\"beforeRequest\":{\"oneOf\":[{\"type\":\"null\"},{\"$ref\":\"beforeRequest.json#\"}]},\"afterRequest\":{\"oneOf\":[{\"type\":\"null\"},{\"$ref\":\"afterRequest.json#\"}]},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/cache.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/content.json":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/content.json ***!
|
||
\**************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"content.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"size\",\"mimeType\"],\"properties\":{\"size\":{\"type\":\"integer\"},\"compression\":{\"type\":\"integer\"},\"mimeType\":{\"type\":\"string\"},\"text\":{\"type\":\"string\"},\"encoding\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/content.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/cookie.json":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/cookie.json ***!
|
||
\*************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"cookie.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"path\":{\"type\":\"string\"},\"domain\":{\"type\":\"string\"},\"expires\":{\"type\":[\"string\",\"null\"],\"format\":\"date-time\"},\"httpOnly\":{\"type\":\"boolean\"},\"secure\":{\"type\":\"boolean\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/cookie.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/creator.json":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/creator.json ***!
|
||
\**************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"creator.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"version\"],\"properties\":{\"name\":{\"type\":\"string\"},\"version\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/creator.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/entry.json":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/entry.json ***!
|
||
\************************************************/
|
||
/*! exports provided: $id, $schema, type, optional, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"entry.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"startedDateTime\",\"time\",\"request\",\"response\",\"cache\",\"timings\"],\"properties\":{\"pageref\":{\"type\":\"string\"},\"startedDateTime\":{\"type\":\"string\",\"format\":\"date-time\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))\"},\"time\":{\"type\":\"number\",\"min\":0},\"request\":{\"$ref\":\"request.json#\"},\"response\":{\"$ref\":\"response.json#\"},\"cache\":{\"$ref\":\"cache.json#\"},\"timings\":{\"$ref\":\"timings.json#\"},\"serverIPAddress\":{\"type\":\"string\",\"oneOf\":[{\"format\":\"ipv4\"},{\"format\":\"ipv6\"}]},\"connection\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/entry.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/har.json":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/har-schema/lib/har.json ***!
|
||
\**********************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"har.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"log\"],\"properties\":{\"log\":{\"$ref\":\"log.json#\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/har.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/header.json":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/header.json ***!
|
||
\*************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"header.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/header.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/har-schema/lib/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = {\n afterRequest: __webpack_require__(/*! ./afterRequest.json */ \"./node_modules/har-schema/lib/afterRequest.json\"),\n beforeRequest: __webpack_require__(/*! ./beforeRequest.json */ \"./node_modules/har-schema/lib/beforeRequest.json\"),\n browser: __webpack_require__(/*! ./browser.json */ \"./node_modules/har-schema/lib/browser.json\"),\n cache: __webpack_require__(/*! ./cache.json */ \"./node_modules/har-schema/lib/cache.json\"),\n content: __webpack_require__(/*! ./content.json */ \"./node_modules/har-schema/lib/content.json\"),\n cookie: __webpack_require__(/*! ./cookie.json */ \"./node_modules/har-schema/lib/cookie.json\"),\n creator: __webpack_require__(/*! ./creator.json */ \"./node_modules/har-schema/lib/creator.json\"),\n entry: __webpack_require__(/*! ./entry.json */ \"./node_modules/har-schema/lib/entry.json\"),\n har: __webpack_require__(/*! ./har.json */ \"./node_modules/har-schema/lib/har.json\"),\n header: __webpack_require__(/*! ./header.json */ \"./node_modules/har-schema/lib/header.json\"),\n log: __webpack_require__(/*! ./log.json */ \"./node_modules/har-schema/lib/log.json\"),\n page: __webpack_require__(/*! ./page.json */ \"./node_modules/har-schema/lib/page.json\"),\n pageTimings: __webpack_require__(/*! ./pageTimings.json */ \"./node_modules/har-schema/lib/pageTimings.json\"),\n postData: __webpack_require__(/*! ./postData.json */ \"./node_modules/har-schema/lib/postData.json\"),\n query: __webpack_require__(/*! ./query.json */ \"./node_modules/har-schema/lib/query.json\"),\n request: __webpack_require__(/*! ./request.json */ \"./node_modules/har-schema/lib/request.json\"),\n response: __webpack_require__(/*! ./response.json */ \"./node_modules/har-schema/lib/response.json\"),\n timings: __webpack_require__(/*! ./timings.json */ \"./node_modules/har-schema/lib/timings.json\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/log.json":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/har-schema/lib/log.json ***!
|
||
\**********************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"log.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"version\",\"creator\",\"entries\"],\"properties\":{\"version\":{\"type\":\"string\"},\"creator\":{\"$ref\":\"creator.json#\"},\"browser\":{\"$ref\":\"browser.json#\"},\"pages\":{\"type\":\"array\",\"items\":{\"$ref\":\"page.json#\"}},\"entries\":{\"type\":\"array\",\"items\":{\"$ref\":\"entry.json#\"}},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/log.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/page.json":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/har-schema/lib/page.json ***!
|
||
\***********************************************/
|
||
/*! exports provided: $id, $schema, type, optional, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"page.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"startedDateTime\",\"id\",\"title\",\"pageTimings\"],\"properties\":{\"startedDateTime\":{\"type\":\"string\",\"format\":\"date-time\",\"pattern\":\"^(\\\\d{4})(-)?(\\\\d\\\\d)(-)?(\\\\d\\\\d)(T)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(:)?(\\\\d\\\\d)(\\\\.\\\\d+)?(Z|([+-])(\\\\d\\\\d)(:)?(\\\\d\\\\d))\"},\"id\":{\"type\":\"string\",\"unique\":true},\"title\":{\"type\":\"string\"},\"pageTimings\":{\"$ref\":\"pageTimings.json#\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/page.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/pageTimings.json":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/pageTimings.json ***!
|
||
\******************************************************/
|
||
/*! exports provided: $id, $schema, type, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"pageTimings.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"properties\":{\"onContentLoad\":{\"type\":\"number\",\"min\":-1},\"onLoad\":{\"type\":\"number\",\"min\":-1},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/pageTimings.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/postData.json":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/postData.json ***!
|
||
\***************************************************/
|
||
/*! exports provided: $id, $schema, type, optional, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"postData.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"optional\":true,\"required\":[\"mimeType\"],\"properties\":{\"mimeType\":{\"type\":\"string\"},\"text\":{\"type\":\"string\"},\"params\":{\"type\":\"array\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"fileName\":{\"type\":\"string\"},\"contentType\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/postData.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/query.json":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/query.json ***!
|
||
\************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"query.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"name\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/query.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/request.json":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/request.json ***!
|
||
\**************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"request.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"method\",\"url\",\"httpVersion\",\"cookies\",\"headers\",\"queryString\",\"headersSize\",\"bodySize\"],\"properties\":{\"method\":{\"type\":\"string\"},\"url\":{\"type\":\"string\",\"format\":\"uri\"},\"httpVersion\":{\"type\":\"string\"},\"cookies\":{\"type\":\"array\",\"items\":{\"$ref\":\"cookie.json#\"}},\"headers\":{\"type\":\"array\",\"items\":{\"$ref\":\"header.json#\"}},\"queryString\":{\"type\":\"array\",\"items\":{\"$ref\":\"query.json#\"}},\"postData\":{\"$ref\":\"postData.json#\"},\"headersSize\":{\"type\":\"integer\"},\"bodySize\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/request.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/response.json":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/response.json ***!
|
||
\***************************************************/
|
||
/*! exports provided: $id, $schema, type, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"response.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"type\":\"object\",\"required\":[\"status\",\"statusText\",\"httpVersion\",\"cookies\",\"headers\",\"content\",\"redirectURL\",\"headersSize\",\"bodySize\"],\"properties\":{\"status\":{\"type\":\"integer\"},\"statusText\":{\"type\":\"string\"},\"httpVersion\":{\"type\":\"string\"},\"cookies\":{\"type\":\"array\",\"items\":{\"$ref\":\"cookie.json#\"}},\"headers\":{\"type\":\"array\",\"items\":{\"$ref\":\"header.json#\"}},\"content\":{\"$ref\":\"content.json#\"},\"redirectURL\":{\"type\":\"string\"},\"headersSize\":{\"type\":\"integer\"},\"bodySize\":{\"type\":\"integer\"},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/response.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-schema/lib/timings.json":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/har-schema/lib/timings.json ***!
|
||
\**************************************************/
|
||
/*! exports provided: $id, $schema, required, properties, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"$id\":\"timings.json#\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"required\":[\"send\",\"wait\",\"receive\"],\"properties\":{\"dns\":{\"type\":\"number\",\"min\":-1},\"connect\":{\"type\":\"number\",\"min\":-1},\"blocked\":{\"type\":\"number\",\"min\":-1},\"send\":{\"type\":\"number\",\"min\":-1},\"wait\":{\"type\":\"number\",\"min\":-1},\"receive\":{\"type\":\"number\",\"min\":-1},\"ssl\":{\"type\":\"number\",\"min\":-1},\"comment\":{\"type\":\"string\"}}};\n\n//# sourceURL=webpack:///./node_modules/har-schema/lib/timings.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-validator/lib/error.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/har-validator/lib/error.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function HARError (errors) {\n var message = 'validation failed'\n\n this.name = 'HARError'\n this.message = message\n this.errors = errors\n\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, this.constructor)\n } else {\n this.stack = (new Error(message)).stack\n }\n}\n\nHARError.prototype = Error.prototype\n\nmodule.exports = HARError\n\n\n//# sourceURL=webpack:///./node_modules/har-validator/lib/error.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/har-validator/lib/promise.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/har-validator/lib/promise.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Ajv = __webpack_require__(/*! ajv */ \"./node_modules/ajv/lib/ajv.js\")\nvar HARError = __webpack_require__(/*! ./error */ \"./node_modules/har-validator/lib/error.js\")\nvar schemas = __webpack_require__(/*! har-schema */ \"./node_modules/har-schema/lib/index.js\")\n\nvar ajv\n\nfunction createAjvInstance () {\n var ajv = new Ajv({\n allErrors: true\n })\n ajv.addMetaSchema(__webpack_require__(/*! ajv/lib/refs/json-schema-draft-06.json */ \"./node_modules/ajv/lib/refs/json-schema-draft-06.json\"))\n ajv.addSchema(schemas)\n\n return ajv\n}\n\nfunction validate (name, data) {\n data = data || {}\n\n // validator config\n ajv = ajv || createAjvInstance()\n\n var validate = ajv.getSchema(name + '.json')\n\n return new Promise(function (resolve, reject) {\n var valid = validate(data)\n\n !valid ? reject(new HARError(validate.errors)) : resolve(data)\n })\n}\n\nexports.afterRequest = function (data) {\n return validate('afterRequest', data)\n}\n\nexports.beforeRequest = function (data) {\n return validate('beforeRequest', data)\n}\n\nexports.browser = function (data) {\n return validate('browser', data)\n}\n\nexports.cache = function (data) {\n return validate('cache', data)\n}\n\nexports.content = function (data) {\n return validate('content', data)\n}\n\nexports.cookie = function (data) {\n return validate('cookie', data)\n}\n\nexports.creator = function (data) {\n return validate('creator', data)\n}\n\nexports.entry = function (data) {\n return validate('entry', data)\n}\n\nexports.har = function (data) {\n return validate('har', data)\n}\n\nexports.header = function (data) {\n return validate('header', data)\n}\n\nexports.log = function (data) {\n return validate('log', data)\n}\n\nexports.page = function (data) {\n return validate('page', data)\n}\n\nexports.pageTimings = function (data) {\n return validate('pageTimings', data)\n}\n\nexports.postData = function (data) {\n return validate('postData', data)\n}\n\nexports.query = function (data) {\n return validate('query', data)\n}\n\nexports.request = function (data) {\n return validate('request', data)\n}\n\nexports.response = function (data) {\n return validate('response', data)\n}\n\nexports.timings = function (data) {\n return validate('timings', data)\n}\n\n\n//# sourceURL=webpack:///./node_modules/har-validator/lib/promise.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/hash-base/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/hash-base/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar Transform = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nfunction throwIfNotStringOrBuffer (val, prefix) {\n if (!Buffer.isBuffer(val) && typeof val !== 'string') {\n throw new TypeError(prefix + ' must be a string or a buffer')\n }\n}\n\nfunction HashBase (blockSize) {\n Transform.call(this)\n\n this._block = Buffer.allocUnsafe(blockSize)\n this._blockSize = blockSize\n this._blockOffset = 0\n this._length = [0, 0, 0, 0]\n\n this._finalized = false\n}\n\ninherits(HashBase, Transform)\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n var error = null\n try {\n this.update(chunk, encoding)\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype._flush = function (callback) {\n var error = null\n try {\n this.push(this.digest())\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype.update = function (data, encoding) {\n throwIfNotStringOrBuffer(data, 'Data')\n if (this._finalized) throw new Error('Digest already called')\n if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\n\n // consume data\n var block = this._block\n var offset = 0\n while (this._blockOffset + data.length - offset >= this._blockSize) {\n for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\n this._update()\n this._blockOffset = 0\n }\n while (offset < data.length) block[this._blockOffset++] = data[offset++]\n\n // update length\n for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n this._length[j] += carry\n carry = (this._length[j] / 0x0100000000) | 0\n if (carry > 0) this._length[j] -= 0x0100000000 * carry\n }\n\n return this\n}\n\nHashBase.prototype._update = function () {\n throw new Error('_update is not implemented')\n}\n\nHashBase.prototype.digest = function (encoding) {\n if (this._finalized) throw new Error('Digest already called')\n this._finalized = true\n\n var digest = this._digest()\n if (encoding !== undefined) digest = digest.toString(encoding)\n\n // reset state\n this._block.fill(0)\n this._blockOffset = 0\n for (var i = 0; i < 4; ++i) this._length[i] = 0\n\n return digest\n}\n\nHashBase.prototype._digest = function () {\n throw new Error('_digest is not implemented')\n}\n\nmodule.exports = HashBase\n\n\n//# sourceURL=webpack:///./node_modules/hash-base/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/hi-base32/src/base32.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/hi-base32/src/base32.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * [hi-base32]{@link https://github.com/emn178/hi-base32}\n *\n * @version 0.5.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.HI_BASE32_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.HI_BASE32_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = true && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\");\n var BASE32_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split('');\n var BASE32_DECODE_CHAR = {\n 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8,\n 'J': 9, 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16,\n 'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24,\n 'Z': 25, '2': 26, '3': 27, '4': 28, '5': 29, '6': 30, '7': 31\n };\n\n var blocks = [0, 0, 0, 0, 0, 0, 0, 0];\n\n var throwInvalidUtf8 = function (position, partial) {\n if (partial.length > 10) {\n partial = '...' + partial.substr(-10);\n }\n var err = new Error('Decoded data is not valid UTF-8.'\n + ' Maybe try base32.decode.asBytes()?'\n + ' Partial data after reading ' + position + ' bytes: ' + partial + ' <-');\n err.position = position;\n throw err;\n };\n\n var toUtf8String = function (bytes) {\n var str = '', length = bytes.length, i = 0, followingChars = 0, b, c;\n while (i < length) {\n b = bytes[i++];\n if (b <= 0x7F) {\n str += String.fromCharCode(b);\n continue;\n } else if (b > 0xBF && b <= 0xDF) {\n c = b & 0x1F;\n followingChars = 1;\n } else if (b <= 0xEF) {\n c = b & 0x0F;\n followingChars = 2;\n } else if (b <= 0xF7) {\n c = b & 0x07;\n followingChars = 3;\n } else {\n throwInvalidUtf8(i, str);\n }\n\n for (var j = 0; j < followingChars; ++j) {\n b = bytes[i++];\n if (b < 0x80 || b > 0xBF) {\n throwInvalidUtf8(i, str);\n }\n c <<= 6;\n c += b & 0x3F;\n }\n if (c >= 0xD800 && c <= 0xDFFF) {\n throwInvalidUtf8(i, str);\n }\n if (c > 0x10FFFF) {\n throwInvalidUtf8(i, str);\n }\n\n if (c <= 0xFFFF) {\n str += String.fromCharCode(c);\n } else {\n c -= 0x10000;\n str += String.fromCharCode((c >> 10) + 0xD800);\n str += String.fromCharCode((c & 0x3FF) + 0xDC00);\n }\n }\n return str;\n };\n\n var decodeAsBytes = function (base32Str) {\n if (!/^[A-Z2-7=]+$/.test(base32Str)) {\n throw new Error('Invalid base32 characters');\n }\n base32Str = base32Str.replace(/=/g, '');\n var v1, v2, v3, v4, v5, v6, v7, v8, bytes = [], index = 0, length = base32Str.length;\n\n // 4 char to 3 bytes\n for (var i = 0, count = length >> 3 << 3; i < count;) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n bytes[index++] = (v1 << 3 | v2 >>> 2) & 255;\n bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255;\n bytes[index++] = (v4 << 4 | v5 >>> 1) & 255;\n bytes[index++] = (v5 << 7 | v6 << 2 | v7 >>> 3) & 255;\n bytes[index++] = (v7 << 5 | v8) & 255;\n }\n\n // remain bytes\n var remain = length - count;\n if (remain === 2) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n bytes[index++] = (v1 << 3 | v2 >>> 2) & 255;\n } else if (remain === 4) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n bytes[index++] = (v1 << 3 | v2 >>> 2) & 255;\n bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255;\n } else if (remain === 5) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n bytes[index++] = (v1 << 3 | v2 >>> 2) & 255;\n bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255;\n bytes[index++] = (v4 << 4 | v5 >>> 1) & 255;\n } else if (remain === 7) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n bytes[index++] = (v1 << 3 | v2 >>> 2) & 255;\n bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255;\n bytes[index++] = (v4 << 4 | v5 >>> 1) & 255;\n bytes[index++] = (v5 << 7 | v6 << 2 | v7 >>> 3) & 255;\n }\n return bytes;\n };\n\n var encodeAscii = function (str) {\n var v1, v2, v3, v4, v5, base32Str = '', length = str.length;\n for (var i = 0, count = parseInt(length / 5) * 5; i < count;) {\n v1 = str.charCodeAt(i++);\n v2 = str.charCodeAt(i++);\n v3 = str.charCodeAt(i++);\n v4 = str.charCodeAt(i++);\n v5 = str.charCodeAt(i++);\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] +\n BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] +\n BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] +\n BASE32_ENCODE_CHAR[v5 & 31];\n }\n\n // remain char\n var remain = length - count;\n if (remain === 1) {\n v1 = str.charCodeAt(i);\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2) & 31] +\n '======';\n } else if (remain === 2) {\n v1 = str.charCodeAt(i++);\n v2 = str.charCodeAt(i);\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4) & 31] +\n '====';\n } else if (remain === 3) {\n v1 = str.charCodeAt(i++);\n v2 = str.charCodeAt(i++);\n v3 = str.charCodeAt(i);\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1) & 31] +\n '===';\n } else if (remain === 4) {\n v1 = str.charCodeAt(i++);\n v2 = str.charCodeAt(i++);\n v3 = str.charCodeAt(i++);\n v4 = str.charCodeAt(i);\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] +\n BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] +\n BASE32_ENCODE_CHAR[(v4 << 3) & 31] +\n '=';\n }\n return base32Str;\n };\n\n var encodeUtf8 = function (str) {\n var v1, v2, v3, v4, v5, code, end = false, base32Str = '',\n index = 0, i, start = 0, bytes = 0, length = str.length;\n do {\n blocks[0] = blocks[5];\n blocks[1] = blocks[6];\n blocks[2] = blocks[7];\n for (i = start; index < length && i < 5; ++index) {\n code = str.charCodeAt(index);\n if (code < 0x80) {\n blocks[i++] = code;\n } else if (code < 0x800) {\n blocks[i++] = 0xc0 | (code >> 6);\n blocks[i++] = 0x80 | (code & 0x3f);\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i++] = 0xe0 | (code >> 12);\n blocks[i++] = 0x80 | ((code >> 6) & 0x3f);\n blocks[i++] = 0x80 | (code & 0x3f);\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++index) & 0x3ff));\n blocks[i++] = 0xf0 | (code >> 18);\n blocks[i++] = 0x80 | ((code >> 12) & 0x3f);\n blocks[i++] = 0x80 | ((code >> 6) & 0x3f);\n blocks[i++] = 0x80 | (code & 0x3f);\n }\n }\n bytes += i - start;\n start = i - 5;\n if (index === length) {\n ++index;\n }\n if (index > length && i < 6) {\n end = true;\n }\n v1 = blocks[0];\n if (i > 4) {\n v2 = blocks[1];\n v3 = blocks[2];\n v4 = blocks[3];\n v5 = blocks[4];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] +\n BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] +\n BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] +\n BASE32_ENCODE_CHAR[v5 & 31];\n } else if (i === 1) {\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2) & 31] +\n '======';\n } else if (i === 2) {\n v2 = blocks[1];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4) & 31] +\n '====';\n } else if (i === 3) {\n v2 = blocks[1];\n v3 = blocks[2];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1) & 31] +\n '===';\n } else {\n v2 = blocks[1];\n v3 = blocks[2];\n v4 = blocks[3];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] +\n BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] +\n BASE32_ENCODE_CHAR[(v4 << 3) & 31] +\n '=';\n }\n } while (!end);\n return base32Str;\n };\n\n var encodeBytes = function (bytes) {\n var v1, v2, v3, v4, v5, base32Str = '', length = bytes.length;\n for (var i = 0, count = parseInt(length / 5) * 5; i < count;) {\n v1 = bytes[i++];\n v2 = bytes[i++];\n v3 = bytes[i++];\n v4 = bytes[i++];\n v5 = bytes[i++];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] +\n BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] +\n BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] +\n BASE32_ENCODE_CHAR[v5 & 31];\n }\n\n // remain char\n var remain = length - count;\n if (remain === 1) {\n v1 = bytes[i];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2) & 31] +\n '======';\n } else if (remain === 2) {\n v1 = bytes[i++];\n v2 = bytes[i];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4) & 31] +\n '====';\n } else if (remain === 3) {\n v1 = bytes[i++];\n v2 = bytes[i++];\n v3 = bytes[i];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1) & 31] +\n '===';\n } else if (remain === 4) {\n v1 = bytes[i++];\n v2 = bytes[i++];\n v3 = bytes[i++];\n v4 = bytes[i];\n base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] +\n BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] +\n BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] +\n BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] +\n BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] +\n BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] +\n BASE32_ENCODE_CHAR[(v4 << 3) & 31] +\n '=';\n }\n return base32Str;\n };\n\n var encode = function (input, asciiOnly) {\n var notString = typeof(input) !== 'string';\n if (notString && input.constructor === ArrayBuffer) {\n input = new Uint8Array(input);\n }\n if (notString) {\n return encodeBytes(input);\n } else if (asciiOnly) {\n return encodeAscii(input);\n } else {\n return encodeUtf8(input);\n }\n };\n\n var decode = function (base32Str, asciiOnly) {\n if (!asciiOnly) {\n return toUtf8String(decodeAsBytes(base32Str));\n }\n if (!/^[A-Z2-7=]+$/.test(base32Str)) {\n throw new Error('Invalid base32 characters');\n }\n var v1, v2, v3, v4, v5, v6, v7, v8, str = '', length = base32Str.indexOf('=');\n if (length === -1) {\n length = base32Str.length;\n }\n\n // 8 char to 5 bytes\n for (var i = 0, count = length >> 3 << 3; i < count;) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) +\n String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) +\n String.fromCharCode((v4 << 4 | v5 >>> 1) & 255) +\n String.fromCharCode((v5 << 7 | v6 << 2 | v7 >>> 3) & 255) +\n String.fromCharCode((v7 << 5 | v8) & 255);\n }\n\n // remain bytes\n var remain = length - count;\n if (remain === 2) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255);\n } else if (remain === 4) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) +\n String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255);\n } else if (remain === 5) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) +\n String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) +\n String.fromCharCode((v4 << 4 | v5 >>> 1) & 255);\n } else if (remain === 7) {\n v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)];\n str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) +\n String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) +\n String.fromCharCode((v4 << 4 | v5 >>> 1) & 255) +\n String.fromCharCode((v5 << 7 | v6 << 2 | v7 >>> 3) & 255);\n }\n return str;\n };\n\n var exports = {\n encode: encode,\n decode: decode\n };\n decode.asBytes = decodeAsBytes;\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.base32 = exports;\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return exports;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/hi-base32/src/base32.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/http-signature/lib/index.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/http-signature/lib/index.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nvar parser = __webpack_require__(/*! ./parser */ \"./node_modules/http-signature/lib/parser.js\");\nvar signer = __webpack_require__(/*! ./signer */ \"./node_modules/http-signature/lib/signer.js\");\nvar verify = __webpack_require__(/*! ./verify */ \"./node_modules/http-signature/lib/verify.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/http-signature/lib/utils.js\");\n\n\n\n///--- API\n\nmodule.exports = {\n\n parse: parser.parseRequest,\n parseRequest: parser.parseRequest,\n\n sign: signer.signRequest,\n signRequest: signer.signRequest,\n createSigner: signer.createSigner,\n isSigner: signer.isSigner,\n\n sshKeyToPEM: utils.sshKeyToPEM,\n sshKeyFingerprint: utils.fingerprint,\n pemToRsaSSHKey: utils.pemToRsaSSHKey,\n\n verify: verify.verifySignature,\n verifySignature: verify.verifySignature,\n verifyHMAC: verify.verifyHMAC\n};\n\n\n//# sourceURL=webpack:///./node_modules/http-signature/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/http-signature/lib/parser.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/http-signature/lib/parser.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/http-signature/lib/utils.js\");\n\n\n\n///--- Globals\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\nvar State = {\n New: 0,\n Params: 1\n};\n\nvar ParamsState = {\n Name: 0,\n Quote: 1,\n Value: 2,\n Comma: 3\n};\n\n\n///--- Specific Errors\n\n\nfunction ExpiredRequestError(message) {\n HttpSignatureError.call(this, message, ExpiredRequestError);\n}\nutil.inherits(ExpiredRequestError, HttpSignatureError);\n\n\nfunction InvalidHeaderError(message) {\n HttpSignatureError.call(this, message, InvalidHeaderError);\n}\nutil.inherits(InvalidHeaderError, HttpSignatureError);\n\n\nfunction InvalidParamsError(message) {\n HttpSignatureError.call(this, message, InvalidParamsError);\n}\nutil.inherits(InvalidParamsError, HttpSignatureError);\n\n\nfunction MissingHeaderError(message) {\n HttpSignatureError.call(this, message, MissingHeaderError);\n}\nutil.inherits(MissingHeaderError, HttpSignatureError);\n\nfunction StrictParsingError(message) {\n HttpSignatureError.call(this, message, StrictParsingError);\n}\nutil.inherits(StrictParsingError, HttpSignatureError);\n\n///--- Exported API\n\nmodule.exports = {\n\n /**\n * Parses the 'Authorization' header out of an http.ServerRequest object.\n *\n * Note that this API will fully validate the Authorization header, and throw\n * on any error. It will not however check the signature, or the keyId format\n * as those are specific to your environment. You can use the options object\n * to pass in extra constraints.\n *\n * As a response object you can expect this:\n *\n * {\n * \"scheme\": \"Signature\",\n * \"params\": {\n * \"keyId\": \"foo\",\n * \"algorithm\": \"rsa-sha256\",\n * \"headers\": [\n * \"date\" or \"x-date\",\n * \"digest\"\n * ],\n * \"signature\": \"base64\"\n * },\n * \"signingString\": \"ready to be passed to crypto.verify()\"\n * }\n *\n * @param {Object} request an http.ServerRequest.\n * @param {Object} options an optional options object with:\n * - clockSkew: allowed clock skew in seconds (default 300).\n * - headers: required header names (def: date or x-date)\n * - algorithms: algorithms to support (default: all).\n * - strict: should enforce latest spec parsing\n * (default: false).\n * @return {Object} parsed out object (see above).\n * @throws {TypeError} on invalid input.\n * @throws {InvalidHeaderError} on an invalid Authorization header error.\n * @throws {InvalidParamsError} if the params in the scheme are invalid.\n * @throws {MissingHeaderError} if the params indicate a header not present,\n * either in the request headers from the params,\n * or not in the params from a required header\n * in options.\n * @throws {StrictParsingError} if old attributes are used in strict parsing\n * mode.\n * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.\n */\n parseRequest: function parseRequest(request, options) {\n assert.object(request, 'request');\n assert.object(request.headers, 'request.headers');\n if (options === undefined) {\n options = {};\n }\n if (options.headers === undefined) {\n options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];\n }\n assert.object(options, 'options');\n assert.arrayOfString(options.headers, 'options.headers');\n assert.optionalFinite(options.clockSkew, 'options.clockSkew');\n\n var authzHeaderName = options.authorizationHeaderName || 'authorization';\n\n if (!request.headers[authzHeaderName]) {\n throw new MissingHeaderError('no ' + authzHeaderName + ' header ' +\n 'present in the request');\n }\n\n options.clockSkew = options.clockSkew || 300;\n\n\n var i = 0;\n var state = State.New;\n var substate = ParamsState.Name;\n var tmpName = '';\n var tmpValue = '';\n\n var parsed = {\n scheme: '',\n params: {},\n signingString: ''\n };\n\n var authz = request.headers[authzHeaderName];\n for (i = 0; i < authz.length; i++) {\n var c = authz.charAt(i);\n\n switch (Number(state)) {\n\n case State.New:\n if (c !== ' ') parsed.scheme += c;\n else state = State.Params;\n break;\n\n case State.Params:\n switch (Number(substate)) {\n\n case ParamsState.Name:\n var code = c.charCodeAt(0);\n // restricted name of A-Z / a-z\n if ((code >= 0x41 && code <= 0x5a) || // A-Z\n (code >= 0x61 && code <= 0x7a)) { // a-z\n tmpName += c;\n } else if (c === '=') {\n if (tmpName.length === 0)\n throw new InvalidHeaderError('bad param format');\n substate = ParamsState.Quote;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n case ParamsState.Quote:\n if (c === '\"') {\n tmpValue = '';\n substate = ParamsState.Value;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n case ParamsState.Value:\n if (c === '\"') {\n parsed.params[tmpName] = tmpValue;\n substate = ParamsState.Comma;\n } else {\n tmpValue += c;\n }\n break;\n\n case ParamsState.Comma:\n if (c === ',') {\n tmpName = '';\n substate = ParamsState.Name;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n default:\n throw new Error('Invalid substate');\n }\n break;\n\n default:\n throw new Error('Invalid substate');\n }\n\n }\n\n if (!parsed.params.headers || parsed.params.headers === '') {\n if (request.headers['x-date']) {\n parsed.params.headers = ['x-date'];\n } else {\n parsed.params.headers = ['date'];\n }\n } else {\n parsed.params.headers = parsed.params.headers.split(' ');\n }\n\n // Minimally validate the parsed object\n if (!parsed.scheme || parsed.scheme !== 'Signature')\n throw new InvalidHeaderError('scheme was not \"Signature\"');\n\n if (!parsed.params.keyId)\n throw new InvalidHeaderError('keyId was not specified');\n\n if (!parsed.params.algorithm)\n throw new InvalidHeaderError('algorithm was not specified');\n\n if (!parsed.params.signature)\n throw new InvalidHeaderError('signature was not specified');\n\n // Check the algorithm against the official list\n parsed.params.algorithm = parsed.params.algorithm.toLowerCase();\n try {\n validateAlgorithm(parsed.params.algorithm);\n } catch (e) {\n if (e instanceof InvalidAlgorithmError)\n throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' +\n 'supported'));\n else\n throw (e);\n }\n\n // Build the signingString\n for (i = 0; i < parsed.params.headers.length; i++) {\n var h = parsed.params.headers[i].toLowerCase();\n parsed.params.headers[i] = h;\n\n if (h === 'request-line') {\n if (!options.strict) {\n /*\n * We allow headers from the older spec drafts if strict parsing isn't\n * specified in options.\n */\n parsed.signingString +=\n request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;\n } else {\n /* Strict parsing doesn't allow older draft headers. */\n throw (new StrictParsingError('request-line is not a valid header ' +\n 'with strict parsing enabled.'));\n }\n } else if (h === '(request-target)') {\n parsed.signingString +=\n '(request-target): ' + request.method.toLowerCase() + ' ' +\n request.url;\n } else {\n var value = request.headers[h];\n if (value === undefined)\n throw new MissingHeaderError(h + ' was not in the request');\n parsed.signingString += h + ': ' + value;\n }\n\n if ((i + 1) < parsed.params.headers.length)\n parsed.signingString += '\\n';\n }\n\n // Check against the constraints\n var date;\n if (request.headers.date || request.headers['x-date']) {\n if (request.headers['x-date']) {\n date = new Date(request.headers['x-date']);\n } else {\n date = new Date(request.headers.date);\n }\n var now = new Date();\n var skew = Math.abs(now.getTime() - date.getTime());\n\n if (skew > options.clockSkew * 1000) {\n throw new ExpiredRequestError('clock skew of ' +\n (skew / 1000) +\n 's was greater than ' +\n options.clockSkew + 's');\n }\n }\n\n options.headers.forEach(function (hdr) {\n // Remember that we already checked any headers in the params\n // were in the request, so if this passes we're good.\n if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)\n throw new MissingHeaderError(hdr + ' was not a signed header');\n });\n\n if (options.algorithms) {\n if (options.algorithms.indexOf(parsed.params.algorithm) === -1)\n throw new InvalidParamsError(parsed.params.algorithm +\n ' is not a supported algorithm');\n }\n\n parsed.algorithm = parsed.params.algorithm.toUpperCase();\n parsed.keyId = parsed.params.keyId;\n return parsed;\n }\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/http-signature/lib/parser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/http-signature/lib/signer.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/http-signature/lib/signer.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar http = __webpack_require__(/*! http */ \"./node_modules/stream-http/index.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar sshpk = __webpack_require__(/*! sshpk */ \"./node_modules/sshpk/lib/index.js\");\nvar jsprim = __webpack_require__(/*! jsprim */ \"./node_modules/jsprim/lib/jsprim.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/http-signature/lib/utils.js\");\n\nvar sprintf = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\").format;\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\n///--- Globals\n\nvar AUTHZ_FMT =\n 'Signature keyId=\"%s\",algorithm=\"%s\",headers=\"%s\",signature=\"%s\"';\n\n///--- Specific Errors\n\nfunction MissingHeaderError(message) {\n HttpSignatureError.call(this, message, MissingHeaderError);\n}\nutil.inherits(MissingHeaderError, HttpSignatureError);\n\nfunction StrictParsingError(message) {\n HttpSignatureError.call(this, message, StrictParsingError);\n}\nutil.inherits(StrictParsingError, HttpSignatureError);\n\n/* See createSigner() */\nfunction RequestSigner(options) {\n assert.object(options, 'options');\n\n var alg = [];\n if (options.algorithm !== undefined) {\n assert.string(options.algorithm, 'options.algorithm');\n alg = validateAlgorithm(options.algorithm);\n }\n this.rs_alg = alg;\n\n /*\n * RequestSigners come in two varieties: ones with an rs_signFunc, and ones\n * with an rs_signer.\n *\n * rs_signFunc-based RequestSigners have to build up their entire signing\n * string within the rs_lines array and give it to rs_signFunc as a single\n * concat'd blob. rs_signer-based RequestSigners can add a line at a time to\n * their signing state by using rs_signer.update(), thus only needing to\n * buffer the hash function state and one line at a time.\n */\n if (options.sign !== undefined) {\n assert.func(options.sign, 'options.sign');\n this.rs_signFunc = options.sign;\n\n } else if (alg[0] === 'hmac' && options.key !== undefined) {\n assert.string(options.keyId, 'options.keyId');\n this.rs_keyId = options.keyId;\n\n if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))\n throw (new TypeError('options.key for HMAC must be a string or Buffer'));\n\n /*\n * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their\n * data in chunks rather than requiring it all to be given in one go\n * at the end, so they are more similar to signers than signFuncs.\n */\n this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);\n this.rs_signer.sign = function () {\n var digest = this.digest('base64');\n return ({\n hashAlgorithm: alg[1],\n toString: function () { return (digest); }\n });\n };\n\n } else if (options.key !== undefined) {\n var key = options.key;\n if (typeof (key) === 'string' || Buffer.isBuffer(key))\n key = sshpk.parsePrivateKey(key);\n\n assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),\n 'options.key must be a sshpk.PrivateKey');\n this.rs_key = key;\n\n assert.string(options.keyId, 'options.keyId');\n this.rs_keyId = options.keyId;\n\n if (!PK_ALGOS[key.type]) {\n throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +\n 'keys are not supported'));\n }\n\n if (alg[0] !== undefined && key.type !== alg[0]) {\n throw (new InvalidAlgorithmError('options.key must be a ' +\n alg[0].toUpperCase() + ' key, was given a ' +\n key.type.toUpperCase() + ' key instead'));\n }\n\n this.rs_signer = key.createSign(alg[1]);\n\n } else {\n throw (new TypeError('options.sign (func) or options.key is required'));\n }\n\n this.rs_headers = [];\n this.rs_lines = [];\n}\n\n/**\n * Adds a header to be signed, with its value, into this signer.\n *\n * @param {String} header\n * @param {String} value\n * @return {String} value written\n */\nRequestSigner.prototype.writeHeader = function (header, value) {\n assert.string(header, 'header');\n header = header.toLowerCase();\n assert.string(value, 'value');\n\n this.rs_headers.push(header);\n\n if (this.rs_signFunc) {\n this.rs_lines.push(header + ': ' + value);\n\n } else {\n var line = header + ': ' + value;\n if (this.rs_headers.length > 0)\n line = '\\n' + line;\n this.rs_signer.update(line);\n }\n\n return (value);\n};\n\n/**\n * Adds a default Date header, returning its value.\n *\n * @return {String}\n */\nRequestSigner.prototype.writeDateHeader = function () {\n return (this.writeHeader('date', jsprim.rfc1123(new Date())));\n};\n\n/**\n * Adds the request target line to be signed.\n *\n * @param {String} method, HTTP method (e.g. 'get', 'post', 'put')\n * @param {String} path\n */\nRequestSigner.prototype.writeTarget = function (method, path) {\n assert.string(method, 'method');\n assert.string(path, 'path');\n method = method.toLowerCase();\n this.writeHeader('(request-target)', method + ' ' + path);\n};\n\n/**\n * Calculate the value for the Authorization header on this request\n * asynchronously.\n *\n * @param {Func} callback (err, authz)\n */\nRequestSigner.prototype.sign = function (cb) {\n assert.func(cb, 'callback');\n\n if (this.rs_headers.length < 1)\n throw (new Error('At least one header must be signed'));\n\n var alg, authz;\n if (this.rs_signFunc) {\n var data = this.rs_lines.join('\\n');\n var self = this;\n this.rs_signFunc(data, function (err, sig) {\n if (err) {\n cb(err);\n return;\n }\n try {\n assert.object(sig, 'signature');\n assert.string(sig.keyId, 'signature.keyId');\n assert.string(sig.algorithm, 'signature.algorithm');\n assert.string(sig.signature, 'signature.signature');\n alg = validateAlgorithm(sig.algorithm);\n\n authz = sprintf(AUTHZ_FMT,\n sig.keyId,\n sig.algorithm,\n self.rs_headers.join(' '),\n sig.signature);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, authz);\n });\n\n } else {\n try {\n var sigObj = this.rs_signer.sign();\n } catch (e) {\n cb(e);\n return;\n }\n alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm;\n var signature = sigObj.toString();\n authz = sprintf(AUTHZ_FMT,\n this.rs_keyId,\n alg,\n this.rs_headers.join(' '),\n signature);\n cb(null, authz);\n }\n};\n\n///--- Exported API\n\nmodule.exports = {\n /**\n * Identifies whether a given object is a request signer or not.\n *\n * @param {Object} object, the object to identify\n * @returns {Boolean}\n */\n isSigner: function (obj) {\n if (typeof (obj) === 'object' && obj instanceof RequestSigner)\n return (true);\n return (false);\n },\n\n /**\n * Creates a request signer, used to asynchronously build a signature\n * for a request (does not have to be an http.ClientRequest).\n *\n * @param {Object} options, either:\n * - {String} keyId\n * - {String|Buffer} key\n * - {String} algorithm (optional, required for HMAC)\n * or:\n * - {Func} sign (data, cb)\n * @return {RequestSigner}\n */\n createSigner: function createSigner(options) {\n return (new RequestSigner(options));\n },\n\n /**\n * Adds an 'Authorization' header to an http.ClientRequest object.\n *\n * Note that this API will add a Date header if it's not already set. Any\n * other headers in the options.headers array MUST be present, or this\n * will throw.\n *\n * You shouldn't need to check the return type; it's just there if you want\n * to be pedantic.\n *\n * The optional flag indicates whether parsing should use strict enforcement\n * of the version draft-cavage-http-signatures-04 of the spec or beyond.\n * The default is to be loose and support\n * older versions for compatibility.\n *\n * @param {Object} request an instance of http.ClientRequest.\n * @param {Object} options signing parameters object:\n * - {String} keyId required.\n * - {String} key required (either a PEM or HMAC key).\n * - {Array} headers optional; defaults to ['date'].\n * - {String} algorithm optional (unless key is HMAC);\n * default is the same as the sshpk default\n * signing algorithm for the type of key given\n * - {String} httpVersion optional; defaults to '1.1'.\n * - {Boolean} strict optional; defaults to 'false'.\n * @return {Boolean} true if Authorization (and optionally Date) were added.\n * @throws {TypeError} on bad parameter types (input).\n * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with\n * the given key.\n * @throws {sshpk.KeyParseError} if key was bad.\n * @throws {MissingHeaderError} if a header to be signed was specified but\n * was not present.\n */\n signRequest: function signRequest(request, options) {\n assert.object(request, 'request');\n assert.object(options, 'options');\n assert.optionalString(options.algorithm, 'options.algorithm');\n assert.string(options.keyId, 'options.keyId');\n assert.optionalArrayOfString(options.headers, 'options.headers');\n assert.optionalString(options.httpVersion, 'options.httpVersion');\n\n if (!request.getHeader('Date'))\n request.setHeader('Date', jsprim.rfc1123(new Date()));\n if (!options.headers)\n options.headers = ['date'];\n if (!options.httpVersion)\n options.httpVersion = '1.1';\n\n var alg = [];\n if (options.algorithm) {\n options.algorithm = options.algorithm.toLowerCase();\n alg = validateAlgorithm(options.algorithm);\n }\n\n var i;\n var stringToSign = '';\n for (i = 0; i < options.headers.length; i++) {\n if (typeof (options.headers[i]) !== 'string')\n throw new TypeError('options.headers must be an array of Strings');\n\n var h = options.headers[i].toLowerCase();\n\n if (h === 'request-line') {\n if (!options.strict) {\n /**\n * We allow headers from the older spec drafts if strict parsing isn't\n * specified in options.\n */\n stringToSign +=\n request.method + ' ' + request.path + ' HTTP/' +\n options.httpVersion;\n } else {\n /* Strict parsing doesn't allow older draft headers. */\n throw (new StrictParsingError('request-line is not a valid header ' +\n 'with strict parsing enabled.'));\n }\n } else if (h === '(request-target)') {\n stringToSign +=\n '(request-target): ' + request.method.toLowerCase() + ' ' +\n request.path;\n } else {\n var value = request.getHeader(h);\n if (value === undefined || value === '') {\n throw new MissingHeaderError(h + ' was not in the request');\n }\n stringToSign += h + ': ' + value;\n }\n\n if ((i + 1) < options.headers.length)\n stringToSign += '\\n';\n }\n\n /* This is just for unit tests. */\n if (request.hasOwnProperty('_stringToSign')) {\n request._stringToSign = stringToSign;\n }\n\n var signature;\n if (alg[0] === 'hmac') {\n if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))\n throw (new TypeError('options.key must be a string or Buffer'));\n\n var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key);\n hmac.update(stringToSign);\n signature = hmac.digest('base64');\n\n } else {\n var key = options.key;\n if (typeof (key) === 'string' || Buffer.isBuffer(key))\n key = sshpk.parsePrivateKey(options.key);\n\n assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),\n 'options.key must be a sshpk.PrivateKey');\n\n if (!PK_ALGOS[key.type]) {\n throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +\n 'keys are not supported'));\n }\n\n if (alg[0] !== undefined && key.type !== alg[0]) {\n throw (new InvalidAlgorithmError('options.key must be a ' +\n alg[0].toUpperCase() + ' key, was given a ' +\n key.type.toUpperCase() + ' key instead'));\n }\n\n var signer = key.createSign(alg[1]);\n signer.update(stringToSign);\n var sigObj = signer.sign();\n if (!HASH_ALGOS[sigObj.hashAlgorithm]) {\n throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() +\n ' is not a supported hash algorithm'));\n }\n options.algorithm = key.type + '-' + sigObj.hashAlgorithm;\n signature = sigObj.toString();\n assert.notStrictEqual(signature, '', 'empty signature produced');\n }\n\n var authzHeaderName = options.authorizationHeaderName || 'Authorization';\n\n request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT,\n options.keyId,\n options.algorithm,\n options.headers.join(' '),\n signature));\n\n return true;\n }\n\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/http-signature/lib/signer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/http-signature/lib/utils.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/http-signature/lib/utils.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar sshpk = __webpack_require__(/*! sshpk */ \"./node_modules/sshpk/lib/index.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nvar HASH_ALGOS = {\n 'sha1': true,\n 'sha256': true,\n 'sha512': true\n};\n\nvar PK_ALGOS = {\n 'rsa': true,\n 'dsa': true,\n 'ecdsa': true\n};\n\nfunction HttpSignatureError(message, caller) {\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, caller || HttpSignatureError);\n\n this.message = message;\n this.name = caller.name;\n}\nutil.inherits(HttpSignatureError, Error);\n\nfunction InvalidAlgorithmError(message) {\n HttpSignatureError.call(this, message, InvalidAlgorithmError);\n}\nutil.inherits(InvalidAlgorithmError, HttpSignatureError);\n\nfunction validateAlgorithm(algorithm) {\n var alg = algorithm.toLowerCase().split('-');\n\n if (alg.length !== 2) {\n throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +\n 'valid algorithm'));\n }\n\n if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {\n throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +\n 'are not supported'));\n }\n\n if (!HASH_ALGOS[alg[1]]) {\n throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +\n 'supported hash algorithm'));\n }\n\n return (alg);\n}\n\n///--- API\n\nmodule.exports = {\n\n HASH_ALGOS: HASH_ALGOS,\n PK_ALGOS: PK_ALGOS,\n\n HttpSignatureError: HttpSignatureError,\n InvalidAlgorithmError: InvalidAlgorithmError,\n\n validateAlgorithm: validateAlgorithm,\n\n /**\n * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.\n *\n * The intent of this module is to interoperate with OpenSSL only,\n * specifically the node crypto module's `verify` method.\n *\n * @param {String} key an OpenSSH public key.\n * @return {String} PEM encoded form of the RSA public key.\n * @throws {TypeError} on bad input.\n * @throws {Error} on invalid ssh key formatted data.\n */\n sshKeyToPEM: function sshKeyToPEM(key) {\n assert.string(key, 'ssh_key');\n\n var k = sshpk.parseKey(key, 'ssh');\n return (k.toString('pem'));\n },\n\n\n /**\n * Generates an OpenSSH fingerprint from an ssh public key.\n *\n * @param {String} key an OpenSSH public key.\n * @return {String} key fingerprint.\n * @throws {TypeError} on bad input.\n * @throws {Error} if what you passed doesn't look like an ssh public key.\n */\n fingerprint: function fingerprint(key) {\n assert.string(key, 'ssh_key');\n\n var k = sshpk.parseKey(key, 'ssh');\n return (k.fingerprint('md5').toString('hex'));\n },\n\n /**\n * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)\n *\n * The reverse of the above function.\n */\n pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {\n assert.equal('string', typeof (pem), 'typeof pem');\n\n var k = sshpk.parseKey(pem, 'pem');\n k.comment = comment;\n return (k.toString('ssh'));\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/http-signature/lib/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/http-signature/lib/verify.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/http-signature/lib/verify.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright 2015 Joyent, Inc.\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar sshpk = __webpack_require__(/*! sshpk */ \"./node_modules/sshpk/lib/index.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/http-signature/lib/utils.js\");\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\n///--- Exported API\n\nmodule.exports = {\n /**\n * Verify RSA/DSA signature against public key. You are expected to pass in\n * an object that was returned from `parse()`.\n *\n * @param {Object} parsedSignature the object you got from `parse`.\n * @param {String} pubkey RSA/DSA private key PEM.\n * @return {Boolean} true if valid, false otherwise.\n * @throws {TypeError} if you pass in bad arguments.\n * @throws {InvalidAlgorithmError}\n */\n verifySignature: function verifySignature(parsedSignature, pubkey) {\n assert.object(parsedSignature, 'parsedSignature');\n if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey))\n pubkey = sshpk.parseKey(pubkey);\n assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key');\n\n var alg = validateAlgorithm(parsedSignature.algorithm);\n if (alg[0] === 'hmac' || alg[0] !== pubkey.type)\n return (false);\n\n var v = pubkey.createVerify(alg[1]);\n v.update(parsedSignature.signingString);\n return (v.verify(parsedSignature.params.signature, 'base64'));\n },\n\n /**\n * Verify HMAC against shared secret. You are expected to pass in an object\n * that was returned from `parse()`.\n *\n * @param {Object} parsedSignature the object you got from `parse`.\n * @param {String} secret HMAC shared secret.\n * @return {Boolean} true if valid, false otherwise.\n * @throws {TypeError} if you pass in bad arguments.\n * @throws {InvalidAlgorithmError}\n */\n verifyHMAC: function verifyHMAC(parsedSignature, secret) {\n assert.object(parsedSignature, 'parsedHMAC');\n assert.string(secret, 'secret');\n\n var alg = validateAlgorithm(parsedSignature.algorithm);\n if (alg[0] !== 'hmac')\n return (false);\n\n var hashAlg = alg[1].toUpperCase();\n\n var hmac = crypto.createHmac(hashAlg, secret);\n hmac.update(parsedSignature.signingString);\n\n /*\n * Now double-hash to avoid leaking timing information - there's\n * no easy constant-time compare in JS, so we use this approach\n * instead. See for more info:\n * https://www.isecpartners.com/blog/2011/february/double-hmac-\n * verification.aspx\n */\n var h1 = crypto.createHmac(hashAlg, secret);\n h1.update(hmac.digest());\n h1 = h1.digest();\n var h2 = crypto.createHmac(hashAlg, secret);\n h2.update(new Buffer(parsedSignature.params.signature, 'base64'));\n h2 = h2.digest();\n\n /* Node 0.8 returns strings from .digest(). */\n if (typeof (h1) === 'string')\n return (h1 === h2);\n /* And node 0.10 lacks the .equals() method on Buffers. */\n if (Buffer.isBuffer(h1) && !h1.equals)\n return (h1.toString('binary') === h2.toString('binary'));\n\n return (h1.equals(h2));\n }\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/http-signature/lib/verify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/https-browserify/index.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/https-browserify/index.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var http = __webpack_require__(/*! http */ \"./node_modules/stream-http/index.js\")\nvar url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\n\nvar https = module.exports\n\nfor (var key in http) {\n if (http.hasOwnProperty(key)) https[key] = http[key]\n}\n\nhttps.request = function (params, cb) {\n params = validateParams(params)\n return http.request.call(this, params, cb)\n}\n\nhttps.get = function (params, cb) {\n params = validateParams(params)\n return http.get.call(this, params, cb)\n}\n\nfunction validateParams (params) {\n if (typeof params === 'string') {\n params = url.parse(params)\n }\n if (!params.protocol) {\n params.protocol = 'https:'\n }\n if (params.protocol !== 'https:') {\n throw new Error('Protocol \"' + params.protocol + '\" not supported. Expected \"https:\"')\n }\n return params\n}\n\n\n//# sourceURL=webpack:///./node_modules/https-browserify/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/hyperdiff/lib/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/hyperdiff/lib/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst cloneDeep = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/hyperdiff/node_modules/debug/src/browser.js\")('hyperdiff')\nconst pullAt = __webpack_require__(/*! lodash.pullat */ \"./node_modules/lodash.pullat/index.js\")\n\nconst isPresent = (itemIndex) => itemIndex !== -1\n\nfunction GET_INITIAL_STATE () {\n return { common: [], removed: [] }\n}\n\nfunction hasItemWithProps (collection, item, props) {\n return props.every(prop => item[prop] === collection[prop])\n}\n\nfunction indexOf (collection, item) {\n return collection.indexOf(item)\n}\n\nfunction findIndexWithProps (collection, item, props) {\n return collection.findIndex(function (origItem) {\n return hasItemWithProps(origItem, item, props)\n })\n}\n\nfunction determinateCollections (orig, dist) {\n return {first: orig, second: cloneDeep(dist)}\n}\n\nfunction determinateFindIndex (ids, props) {\n return props ? findIndexWithProps : indexOf\n}\n\nfunction hyperdiff (orig, dist, props) {\n const ids = props ? [].concat(props) : []\n const {first, second} = determinateCollections(orig, dist)\n const findIndex = determinateFindIndex(ids, props)\n\n debug('preconditions first=%j second=%j findIndex=%s', first, second, findIndex.name)\n\n const results = first.reduce(function (acc, item, index) {\n const itemIndex = findIndex(second, item, ids)\n const destination = isPresent(itemIndex) ? 'common' : 'removed'\n acc[destination].push(item)\n pullAt(second, itemIndex)\n debug('index=%s value=%s collection=%s', index, item, destination)\n return acc\n }, GET_INITIAL_STATE())\n\n results.added = second\n debug('added=%j removed=%j common%j', results.added, results.removed, results.common)\n return results\n}\n\nmodule.exports = hyperdiff\n\n\n//# sourceURL=webpack:///./node_modules/hyperdiff/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/hyperdiff/node_modules/debug/src/browser.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/hyperdiff/node_modules/debug/src/browser.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/hyperdiff/node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',\n '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',\n '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',\n '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',\n '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',\n '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',\n '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',\n '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',\n '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',\n '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',\n '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // Internet Explorer and Edge do not support colors.\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/hyperdiff/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/hyperdiff/node_modules/debug/src/debug.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/hyperdiff/node_modules/debug/src/debug.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/hyperdiff/node_modules/ms/index.js\");\n\n/**\n * Active `debug` instances.\n */\nexports.instances = [];\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n var prevTime;\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n exports.instances.push(debug);\n\n return debug;\n}\n\nfunction destroy () {\n var index = exports.instances.indexOf(this);\n if (index !== -1) {\n exports.instances.splice(index, 1);\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < exports.instances.length; i++) {\n var instance = exports.instances[i];\n instance.enabled = exports.enabled(instance.namespace);\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/hyperdiff/node_modules/debug/src/debug.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/hyperdiff/node_modules/ms/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/hyperdiff/node_modules/ms/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/hyperdiff/node_modules/ms/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/idb/build/idb.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/idb/build/idb.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("(function (global, factory) {\n true ? factory(exports) :\n undefined;\n}(this, function (exports) { 'use strict';\n\n function toArray(arr) {\n return Array.prototype.slice.call(arr);\n }\n\n function promisifyRequest(request) {\n return new Promise(function(resolve, reject) {\n request.onsuccess = function() {\n resolve(request.result);\n };\n\n request.onerror = function() {\n reject(request.error);\n };\n });\n }\n\n function promisifyRequestCall(obj, method, args) {\n var request;\n var p = new Promise(function(resolve, reject) {\n request = obj[method].apply(obj, args);\n promisifyRequest(request).then(resolve, reject);\n });\n\n p.request = request;\n return p;\n }\n\n function promisifyCursorRequestCall(obj, method, args) {\n var p = promisifyRequestCall(obj, method, args);\n return p.then(function(value) {\n if (!value) return;\n return new Cursor(value, p.request);\n });\n }\n\n function proxyProperties(ProxyClass, targetProp, properties) {\n properties.forEach(function(prop) {\n Object.defineProperty(ProxyClass.prototype, prop, {\n get: function() {\n return this[targetProp][prop];\n },\n set: function(val) {\n this[targetProp][prop] = val;\n }\n });\n });\n }\n\n function proxyRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyRequestCall(this[targetProp], prop, arguments);\n };\n });\n }\n\n function proxyMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return this[targetProp][prop].apply(this[targetProp], arguments);\n };\n });\n }\n\n function proxyCursorRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyCursorRequestCall(this[targetProp], prop, arguments);\n };\n });\n }\n\n function Index(index) {\n this._index = index;\n }\n\n proxyProperties(Index, '_index', [\n 'name',\n 'keyPath',\n 'multiEntry',\n 'unique'\n ]);\n\n proxyRequestMethods(Index, '_index', IDBIndex, [\n 'get',\n 'getKey',\n 'getAll',\n 'getAllKeys',\n 'count'\n ]);\n\n proxyCursorRequestMethods(Index, '_index', IDBIndex, [\n 'openCursor',\n 'openKeyCursor'\n ]);\n\n function Cursor(cursor, request) {\n this._cursor = cursor;\n this._request = request;\n }\n\n proxyProperties(Cursor, '_cursor', [\n 'direction',\n 'key',\n 'primaryKey',\n 'value'\n ]);\n\n proxyRequestMethods(Cursor, '_cursor', IDBCursor, [\n 'update',\n 'delete'\n ]);\n\n // proxy 'next' methods\n ['advance', 'continue', 'continuePrimaryKey'].forEach(function(methodName) {\n if (!(methodName in IDBCursor.prototype)) return;\n Cursor.prototype[methodName] = function() {\n var cursor = this;\n var args = arguments;\n return Promise.resolve().then(function() {\n cursor._cursor[methodName].apply(cursor._cursor, args);\n return promisifyRequest(cursor._request).then(function(value) {\n if (!value) return;\n return new Cursor(value, cursor._request);\n });\n });\n };\n });\n\n function ObjectStore(store) {\n this._store = store;\n }\n\n ObjectStore.prototype.createIndex = function() {\n return new Index(this._store.createIndex.apply(this._store, arguments));\n };\n\n ObjectStore.prototype.index = function() {\n return new Index(this._store.index.apply(this._store, arguments));\n };\n\n proxyProperties(ObjectStore, '_store', [\n 'name',\n 'keyPath',\n 'indexNames',\n 'autoIncrement'\n ]);\n\n proxyRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'put',\n 'add',\n 'delete',\n 'clear',\n 'get',\n 'getAll',\n 'getKey',\n 'getAllKeys',\n 'count'\n ]);\n\n proxyCursorRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'openCursor',\n 'openKeyCursor'\n ]);\n\n proxyMethods(ObjectStore, '_store', IDBObjectStore, [\n 'deleteIndex'\n ]);\n\n function Transaction(idbTransaction) {\n this._tx = idbTransaction;\n this.complete = new Promise(function(resolve, reject) {\n idbTransaction.oncomplete = function() {\n resolve();\n };\n idbTransaction.onerror = function() {\n reject(idbTransaction.error);\n };\n idbTransaction.onabort = function() {\n reject(idbTransaction.error);\n };\n });\n }\n\n Transaction.prototype.objectStore = function() {\n return new ObjectStore(this._tx.objectStore.apply(this._tx, arguments));\n };\n\n proxyProperties(Transaction, '_tx', [\n 'objectStoreNames',\n 'mode'\n ]);\n\n proxyMethods(Transaction, '_tx', IDBTransaction, [\n 'abort'\n ]);\n\n function UpgradeDB(db, oldVersion, transaction) {\n this._db = db;\n this.oldVersion = oldVersion;\n this.transaction = new Transaction(transaction);\n }\n\n UpgradeDB.prototype.createObjectStore = function() {\n return new ObjectStore(this._db.createObjectStore.apply(this._db, arguments));\n };\n\n proxyProperties(UpgradeDB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n ]);\n\n proxyMethods(UpgradeDB, '_db', IDBDatabase, [\n 'deleteObjectStore',\n 'close'\n ]);\n\n function DB(db) {\n this._db = db;\n }\n\n DB.prototype.transaction = function() {\n return new Transaction(this._db.transaction.apply(this._db, arguments));\n };\n\n proxyProperties(DB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n ]);\n\n proxyMethods(DB, '_db', IDBDatabase, [\n 'close'\n ]);\n\n // Add cursor iterators\n // TODO: remove this once browsers do the right thing with promises\n ['openCursor', 'openKeyCursor'].forEach(function(funcName) {\n [ObjectStore, Index].forEach(function(Constructor) {\n // Don't create iterateKeyCursor if openKeyCursor doesn't exist.\n if (!(funcName in Constructor.prototype)) return;\n\n Constructor.prototype[funcName.replace('open', 'iterate')] = function() {\n var args = toArray(arguments);\n var callback = args[args.length - 1];\n var nativeObject = this._store || this._index;\n var request = nativeObject[funcName].apply(nativeObject, args.slice(0, -1));\n request.onsuccess = function() {\n callback(request.result);\n };\n };\n });\n });\n\n // polyfill getAll\n [Index, ObjectStore].forEach(function(Constructor) {\n if (Constructor.prototype.getAll) return;\n Constructor.prototype.getAll = function(query, count) {\n var instance = this;\n var items = [];\n\n return new Promise(function(resolve) {\n instance.iterateCursor(query, function(cursor) {\n if (!cursor) {\n resolve(items);\n return;\n }\n items.push(cursor.value);\n\n if (count !== undefined && items.length == count) {\n resolve(items);\n return;\n }\n cursor.continue();\n });\n });\n };\n });\n\n function openDb(name, version, upgradeCallback) {\n var p = promisifyRequestCall(indexedDB, 'open', [name, version]);\n var request = p.request;\n\n if (request) {\n request.onupgradeneeded = function(event) {\n if (upgradeCallback) {\n upgradeCallback(new UpgradeDB(request.result, event.oldVersion, request.transaction));\n }\n };\n }\n\n return p.then(function(db) {\n return new DB(db);\n });\n }\n\n function deleteDb(name) {\n return promisifyRequestCall(indexedDB, 'deleteDatabase', [name]);\n }\n\n exports.openDb = openDb;\n exports.deleteDb = deleteDb;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n\n\n//# sourceURL=webpack:///./node_modules/idb/build/idb.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ieee754/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ieee754/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack:///./node_modules/ieee754/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/immediate-chunk-store/index.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/immediate-chunk-store/index.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {class ImmediateStore {\n constructor (store) {\n this.store = store\n this.chunkLength = store.chunkLength\n\n if (!this.store || !this.store.get || !this.store.put) {\n throw new Error('First argument must be abstract-chunk-store compliant')\n }\n\n this.mem = []\n }\n\n put (index, buf, cb) {\n this.mem[index] = buf\n this.store.put(index, buf, err => {\n this.mem[index] = null\n if (cb) cb(err)\n })\n }\n\n get (index, opts, cb) {\n if (typeof opts === 'function') return this.get(index, null, opts)\n\n const start = (opts && opts.offset) || 0\n const end = opts && opts.length && (start + opts.length)\n\n const buf = this.mem[index]\n if (buf) return nextTick(cb, null, opts ? buf.slice(start, end) : buf)\n\n this.store.get(index, opts, cb)\n }\n\n close (cb) {\n this.store.close(cb)\n }\n\n destroy (cb) {\n this.store.destroy(cb)\n }\n}\n\nfunction nextTick (cb, err, val) {\n process.nextTick(() => {\n if (cb) cb(err, val)\n })\n}\n\nmodule.exports = ImmediateStore\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/immediate-chunk-store/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/inherits/inherits_browser.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/inherits/inherits_browser.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/inherits/inherits_browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ip-regex/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ip-regex/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}';\n\nconst v6seg = '[0-9a-fA-F]{1,4}';\nconst v6 = `\n(\n(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(%[0-9a-zA-Z]{1,})? // %eth0 %1\n`.replace(/\\s*\\/\\/.*$/gm, '').replace(/\\n/g, '').trim();\n\nconst ip = module.exports = opts => opts && opts.exact ?\n\tnew RegExp(`(?:^${v4}$)|(?:^${v6}$)`) :\n\tnew RegExp(`(?:${v4})|(?:${v6})`, 'g');\n\nip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g');\nip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g');\n\n\n//# sourceURL=webpack:///./node_modules/ip-regex/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ip/lib/ip.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ip/lib/ip.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar ip = exports;\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\nvar os = __webpack_require__(/*! os */ \"./node_modules/os-browserify/browser.js\");\n\nip.toBuffer = function(ip, buff, offset) {\n offset = ~~offset;\n\n var result;\n\n if (this.isV4Format(ip)) {\n result = buff || new Buffer(offset + 4);\n ip.split(/\\./g).map(function(byte) {\n result[offset++] = parseInt(byte, 10) & 0xff;\n });\n } else if (this.isV6Format(ip)) {\n var sections = ip.split(':', 8);\n\n var i;\n for (i = 0; i < sections.length; i++) {\n var isv4 = this.isV4Format(sections[i]);\n var v4Buffer;\n\n if (isv4) {\n v4Buffer = this.toBuffer(sections[i]);\n sections[i] = v4Buffer.slice(0, 2).toString('hex');\n }\n\n if (v4Buffer && ++i < 8) {\n sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex'));\n }\n }\n\n if (sections[0] === '') {\n while (sections.length < 8) sections.unshift('0');\n } else if (sections[sections.length - 1] === '') {\n while (sections.length < 8) sections.push('0');\n } else if (sections.length < 8) {\n for (i = 0; i < sections.length && sections[i] !== ''; i++);\n var argv = [ i, 1 ];\n for (i = 9 - sections.length; i > 0; i--) {\n argv.push('0');\n }\n sections.splice.apply(sections, argv);\n }\n\n result = buff || new Buffer(offset + 16);\n for (i = 0; i < sections.length; i++) {\n var word = parseInt(sections[i], 16);\n result[offset++] = (word >> 8) & 0xff;\n result[offset++] = word & 0xff;\n }\n }\n\n if (!result) {\n throw Error('Invalid ip address: ' + ip);\n }\n\n return result;\n};\n\nip.toString = function(buff, offset, length) {\n offset = ~~offset;\n length = length || (buff.length - offset);\n\n var result = [];\n if (length === 4) {\n // IPv4\n for (var i = 0; i < length; i++) {\n result.push(buff[offset + i]);\n }\n result = result.join('.');\n } else if (length === 16) {\n // IPv6\n for (var i = 0; i < length; i += 2) {\n result.push(buff.readUInt16BE(offset + i).toString(16));\n }\n result = result.join(':');\n result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3');\n result = result.replace(/:{3,4}/, '::');\n }\n\n return result;\n};\n\nvar ipv4Regex = /^(\\d{1,3}\\.){3,3}\\d{1,3}$/;\nvar ipv6Regex =\n /^(::)?(((\\d{1,3}\\.){3}(\\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;\n\nip.isV4Format = function(ip) {\n return ipv4Regex.test(ip);\n};\n\nip.isV6Format = function(ip) {\n return ipv6Regex.test(ip);\n};\nfunction _normalizeFamily(family) {\n return family ? family.toLowerCase() : 'ipv4';\n}\n\nip.fromPrefixLen = function(prefixlen, family) {\n if (prefixlen > 32) {\n family = 'ipv6';\n } else {\n family = _normalizeFamily(family);\n }\n\n var len = 4;\n if (family === 'ipv6') {\n len = 16;\n }\n var buff = new Buffer(len);\n\n for (var i = 0, n = buff.length; i < n; ++i) {\n var bits = 8;\n if (prefixlen < 8) {\n bits = prefixlen;\n }\n prefixlen -= bits;\n\n buff[i] = ~(0xff >> bits) & 0xff;\n }\n\n return ip.toString(buff);\n};\n\nip.mask = function(addr, mask) {\n addr = ip.toBuffer(addr);\n mask = ip.toBuffer(mask);\n\n var result = new Buffer(Math.max(addr.length, mask.length));\n\n var i = 0;\n // Same protocol - do bitwise and\n if (addr.length === mask.length) {\n for (i = 0; i < addr.length; i++) {\n result[i] = addr[i] & mask[i];\n }\n } else if (mask.length === 4) {\n // IPv6 address and IPv4 mask\n // (Mask low bits)\n for (i = 0; i < mask.length; i++) {\n result[i] = addr[addr.length - 4 + i] & mask[i];\n }\n } else {\n // IPv6 mask and IPv4 addr\n for (var i = 0; i < result.length - 6; i++) {\n result[i] = 0;\n }\n\n // ::ffff:ipv4\n result[10] = 0xff;\n result[11] = 0xff;\n for (i = 0; i < addr.length; i++) {\n result[i + 12] = addr[i] & mask[i + 12];\n }\n i = i + 12;\n }\n for (; i < result.length; i++)\n result[i] = 0;\n\n return ip.toString(result);\n};\n\nip.cidr = function(cidrString) {\n var cidrParts = cidrString.split('/');\n\n var addr = cidrParts[0];\n if (cidrParts.length !== 2)\n throw new Error('invalid CIDR subnet: ' + addr);\n\n var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));\n\n return ip.mask(addr, mask);\n};\n\nip.subnet = function(addr, mask) {\n var networkAddress = ip.toLong(ip.mask(addr, mask));\n\n // Calculate the mask's length.\n var maskBuffer = ip.toBuffer(mask);\n var maskLength = 0;\n\n for (var i = 0; i < maskBuffer.length; i++) {\n if (maskBuffer[i] === 0xff) {\n maskLength += 8;\n } else {\n var octet = maskBuffer[i] & 0xff;\n while (octet) {\n octet = (octet << 1) & 0xff;\n maskLength++;\n }\n }\n }\n\n var numberOfAddresses = Math.pow(2, 32 - maskLength);\n\n return {\n networkAddress: ip.fromLong(networkAddress),\n firstAddress: numberOfAddresses <= 2 ?\n ip.fromLong(networkAddress) :\n ip.fromLong(networkAddress + 1),\n lastAddress: numberOfAddresses <= 2 ?\n ip.fromLong(networkAddress + numberOfAddresses - 1) :\n ip.fromLong(networkAddress + numberOfAddresses - 2),\n broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1),\n subnetMask: mask,\n subnetMaskLength: maskLength,\n numHosts: numberOfAddresses <= 2 ?\n numberOfAddresses : numberOfAddresses - 2,\n length: numberOfAddresses,\n contains: function(other) {\n return networkAddress === ip.toLong(ip.mask(other, mask));\n }\n };\n};\n\nip.cidrSubnet = function(cidrString) {\n var cidrParts = cidrString.split('/');\n\n var addr = cidrParts[0];\n if (cidrParts.length !== 2)\n throw new Error('invalid CIDR subnet: ' + addr);\n\n var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));\n\n return ip.subnet(addr, mask);\n};\n\nip.not = function(addr) {\n var buff = ip.toBuffer(addr);\n for (var i = 0; i < buff.length; i++) {\n buff[i] = 0xff ^ buff[i];\n }\n return ip.toString(buff);\n};\n\nip.or = function(a, b) {\n a = ip.toBuffer(a);\n b = ip.toBuffer(b);\n\n // same protocol\n if (a.length === b.length) {\n for (var i = 0; i < a.length; ++i) {\n a[i] |= b[i];\n }\n return ip.toString(a);\n\n // mixed protocols\n } else {\n var buff = a;\n var other = b;\n if (b.length > a.length) {\n buff = b;\n other = a;\n }\n\n var offset = buff.length - other.length;\n for (var i = offset; i < buff.length; ++i) {\n buff[i] |= other[i - offset];\n }\n\n return ip.toString(buff);\n }\n};\n\nip.isEqual = function(a, b) {\n a = ip.toBuffer(a);\n b = ip.toBuffer(b);\n\n // Same protocol\n if (a.length === b.length) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n\n // Swap\n if (b.length === 4) {\n var t = b;\n b = a;\n a = t;\n }\n\n // a - IPv4, b - IPv6\n for (var i = 0; i < 10; i++) {\n if (b[i] !== 0) return false;\n }\n\n var word = b.readUInt16BE(10);\n if (word !== 0 && word !== 0xffff) return false;\n\n for (var i = 0; i < 4; i++) {\n if (a[i] !== b[i + 12]) return false;\n }\n\n return true;\n};\n\nip.isPrivate = function(addr) {\n return /^(::f{4}:)?10\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/i\n .test(addr) ||\n /^(::f{4}:)?192\\.168\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) ||\n /^(::f{4}:)?172\\.(1[6-9]|2\\d|30|31)\\.([0-9]{1,3})\\.([0-9]{1,3})$/i\n .test(addr) ||\n /^(::f{4}:)?127\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) ||\n /^(::f{4}:)?169\\.254\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) ||\n /^f[cd][0-9a-f]{2}:/i.test(addr) ||\n /^fe80:/i.test(addr) ||\n /^::1$/.test(addr) ||\n /^::$/.test(addr);\n};\n\nip.isPublic = function(addr) {\n return !ip.isPrivate(addr);\n};\n\nip.isLoopback = function(addr) {\n return /^(::f{4}:)?127\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})/\n .test(addr) ||\n /^fe80::1$/.test(addr) ||\n /^::1$/.test(addr) ||\n /^::$/.test(addr);\n};\n\nip.loopback = function(family) {\n //\n // Default to `ipv4`\n //\n family = _normalizeFamily(family);\n\n if (family !== 'ipv4' && family !== 'ipv6') {\n throw new Error('family must be ipv4 or ipv6');\n }\n\n return family === 'ipv4' ? '127.0.0.1' : 'fe80::1';\n};\n\n//\n// ### function address (name, family)\n// #### @name {string|'public'|'private'} **Optional** Name or security\n// of the network interface.\n// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults\n// to ipv4).\n//\n// Returns the address for the network interface on the current system with\n// the specified `name`:\n// * String: First `family` address of the interface.\n// If not found see `undefined`.\n// * 'public': the first public ip address of family.\n// * 'private': the first private ip address of family.\n// * undefined: First address with `ipv4` or loopback address `127.0.0.1`.\n//\nip.address = function(name, family) {\n var interfaces = os.networkInterfaces();\n var all;\n\n //\n // Default to `ipv4`\n //\n family = _normalizeFamily(family);\n\n //\n // If a specific network interface has been named,\n // return the address.\n //\n if (name && name !== 'private' && name !== 'public') {\n var res = interfaces[name].filter(function(details) {\n var itemFamily = details.family.toLowerCase();\n return itemFamily === family;\n });\n if (res.length === 0)\n return undefined;\n return res[0].address;\n }\n\n var all = Object.keys(interfaces).map(function (nic) {\n //\n // Note: name will only be `public` or `private`\n // when this is called.\n //\n var addresses = interfaces[nic].filter(function (details) {\n details.family = details.family.toLowerCase();\n if (details.family !== family || ip.isLoopback(details.address)) {\n return false;\n } else if (!name) {\n return true;\n }\n\n return name === 'public' ? ip.isPrivate(details.address) :\n ip.isPublic(details.address);\n });\n\n return addresses.length ? addresses[0].address : undefined;\n }).filter(Boolean);\n\n return !all.length ? ip.loopback(family) : all[0];\n};\n\nip.toLong = function(ip) {\n var ipl = 0;\n ip.split('.').forEach(function(octet) {\n ipl <<= 8;\n ipl += parseInt(octet);\n });\n return(ipl >>> 0);\n};\n\nip.fromLong = function(ipl) {\n return ((ipl >>> 24) + '.' +\n (ipl >> 16 & 255) + '.' +\n (ipl >> 8 & 255) + '.' +\n (ipl & 255) );\n};\n\n\n//# sourceURL=webpack:///./node_modules/ip/lib/ip.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-block/src/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ipfs-block/src/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst withIs = __webpack_require__(/*! class-is */ \"./node_modules/class-is/index.js\")\n\n/**\n * Represents an immutable block of data that is uniquely referenced with a cid.\n *\n * @constructor\n * @param {Buffer} data - The data to be stored in the block as a buffer.\n * @param {CID} cid - The cid of the data\n *\n * @example\n * const block = new Block(new Buffer('a012d83b20f9371...'))\n */\nclass Block {\n constructor (data, cid) {\n if (!data || !Buffer.isBuffer(data)) {\n throw new Error('first argument must be a buffer')\n }\n\n if (!cid || !CID.isCID(cid)) {\n throw new Error('second argument must be a CID')\n }\n\n this._data = data\n this._cid = cid\n }\n\n /**\n * The data of this block.\n *\n * @type {Buffer}\n */\n get data () {\n return this._data\n }\n\n set data (val) {\n throw new Error('Tried to change an immutable block')\n }\n\n /**\n * The cid of the data this block represents.\n *\n * @type {CID}\n */\n get cid () {\n return this._cid\n }\n\n set cid (val) {\n throw new Error('Tried to change an immutable block')\n }\n}\n\nmodule.exports = withIs(Block, { className: 'Block', symbolName: '@ipfs/js-ipfs-block/block' })\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-block/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js":
|
||
/*!******************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js ***!
|
||
\******************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalObject) {\r\n 'use strict';\r\n\r\n/*\r\n * bignumber.js v9.0.0\r\n * A JavaScript library for arbitrary-precision arithmetic.\r\n * https://github.com/MikeMcl/bignumber.js\r\n * Copyright (c) 2019 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Licensed.\r\n *\r\n * BigNumber.prototype methods | BigNumber methods\r\n * |\r\n * absoluteValue abs | clone\r\n * comparedTo | config set\r\n * decimalPlaces dp | DECIMAL_PLACES\r\n * dividedBy div | ROUNDING_MODE\r\n * dividedToIntegerBy idiv | EXPONENTIAL_AT\r\n * exponentiatedBy pow | RANGE\r\n * integerValue | CRYPTO\r\n * isEqualTo eq | MODULO_MODE\r\n * isFinite | POW_PRECISION\r\n * isGreaterThan gt | FORMAT\r\n * isGreaterThanOrEqualTo gte | ALPHABET\r\n * isInteger | isBigNumber\r\n * isLessThan lt | maximum max\r\n * isLessThanOrEqualTo lte | minimum min\r\n * isNaN | random\r\n * isNegative | sum\r\n * isPositive |\r\n * isZero |\r\n * minus |\r\n * modulo mod |\r\n * multipliedBy times |\r\n * negated |\r\n * plus |\r\n * precision sd |\r\n * shiftedBy |\r\n * squareRoot sqrt |\r\n * toExponential |\r\n * toFixed |\r\n * toFormat |\r\n * toFraction |\r\n * toJSON |\r\n * toNumber |\r\n * toPrecision |\r\n * toString |\r\n * valueOf |\r\n *\r\n */\r\n\r\n\r\n var BigNumber,\r\n isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n mathceil = Math.ceil,\r\n mathfloor = Math.floor,\r\n\r\n bignumberError = '[BigNumber Error] ',\r\n tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n BASE = 1e14,\r\n LOG_BASE = 14,\r\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\r\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\r\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n SQRT_BASE = 1e7,\r\n\r\n // EDITABLE\r\n // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n MAX = 1E9; // 0 to MAX_INT32\r\n\r\n\r\n /*\r\n * Create and return a BigNumber constructor.\r\n */\r\n function clone(configObject) {\r\n var div, convertBase, parseNumeric,\r\n P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r\n ONE = new BigNumber(1),\r\n\r\n\r\n //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n // The default values below must be integers within the inclusive ranges stated.\r\n // The values can also be changed at run-time using BigNumber.set.\r\n\r\n // The maximum number of decimal places for operations involving division.\r\n DECIMAL_PLACES = 20, // 0 to MAX\r\n\r\n // The rounding mode used when rounding to the above decimal places, and when using\r\n // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n // UP 0 Away from zero.\r\n // DOWN 1 Towards zero.\r\n // CEIL 2 Towards +Infinity.\r\n // FLOOR 3 Towards -Infinity.\r\n // HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n ROUNDING_MODE = 4, // 0 to 8\r\n\r\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n // The exponent value at and beneath which toString returns exponential notation.\r\n // Number type: -7\r\n TO_EXP_NEG = -7, // 0 to -MAX\r\n\r\n // The exponent value at and above which toString returns exponential notation.\r\n // Number type: 21\r\n TO_EXP_POS = 21, // 0 to MAX\r\n\r\n // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // Number type: -324 (5e-324)\r\n MIN_EXP = -1e7, // -1 to -MAX\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // Number type: 308 (1.7976931348623157e+308)\r\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n MAX_EXP = 1e7, // 1 to MAX\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n CRYPTO = false, // true or false\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend.\r\n // This modulo mode is commonly known as 'truncated division' and is\r\n // equivalent to (a % n) in JavaScript.\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n // The remainder is always positive.\r\n //\r\n // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n // modes are commonly used for the modulus operation.\r\n // Although the other rounding modes can also be used, they may not give useful results.\r\n MODULO_MODE = 1, // 0 to 9\r\n\r\n // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n POW_PRECISION = 0, // 0 to MAX\r\n\r\n // The format specification used by the BigNumber.prototype.toFormat method.\r\n FORMAT = {\r\n prefix: '',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n groupSeparator: ',',\r\n decimalSeparator: '.',\r\n fractionGroupSize: 0,\r\n fractionGroupSeparator: '\\xA0', // non-breaking space\r\n suffix: ''\r\n },\r\n\r\n // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r\n // '-', '.', whitespace, or repeated character.\r\n // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz';\r\n\r\n\r\n //------------------------------------------------------------------------------------------\r\n\r\n\r\n // CONSTRUCTOR\r\n\r\n\r\n /*\r\n * The BigNumber constructor and exported function.\r\n * Create and return a new instance of a BigNumber object.\r\n *\r\n * v {number|string|BigNumber} A numeric value.\r\n * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r\n */\r\n function BigNumber(v, b) {\r\n var alphabet, c, caseChanged, e, i, isNum, len, str,\r\n x = this;\r\n\r\n // Enable constructor call without `new`.\r\n if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r\n\r\n if (b == null) {\r\n\r\n if (v && v._isBigNumber === true) {\r\n x.s = v.s;\r\n\r\n if (!v.c || v.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else if (v.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = v.e;\r\n x.c = v.c.slice();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if ((isNum = typeof v == 'number') && v * 0 == 0) {\r\n\r\n // Use `1 / n` to handle minus zero also.\r\n x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r\n\r\n // Fast path for integers, where n < 2147483648 (2**31).\r\n if (v === ~~v) {\r\n for (e = 0, i = v; i >= 10; i /= 10, e++);\r\n\r\n if (e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else {\r\n x.e = e;\r\n x.c = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n str = String(v);\r\n } else {\r\n\r\n if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r\n\r\n x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n\r\n // Allow exponential notation to be used with base 10 argument, while\r\n // also rounding to DECIMAL_PLACES as with other bases.\r\n if (b == 10) {\r\n x = new BigNumber(v);\r\n return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r\n }\r\n\r\n str = String(v);\r\n\r\n if (isNum = typeof v == 'number') {\r\n\r\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r\n\r\n x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (BigNumber.DEBUG && str.replace(/^0\\.0*|\\./, '').length > 15) {\r\n throw Error\r\n (tooManyDigits + v);\r\n }\r\n } else {\r\n x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n alphabet = ALPHABET.slice(0, b);\r\n e = i = 0;\r\n\r\n // Check that str is a valid base b number.\r\n // Don't use RegExp, so alphabet can contain special characters.\r\n for (len = str.length; i < len; i++) {\r\n if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r\n if (c == '.') {\r\n\r\n // If '.' is not the first character and it has not be found before.\r\n if (i > e) {\r\n e = len;\r\n continue;\r\n }\r\n } else if (!caseChanged) {\r\n\r\n // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r\n str == str.toLowerCase() && (str = str.toUpperCase())) {\r\n caseChanged = true;\r\n i = -1;\r\n e = 0;\r\n continue;\r\n }\r\n }\r\n\r\n return parseNumeric(x, String(v), isNum, b);\r\n }\r\n }\r\n\r\n // Prevent later check for length on converted number.\r\n isNum = false;\r\n str = convertBase(str, b, 10, x.s);\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n else e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(--len) === 48;);\r\n\r\n if (str = str.slice(i, ++len)) {\r\n len -= i;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (isNum && BigNumber.DEBUG &&\r\n len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r\n throw Error\r\n (tooManyDigits + (x.s * v));\r\n }\r\n\r\n // Overflow?\r\n if ((e = e - i - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n x.c = x.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = e;\r\n x.c = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first element of the coefficient array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE; // i < 1\r\n\r\n if (i < len) {\r\n if (i) x.c.push(+str.slice(0, i));\r\n\r\n for (len -= LOG_BASE; i < len;) {\r\n x.c.push(+str.slice(i, i += LOG_BASE));\r\n }\r\n\r\n i = LOG_BASE - (str = str.slice(i)).length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--; str += '0');\r\n x.c.push(+str);\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n\r\n // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n BigNumber.clone = clone;\r\n\r\n BigNumber.ROUND_UP = 0;\r\n BigNumber.ROUND_DOWN = 1;\r\n BigNumber.ROUND_CEIL = 2;\r\n BigNumber.ROUND_FLOOR = 3;\r\n BigNumber.ROUND_HALF_UP = 4;\r\n BigNumber.ROUND_HALF_DOWN = 5;\r\n BigNumber.ROUND_HALF_EVEN = 6;\r\n BigNumber.ROUND_HALF_CEIL = 7;\r\n BigNumber.ROUND_HALF_FLOOR = 8;\r\n BigNumber.EUCLID = 9;\r\n\r\n\r\n /*\r\n * Configure infrequently-changing library-wide settings.\r\n *\r\n * Accept an object with the following optional properties (if the value of a property is\r\n * a number, it must be an integer within the inclusive range stated):\r\n *\r\n * DECIMAL_PLACES {number} 0 to MAX\r\n * ROUNDING_MODE {number} 0 to 8\r\n * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]\r\n * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]\r\n * CRYPTO {boolean} true or false\r\n * MODULO_MODE {number} 0 to 9\r\n * POW_PRECISION {number} 0 to MAX\r\n * ALPHABET {string} A string of two or more unique characters which does\r\n * not contain '.'.\r\n * FORMAT {object} An object with some of the following properties:\r\n * prefix {string}\r\n * groupSize {number}\r\n * secondaryGroupSize {number}\r\n * groupSeparator {string}\r\n * decimalSeparator {string}\r\n * fractionGroupSize {number}\r\n * fractionGroupSeparator {string}\r\n * suffix {string}\r\n *\r\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n *\r\n * E.g.\r\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n *\r\n * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n *\r\n * Return an object with the properties current values.\r\n */\r\n BigNumber.config = BigNumber.set = function (obj) {\r\n var p, v;\r\n\r\n if (obj != null) {\r\n\r\n if (typeof obj == 'object') {\r\n\r\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n DECIMAL_PLACES = v;\r\n }\r\n\r\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 8, p);\r\n ROUNDING_MODE = v;\r\n }\r\n\r\n // EXPONENTIAL_AT {number|number[]}\r\n // Integer, -MAX to MAX inclusive or\r\n // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, 0, p);\r\n intCheck(v[1], 0, MAX, p);\r\n TO_EXP_NEG = v[0];\r\n TO_EXP_POS = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r\n }\r\n }\r\n\r\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n if (obj.hasOwnProperty(p = 'RANGE')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, -1, p);\r\n intCheck(v[1], 1, MAX, p);\r\n MIN_EXP = v[0];\r\n MAX_EXP = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n if (v) {\r\n MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' cannot be zero: ' + v);\r\n }\r\n }\r\n }\r\n\r\n // CRYPTO {boolean} true or false.\r\n // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n // '[BigNumber Error] crypto unavailable'\r\n if (obj.hasOwnProperty(p = 'CRYPTO')) {\r\n v = obj[p];\r\n if (v === !!v) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n CRYPTO = v;\r\n } else {\r\n CRYPTO = !v;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n } else {\r\n CRYPTO = v;\r\n }\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' not true or false: ' + v);\r\n }\r\n }\r\n\r\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 9, p);\r\n MODULO_MODE = v;\r\n }\r\n\r\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n POW_PRECISION = v;\r\n }\r\n\r\n // FORMAT {object}\r\n // '[BigNumber Error] FORMAT not an object: {v}'\r\n if (obj.hasOwnProperty(p = 'FORMAT')) {\r\n v = obj[p];\r\n if (typeof v == 'object') FORMAT = v;\r\n else throw Error\r\n (bignumberError + p + ' not an object: ' + v);\r\n }\r\n\r\n // ALPHABET {string}\r\n // '[BigNumber Error] ALPHABET invalid: {v}'\r\n if (obj.hasOwnProperty(p = 'ALPHABET')) {\r\n v = obj[p];\r\n\r\n // Disallow if only one character,\r\n // or if it contains '+', '-', '.', whitespace, or a repeated character.\r\n if (typeof v == 'string' && !/^.$|[+-.\\s]|(.).*\\1/.test(v)) {\r\n ALPHABET = v;\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' invalid: ' + v);\r\n }\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Object expected: {v}'\r\n throw Error\r\n (bignumberError + 'Object expected: ' + obj);\r\n }\r\n }\r\n\r\n return {\r\n DECIMAL_PLACES: DECIMAL_PLACES,\r\n ROUNDING_MODE: ROUNDING_MODE,\r\n EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r\n RANGE: [MIN_EXP, MAX_EXP],\r\n CRYPTO: CRYPTO,\r\n MODULO_MODE: MODULO_MODE,\r\n POW_PRECISION: POW_PRECISION,\r\n FORMAT: FORMAT,\r\n ALPHABET: ALPHABET\r\n };\r\n };\r\n\r\n\r\n /*\r\n * Return true if v is a BigNumber instance, otherwise return false.\r\n *\r\n * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r\n *\r\n * v {any}\r\n *\r\n * '[BigNumber Error] Invalid BigNumber: {v}'\r\n */\r\n BigNumber.isBigNumber = function (v) {\r\n if (!v || v._isBigNumber !== true) return false;\r\n if (!BigNumber.DEBUG) return true;\r\n\r\n var i, n,\r\n c = v.c,\r\n e = v.e,\r\n s = v.s;\r\n\r\n out: if ({}.toString.call(c) == '[object Array]') {\r\n\r\n if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r\n\r\n // If the first element is zero, the BigNumber value must be zero.\r\n if (c[0] === 0) {\r\n if (e === 0 && c.length === 1) return true;\r\n break out;\r\n }\r\n\r\n // Calculate number of digits that c[0] should have, based on the exponent.\r\n i = (e + 1) % LOG_BASE;\r\n if (i < 1) i += LOG_BASE;\r\n\r\n // Calculate number of digits of c[0].\r\n //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r\n if (String(c[0]).length == i) {\r\n\r\n for (i = 0; i < c.length; i++) {\r\n n = c[i];\r\n if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r\n }\r\n\r\n // Last element cannot be zero, unless it is the only element.\r\n if (n !== 0) return true;\r\n }\r\n }\r\n\r\n // Infinity/NaN\r\n } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r\n return true;\r\n }\r\n\r\n throw Error\r\n (bignumberError + 'Invalid BigNumber: ' + v);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.maximum = BigNumber.max = function () {\r\n return maxOrMin(arguments, P.lt);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.minimum = BigNumber.min = function () {\r\n return maxOrMin(arguments, P.gt);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n * zeros are produced).\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n * '[BigNumber Error] crypto unavailable'\r\n */\r\n BigNumber.random = (function () {\r\n var pow2_53 = 0x20000000000000;\r\n\r\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n // Check if Math.random() produces more than 32 bits of randomness.\r\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n ? function () { return mathfloor(Math.random() * pow2_53); }\r\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n (Math.random() * 0x800000 | 0); };\r\n\r\n return function (dp) {\r\n var a, b, e, k, v,\r\n i = 0,\r\n c = [],\r\n rand = new BigNumber(ONE);\r\n\r\n if (dp == null) dp = DECIMAL_PLACES;\r\n else intCheck(dp, 0, MAX);\r\n\r\n k = mathceil(dp / LOG_BASE);\r\n\r\n if (CRYPTO) {\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n if (crypto.getRandomValues) {\r\n\r\n a = crypto.getRandomValues(new Uint32Array(k *= 2));\r\n\r\n for (; i < k;) {\r\n\r\n // 53 bits:\r\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n // 11111 11111111 11111111\r\n // 0x20000 is 2^21.\r\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n // Rejection sampling:\r\n // 0 <= v < 9007199254740992\r\n // Probability that v >= 9e15, is\r\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n if (v >= 9e15) {\r\n b = crypto.getRandomValues(new Uint32Array(2));\r\n a[i] = b[0];\r\n a[i + 1] = b[1];\r\n } else {\r\n\r\n // 0 <= v <= 8999999999999999\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 2;\r\n }\r\n }\r\n i = k / 2;\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n a = crypto.randomBytes(k *= 7);\r\n\r\n for (; i < k;) {\r\n\r\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n // 0 <= v < 9007199254740992\r\n v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r\n (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r\n (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r\n\r\n if (v >= 9e15) {\r\n crypto.randomBytes(7).copy(a, i);\r\n } else {\r\n\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 7;\r\n }\r\n }\r\n i = k / 7;\r\n } else {\r\n CRYPTO = false;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n }\r\n\r\n // Use Math.random.\r\n if (!CRYPTO) {\r\n\r\n for (; i < k;) {\r\n v = random53bitInt();\r\n if (v < 9e15) c[i++] = v % 1e14;\r\n }\r\n }\r\n\r\n k = c[--i];\r\n dp %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to dp.\r\n if (k && dp) {\r\n v = POWS_TEN[LOG_BASE - dp];\r\n c[i] = mathfloor(k / v) * v;\r\n }\r\n\r\n // Remove trailing elements which are zero.\r\n for (; c[i] === 0; c.pop(), i--);\r\n\r\n // Zero?\r\n if (i < 0) {\r\n c = [e = 0];\r\n } else {\r\n\r\n // Remove leading elements which are zero and adjust exponent accordingly.\r\n for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n // Count the digits of the first element of c to determine leading zeros, and...\r\n for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n // adjust the exponent accordingly.\r\n if (i < LOG_BASE) e -= LOG_BASE - i;\r\n }\r\n\r\n rand.e = e;\r\n rand.c = c;\r\n return rand;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the sum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.sum = function () {\r\n var i = 1,\r\n args = arguments,\r\n sum = new BigNumber(args[0]);\r\n for (; i < args.length;) sum = sum.plus(args[i++]);\r\n return sum;\r\n };\r\n\r\n\r\n // PRIVATE FUNCTIONS\r\n\r\n\r\n // Called by BigNumber and BigNumber.prototype.toString.\r\n convertBase = (function () {\r\n var decimal = '0123456789';\r\n\r\n /*\r\n * Convert string of baseIn to an array of numbers of baseOut.\r\n * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n */\r\n function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n // If the caller is toString, we are converting from base 10 to baseOut.\r\n // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n return function (str, baseIn, baseOut, sign, callerIsToString) {\r\n var alphabet, d, e, k, r, x, xc, y,\r\n i = str.indexOf('.'),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace('.', '');\r\n y = new BigNumber(baseIn);\r\n x = y.pow(str.length - i);\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n\r\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r\n 10, baseOut, decimal);\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n\r\n xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r\n ? (alphabet = ALPHABET, decimal)\r\n : (alphabet = decimal, ALPHABET));\r\n\r\n // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--k] == 0; xc.pop());\r\n\r\n // Zero?\r\n if (!xc[0]) return alphabet.charAt(0);\r\n\r\n // Does str represent an integer? If so, no need for the division.\r\n if (i < 0) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // The sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div(x, y, dp, rm, baseOut);\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n // xc now represents str converted to baseOut.\r\n\r\n // THe index of the rounding digit.\r\n d = e + dp + 1;\r\n\r\n // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n\r\n // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n // If the index of the rounding digit is not greater than zero, or xc represents\r\n // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n // such as 0.00001.\r\n if (d < 1 || !xc[0]) {\r\n\r\n // 1^-dp or 0\r\n str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r\n } else {\r\n\r\n // Truncate xc to the required number of decimal places.\r\n xc.length = d;\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (--baseOut; ++xc[--d] > baseOut;) {\r\n xc[d] = 0;\r\n\r\n if (!d) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (k = xc.length; !xc[--k];);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r\n\r\n // Add leading zeros, decimal point and trailing zeros as required.\r\n str = toFixedPoint(str, e, alphabet.charAt(0));\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n };\r\n })();\r\n\r\n\r\n // Perform division in the specified base. Called by div and convertBase.\r\n div = (function () {\r\n\r\n // Assume non-zero x and k.\r\n function multiply(x, k, base) {\r\n var m, temp, xlo, xhi,\r\n carry = 0,\r\n i = x.length,\r\n klo = k % SQRT_BASE,\r\n khi = k / SQRT_BASE | 0;\r\n\r\n for (x = x.slice(); i--;) {\r\n xlo = x[i] % SQRT_BASE;\r\n xhi = x[i] / SQRT_BASE | 0;\r\n m = khi * xlo + xhi * klo;\r\n temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r\n carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r\n x[i] = temp % base;\r\n }\r\n\r\n if (carry) x = [carry].concat(x);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, cmp;\r\n\r\n if (aL != bL) {\r\n cmp = aL > bL ? 1 : -1;\r\n } else {\r\n\r\n for (i = cmp = 0; i < aL; i++) {\r\n\r\n if (a[i] != b[i]) {\r\n cmp = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1; a.splice(0, 1));\r\n }\r\n\r\n // x: dividend, y: divisor.\r\n return function (x, y, dp, rm, base) {\r\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n yL, yz,\r\n s = x.s == y.s ? 1 : -1,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xc || !xc[0] || !yc || !yc[0]) {\r\n\r\n return new BigNumber(\r\n\r\n // Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r\n\r\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n );\r\n }\r\n\r\n q = new BigNumber(s);\r\n qc = q.c = [];\r\n e = x.e - y.e;\r\n s = dp + e + 1;\r\n\r\n if (!base) {\r\n base = BASE;\r\n e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r\n s = s / LOG_BASE | 0;\r\n }\r\n\r\n // Result exponent may be one less then the current value of e.\r\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n for (i = 0; yc[i] == (xc[i] || 0); i++);\r\n\r\n if (yc[i] > (xc[i] || 0)) e--;\r\n\r\n if (s < 0) {\r\n qc.push(1);\r\n more = true;\r\n } else {\r\n xL = xc.length;\r\n yL = yc.length;\r\n i = 0;\r\n s += 2;\r\n\r\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n n = mathfloor(base / (yc[0] + 1));\r\n\r\n // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r\n // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r\n if (n > 1) {\r\n yc = multiply(yc, n, base);\r\n xc = multiply(xc, n, base);\r\n yL = yc.length;\r\n xL = xc.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xc.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL; rem[remL++] = 0);\r\n yz = yc.slice();\r\n yz = [0].concat(yz);\r\n yc0 = yc[0];\r\n if (yc[1] >= base / 2) yc0++;\r\n // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r\n\r\n do {\r\n n = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yc, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, n.\r\n\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // n is how many times the divisor goes into the current remainder.\r\n n = mathfloor(rem0 / yc0);\r\n\r\n // Algorithm:\r\n // product = divisor multiplied by trial digit (n).\r\n // Compare product and remainder.\r\n // If product is greater than remainder:\r\n // Subtract divisor from product, decrement trial digit.\r\n // Subtract product from remainder.\r\n // If product was less than remainder at the last compare:\r\n // Compare new remainder and divisor.\r\n // If remainder is greater than divisor:\r\n // Subtract divisor from remainder, increment trial digit.\r\n\r\n if (n > 1) {\r\n\r\n // n may be > base only when base is 3.\r\n if (n >= base) n = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiply(yc, n, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n // If product > remainder then trial digit n too high.\r\n // n is 1 too high about 5% of the time, and is not known to have\r\n // ever been more than 1 too high.\r\n while (compare(prod, rem, prodL, remL) == 1) {\r\n n--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yc, prodL, base);\r\n prodL = prod.length;\r\n cmp = 1;\r\n }\r\n } else {\r\n\r\n // n is 0 or 1, cmp is -1.\r\n // If n is 0, there is no need to compare yc and rem again below,\r\n // so change cmp to 1 to avoid it.\r\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n if (n == 0) {\r\n\r\n // divisor < remainder, so n must be at least 1.\r\n cmp = n = 1;\r\n }\r\n\r\n // product = divisor\r\n prod = yc.slice();\r\n prodL = prod.length;\r\n }\r\n\r\n if (prodL < remL) prod = [0].concat(prod);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n remL = rem.length;\r\n\r\n // If product was < remainder.\r\n if (cmp == -1) {\r\n\r\n // Compare divisor and new remainder.\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n // Trial digit n too low.\r\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n while (compare(yc, rem, yL, remL) < 1) {\r\n n++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yc, remL, base);\r\n remL = rem.length;\r\n }\r\n }\r\n } else if (cmp === 0) {\r\n n++;\r\n rem = [0];\r\n } // else cmp === 1 and n will be 0\r\n\r\n // Add the next digit, n, to the result array.\r\n qc[i++] = n;\r\n\r\n // Update the remainder.\r\n if (rem[0]) {\r\n rem[remL++] = xc[xi] || 0;\r\n } else {\r\n rem = [xc[xi]];\r\n remL = 1;\r\n }\r\n } while ((xi++ < xL || rem[0] != null) && s--);\r\n\r\n more = rem[0] != null;\r\n\r\n // Leading zero?\r\n if (!qc[0]) qc.splice(0, 1);\r\n }\r\n\r\n if (base == BASE) {\r\n\r\n // To calculate q.e, first get the number of digits of qc[0].\r\n for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r\n\r\n round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r\n\r\n // Caller is convertBase.\r\n } else {\r\n q.e = e;\r\n q.r = +more;\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n * notation rounded to the specified decimal places or significant digits.\r\n *\r\n * n: a BigNumber.\r\n * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n * rm: the rounding mode.\r\n * id: 1 (toExponential) or 2 (toPrecision).\r\n */\r\n function format(n, i, rm, id) {\r\n var c0, e, ne, len, str;\r\n\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n if (!n.c) return n.toString();\r\n\r\n c0 = n.c[0];\r\n ne = n.e;\r\n\r\n if (i == null) {\r\n str = coeffToString(n.c);\r\n str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r\n ? toExponential(str, ne)\r\n : toFixedPoint(str, ne, '0');\r\n } else {\r\n n = round(new BigNumber(n), i, rm);\r\n\r\n // n.e may have changed if the value was rounded up.\r\n e = n.e;\r\n\r\n str = coeffToString(n.c);\r\n len = str.length;\r\n\r\n // toPrecision returns exponential notation if the number of significant digits\r\n // specified is less than the number of digits necessary to represent the integer\r\n // part of the value in fixed-point notation.\r\n\r\n // Exponential notation.\r\n if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r\n\r\n // Append zeros?\r\n for (; len < i; str += '0', len++);\r\n str = toExponential(str, e);\r\n\r\n // Fixed-point notation.\r\n } else {\r\n i -= ne;\r\n str = toFixedPoint(str, e, '0');\r\n\r\n // Append zeros?\r\n if (e + 1 > len) {\r\n if (--i > 0) for (str += '.'; i--; str += '0');\r\n } else {\r\n i += e - len;\r\n if (i > 0) {\r\n if (e + 1 == len) str += '.';\r\n for (; i--; str += '0');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return n.s < 0 && c0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Handle BigNumber.max and BigNumber.min.\r\n function maxOrMin(args, method) {\r\n var n,\r\n i = 1,\r\n m = new BigNumber(args[0]);\r\n\r\n for (; i < args.length; i++) {\r\n n = new BigNumber(args[i]);\r\n\r\n // If any number is NaN, return NaN.\r\n if (!n.s) {\r\n m = n;\r\n break;\r\n } else if (method.call(m, n)) {\r\n m = n;\r\n }\r\n }\r\n\r\n return m;\r\n }\r\n\r\n\r\n /*\r\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n * Called by minus, plus and times.\r\n */\r\n function normalise(n, c, e) {\r\n var i = 1,\r\n j = c.length;\r\n\r\n // Remove trailing zeros.\r\n for (; !c[--j]; c.pop());\r\n\r\n // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n for (j = c[0]; j >= 10; j /= 10, i++);\r\n\r\n // Overflow?\r\n if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n n.c = n.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n n.c = [n.e = 0];\r\n } else {\r\n n.e = e;\r\n n.c = c;\r\n }\r\n\r\n return n;\r\n }\r\n\r\n\r\n // Handle values that fail the validity test in BigNumber.\r\n parseNumeric = (function () {\r\n var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n dotAfter = /^([^.]+)\\.$/,\r\n dotBefore = /^\\.([^.]+)$/,\r\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n return function (x, str, isNum, b) {\r\n var base,\r\n s = isNum ? str : str.replace(whitespaceOrPlus, '');\r\n\r\n // No exception on ±Infinity or NaN.\r\n if (isInfinityOrNaN.test(s)) {\r\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n } else {\r\n if (!isNum) {\r\n\r\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n s = s.replace(basePrefix, function (m, p1, p2) {\r\n base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n return !b || b == base ? p1 : m;\r\n });\r\n\r\n if (b) {\r\n base = b;\r\n\r\n // E.g. '1.' to '1', '.1' to '0.1'\r\n s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r\n }\r\n\r\n if (str != s) return new BigNumber(s, base);\r\n }\r\n\r\n // '[BigNumber Error] Not a number: {n}'\r\n // '[BigNumber Error] Not a base {b} number: {n}'\r\n if (BigNumber.DEBUG) {\r\n throw Error\r\n (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r\n }\r\n\r\n // NaN\r\n x.s = null;\r\n }\r\n\r\n x.c = x.e = null;\r\n }\r\n })();\r\n\r\n\r\n /*\r\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n * If r is truthy, it is known that there are more digits after the rounding digit.\r\n */\r\n function round(x, sd, rm, r) {\r\n var d, i, j, k, n, ni, rd,\r\n xc = x.c,\r\n pows10 = POWS_TEN;\r\n\r\n // if x is not Infinity or NaN...\r\n if (xc) {\r\n\r\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n // ni is the index of n within x.c.\r\n // d is the number of digits of n.\r\n // i is the index of rd within n including leading zeros.\r\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n out: {\r\n\r\n // Get the number of digits of the first element of xc.\r\n for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r\n i = sd - d;\r\n\r\n // If the rounding digit is in the first element of xc...\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n n = xc[ni = 0];\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = n / pows10[d - j - 1] % 10 | 0;\r\n } else {\r\n ni = mathceil((i + 1) / LOG_BASE);\r\n\r\n if (ni >= xc.length) {\r\n\r\n if (r) {\r\n\r\n // Needed by sqrt.\r\n for (; xc.length <= ni; xc.push(0));\r\n n = rd = 0;\r\n d = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n n = k = xc[ni];\r\n\r\n // Get the number of digits of n.\r\n for (d = 1; k >= 10; k /= 10, d++);\r\n\r\n // Get the index of rd within n.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within n, adjusted for leading zeros.\r\n // The number of leading zeros of n is given by LOG_BASE - d.\r\n j = i - LOG_BASE + d;\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;\r\n }\r\n }\r\n\r\n r = r || sd < 0 ||\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n // The expression n % pows10[d - j - 1] returns all digits of n to the right\r\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r\n\r\n r = rm < 4\r\n ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xc[0]) {\r\n xc.length = 0;\r\n\r\n if (r) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xc.length = ni;\r\n k = 1;\r\n ni--;\r\n } else {\r\n xc.length = ni + 1;\r\n k = pows10[LOG_BASE - i];\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of n.\r\n xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r\n }\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n for (; ;) {\r\n\r\n // If the digit to be rounded up is in the first element of xc...\r\n if (ni == 0) {\r\n\r\n // i will be the length of xc[0] before k is added.\r\n for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r\n j = xc[0] += k;\r\n for (k = 1; j >= 10; j /= 10, k++);\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xc[0] == BASE) xc[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xc[ni] += k;\r\n if (xc[ni] != BASE) break;\r\n xc[ni--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; xc[--i] === 0; xc.pop());\r\n }\r\n\r\n // Overflow? Infinity.\r\n if (x.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n\r\n // Underflow? Zero.\r\n } else if (x.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function valueOf(n) {\r\n var str,\r\n e = n.e;\r\n\r\n if (e === null) return n.toString();\r\n\r\n str = coeffToString(n.c);\r\n\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(str, e)\r\n : toFixedPoint(str, e, '0');\r\n\r\n return n.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new BigNumber(this);\r\n if (x.s < 0) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * 0 if they have the same value,\r\n * or null if the value of either is NaN.\r\n */\r\n P.comparedTo = function (y, b) {\r\n return compare(this, new BigNumber(y, b));\r\n };\r\n\r\n\r\n /*\r\n * If dp is undefined or null or true or false, return the number of decimal places of the\r\n * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n *\r\n * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.decimalPlaces = P.dp = function (dp, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), dp + x.e + 1, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last number.\r\n if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r\n if (n < 0) n = 0;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.dividedBy = P.div = function (y, b) {\r\n return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n * BigNumber by the value of BigNumber(y, b).\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y, b) {\r\n return div(this, new BigNumber(y, b), 0, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n *\r\n * If m is present, return the result modulo m.\r\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n *\r\n * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r\n * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n *\r\n * n {number|string|BigNumber} The exponent. An integer.\r\n * [m] {number|string|BigNumber} The modulus.\r\n *\r\n * '[BigNumber Error] Exponent not an integer: {n}'\r\n */\r\n P.exponentiatedBy = P.pow = function (n, m) {\r\n var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r\n x = this;\r\n\r\n n = new BigNumber(n);\r\n\r\n // Allow NaN and ±Infinity, but not other non-integers.\r\n if (n.c && !n.isInteger()) {\r\n throw Error\r\n (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r\n }\r\n\r\n if (m != null) m = new BigNumber(m);\r\n\r\n // Exponent of MAX_SAFE_INTEGER is 15.\r\n nIsBig = n.e > 14;\r\n\r\n // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r\n if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r\n\r\n // The sign of the result of pow when x is negative depends on the evenness of n.\r\n // If +n overflows to ±Infinity, the evenness of n would be not be known.\r\n y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));\r\n return m ? y.mod(m) : y;\r\n }\r\n\r\n nIsNeg = n.s < 0;\r\n\r\n if (m) {\r\n\r\n // x % m returns NaN if abs(m) is zero, or m is NaN.\r\n if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r\n\r\n isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r\n\r\n if (isModExp) x = x.mod(m);\r\n\r\n // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r\n // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r\n } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r\n // [1, 240000000]\r\n ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r\n // [80000000000000] [99999750000000]\r\n : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r\n\r\n // If x is negative and n is odd, k = -0, else k = 0.\r\n k = x.s < 0 && isOdd(n) ? -0 : 0;\r\n\r\n // If x >= 1, k = ±Infinity.\r\n if (x.e > -1) k = 1 / k;\r\n\r\n // If n is negative return ±0, else return ±Infinity.\r\n return new BigNumber(nIsNeg ? 1 / k : k);\r\n\r\n } else if (POW_PRECISION) {\r\n\r\n // Truncating each coefficient array to a length of k after each multiplication\r\n // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n // i.e. there will be a minimum of 28 guard digits retained.\r\n k = mathceil(POW_PRECISION / LOG_BASE + 2);\r\n }\r\n\r\n if (nIsBig) {\r\n half = new BigNumber(0.5);\r\n if (nIsNeg) n.s = 1;\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = Math.abs(+valueOf(n));\r\n nIsOdd = i % 2;\r\n }\r\n\r\n y = new BigNumber(ONE);\r\n\r\n // Performs 54 loop iterations for n of 9007199254740991.\r\n for (; ;) {\r\n\r\n if (nIsOdd) {\r\n y = y.times(x);\r\n if (!y.c) break;\r\n\r\n if (k) {\r\n if (y.c.length > k) y.c.length = k;\r\n } else if (isModExp) {\r\n y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (i) {\r\n i = mathfloor(i / 2);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n } else {\r\n n = n.times(half);\r\n round(n, n.e + 1, 1);\r\n\r\n if (n.e > 14) {\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = +valueOf(n);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n }\r\n }\r\n\r\n x = x.times(x);\r\n\r\n if (k) {\r\n if (x.c && x.c.length > k) x.c.length = k;\r\n } else if (isModExp) {\r\n x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (isModExp) return y;\r\n if (nIsNeg) y = ONE.div(y);\r\n\r\n return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n */\r\n P.integerValue = function (rm) {\r\n var n = new BigNumber(this);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n return round(n, n.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isEqualTo = P.eq = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n */\r\n P.isFinite = function () {\r\n return !!this.c;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isGreaterThan = P.gt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r\n\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n */\r\n P.isInteger = function () {\r\n return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isLessThan = P.lt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isLessThanOrEqualTo = P.lte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is negative, otherwise return false.\r\n */\r\n P.isNegative = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is positive, otherwise return false.\r\n */\r\n P.isPositive = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n */\r\n P.isZero = function () {\r\n return !!this.c && this.c[0] == 0;\r\n };\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.minus = function (y, b) {\r\n var i, j, t, xLTy,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r\n\r\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n ROUNDING_MODE == 3 ? -0 : 0);\r\n }\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Determine which is the bigger number.\r\n if (a = xe - ye) {\r\n\r\n if (xLTy = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n\r\n // Prepend zeros to equalise exponents.\r\n for (b = a; b--; t.push(0));\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n\r\n if (xc[b] != yc[b]) {\r\n xLTy = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\r\n\r\n b = (j = yc.length) - (i = xc.length);\r\n\r\n // Append zeros to xc if shorter.\r\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n if (b > 0) for (; b--; xc[i++] = 0);\r\n b = BASE - 1;\r\n\r\n // Subtract yc from xc.\r\n for (; j > a;) {\r\n\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i]; xc[i] = b);\r\n --xc[i];\r\n xc[j] += BASE;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] == 0; xc.splice(0, 1), --ye);\r\n\r\n // Zero?\r\n if (!xc[0]) {\r\n\r\n // Following IEEE 754 (2008) 6.3,\r\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\r\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n // for finite x and y.\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n */\r\n P.modulo = P.mod = function (y, b) {\r\n var q, s,\r\n x = this;\r\n\r\n y = new BigNumber(y, b);\r\n\r\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n if (!x.c || !y.s || y.c && !y.c[0]) {\r\n return new BigNumber(NaN);\r\n\r\n // Return x if y is Infinity or x is zero.\r\n } else if (!y.c || x.c && !x.c[0]) {\r\n return new BigNumber(x);\r\n }\r\n\r\n if (MODULO_MODE == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // r = x - qy where 0 <= r < abs(y)\r\n s = y.s;\r\n y.s = 1;\r\n q = div(x, y, 0, 3);\r\n y.s = s;\r\n q.s *= s;\r\n } else {\r\n q = div(x, y, 0, MODULO_MODE);\r\n }\r\n\r\n y = x.minus(q.times(y));\r\n\r\n // To match JavaScript %, ensure sign of zero is sign of dividend.\r\n if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n * of BigNumber(y, b).\r\n */\r\n P.multipliedBy = P.times = function (y, b) {\r\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n base, sqrtBase,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new BigNumber(y, b)).c;\r\n\r\n // Either NaN, ±Infinity or ±0?\r\n if (!xc || !yc || !xc[0] || !yc[0]) {\r\n\r\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r\n y.c = y.e = y.s = null;\r\n } else {\r\n y.s *= x.s;\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n if (!xc || !yc) {\r\n y.c = y.e = null;\r\n\r\n // Return ±0 if either is ±0.\r\n } else {\r\n y.c = [0];\r\n y.e = 0;\r\n }\r\n }\r\n\r\n return y;\r\n }\r\n\r\n e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r\n y.s *= x.s;\r\n xcL = xc.length;\r\n ycL = yc.length;\r\n\r\n // Ensure xc points to longer array and xcL to its length.\r\n if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\r\n\r\n // Initialise the result array with zeros.\r\n for (i = xcL + ycL, zc = []; i--; zc.push(0));\r\n\r\n base = BASE;\r\n sqrtBase = SQRT_BASE;\r\n\r\n for (i = ycL; --i >= 0;) {\r\n c = 0;\r\n ylo = yc[i] % sqrtBase;\r\n yhi = yc[i] / sqrtBase | 0;\r\n\r\n for (k = xcL, j = i + k; j > i;) {\r\n xlo = xc[--k] % sqrtBase;\r\n xhi = xc[k] / sqrtBase | 0;\r\n m = yhi * xlo + xhi * ylo;\r\n xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r\n c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r\n zc[j--] = xlo % base;\r\n }\r\n\r\n zc[j] = c;\r\n }\r\n\r\n if (c) {\r\n ++e;\r\n } else {\r\n zc.splice(0, 1);\r\n }\r\n\r\n return normalise(y, zc, e);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n * i.e. multiplied by -1.\r\n */\r\n P.negated = function () {\r\n var x = new BigNumber(this);\r\n x.s = -x.s || null;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.plus = function (y, b) {\r\n var t,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Return ±Infinity if either ±Infinity.\r\n if (!xc || !yc) return new BigNumber(a / 0);\r\n\r\n // Either zero?\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--; t.push(0));\r\n t.reverse();\r\n }\r\n\r\n a = xc.length;\r\n b = yc.length;\r\n\r\n // Point xc to the longer array, and b to the shorter length.\r\n if (a - b < 0) t = yc, yc = xc, xc = t, b = a;\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n for (a = 0; b;) {\r\n a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r\n xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n }\r\n\r\n if (a) {\r\n xc = [a].concat(xc);\r\n ++ye;\r\n }\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n // ye = MAX_EXP + 1 possible\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * If sd is undefined or null or true or false, return the number of significant digits of\r\n * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n * If sd is true include integer-part trailing zeros in the count.\r\n *\r\n * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n * boolean: whether to count integer-part trailing zeros: true or false.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.precision = P.sd = function (sd, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (sd != null && sd !== !!sd) {\r\n intCheck(sd, 1, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), sd, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n v = c.length - 1;\r\n n = v * LOG_BASE + 1;\r\n\r\n if (v = c[v]) {\r\n\r\n // Subtract the number of trailing zeros of the last element.\r\n for (; v % 10 == 0; v /= 10, n--);\r\n\r\n // Add the number of digits of the first element.\r\n for (v = c[0]; v >= 10; v /= 10, n++);\r\n }\r\n\r\n if (sd && x.e + 1 > n) n = x.e + 1;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n *\r\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n */\r\n P.shiftedBy = function (k) {\r\n intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r\n return this.times('1e' + k);\r\n };\r\n\r\n\r\n /*\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, r, rep, t,\r\n x = this,\r\n c = x.c,\r\n s = x.s,\r\n e = x.e,\r\n dp = DECIMAL_PLACES + 4,\r\n half = new BigNumber('0.5');\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !c || !c[0]) {\r\n return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r\n }\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+valueOf(x));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = coeffToString(c);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(+n);\r\n e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '1e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new BigNumber(n);\r\n } else {\r\n r = new BigNumber(s + '');\r\n }\r\n\r\n // Check for zero.\r\n // r could be zero if MIN_EXP is changed after the this value was created.\r\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n // coeffToString to throw.\r\n if (r.c[0]) {\r\n e = r.e;\r\n s = e + dp;\r\n if (s < 3) s = 0;\r\n\r\n // Newton-Raphson iteration.\r\n for (; ;) {\r\n t = r;\r\n r = half.times(t.plus(div(x, t, dp, 1)));\r\n\r\n if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r\n\r\n // The exponent of r may here be one less than the final result exponent,\r\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r\n // are indexed correctly.\r\n if (r.e < e) --s;\r\n n = n.slice(s - 3, s + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n // iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the\r\n // exact result as the nines may infinitely repeat.\r\n if (!rep) {\r\n round(t, t.e + DECIMAL_PLACES + 2, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n dp += 4;\r\n s += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n // result. If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n round(r, r.e + DECIMAL_PLACES + 2, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in exponential notation and\r\n * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toExponential = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp++;\r\n }\r\n return format(this, dp, rm, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toFixed = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp = dp + this.e + 1;\r\n }\r\n return format(this, dp, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n * of the format or FORMAT object (see BigNumber.set).\r\n *\r\n * The formatting object may contain some or all of the properties shown below.\r\n *\r\n * FORMAT = {\r\n * prefix: '',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * groupSeparator: ',',\r\n * decimalSeparator: '.',\r\n * fractionGroupSize: 0,\r\n * fractionGroupSeparator: '\\xA0', // non-breaking space\r\n * suffix: ''\r\n * };\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n * [format] {object} Formatting options. See FORMAT pbject above.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n * '[BigNumber Error] Argument not an object: {format}'\r\n */\r\n P.toFormat = function (dp, rm, format) {\r\n var str,\r\n x = this;\r\n\r\n if (format == null) {\r\n if (dp != null && rm && typeof rm == 'object') {\r\n format = rm;\r\n rm = null;\r\n } else if (dp && typeof dp == 'object') {\r\n format = dp;\r\n dp = rm = null;\r\n } else {\r\n format = FORMAT;\r\n }\r\n } else if (typeof format != 'object') {\r\n throw Error\r\n (bignumberError + 'Argument not an object: ' + format);\r\n }\r\n\r\n str = x.toFixed(dp, rm);\r\n\r\n if (x.c) {\r\n var i,\r\n arr = str.split('.'),\r\n g1 = +format.groupSize,\r\n g2 = +format.secondaryGroupSize,\r\n groupSeparator = format.groupSeparator || '',\r\n intPart = arr[0],\r\n fractionPart = arr[1],\r\n isNeg = x.s < 0,\r\n intDigits = isNeg ? intPart.slice(1) : intPart,\r\n len = intDigits.length;\r\n\r\n if (g2) i = g1, g1 = g2, g2 = i, len -= i;\r\n\r\n if (g1 > 0 && len > 0) {\r\n i = len % g1 || g1;\r\n intPart = intDigits.substr(0, i);\r\n for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r\n if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r\n if (isNeg) intPart = '-' + intPart;\r\n }\r\n\r\n str = fractionPart\r\n ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r\n ? fractionPart.replace(new RegExp('\\\\d{' + g2 + '}\\\\B', 'g'),\r\n '$&' + (format.fractionGroupSeparator || ''))\r\n : fractionPart)\r\n : intPart;\r\n }\r\n\r\n return (format.prefix || '') + str + (format.suffix || '');\r\n };\r\n\r\n\r\n /*\r\n * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r\n * fraction with an integer numerator and an integer denominator.\r\n * The denominator will be a positive non-zero value less than or equal to the specified\r\n * maximum denominator. If a maximum denominator is not specified, the denominator will be\r\n * the lowest value necessary to represent the number exactly.\r\n *\r\n * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r\n *\r\n * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n */\r\n P.toFraction = function (md) {\r\n var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r\n x = this,\r\n xc = x.c;\r\n\r\n if (md != null) {\r\n n = new BigNumber(md);\r\n\r\n // Throw if md is less than one or is not an integer, unless it is Infinity.\r\n if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r\n throw Error\r\n (bignumberError + 'Argument ' +\r\n (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r\n }\r\n }\r\n\r\n if (!xc) return new BigNumber(x);\r\n\r\n d = new BigNumber(ONE);\r\n n1 = d0 = new BigNumber(ONE);\r\n d1 = n0 = new BigNumber(ONE);\r\n s = coeffToString(xc);\r\n\r\n // Determine initial denominator.\r\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n e = d.e = s.length - x.e - 1;\r\n d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r\n md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r\n\r\n exp = MAX_EXP;\r\n MAX_EXP = 1 / 0;\r\n n = new BigNumber(s);\r\n\r\n // n0 = d1 = 0\r\n n0.c[0] = 0;\r\n\r\n for (; ;) {\r\n q = div(n, d, 0, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.comparedTo(md) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n n1 = n0.plus(q.times(d2 = n1));\r\n n0 = d2;\r\n d = n.minus(q.times(d2 = d));\r\n n = d2;\r\n }\r\n\r\n d2 = div(md.minus(d0), d1, 0, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n e = e * 2;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r\n div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r\n\r\n MAX_EXP = exp;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this BigNumber converted to a number primitive.\r\n */\r\n P.toNumber = function () {\r\n return +valueOf(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n * necessary to represent the integer part of the value in fixed-point notation, then use\r\n * exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n if (sd != null) intCheck(sd, 1, MAX);\r\n return format(this, sd, rm, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n * TO_EXP_NEG, return exponential notation.\r\n *\r\n * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n *\r\n * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n */\r\n P.toString = function (b) {\r\n var str,\r\n n = this,\r\n s = n.s,\r\n e = n.e;\r\n\r\n // Infinity or NaN?\r\n if (e === null) {\r\n if (s) {\r\n str = 'Infinity';\r\n if (s < 0) str = '-' + str;\r\n } else {\r\n str = 'NaN';\r\n }\r\n } else {\r\n if (b == null) {\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(coeffToString(n.c), e)\r\n : toFixedPoint(coeffToString(n.c), e, '0');\r\n } else if (b === 10) {\r\n n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r\n str = toFixedPoint(coeffToString(n.c), n.e, '0');\r\n } else {\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r\n }\r\n\r\n if (s < 0 && n.c[0]) str = '-' + str;\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return as toString, but do not accept a base argument, and include the minus sign for\r\n * negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return valueOf(this);\r\n };\r\n\r\n\r\n P._isBigNumber = true;\r\n\r\n if (configObject != null) BigNumber.set(configObject);\r\n\r\n return BigNumber;\r\n }\r\n\r\n\r\n // PRIVATE HELPER FUNCTIONS\r\n\r\n // These functions don't need access to variables,\r\n // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r\n\r\n\r\n function bitFloor(n) {\r\n var i = n | 0;\r\n return n > 0 || n === i ? i : i - 1;\r\n }\r\n\r\n\r\n // Return a coefficient array as a string of base 10 digits.\r\n function coeffToString(a) {\r\n var s, z,\r\n i = 1,\r\n j = a.length,\r\n r = a[0] + '';\r\n\r\n for (; i < j;) {\r\n s = a[i++] + '';\r\n z = LOG_BASE - s.length;\r\n for (; z--; s = '0' + s);\r\n r += s;\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (j = r.length; r.charCodeAt(--j) === 48;);\r\n\r\n return r.slice(0, j + 1 || 1);\r\n }\r\n\r\n\r\n // Compare the value of BigNumbers x and y.\r\n function compare(x, y) {\r\n var a, b,\r\n xc = x.c,\r\n yc = y.c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either NaN?\r\n if (!i || !j) return null;\r\n\r\n a = xc && !xc[0];\r\n b = yc && !yc[0];\r\n\r\n // Either zero?\r\n if (a || b) return a ? b ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n a = i < 0;\r\n b = k == l;\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n // Compare exponents.\r\n if (!b) return k > l ^ a ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n }\r\n\r\n\r\n /*\r\n * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n */\r\n function intCheck(n, min, max, name) {\r\n if (n < min || n > max || n !== mathfloor(n)) {\r\n throw Error\r\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\r\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n : ' not a primitive number: ') + String(n));\r\n }\r\n }\r\n\r\n\r\n // Assumes finite n.\r\n function isOdd(n) {\r\n var k = n.c.length - 1;\r\n return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r\n }\r\n\r\n\r\n function toExponential(str, e) {\r\n return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r\n (e < 0 ? 'e' : 'e+') + e;\r\n }\r\n\r\n\r\n function toFixedPoint(str, e, z) {\r\n var len, zs;\r\n\r\n // Negative exponent?\r\n if (e < 0) {\r\n\r\n // Prepend zeros.\r\n for (zs = z + '.'; ++e; zs += z);\r\n str = zs + str;\r\n\r\n // Positive exponent\r\n } else {\r\n len = str.length;\r\n\r\n // Append zeros.\r\n if (++e > len) {\r\n for (zs = z, e -= len; --e; zs += z);\r\n str += zs;\r\n } else if (e < len) {\r\n str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // EXPORT\r\n\r\n\r\n BigNumber = clone();\r\n BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n // AMD.\r\n if (true) {\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return BigNumber; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\r\n // Node.js and other environments that support module.exports.\r\n } else {}\r\n})(this);\r\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/node_modules/concat-stream/index.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/node_modules/concat-stream/index.js ***!
|
||
\***************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var Writable = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Writable\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nvar U8 = Uint8Array\n\nfunction ConcatStream(opts, cb) {\n if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb)\n\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n if (!opts) opts = {}\n\n var encoding = opts.encoding\n var shouldInferEncoding = false\n\n if (!encoding) {\n shouldInferEncoding = true\n } else {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'u8' || encoding === 'uint8') {\n encoding = 'uint8array'\n }\n }\n\n Writable.call(this, { objectMode: true })\n\n this.encoding = encoding\n this.shouldInferEncoding = shouldInferEncoding\n\n if (cb) this.on('finish', function () { cb(this.getBody()) })\n this.body = []\n}\n\nmodule.exports = ConcatStream\ninherits(ConcatStream, Writable)\n\nConcatStream.prototype._write = function(chunk, enc, next) {\n this.body.push(chunk)\n next()\n}\n\nConcatStream.prototype.inferEncoding = function (buff) {\n var firstBuffer = buff === undefined ? this.body[0] : buff;\n if (Buffer.isBuffer(firstBuffer)) return 'buffer'\n if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array'\n if (Array.isArray(firstBuffer)) return 'array'\n if (typeof firstBuffer === 'string') return 'string'\n if (Object.prototype.toString.call(firstBuffer) === \"[object Object]\") return 'object'\n return 'buffer'\n}\n\nConcatStream.prototype.getBody = function () {\n if (!this.encoding && this.body.length === 0) return []\n if (this.shouldInferEncoding) this.encoding = this.inferEncoding()\n if (this.encoding === 'array') return arrayConcat(this.body)\n if (this.encoding === 'string') return stringConcat(this.body)\n if (this.encoding === 'buffer') return bufferConcat(this.body)\n if (this.encoding === 'uint8array') return u8Concat(this.body)\n return this.body\n}\n\nfunction isArrayish (arr) {\n return /Array\\]$/.test(Object.prototype.toString.call(arr))\n}\n\nfunction isBufferish (p) {\n return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function')\n}\n\nfunction stringConcat (parts) {\n var strings = []\n for (var i = 0; i < parts.length; i++) {\n var p = parts[i]\n if (typeof p === 'string') {\n strings.push(p)\n } else if (Buffer.isBuffer(p)) {\n strings.push(p)\n } else if (isBufferish(p)) {\n strings.push(Buffer.from(p))\n } else {\n strings.push(Buffer.from(String(p)))\n }\n }\n if (Buffer.isBuffer(parts[0])) {\n strings = Buffer.concat(strings)\n strings = strings.toString('utf8')\n } else {\n strings = strings.join('')\n }\n return strings\n}\n\nfunction bufferConcat (parts) {\n var bufs = []\n for (var i = 0; i < parts.length; i++) {\n var p = parts[i]\n if (Buffer.isBuffer(p)) {\n bufs.push(p)\n } else if (isBufferish(p)) {\n bufs.push(Buffer.from(p))\n } else {\n bufs.push(Buffer.from(String(p)))\n }\n }\n return Buffer.concat(bufs)\n}\n\nfunction arrayConcat (parts) {\n var res = []\n for (var i = 0; i < parts.length; i++) {\n res.push.apply(res, parts[i])\n }\n return res\n}\n\nfunction u8Concat (parts) {\n var len = 0\n for (var i = 0; i < parts.length; i++) {\n if (typeof parts[i] === 'string') {\n parts[i] = Buffer.from(parts[i])\n }\n len += parts[i].length\n }\n var u8 = new U8(len)\n for (var i = 0, offset = 0; i < parts.length; i++) {\n var part = parts[i]\n for (var j = 0; j < part.length; j++) {\n u8[offset++] = part[j]\n }\n }\n return u8\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/node_modules/concat-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/node_modules/lru-cache/index.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/node_modules/lru-cache/index.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = __webpack_require__(/*! yallist */ \"./node_modules/yallist/yallist.js\")\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/node_modules/lru-cache/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/node_modules/through2/through2.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/node_modules/through2/through2.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var Transform = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Transform\n , inherits = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\").inherits\n\nfunction DestroyableTransform(opts) {\n Transform.call(this, opts)\n this._destroyed = false\n}\n\ninherits(DestroyableTransform, Transform)\n\nDestroyableTransform.prototype.destroy = function(err) {\n if (this._destroyed) return\n this._destroyed = true\n \n var self = this\n process.nextTick(function() {\n if (err)\n self.emit('error', err)\n self.emit('close')\n })\n}\n\n// a noop _transform function\nfunction noop (chunk, enc, callback) {\n callback(null, chunk)\n}\n\n\n// create a new export function, used by both the main export and\n// the .ctor export, contains common logic for dealing with arguments\nfunction through2 (construct) {\n return function (options, transform, flush) {\n if (typeof options == 'function') {\n flush = transform\n transform = options\n options = {}\n }\n\n if (typeof transform != 'function')\n transform = noop\n\n if (typeof flush != 'function')\n flush = null\n\n return construct(options, transform, flush)\n }\n}\n\n\n// main export, just make me a transform stream!\nmodule.exports = through2(function (options, transform, flush) {\n var t2 = new DestroyableTransform(options)\n\n t2._transform = transform\n\n if (flush)\n t2._flush = flush\n\n return t2\n})\n\n\n// make me a reusable prototype that I can `new`, or implicitly `new`\n// with a constructor call\nmodule.exports.ctor = through2(function (options, transform, flush) {\n function Through2 (override) {\n if (!(this instanceof Through2))\n return new Through2(override)\n\n this.options = Object.assign({}, options, override)\n\n DestroyableTransform.call(this, this.options)\n }\n\n inherits(Through2, DestroyableTransform)\n\n Through2.prototype._transform = transform\n\n if (flush)\n Through2.prototype._flush = flush\n\n return Through2\n})\n\n\nmodule.exports.obj = through2(function (options, transform, flush) {\n var t2 = new DestroyableTransform(Object.assign({ objectMode: true, highWaterMark: 16 }, options))\n\n t2._transform = transform\n\n if (flush)\n t2._flush = flush\n\n return t2\n})\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/node_modules/through2/through2.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/package.json":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/package.json ***!
|
||
\****************************************************/
|
||
/*! exports provided: name, version, description, keywords, homepage, bugs, license, leadMaintainer, files, main, browser, repository, scripts, dependencies, devDependencies, engines, contributors, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"name\":\"ipfs-http-client\",\"version\":\"33.1.1\",\"description\":\"A client library for the IPFS HTTP API\",\"keywords\":[\"ipfs\"],\"homepage\":\"https://github.com/ipfs/js-ipfs-http-client\",\"bugs\":\"https://github.com/ipfs/js-ipfs-http-client/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Alan Shaw <alan@tableflip.io>\",\"files\":[\"src\",\"dist\"],\"main\":\"src/index.js\",\"browser\":{\"glob\":false,\"fs\":false,\"stream\":\"readable-stream\"},\"repository\":\"github:ipfs/js-ipfs-http-client\",\"scripts\":{\"test\":\"aegir test\",\"test:node\":\"aegir test -t node\",\"test:browser\":\"aegir test -t browser\",\"test:webworker\":\"aegir test -t webworker\",\"lint\":\"aegir lint\",\"build\":\"aegir build\",\"release\":\"aegir release \",\"release-minor\":\"aegir release --type minor \",\"release-major\":\"aegir release --type major \",\"coverage\":\"npx nyc -r html npm run test:node -- --bail\"},\"dependencies\":{\"async\":\"^2.6.1\",\"bignumber.js\":\"^9.0.0\",\"bl\":\"^3.0.0\",\"bs58\":\"^4.0.1\",\"buffer\":\"^5.2.1\",\"cids\":\"~0.7.1\",\"concat-stream\":\"github:hugomrdias/concat-stream#feat/smaller\",\"debug\":\"^4.1.0\",\"detect-node\":\"^2.0.4\",\"end-of-stream\":\"^1.4.1\",\"err-code\":\"^1.1.2\",\"flatmap\":\"0.0.3\",\"glob\":\"^7.1.3\",\"ipfs-block\":\"~0.8.1\",\"ipfs-utils\":\"~0.0.3\",\"ipld-dag-cbor\":\"~0.15.0\",\"ipld-dag-pb\":\"~0.17.3\",\"ipld-raw\":\"^4.0.0\",\"is-ipfs\":\"~0.6.1\",\"is-pull-stream\":\"0.0.0\",\"is-stream\":\"^2.0.0\",\"iso-stream-http\":\"~0.1.2\",\"iso-url\":\"~0.4.6\",\"just-kebab-case\":\"^1.1.0\",\"just-map-keys\":\"^1.1.0\",\"kind-of\":\"^6.0.2\",\"lru-cache\":\"^5.1.1\",\"multiaddr\":\"^6.0.6\",\"multibase\":\"~0.6.0\",\"multicodec\":\"~0.5.1\",\"multihashes\":\"~0.4.14\",\"ndjson\":\"github:hugomrdias/ndjson#feat/readable-stream3\",\"once\":\"^1.4.0\",\"peer-id\":\"~0.12.2\",\"peer-info\":\"~0.15.1\",\"promisify-es6\":\"^1.0.3\",\"pull-defer\":\"~0.2.3\",\"pull-stream\":\"^3.6.9\",\"pull-to-stream\":\"~0.1.1\",\"pump\":\"^3.0.0\",\"qs\":\"^6.5.2\",\"readable-stream\":\"^3.1.1\",\"stream-to-pull-stream\":\"^1.7.2\",\"tar-stream\":\"^2.0.1\",\"through2\":\"^3.0.1\"},\"devDependencies\":{\"aegir\":\"^19.0.3\",\"browser-process-platform\":\"~0.1.1\",\"chai\":\"^4.2.0\",\"cross-env\":\"^5.2.0\",\"dirty-chai\":\"^2.0.1\",\"go-ipfs-dep\":\"~0.4.21\",\"interface-ipfs-core\":\"^0.109.0\",\"ipfsd-ctl\":\"~0.43.0\",\"nock\":\"^10.0.2\",\"stream-equal\":\"^1.1.1\"},\"engines\":{\"node\":\">=8.3.0\",\"npm\":\">=3.0.0\"},\"contributors\":[\"Alan Shaw <alan.shaw@protocol.ai>\",\"Alan Shaw <alan@tableflip.io>\",\"Alex Mingoia <talk@alexmingoia.com>\",\"Alex Potsides <alex@achingbrain.net>\",\"Antonio Tenorio-Fornés <antoniotenorio@ucm.es>\",\"Bruno Barbieri <bbarbieri@delivery.com>\",\"Clemo <flipflopsimsommer@users.noreply.github.com>\",\"Connor Keenan <ckeenan89@gmail.com>\",\"Danny <dannyid@protonmail.com>\",\"David Braun <David.Braun@Toptal.com>\",\"David Dias <daviddias.p@gmail.com>\",\"Dietrich Ayala <autonome@gmail.com>\",\"Diogo Silva <fsdiogo@gmail.com>\",\"Dmitriy Ryajov <dryajov@gmail.com>\",\"Dmitry Nikulin <dmitr-nikulin@mail.ru>\",\"Donatas Stundys <donatas.stundys@necolt.com>\",\"Fil <fil@rezo.net>\",\"Filip Š <filip.stamcar@hotmail.com>\",\"Francisco Baio Dias <xicombd@gmail.com>\",\"Friedel Ziegelmayer <dignifiedquire@gmail.com>\",\"Gar <gar+gh@danger.computer>\",\"Gavin McDermott <gavinmcdermott@gmail.com>\",\"Gopalakrishna Palem <KrishnaPG@users.noreply.github.com>\",\"Greenkeeper <support@greenkeeper.io>\",\"Haad <haadcode@users.noreply.github.com>\",\"Harlan T Wood <harlantwood@users.noreply.github.com>\",\"Harlan T Wood <code@harlantwood.net>\",\"Henrique Dias <hacdias@gmail.com>\",\"Holodisc <holodiscent@gmail.com>\",\"Hugo Dias <hugomrdias@gmail.com>\",\"Hugo Dias <mail@hugodias.me>\",\"JGAntunes <j.goncalo.antunes@gmail.com>\",\"Jacob Heun <jacobheun@gmail.com>\",\"James Halliday <substack@gmail.com>\",\"Jason Carver <jacarver@linkedin.com>\",\"Jason Papakostas <vith@users.noreply.github.com>\",\"Jeff Downie <JeffDownie@users.noreply.github.com>\",\"Jeromy <why@ipfs.io>\",\"Jeromy <jeromyj@gmail.com>\",\"Joe Turgeon <arithmetric@gmail.com>\",\"Jonathan <jkrone@vt.edu>\",\"Juan Batiz-Benet <juan@benet.ai>\",\"Kevin Wang <kevin@fossa.io>\",\"Kristoffer Ström <kristoffer@rymdkoloni.se>\",\"Marcin Rataj <lidel@lidel.org>\",\"Matt Bell <mappum@gmail.com>\",\"Matt Ober <matt.ober3@gmail.com>\",\"Maxime Lathuilière <k@maxlath.eu>\",\"Michael Bradley <michaelsbradleyjr@gmail.com>\",\"Michael Muré <michael.mure@consensys.net>\",\"Michael Muré <batolettre@gmail.com>\",\"Mikeal Rogers <mikeal.rogers@gmail.com>\",\"Mitar <mitar.git@tnode.com>\",\"Mithgol <getgit@mithgol.ru>\",\"Mohamed Abdulaziz <mohamed@mohamedabdulaziz.com>\",\"Nitin Patel <31539366+niinpatel@users.noreply.github.com>\",\"Nuno Nogueira <nunofmn@gmail.com>\",\"Níckolas Goline <nickolas.goline@gmail.com>\",\"Oli Evans <oli@tableflip.io>\",\"Orie Steele <orie@ohs.io>\",\"Pedro Teixeira <i@pgte.me>\",\"Pete Thomas <pete@xminusone.net>\",\"Richard Littauer <richard.littauer@gmail.com>\",\"Richard Schneider <makaretu@gmail.com>\",\"Roman Khafizianov <requilence@gmail.com>\",\"SeungWon <ksw3894@gmail.com>\",\"Stephen Whitmore <stephen.whitmore@gmail.com>\",\"Tara Vancil <tbvanc@gmail.com>\",\"Teri Chadbourne <terichadbourne@users.noreply.github.com>\",\"Travis Person <travis@protocol.ai>\",\"Travis Person <travis.person@gmail.com>\",\"Vasco Santos <vasco.santos@ua.pt>\",\"Vasco Santos <vasco.santos@moxy.studio>\",\"Victor Bjelkholm <victor@typeform.com>\",\"Volker Mische <volker.mische@gmail.com>\",\"Zhiyuan Lin <edsgerlin@gmail.com>\",\"dirkmc <dirkmdev@gmail.com>\",\"dmitriy ryajov <dryajov@dmitriys-MacBook-Pro.local>\",\"elsehow <yes@cosmopol.is>\",\"ethers <ethereum@outlook.com>\",\"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>\",\"haad <haad@headbanggames.com>\",\"kumavis <kumavis@users.noreply.github.com>\",\"leekt216 <leekt216@gmail.com>\",\"nginnever <ginneversource@gmail.com>\",\"noah the goodra <peterpan0413@live.com>\",\"priecint <tp-dev@seznam.cz>\",\"samuli <samuli@nugg.ad>\",\"shunkin <hiyoko.san.ipod@gmail.com>\",\"victorbjelkholm <victorbjelkholm@gmail.com>\",\"Łukasz Magiera <magik6k@users.noreply.github.com>\",\"Łukasz Magiera <magik6k@gmail.com>\"]};\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/package.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bitswap/index.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bitswap/index.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n wantlist: __webpack_require__(/*! ./wantlist */ \"./node_modules/ipfs-http-client/src/bitswap/wantlist.js\")(send),\n stat: __webpack_require__(/*! ./stat */ \"./node_modules/ipfs-http-client/src/bitswap/stat.js\")(send),\n unwant: __webpack_require__(/*! ./unwant */ \"./node_modules/ipfs-http-client/src/bitswap/unwant.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bitswap/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bitswap/stat.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bitswap/stat.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst Big = __webpack_require__(/*! bignumber.js */ \"./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n provideBufLen: res.ProvideBufLen,\n wantlist: res.Wantlist || [],\n peers: res.Peers || [],\n blocksReceived: new Big(res.BlocksReceived),\n dataReceived: new Big(res.DataReceived),\n blocksSent: new Big(res.BlocksSent),\n dataSent: new Big(res.DataSent),\n dupBlksReceived: new Big(res.DupBlksReceived),\n dupDataReceived: new Big(res.DupDataReceived)\n })\n}\n\nmodule.exports = (send) => {\n return promisify((callback) => {\n send.andTransform({\n path: 'bitswap/stat'\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bitswap/stat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bitswap/unwant.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bitswap/unwant.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((cid, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n send({\n path: 'bitswap/unwant',\n args: cid.toBaseEncodedString(),\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bitswap/unwant.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bitswap/wantlist.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bitswap/wantlist.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((peerId, opts, callback) => {\n if (typeof (peerId) === 'function') {\n callback = peerId\n opts = {}\n peerId = null\n } else if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n if (peerId) {\n try {\n opts.peer = new CID(peerId).toBaseEncodedString()\n } catch (err) {\n return callback(err)\n }\n }\n\n send({\n path: 'bitswap/wantlist',\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bitswap/wantlist.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/block/get.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/block/get.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst Block = __webpack_require__(/*! ipfs-block */ \"./node_modules/ipfs-block/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst streamToValue = __webpack_require__(/*! ../utils/stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n\n // TODO this needs to be adjusted with the new go-ipfs http-api\n let cid\n try {\n if (CID.isCID(args)) {\n cid = args\n args = cid.toBaseEncodedString()\n } else if (Buffer.isBuffer(args)) {\n cid = new CID(args)\n args = cid.toBaseEncodedString()\n } else if (typeof args === 'string') {\n cid = new CID(args)\n } else {\n return callback(new Error('invalid argument'))\n }\n } catch (err) {\n return callback(err)\n }\n\n // Transform the response from Buffer or a Stream to a Block\n const transform = (res, callback) => {\n if (Buffer.isBuffer(res)) {\n callback(null, new Block(res, cid))\n // For empty blocks, concat-stream can't infer the encoding so we are\n // passed back an empty array\n } else if (Array.isArray(res) && res.length === 0) {\n callback(null, new Block(Buffer.alloc(0), cid))\n } else {\n streamToValue(res, (err, data) => {\n if (err) {\n return callback(err)\n }\n // For empty blocks, concat-stream can't infer the encoding so we are\n // passed back an empty array\n if (!data.length) data = Buffer.alloc(0)\n callback(null, new Block(data, cid))\n })\n }\n }\n\n const request = {\n path: 'block/get',\n args: args,\n qs: opts\n }\n\n send.andTransform(request, transform, callback)\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/block/get.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/block/index.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/block/index.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n get: __webpack_require__(/*! ./get */ \"./node_modules/ipfs-http-client/src/block/get.js\")(send),\n stat: __webpack_require__(/*! ./stat */ \"./node_modules/ipfs-http-client/src/block/stat.js\")(send),\n put: __webpack_require__(/*! ./put */ \"./node_modules/ipfs-http-client/src/block/put.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/block/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/block/put.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/block/put.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst Block = __webpack_require__(/*! ipfs-block */ \"./node_modules/ipfs-block/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file */ \"./node_modules/ipfs-http-client/src/utils/send-one-file.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'block/put')\n\n return promisify((block, options, callback) => {\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n\n options = options || {}\n\n if (Array.isArray(block)) {\n return callback(new Error('block.put accepts only one block'))\n }\n\n if (Buffer.isBuffer(block)) {\n block = { data: block }\n }\n\n if (!block || !block.data) {\n return callback(new Error('invalid block arg'))\n }\n\n const qs = {}\n\n if (block.cid || options.cid) {\n let cid\n\n try {\n cid = new CID(block.cid || options.cid)\n } catch (err) {\n return callback(err)\n }\n\n const { name, length } = multihash.decode(cid.multihash)\n\n qs.format = cid.codec\n qs.mhtype = name\n qs.mhlen = length\n qs.version = cid.version\n } else {\n if (options.format) qs.format = options.format\n if (options.mhtype) qs.mhtype = options.mhtype\n if (options.mhlen) qs.mhlen = options.mhlen\n if (options.version != null) qs.version = options.version\n }\n\n sendOneFile(block.data, { qs }, (err, result) => {\n if (err) {\n // Retry with \"protobuf\"/\"cbor\" format for go-ipfs\n // TODO: remove when https://github.com/ipfs/go-cid/issues/75 resolved\n if (qs.format === 'dag-pb' || qs.format === 'dag-cbor') {\n qs.format = qs.format === 'dag-pb' ? 'protobuf' : 'cbor'\n return sendOneFile(block.data, { qs }, (err, result) => {\n if (err) return callback(err)\n callback(null, new Block(block.data, new CID(result.Key)))\n })\n }\n\n return callback(err)\n }\n\n callback(null, new Block(block.data, new CID(result.Key)))\n })\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/block/put.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/block/stat.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/block/stat.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n // TODO this needs to be adjusted with the new go-ipfs http-api\n if (args && CID.isCID(args)) {\n args = multihash.toB58String(args.multihash)\n }\n\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n const request = {\n path: 'block/stat',\n args: args,\n qs: opts\n }\n\n // Transform the response from { Key, Size } objects to { key, size } objects\n const transform = (stats, callback) => {\n callback(null, {\n key: stats.Key,\n size: stats.Size\n })\n }\n\n send.andTransform(request, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/block/stat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bootstrap/add.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bootstrap/add.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof opts === 'function' &&\n !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' &&\n typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n if (args && typeof args === 'object') {\n opts = args\n args = undefined\n }\n\n send({\n path: 'bootstrap/add',\n args: args,\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bootstrap/add.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bootstrap/index.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bootstrap/index.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n add: __webpack_require__(/*! ./add */ \"./node_modules/ipfs-http-client/src/bootstrap/add.js\")(send),\n rm: __webpack_require__(/*! ./rm */ \"./node_modules/ipfs-http-client/src/bootstrap/rm.js\")(send),\n list: __webpack_require__(/*! ./list */ \"./node_modules/ipfs-http-client/src/bootstrap/list.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bootstrap/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bootstrap/list.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bootstrap/list.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'bootstrap/list',\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bootstrap/list.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/bootstrap/rm.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/bootstrap/rm.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof opts === 'function' &&\n !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' &&\n typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n if (args && typeof args === 'object') {\n opts = args\n args = undefined\n }\n\n send({\n path: 'bootstrap/rm',\n args: args,\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/bootstrap/rm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/commands.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/commands.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((callback) => {\n send({\n path: 'commands'\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/commands.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/config/get.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/config/get.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst toObject = function (res, callback) {\n if (Buffer.isBuffer(res)) {\n callback(null, JSON.parse(res.toString()))\n } else {\n callback(null, res)\n }\n}\n\nmodule.exports = (send) => {\n return promisify((key, callback) => {\n if (typeof key === 'function') {\n callback = key\n key = undefined\n }\n\n if (!key) {\n send.andTransform({\n path: 'config/show',\n buffer: true\n }, toObject, callback)\n return\n }\n\n send.andTransform({\n path: 'config',\n args: key,\n buffer: true\n }, toObject, (err, response) => {\n if (err) {\n return callback(err)\n }\n callback(null, response.Value)\n })\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/config/get.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/config/index.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/config/index.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n get: __webpack_require__(/*! ./get */ \"./node_modules/ipfs-http-client/src/config/get.js\")(send),\n set: __webpack_require__(/*! ./set */ \"./node_modules/ipfs-http-client/src/config/set.js\")(send),\n replace: __webpack_require__(/*! ./replace */ \"./node_modules/ipfs-http-client/src/config/replace.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/config/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/config/replace.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/config/replace.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst { Readable } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file */ \"./node_modules/ipfs-http-client/src/utils/send-one-file.js\")\n\nfunction toStream (input) {\n return new Readable({\n read () {\n this.push(input)\n this.push(null)\n }\n })\n}\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'config/replace')\n return promisify((config, callback) => {\n if (typeof config === 'object') {\n config = toStream(Buffer.from(JSON.stringify(config)))\n }\n\n sendOneFile(config, {}, callback)\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/config/replace.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/config/set.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/config/set.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((key, value, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n if (typeof key !== 'string') {\n return callback(new Error('Invalid key type'))\n }\n\n if (value === undefined || Buffer.isBuffer(value)) {\n return callback(new Error('Invalid value type'))\n }\n\n if (typeof value === 'boolean') {\n value = value.toString()\n opts = { bool: true }\n } else if (typeof value !== 'string') {\n value = JSON.stringify(value)\n opts = { json: true }\n }\n\n send({\n path: 'config',\n args: [key, value],\n qs: opts,\n files: undefined,\n buffer: true\n }, callback)\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/config/set.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dag/get.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dag/get.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst dagPB = __webpack_require__(/*! ipld-dag-pb */ \"./node_modules/ipld-dag-pb/src/index.js\")\nconst dagCBOR = __webpack_require__(/*! ipld-dag-cbor */ \"./node_modules/ipld-dag-cbor/src/index.js\")\nconst raw = __webpack_require__(/*! ipld-raw */ \"./node_modules/ipld-raw/src/index.js\")\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst waterfall = __webpack_require__(/*! async/waterfall */ \"./node_modules/async/waterfall.js\")\nconst block = __webpack_require__(/*! ../block */ \"./node_modules/ipfs-http-client/src/block/index.js\")\n\nconst resolvers = {\n 'dag-cbor': dagCBOR.resolver,\n 'dag-pb': dagPB.resolver,\n raw: raw.resolver\n}\n\nmodule.exports = (send) => {\n return promisify((cid, path, options, callback) => {\n if (typeof path === 'function') {\n callback = path\n path = undefined\n }\n\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n\n options = options || {}\n path = path || ''\n\n if (CID.isCID(cid)) {\n cid = cid.toBaseEncodedString()\n }\n\n waterfall([\n cb => {\n send({\n path: 'dag/resolve',\n args: cid + '/' + path,\n qs: options\n }, cb)\n },\n (resolved, cb) => {\n block(send).get(new CID(resolved['Cid']['/']), (err, ipfsBlock) => {\n cb(err, ipfsBlock, resolved['RemPath'])\n })\n },\n (ipfsBlock, path, cb) => {\n const dagResolver = resolvers[ipfsBlock.cid.codec]\n\n if (!dagResolver) {\n const error = new Error(`Missing IPLD format \"${ipfsBlock.cid.codec}\"`)\n error.missingMulticodec = ipfsBlock.cid.codec\n return cb(error)\n }\n\n let res\n try {\n res = dagResolver.resolve(ipfsBlock.data, path)\n } catch (err) {\n return cb(err)\n }\n\n cb(null, res)\n }\n ], callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dag/get.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dag/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dag/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n get: __webpack_require__(/*! ./get */ \"./node_modules/ipfs-http-client/src/dag/get.js\")(send),\n put: __webpack_require__(/*! ./put */ \"./node_modules/ipfs-http-client/src/dag/put.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dag/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dag/put.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dag/put.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst dagPB = __webpack_require__(/*! ipld-dag-pb */ \"./node_modules/ipld-dag-pb/src/index.js\")\nconst dagCBOR = __webpack_require__(/*! ipld-dag-cbor */ \"./node_modules/ipld-dag-cbor/src/index.js\")\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file */ \"./node_modules/ipfs-http-client/src/utils/send-one-file.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'dag/put')\n\n return promisify((dagNode, options, callback) => {\n if (typeof options === 'function') {\n callback = options\n }\n\n options = options || {}\n\n if (options.hash) {\n options.hashAlg = options.hash\n delete options.hash\n }\n\n if (options.cid && (options.format || options.hashAlg)) {\n return callback(new Error('Can\\'t put dag node. Please provide either `cid` OR `format` and `hash` options.'))\n } else if ((options.format && !options.hashAlg) || (!options.format && options.hashAlg)) {\n return callback(new Error('Can\\'t put dag node. Please provide `format` AND `hash` options.'))\n }\n\n if (options.cid) {\n let cid\n\n try {\n cid = new CID(options.cid)\n } catch (err) {\n return callback(err)\n }\n\n options.format = cid.codec\n options.hashAlg = multihash.decode(cid.multihash).name\n delete options.cid\n }\n\n const optionDefaults = {\n format: 'dag-cbor',\n hashAlg: 'sha2-256',\n inputEnc: 'raw'\n }\n\n options = Object.assign(optionDefaults, options)\n\n let serialized\n\n try {\n if (options.format === 'dag-cbor') {\n serialized = dagCBOR.util.serialize(dagNode)\n } else if (options.format === 'dag-pb') {\n serialized = dagPB.util.serialize(dagNode)\n } else {\n // FIXME Hopefully already serialized...can we use IPLD to serialise instead?\n serialized = dagNode\n }\n } catch (err) {\n return callback(err)\n }\n\n const sendOptions = {\n qs: {\n hash: options.hashAlg,\n format: options.format,\n 'input-enc': options.inputEnc\n }\n }\n\n sendOneFile(serialized, sendOptions, (err, result) => {\n if (err) {\n return callback(err)\n }\n if (result['Cid']) {\n return callback(null, new CID(result['Cid']['/']))\n } else {\n return callback(result)\n }\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dag/put.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/findpeer.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/findpeer.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValueWithTransformer = __webpack_require__(/*! ../utils/stream-to-value-with-transformer */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js\")\n\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\nconst PeerInfo = __webpack_require__(/*! peer-info */ \"./node_modules/peer-info/src/index.js\")\nconst errcode = __webpack_require__(/*! err-code */ \"./node_modules/err-code/index.js\")\n\nmodule.exports = (send) => {\n return promisify((peerId, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n const handleResult = (res, callback) => {\n // Inconsistent return values in the browser\n if (Array.isArray(res)) {\n res = res.find(r => r.Type === 2)\n }\n\n // Type 2 keys\n // 2 = FinalPeer\n // https://github.com/libp2p/go-libp2p-core/blob/6e566d10f4a5447317a66d64c7459954b969bdab/routing/query.go#L18\n if (!res || res.Type !== 2) {\n const errMsg = `key was not found (type 4)`\n return callback(errcode(new Error(errMsg), 'ERR_KEY_TYPE_4_NOT_FOUND'))\n }\n\n const responseReceived = res.Responses[0]\n const peerInfo = new PeerInfo(PeerId.createFromB58String(responseReceived.ID))\n\n responseReceived.Addrs.forEach((addr) => {\n const ma = multiaddr(addr)\n\n peerInfo.multiaddrs.add(ma)\n })\n\n callback(null, peerInfo)\n }\n\n send({\n path: 'dht/findpeer',\n args: peerId.toString(),\n qs: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n streamToValueWithTransformer(result, handleResult, callback)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/findpeer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/findprovs.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/findprovs.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValueWithTransformer = __webpack_require__(/*! ../utils/stream-to-value-with-transformer */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js\")\n\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\nconst PeerInfo = __webpack_require__(/*! peer-info */ \"./node_modules/peer-info/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((cid, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n const handleResult = (res, callback) => {\n // Inconsistent return values in the browser vs node\n if (!Array.isArray(res)) {\n res = [res]\n }\n\n let responses = []\n res.forEach(result => {\n // 4 = Provider\n if (result.Type !== 4) return\n result.Responses.forEach(response => {\n const peerInfo = new PeerInfo(PeerId.createFromB58String(response.ID))\n\n if (response.Addrs) {\n response.Addrs.forEach((addr) => {\n const ma = multiaddr(addr)\n peerInfo.multiaddrs.add(ma)\n })\n }\n\n responses.push(peerInfo)\n })\n })\n\n callback(null, responses)\n }\n\n send({\n path: 'dht/findprovs',\n args: cid.toString(),\n qs: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n streamToValueWithTransformer(result, handleResult, callback)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/findprovs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/get.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/get.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((key, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n function handleResult (done, err, res) {\n if (err) {\n return done(err)\n }\n if (!res) {\n return done(new Error('empty response'))\n }\n if (res.length === 0) {\n return done(new Error('no value returned for key'))\n }\n\n // Inconsistent return values in the browser vs node\n if (Array.isArray(res)) {\n res = res[0]\n }\n\n if (res.Type === 5) {\n done(null, res.Extra)\n } else {\n let error = new Error('key was not found (type 6)')\n done(error)\n }\n }\n\n send({\n path: 'dht/get',\n args: key,\n qs: opts\n }, handleResult.bind(null, callback))\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/get.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n get: __webpack_require__(/*! ./get */ \"./node_modules/ipfs-http-client/src/dht/get.js\")(send),\n put: __webpack_require__(/*! ./put */ \"./node_modules/ipfs-http-client/src/dht/put.js\")(send),\n findProvs: __webpack_require__(/*! ./findprovs */ \"./node_modules/ipfs-http-client/src/dht/findprovs.js\")(send),\n findPeer: __webpack_require__(/*! ./findpeer */ \"./node_modules/ipfs-http-client/src/dht/findpeer.js\")(send),\n provide: __webpack_require__(/*! ./provide */ \"./node_modules/ipfs-http-client/src/dht/provide.js\")(send),\n // find closest peerId to given peerId\n query: __webpack_require__(/*! ./query */ \"./node_modules/ipfs-http-client/src/dht/query.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/provide.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/provide.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((cids, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n if (!Array.isArray(cids)) {\n cids = [cids]\n }\n\n // Validate CID(s) and serialize\n try {\n cids = cids.map(cid => new CID(cid).toBaseEncodedString('base58btc'))\n } catch (err) {\n return callback(err)\n }\n\n send({\n path: 'dht/provide',\n args: cids,\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/provide.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/put.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/put.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((key, value, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n send({\n path: 'dht/put',\n args: [key, value],\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/put.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dht/query.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dht/query.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValueWithTransformer = __webpack_require__(/*! ../utils/stream-to-value-with-transformer */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js\")\n\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\nconst PeerInfo = __webpack_require__(/*! peer-info */ \"./node_modules/peer-info/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((peerId, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n const handleResult = (res, callback) => {\n const peerIds = res.map((r) => (new PeerInfo(PeerId.createFromB58String(r.ID))))\n\n callback(null, peerIds)\n }\n\n send({\n path: 'dht/query',\n args: peerId,\n qs: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n streamToValueWithTransformer(result, handleResult, callback)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dht/query.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/diag/cmds.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/diag/cmds.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send({\n path: 'diag/cmds',\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/diag/cmds.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/diag/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/diag/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n net: __webpack_require__(/*! ./net */ \"./node_modules/ipfs-http-client/src/diag/net.js\")(send),\n sys: __webpack_require__(/*! ./sys */ \"./node_modules/ipfs-http-client/src/diag/sys.js\")(send),\n cmds: __webpack_require__(/*! ./cmds */ \"./node_modules/ipfs-http-client/src/diag/cmds.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/diag/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/diag/net.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/diag/net.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send({\n path: 'diag/net',\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/diag/net.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/diag/sys.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/diag/sys.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send({\n path: 'diag/sys',\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/diag/sys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/dns.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/dns.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nconst transform = function (res, callback) {\n callback(null, res.Path)\n}\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'dns',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/dns.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/cp.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/cp.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst findSources = __webpack_require__(/*! ../utils/find-sources */ \"./node_modules/ipfs-http-client/src/utils/find-sources.js\")\n\nmodule.exports = (send) => {\n return promisify(function () {\n const {\n callback,\n sources,\n opts\n } = findSources(Array.prototype.slice.call(arguments))\n\n send({\n path: 'files/cp',\n args: sources,\n qs: opts\n }, (error) => callback(error))\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/cp.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/flush.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/flush.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, callback) => {\n if (typeof args === 'function') {\n callback = args\n args = '/'\n }\n\n return send({\n path: 'files/flush',\n args: args\n }, (error) => callback(error))\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/flush.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/index.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/index.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n cp: __webpack_require__(/*! ./cp */ \"./node_modules/ipfs-http-client/src/files-mfs/cp.js\")(send),\n mkdir: __webpack_require__(/*! ./mkdir */ \"./node_modules/ipfs-http-client/src/files-mfs/mkdir.js\")(send),\n flush: __webpack_require__(/*! ./flush */ \"./node_modules/ipfs-http-client/src/files-mfs/flush.js\")(send),\n stat: __webpack_require__(/*! ./stat */ \"./node_modules/ipfs-http-client/src/files-mfs/stat.js\")(send),\n rm: __webpack_require__(/*! ./rm */ \"./node_modules/ipfs-http-client/src/files-mfs/rm.js\")(send),\n ls: __webpack_require__(/*! ./ls */ \"./node_modules/ipfs-http-client/src/files-mfs/ls.js\")(send),\n lsReadableStream: __webpack_require__(/*! ./ls-readable-stream */ \"./node_modules/ipfs-http-client/src/files-mfs/ls-readable-stream.js\")(send),\n lsPullStream: __webpack_require__(/*! ./ls-pull-stream */ \"./node_modules/ipfs-http-client/src/files-mfs/ls-pull-stream.js\")(send),\n read: __webpack_require__(/*! ./read */ \"./node_modules/ipfs-http-client/src/files-mfs/read.js\")(send),\n readReadableStream: __webpack_require__(/*! ./read-readable-stream */ \"./node_modules/ipfs-http-client/src/files-mfs/read-readable-stream.js\")(send),\n readPullStream: __webpack_require__(/*! ./read-pull-stream */ \"./node_modules/ipfs-http-client/src/files-mfs/read-pull-stream.js\")(send),\n write: __webpack_require__(/*! ./write */ \"./node_modules/ipfs-http-client/src/files-mfs/write.js\")(send),\n mv: __webpack_require__(/*! ./mv */ \"./node_modules/ipfs-http-client/src/files-mfs/mv.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/ls-pull-stream.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/ls-pull-stream.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst lsReadableStream = __webpack_require__(/*! ./ls-readable-stream */ \"./node_modules/ipfs-http-client/src/files-mfs/ls-readable-stream.js\")\n\nmodule.exports = (send) => {\n return (args, opts) => {\n opts = opts || {}\n\n return toPull.source(lsReadableStream(send)(args, opts))\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/ls-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/ls-readable-stream.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/ls-readable-stream.js ***!
|
||
\***************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst {\n Transform,\n PassThrough\n} = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst ndjson = __webpack_require__(/*! ndjson */ \"./node_modules/ndjson/index.js\")\nconst isStream = __webpack_require__(/*! is-stream */ \"./node_modules/is-stream/index.js\")\n\nconst toEntry = (entry) => {\n return {\n name: entry.Name,\n type: entry.Type,\n size: entry.Size,\n hash: entry.Hash\n }\n}\n\nmodule.exports = (send) => {\n return (args, opts) => {\n opts = opts || {}\n\n const transform = new Transform({\n objectMode: true,\n\n transform (entry, encoding, callback) {\n callback(null, toEntry(entry))\n }\n })\n\n const output = new PassThrough({\n objectMode: true\n })\n\n send({\n path: 'files/ls',\n args: args,\n qs: Object.assign({}, opts, { stream: true })\n }, (err, res) => {\n if (err) {\n return output.destroy(err)\n }\n\n if (isStream(res)) {\n const parse = ndjson.parse()\n\n pump(res, parse, transform, output)\n } else {\n const entries = res.Entries || []\n\n entries.forEach((entry) => {\n output.write(toEntry(entry))\n })\n\n output.end()\n }\n })\n\n return output\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/ls-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/ls.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/ls.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n const entries = res.Entries || []\n\n callback(null, entries.map((entry) => {\n return {\n name: entry.Name,\n type: entry.Type,\n size: entry.Size,\n hash: entry.Hash\n }\n }))\n}\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n if (typeof (args) === 'function') {\n callback = args\n opts = {}\n args = null\n }\n\n return send.andTransform({\n path: 'files/ls',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/ls.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/mkdir.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/mkdir.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'files/mkdir',\n args: args,\n qs: opts\n }, (error) => callback(error))\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/mkdir.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/mv.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/mv.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst findSources = __webpack_require__(/*! ../utils/find-sources */ \"./node_modules/ipfs-http-client/src/utils/find-sources.js\")\n\nmodule.exports = (send) => {\n return promisify(function () {\n const {\n callback,\n sources,\n opts\n } = findSources(Array.prototype.slice.call(arguments))\n\n send({\n path: 'files/mv',\n args: sources,\n qs: opts\n }, (error) => callback(error))\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/mv.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/read-pull-stream.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/read-pull-stream.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\n\nmodule.exports = (send) => {\n return (args, opts) => {\n opts = opts || {}\n\n const p = deferred.source()\n\n send({\n path: 'files/read',\n args: args,\n qs: opts\n }, (err, stream) => {\n if (err) {\n return p.abort(err)\n }\n\n p.resolve(toPull(stream))\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/read-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/read-readable-stream.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/read-readable-stream.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\n\nmodule.exports = (send) => {\n return (args, opts) => {\n opts = opts || {}\n\n const pt = new Stream.PassThrough()\n\n send({\n path: 'files/read',\n args: args,\n qs: opts\n }, (err, stream) => {\n if (err) {\n return pt.destroy(err)\n }\n\n pump(stream, pt)\n })\n\n return pt\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/read-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/read.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/read.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValue = __webpack_require__(/*! ../utils/stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'files/read',\n args: args,\n qs: opts\n }, streamToValue, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/read.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/rm.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/rm.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((path, opts, callback) => {\n if (typeof opts === 'function' &&\n !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' &&\n typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n send({\n path: 'files/rm',\n args: path,\n qs: opts\n }, (error) => callback(error))\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/rm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/stat.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/stat.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst mapKeys = __webpack_require__(/*! just-map-keys */ \"./node_modules/just-map-keys/index.js\")\nconst kebabCase = __webpack_require__(/*! just-kebab-case */ \"./node_modules/just-kebab-case/index.js\")\n\nconst transform = function (data, callback) {\n callback(null, {\n type: data.Type,\n blocks: data.Blocks,\n size: data.Size,\n hash: data.Hash,\n cumulativeSize: data.CumulativeSize,\n withLocality: data.WithLocality || false,\n local: data.Local || undefined,\n sizeLocal: data.SizeLocal || undefined\n })\n}\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n opts = mapKeys(opts, (v, k) => kebabCase(k))\n\n send.andTransform({\n path: 'files/stat',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/stat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-mfs/write.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-mfs/write.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst concatStream = __webpack_require__(/*! concat-stream */ \"./node_modules/ipfs-http-client/node_modules/concat-stream/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst FileResultStreamConverter = __webpack_require__(/*! ../utils/file-result-stream-converter */ \"./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js\")\nconst SendFilesStream = __webpack_require__(/*! ../utils/send-files-stream */ \"./node_modules/ipfs-http-client/src/utils/send-files-stream.js\")\n\nmodule.exports = (send) => {\n const sendFilesStream = SendFilesStream(send, 'files/write')\n\n return promisify((pathDst, _files, opts, _callback) => {\n if (typeof opts === 'function' &&\n !_callback) {\n _callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' &&\n typeof _callback === 'function') {\n _callback = opts\n opts = {}\n }\n\n const files = [].concat(_files)\n const callback = once(_callback)\n\n const options = {\n args: pathDst,\n qs: opts,\n converter: FileResultStreamConverter\n }\n\n const stream = sendFilesStream({ qs: options })\n const concat = concatStream((result) => callback(null, result))\n stream.once('error', callback)\n stream.pipe(concat)\n\n files.forEach((file) => stream.write(file))\n stream.end()\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-mfs/write.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/add-from-fs.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/add-from-fs.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst isNode = __webpack_require__(/*! detect-node */ \"./node_modules/detect-node/browser.js\")\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file-multiple-results */ \"./node_modules/ipfs-http-client/src/utils/send-one-file-multiple-results.js\")\nconst FileResultStreamConverter = __webpack_require__(/*! ../utils/file-result-stream-converter */ \"./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'add')\n\n return promisify((path, opts, callback) => {\n if (typeof opts === 'function' &&\n callback === undefined) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' &&\n typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n if (!isNode) {\n return callback(new Error('fsAdd does not work in the browser'))\n }\n\n if (typeof path !== 'string') {\n return callback(new Error('\"path\" must be a string'))\n }\n\n const requestOpts = {\n qs: opts,\n converter: FileResultStreamConverter\n }\n sendOneFile(path, requestOpts, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/add-from-fs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/add-from-url.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/add-from-url.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst { URL } = __webpack_require__(/*! iso-url */ \"./node_modules/iso-url/index.js\")\nconst { getRequest } = __webpack_require__(/*! iso-stream-http */ \"./node_modules/iso-stream-http/index.browser.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file-multiple-results */ \"./node_modules/ipfs-http-client/src/utils/send-one-file-multiple-results.js\")\nconst FileResultStreamConverter = __webpack_require__(/*! ../utils/file-result-stream-converter */ \"./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'add')\n\n return promisify((url, opts, callback) => {\n if (typeof (opts) === 'function' &&\n callback === undefined) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' &&\n typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n if (!validUrl(url)) {\n return callback(new Error('\"url\" param must be an http(s) url'))\n }\n\n requestWithRedirect(url, opts, sendOneFile, callback)\n })\n}\n\nconst validUrl = (url) => typeof url === 'string' && url.startsWith('http')\n\nconst requestWithRedirect = (url, opts, sendOneFile, callback) => {\n const parsedUrl = new URL(url)\n\n const req = getRequest(parsedUrl, (res) => {\n if (res.statusCode >= 400) {\n return callback(new Error(`Failed to download with ${res.statusCode}`))\n }\n\n const redirection = res.headers.location\n\n if (res.statusCode >= 300 && res.statusCode < 400 && redirection) {\n if (!validUrl(redirection)) {\n return callback(new Error('redirection url must be an http(s) url'))\n }\n\n requestWithRedirect(redirection, opts, sendOneFile, callback)\n } else {\n const requestOpts = {\n qs: opts,\n converter: FileResultStreamConverter\n }\n const fileName = decodeURIComponent(parsedUrl.pathname.split('/').pop())\n\n sendOneFile({\n content: res,\n path: fileName\n }, requestOpts, callback)\n }\n })\n\n req.once('error', callback)\n\n req.end()\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/add-from-url.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/add-pull-stream.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/add-pull-stream.js ***!
|
||
\****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst SendFilesStream = __webpack_require__(/*! ../utils/send-files-stream */ \"./node_modules/ipfs-http-client/src/utils/send-files-stream.js\")\nconst FileResultStreamConverter = __webpack_require__(/*! ../utils/file-result-stream-converter */ \"./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js\")\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\n\nmodule.exports = (send) => {\n return (options) => {\n options = options || {}\n options.converter = FileResultStreamConverter\n return toPull(SendFilesStream(send, 'add')({ qs: options }))\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/add-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/add-readable-stream.js":
|
||
/*!********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/add-readable-stream.js ***!
|
||
\********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst SendFilesStream = __webpack_require__(/*! ../utils/send-files-stream */ \"./node_modules/ipfs-http-client/src/utils/send-files-stream.js\")\nconst FileResultStreamConverter = __webpack_require__(/*! ../utils/file-result-stream-converter */ \"./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js\")\n\nmodule.exports = (send) => {\n return (options) => {\n options = options || {}\n options.converter = FileResultStreamConverter\n return SendFilesStream(send, 'add')(options)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/add-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/add.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/add.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst ConcatStream = __webpack_require__(/*! concat-stream */ \"./node_modules/ipfs-http-client/node_modules/concat-stream/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst { isSource } = __webpack_require__(/*! is-pull-stream */ \"./node_modules/is-pull-stream/index.js\")\nconst FileResultStreamConverter = __webpack_require__(/*! ../utils/file-result-stream-converter */ \"./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js\")\nconst SendFilesStream = __webpack_require__(/*! ../utils/send-files-stream */ \"./node_modules/ipfs-http-client/src/utils/send-files-stream.js\")\nconst validateAddInput = __webpack_require__(/*! ipfs-utils/src/files/add-input-validation */ \"./node_modules/ipfs-utils/src/files/add-input-validation.js\")\n\nmodule.exports = (send) => {\n const createAddStream = SendFilesStream(send, 'add')\n\n const add = promisify((_files, options, _callback) => {\n if (typeof options === 'function') {\n _callback = options\n options = null\n }\n const callback = once(_callback)\n\n if (!options) {\n options = {}\n }\n options.converter = FileResultStreamConverter\n\n try {\n validateAddInput(_files)\n } catch (err) {\n return callback(err)\n }\n\n const files = [].concat(_files)\n\n const stream = createAddStream({ qs: options })\n const concat = ConcatStream((result) => callback(null, result))\n stream.once('error', callback)\n stream.pipe(concat)\n\n files.forEach((file) => stream.write(file))\n stream.end()\n })\n\n return function () {\n const args = Array.from(arguments)\n\n // If we files.add(<pull stream>), then promisify thinks the pull stream is\n // a callback! Add an empty options object in this case so that a promise\n // is returned.\n if (args.length === 1 && isSource(args[0])) {\n args.push({})\n }\n\n return add.apply(null, args)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/add.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/cat-pull-stream.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/cat-pull-stream.js ***!
|
||
\****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\nconst v = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\n\nmodule.exports = (send) => {\n return (hash, opts) => {\n opts = opts || {}\n\n const p = deferred.source()\n\n try {\n hash = cleanCID(hash)\n } catch (err) {\n if (!v.ipfsPath(hash)) {\n return p.end(err)\n }\n }\n\n const query = {\n offset: opts.offset,\n length: opts.length\n }\n\n send({ path: 'cat', args: hash, buffer: opts.buffer, qs: query }, (err, stream) => {\n if (err) { return p.end(err) }\n\n p.resolve(toPull(stream))\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/cat-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/cat-readable-stream.js":
|
||
/*!********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/cat-readable-stream.js ***!
|
||
\********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\nconst v = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\n\nmodule.exports = (send) => {\n return (hash, opts) => {\n opts = opts || {}\n\n const pt = new Stream.PassThrough()\n\n try {\n hash = cleanCID(hash)\n } catch (err) {\n if (!v.ipfsPath(hash)) {\n return pt.destroy(err)\n }\n }\n\n const query = {\n offset: opts.offset,\n length: opts.length\n }\n\n send({ path: 'cat', args: hash, buffer: opts.buffer, qs: query }, (err, stream) => {\n if (err) { return pt.destroy(err) }\n\n pump(stream, pt)\n })\n\n return pt\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/cat-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/cat.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/cat.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\nconst v = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst bl = __webpack_require__(/*! bl */ \"./node_modules/bl/bl.js\")\n\nmodule.exports = (send) => {\n return promisify((hash, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n\n try {\n hash = cleanCID(hash)\n } catch (err) {\n if (!v.ipfsPath(hash)) {\n return callback(err)\n }\n }\n\n const query = {\n offset: opts.offset,\n length: opts.length\n }\n\n send({ path: 'cat', args: hash, buffer: opts.buffer, qs: query }, (err, stream) => {\n if (err) { return callback(err) }\n\n stream.pipe(bl((err, data) => {\n if (err) { return callback(err) }\n\n callback(null, data)\n }))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/cat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/get-pull-stream.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/get-pull-stream.js ***!
|
||
\****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\nconst TarStreamToObjects = __webpack_require__(/*! ../utils/tar-stream-to-objects */ \"./node_modules/ipfs-http-client/src/utils/tar-stream-to-objects.js\")\nconst v = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst pull = __webpack_require__(/*! pull-stream/pull */ \"./node_modules/pull-stream/pull.js\")\nconst map = __webpack_require__(/*! pull-stream/throughs/map */ \"./node_modules/pull-stream/throughs/map.js\")\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\n\nmodule.exports = (send) => {\n return (path, opts) => {\n opts = opts || {}\n\n const p = deferred.source()\n\n try {\n path = cleanCID(path)\n } catch (err) {\n if (!v.ipfsPath(path)) {\n return p.end(err)\n }\n }\n\n const request = { path: 'get', args: path, qs: opts }\n\n // Convert the response stream to TarStream objects\n send.andTransform(request, TarStreamToObjects, (err, stream) => {\n if (err) { return p.end(err) }\n\n p.resolve(\n pull(\n toPull.source(stream),\n map(file => {\n const { path, content } = file\n return content ? { path, content: toPull.source(content) } : file\n })\n )\n )\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/get-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/get-readable-stream.js":
|
||
/*!********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/get-readable-stream.js ***!
|
||
\********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\nconst TarStreamToObjects = __webpack_require__(/*! ../utils/tar-stream-to-objects */ \"./node_modules/ipfs-http-client/src/utils/tar-stream-to-objects.js\")\nconst v = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\n\nmodule.exports = (send) => {\n return (path, opts) => {\n opts = opts || {}\n\n const pt = new Stream.PassThrough({ objectMode: true })\n\n try {\n path = cleanCID(path)\n } catch (err) {\n if (!v.ipfsPath(path)) {\n return pt.destroy(err)\n }\n }\n\n const request = { path: 'get', args: path, qs: opts }\n\n // Convert the response stream to TarStream objects\n send.andTransform(request, TarStreamToObjects, (err, stream) => {\n if (err) { return pt.destroy(err) }\n\n pump(stream, pt)\n })\n\n return pt\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/get-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/get.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/get.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\nconst TarStreamToObjects = __webpack_require__(/*! ../utils/tar-stream-to-objects */ \"./node_modules/ipfs-http-client/src/utils/tar-stream-to-objects.js\")\nconst concat = __webpack_require__(/*! concat-stream */ \"./node_modules/ipfs-http-client/node_modules/concat-stream/index.js\")\nconst through = __webpack_require__(/*! through2 */ \"./node_modules/ipfs-http-client/node_modules/through2/through2.js\")\nconst v = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((path, opts, callback) => {\n if (typeof opts === 'function' && !callback) {\n callback = opts\n opts = {}\n }\n\n // opts is the real callback --\n // 'callback' is being injected by promisify\n if (typeof opts === 'function' && typeof callback === 'function') {\n callback = opts\n opts = {}\n }\n\n try {\n path = cleanCID(path)\n } catch (err) {\n if (!v.ipfsPath(path)) {\n return callback(err)\n }\n }\n\n const request = { path: 'get', args: path, qs: opts }\n\n // Convert the response stream to TarStream objects\n send.andTransform(request, TarStreamToObjects, (err, stream) => {\n if (err) { return callback(err) }\n\n const files = []\n\n stream.pipe(through.obj((file, enc, next) => {\n if (file.content) {\n file.content.pipe(concat((content) => {\n files.push({ path: file.path, content: content })\n }))\n } else {\n files.push(file)\n }\n next()\n }, () => callback(null, files)))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/get.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/ls-pull-stream.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/ls-pull-stream.js ***!
|
||
\***************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst values = __webpack_require__(/*! pull-stream/sources/values */ \"./node_modules/pull-stream/sources/values.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\nconst IsIpfs = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return (args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n try {\n args = cleanCID(args)\n } catch (err) {\n if (!IsIpfs.ipfsPath(args)) {\n return callback(err)\n }\n }\n\n const p = deferred.source()\n\n send({ path: 'ls', args: args, qs: opts }, (err, results) => {\n if (err) {\n return callback(err)\n }\n\n let result = results.Objects\n if (!result) {\n return callback(new Error('expected .Objects in results'))\n }\n\n result = result[0]\n if (!result) {\n return callback(new Error('expected one array in results.Objects'))\n }\n\n result = result.Links\n if (!Array.isArray(result)) {\n return callback(new Error('expected one array in results.Objects[0].Links'))\n }\n\n result = result.map((link) => ({\n depth: 1,\n name: link.Name,\n path: args + '/' + link.Name,\n size: link.Size,\n hash: link.Hash,\n type: typeOf(link)\n }))\n\n p.resolve(values(result))\n })\n\n return p\n }\n}\n\nfunction typeOf (link) {\n switch (link.Type) {\n case 1:\n case 5:\n return 'dir'\n case 2:\n return 'file'\n default:\n return 'unknown'\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/ls-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/ls-readable-stream.js":
|
||
/*!*******************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/ls-readable-stream.js ***!
|
||
\*******************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst IsIpfs = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return (args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n try {\n args = cleanCID(args)\n } catch (err) {\n if (!IsIpfs.ipfsPath(args)) {\n return callback(err)\n }\n }\n\n const pt = new Stream.PassThrough({ objectMode: true })\n\n send({ path: 'ls', args: args, qs: opts }, (err, results) => {\n if (err) { return callback(err) }\n\n let result = results.Objects\n if (!result) {\n return callback(new Error('expected .Objects in results'))\n }\n\n result = result[0]\n if (!result) {\n return callback(new Error('expected one array in results.Objects'))\n }\n\n result = result.Links\n if (!Array.isArray(result)) {\n return callback(new Error('expected one array in results.Objects[0].Links'))\n }\n\n result = result.map((link) => ({\n depth: 1,\n name: link.Name,\n path: args + '/' + link.Name,\n size: link.Size,\n hash: link.Hash,\n type: typeOf(link)\n }))\n\n result.forEach((item) => pt.write(item))\n pt.end()\n })\n\n return pt\n }\n}\n\nfunction typeOf (link) {\n switch (link.Type) {\n case 1:\n case 5:\n return 'dir'\n case 2:\n return 'file'\n default:\n return 'unknown'\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/ls-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/ls.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/ls.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst IsIpfs = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n try {\n args = cleanCID(args)\n } catch (err) {\n if (!IsIpfs.ipfsPath(args)) {\n return callback(err)\n }\n }\n\n send({\n path: 'ls',\n args: args,\n qs: opts\n }, (err, results) => {\n if (err) {\n return callback(err)\n }\n\n let result = results.Objects\n if (!result) {\n return callback(new Error('expected .Objects in results'))\n }\n\n result = result[0]\n if (!result) {\n return callback(new Error('expected one array in results.Objects'))\n }\n\n result = result.Links\n if (!Array.isArray(result)) {\n return callback(new Error('expected one array in results.Objects[0].Links'))\n }\n\n result = result.map((link) => ({\n name: link.Name,\n path: args + '/' + link.Name,\n size: link.Size,\n hash: link.Hash,\n type: typeOf(link),\n depth: link.Depth || 1\n }))\n\n callback(null, result)\n })\n })\n}\n\nfunction typeOf (link) {\n switch (link.Type) {\n case 1:\n case 5:\n return 'dir'\n case 2:\n return 'file'\n default:\n return 'unknown'\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/ls.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/refs-local-pull-stream.js":
|
||
/*!***********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/refs-local-pull-stream.js ***!
|
||
\***********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst pull = __webpack_require__(/*! pull-stream */ \"./node_modules/pull-stream/index.js\")\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (send) => {\n send = moduleConfig(send)\n\n return (opts) => {\n opts = opts || {}\n\n const p = deferred.source()\n\n send({ path: 'refs/local', qs: opts }, (err, stream) => {\n if (err) { return p.resolve(pull.error(err)) }\n\n p.resolve(pull(\n toPull.source(stream),\n pull.map(r => ({ ref: r.Ref, err: r.Err }))\n ))\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/refs-local-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/refs-local-readable-stream.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/refs-local-readable-stream.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst through = __webpack_require__(/*! through2 */ \"./node_modules/ipfs-http-client/node_modules/through2/through2.js\")\n\nmodule.exports = (send) => {\n return (opts) => {\n opts = opts || {}\n\n const pt = new Stream.PassThrough({ objectMode: true })\n\n send({ path: 'refs/local', qs: opts }, (err, stream) => {\n if (err) { return pt.destroy(err) }\n\n stream.once('error', (err) => pt.destroy(err))\n\n pump(stream, through.obj(function (r, enc, cb) {\n cb(null, { ref: r.Ref, err: r.Err })\n }), pt)\n })\n\n return pt\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/refs-local-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/refs-local.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/refs-local.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValueWithTransformer = __webpack_require__(/*! ../utils/stream-to-value-with-transformer */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js\")\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n const transform = (res, cb) => {\n cb(null, res.map(r => ({ ref: r.Ref, err: r.Err })))\n }\n\n const request = {\n path: 'refs/local',\n qs: opts\n }\n send(request, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n streamToValueWithTransformer(result, transform, callback)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/refs-local.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/refs-pull-stream.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/refs-pull-stream.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst pull = __webpack_require__(/*! pull-stream */ \"./node_modules/pull-stream/index.js\")\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst { checkArgs, normalizeOpts } = __webpack_require__(/*! ./refs */ \"./node_modules/ipfs-http-client/src/files-regular/refs.js\")\n\nmodule.exports = (send) => {\n send = moduleConfig(send)\n\n return (args, opts) => {\n opts = normalizeOpts(opts)\n\n const p = deferred.source()\n\n try {\n args = checkArgs(args)\n } catch (err) {\n return p.end(err)\n }\n\n send({ path: 'refs', args, qs: opts }, (err, stream) => {\n if (err) { return p.resolve(pull.error(err)) }\n\n p.resolve(pull(\n toPull.source(stream),\n pull.map(r => ({ ref: r.Ref, err: r.Err }))\n ))\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/refs-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/refs-readable-stream.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/refs-readable-stream.js ***!
|
||
\*********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst through = __webpack_require__(/*! through2 */ \"./node_modules/ipfs-http-client/node_modules/through2/through2.js\")\nconst { checkArgs, normalizeOpts } = __webpack_require__(/*! ./refs */ \"./node_modules/ipfs-http-client/src/files-regular/refs.js\")\n\nmodule.exports = (send) => {\n return (args, opts) => {\n opts = normalizeOpts(opts)\n\n const pt = new Stream.PassThrough({ objectMode: true })\n\n try {\n args = checkArgs(args)\n } catch (err) {\n return pt.destroy(err)\n }\n\n send({ path: 'refs', args, qs: opts }, (err, stream) => {\n if (err) { return pt.destroy(err) }\n\n stream.once('error', (err) => pt.destroy(err))\n\n pump(stream, through.obj(function (r, enc, cb) {\n cb(null, { ref: r.Ref, err: r.Err })\n }), pt)\n })\n\n return pt\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/refs-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/files-regular/refs.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/files-regular/refs.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst IsIpfs = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValueWithTransformer = __webpack_require__(/*! ../utils/stream-to-value-with-transformer */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js\")\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst cleanCID = __webpack_require__(/*! ../utils/clean-cid */ \"./node_modules/ipfs-http-client/src/utils/clean-cid.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n const refs = promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n opts = module.exports.normalizeOpts(opts)\n\n try {\n args = module.exports.checkArgs(args)\n } catch (err) {\n return callback(err)\n }\n\n const transform = (res, cb) => {\n cb(null, res.map(r => ({ ref: r.Ref, err: r.Err })))\n }\n\n const request = {\n args,\n path: 'refs',\n qs: opts\n }\n send(request, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n streamToValueWithTransformer(result, transform, callback)\n })\n })\n\n refs.local = __webpack_require__(/*! ./refs-local */ \"./node_modules/ipfs-http-client/src/files-regular/refs-local.js\")(arg)\n refs.localReadableStream = __webpack_require__(/*! ./refs-local-readable-stream */ \"./node_modules/ipfs-http-client/src/files-regular/refs-local-readable-stream.js\")(arg)\n refs.localPullStream = __webpack_require__(/*! ./refs-local-pull-stream */ \"./node_modules/ipfs-http-client/src/files-regular/refs-local-pull-stream.js\")(arg)\n\n return refs\n}\n\nmodule.exports.checkArgs = (args) => {\n const isArray = Array.isArray(args)\n args = isArray ? args : [args]\n\n const res = []\n for (let arg of args) {\n try {\n arg = cleanCID(arg)\n } catch (err) {\n if (!IsIpfs.ipfsPath(arg)) {\n throw err\n }\n }\n res.push(arg)\n }\n\n return isArray ? res : res[0]\n}\n\nmodule.exports.normalizeOpts = (opts) => {\n opts = opts || {}\n if (typeof opts.maxDepth === 'number') {\n opts['max-depth'] = opts.maxDepth\n }\n return opts\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/files-regular/refs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/get-endpoint-config.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/get-endpoint-config.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = (config) => {\n return () => ({\n host: config.host,\n port: config.port,\n protocol: config.protocol,\n 'api-path': config['api-path']\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/get-endpoint-config.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/id.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/id.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = undefined\n }\n send({\n path: 'id',\n args: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n const identity = {\n id: result.ID,\n publicKey: result.PublicKey,\n addresses: result.Addresses,\n agentVersion: result.AgentVersion,\n protocolVersion: result.ProtocolVersion\n }\n callback(null, identity)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/id.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n/* global self */\n\nconst isIPFS = __webpack_require__(/*! is-ipfs */ \"./node_modules/is-ipfs/src/index.js\")\nconst { Buffer } = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\nconst multibase = __webpack_require__(/*! multibase */ \"./node_modules/multibase/src/index.js\")\nconst multicodec = __webpack_require__(/*! multicodec */ \"./node_modules/multicodec/src/index.js\")\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\nconst PeerInfo = __webpack_require__(/*! peer-info */ \"./node_modules/peer-info/src/index.js\")\nconst loadCommands = __webpack_require__(/*! ./utils/load-commands */ \"./node_modules/ipfs-http-client/src/utils/load-commands.js\")\nconst getConfig = __webpack_require__(/*! ./utils/default-config */ \"./node_modules/ipfs-http-client/src/utils/default-config.js\")\nconst sendRequest = __webpack_require__(/*! ./utils/send-request */ \"./node_modules/ipfs-http-client/src/utils/send-request.js\")\n\nfunction ipfsClient (hostOrMultiaddr, port, userOptions) {\n // convert all three params to objects that we can merge.\n let options = {}\n\n if (!hostOrMultiaddr) {\n // autoconfigure host and port in browser\n if (typeof self !== 'undefined') {\n options = urlToOptions(self.location)\n }\n } else if (multiaddr.isMultiaddr(hostOrMultiaddr)) {\n options = maToOptions(hostOrMultiaddr)\n } else if (typeof hostOrMultiaddr === 'object') {\n options = hostOrMultiaddr\n } else if (typeof hostOrMultiaddr === 'string') {\n if (hostOrMultiaddr[0] === '/') {\n // throws if multiaddr is malformed or can't be converted to a nodeAddress\n options = maToOptions(multiaddr(hostOrMultiaddr))\n } else {\n // hostOrMultiaddr is domain or ip address as a string\n options.host = hostOrMultiaddr\n }\n }\n\n if (port && typeof port !== 'object') {\n port = { port: port }\n }\n\n const config = Object.assign(getConfig(), options, port, userOptions)\n const requestAPI = sendRequest(config)\n const cmds = loadCommands(requestAPI, config)\n cmds.send = requestAPI\n\n return cmds\n}\n\nfunction maToOptions (multiaddr) {\n // ma.nodeAddress() throws if multiaddr can't be converted to a nodeAddress\n const nodeAddr = multiaddr.nodeAddress()\n const protos = multiaddr.protos()\n // only http and https are allowed as protocol,\n // anything else will be replaced with http\n const exitProtocol = protos[protos.length - 1].name\n return {\n host: nodeAddr.address,\n port: nodeAddr.port,\n protocol: exitProtocol.startsWith('http') ? exitProtocol : 'http'\n }\n}\n\nfunction urlToOptions (url) {\n return {\n host: url.hostname,\n port: url.port || (url.protocol.startsWith('https') ? 443 : 80),\n protocol: url.protocol.startsWith('http') ? url.protocol.split(':')[0] : 'http'\n }\n}\n\nmodule.exports = ipfsClient\n\nObject.assign(module.exports, { isIPFS, Buffer, CID, multiaddr, multibase, multicodec, multihash, PeerId, PeerInfo })\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/export.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/export.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((name, password, callback) => {\n send({\n path: 'key/export',\n args: name,\n qs: { password: password }\n }, (err, pem) => {\n if (err) return callback(err)\n callback(null, pem.toString())\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/export.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/gen.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/gen.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n id: res.Id,\n name: res.Name\n })\n}\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'key/gen',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/gen.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/import.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/import.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n id: res.Id,\n name: res.Name\n })\n}\n\nmodule.exports = (send) => {\n return promisify((name, pem, password, callback) => {\n send.andTransform({\n path: 'key/import',\n args: name,\n qs: {\n pem: pem,\n password: password\n }\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/import.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n gen: __webpack_require__(/*! ./gen */ \"./node_modules/ipfs-http-client/src/key/gen.js\")(send),\n list: __webpack_require__(/*! ./list */ \"./node_modules/ipfs-http-client/src/key/list.js\")(send),\n rename: __webpack_require__(/*! ./rename */ \"./node_modules/ipfs-http-client/src/key/rename.js\")(send),\n rm: __webpack_require__(/*! ./rm */ \"./node_modules/ipfs-http-client/src/key/rm.js\")(send),\n export: __webpack_require__(/*! ./export */ \"./node_modules/ipfs-http-client/src/key/export.js\")(send),\n import: __webpack_require__(/*! ./import */ \"./node_modules/ipfs-http-client/src/key/import.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/list.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/list.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, res.Keys.map(key => {\n return {\n id: key.Id,\n name: key.Name\n }\n }))\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'key/list',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/list.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/rename.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/rename.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n id: res.Id,\n was: res.Was,\n now: res.Now,\n overwrite: res.Overwrite\n })\n}\n\nmodule.exports = (send) => {\n return promisify((oldName, newName, callback) => {\n send.andTransform({\n path: 'key/rename',\n args: [oldName, newName]\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/rename.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/key/rm.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/key/rm.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n id: res.Keys[0].Id,\n name: res.Keys[0].Name\n })\n}\n\nmodule.exports = (send) => {\n return promisify((args, callback) => {\n send.andTransform({\n path: 'key/rm',\n args: args\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/key/rm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/log/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/log/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n tail: __webpack_require__(/*! ./tail */ \"./node_modules/ipfs-http-client/src/log/tail.js\")(send),\n ls: __webpack_require__(/*! ./ls */ \"./node_modules/ipfs-http-client/src/log/ls.js\")(send),\n level: __webpack_require__(/*! ./level */ \"./node_modules/ipfs-http-client/src/log/level.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/log/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/log/level.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/log/level.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((subsystem, level, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n if (typeof subsystem !== 'string') {\n return callback(new Error('Invalid subsystem type'))\n }\n\n if (typeof level !== 'string') {\n return callback(new Error('Invalid level type'))\n }\n\n send({\n path: 'log/level',\n args: [subsystem, level],\n qs: opts,\n files: undefined,\n buffer: true\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/log/level.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/log/ls.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/log/ls.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((callback) => {\n send({\n path: 'log/ls'\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, result.Strings)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/log/ls.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/log/tail.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/log/tail.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst ndjson = __webpack_require__(/*! ndjson */ \"./node_modules/ndjson/index.js\")\n\nmodule.exports = (send) => {\n return promisify((callback) => {\n return send({\n path: 'log/tail'\n }, (err, response) => {\n if (err) {\n return callback(err)\n }\n const outputStream = ndjson.parse()\n pump(response, outputStream)\n callback(null, outputStream)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/log/tail.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/mount.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/mount.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((ipfs, ipns, callback) => {\n if (typeof ipfs === 'function') {\n callback = ipfs\n ipfs = null\n } else if (typeof ipns === 'function') {\n callback = ipns\n ipns = null\n }\n const opts = {}\n if (ipfs) {\n opts.f = ipfs\n }\n if (ipns) {\n opts.n = ipns\n }\n\n send({\n path: 'mount',\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/mount.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n publish: __webpack_require__(/*! ./publish */ \"./node_modules/ipfs-http-client/src/name/publish.js\")(send),\n resolve: __webpack_require__(/*! ./resolve */ \"./node_modules/ipfs-http-client/src/name/resolve.js\")(send),\n pubsub: __webpack_require__(/*! ./pubsub */ \"./node_modules/ipfs-http-client/src/name/pubsub/index.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/publish.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/publish.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n name: res.Name,\n value: res.Value\n })\n}\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'name/publish',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/publish.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/pubsub/cancel.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/pubsub/cancel.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n canceled: res.Canceled === undefined || res.Canceled === true\n })\n}\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'name/pubsub/cancel',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/pubsub/cancel.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/pubsub/index.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/pubsub/index.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = (send) => ({\n cancel: __webpack_require__(/*! ./cancel */ \"./node_modules/ipfs-http-client/src/name/pubsub/cancel.js\")(send),\n state: __webpack_require__(/*! ./state */ \"./node_modules/ipfs-http-client/src/name/pubsub/state.js\")(send),\n subs: __webpack_require__(/*! ./subs */ \"./node_modules/ipfs-http-client/src/name/pubsub/subs.js\")(send)\n})\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/pubsub/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/pubsub/state.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/pubsub/state.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n enabled: res.Enabled\n })\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'name/pubsub/state',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/pubsub/state.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/pubsub/subs.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/pubsub/subs.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, res.Strings || [])\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'name/pubsub/subs',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/pubsub/subs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/name/resolve.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/name/resolve.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, res.Path)\n}\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'name/resolve',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/name/resolve.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/addLink.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/addLink.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((cid, dLink, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n if (!opts) {\n opts = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n const args = [\n cid.toString(),\n dLink.Name || dLink.name || null,\n (dLink.Hash || dLink.cid || '').toString() || null\n ]\n\n send({ path: 'object/patch/add-link', args }, (err, result) => {\n if (err) {\n return callback(err)\n }\n callback(null, new CID(result.Hash))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/addLink.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/appendData.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/appendData.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file */ \"./node_modules/ipfs-http-client/src/utils/send-one-file.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'object/patch/append-data')\n\n return promisify((cid, data, opts, _callback) => {\n if (typeof opts === 'function') {\n _callback = opts\n opts = {}\n }\n const callback = once(_callback)\n if (!opts) {\n opts = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n sendOneFile(data, { args: [cid.toString()] }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new CID(result.Hash))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/appendData.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/data.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/data.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValue = __webpack_require__(/*! ../utils/stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst LRU = __webpack_require__(/*! lru-cache */ \"./node_modules/ipfs-http-client/node_modules/lru-cache/index.js\")\nconst lruOptions = {\n max: 128\n}\n\nconst cache = new LRU(lruOptions)\n\nmodule.exports = (send) => {\n return promisify((cid, options, callback) => {\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n if (!options) {\n options = {}\n }\n\n let cidB58Str\n\n try {\n cid = new CID(cid)\n cidB58Str = cid.toBaseEncodedString()\n } catch (err) {\n return callback(err)\n }\n\n const node = cache.get(cidB58Str)\n\n if (node) {\n return callback(null, node.data)\n }\n\n send({\n path: 'object/data',\n args: cidB58Str\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n if (typeof result.pipe === 'function') {\n streamToValue(result, callback)\n } else {\n callback(null, result)\n }\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/data.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/get.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/get.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst { DAGNode, DAGLink } = __webpack_require__(/*! ipld-dag-pb */ \"./node_modules/ipld-dag-pb/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst LRU = __webpack_require__(/*! lru-cache */ \"./node_modules/ipfs-http-client/node_modules/lru-cache/index.js\")\nconst lruOptions = {\n max: 128\n}\n\nconst cache = new LRU(lruOptions)\n\nmodule.exports = (send) => {\n return promisify((cid, options, callback) => {\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n\n if (!options) {\n options = {}\n }\n\n let cidB58Str\n\n try {\n cid = new CID(cid)\n cidB58Str = cid.toBaseEncodedString()\n } catch (err) {\n return callback(err)\n }\n\n const node = cache.get(cidB58Str)\n\n if (node) {\n return callback(null, node)\n }\n\n send({\n path: 'object/get',\n args: cidB58Str,\n qs: {\n 'data-encoding': 'base64'\n }\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n const links = result.Links.map(l => new DAGLink(l.Name, l.Size, l.Hash))\n const node = DAGNode.create(Buffer.from(result.Data, 'base64'), links)\n\n cache.set(cidB58Str, node)\n callback(null, node)\n })\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/get.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/index.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/index.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n get: __webpack_require__(/*! ./get */ \"./node_modules/ipfs-http-client/src/object/get.js\")(send),\n put: __webpack_require__(/*! ./put */ \"./node_modules/ipfs-http-client/src/object/put.js\")(send),\n data: __webpack_require__(/*! ./data */ \"./node_modules/ipfs-http-client/src/object/data.js\")(send),\n links: __webpack_require__(/*! ./links */ \"./node_modules/ipfs-http-client/src/object/links.js\")(send),\n stat: __webpack_require__(/*! ./stat */ \"./node_modules/ipfs-http-client/src/object/stat.js\")(send),\n new: __webpack_require__(/*! ./new */ \"./node_modules/ipfs-http-client/src/object/new.js\")(send),\n patch: {\n addLink: __webpack_require__(/*! ./addLink */ \"./node_modules/ipfs-http-client/src/object/addLink.js\")(send),\n rmLink: __webpack_require__(/*! ./rmLink */ \"./node_modules/ipfs-http-client/src/object/rmLink.js\")(send),\n setData: __webpack_require__(/*! ./setData */ \"./node_modules/ipfs-http-client/src/object/setData.js\")(send),\n appendData: __webpack_require__(/*! ./appendData */ \"./node_modules/ipfs-http-client/src/object/appendData.js\")(send)\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/links.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/links.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst { DAGLink } = __webpack_require__(/*! ipld-dag-pb */ \"./node_modules/ipld-dag-pb/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst LRU = __webpack_require__(/*! lru-cache */ \"./node_modules/ipfs-http-client/node_modules/lru-cache/index.js\")\nconst lruOptions = {\n max: 128\n}\n\nconst cache = new LRU(lruOptions)\n\nmodule.exports = (send) => {\n return promisify((cid, options, callback) => {\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n if (!options) {\n options = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n const node = cache.get(cid.toString())\n\n if (node) {\n return callback(null, node.links)\n }\n\n send({\n path: 'object/links',\n args: cid.toString()\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n let links = []\n\n if (result.Links) {\n links = result.Links.map((l) => {\n return new DAGLink(l.Name, l.Size, l.Hash)\n })\n }\n callback(null, links)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/links.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/new.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/new.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((template, callback) => {\n if (typeof template === 'function') {\n callback = template\n template = undefined\n }\n send({\n path: 'object/new',\n args: template\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new CID(result.Hash))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/new.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/put.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/put.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst { DAGNode } = __webpack_require__(/*! ipld-dag-pb */ \"./node_modules/ipld-dag-pb/src/index.js\")\n\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file */ \"./node_modules/ipfs-http-client/src/utils/send-one-file.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'object/put')\n\n return promisify((obj, options, _callback) => {\n if (typeof options === 'function') {\n _callback = options\n options = {}\n }\n\n const callback = once(_callback)\n\n if (!options) {\n options = {}\n }\n\n let tmpObj = {\n Data: null,\n Links: []\n }\n\n if (Buffer.isBuffer(obj)) {\n if (!options.enc) {\n tmpObj = {\n Data: obj.toString(),\n Links: []\n }\n }\n } else if (DAGNode.isDAGNode(obj)) {\n tmpObj = {\n Data: obj.Data.toString(),\n Links: obj.Links.map(l => ({\n Name: l.Name,\n Hash: l.Hash.toString(),\n Size: l.Tsize\n }))\n }\n } else if (typeof obj === 'object') {\n tmpObj.Data = obj.Data.toString()\n tmpObj.Links = obj.Links\n } else {\n return callback(new Error('obj not recognized'))\n }\n\n let buf\n if (Buffer.isBuffer(obj) && options.enc) {\n buf = obj\n } else {\n buf = Buffer.from(JSON.stringify(tmpObj))\n }\n const enc = options.enc || 'json'\n\n const sendOptions = {\n qs: { inputenc: enc }\n }\n\n sendOneFile(buf, sendOptions, (err, result) => {\n if (err) {\n return callback(err) // early\n }\n\n callback(null, new CID(result.Hash))\n })\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/put.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/rmLink.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/rmLink.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((cid, dLink, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n if (!opts) {\n opts = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n send({\n path: 'object/patch/rm-link',\n args: [\n cid.toString(),\n dLink.Name || dLink.name || null\n ]\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n callback(null, new CID(result.Hash))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/rmLink.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/setData.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/setData.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst SendOneFile = __webpack_require__(/*! ../utils/send-one-file */ \"./node_modules/ipfs-http-client/src/utils/send-one-file.js\")\n\nmodule.exports = (send) => {\n const sendOneFile = SendOneFile(send, 'object/patch/set-data')\n\n return promisify((cid, data, opts, _callback) => {\n if (typeof opts === 'function') {\n _callback = opts\n opts = {}\n }\n const callback = once(_callback)\n if (!opts) {\n opts = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n sendOneFile(data, { args: [cid.toString()] }, (err, result) => {\n if (err) {\n return callback(err)\n }\n callback(null, new CID(result.Hash))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/setData.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/object/stat.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/object/stat.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((cid, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n if (!opts) {\n opts = {}\n }\n\n try {\n cid = new CID(cid)\n } catch (err) {\n return callback(err)\n }\n\n send({\n path: 'object/stat',\n args: cid.toString(),\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/object/stat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/pin/add.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/pin/add.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((hash, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = null\n }\n send({\n path: 'pin/add',\n args: hash,\n qs: opts\n }, (err, res) => {\n if (err) {\n return callback(err)\n }\n callback(null, res.Pins.map((hash) => ({ hash: hash })))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/pin/add.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/pin/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/pin/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n add: __webpack_require__(/*! ./add */ \"./node_modules/ipfs-http-client/src/pin/add.js\")(send),\n rm: __webpack_require__(/*! ./rm */ \"./node_modules/ipfs-http-client/src/pin/rm.js\")(send),\n ls: __webpack_require__(/*! ./ls */ \"./node_modules/ipfs-http-client/src/pin/ls.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/pin/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/pin/ls.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/pin/ls.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((hash, opts, callback) => {\n if (typeof hash === 'function') {\n callback = hash\n opts = null\n hash = null\n }\n if (typeof opts === 'function') {\n callback = opts\n opts = null\n }\n if (hash && hash.type) {\n opts = hash\n hash = null\n }\n send({\n path: 'pin/ls',\n args: hash,\n qs: opts\n }, (err, res) => {\n if (err) {\n return callback(err)\n }\n callback(null, Object.keys(res.Keys).map(hash => (\n { hash, type: res.Keys[hash].Type }\n )))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/pin/ls.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/pin/rm.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/pin/rm.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((hash, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = null\n }\n send({\n path: 'pin/rm',\n args: hash,\n qs: opts\n }, (err, res) => {\n if (err) {\n return callback(err)\n }\n callback(null, res.Pins.map((hash) => ({ hash: hash })))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/pin/rm.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/ping-pull-stream.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/ping-pull-stream.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst PingMessageStream = __webpack_require__(/*! ./utils/ping-message-stream */ \"./node_modules/ipfs-http-client/src/utils/ping-message-stream.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return (id, opts = {}) => {\n // Default number of packtes to 1\n if (!opts.n && !opts.count) {\n opts.n = 1\n }\n const request = {\n path: 'ping',\n args: id,\n qs: opts\n }\n const p = deferred.source()\n const response = new PingMessageStream()\n\n send(request, (err, stream) => {\n if (err) { return p.abort(err) }\n\n pump(stream, response)\n p.resolve(toPull.source(response))\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/ping-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/ping-readable-stream.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/ping-readable-stream.js ***!
|
||
\*******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst PingMessageStream = __webpack_require__(/*! ./utils/ping-message-stream */ \"./node_modules/ipfs-http-client/src/utils/ping-message-stream.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return (id, opts = {}) => {\n // Default number of packtes to 1\n if (!opts.n && !opts.count) {\n opts.n = 1\n }\n const request = {\n path: 'ping',\n args: id,\n qs: opts\n }\n\n const response = new PingMessageStream()\n\n send(request, (err, stream) => {\n if (err) { return response.emit('error', err) }\n pump(stream, response)\n })\n\n return response\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/ping-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/ping.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/ping.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst Writable = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Writable\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\nconst PingMessageStream = __webpack_require__(/*! ./utils/ping-message-stream */ \"./node_modules/ipfs-http-client/src/utils/ping-message-stream.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((id, opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n\n if (opts.n && opts.count) {\n return callback(new Error('Use either n or count, not both'))\n }\n\n // Default number of packtes to 1\n if (!opts.n && !opts.count) {\n opts.n = 1\n }\n\n const request = {\n path: 'ping',\n args: id,\n qs: opts\n }\n\n // Transform the response stream to a value:\n // [{ success: <boolean>, time: <number>, text: <string> }]\n const transform = (stream, callback) => {\n const messageConverter = new PingMessageStream()\n const responses = []\n\n pump(\n stream,\n messageConverter,\n new Writable({\n objectMode: true,\n write (chunk, enc, cb) {\n responses.push(chunk)\n cb()\n }\n }),\n (err) => {\n if (err) {\n return callback(err)\n }\n callback(null, responses)\n }\n )\n }\n\n send.andTransform(request, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/ping.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/pubsub.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/pubsub.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst eos = __webpack_require__(/*! end-of-stream */ \"./node_modules/end-of-stream/index.js\")\nconst isNode = __webpack_require__(/*! detect-node */ \"./node_modules/detect-node/browser.js\")\nconst setImmediate = __webpack_require__(/*! async/setImmediate */ \"./node_modules/async/setImmediate.js\")\nconst PubsubMessageStream = __webpack_require__(/*! ./utils/pubsub-message-stream */ \"./node_modules/ipfs-http-client/src/utils/pubsub-message-stream.js\")\nconst stringlistToArray = __webpack_require__(/*! ./utils/stringlist-to-array */ \"./node_modules/ipfs-http-client/src/utils/stringlist-to-array.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nconst NotSupportedError = () => new Error('pubsub is currently not supported when run in the browser')\n\n/* Public API */\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n /* Internal subscriptions state and functions */\n const ps = new EventEmitter()\n const subscriptions = {}\n ps.id = Math.random()\n return {\n subscribe: (topic, handler, options, callback) => {\n const defaultOptions = {\n discover: false\n }\n\n if (typeof options === 'function') {\n callback = options\n options = defaultOptions\n }\n\n if (!options) {\n options = defaultOptions\n }\n\n // Throw an error if ran in the browsers\n if (!isNode) {\n if (!callback) {\n return Promise.reject(NotSupportedError())\n }\n\n return setImmediate(() => callback(NotSupportedError()))\n }\n\n // promisify doesn't work as we always pass a\n // function as last argument (`handler`)\n if (!callback) {\n return new Promise((resolve, reject) => {\n subscribe(topic, handler, options, (err) => {\n if (err) {\n return reject(err)\n }\n resolve()\n })\n })\n }\n\n subscribe(topic, handler, options, callback)\n },\n unsubscribe: (topic, handler, callback) => {\n if (!isNode) {\n if (!callback) {\n return Promise.reject(NotSupportedError())\n }\n\n return setImmediate(() => callback(NotSupportedError()))\n }\n\n if (ps.listenerCount(topic) === 0 || !subscriptions[topic]) {\n const err = new Error(`Not subscribed to '${topic}'`)\n\n if (!callback) {\n return Promise.reject(err)\n }\n\n return setImmediate(() => callback(err))\n }\n\n if (!handler && !callback) {\n ps.removeAllListeners(topic)\n } else {\n ps.removeListener(topic, handler)\n }\n\n // Drop the request once we are actually done\n if (ps.listenerCount(topic) === 0) {\n if (!callback) {\n return new Promise((resolve, reject) => {\n // When the response stream has ended, resolve the promise\n eos(subscriptions[topic].res, (err) => {\n // FIXME: Artificial timeout needed to ensure unsubscribed\n setTimeout(() => {\n if (err) return reject(err)\n resolve()\n })\n })\n subscriptions[topic].req.abort()\n subscriptions[topic] = null\n })\n }\n\n // When the response stream has ended, call the callback\n eos(subscriptions[topic].res, (err) => {\n // FIXME: Artificial timeout needed to ensure unsubscribed\n setTimeout(() => callback(err))\n })\n subscriptions[topic].req.abort()\n subscriptions[topic] = null\n return\n }\n\n if (!callback) {\n return Promise.resolve()\n }\n\n setImmediate(() => callback())\n },\n publish: promisify((topic, data, callback) => {\n if (!isNode) {\n return callback(NotSupportedError())\n }\n\n if (!Buffer.isBuffer(data)) {\n return callback(new Error('data must be a Buffer'))\n }\n\n const request = {\n path: 'pubsub/pub',\n args: [topic, data]\n }\n\n send(request, callback)\n }),\n ls: promisify((callback) => {\n if (!isNode) {\n return callback(NotSupportedError())\n }\n\n const request = {\n path: 'pubsub/ls'\n }\n\n send.andTransform(request, stringlistToArray, callback)\n }),\n peers: promisify((topic, callback) => {\n if (!isNode) {\n return callback(NotSupportedError())\n }\n\n const request = {\n path: 'pubsub/peers',\n args: [topic]\n }\n\n send.andTransform(request, stringlistToArray, callback)\n }),\n setMaxListeners (n) {\n return ps.setMaxListeners(n)\n }\n }\n\n function subscribe (topic, handler, options, callback) {\n ps.on(topic, handler)\n\n if (subscriptions[topic]) {\n // TODO: should a callback error be returned?\n return callback()\n }\n\n // Request params\n const request = {\n path: 'pubsub/sub',\n args: [topic],\n qs: {\n discover: options.discover\n }\n }\n\n // Start the request and transform the response\n // stream to Pubsub messages stream\n subscriptions[topic] = {}\n subscriptions[topic].req = send.andTransform(request, PubsubMessageStream.from, (err, stream) => {\n if (err) {\n subscriptions[topic] = null\n ps.removeListener(topic, handler)\n return callback(err)\n }\n\n subscriptions[topic].res = stream\n\n stream.on('data', (msg) => {\n ps.emit(topic, msg)\n })\n\n stream.on('error', (err) => {\n ps.emit('error', err)\n })\n\n eos(stream, (err) => {\n if (err) {\n ps.emit('error', err)\n }\n\n subscriptions[topic] = null\n ps.removeListener(topic, handler)\n })\n\n callback()\n })\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/pubsub.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/repo/gc.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/repo/gc.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValueWithTransformer = __webpack_require__(/*! ../utils/stream-to-value-with-transformer */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, res.map(r => ({\n err: r.Err ? new Error(r.Err) : null,\n cid: (r.Key || {})['/'] ? new CID(r.Key['/']) : null\n })))\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n const request = {\n path: 'repo/gc',\n qs: opts\n }\n send(request, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n streamToValueWithTransformer(result, transform, callback)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/repo/gc.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/repo/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/repo/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n gc: __webpack_require__(/*! ./gc */ \"./node_modules/ipfs-http-client/src/repo/gc.js\")(send),\n stat: __webpack_require__(/*! ./stat */ \"./node_modules/ipfs-http-client/src/repo/stat.js\")(send),\n version: __webpack_require__(/*! ./version */ \"./node_modules/ipfs-http-client/src/repo/version.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/repo/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/repo/stat.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/repo/stat.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst Big = __webpack_require__(/*! bignumber.js */ \"./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n numObjects: new Big(res.NumObjects),\n repoSize: new Big(res.RepoSize),\n repoPath: res.RepoPath,\n version: res.Version,\n storageMax: new Big(res.StorageMax)\n })\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'repo/stat',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/repo/stat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/repo/version.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/repo/version.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nconst transform = function (res, callback) {\n callback(null, res.Version)\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'repo/version',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/repo/version.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/resolve.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/resolve.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst multibase = __webpack_require__(/*! multibase */ \"./node_modules/multibase/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n opts = opts || {}\n\n if (opts.cidBase) {\n opts['cid-base'] = opts.cidBase\n delete opts.cidBase\n }\n\n const transform = (res, callback) => {\n if (!opts['cid-base']) {\n return callback(null, res.Path)\n }\n\n // FIXME: remove when go-ipfs supports ?cid-base for /api/v0/resolve\n // https://github.com/ipfs/go-ipfs/pull/5777#issuecomment-439838555\n const parts = res.Path.split('/') // ['', 'ipfs', 'QmHash', ...]\n\n if (multibase.isEncoded(parts[2]) !== opts['cid-base']) {\n try {\n let cid = new CID(parts[2])\n\n if (cid.version === 0 && opts['cid-base'] !== 'base58btc') {\n cid = cid.toV1()\n }\n\n parts[2] = cid.toBaseEncodedString(opts['cid-base'])\n res.Path = parts.join('/')\n } catch (err) {\n return callback(err)\n }\n }\n\n callback(null, res.Path)\n }\n\n send.andTransform({\n path: 'resolve',\n args: args,\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/resolve.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/bitswap.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/bitswap.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst Big = __webpack_require__(/*! bignumber.js */ \"./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n provideBufLen: res.ProvideBufLen,\n wantlist: res.Wantlist || [],\n peers: res.Peers || [],\n blocksReceived: new Big(res.BlocksReceived),\n dataReceived: new Big(res.DataReceived),\n blocksSent: new Big(res.BlocksSent),\n dataSent: new Big(res.DataSent),\n dupBlksReceived: new Big(res.DupBlksReceived),\n dupDataReceived: new Big(res.DupDataReceived)\n })\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'stats/bitswap',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/bitswap.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/bw-pull-stream.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/bw-pull-stream.js ***!
|
||
\*******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst toPull = __webpack_require__(/*! stream-to-pull-stream */ \"./node_modules/stream-to-pull-stream/index.js\")\nconst map = __webpack_require__(/*! pull-stream/throughs/map */ \"./node_modules/pull-stream/throughs/map.js\")\nconst pull = __webpack_require__(/*! pull-stream/pull */ \"./node_modules/pull-stream/pull.js\")\nconst transformChunk = __webpack_require__(/*! ./bw-util */ \"./node_modules/ipfs-http-client/src/stats/bw-util.js\")\nconst deferred = __webpack_require__(/*! pull-defer */ \"./node_modules/pull-defer/index.js\")\n\nmodule.exports = (send) => {\n return (opts) => {\n opts = opts || {}\n\n const p = deferred.source()\n\n send({\n path: 'stats/bw',\n qs: opts\n }, (err, stream) => {\n if (err) {\n return p.end(err)\n }\n\n p.resolve(pull(\n toPull.source(stream),\n map(transformChunk)\n ))\n })\n\n return p\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/bw-pull-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/bw-readable-stream.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/bw-readable-stream.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst transformChunk = __webpack_require__(/*! ./bw-util */ \"./node_modules/ipfs-http-client/src/stats/bw-util.js\")\n\nmodule.exports = (send) => {\n return (opts) => {\n opts = opts || {}\n\n const pt = new Stream.Transform({\n objectMode: true,\n transform (chunk, encoding, cb) {\n cb(null, transformChunk(chunk))\n }\n })\n\n send({\n path: 'stats/bw',\n qs: opts\n }, (err, stream) => {\n if (err) {\n return pt.destroy(err)\n }\n\n pump(stream, pt)\n })\n\n return pt\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/bw-readable-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/bw-util.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/bw-util.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Big = __webpack_require__(/*! bignumber.js */ \"./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js\")\n\nmodule.exports = (chunk) => {\n return {\n totalIn: new Big(chunk.TotalIn),\n totalOut: new Big(chunk.TotalOut),\n rateIn: new Big(chunk.RateIn),\n rateOut: new Big(chunk.RateOut)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/bw-util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/bw.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/bw.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst streamToValue = __webpack_require__(/*! ../utils/stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\nconst transformChunk = __webpack_require__(/*! ./bw-util */ \"./node_modules/ipfs-http-client/src/stats/bw-util.js\")\n\nconst transform = (res, callback) => {\n return streamToValue(res, (err, data) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, transformChunk(data[0]))\n })\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'stats/bw',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/bw.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/index.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/index.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n bitswap: __webpack_require__(/*! ./bitswap */ \"./node_modules/ipfs-http-client/src/stats/bitswap.js\")(send),\n bw: __webpack_require__(/*! ./bw */ \"./node_modules/ipfs-http-client/src/stats/bw.js\")(send),\n bwReadableStream: __webpack_require__(/*! ./bw-readable-stream */ \"./node_modules/ipfs-http-client/src/stats/bw-readable-stream.js\")(send),\n bwPullStream: __webpack_require__(/*! ./bw-pull-stream */ \"./node_modules/ipfs-http-client/src/stats/bw-pull-stream.js\")(send),\n repo: __webpack_require__(/*! ./repo */ \"./node_modules/ipfs-http-client/src/stats/repo.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stats/repo.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stats/repo.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst Big = __webpack_require__(/*! bignumber.js */ \"./node_modules/ipfs-http-client/node_modules/bignumber.js/bignumber.js\")\n\nconst transform = function (res, callback) {\n callback(null, {\n numObjects: new Big(res.NumObjects),\n repoSize: new Big(res.RepoSize),\n repoPath: res.RepoPath,\n version: res.Version,\n storageMax: new Big(res.StorageMax)\n })\n}\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n\n send.andTransform({\n path: 'stats/repo',\n qs: opts\n }, transform, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stats/repo.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/stop.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/stop.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((callback) => {\n send({ path: 'shutdown' }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/stop.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/swarm/addrs.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/swarm/addrs.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst PeerInfo = __webpack_require__(/*! peer-info */ \"./node_modules/peer-info/src/index.js\")\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'swarm/addrs',\n qs: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n\n const peers = Object.keys(result.Addrs).map((id) => {\n const peerInfo = new PeerInfo(PeerId.createFromB58String(id))\n result.Addrs[id].forEach((addr) => {\n peerInfo.multiaddrs.add(multiaddr(addr))\n })\n return peerInfo\n })\n\n callback(null, peers)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/swarm/addrs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/swarm/connect.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/swarm/connect.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'swarm/connect',\n args: args,\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/swarm/connect.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/swarm/disconnect.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/swarm/disconnect.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\n\nmodule.exports = (send) => {\n return promisify((args, opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'swarm/disconnect',\n args: args,\n qs: opts\n }, callback)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/swarm/disconnect.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/swarm/index.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/swarm/index.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst moduleConfig = __webpack_require__(/*! ../utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n peers: __webpack_require__(/*! ./peers */ \"./node_modules/ipfs-http-client/src/swarm/peers.js\")(send),\n connect: __webpack_require__(/*! ./connect */ \"./node_modules/ipfs-http-client/src/swarm/connect.js\")(send),\n disconnect: __webpack_require__(/*! ./disconnect */ \"./node_modules/ipfs-http-client/src/swarm/disconnect.js\")(send),\n addrs: __webpack_require__(/*! ./addrs */ \"./node_modules/ipfs-http-client/src/swarm/addrs.js\")(send),\n localAddrs: __webpack_require__(/*! ./localAddrs */ \"./node_modules/ipfs-http-client/src/swarm/localAddrs.js\")(send)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/swarm/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/swarm/localAddrs.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/swarm/localAddrs.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'swarm/addrs/local',\n qs: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n callback(null, result.Strings.map((addr) => {\n return multiaddr(addr)\n }))\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/swarm/localAddrs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/swarm/peers.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/swarm/peers.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\n\nmodule.exports = (send) => {\n return promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n const verbose = opts.v || opts.verbose\n send({\n path: 'swarm/peers',\n qs: opts\n }, (err, response) => {\n if (err) {\n return callback(err)\n }\n const peerInfo = parsePeersResponse(verbose, response)\n callback(null, peerInfo)\n })\n })\n}\n\nfunction parsePeersResponse (verbose, response) {\n // go-ipfs <= 0.4.4\n if (Array.isArray(response.Strings)) {\n return response.Strings.map(parseLegacyPeer.bind(null, verbose))\n }\n // go-ipfs >= 0.4.5\n if (Array.isArray(response.Peers)) {\n return response.Peers.map(parsePeer.bind(null, verbose))\n }\n return []\n}\n\nfunction parseLegacyPeer (verbose, peer) {\n const res = {}\n try {\n if (verbose) {\n const parts = peer.split(' ')\n res.addr = multiaddr(parts[0])\n res.latency = parts[1]\n } else {\n res.addr = multiaddr(peer)\n }\n res.peer = PeerId.createFromB58String(res.addr.getPeerId())\n } catch (error) {\n res.error = error\n res.rawPeerInfo = peer\n }\n return res\n}\n\nfunction parsePeer (verbose, peer) {\n const res = {}\n try {\n res.addr = multiaddr(peer.Addr)\n res.peer = PeerId.createFromB58String(peer.Peer)\n res.muxer = peer.Muxer\n } catch (error) {\n res.error = error\n res.rawPeerInfo = peer\n }\n if (peer.Latency) {\n res.latency = peer.Latency\n }\n if (peer.Streams) {\n res.streams = peer.Streams\n }\n return res\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/swarm/peers.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/update.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/update.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return {\n apply: promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'update',\n qs: opts\n }, callback)\n }),\n check: promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'update/check',\n qs: opts\n }, callback)\n }),\n log: promisify((opts, callback) => {\n if (typeof (opts) === 'function') {\n callback = opts\n opts = {}\n }\n send({\n path: 'update/log',\n qs: opts\n }, callback)\n })\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/update.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/clean-cid.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/clean-cid.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nmodule.exports = function (cid) {\n if (Buffer.isBuffer(cid)) {\n return new CID(cid).toString()\n }\n if (CID.isCID(cid)) {\n return cid.toString()\n }\n if (typeof cid !== 'string') {\n throw new Error('unexpected cid type: ' + typeof cid)\n }\n new CID(cid.split('/')[0]) // eslint-disable-line no-new\n return cid\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/clean-cid.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/default-config.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/default-config.js ***!
|
||
\*******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst pkg = __webpack_require__(/*! ../../package.json */ \"./node_modules/ipfs-http-client/package.json\")\n\nexports = module.exports = () => {\n return {\n 'api-path': '/api/v0/',\n 'user-agent': `/node-${pkg.name}/${pkg.version}/`,\n host: 'localhost',\n port: '5001',\n protocol: 'http'\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/default-config.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js ***!
|
||
\*********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst TransformStream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Transform\n\n/*\n Transforms a stream of {Name, Hash} objects to include size\n of the DAG object.\n\n Usage: inputStream.pipe(new FileResultStreamConverter())\n\n Input object format:\n {\n Name: '/path/to/file/foo.txt',\n Hash: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'\n Size: '20'\n }\n\n Output object format:\n {\n path: '/path/to/file/foo.txt',\n hash: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',\n size: 20\n }\n*/\nclass FileResultStreamConverter extends TransformStream {\n constructor (options) {\n const opts = Object.assign({}, options || {}, { objectMode: true })\n super(opts)\n }\n\n _transform (obj, enc, callback) {\n if (!obj.Hash) {\n return callback()\n }\n\n callback(null, {\n path: obj.Name,\n hash: obj.Hash,\n size: parseInt(obj.Size, 10)\n })\n }\n}\n\nmodule.exports = FileResultStreamConverter\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/file-result-stream-converter.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/find-sources.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/find-sources.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = (args) => {\n const callback = args.pop()\n let opts = {}\n let sources = []\n\n if (!Array.isArray(args[args.length - 1]) && typeof args[args.length - 1] === 'object') {\n opts = args.pop()\n }\n\n if (args.length === 1 && Array.isArray(args[0])) {\n // support ipfs.file.cp([src, dest], opts, cb)\n sources = args[0]\n } else {\n // support ipfs.file.cp(src, dest, opts, cb) and ipfs.file.cp(src1, src2, dest, opts, cb)\n sources = args\n }\n\n return {\n callback,\n sources,\n opts\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/find-sources.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/load-commands.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/load-commands.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction requireCommands () {\n return {\n // Files Regular (not MFS)\n add: __webpack_require__(/*! ../files-regular/add */ \"./node_modules/ipfs-http-client/src/files-regular/add.js\"),\n addReadableStream: __webpack_require__(/*! ../files-regular/add-readable-stream */ \"./node_modules/ipfs-http-client/src/files-regular/add-readable-stream.js\"),\n addPullStream: __webpack_require__(/*! ../files-regular/add-pull-stream */ \"./node_modules/ipfs-http-client/src/files-regular/add-pull-stream.js\"),\n addFromFs: __webpack_require__(/*! ../files-regular/add-from-fs */ \"./node_modules/ipfs-http-client/src/files-regular/add-from-fs.js\"),\n addFromURL: __webpack_require__(/*! ../files-regular/add-from-url */ \"./node_modules/ipfs-http-client/src/files-regular/add-from-url.js\"),\n addFromStream: __webpack_require__(/*! ../files-regular/add */ \"./node_modules/ipfs-http-client/src/files-regular/add.js\"),\n cat: __webpack_require__(/*! ../files-regular/cat */ \"./node_modules/ipfs-http-client/src/files-regular/cat.js\"),\n catReadableStream: __webpack_require__(/*! ../files-regular/cat-readable-stream */ \"./node_modules/ipfs-http-client/src/files-regular/cat-readable-stream.js\"),\n catPullStream: __webpack_require__(/*! ../files-regular/cat-pull-stream */ \"./node_modules/ipfs-http-client/src/files-regular/cat-pull-stream.js\"),\n get: __webpack_require__(/*! ../files-regular/get */ \"./node_modules/ipfs-http-client/src/files-regular/get.js\"),\n getReadableStream: __webpack_require__(/*! ../files-regular/get-readable-stream */ \"./node_modules/ipfs-http-client/src/files-regular/get-readable-stream.js\"),\n getPullStream: __webpack_require__(/*! ../files-regular/get-pull-stream */ \"./node_modules/ipfs-http-client/src/files-regular/get-pull-stream.js\"),\n ls: __webpack_require__(/*! ../files-regular/ls */ \"./node_modules/ipfs-http-client/src/files-regular/ls.js\"),\n lsReadableStream: __webpack_require__(/*! ../files-regular/ls-readable-stream */ \"./node_modules/ipfs-http-client/src/files-regular/ls-readable-stream.js\"),\n lsPullStream: __webpack_require__(/*! ../files-regular/ls-pull-stream */ \"./node_modules/ipfs-http-client/src/files-regular/ls-pull-stream.js\"),\n refs: __webpack_require__(/*! ../files-regular/refs */ \"./node_modules/ipfs-http-client/src/files-regular/refs.js\"),\n refsReadableStream: __webpack_require__(/*! ../files-regular/refs-readable-stream */ \"./node_modules/ipfs-http-client/src/files-regular/refs-readable-stream.js\"),\n refsPullStream: __webpack_require__(/*! ../files-regular/refs-pull-stream */ \"./node_modules/ipfs-http-client/src/files-regular/refs-pull-stream.js\"),\n\n // Files MFS (Mutable Filesystem)\n files: __webpack_require__(/*! ../files-mfs */ \"./node_modules/ipfs-http-client/src/files-mfs/index.js\"),\n\n // Block\n block: __webpack_require__(/*! ../block */ \"./node_modules/ipfs-http-client/src/block/index.js\"),\n bitswap: __webpack_require__(/*! ../bitswap */ \"./node_modules/ipfs-http-client/src/bitswap/index.js\"),\n\n // Graph\n dag: __webpack_require__(/*! ../dag */ \"./node_modules/ipfs-http-client/src/dag/index.js\"),\n object: __webpack_require__(/*! ../object */ \"./node_modules/ipfs-http-client/src/object/index.js\"),\n pin: __webpack_require__(/*! ../pin */ \"./node_modules/ipfs-http-client/src/pin/index.js\"),\n\n // Network\n bootstrap: __webpack_require__(/*! ../bootstrap */ \"./node_modules/ipfs-http-client/src/bootstrap/index.js\"),\n dht: __webpack_require__(/*! ../dht */ \"./node_modules/ipfs-http-client/src/dht/index.js\"),\n name: __webpack_require__(/*! ../name */ \"./node_modules/ipfs-http-client/src/name/index.js\"),\n ping: __webpack_require__(/*! ../ping */ \"./node_modules/ipfs-http-client/src/ping.js\"),\n pingReadableStream: __webpack_require__(/*! ../ping-readable-stream */ \"./node_modules/ipfs-http-client/src/ping-readable-stream.js\"),\n pingPullStream: __webpack_require__(/*! ../ping-pull-stream */ \"./node_modules/ipfs-http-client/src/ping-pull-stream.js\"),\n swarm: __webpack_require__(/*! ../swarm */ \"./node_modules/ipfs-http-client/src/swarm/index.js\"),\n pubsub: __webpack_require__(/*! ../pubsub */ \"./node_modules/ipfs-http-client/src/pubsub.js\"),\n dns: __webpack_require__(/*! ../dns */ \"./node_modules/ipfs-http-client/src/dns.js\"),\n\n // Miscellaneous\n commands: __webpack_require__(/*! ../commands */ \"./node_modules/ipfs-http-client/src/commands.js\"),\n config: __webpack_require__(/*! ../config */ \"./node_modules/ipfs-http-client/src/config/index.js\"),\n diag: __webpack_require__(/*! ../diag */ \"./node_modules/ipfs-http-client/src/diag/index.js\"),\n id: __webpack_require__(/*! ../id */ \"./node_modules/ipfs-http-client/src/id.js\"),\n key: __webpack_require__(/*! ../key */ \"./node_modules/ipfs-http-client/src/key/index.js\"),\n log: __webpack_require__(/*! ../log */ \"./node_modules/ipfs-http-client/src/log/index.js\"),\n mount: __webpack_require__(/*! ../mount */ \"./node_modules/ipfs-http-client/src/mount.js\"),\n repo: __webpack_require__(/*! ../repo */ \"./node_modules/ipfs-http-client/src/repo/index.js\"),\n stop: __webpack_require__(/*! ../stop */ \"./node_modules/ipfs-http-client/src/stop.js\"),\n shutdown: __webpack_require__(/*! ../stop */ \"./node_modules/ipfs-http-client/src/stop.js\"),\n stats: __webpack_require__(/*! ../stats */ \"./node_modules/ipfs-http-client/src/stats/index.js\"),\n update: __webpack_require__(/*! ../update */ \"./node_modules/ipfs-http-client/src/update.js\"),\n version: __webpack_require__(/*! ../version */ \"./node_modules/ipfs-http-client/src/version.js\"),\n resolve: __webpack_require__(/*! ../resolve */ \"./node_modules/ipfs-http-client/src/resolve.js\"),\n // ipfs-http-client instance\n getEndpointConfig: (send, config) => __webpack_require__(/*! ../get-endpoint-config */ \"./node_modules/ipfs-http-client/src/get-endpoint-config.js\")(config)\n }\n}\n\nfunction loadCommands (send, config) {\n const files = requireCommands()\n const cmds = {}\n\n Object.keys(files).forEach((file) => {\n cmds[file] = files[file](send, config)\n })\n\n return cmds\n}\n\nmodule.exports = loadCommands\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/load-commands.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/module-config.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/module-config.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst getConfig = __webpack_require__(/*! ./default-config */ \"./node_modules/ipfs-http-client/src/utils/default-config.js\")\nconst sendRequest = __webpack_require__(/*! ./send-request */ \"./node_modules/ipfs-http-client/src/utils/send-request.js\")\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\n\nmodule.exports = (arg) => {\n const config = getConfig()\n\n if (typeof arg === 'function') {\n return arg\n } else if (typeof arg === 'object') {\n return sendRequest(arg)\n } else if (typeof arg === 'string') {\n const maddr = multiaddr(arg).nodeAddress()\n config.host = maddr.address\n config.port = maddr.port\n return sendRequest(config)\n } else {\n throw new Error('Argument must be a send function or a config object.')\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/module-config.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/multipart.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/multipart.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Transform = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Transform\nconst isNode = __webpack_require__(/*! detect-node */ \"./node_modules/detect-node/browser.js\")\n\nconst PADDING = '--'\nconst NEW_LINE = '\\r\\n'\nconst NEW_LINE_BUFFER = Buffer.from(NEW_LINE)\n\nclass Multipart extends Transform {\n constructor (options) {\n super(Object.assign({}, options, { objectMode: true, highWaterMark: 1 }))\n\n this._boundary = this._generateBoundary()\n this._files = []\n this._draining = false\n }\n\n _flush () {\n this.push(Buffer.from(PADDING + this._boundary + PADDING + NEW_LINE))\n this.push(null)\n }\n\n _generateBoundary () {\n var boundary = '--------------------------'\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16)\n }\n\n return boundary\n }\n\n _transform (file, encoding, callback) {\n if (Buffer.isBuffer(file)) {\n this.push(file)\n return callback() // early\n }\n // not a buffer, must be a file\n this._files.push(file)\n this._maybeDrain(callback)\n }\n\n _maybeDrain (callback) {\n if (!this._draining) {\n if (this._files.length) {\n this._draining = true\n const file = this._files.shift()\n this._pushFile(file, (err) => {\n this._draining = false\n if (err) {\n this.emit('error', err)\n } else {\n this._maybeDrain(callback)\n }\n })\n } else {\n this.emit('drained all files')\n callback()\n }\n } else {\n this.once('drained all files', callback)\n }\n }\n\n _pushFile (file, callback) {\n const leading = this._leading(file.headers || {})\n\n this.push(leading)\n\n let content = file.content || Buffer.alloc(0)\n\n if (Buffer.isBuffer(content)) {\n this.push(content)\n this.push(NEW_LINE_BUFFER)\n return callback() // early\n }\n\n // From now on we assume content is a stream\n content.once('error', this.emit.bind(this, 'error'))\n\n content.once('end', () => {\n this.push(NEW_LINE_BUFFER)\n callback()\n\n // TODO: backpressure!!! wait once self is drained so we can proceed\n // This does not work\n // this.once('drain', () => {\n // callback()\n // })\n })\n\n content.on('data', (data) => {\n const drained = this.push(data)\n // Only do the drain dance on Node.js.\n // In browserland, the underlying stream\n // does NOT drain because the request is only sent\n // once this stream ends.\n if (!drained && isNode) {\n content.pause()\n this.once('drain', () => content.resume())\n }\n })\n }\n\n _leading (headers) {\n var leading = [PADDING + this._boundary]\n\n Object.keys(headers).forEach((header) => {\n leading.push(header + ': ' + headers[header])\n })\n\n leading.push('')\n leading.push('')\n\n const leadingStr = leading.join(NEW_LINE)\n\n return Buffer.from(leadingStr)\n }\n}\n\nmodule.exports = Multipart\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/multipart.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/ping-message-converter.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/ping-message-converter.js ***!
|
||
\***************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// Converts IPFS API ping messages to lowercase\n//\n// {\n// Success: true,\n// Text: 'foobar',\n// Time: 0\n// }\n//\n\nmodule.exports = function pingMessageConverter (obj) {\n if (!isPingMessage(obj)) throw new Error('Invalid ping message received')\n return {\n success: obj.Success,\n time: obj.Time,\n text: obj.Text\n }\n}\n\nfunction isPingMessage (obj) {\n return obj && typeof obj.Success === 'boolean'\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/ping-message-converter.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/ping-message-stream.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/ping-message-stream.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst TransformStream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Transform\nconst pingMessageConverter = __webpack_require__(/*! ./ping-message-converter */ \"./node_modules/ipfs-http-client/src/utils/ping-message-converter.js\")\n\nclass PingMessageStream extends TransformStream {\n constructor (options) {\n const opts = Object.assign(options || {}, { objectMode: true })\n super(opts)\n }\n\n _transform (obj, enc, callback) {\n try {\n const msg = pingMessageConverter(obj)\n this.push(msg)\n\n if (!msg.success) {\n throw new Error(msg.text)\n }\n } catch (err) {\n return callback(err)\n }\n callback()\n }\n}\n\nmodule.exports = PingMessageStream\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/ping-message-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/prepare-file.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/prepare-file.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst isNode = __webpack_require__(/*! detect-node */ \"./node_modules/detect-node/browser.js\")\nconst flatmap = __webpack_require__(/*! flatmap */ \"./node_modules/flatmap/index.js\")\nconst { Readable } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst kindOf = __webpack_require__(/*! kind-of */ \"./node_modules/kind-of/index.js\")\nconst { isSource } = __webpack_require__(/*! is-pull-stream */ \"./node_modules/is-pull-stream/index.js\")\nconst isStream = __webpack_require__(/*! is-stream */ \"./node_modules/is-stream/index.js\")\nconst pullToStream = __webpack_require__(/*! pull-to-stream */ \"./node_modules/pull-to-stream/index.js\")\nconst { supportsFileReader } = __webpack_require__(/*! ipfs-utils/src/supports */ \"./node_modules/ipfs-utils/src/supports.js\")\nconst streamFromFileReader = __webpack_require__(/*! ipfs-utils/src/streams/stream-from-filereader */ \"./node_modules/ipfs-utils/src/streams/stream-from-filereader.js\")\n\nfunction loadPaths (opts, file) {\n const path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\n const fs = __webpack_require__(/*! fs */ 8)\n const glob = __webpack_require__(/*! glob */ 9)\n\n const followSymlinks = opts.followSymlinks != null ? opts.followSymlinks : true\n\n file = path.resolve(file)\n const stats = fs.statSync(file)\n\n if (stats.isDirectory() && !opts.recursive) {\n throw new Error('Can only add directories using --recursive')\n }\n\n if (stats.isDirectory() && opts.recursive) {\n // glob requires a POSIX filename\n file = file.split(path.sep).join('/')\n const fullDir = file + (file.endsWith('/') ? '' : '/')\n let dirName = fullDir.split('/')\n dirName = dirName[dirName.length - 2] + '/'\n const mg = new glob.sync.GlobSync('**/*', {\n cwd: file,\n follow: followSymlinks,\n dot: opts.hidden,\n ignore: opts.ignore\n })\n\n return mg.found\n .map((name) => {\n const fqn = fullDir + name\n // symlinks\n if (mg.symlinks[fqn] === true) {\n return {\n path: dirName + name,\n symlink: true,\n dir: false,\n content: fs.readlinkSync(fqn)\n }\n }\n\n // files\n if (mg.cache[fqn] === 'FILE') {\n return {\n path: dirName + name,\n symlink: false,\n dir: false,\n content: fs.createReadStream(fqn)\n }\n }\n\n // directories\n if (mg.cache[fqn] === 'DIR' || mg.cache[fqn] instanceof Array) {\n return {\n path: dirName + name,\n symlink: false,\n dir: true\n }\n }\n // files inside symlinks and others\n })\n // filter out null files\n .filter(Boolean)\n }\n\n return {\n path: path.basename(file),\n content: fs.createReadStream(file)\n }\n}\n\nfunction contentToStream (content) {\n if (supportsFileReader && kindOf(content) === 'file') {\n return streamFromFileReader(content)\n }\n\n if (kindOf(content) === 'buffer') {\n return new Readable({\n read () {\n this.push(content)\n this.push(null)\n }\n })\n }\n\n if (isSource(content)) {\n return pullToStream.readable(content)\n }\n\n if (isStream.readable(content)) {\n return content\n }\n\n throw new Error(`Input not supported. Expected Buffer|ReadableStream|PullStream|File got ${kindOf(content)}. Check the documentation for more info https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#add`)\n}\n\nfunction prepareFile (file, opts) {\n let files = [].concat(file)\n\n return flatmap(files, (file) => {\n // add from fs with file path\n if (typeof file === 'string') {\n if (!isNode) {\n throw new Error('Can only add file paths in node')\n }\n\n return loadPaths(opts, file)\n }\n\n // add with object syntax { path : <string> , content: <Buffer|ReadableStream|PullStream|File }\n if (kindOf(file) === 'object') {\n // treat as an empty directory when path is a string and content undefined\n if (file.path && kindOf(file.path) === 'string' && !file.content) {\n file.dir = true\n return file\n }\n\n // just return when directory\n if (file.dir) {\n return file\n }\n\n if (file.content) {\n return {\n path: file.path || '',\n symlink: false,\n dir: false,\n content: contentToStream(file.content)\n }\n }\n }\n\n return {\n path: '',\n symlink: false,\n dir: false,\n content: contentToStream(file)\n }\n })\n}\n\nexports = module.exports = prepareFile\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/prepare-file.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/pubsub-message-stream.js":
|
||
/*!**************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/pubsub-message-stream.js ***!
|
||
\**************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst TransformStream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Transform\nconst PubsubMessage = __webpack_require__(/*! ./pubsub-message-utils */ \"./node_modules/ipfs-http-client/src/utils/pubsub-message-utils.js\")\n\nclass PubsubMessageStream extends TransformStream {\n constructor (options) {\n const opts = Object.assign(options || {}, { objectMode: true })\n super(opts)\n }\n\n static from (inputStream, callback) {\n let outputStream = inputStream.pipe(new PubsubMessageStream())\n inputStream.on('end', () => outputStream.emit('end'))\n callback(null, outputStream)\n }\n\n _transform (obj, enc, callback) {\n // go-ipfs returns '{}' as the very first object atm, we skip that\n if (Object.keys(obj).length === 0) {\n return callback()\n }\n\n try {\n const msg = PubsubMessage.deserialize(obj, 'base64')\n this.push(msg)\n callback()\n } catch (err) {\n return callback(err)\n }\n }\n}\n\nmodule.exports = PubsubMessageStream\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/pubsub-message-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/pubsub-message-utils.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/pubsub-message-utils.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\n\nmodule.exports = {\n deserialize (data, enc) {\n enc = enc ? enc.toLowerCase() : 'json'\n\n if (enc === 'json') {\n return deserializeFromJson(data)\n } else if (enc === 'base64') {\n return deserializeFromBase64(data)\n }\n\n throw new Error(`Unsupported encoding: '${enc}'`)\n }\n}\n\nfunction deserializeFromJson (data) {\n const json = JSON.parse(data)\n return deserializeFromBase64(json)\n}\n\nfunction deserializeFromBase64 (obj) {\n if (!isPubsubMessage(obj)) {\n throw new Error(`Not a pubsub message`)\n }\n\n return {\n from: bs58.encode(Buffer.from(obj.from, 'base64')).toString(),\n seqno: Buffer.from(obj.seqno, 'base64'),\n data: Buffer.from(obj.data, 'base64'),\n topicIDs: obj.topicIDs || obj.topicCIDs\n }\n}\n\nfunction isPubsubMessage (obj) {\n return obj && obj.from && obj.seqno && obj.data && (obj.topicIDs || obj.topicCIDs)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/pubsub-message-utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/send-files-stream.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/send-files-stream.js ***!
|
||
\**********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Duplex } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst eachSeries = __webpack_require__(/*! async/eachSeries */ \"./node_modules/async/eachSeries.js\")\nconst isStream = __webpack_require__(/*! is-stream */ \"./node_modules/is-stream/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst prepareFile = __webpack_require__(/*! ./prepare-file */ \"./node_modules/ipfs-http-client/src/utils/prepare-file.js\")\nconst Multipart = __webpack_require__(/*! ./multipart */ \"./node_modules/ipfs-http-client/src/utils/multipart.js\")\n\nfunction headers (file, i) {\n const filename = file.path\n ? encodeURIComponent(file.path)\n : ''\n\n const header = { 'Content-Disposition': `form-data; name=\"data${i}\"; filename=\"${filename}\"` }\n\n if (!file.content) {\n header['Content-Type'] = 'application/x-directory'\n } else if (file.symlink) {\n header['Content-Type'] = 'application/symlink'\n } else {\n header['Content-Type'] = 'application/octet-stream'\n }\n\n return header\n}\n\nmodule.exports = (send, path) => {\n return (options) => {\n let request\n let ended = false\n let writing = false\n\n options = options ? Object.assign({}, options, options.qs) : {}\n\n const multipart = new Multipart()\n\n const retStream = new Duplex({ objectMode: true })\n\n retStream._read = (n) => {}\n\n retStream._write = (file, enc, _next) => {\n const next = once(_next)\n try {\n const files = prepareFile(file, options)\n .map((file, i) => Object.assign({ headers: headers(file, i) }, file))\n\n writing = true\n eachSeries(\n files,\n (file, cb) => multipart.write(file, enc, cb),\n (err) => {\n writing = false\n if (err) {\n return next(err)\n }\n if (ended) {\n multipart.end()\n }\n next()\n })\n } catch (err) {\n next(err)\n }\n }\n\n retStream.once('finish', () => {\n if (!ended) {\n ended = true\n if (!writing) {\n multipart.end()\n }\n }\n })\n\n const qs = options.qs || {}\n\n qs['cid-version'] = propOrProp(options, 'cid-version', 'cidVersion')\n qs['raw-leaves'] = propOrProp(options, 'raw-leaves', 'rawLeaves')\n qs['only-hash'] = propOrProp(options, 'only-hash', 'onlyHash')\n qs['wrap-with-directory'] = propOrProp(options, 'wrap-with-directory', 'wrapWithDirectory')\n qs.hash = propOrProp(options, 'hash', 'hashAlg')\n\n if (options.strategy === 'trickle' || options.trickle) {\n qs['trickle'] = 'true'\n }\n\n const args = {\n path: path,\n qs: qs,\n args: options.args,\n multipart: true,\n multipartBoundary: multipart._boundary,\n stream: true,\n recursive: true,\n progress: options.progress\n }\n\n multipart.on('error', (err) => {\n retStream.emit('error', err)\n })\n\n request = send(args, (err, response) => {\n if (err) {\n return retStream.emit('error', err)\n }\n\n if (!response) {\n // no response, which means everything is ok, so we end the retStream\n return retStream.push(null) // early\n }\n\n if (!isStream(response)) {\n retStream.push(response)\n retStream.push(null)\n return\n }\n\n response.on('error', (err) => retStream.emit('error', err))\n\n if (options.converter) {\n response.on('data', (d) => {\n if (d.Bytes && options.progress) {\n options.progress(d.Bytes)\n }\n })\n\n const Converter = options.converter\n const convertedResponse = new Converter()\n convertedResponse.once('end', () => retStream.push(null))\n convertedResponse.on('data', (d) => retStream.push(d))\n response.pipe(convertedResponse)\n } else {\n response.on('data', (d) => {\n if (d.Bytes && options.progress) {\n options.progress(d.Bytes)\n }\n retStream.push(d)\n })\n response.once('end', () => retStream.push(null))\n }\n })\n\n // signal the multipart that the underlying stream has drained and that\n // it can continue producing data..\n request.on('drain', () => multipart.emit('drain'))\n\n multipart.pipe(request)\n\n return retStream\n }\n}\n\nfunction propOrProp (source, prop1, prop2) {\n if (prop1 in source) {\n return source[prop1]\n } else if (prop2 in source) {\n return source[prop2]\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/send-files-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/send-one-file-multiple-results.js":
|
||
/*!***********************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/send-one-file-multiple-results.js ***!
|
||
\***********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst ConcatStream = __webpack_require__(/*! concat-stream */ \"./node_modules/ipfs-http-client/node_modules/concat-stream/index.js\")\nconst SendFilesStream = __webpack_require__(/*! ./send-files-stream */ \"./node_modules/ipfs-http-client/src/utils/send-files-stream.js\")\n\nmodule.exports = (send, path) => {\n const sendFilesStream = SendFilesStream(send, path)\n return (file, options, _callback) => {\n const callback = once(_callback)\n const stream = sendFilesStream(options)\n const concat = ConcatStream((results) => callback(null, results))\n stream.once('error', callback)\n stream.pipe(concat)\n stream.write(file)\n stream.end()\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/send-one-file-multiple-results.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/send-one-file.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/send-one-file.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst SendOneFileMultipleResults = __webpack_require__(/*! ./send-one-file-multiple-results */ \"./node_modules/ipfs-http-client/src/utils/send-one-file-multiple-results.js\")\n\nmodule.exports = (send, path) => {\n const sendFile = SendOneFileMultipleResults(send, path)\n return (file, options, callback) => {\n sendFile(file, options, (err, results) => {\n if (err) {\n return callback(err)\n }\n callback(null, results[0])\n })\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/send-one-file.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/send-request.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/send-request.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Qs = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\")\nconst qsDefaultEncoder = __webpack_require__(/*! qs/lib/utils */ \"./node_modules/qs/lib/utils.js\").encode\nconst isNode = __webpack_require__(/*! detect-node */ \"./node_modules/detect-node/browser.js\")\nconst ndjson = __webpack_require__(/*! ndjson */ \"./node_modules/ndjson/index.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst { getRequest } = __webpack_require__(/*! iso-stream-http */ \"./node_modules/iso-stream-http/index.browser.js\")\nconst streamToValue = __webpack_require__(/*! ./stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\nconst streamToJsonValue = __webpack_require__(/*! ./stream-to-json-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-json-value.js\")\nconst log = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('ipfs-http-client:request')\n\n// -- Internal\n\nfunction hasJSONHeaders (res) {\n return res.headers['content-type'] &&\n res.headers['content-type'].indexOf('application/json') === 0\n}\n\nfunction parseError (res, cb) {\n const error = new Error(`Server responded with ${res.statusCode}`)\n error.statusCode = res.statusCode\n\n if (!hasJSONHeaders(res)) {\n return streamToValue(res, (err, data) => { // eslint-disable-line handle-callback-err\n // the `err` here refers to errors in stream processing, which\n // we ignore here, since we already have a valid `error` response\n // from the server above that we have to report to the caller.\n if (data && data.length) {\n error.message = data.toString()\n }\n cb(error)\n })\n }\n\n streamToJsonValue(res, (err, payload) => {\n if (err) {\n return cb(err)\n }\n\n if (payload) {\n error.code = payload.Code\n error.message = payload.Message || payload.toString()\n error.type = payload.Type\n }\n cb(error)\n })\n}\n\nfunction onRes (buffer, cb) {\n return (res) => {\n const stream = Boolean(res.headers['x-stream-output'])\n const chunkedObjects = Boolean(res.headers['x-chunked-output'])\n const isJson = hasJSONHeaders(res)\n\n if (res.req) {\n log(res.req.method, `${res.req.getHeaders().host}${res.req.path}`, res.statusCode, res.statusMessage)\n } else {\n log(res.url, res.statusCode, res.statusMessage)\n }\n\n if (res.statusCode >= 400 || !res.statusCode) {\n return parseError(res, cb)\n }\n\n // Return the response stream directly\n if (stream && !buffer) {\n return cb(null, res)\n }\n\n // Return a stream of JSON objects\n if (chunkedObjects && isJson) {\n const outputStream = ndjson.parse()\n pump(res, outputStream)\n res.on('end', () => {\n let err = res.trailers['x-stream-error']\n if (err) {\n // Not all errors are JSON\n try {\n err = JSON.parse(err)\n } catch (e) {\n err = { Message: err }\n }\n outputStream.emit('error', new Error(err.Message))\n }\n })\n return cb(null, outputStream)\n }\n\n // Return a JSON object\n if (isJson) {\n return streamToJsonValue(res, cb)\n }\n\n // Return a value\n return streamToValue(res, cb)\n }\n}\n\nfunction requestAPI (config, options, callback) {\n callback = once(callback)\n options.qs = options.qs || {}\n\n if (Array.isArray(options.path)) {\n options.path = options.path.join('/')\n }\n if (options.args && !Array.isArray(options.args)) {\n options.args = [options.args]\n }\n if (options.args) {\n options.qs.arg = options.args\n }\n if (options.progress) {\n options.qs.progress = true\n }\n\n if (options.qs.r) {\n options.qs.recursive = options.qs.r\n // From IPFS 0.4.0, it throws an error when both r and recursive are passed\n delete options.qs.r\n }\n\n options.qs['stream-channels'] = true\n\n if (options.stream) {\n options.buffer = false\n }\n\n // this option is only used internally, not passed to daemon\n delete options.qs.followSymlinks\n\n const method = 'POST'\n const headers = Object.assign({}, config.headers)\n\n if (isNode) {\n // Browsers do not allow you to modify the user agent\n headers['User-Agent'] = config['user-agent']\n }\n\n if (options.multipart) {\n if (!options.multipartBoundary) {\n return callback(new Error('No multipartBoundary'))\n }\n\n headers['Content-Type'] = `multipart/form-data; boundary=${options.multipartBoundary}`\n }\n\n const qs = Qs.stringify(options.qs, {\n arrayFormat: 'repeat',\n encoder: data => {\n // TODO: future releases of qs will provide the default\n // encoder as a 2nd argument to this function; it will\n // no longer be necessary to import qsDefaultEncoder\n if (Buffer.isBuffer(data)) {\n let uriEncoded = ''\n for (const byte of data) {\n // https://tools.ietf.org/html/rfc3986#page-14\n // ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E)\n if (\n (byte >= 0x41 && byte <= 0x5A) ||\n (byte >= 0x61 && byte <= 0x7A) ||\n (byte >= 0x30 && byte <= 0x39) ||\n (byte === 0x2D) ||\n (byte === 0x2E) ||\n (byte === 0x5F) ||\n (byte === 0x7E)\n ) {\n uriEncoded += String.fromCharCode(byte)\n } else {\n const hex = byte.toString(16)\n // String.prototype.padStart() not widely supported yet\n const padded = hex.length === 1 ? `0${hex}` : hex\n uriEncoded += `%${padded}`\n }\n }\n return uriEncoded\n }\n return qsDefaultEncoder(data)\n }\n })\n const reqOptions = {\n hostname: config.host,\n path: `${config['api-path']}${options.path}?${qs}`,\n port: config.port,\n method: method,\n headers: headers,\n protocol: `${config.protocol}:`\n }\n\n const req = getRequest(reqOptions, onRes(options.buffer, callback))\n\n req.on('error', (err) => {\n callback(err)\n })\n\n if (!options.stream) {\n req.end()\n }\n\n return req\n}\n\n//\n// -- Module Interface\n\nexports = module.exports = (config) => {\n /*\n * options: {\n * path: // API path (like /add or /config) - type: string\n * args: // Arguments to the command - type: object\n * qs: // Opts as query string opts to the command --something - type: object\n * files: // files to be sent - type: string, buffer or array of strings or buffers\n * buffer: // buffer the request before sending it - type: bool\n * }\n */\n const send = (options, callback) => {\n if (typeof options !== 'object') {\n return callback(new Error('no options were passed'))\n }\n\n return requestAPI(config, options, callback)\n }\n\n // Send a HTTP request and pass via a transform function\n // to convert the response data to wanted format before\n // returning it to the callback.\n // Eg. send.andTransform({}, (e) => JSON.parse(e), (err, res) => ...)\n send.andTransform = (options, transform, callback) => {\n return send(options, (err, res) => {\n if (err) {\n return callback(err)\n }\n transform(res, callback)\n })\n }\n\n return send\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/send-request.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/stream-to-json-value.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/stream-to-json-value.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst streamToValue = __webpack_require__(/*! ./stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\n\n/*\n Converts a stream to a single JSON value\n*/\nfunction streamToJsonValue (res, cb) {\n streamToValue(res, (err, data) => {\n if (err) {\n return cb(err)\n }\n\n if (!data || data.length === 0) {\n return cb()\n }\n\n // TODO: check if needed, afaik JSON.parse can parse Buffers\n if (Buffer.isBuffer(data)) {\n data = data.toString()\n }\n\n let res\n try {\n res = JSON.parse(data)\n } catch (err) {\n return cb(new Error(`Invalid JSON: ${data}`))\n }\n\n cb(null, res)\n })\n}\n\nmodule.exports = streamToJsonValue\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/stream-to-json-value.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js":
|
||
/*!*************************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js ***!
|
||
\*************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst streamToValue = __webpack_require__(/*! ./stream-to-value */ \"./node_modules/ipfs-http-client/src/utils/stream-to-value.js\")\n\nfunction streamToValueWithTransformer (response, transformer, callback) {\n if (typeof response.pipe === 'function') {\n streamToValue(response, (err, res) => {\n if (err) {\n return callback(err)\n }\n transformer(res, callback)\n })\n } else {\n transformer(response, callback)\n }\n}\n\nmodule.exports = streamToValueWithTransformer\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/stream-to-value-with-transformer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/stream-to-value.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/stream-to-value.js ***!
|
||
\********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst concat = __webpack_require__(/*! concat-stream */ \"./node_modules/ipfs-http-client/node_modules/concat-stream/index.js\")\n\n/*\n Concatenate a stream to a single value.\n*/\nfunction streamToValue (response, callback) {\n let data\n pump(\n response,\n concat((d) => { data = d }),\n (err) => callback(err, data)\n )\n}\n\nmodule.exports = streamToValue\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/stream-to-value.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/stringlist-to-array.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/stringlist-to-array.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// Converts a go-ipfs \"stringList\" to an array\n// { Strings: ['A', 'B'] } --> ['A', 'B']\nfunction stringlistToArray (res, cb) {\n cb(null, res.Strings || [])\n}\n\nmodule.exports = stringlistToArray\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/stringlist-to-array.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/utils/tar-stream-to-objects.js":
|
||
/*!**************************************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/utils/tar-stream-to-objects.js ***!
|
||
\**************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst tar = __webpack_require__(/*! tar-stream */ \"./node_modules/tar-stream/index.js\")\nconst ReadableStream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Readable\n\nclass ObjectsStreams extends ReadableStream {\n constructor (options) {\n const opts = Object.assign(options || {}, { objectMode: true })\n super(opts)\n }\n\n _read () {}\n}\n\n/*\n Transform a tar stream into a stream of objects:\n\n Output format:\n { path: 'string', content: Stream<Readable> }\n*/\nconst TarStreamToObjects = (inputStream, callback) => {\n let outputStream = new ObjectsStreams()\n let extractStream = tar.extract()\n\n extractStream\n .on('entry', (header, stream, next) => {\n stream.on('end', next)\n\n if (header.type !== 'directory') {\n outputStream.push({\n path: header.name,\n content: stream\n })\n } else {\n outputStream.push({\n path: header.name\n })\n stream.resume()\n }\n })\n .on('finish', () => outputStream.push(null))\n\n pump(inputStream, extractStream)\n callback(null, outputStream)\n}\n\nmodule.exports = TarStreamToObjects\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/utils/tar-stream-to-objects.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-http-client/src/version.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-http-client/src/version.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst promisify = __webpack_require__(/*! promisify-es6 */ \"./node_modules/promisify-es6/index.js\")\nconst moduleConfig = __webpack_require__(/*! ./utils/module-config */ \"./node_modules/ipfs-http-client/src/utils/module-config.js\")\n\nmodule.exports = (arg) => {\n const send = moduleConfig(arg)\n\n return promisify((opts, callback) => {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n\n send({\n path: 'version',\n qs: opts\n }, (err, result) => {\n if (err) {\n return callback(err)\n }\n const version = {\n version: result.Version,\n commit: result.Commit,\n repo: result.Repo\n }\n callback(null, version)\n })\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-http-client/src/version.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/connection.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/connection.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst pull = __webpack_require__(/*! pull-stream */ \"./node_modules/pull-stream/index.js\")\nconst Pushable = __webpack_require__(/*! pull-pushable */ \"./node_modules/pull-pushable/index.js\")\n\nconst PROTOCOL = __webpack_require__(/*! ./protocol */ \"./node_modules/ipfs-pubsub-room/src/protocol.js\")\nconst encoding = __webpack_require__(/*! ./encoding */ \"./node_modules/ipfs-pubsub-room/src/encoding.js\")\nconst getPeerId = __webpack_require__(/*! ./peer-id */ \"./node_modules/ipfs-pubsub-room/src/peer-id.js\")\nconst libp2p = __webpack_require__(/*! ./libp2p */ \"./node_modules/ipfs-pubsub-room/src/libp2p.js\")\n\nmodule.exports = class Connection extends EventEmitter {\n constructor (id, ipfs, room) {\n super()\n this._id = id\n this._ipfs = ipfs\n this._room = room\n this._connection = null\n this._connecting = false\n }\n\n push (message) {\n if (this._connection) {\n this._connection.push(encoding(message))\n } else {\n this.once('connect', () => this.push(message))\n if (!this._connecting) {\n this._getConnection()\n }\n }\n }\n\n stop () {\n if (this._connection) {\n this._connection.end()\n }\n }\n\n _getConnection () {\n this._connecting = true\n this._getPeerAddresses(this._id, (err, peerAddresses) => {\n if (err) {\n this.emit('error', err)\n return // early\n }\n\n if (!peerAddresses.length) {\n this.emit('disconnect')\n return // early\n }\n\n libp2p(this._ipfs).dialProtocol(peerAddresses[0], PROTOCOL, (err, conn) => {\n if (err) {\n this.emit('disconnect')\n return // early\n }\n this._connecting = false\n const pushable = Pushable()\n this._connection = pushable\n pull(\n pushable,\n conn,\n pull.onEnd(() => {\n delete this._connection\n this.emit('disconnect')\n })\n )\n this.emit('connect', pushable)\n })\n })\n }\n\n _getPeerAddresses (peerId, callback) {\n this._ipfs.swarm.peers((err, peersAddresses) => {\n if (err) {\n callback(err)\n return // early\n }\n\n callback(\n null,\n peersAddresses\n .filter((peerAddress) => getPeerId(peerAddress.peer) === peerId)\n .map(peerAddress => peerAddress.peer))\n })\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/connection.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/direct-connection-handler.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/direct-connection-handler.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst pull = __webpack_require__(/*! pull-stream */ \"./node_modules/pull-stream/index.js\")\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\n\nconst emitter = new EventEmitter()\n\nfunction handler (protocol, conn) {\n conn.getPeerInfo((err, peerInfo) => {\n if (err) {\n console.log(err)\n return\n }\n\n const peerId = peerInfo.id.toB58String()\n\n pull(\n conn,\n pull.map((message) => {\n let msg\n try {\n msg = JSON.parse(message.toString())\n } catch (err) {\n emitter.emit('warning', err.message)\n return // early\n }\n\n if (peerId !== msg.from) {\n emitter.emit('warning', 'no peerid match ' + msg.from)\n return // early\n }\n\n const topicIDs = msg.topicIDs\n if (!Array.isArray(topicIDs)) {\n emitter.emit('warning', 'no topic IDs')\n return // early\n }\n\n msg.data = Buffer.from(msg.data, 'hex')\n msg.seqno = Buffer.from(msg.seqno, 'hex')\n\n topicIDs.forEach((topic) => {\n emitter.emit(topic, msg)\n })\n\n return msg\n }),\n pull.onEnd(() => {\n // do nothing\n })\n )\n })\n}\n\nexports = module.exports = {\n handler: handler,\n emitter: emitter\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/direct-connection-handler.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/encoding.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/encoding.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nmodule.exports = (_message) => {\n let message = _message\n if (!Buffer.isBuffer(message)) {\n message = Buffer.from(message)\n }\n return message\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/encoding.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst diff = __webpack_require__(/*! hyperdiff */ \"./node_modules/hyperdiff/lib/index.js\")\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst timers = __webpack_require__(/*! timers */ \"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js\")\nconst clone = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\")\n\nconst PROTOCOL = __webpack_require__(/*! ./protocol */ \"./node_modules/ipfs-pubsub-room/src/protocol.js\")\nconst Connection = __webpack_require__(/*! ./connection */ \"./node_modules/ipfs-pubsub-room/src/connection.js\")\nconst encoding = __webpack_require__(/*! ./encoding */ \"./node_modules/ipfs-pubsub-room/src/encoding.js\")\nconst directConnection = __webpack_require__(/*! ./direct-connection-handler */ \"./node_modules/ipfs-pubsub-room/src/direct-connection-handler.js\")\nconst libp2p = __webpack_require__(/*! ./libp2p */ \"./node_modules/ipfs-pubsub-room/src/libp2p.js\")\n\nconst DEFAULT_OPTIONS = {\n pollInterval: 1000\n}\n\nmodule.exports = (ipfs, topic, options) => {\n return new PubSubRoom(ipfs, topic, options)\n}\n\nclass PubSubRoom extends EventEmitter {\n constructor (ipfs, topic, options) {\n super()\n this._ipfs = ipfs\n this._topic = topic\n this._options = Object.assign({}, clone(DEFAULT_OPTIONS), clone(options))\n this._peers = []\n this._connections = {}\n\n this._handleDirectMessage = this._handleDirectMessage.bind(this)\n\n if (!this._ipfs.pubsub) {\n throw new Error('This IPFS node does not have pubsub.')\n }\n\n if (this._ipfs.isOnline()) {\n this._start()\n } else {\n this._ipfs.on('ready', this._start.bind(this))\n }\n\n this._ipfs.on('stop', this.leave.bind(this))\n }\n\n getPeers () {\n return this._peers.slice(0)\n }\n\n hasPeer (peer) {\n return this._peers.indexOf(peer) >= 0\n }\n\n leave () {\n return new Promise((resolve, reject) => {\n timers.clearInterval(this._interval)\n Object.keys(this._connections).forEach((peer) => {\n this._connections[peer].stop()\n })\n directConnection.emitter.removeListener(this._topic, this._handleDirectMessage)\n this.once('stopped', () => resolve())\n this.emit('stopping')\n })\n }\n\n broadcast (_message) {\n let message = encoding(_message)\n\n this._ipfs.pubsub.publish(this._topic, message, (err) => {\n if (err) {\n this.emit('error', err)\n }\n })\n }\n\n sendTo (peer, message) {\n let conn = this._connections[peer]\n if (!conn) {\n conn = new Connection(peer, this._ipfs, this)\n conn.on('error', (err) => this.emit('error', err))\n this._connections[peer] = conn\n\n conn.once('disconnect', () => {\n delete this._connections[peer]\n this._peers = this._peers.filter((p) => p !== peer)\n this.emit('peer left', peer)\n })\n }\n\n // We should use the same sequence number generation as js-libp2p-floosub does:\n // const seqno = Buffer.from(utils.randomSeqno())\n\n // Until we figure out a good way to bring in the js-libp2p-floosub's randomSeqno\n // generator, let's use 0 as the sequence number for all private messages\n // const seqno = Buffer.from([0])\n const seqno = Buffer.from([0])\n\n const msg = {\n to: peer,\n from: this._ipfs._peerInfo.id.toB58String(),\n data: Buffer.from(message).toString('hex'),\n seqno: seqno.toString('hex'),\n topicIDs: [ this._topic ],\n topicCIDs: [ this._topic ]\n }\n\n conn.push(Buffer.from(JSON.stringify(msg)))\n }\n\n _start () {\n this._interval = timers.setInterval(\n this._pollPeers.bind(this),\n this._options.pollInterval)\n\n const listener = this._onMessage.bind(this)\n this._ipfs.pubsub.subscribe(this._topic, listener, {}, (err) => {\n if (err) {\n this.emit('error', err)\n } else {\n this.emit('subscribed', this._topic)\n }\n })\n\n this.once('stopping', () => {\n this._ipfs.pubsub.unsubscribe(this._topic, listener, (err) => {\n if (err) {\n this.emit('error', err)\n } else {\n this.emit('stopped')\n }\n })\n })\n\n libp2p(this._ipfs).handle(PROTOCOL, directConnection.handler)\n\n directConnection.emitter.on(this._topic, this._handleDirectMessage)\n }\n\n _pollPeers () {\n this._ipfs.pubsub.peers(this._topic, (err, _newPeers) => {\n if (err) {\n this.emit('error', err)\n return // early\n }\n\n const newPeers = _newPeers.sort()\n\n if (this._emitChanges(newPeers)) {\n this._peers = newPeers\n }\n })\n }\n\n _emitChanges (newPeers) {\n const differences = diff(this._peers, newPeers)\n\n differences.added.forEach((addedPeer) => this.emit('peer joined', addedPeer))\n differences.removed.forEach((removedPeer) => this.emit('peer left', removedPeer))\n\n return differences.added.length > 0 || differences.removed.length > 0\n }\n\n _onMessage (message) {\n this.emit('message', message)\n }\n\n _handleDirectMessage (message) {\n if (message.to === this._ipfs._peerInfo.id.toB58String()) {\n const m = Object.assign({}, message)\n delete m.to\n this.emit('message', m)\n }\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/libp2p.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/libp2p.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = (ipfs) => {\n return ipfs._libp2pNode || ipfs.libp2p\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/libp2p.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/peer-id.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/peer-id.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = (peer) => {\n if (peer.id && (typeof peer.id.toB58String === 'function')) {\n peer = peer.id\n }\n return peer.toB58String()\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/peer-id.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-pubsub-room/src/protocol.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipfs-pubsub-room/src/protocol.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = 'ipfs-pubsub-room/v2'\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-pubsub-room/src/protocol.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-utils/node_modules/is-buffer/index.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/ipfs-utils/node_modules/is-buffer/index.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-utils/node_modules/is-buffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-utils/src/files/add-input-validation.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/ipfs-utils/src/files/add-input-validation.js ***!
|
||
\*******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst kindOf = __webpack_require__(/*! kind-of */ \"./node_modules/kind-of/index.js\")\nconst isStream = __webpack_require__(/*! is-stream */ \"./node_modules/is-stream/index.js\")\nconst { isSource } = __webpack_require__(/*! is-pull-stream */ \"./node_modules/is-pull-stream/index.js\")\nconst isBuffer = __webpack_require__(/*! is-buffer */ \"./node_modules/ipfs-utils/node_modules/is-buffer/index.js\")\n\nconst validateAddInput = (input) => {\n // Buffer|ReadableStream|PullStream|File\n const isPrimitive = obj => isBuffer(obj) || isStream.readable(obj) || isSource(obj) || kindOf(obj) === 'file'\n\n // An object like { content?, path? }, where content isBufferOrStream and path isString\n const isContentObject = obj => {\n if (typeof obj !== 'object') return false\n // path is optional if content is present\n if (obj.content) return isPrimitive(obj.content)\n // path must be a non-empty string if no content\n return Boolean(obj.path) && typeof obj.path === 'string'\n }\n\n // An input atom: a buffer, stream or content object\n const isInput = obj => isPrimitive(obj) || isContentObject(obj)\n\n if (isInput(input) || (Array.isArray(input) && input.every(isInput))) {\n return true\n } else {\n throw new Error(`Input not supported. Expected Buffer|ReadableStream|PullStream|File|Array<Object> got ${kindOf(input)}. Check the documentation for more info https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#add`)\n }\n}\n\nmodule.exports = validateAddInput\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-utils/src/files/add-input-validation.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-utils/src/streams/stream-from-filereader.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/ipfs-utils/src/streams/stream-from-filereader.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nconst { Readable } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst { supportsFileReader } = __webpack_require__(/*! ../supports */ \"./node_modules/ipfs-utils/src/supports.js\")\n\nconst streamFromFileReader = (file, options) => {\n if (!supportsFileReader) {\n throw new Error('FileReader DOM API is not supported.')\n }\n class FileStream extends Readable {\n constructor (file, options = {}) {\n super(options)\n this.file = file\n this.offset = options.offset || 0\n this.chunkSize = options.chunkSize || 1024 * 1024\n this.fileReader = new self.FileReader(file)\n this.fileReader.onloadend = (event) => {\n const data = event.target.result\n if (data.byteLength === 0) {\n this.push(null)\n }\n this.push(new Uint8Array(data))\n }\n this.fileReader.onerror = (err) => this.destroy(err)\n }\n\n _read (size) {\n const end = this.offset + this.chunkSize\n const slice = file.slice(this.offset, end)\n this.fileReader.readAsArrayBuffer(slice)\n this.offset = end\n }\n }\n\n return new FileStream(file, options)\n}\n\nmodule.exports = streamFromFileReader\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-utils/src/streams/stream-from-filereader.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipfs-utils/src/supports.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ipfs-utils/src/supports.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = {\n supportsFileReader: typeof self !== 'undefined' && 'FileReader' in self\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipfs-utils/src/supports.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-cbor/src/index.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ipld-dag-cbor/src/index.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nexports.util = __webpack_require__(/*! ./util.js */ \"./node_modules/ipld-dag-cbor/src/util.js\")\nexports.resolver = __webpack_require__(/*! ./resolver.js */ \"./node_modules/ipld-dag-cbor/src/resolver.js\")\nexports.codec = exports.util.codec\nexports.defaultHashAlg = exports.util.defaultHashAlg\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-cbor/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-cbor/src/resolver.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ipld-dag-cbor/src/resolver.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nconst util = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-cbor/src/util.js\")\n\n/**\n * Resolves a path within a CBOR block.\n *\n * Returns the value or a link and the partial mising path. This way the\n * IPLD Resolver can fetch the link and continue to resolve.\n *\n * @param {Buffer} binaryBlob - Binary representation of a CBOR block\n * @param {string} [path='/'] - Path that should be resolved\n * @returns {Object} result - Result of the path it it was resolved successfully\n * @returns {*} result.value - Value the path resolves to\n * @returns {string} result.remainderPath - If the path resolves half-way to a\n * link, then the `remainderPath` is the part after the link that can be used\n * for further resolving\n */\nexports.resolve = (binaryBlob, path) => {\n let node = util.deserialize(binaryBlob)\n\n const parts = path.split('/').filter(Boolean)\n while (parts.length) {\n const key = parts.shift()\n if (node[key] === undefined) {\n throw new Error(`Object has no property '${key}'`)\n }\n\n node = node[key]\n if (CID.isCID(node)) {\n return {\n value: node,\n remainderPath: parts.join('/')\n }\n }\n }\n\n return {\n value: node,\n remainderPath: ''\n }\n}\n\nconst traverse = function * (node, path) {\n // Traverse only objects and arrays\n if (Buffer.isBuffer(node) || CID.isCID(node) || typeof node === 'string' ||\n node === null) {\n return\n }\n for (const item of Object.keys(node)) {\n const nextpath = path === undefined ? item : path + '/' + item\n yield nextpath\n yield * traverse(node[item], nextpath)\n }\n}\n\n/**\n * Return all available paths of a block.\n *\n * @generator\n * @param {Buffer} binaryBlob - Binary representation of a CBOR block\n * @yields {string} - A single path\n */\nexports.tree = function * (binaryBlob) {\n const node = util.deserialize(binaryBlob)\n\n yield * traverse(node)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-cbor/src/resolver.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-cbor/src/util.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ipld-dag-cbor/src/util.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst cbor = __webpack_require__(/*! borc */ \"./node_modules/borc/src/index.js\")\nconst multicodec = __webpack_require__(/*! multicodec */ \"./node_modules/multicodec/src/index.js\")\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/multihashing-async/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst isCircular = __webpack_require__(/*! is-circular */ \"./node_modules/is-circular/index.js\")\n\n// https://github.com/ipfs/go-ipfs/issues/3570#issuecomment-273931692\nconst CID_CBOR_TAG = 42\n\nfunction tagCID (cid) {\n if (typeof cid === 'string') {\n cid = new CID(cid).buffer\n } else if (CID.isCID(cid)) {\n cid = cid.buffer\n }\n\n return new cbor.Tagged(CID_CBOR_TAG, Buffer.concat([\n Buffer.from('00', 'hex'), // thanks jdag\n cid\n ]))\n}\n\nfunction replaceCIDbyTAG (dagNode) {\n let circular\n try {\n circular = isCircular(dagNode)\n } catch (e) {\n circular = false\n }\n if (circular) {\n throw new Error('The object passed has circular references')\n }\n\n function transform (obj) {\n if (!obj || Buffer.isBuffer(obj) || typeof obj === 'string') {\n return obj\n }\n\n if (Array.isArray(obj)) {\n return obj.map(transform)\n }\n\n if (CID.isCID(obj)) {\n return tagCID(obj)\n }\n\n const keys = Object.keys(obj)\n\n if (keys.length > 0) {\n // Recursive transform\n const out = {}\n keys.forEach((key) => {\n if (typeof obj[key] === 'object') {\n out[key] = transform(obj[key])\n } else {\n out[key] = obj[key]\n }\n })\n return out\n } else {\n return obj\n }\n }\n\n return transform(dagNode)\n}\n\nexports = module.exports\n\nexports.codec = multicodec.DAG_CBOR\nexports.defaultHashAlg = multicodec.SHA2_256\n\nconst defaultTags = {\n [CID_CBOR_TAG]: (val) => {\n // remove that 0\n val = val.slice(1)\n return new CID(val)\n }\n}\nconst defaultSize = 64 * 1024 // current decoder heap size, 64 Kb\nlet currentSize = defaultSize\nconst defaultMaxSize = 64 * 1024 * 1024 // max heap size when auto-growing, 64 Mb\nlet maxSize = defaultMaxSize\nlet decoder = null\n\n/**\n * Configure the underlying CBOR decoder.\n *\n * @param {Object} [options] - The options the decoder takes. The decoder will reset to the defaul values if no options are given.\n * @param {number} [options.size=65536] - The current heap size used in CBOR parsing, this may grow automatically as larger blocks are encountered up to `maxSize`\n * @param {number} [options.maxSize=67108864] - The maximum size the CBOR parsing heap is allowed to grow to before `dagCBOR.util.deserialize()` returns an error\n * @param {Object} [options.tags] - An object whose keys are CBOR tag numbers and values are transform functions that accept a `value` and return a decoded representation of that `value`\n */\nexports.configureDecoder = (options) => {\n let tags = defaultTags\n\n if (options) {\n if (typeof options.size === 'number') {\n currentSize = options.size\n }\n if (typeof options.maxSize === 'number') {\n maxSize = options.maxSize\n }\n if (options.tags) {\n tags = Object.assign({}, defaultTags, options && options.tags)\n }\n } else {\n // no options, reset to defaults\n currentSize = defaultSize\n maxSize = defaultMaxSize\n }\n\n let decoderOptions = {\n tags: tags,\n size: currentSize\n }\n\n decoder = new cbor.Decoder(decoderOptions)\n // borc edits opts.size in-place so we can capture _actual_ size\n currentSize = decoderOptions.size\n}\n\nexports.configureDecoder() // Setup default cbor.Decoder\n\n/**\n * Serialize internal representation into a binary CBOR block.\n *\n * @param {Object} node - Internal representation of a CBOR block\n * @returns {Buffer} - The encoded binary representation\n */\nexports.serialize = (node) => {\n const nodeTagged = replaceCIDbyTAG(node)\n const serialized = cbor.encode(nodeTagged)\n\n return serialized\n}\n\n/**\n * Deserialize CBOR block into the internal representation.\n *\n * @param {Buffer} data - Binary representation of a CBOR block\n * @returns {Object} - An object that conforms to the IPLD Data Model\n */\nexports.deserialize = (data) => {\n if (data.length > currentSize && data.length <= maxSize) {\n exports.configureDecoder({ size: data.length })\n }\n\n if (data.length > currentSize) {\n throw new Error('Data is too large to deserialize with current decoder')\n }\n\n const deserialized = decoder.decodeFirst(data)\n\n return deserialized\n}\n\n/**\n * Calculate the CID of the binary blob.\n *\n * @param {Object} binaryBlob - Encoded IPLD Node\n * @param {Object} [userOptions] - Options to create the CID\n * @param {number} [userOptions.cidVersion=1] - CID version number\n * @param {string} [UserOptions.hashAlg] - Defaults to the defaultHashAlg of the format\n * @returns {Promise.<CID>}\n */\nexports.cid = async (binaryBlob, userOptions) => {\n const defaultOptions = { cidVersion: 1, hashAlg: exports.defaultHashAlg }\n const options = Object.assign(defaultOptions, userOptions)\n\n const multihash = await multihashing(binaryBlob, options.hashAlg)\n const codecName = multicodec.print[exports.codec]\n const cid = new CID(options.cidVersion, codecName, multihash)\n\n return cid\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-cbor/src/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-link/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-link/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\")\nconst withIs = __webpack_require__(/*! class-is */ \"./node_modules/class-is/index.js\")\nconst visibility = __webpack_require__(/*! ../visibility */ \"./node_modules/ipld-dag-pb/src/visibility.js\")\n\n// Link represents an IPFS Merkle DAG Link between Nodes.\nclass DAGLink {\n constructor (name, size, cid) {\n assert(cid, 'A link requires a cid to point to')\n // assert(size, 'A link requires a size')\n // note - links should include size, but this assert is disabled\n // for now to maintain consistency with go-ipfs pinset\n\n this._name = name || ''\n this._nameBuf = null\n this._size = size\n this._cid = new CID(cid)\n\n // Make sure we have a nice public API that can be used by an IPLD resolver\n visibility.hidePrivateFields(this)\n visibility.addEnumerableGetters(this, ['Hash', 'Name', 'Tsize'])\n }\n\n toString () {\n return `DAGLink <${this._cid.toBaseEncodedString()} - name: \"${this.Name}\", size: ${this.Tsize}>`\n }\n\n toJSON () {\n if (!this._json) {\n this._json = Object.freeze({\n name: this.Name,\n size: this.Tsize,\n cid: this.Hash.toBaseEncodedString()\n })\n }\n\n return Object.assign({}, this._json)\n }\n\n get Name () {\n return this._name\n }\n\n // Memoize the Buffer representation of name\n // We need this to sort the links, otherwise\n // we will reallocate new buffers every time\n get nameAsBuffer () {\n if (this._nameBuf !== null) {\n return this._nameBuf\n }\n\n this._nameBuf = Buffer.from(this._name)\n return this._nameBuf\n }\n\n set Name (name) {\n throw new Error(\"Can't set property: 'name' is immutable\")\n }\n\n get Tsize () {\n return this._size\n }\n\n set Tsize (size) {\n throw new Error(\"Can't set property: 'size' is immutable\")\n }\n\n get Hash () {\n return this._cid\n }\n\n set Hash (cid) {\n throw new Error(\"Can't set property: 'cid' is immutable\")\n }\n}\n\nexports = module.exports = withIs(DAGLink, { className: 'DAGLink', symbolName: '@ipld/js-ipld-dag-pb/daglink' })\nexports.util = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-pb/src/dag-link/util.js\")\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-link/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-link/util.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-link/util.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst DAGLink = __webpack_require__(/*! ./index */ \"./node_modules/ipld-dag-pb/src/dag-link/index.js\")\n\nfunction createDagLinkFromB58EncodedHash (link) {\n return new DAGLink(\n link.Name || link.name || '',\n link.Tsize || link.Size || link.size || 0,\n link.Hash || link.hash || link.multihash || link.cid\n )\n}\n\nexports = module.exports\nexports.createDagLinkFromB58EncodedHash = createDagLinkFromB58EncodedHash\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-link/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/addLink.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/addLink.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst dagNodeUtil = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-pb/src/dag-node/util.js\")\nconst cloneLinks = dagNodeUtil.cloneLinks\nconst cloneData = dagNodeUtil.cloneData\nconst toDAGLink = dagNodeUtil.toDAGLink\nconst DAGLink = __webpack_require__(/*! ../dag-link */ \"./node_modules/ipld-dag-pb/src/dag-link/index.js\")\nconst DAGNode = __webpack_require__(/*! ./index */ \"./node_modules/ipld-dag-pb/src/dag-node/index.js\")\nconst create = __webpack_require__(/*! ./create */ \"./node_modules/ipld-dag-pb/src/dag-node/create.js\")\n\nconst asDAGLink = async (link) => {\n if (DAGLink.isDAGLink(link)) {\n // It's a DAGLink instance\n // no need to do anything\n return link\n }\n\n if (DAGNode.isDAGNode(link)) {\n // It's a DAGNode instance\n // convert to link\n return toDAGLink(link, {})\n }\n\n // It's a Object with name, multihash/hash/cid and size\n return new DAGLink(link.Name || link.name, link.Tsize || link.size, link.Hash || link.multihash || link.hash || link.cid)\n}\n\nconst addLink = async (node, link) => {\n const links = cloneLinks(node)\n const data = cloneData(node)\n\n const dagLink = await asDAGLink(link)\n links.push(dagLink)\n return create(data, links)\n}\n\nmodule.exports = addLink\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/addLink.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/addNamedLink.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/addNamedLink.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * Adds a link with its name as property to an object.\n *\n * The link won't be added if its name is empty or matches one of the existing\n * properties.\n *\n * @param {Object} object - The object that contains an array of links\n * @param {string} name - The name of the link to add\n * @param {numner} position - The position within the array of links\n */\nconst addNamedLink = (object, name, position) => {\n const skipNames = ['', ...Object.keys(object)]\n if (skipNames.includes(name)) {\n return\n }\n Object.defineProperty(object, name, {\n enumerable: true,\n configurable: true,\n get: () => object._links[position].Hash\n })\n}\n\nmodule.exports = addNamedLink\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/addNamedLink.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/clone.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/clone.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst dagNodeUtil = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-pb/src/dag-node/util.js\")\nconst cloneLinks = dagNodeUtil.cloneLinks\nconst cloneData = dagNodeUtil.cloneData\nconst create = __webpack_require__(/*! ./create */ \"./node_modules/ipld-dag-pb/src/dag-node/create.js\")\n\nfunction clone (dagNode) {\n const data = cloneData(dagNode)\n const links = cloneLinks(dagNode)\n return create(data, links)\n}\n\nmodule.exports = clone\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/clone.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/create.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/create.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst sort = __webpack_require__(/*! stable */ \"./node_modules/stable/stable.js\")\nconst {\n serialize\n} = __webpack_require__(/*! ../util.js */ \"./node_modules/ipld-dag-pb/src/util.js\")\nconst dagNodeUtil = __webpack_require__(/*! ./util.js */ \"./node_modules/ipld-dag-pb/src/dag-node/util.js\")\nconst linkSort = dagNodeUtil.linkSort\nconst DAGNode = __webpack_require__(/*! ./index.js */ \"./node_modules/ipld-dag-pb/src/dag-node/index.js\")\nconst DAGLink = __webpack_require__(/*! ../dag-link */ \"./node_modules/ipld-dag-pb/src/dag-link/index.js\")\n\nconst create = (data, links = []) => {\n if (typeof data === 'string') {\n data = Buffer.from(data)\n }\n\n if (!Buffer.isBuffer(data)) {\n throw new Error('Passed \\'data\\' is not a buffer or a string!')\n }\n links = links.map((link) => {\n return DAGLink.isDAGLink(link) ? link : DAGLink.util.createDagLinkFromB58EncodedHash(link)\n })\n links = sort(links, linkSort)\n\n const serialized = serialize({\n Data: data,\n Links: links\n })\n\n return new DAGNode(data, links, serialized.length)\n}\n\nmodule.exports = create\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/create.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/index.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/index.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\")\nconst withIs = __webpack_require__(/*! class-is */ \"./node_modules/class-is/index.js\")\nconst addNamedLink = __webpack_require__(/*! ./addNamedLink */ \"./node_modules/ipld-dag-pb/src/dag-node/addNamedLink.js\")\nconst visibility = __webpack_require__(/*! ../visibility */ \"./node_modules/ipld-dag-pb/src/visibility.js\")\n\nclass DAGNode {\n constructor (data, links, serializedSize) {\n if (serializedSize !== 0) {\n assert(serializedSize, 'A DAGNode requires it\\'s serialized size')\n }\n\n this._data = data || Buffer.alloc(0)\n this._links = links\n this._serializedSize = serializedSize\n\n // Make sure we have a nice public API that can be used by an IPLD resolver\n visibility.hidePrivateFields(this)\n visibility.addEnumerableGetters(this, ['Data', 'Links'])\n\n // Add getters for existing links by the name of the link\n // This is how paths are traversed in IPFS. Links with names won't\n // override existing fields like `data` or `links`.\n links.forEach((link, position) => {\n addNamedLink(this, link.Name, position)\n })\n }\n\n toJSON () {\n if (!this._json) {\n this._json = Object.freeze({\n data: this.Data,\n links: this._links.map((l) => l.toJSON()),\n size: this.size\n })\n }\n\n return Object.assign({}, this._json)\n }\n\n toString () {\n return `DAGNode <data: \"${this.Data.toString('base64')}\", links: ${this.Links.length}, size: ${this.size}>`\n }\n\n get size () {\n if (this._size === undefined) {\n this._size = this._links.reduce((sum, l) => sum + l.Tsize, this._serializedSize)\n }\n\n return this._size\n }\n\n set size (size) {\n throw new Error(\"Can't set property: 'size' is immutable\")\n }\n\n // Getters for backwards compatible path resolving\n get Data () {\n return this._data\n }\n set Data (_) {\n throw new Error(\"Can't set property: 'Data' is immutable\")\n }\n get Links () {\n return this._links.map((link) => {\n return {\n Name: link.Name,\n Tsize: link.Tsize,\n Hash: link.Hash\n }\n })\n }\n set Links (_) {\n throw new Error(\"Can't set property: 'Links' is immutable\")\n }\n}\n\nexports = module.exports = withIs(DAGNode, { className: 'DAGNode', symbolName: '@ipld/js-ipld-dag-pb/dagnode' })\nexports.create = __webpack_require__(/*! ./create */ \"./node_modules/ipld-dag-pb/src/dag-node/create.js\")\nexports.clone = __webpack_require__(/*! ./clone */ \"./node_modules/ipld-dag-pb/src/dag-node/clone.js\")\nexports.addLink = __webpack_require__(/*! ./addLink */ \"./node_modules/ipld-dag-pb/src/dag-node/addLink.js\")\nexports.rmLink = __webpack_require__(/*! ./rmLink */ \"./node_modules/ipld-dag-pb/src/dag-node/rmLink.js\")\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/rmLink.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/rmLink.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst dagNodeUtil = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-pb/src/dag-node/util.js\")\nconst cloneLinks = dagNodeUtil.cloneLinks\nconst cloneData = dagNodeUtil.cloneData\nconst create = __webpack_require__(/*! ./create */ \"./node_modules/ipld-dag-pb/src/dag-node/create.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nconst rmLink = (dagNode, nameOrCid) => {\n const data = cloneData(dagNode)\n let links = cloneLinks(dagNode)\n\n if (typeof nameOrCid === 'string') {\n links = links.filter((link) => link.Name !== nameOrCid)\n } else if (Buffer.isBuffer(nameOrCid) || CID.isCID(nameOrCid)) {\n links = links.filter((link) => !link.Hash.equals(nameOrCid))\n } else {\n throw new Error('second arg needs to be a name or CID')\n }\n\n return create(data, links)\n}\n\nmodule.exports = rmLink\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/rmLink.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag-node/util.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag-node/util.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst DAGLink = __webpack_require__(/*! ./../dag-link */ \"./node_modules/ipld-dag-pb/src/dag-link/index.js\")\nconst {\n cid,\n serialize\n} = __webpack_require__(/*! ../util */ \"./node_modules/ipld-dag-pb/src/util.js\")\n\nexports = module.exports\n\nfunction cloneData (dagNode) {\n let data\n\n if (dagNode.Data && dagNode.Data.length > 0) {\n data = Buffer.alloc(dagNode.Data.length)\n dagNode.Data.copy(data)\n } else {\n data = Buffer.alloc(0)\n }\n\n return data\n}\n\nfunction cloneLinks (dagNode) {\n return dagNode.Links.slice()\n}\n\nfunction linkSort (a, b) {\n return Buffer.compare(a.nameAsBuffer, b.nameAsBuffer)\n}\n\n/*\n * toDAGLink converts a DAGNode to a DAGLink\n */\nconst toDAGLink = async (node, options = {}) => {\n const serialized = serialize(node)\n const nodeCid = await cid(serialized)\n return new DAGLink(options.name || '', serialized.length, nodeCid)\n}\n\nexports.cloneData = cloneData\nexports.cloneLinks = cloneLinks\nexports.linkSort = linkSort\nexports.toDAGLink = toDAGLink\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag-node/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/dag.proto.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/dag.proto.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = `// An IPFS MerkleDAG Link\nmessage PBLink {\n\n // multihash of the target object\n optional bytes Hash = 1;\n\n // utf string name. should be unique per object\n optional string Name = 2;\n\n // cumulative size of target object\n optional uint64 Tsize = 3;\n}\n\n// An IPFS MerkleDAG Node\nmessage PBNode {\n\n // refs to other objects\n repeated PBLink Links = 2;\n\n // opaque user data\n optional bytes Data = 1;\n}`\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/dag.proto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nexports.DAGNode = __webpack_require__(/*! ./dag-node */ \"./node_modules/ipld-dag-pb/src/dag-node/index.js\")\nexports.DAGLink = __webpack_require__(/*! ./dag-link */ \"./node_modules/ipld-dag-pb/src/dag-link/index.js\")\n\n/*\n * Functions to fulfil IPLD Format interface\n * https://github.com/ipld/interface-ipld-format\n */\nexports.resolver = __webpack_require__(/*! ./resolver */ \"./node_modules/ipld-dag-pb/src/resolver.js\")\nexports.util = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-pb/src/util.js\")\nexports.codec = exports.util.codec\nexports.defaultHashAlg = exports.util.defaultHashAlg\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/resolver.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/resolver.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nconst util = __webpack_require__(/*! ./util */ \"./node_modules/ipld-dag-pb/src/util.js\")\n\n/**\n * Resolves a path within a PB block.\n *\n * Returns the value or a link and the partial mising path. This way the\n * IPLD Resolver can fetch the link and continue to resolve.\n *\n * @param {Buffer} binaryBlob - Binary representation of a PB block\n * @param {string} [path='/'] - Path that should be resolved\n * @returns {Object} result - Result of the path it it was resolved successfully\n * @returns {*} result.value - Value the path resolves to\n * @returns {string} result.remainderPath - If the path resolves half-way to a\n * link, then the `remainderPath` is the part after the link that can be used\n * for further resolving\n */\nexports.resolve = (binaryBlob, path) => {\n let node = util.deserialize(binaryBlob)\n\n const parts = path.split('/').filter(Boolean)\n while (parts.length) {\n const key = parts.shift()\n if (node[key] === undefined) {\n throw new Error(`Object has no property '${key}'`)\n }\n\n node = node[key]\n if (CID.isCID(node)) {\n return {\n value: node,\n remainderPath: parts.join('/')\n }\n }\n }\n\n return {\n value: node,\n remainderPath: ''\n }\n}\n\nconst traverse = function * (node, path) {\n // Traverse only objects and arrays\n if (Buffer.isBuffer(node) || CID.isCID(node) || typeof node === 'string' ||\n node === null) {\n return\n }\n for (const item of Object.keys(node)) {\n const nextpath = path === undefined ? item : path + '/' + item\n yield nextpath\n yield * traverse(node[item], nextpath)\n }\n}\n\n/**\n * Return all available paths of a block.\n *\n * @generator\n * @param {Buffer} binaryBlob - Binary representation of a PB block\n * @yields {string} - A single path\n */\nexports.tree = function * (binaryBlob) {\n const node = util.deserialize(binaryBlob)\n\n yield * traverse(node)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/resolver.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/util.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/util.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst protons = __webpack_require__(/*! protons */ \"./node_modules/protons/src/index.js\")\nconst proto = protons(__webpack_require__(/*! ./dag.proto.js */ \"./node_modules/ipld-dag-pb/src/dag.proto.js\"))\nconst DAGLink = __webpack_require__(/*! ./dag-link */ \"./node_modules/ipld-dag-pb/src/dag-link/index.js\")\nconst DAGNode = __webpack_require__(/*! ./dag-node */ \"./node_modules/ipld-dag-pb/src/dag-node/index.js\")\nconst multicodec = __webpack_require__(/*! multicodec */ \"./node_modules/multicodec/src/index.js\")\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/multihashing-async/src/index.js\")\n\nexports = module.exports\n\nexports.codec = multicodec.DAG_PB\nexports.defaultHashAlg = multicodec.SHA2_256\n\n/**\n * Calculate the CID of the binary blob.\n *\n * @param {Object} binaryBlob - Encoded IPLD Node\n * @param {Object} [userOptions] - Options to create the CID\n * @param {number} [userOptions.cidVersion=1] - CID version number\n * @param {string} [UserOptions.hashAlg] - Defaults to the defaultHashAlg of the format\n * @returns {Promise.<CID>}\n */\nconst cid = async (binaryBlob, userOptions) => {\n const defaultOptions = { cidVersion: 1, hashAlg: exports.defaultHashAlg }\n const options = Object.assign(defaultOptions, userOptions)\n\n const multihash = await multihashing(binaryBlob, options.hashAlg)\n const codecName = multicodec.print[exports.codec]\n const cid = new CID(options.cidVersion, codecName, multihash)\n\n return cid\n}\n\n/**\n * Serialize internal representation into a binary PB block.\n *\n * @param {Object} node - Internal representation of a CBOR block\n * @returns {Buffer} - The encoded binary representation\n */\nconst serialize = (node) => {\n let data = node.Data\n let links = node.Links || []\n\n // If the node is not an instance of a DAGNode, the link.hash might be a Base58 encoded string; decode it\n if (!DAGNode.isDAGNode(node) && links) {\n links = links.map((link) => {\n return DAGLink.isDAGLink(link) ? link : DAGLink.util.createDagLinkFromB58EncodedHash(link)\n })\n }\n\n const serialized = proto.PBNode.encode(toProtoBuf({\n Data: data,\n Links: links\n }))\n\n return serialized\n}\n\n/**\n * Deserialize PB block into the internal representation.\n *\n * @param {Buffer} buffer - Binary representation of a PB block\n * @returns {Object} - An object that conforms to the IPLD Data Model\n */\nconst deserialize = (buffer) => {\n const pbn = proto.PBNode.decode(buffer)\n\n const links = pbn.Links.map((link) => {\n return new DAGLink(link.Name, link.Tsize, link.Hash)\n })\n\n const data = pbn.Data == null ? Buffer.alloc(0) : pbn.Data\n\n return new DAGNode(data, links, buffer.length)\n}\n\nfunction toProtoBuf (node) {\n const pbn = {}\n\n if (node.Data && node.Data.length > 0) {\n pbn.Data = node.Data\n } else {\n // NOTE: this has to be null in order to match go-ipfs serialization `null !== new Buffer(0)`\n pbn.Data = null\n }\n\n if (node.Links && node.Links.length > 0) {\n pbn.Links = node.Links\n .map((link) => ({\n Hash: link.Hash.buffer,\n Name: link.Name,\n Tsize: link.Tsize\n }))\n } else {\n pbn.Links = null\n }\n\n return pbn\n}\n\nexports.serialize = serialize\nexports.deserialize = deserialize\nexports.cid = cid\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-dag-pb/src/visibility.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ipld-dag-pb/src/visibility.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * Make certain getters enumnerable\n *\n * This can be used to add additional getters that are enumerable and hence\n * show up on an `Object.keys()` call.\n *\n * @param {Object} object - The object it should be applied to\n * @param {Array.<String>} fields - The fields that should be made enumnerable\n */\nconst addEnumerableGetters = (object, fields) => {\n for (const field of fields) {\n let prop\n let proto = object\n // Walk up the proottype chain until a property with the given name is\n // found\n while (prop === undefined) {\n proto = Object.getPrototypeOf(proto)\n if (proto === null) {\n throw new Error(`no getter named '${field}' found`)\n }\n prop = Object.getOwnPropertyDescriptor(proto, field)\n }\n\n // There is a property with the correct name, but it's not a getter\n if (prop.get === undefined) {\n throw new Error(`no getter named '${field}' found`)\n }\n Object.defineProperty(object, field, {\n enumerable: true,\n get: prop.get\n })\n }\n}\n\n/**\n * Makes all properties with a leading underscore non-enumerable.\n *\n * @param {Object} object - The object it should be applied to\n */\nconst hidePrivateFields = (object) => {\n for (const key in object) {\n if (key[0] === '_') {\n Object.defineProperty(object, key, { enumerable: false })\n }\n }\n}\n\nmodule.exports = {\n addEnumerableGetters,\n hidePrivateFields\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipld-dag-pb/src/visibility.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ipld-raw/src/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ipld-raw/src/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/multihashing-async/src/index.js\")\nconst multicodec = __webpack_require__(/*! multicodec */ \"./node_modules/multicodec/src/index.js\")\n\n// binary resolver\nmodule.exports = {\n codec: multicodec.RAW,\n defaultHashAlg: multicodec.SHA2_256,\n resolver: {\n /**\n * Resolves a path within a Raw block.\n *\n * Always returns the raw data as value without any remainderPath.\n *\n * @param {Buffer} binaryBlob - Binary representation of a PB block\n * @param {string} [path='/'] - Path that should be resolved (that value is ignored)\n * @returns {Object} result - Result of the path it it was resolved successfully\n * @returns {*} result.value - The raw data\n * @returns {string} result.remainderPath - An empty string\n */\n resolve: (binaryBlob, path) => {\n return {\n value: binaryBlob,\n remainderPath: ''\n }\n },\n /**\n * Return all available paths of a block.\n *\n * @generator\n * @param {Buffer} binaryBlob - The raw data\n * @returns {Object} - Finished generator with `done: true`\n */\n tree: (binaryBlob) => {\n return {\n done: true\n }\n }\n },\n util: {\n deserialize: (data) => {\n return data\n },\n serialize: (data) => {\n return data\n },\n /**\n * Calculate the CID of the binary blob.\n *\n * @param {Object} binaryBlob - Encoded IPLD Node\n * @param {Object} [userOptions] - Options to create the CID\n * @param {number} [userOptions.cidVersion=1] - CID version number\n * @param {string} [UserOptions.hashAlg] - Defaults to the defaultHashAlg of the format\n * @returns {Promise.<CID>}\n */\n cid: async (binaryBlob, userOptions) => {\n const defaultOptions = { cidVersion: 1, hashAlg: module.exports.defaultHashAlg }\n const options = Object.assign(defaultOptions, userOptions)\n\n const multihash = await multihashing(binaryBlob, options.hashAlg)\n const codecName = multicodec.print[module.exports.codec]\n const cid = new CID(options.cidVersion, codecName, multihash)\n\n return cid\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ipld-raw/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-ascii/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/is-ascii/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (c) 2016 Ari Porad (@ariporad) <http://ariporad.com>. License: ariporad.mit-license.org */\n\n// Partially from http://stackoverflow.com/a/94049/1928484, and from another SO answer, which told me that the highest\n// char code that's ascii is 127, but I can't find the link for. Sorry.\n\nvar MAX_ASCII_CHAR_CODE = 127;\n\nmodule.exports = function isAscii(str) {\n for (var i = 0, strLen = str.length; i < strLen; ++i) {\n if (str.charCodeAt(i) > MAX_ASCII_CHAR_CODE) return false;\n }\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/is-ascii/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-circular/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/is-circular/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Node = __webpack_require__(/*! ./lib/node */ \"./node_modules/is-circular/lib/node.js\")\n\nmodule.exports = isCircular\n\n/**\n * checks whether the object is circular\n * @param {object} obj - object to check circularity for\n * @return {Boolean} true if obj is circular, false if it is not\n */\nfunction isCircular (obj) {\n if (!(obj instanceof Object)) {\n throw new TypeError('\"obj\" must be an object (or inherit from it)')\n }\n return _isCircular(obj)\n}\n\n/**\n * @private\n * checks whether the object is circular\n * @param {object} obj - object to check circularity for\n * @param {Node} parentList - linked-list that contains all the object's parents\n * @return {Boolean} true if obj is circular, false if it is not\n */\nfunction _isCircular (obj, parentList) {\n parentList = new Node(obj, parentList)\n\n // breadth-first search for circular object\n for (var key in obj) {\n var val = obj[key]\n if (val instanceof Object) {\n if (parentList.contains(val) || _isCircular(val, parentList)) {\n return true\n }\n }\n }\n\n return false\n}\n\n\n//# sourceURL=webpack:///./node_modules/is-circular/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-circular/lib/node.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/is-circular/lib/node.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = Node\n\n/**\n * a linked-list node\n * @class\n * @param {any} value - node's value\n * @param {Node} next - next node\n */\nfunction Node (value, next) {\n this.value = value\n this.next = next\n}\n\n/**\n * checks if this node or any of its children has the value\n * @param {any} value - value to check if linked-list contains\n * @return {boolean} true if the list contains the value; false if not\n */\nNode.prototype.contains = function (value) {\n var cursor = this\n\n while (cursor) {\n if (cursor.value === value) return true\n cursor = cursor.next\n }\n\n return false\n}\n\n\n//# sourceURL=webpack:///./node_modules/is-circular/lib/node.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-file/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/is-file/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\");\n\nmodule.exports = function isFile(path, cb){\n if(!cb)return isFileSync(path);\n\n fs.stat(path, function(err, stats){\n if(err)return cb(err);\n return cb(null, stats.isFile());\n });\n};\n\nmodule.exports.sync = isFileSync;\n\nfunction isFileSync(path){\n return fs.existsSync(path) && fs.statSync(path).isFile();\n}\n\n\n//# sourceURL=webpack:///./node_modules/is-file/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-ip/index.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/is-ip/index.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nconst ipRegex = __webpack_require__(/*! ip-regex */ \"./node_modules/ip-regex/index.js\");\n\nconst isIp = module.exports = x => ipRegex({exact: true}).test(x);\nisIp.v4 = x => ipRegex.v4({exact: true}).test(x);\nisIp.v6 = x => ipRegex.v6({exact: true}).test(x);\n\n\n//# sourceURL=webpack:///./node_modules/is-ip/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-ipfs/src/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/is-ipfs/src/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst base58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst multibase = __webpack_require__(/*! multibase */ \"./node_modules/multibase/src/index.js\")\nconst Multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\nconst mafmt = __webpack_require__(/*! mafmt */ \"./node_modules/mafmt/src/index.js\")\nconst CID = __webpack_require__(/*! cids */ \"./node_modules/cids/src/index.js\")\n\nconst urlPattern = /^https?:\\/\\/[^/]+\\/(ip(f|n)s)\\/((\\w+).*)/\nconst pathPattern = /^\\/(ip(f|n)s)\\/((\\w+).*)/\nconst defaultProtocolMatch = 1\nconst defaultHashMath = 4\n\nconst fqdnPattern = /^https?:\\/\\/([^/]+)\\.(ip(?:f|n)s)\\.[^/]+/\nconst fqdnHashMatch = 1\nconst fqdnProtocolMatch = 2\n\nfunction isMultihash (hash) {\n const formatted = convertToString(hash)\n try {\n const buffer = Buffer.from(base58.decode(formatted))\n multihash.decode(buffer)\n return true\n } catch (e) {\n return false\n }\n}\n\nfunction isMultibase (hash) {\n try {\n return multibase.isEncoded(hash)\n } catch (e) {\n return false\n }\n}\n\nfunction isCID (hash) {\n try {\n new CID(hash) // eslint-disable-line no-new\n return true\n } catch (e) {\n return false\n }\n}\n\nfunction isMultiaddr (input) {\n if (!input) return false\n if (Multiaddr.isMultiaddr(input)) return true\n try {\n new Multiaddr(input) // eslint-disable-line no-new\n return true\n } catch (e) {\n return false\n }\n}\n\nfunction isPeerMultiaddr (input) {\n return isMultiaddr(input) && mafmt.IPFS.matches(input)\n}\n\nfunction isIpfs (input, pattern, protocolMatch = defaultProtocolMatch, hashMatch = defaultHashMath) {\n const formatted = convertToString(input)\n if (!formatted) {\n return false\n }\n\n const match = formatted.match(pattern)\n if (!match) {\n return false\n }\n\n if (match[protocolMatch] !== 'ipfs') {\n return false\n }\n\n let hash = match[hashMatch]\n\n if (hash && pattern === fqdnPattern) {\n // when doing checks for subdomain context\n // ensure hash is case-insensitive\n // (browsers force-lowercase authority compotent anyway)\n hash = hash.toLowerCase()\n }\n\n return isCID(hash)\n}\n\nfunction isIpns (input, pattern, protocolMatch = defaultProtocolMatch, hashMatch) {\n const formatted = convertToString(input)\n if (!formatted) {\n return false\n }\n const match = formatted.match(pattern)\n if (!match) {\n return false\n }\n\n if (match[protocolMatch] !== 'ipns') {\n return false\n }\n\n if (hashMatch && pattern === fqdnPattern) {\n let hash = match[hashMatch]\n // when doing checks for subdomain context\n // ensure hash is case-insensitive\n // (browsers force-lowercase authority compotent anyway)\n hash = hash.toLowerCase()\n return isCID(hash)\n }\n\n return true\n}\n\nfunction isString (input) {\n return typeof input === 'string'\n}\n\nfunction convertToString (input) {\n if (Buffer.isBuffer(input)) {\n return base58.encode(input)\n }\n\n if (isString(input)) {\n return input\n }\n\n return false\n}\n\nconst ipfsSubdomain = (url) => isIpfs(url, fqdnPattern, fqdnProtocolMatch, fqdnHashMatch)\nconst ipnsSubdomain = (url) => isIpns(url, fqdnPattern, fqdnProtocolMatch, fqdnHashMatch)\n\nmodule.exports = {\n multihash: isMultihash,\n multiaddr: isMultiaddr,\n peerMultiaddr: isPeerMultiaddr,\n cid: isCID,\n base32cid: (cid) => (isMultibase(cid) === 'base32' && isCID(cid)),\n ipfsSubdomain: ipfsSubdomain,\n ipnsSubdomain: ipnsSubdomain,\n subdomain: (url) => (ipfsSubdomain(url) || ipnsSubdomain(url)),\n subdomainPattern: fqdnPattern,\n ipfsUrl: (url) => isIpfs(url, urlPattern),\n ipnsUrl: (url) => isIpns(url, urlPattern),\n url: (url) => (isIpfs(url, urlPattern) || isIpns(url, urlPattern)),\n urlPattern: urlPattern,\n ipfsPath: (path) => isIpfs(path, pathPattern),\n ipnsPath: (path) => isIpns(path, pathPattern),\n path: (path) => (isIpfs(path, pathPattern) || isIpns(path, pathPattern)),\n pathPattern: pathPattern,\n urlOrPath: (x) => (isIpfs(x, urlPattern) || isIpns(x, urlPattern) || isIpfs(x, pathPattern) || isIpns(x, pathPattern)),\n cidPath: path => isString(path) && !isCID(path) && isIpfs(`/ipfs/${path}`, pathPattern)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/is-ipfs/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-promise/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/is-promise/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = isPromise;\r\n\r\nfunction isPromise(obj) {\r\n return obj && typeof obj.then === 'function';\r\n}\n\n//# sourceURL=webpack:///./node_modules/is-promise/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-pull-stream/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/is-pull-stream/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\nfunction isFunction (f) {\n return 'function' === typeof f\n}\n\nfunction isDuplex (d) {\n return 'object' === typeof d && isSource(d.source) && isSink(d.sink)\n}\n\nfunction isSource (s) {\n return isFunction(s) && s.length === 2\n}\n\nfunction isSink (s) {\n return isFunction(s) && s.length === 1\n}\n\nexports.isDuplex = isDuplex\nexports.isSource = isSource\nexports.isSink = isSink\n//can't do is through, it will appear as a sink til you git it a source.\n\n\n\n//# sourceURL=webpack:///./node_modules/is-pull-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-stream/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/is-stream/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst isStream = stream =>\n\tstream !== null &&\n\ttypeof stream === 'object' &&\n\ttypeof stream.pipe === 'function';\n\nisStream.writable = stream =>\n\tisStream(stream) &&\n\tstream.writable !== false &&\n\ttypeof stream._write === 'function' &&\n\ttypeof stream._writableState === 'object';\n\nisStream.readable = stream =>\n\tisStream(stream) &&\n\tstream.readable !== false &&\n\ttypeof stream._read === 'function' &&\n\ttypeof stream._readableState === 'object';\n\nisStream.duplex = stream =>\n\tisStream.writable(stream) &&\n\tisStream.readable(stream);\n\nisStream.transform = stream =>\n\tisStream.duplex(stream) &&\n\ttypeof stream._transform === 'function' &&\n\ttypeof stream._transformState === 'object';\n\nmodule.exports = isStream;\n\n\n//# sourceURL=webpack:///./node_modules/is-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/is-typedarray/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/is-typedarray/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = isTypedArray\nisTypedArray.strict = isStrictTypedArray\nisTypedArray.loose = isLooseTypedArray\n\nvar toString = Object.prototype.toString\nvar names = {\n '[object Int8Array]': true\n , '[object Int16Array]': true\n , '[object Int32Array]': true\n , '[object Uint8Array]': true\n , '[object Uint8ClampedArray]': true\n , '[object Uint16Array]': true\n , '[object Uint32Array]': true\n , '[object Float32Array]': true\n , '[object Float64Array]': true\n}\n\nfunction isTypedArray(arr) {\n return (\n isStrictTypedArray(arr)\n || isLooseTypedArray(arr)\n )\n}\n\nfunction isStrictTypedArray(arr) {\n return (\n arr instanceof Int8Array\n || arr instanceof Int16Array\n || arr instanceof Int32Array\n || arr instanceof Uint8Array\n || arr instanceof Uint8ClampedArray\n || arr instanceof Uint16Array\n || arr instanceof Uint32Array\n || arr instanceof Float32Array\n || arr instanceof Float64Array\n )\n}\n\nfunction isLooseTypedArray(arr) {\n return names[toString.call(arr)]\n}\n\n\n//# sourceURL=webpack:///./node_modules/is-typedarray/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/isarray/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/isarray/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n//# sourceURL=webpack:///./node_modules/isarray/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-random-stream/src/random.browser.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/iso-random-stream/src/random.browser.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {\n\nconst crypto = global.crypto || global.msCrypto;\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536;\n\nfunction oldBrowser() {\n throw new Error(\n 'Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11'\n );\n}\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes;\n} else {\n module.exports = oldBrowser;\n}\n\nfunction randomBytes(size) {\n const bytes = new Uint8Array(size);\n let generated = 0;\n\n if (size > 0) {\n // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) {\n while (generated < bytes) {\n if (generated + MAX_BYTES > bytes) {\n crypto.getRandomValues(\n bytes.subarray(generated, bytes - generated)\n );\n } else {\n crypto.getRandomValues(\n bytes.subarray(generated, generated + MAX_BYTES)\n );\n generated += MAX_BYTES;\n }\n }\n } else {\n crypto.getRandomValues(bytes);\n }\n }\n\n return Buffer.from(bytes);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/iso-random-stream/src/random.browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-stream-http/index.browser.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/iso-stream-http/index.browser.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const http = __webpack_require__(/*! ./lib/http */ \"./node_modules/iso-stream-http/lib/http.js\")\nconst https = http\nconst URL = self.URL\n\nmodule.exports = {\n http,\n https,\n getRequest: (options, cb) => {\n let protocol = 'http:'\n\n if (typeof options === 'string') {\n const url = new URL(options)\n protocol = url.protocol\n } else if (options.protocol) {\n protocol = options.protocol\n }\n\n return protocol === 'http:' ? http.request(options, cb) : https.request(options, cb)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/iso-stream-http/index.browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-stream-http/lib/capability.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/iso-stream-http/lib/capability.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function isFunction (value) {\n\treturn typeof value === 'function'\n}\n\nmodule.exports = {\n\tfetch: 'fetch' in self && isFunction(self.fecth),\n\twritableStream: 'WritableStream' in self && isFunction(self.WritableStream),\n\tabortController: 'AbortController' in self && isFunction(self.AbortController),\n\tarrayBuffer: 'ArrayBuffer' in self\n}\n\n//# sourceURL=webpack:///./node_modules/iso-stream-http/lib/capability.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-stream-http/lib/http.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/iso-stream-http/lib/http.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {var ClientRequest = __webpack_require__(/*! ./request */ \"./node_modules/iso-stream-http/lib/request.js\")\nvar IncomingMessage = __webpack_require__(/*! ./incoming-message */ \"./node_modules/iso-stream-http/lib/incoming-message.js\")\nvar statusCodes = __webpack_require__(/*! builtin-status-codes */ \"./node_modules/builtin-status-codes/browser.js\")\nvar URL = self.URL\n\n\nconst request = (opts, cb) => {\n\tif (typeof opts === 'string') {\n\n\t\topts = new URL(opts, self.location.protocol + '//' +self.location.host)\n\t\topts.path = opts.pathname + opts.search\n\t\topts.auth = (opts.username && opts.password) ? opts.username + ':' + opts.password : null\n\t} else {\n\t\topts = Object.assign({}, opts)\n\t}\n\n\t// Normally, the page is loaded from http or https, so not specifying a protocol\n\t// will result in a (valid) protocol-relative url. However, this won't work if\n\t// the protocol is something else, like 'file:'\n\tvar defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : ''\n\n\tvar protocol = opts.protocol || defaultProtocol\n\tvar host = opts.hostname || opts.host\n\tvar port = opts.port\n\tvar path = opts.path || '/'\n\n\t// Necessary for IPv6 addresses\n\tif (host && host.indexOf(':') !== -1)\n\t\thost = '[' + host + ']'\n\n\t// This may be a relative url. The browser should always be able to interpret it correctly.\n\topts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path\n\topts.method = (opts.method || 'GET').toUpperCase()\n\topts.headers = opts.headers || {}\n\n\t// Also valid opts.auth, opts.mode\n\n\tvar req = new ClientRequest(opts)\n\tif (cb)\n\t\treq.on('response', cb)\n\treturn req\n}\n\nconst get = (opts, cb) => {\n\tvar req = request(opts, cb)\n\treq.end()\n\treturn req\n}\n\nconst Agent = function () {}\nAgent.defaultMaxSockets = 4\n\nconst METHODS = [\n\t'CHECKOUT',\n\t'CONNECT',\n\t'COPY',\n\t'DELETE',\n\t'GET',\n\t'HEAD',\n\t'LOCK',\n\t'M-SEARCH',\n\t'MERGE',\n\t'MKACTIVITY',\n\t'MKCOL',\n\t'MOVE',\n\t'NOTIFY',\n\t'OPTIONS',\n\t'PATCH',\n\t'POST',\n\t'PROPFIND',\n\t'PROPPATCH',\n\t'PURGE',\n\t'PUT',\n\t'REPORT',\n\t'SEARCH',\n\t'SUBSCRIBE',\n\t'TRACE',\n\t'UNLOCK',\n\t'UNSUBSCRIBE'\n]\n\nmodule.exports = {\n\tAgent,\n\tClientRequest,\n\tIncomingMessage,\n\tMETHODS,\n\tSTATUS_CODES: statusCodes,\n\tget,\n\tglobalAgent : new Agent(),\n\trequest,\n\tmaxHeaderSize: '8KB'\n\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/iso-stream-http/lib/http.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-stream-http/lib/incoming-message.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/iso-stream-http/lib/incoming-message.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {var capability = __webpack_require__(/*! ./capability */ \"./node_modules/iso-stream-http/lib/capability.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\nvar IncomingMessage = function (response, mode, fetchTimer) {\n\tstream.Readable.call(this)\n\n\tthis._mode = mode\n\tthis.headers = {}\n\tthis.rawHeaders = []\n\tthis.trailers = {}\n\tthis.rawTrailers = []\n\n\t// Fake the 'close' event, but only once 'end' fires\n\tthis.on('end', () => {\n\t\t// The nextTick is necessary to prevent the 'request' module from causing an infinite loop\n\t\tprocess.nextTick(() =>this.emit('close'))\n\t})\n\n\tthis._fetchResponse = response\n\n\tthis.url = response.url\n\tthis.statusCode = response.status\n\tthis.statusMessage = response.statusText\n\t\n\tresponse.headers.forEach((header, key) => {\n\t\tthis.headers[key.toLowerCase()] = header\n\t\tthis.rawHeaders.push(key, header)\n\t})\n\n\tif (capability.writableStream) {\n\t\tvar writable = new WritableStream({\n\t\t\twrite: chunk => {\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tif (this._destroyed) {\n\t\t\t\t\t\treject()\n\t\t\t\t\t} else if(this.push(Buffer.from(chunk))) {\n\t\t\t\t\t\tresolve()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._resumeFetch = resolve\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\tclose: () => {\n\t\t\t\tclearTimeout(fetchTimer)\n\t\t\t\tif (!this._destroyed){\n\t\t\t\t\tthis.push(null)\n\t\t\t\t}\n\t\t\t},\n\t\t\tabort: err => {\n\t\t\t\tif (!this._destroyed){\n\t\t\t\t\tthis.emit('error', err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\ttry {\n\t\t\tresponse.body\n\t\t\t\t.pipeTo(writable)\n\t\t\t\t.catch(err => {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tself.clearTimeout(fetchTimer)\n\t\t\t\t\tif (!this._destroyed){\n\t\t\t\t\t\tthis.emit('error', err)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\treturn\n\t\t} catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this\n\t}\n\t// fallback for when writableStream or pipeTo aren't available\n\tvar reader = response.body.getReader()\n\t\n\tfunction read (context) {\n\t\treader.read()\n\t\t.then(result => {\n\t\t\tif (context._destroyed){\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (result.done) {\n\t\t\t\tclearTimeout(fetchTimer)\n\t\t\t\tcontext.push(null)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcontext.push(Buffer.from(result.value))\n\t\t\tread(context)\n\t\t})\n\t\t.catch(err => {\n\t\t\tclearTimeout(fetchTimer)\n\t\t\tif (!context._destroyed){\n\t\t\t\tcontext.emit('error', err)\n\t\t\t}\n\t\t})\n\t}\n\n\tread(this)\n\t\n}\n\ninherits(IncomingMessage, stream.Readable)\n\nIncomingMessage.prototype._read = function () {\n\tvar resolve = this._resumeFetch\n\tif (resolve) {\n\t\tthis._resumeFetch = null\n\t\tresolve()\n\t}\n}\n\nmodule.exports = IncomingMessage\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/iso-stream-http/lib/incoming-message.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-stream-http/lib/request.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/iso-stream-http/lib/request.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var capability = __webpack_require__(/*! ./capability */ \"./node_modules/iso-stream-http/lib/capability.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar IncomingMessage = __webpack_require__(/*! ./incoming-message */ \"./node_modules/iso-stream-http/lib/incoming-message.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\nvar fetch = self.fetch\n\nvar ClientRequest = module.exports = function (opts) {\n\tstream.Writable.call(this)\n\n\tthis._opts = opts\n\tthis._body = []\n\tthis._headers = {}\n\tif (opts.auth)\n\t\tthis.setHeader('Authorization', 'Basic ' + Buffer.from(opts.auth).toString('base64'))\n\n\n\tObject.keys(opts.headers).forEach(name => {\n\t\tthis.setHeader(name, opts.headers[name])\n\t})\n\n\tthis._mode = 'fetch'\n\tthis._fetchTimer = null\n\n\tthis.on('finish', () => this._onFinish())\n}\n\ninherits(ClientRequest, stream.Writable)\n\nClientRequest.prototype.setHeader = function (name, value) {\n\tvar lowerName = name.toLowerCase()\n\t// This check is not necessary, but it prevents warnings from browsers about setting unsafe\n\t// headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but\n\t// http-browserify did it, so I will too.\n\tif (unsafeHeaders.indexOf(lowerName) !== -1){\n\t\treturn\n\t}\n\tthis._headers[lowerName] = value\n}\n\nClientRequest.prototype.getHeader = function (name) {\n\tvar header = this._headers[name.toLowerCase()]\n\tif (header)\n\t\treturn header.value\n\treturn null\n}\n\nClientRequest.prototype.removeHeader = function (name) {\n\tdelete this._headers[name.toLowerCase()]\n}\n\nClientRequest.prototype._onFinish = function () {\n\tif (this._destroyed)\n\t\treturn\n\tvar opts = this._opts\n\n\tvar headersObj = this._headers\n\tvar body = null\n\tif (opts.method !== 'GET' && opts.method !== 'HEAD') {\n body = new Blob(this._body, {\n type: (headersObj['content-type'] || {}).value || ''\n });\n }\n\n\tvar signal = null\n\tif (capability.abortController) {\n\t\tvar controller = new AbortController()\n\t\tsignal = controller.signal\n\t\tthis._fetchAbortController = controller\n\n\t\tif ('requestTimeout' in opts && opts.requestTimeout !== 0) {\n\t\t\tthis._fetchTimer = setTimeout(() => {\n\t\t\t\tthis.emit('requestTimeout')\n\t\t\t\tif (this._fetchAbortController)\n\t\t\t\t\tthis._fetchAbortController.abort()\n\t\t\t}, opts.requestTimeout)\n\t\t}\n\t}\n\n\tfetch(this._opts.url, {\n\t\tmethod: this._opts.method,\n\t\theaders: this._headers,\n\t\tbody: body || undefined,\n\t\tmode: 'cors',\n\t\tcredentials: opts.withCredentials ? 'include' : 'same-origin',\n\t\tsignal: signal\n\t})\n\t.then(response => {\n\t\tthis._fetchResponse = response\n\t\tthis._connect()\n\t}, reason => {\n\t\tclearTimeout(this._fetchTimer)\n\t\tif (!this._destroyed)\n\t\t\tthis.emit('error', reason)\n\t})\n}\n\nClientRequest.prototype._connect = function () {\n\tif (this._destroyed)\n\t\treturn\n\n\tthis._response = new IncomingMessage(this._fetchResponse, this._mode, this._fetchTimer)\n\tthis._response.on('error', (err) => this.emit('error', err))\n\n\tthis.emit('response', this._response)\n}\n\nClientRequest.prototype._write = function (chunk, encoding, cb) {\n\tthis._body.push(chunk)\n\tcb()\n}\n\nClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () {\n\tthis._destroyed = true\n\n\t\n\tclearTimeout(this._fetchTimer)\n\t\n\tif (this._response)\n\t\tthis._response._destroyed = true\n\tif (this._xhr)\n\t\tthis._xhr.abort()\n\telse if (this._fetchAbortController)\n\t\tthis._fetchAbortController.abort()\n}\n\nClientRequest.prototype.end = function (data, encoding, cb) {\n\tif (typeof data === 'function') {\n\t\tcb = data\n\t\tdata = undefined\n\t}\n\n\tstream.Writable.prototype.end.call(this, data, encoding, cb)\n}\n\nClientRequest.prototype.flushHeaders = function () {}\nClientRequest.prototype.setTimeout = function () {}\nClientRequest.prototype.setNoDelay = function () {}\nClientRequest.prototype.setSocketKeepAlive = function () {}\n\n// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method\nvar unsafeHeaders = [\n\t'accept-charset',\n\t'accept-encoding',\n\t'access-control-request-headers',\n\t'access-control-request-method',\n\t'connection',\n\t'content-length',\n\t'cookie',\n\t'cookie2',\n\t'date',\n\t'dnt',\n\t'expect',\n\t'host',\n\t'keep-alive',\n\t'origin',\n\t'referer',\n\t'te',\n\t'trailer',\n\t'transfer-encoding',\n\t'upgrade',\n\t'via'\n]\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/iso-stream-http/lib/request.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-url/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/iso-url/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst {\n URLWithLegacySupport,\n format,\n URLSearchParams,\n defaultBase\n} = __webpack_require__(/*! ./src/url */ \"./node_modules/iso-url/src/url-browser.js\");\nconst relative = __webpack_require__(/*! ./src/relative */ \"./node_modules/iso-url/src/relative.js\");\n\nmodule.exports = {\n URL: URLWithLegacySupport,\n URLSearchParams,\n format,\n relative,\n defaultBase\n};\n\n\n//# sourceURL=webpack:///./node_modules/iso-url/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-url/src/relative.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/iso-url/src/relative.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { URLWithLegacySupport, format } = __webpack_require__(/*! ./url */ \"./node_modules/iso-url/src/url-browser.js\");\n\nmodule.exports = (url, location = {}, protocolMap = {}, defaultProtocol) => {\n let protocol = location.protocol ?\n location.protocol.replace(':', '') :\n 'http';\n\n // Check protocol map\n protocol = (protocolMap[protocol] || defaultProtocol || protocol) + ':';\n let urlParsed;\n\n try {\n urlParsed = new URLWithLegacySupport(url);\n } catch (err) {\n urlParsed = {};\n }\n\n const base = Object.assign({}, location, {\n protocol: protocol || urlParsed.protocol,\n host: location.host || urlParsed.host\n });\n\n return new URLWithLegacySupport(url, format(base)).toString();\n};\n\n\n//# sourceURL=webpack:///./node_modules/iso-url/src/relative.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/iso-url/src/url-browser.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/iso-url/src/url-browser.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst defaultBase = self.location ?\n self.location.protocol + '//' + self.location.host :\n '';\nconst URL = self.URL;\n\nclass URLWithLegacySupport {\n constructor(url, base = defaultBase) {\n this.super = new URL(url, base);\n this.path = this.pathname + this.search;\n this.auth =\n this.username && this.password ?\n this.username + ':' + this.password :\n null;\n\n this.query =\n this.search && this.search.startsWith('?') ?\n this.search.slice(1) :\n null;\n }\n\n get hash() {\n return this.super.hash;\n }\n get host() {\n return this.super.host;\n }\n get hostname() {\n return this.super.hostname;\n }\n get href() {\n return this.super.href;\n }\n get origin() {\n return this.super.origin;\n }\n get password() {\n return this.super.password;\n }\n get pathname() {\n return this.super.pathname;\n }\n get port() {\n return this.super.port;\n }\n get protocol() {\n return this.super.protocol;\n }\n get search() {\n return this.super.search;\n }\n get searchParams() {\n return this.super.searchParams;\n }\n get username() {\n return this.super.username;\n }\n\n set hash(hash) {\n this.super.hash = hash;\n }\n set host(host) {\n this.super.host = host;\n }\n set hostname(hostname) {\n this.super.hostname = hostname;\n }\n set href(href) {\n this.super.href = href;\n }\n set origin(origin) {\n this.super.origin = origin;\n }\n set password(password) {\n this.super.password = password;\n }\n set pathname(pathname) {\n this.super.pathname = pathname;\n }\n set port(port) {\n this.super.port = port;\n }\n set protocol(protocol) {\n this.super.protocol = protocol;\n }\n set search(search) {\n this.super.search = search;\n }\n set searchParams(searchParams) {\n this.super.searchParams = searchParams;\n }\n set username(username) {\n this.super.username = username;\n }\n\n createObjectURL(o) {\n return this.super.createObjectURL(o);\n }\n revokeObjectURL(o) {\n this.super.revokeObjectURL(o);\n }\n toJSON() {\n return this.super.toJSON();\n }\n toString() {\n return this.super.toString();\n }\n format() {\n return this.toString();\n }\n}\n\nfunction format(obj) {\n if (typeof obj === 'string') {\n const url = new URL(obj);\n\n return url.toString();\n }\n\n if (!(obj instanceof URL)) {\n const userPass =\n obj.username && obj.password ?\n `${obj.username}:${obj.password}@` :\n '';\n const auth = obj.auth ? obj.auth + '@' : '';\n const port = obj.port ? ':' + obj.port : '';\n const protocol = obj.protocol ? obj.protocol + '//' : '';\n const host = obj.host || '';\n const hostname = obj.hostname || '';\n const search = obj.search || (obj.query ? '?' + obj.query : '');\n const hash = obj.hash || '';\n const pathname = obj.pathname || '';\n const path = obj.path || pathname + search;\n\n return `${protocol}${userPass || auth}${host ||\n hostname + port}${path}${hash}`;\n }\n}\n\nmodule.exports = {\n URLWithLegacySupport,\n URLSearchParams: self.URLSearchParams,\n defaultBase,\n format\n};\n\n\n//# sourceURL=webpack:///./node_modules/iso-url/src/url-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/isstream/isstream.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/isstream/isstream.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\")\n\n\nfunction isStream (obj) {\n return obj instanceof stream.Stream\n}\n\n\nfunction isReadable (obj) {\n return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'\n}\n\n\nfunction isWritable (obj) {\n return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'\n}\n\n\nfunction isDuplex (obj) {\n return isReadable(obj) && isWritable(obj)\n}\n\n\nmodule.exports = isStream\nmodule.exports.isReadable = isReadable\nmodule.exports.isWritable = isWritable\nmodule.exports.isDuplex = isDuplex\n\n\n//# sourceURL=webpack:///./node_modules/isstream/isstream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/js-sha3/src/sha3.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/js-sha3/src/sha3.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = true && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\");\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (!n && !s) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (notString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var notString, type = typeof str;\n if (type !== 'string') {\n if (type === 'object') {\n if (str === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n str = new Uint8Array(str);\n } else if (!Array.isArray(str)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var bytes = 0, length = str.length;\n if (notString) {\n bytes = length;\n } else {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = w - bytes % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n array[i] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return methods;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n }\n }\n})();\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/js-sha3/src/sha3.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/jsbn/index.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/jsbn/index.js ***!
|
||
\************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("(function(){\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n var inBrowser = typeof navigator !== \"undefined\";\n if(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<<dbits)-1);\n BigInteger.prototype.DV = (1<<dbits);\n\n var BI_FP = 52;\n BigInteger.prototype.FV = Math.pow(2,BI_FP);\n BigInteger.prototype.F1 = BI_FP-dbits;\n BigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n // Digit conversions\n var BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n var BI_RC = new Array();\n var rr,vv;\n rr = \"0\".charCodeAt(0);\n for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\n rr = \"a\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n rr = \"A\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\n function int2char(n) { return BI_RM.charAt(n); }\n function intAt(s,i) {\n var c = BI_RC[s.charCodeAt(i)];\n return (c==null)?-1:c;\n }\n\n // (protected) copy this to r\n function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n this[this.t++] = (x>>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<<sh;\n sh += k;\n if(sh >= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n }\n this.clamp();\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) clamp off excess high words\n function bnpClamp() {\n var c = this.s&this.DM;\n while(this.t > 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }\n\n // (protected) r = this - a\n function bnpSubTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]-a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3; // y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // Copyright (c) 2005-2009 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Extended JavaScript BN functions, required for RSA private ops.\n\n // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n // Version 1.2: square() API, isProbablePrime fix\n\n // (public)\n function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }\n\n // (public) return value as byte\n function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }\n\n // (public) return value as short (assumes DB>=16)\n function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) alternate constructor\n function bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1))\t// force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;\n this.fromString(x,256);\n }\n }\n\n // (public) convert to bigendian byte array\n function bnToByteArray() {\n var i = this.t, r = new Array();\n r[0] = this.s;\n var p = this.DB-(i*this.DB)%8, d, k = 0;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<<p)-1))<<(8-p);\n d |= this[--i]>>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n }\n\n function bnEquals(a) { return(this.compareTo(a)==0); }\n function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n // (protected) r = this op a (bitwise)\n function bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n }\n\n // (public) this & a\n function op_and(x,y) { return x&y; }\n function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n // (public) this | a\n function op_or(x,y) { return x|y; }\n function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n // (public) this ^ a\n function op_xor(x,y) { return x^y; }\n function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n // (public) this & ~a\n function op_andnot(x,y) { return x&~y; }\n function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n // (public) ~this\n function bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n }\n\n // (public) this << n\n function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }\n\n // (public) this >> n\n function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }\n\n // return index of lowest 1-bit in x, x < 2^31\n function lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n }\n\n // (public) returns index of lowest 1-bit (or -1 if none)\n function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }\n\n // return number of 1 bits in x\n function cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n }\n\n // (public) return number of set bits\n function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }\n\n // (public) true iff nth bit is set\n function bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n }\n\n // (protected) this op (1<<n)\n function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }\n\n // (public) this | (1<<n)\n function bnSetBit(n) { return this.changeBit(n,op_or); }\n\n // (public) this & ~(1<<n)\n function bnClearBit(n) { return this.changeBit(n,op_andnot); }\n\n // (public) this ^ (1<<n)\n function bnFlipBit(n) { return this.changeBit(n,op_xor); }\n\n // (protected) r = this + a\n function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n // (public) this + a\n function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n // (public) this - a\n function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n // (public) this * a\n function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n // (public) this^2\n function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n // (public) this / a\n function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n // (public) this % a\n function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n // (public) [this/a,this%a]\n function bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // A \"null\" reducer\n function NullExp() {}\n function nNop(x) { return x; }\n function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n function nSqrTo(x,r) { x.squareTo(r); }\n\n NullExp.prototype.convert = nNop;\n NullExp.prototype.revert = nNop;\n NullExp.prototype.mulTo = nMulTo;\n NullExp.prototype.sqrTo = nSqrTo;\n\n // (public) this^e\n function bnPow(e) { return this.exp(e,new NullExp()); }\n\n // (protected) r = lower n words of \"this * a\", a.t <= n\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n }\n\n // (protected) r = \"this * a\" without lower n words, n > 0\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n }\n\n // Barrett modular reduction\n function Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n }\n\n function barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n }\n\n function barrettRevert(x) { return x; }\n\n // x = x mod m (HAC 14.42)\n function barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = x^2 mod m; x != r\n function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = x*y mod m; x,y != r\n function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Barrett.prototype.convert = barrettConvert;\n Barrett.prototype.revert = barrettRevert;\n Barrett.prototype.reduce = barrettReduce;\n Barrett.prototype.mulTo = barrettMulTo;\n Barrett.prototype.sqrTo = barrettSqrTo;\n\n // (public) this^e % m (HAC 14.85)\n function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }\n\n // (public) gcd(this,a) (HAC 14.54)\n function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n }\n\n // (protected) this % n, n < 2^26\n function bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n }\n\n // (public) 1/this % m (HAC 14.61)\n function bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n }\n\n var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n // (public) test primality with certainty >= 1-.5^t\n function bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n }\n\n // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n function bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n }\n\n // protected\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.fromNumber = bnpFromNumber;\n BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n BigInteger.prototype.changeBit = bnpChangeBit;\n BigInteger.prototype.addTo = bnpAddTo;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n BigInteger.prototype.modInt = bnpModInt;\n BigInteger.prototype.millerRabin = bnpMillerRabin;\n\n // public\n BigInteger.prototype.clone = bnClone;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.byteValue = bnByteValue;\n BigInteger.prototype.shortValue = bnShortValue;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.toByteArray = bnToByteArray;\n BigInteger.prototype.equals = bnEquals;\n BigInteger.prototype.min = bnMin;\n BigInteger.prototype.max = bnMax;\n BigInteger.prototype.and = bnAnd;\n BigInteger.prototype.or = bnOr;\n BigInteger.prototype.xor = bnXor;\n BigInteger.prototype.andNot = bnAndNot;\n BigInteger.prototype.not = bnNot;\n BigInteger.prototype.shiftLeft = bnShiftLeft;\n BigInteger.prototype.shiftRight = bnShiftRight;\n BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n BigInteger.prototype.bitCount = bnBitCount;\n BigInteger.prototype.testBit = bnTestBit;\n BigInteger.prototype.setBit = bnSetBit;\n BigInteger.prototype.clearBit = bnClearBit;\n BigInteger.prototype.flipBit = bnFlipBit;\n BigInteger.prototype.add = bnAdd;\n BigInteger.prototype.subtract = bnSubtract;\n BigInteger.prototype.multiply = bnMultiply;\n BigInteger.prototype.divide = bnDivide;\n BigInteger.prototype.remainder = bnRemainder;\n BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n BigInteger.prototype.modPow = bnModPow;\n BigInteger.prototype.modInverse = bnModInverse;\n BigInteger.prototype.pow = bnPow;\n BigInteger.prototype.gcd = bnGCD;\n BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n // JSBN-specific extension\n BigInteger.prototype.square = bnSquare;\n\n // Expose the Barrett function\n BigInteger.prototype.Barrett = Barrett\n\n // BigInteger interfaces not implemented in jsbn:\n\n // BigInteger(int signum, byte[] magnitude)\n // double doubleValue()\n // float floatValue()\n // int hashCode()\n // long longValue()\n // static BigInteger valueOf(long val)\n\n\t// Random number generator - requires a PRNG backend, e.g. prng4.js\n\n\t// For best results, put code like\n\t// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>\n\t// in your main HTML document.\n\n\tvar rng_state;\n\tvar rng_pool;\n\tvar rng_pptr;\n\n\t// Mix in a 32-bit integer into the pool\n\tfunction rng_seed_int(x) {\n\t rng_pool[rng_pptr++] ^= x & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n\t if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n\t}\n\n\t// Mix in the current time (w/milliseconds) into the pool\n\tfunction rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}\n\n\t// Initialize the pool with junk if needed.\n\tif(rng_pool == null) {\n\t rng_pool = new Array();\n\t rng_pptr = 0;\n\t var t;\n\t if(typeof window !== \"undefined\" && window.crypto) {\n\t\tif (window.crypto.getRandomValues) {\n\t\t // Use webcrypto if available\n\t\t var ua = new Uint8Array(32);\n\t\t window.crypto.getRandomValues(ua);\n\t\t for(t = 0; t < 32; ++t)\n\t\t\trng_pool[rng_pptr++] = ua[t];\n\t\t}\n\t\telse if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n\t\t // Extract entropy (256 bits) from NS4 RNG if available\n\t\t var z = window.crypto.random(32);\n\t\t for(t = 0; t < z.length; ++t)\n\t\t\trng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n\t\t}\n\t }\n\t while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n\t\tt = Math.floor(65536 * Math.random());\n\t\trng_pool[rng_pptr++] = t >>> 8;\n\t\trng_pool[rng_pptr++] = t & 255;\n\t }\n\t rng_pptr = 0;\n\t rng_seed_time();\n\t //rng_seed_int(window.screenX);\n\t //rng_seed_int(window.screenY);\n\t}\n\n\tfunction rng_get_byte() {\n\t if(rng_state == null) {\n\t\trng_seed_time();\n\t\trng_state = prng_newstate();\n\t\trng_state.init(rng_pool);\n\t\tfor(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n\t\t rng_pool[rng_pptr] = 0;\n\t\trng_pptr = 0;\n\t\t//rng_pool = null;\n\t }\n\t // TODO: allow reseeding after first request\n\t return rng_state.next();\n\t}\n\n\tfunction rng_get_bytes(ba) {\n\t var i;\n\t for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n\t}\n\n\tfunction SecureRandom() {}\n\n\tSecureRandom.prototype.nextBytes = rng_get_bytes;\n\n\t// prng4.js - uses Arcfour as a PRNG\n\n\tfunction Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}\n\n\t// Initialize arcfour context from key, an array of ints, each from [0..255]\n\tfunction ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}\n\n\tfunction ARC4next() {\n\t var t;\n\t this.i = (this.i + 1) & 255;\n\t this.j = (this.j + this.S[this.i]) & 255;\n\t t = this.S[this.i];\n\t this.S[this.i] = this.S[this.j];\n\t this.S[this.j] = t;\n\t return this.S[(t + this.S[this.i]) & 255];\n\t}\n\n\tArcfour.prototype.init = ARC4init;\n\tArcfour.prototype.next = ARC4next;\n\n\t// Plug in your RNG constructor here\n\tfunction prng_newstate() {\n\t return new Arcfour();\n\t}\n\n\t// Pool size must be a multiple of 4 and greater than 32.\n\t// An array of bytes the size of the pool will be passed to init()\n\tvar rng_psize = 256;\n\n BigInteger.SecureRandom = SecureRandom;\n BigInteger.BigInteger = BigInteger;\n if (true) {\n exports = module.exports = BigInteger;\n } else {}\n\n}).call(this);\n\n\n//# sourceURL=webpack:///./node_modules/jsbn/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/json-schema-traverse/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/json-schema-traverse/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n\n\n//# sourceURL=webpack:///./node_modules/json-schema-traverse/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/json-schema/lib/validate.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/json-schema/lib/validate.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\r\n * JSONSchema Validator - Validates JavaScript objects using JSON Schemas\r\n *\t(http://www.json.com/json-schema-proposal/)\r\n *\r\n * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)\r\n * Licensed under the MIT (MIT-LICENSE.txt) license.\r\nTo use the validator call the validate function with an instance object and an optional schema object.\r\nIf a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),\r\nthat schema will be used to validate and the schema parameter is not necessary (if both exist,\r\nboth validations will occur).\r\nThe validate method will return an array of validation errors. If there are no errors, then an\r\nempty list will be returned. A validation error will have two properties:\r\n\"property\" which indicates which property had the error\r\n\"message\" which indicates what the error was\r\n */\r\n(function (root, factory) {\r\n if (true) {\r\n // AMD. Register as an anonymous module.\r\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\r\n return factory();\r\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n } else {}\r\n}(this, function () {// setup primitive classes to be JSON Schema types\r\nvar exports = validate\r\nexports.Integer = {type:\"integer\"};\r\nvar primitiveConstructors = {\r\n\tString: String,\r\n\tBoolean: Boolean,\r\n\tNumber: Number,\r\n\tObject: Object,\r\n\tArray: Array,\r\n\tDate: Date\r\n}\r\nexports.validate = validate;\r\nfunction validate(/*Any*/instance,/*Object*/schema) {\r\n\t\t// Summary:\r\n\t\t// \tTo use the validator call JSONSchema.validate with an instance object and an optional schema object.\r\n\t\t// \t\tIf a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),\r\n\t\t// \t\tthat schema will be used to validate and the schema parameter is not necessary (if both exist,\r\n\t\t// \t\tboth validations will occur).\r\n\t\t// \t\tThe validate method will return an object with two properties:\r\n\t\t// \t\t\tvalid: A boolean indicating if the instance is valid by the schema\r\n\t\t// \t\t\terrors: An array of validation errors. If there are no errors, then an\r\n\t\t// \t\t\t\t\tempty list will be returned. A validation error will have two properties:\r\n\t\t// \t\t\t\t\t\tproperty: which indicates which property had the error\r\n\t\t// \t\t\t\t\t\tmessage: which indicates what the error was\r\n\t\t//\r\n\t\treturn validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false});\r\n\t};\r\nexports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) {\r\n\t\t// Summary:\r\n\t\t// \t\tThe checkPropertyChange method will check to see if an value can legally be in property with the given schema\r\n\t\t// \t\tThis is slightly different than the validate method in that it will fail if the schema is readonly and it will\r\n\t\t// \t\tnot check for self-validation, it is assumed that the passed in value is already internally valid.\r\n\t\t// \t\tThe checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for\r\n\t\t// \t\tinformation.\r\n\t\t//\r\n\t\treturn validate(value, schema, {changing: property || \"property\"});\r\n\t};\r\nvar validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {\r\n\r\n\tif (!options) options = {};\r\n\tvar _changing = options.changing;\r\n\r\n\tfunction getType(schema){\r\n\t\treturn schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());\r\n\t}\r\n\tvar errors = [];\r\n\t// validate a value against a property definition\r\n\tfunction checkProp(value, schema, path,i){\r\n\r\n\t\tvar l;\r\n\t\tpath += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;\r\n\t\tfunction addError(message){\r\n\t\t\terrors.push({property:path,message:message});\r\n\t\t}\r\n\r\n\t\tif((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){\r\n\t\t\tif(typeof schema == 'function'){\r\n\t\t\t\tif(!(value instanceof schema)){\r\n\t\t\t\t\taddError(\"is not an instance of the class/constructor \" + schema.name);\r\n\t\t\t\t}\r\n\t\t\t}else if(schema){\r\n\t\t\t\taddError(\"Invalid schema/property definition \" + schema);\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif(_changing && schema.readonly){\r\n\t\t\taddError(\"is a readonly field, it can not be changed\");\r\n\t\t}\r\n\t\tif(schema['extends']){ // if it extends another schema, it must pass that schema as well\r\n\t\t\tcheckProp(value,schema['extends'],path,i);\r\n\t\t}\r\n\t\t// validate a value against a type definition\r\n\t\tfunction checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\tif(value === undefined){\r\n\t\t\tif(schema.required){\r\n\t\t\t\taddError(\"is missing and it is required\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terrors = errors.concat(checkType(getType(schema),value));\r\n\t\t\tif(schema.disallow && !checkType(schema.disallow,value).length){\r\n\t\t\t\taddError(\" disallowed value was matched\");\r\n\t\t\t}\r\n\t\t\tif(value !== null){\r\n\t\t\t\tif(value instanceof Array){\r\n\t\t\t\t\tif(schema.items){\r\n\t\t\t\t\t\tvar itemsIsArray = schema.items instanceof Array;\r\n\t\t\t\t\t\tvar propDef = schema.items;\r\n\t\t\t\t\t\tfor (i = 0, l = value.length; i < l; i += 1) {\r\n\t\t\t\t\t\t\tif (itemsIsArray)\r\n\t\t\t\t\t\t\t\tpropDef = schema.items[i];\r\n\t\t\t\t\t\t\tif (options.coerce)\r\n\t\t\t\t\t\t\t\tvalue[i] = options.coerce(value[i], propDef);\r\n\t\t\t\t\t\t\terrors.concat(checkProp(value[i],propDef,path,i));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(schema.minItems && value.length < schema.minItems){\r\n\t\t\t\t\t\taddError(\"There must be a minimum of \" + schema.minItems + \" in the array\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(schema.maxItems && value.length > schema.maxItems){\r\n\t\t\t\t\t\taddError(\"There must be a maximum of \" + schema.maxItems + \" in the array\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(schema.properties || schema.additionalProperties){\r\n\t\t\t\t\terrors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){\r\n\t\t\t\t\taddError(\"does not match the regex pattern \" + schema.pattern);\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){\r\n\t\t\t\t\taddError(\"may only be \" + schema.maxLength + \" characters long\");\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.minLength && typeof value == 'string' && value.length < schema.minLength){\r\n\t\t\t\t\taddError(\"must be at least \" + schema.minLength + \" characters long\");\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&\r\n\t\t\t\t\t\tschema.minimum > value){\r\n\t\t\t\t\taddError(\"must have a minimum value of \" + schema.minimum);\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&\r\n\t\t\t\t\t\tschema.maximum < value){\r\n\t\t\t\t\taddError(\"must have a maximum value of \" + schema.maximum);\r\n\t\t\t\t}\r\n\t\t\t\tif(schema['enum']){\r\n\t\t\t\t\tvar enumer = schema['enum'];\r\n\t\t\t\t\tl = enumer.length;\r\n\t\t\t\t\tvar found;\r\n\t\t\t\t\tfor(var j = 0; j < l; j++){\r\n\t\t\t\t\t\tif(enumer[j]===value){\r\n\t\t\t\t\t\t\tfound=1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!found){\r\n\t\t\t\t\t\taddError(\"does not have a value in the enumeration \" + enumer.join(\", \"));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.maxDecimal == 'number' &&\r\n\t\t\t\t\t(value.toString().match(new RegExp(\"\\\\.[0-9]{\" + (schema.maxDecimal + 1) + \",}\")))){\r\n\t\t\t\t\taddError(\"may only have \" + schema.maxDecimal + \" digits of decimal places\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\t// validate an object against a schema\r\n\tfunction checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}\r\n\tif(schema){\r\n\t\tcheckProp(instance,schema,'',_changing || '');\r\n\t}\r\n\tif(!_changing && instance && instance.$schema){\r\n\t\tcheckProp(instance,instance.$schema,'','');\r\n\t}\r\n\treturn {valid:!errors.length,errors:errors};\r\n};\r\nexports.mustBeValid = function(result){\r\n\t//\tsummary:\r\n\t//\t\tThis checks to ensure that the result is valid and will throw an appropriate error message if it is not\r\n\t// result: the result returned from checkPropertyChange or validate\r\n\tif(!result.valid){\r\n\t\tthrow new TypeError(result.errors.map(function(error){return \"for property \" + error.property + ': ' + error.message;}).join(\", \\n\"));\r\n\t}\r\n}\r\n\r\nreturn exports;\r\n}));\r\n\n\n//# sourceURL=webpack:///./node_modules/json-schema/lib/validate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/json-stringify-safe/stringify.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/json-stringify-safe/stringify.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/json-stringify-safe/stringify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/jsprim/lib/jsprim.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/jsprim/lib/jsprim.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\n * lib/jsprim.js: utilities for primitive JavaScript types\n */\n\nvar mod_assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nvar mod_extsprintf = __webpack_require__(/*! extsprintf */ \"./node_modules/extsprintf/lib/extsprintf.js\");\nvar mod_verror = __webpack_require__(/*! verror */ \"./node_modules/verror/lib/verror.js\");\nvar mod_jsonschema = __webpack_require__(/*! json-schema */ \"./node_modules/json-schema/lib/validate.js\");\n\n/*\n * Public interface\n */\nexports.deepCopy = deepCopy;\nexports.deepEqual = deepEqual;\nexports.isEmpty = isEmpty;\nexports.hasKey = hasKey;\nexports.forEachKey = forEachKey;\nexports.pluck = pluck;\nexports.flattenObject = flattenObject;\nexports.flattenIter = flattenIter;\nexports.validateJsonObject = validateJsonObjectJS;\nexports.validateJsonObjectJS = validateJsonObjectJS;\nexports.randElt = randElt;\nexports.extraProperties = extraProperties;\nexports.mergeObjects = mergeObjects;\n\nexports.startsWith = startsWith;\nexports.endsWith = endsWith;\n\nexports.parseInteger = parseInteger;\n\nexports.iso8601 = iso8601;\nexports.rfc1123 = rfc1123;\nexports.parseDateTime = parseDateTime;\n\nexports.hrtimediff = hrtimeDiff;\nexports.hrtimeDiff = hrtimeDiff;\nexports.hrtimeAccum = hrtimeAccum;\nexports.hrtimeAdd = hrtimeAdd;\nexports.hrtimeNanosec = hrtimeNanosec;\nexports.hrtimeMicrosec = hrtimeMicrosec;\nexports.hrtimeMillisec = hrtimeMillisec;\n\n\n/*\n * Deep copy an acyclic *basic* Javascript object. This only handles basic\n * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects\n * containing these. This does *not* handle instances of other classes.\n */\nfunction deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}\n\nfunction deepEqual(obj1, obj2)\n{\n\tif (typeof (obj1) != typeof (obj2))\n\t\treturn (false);\n\n\tif (obj1 === null || obj2 === null || typeof (obj1) != 'object')\n\t\treturn (obj1 === obj2);\n\n\tif (obj1.constructor != obj2.constructor)\n\t\treturn (false);\n\n\tvar k;\n\tfor (k in obj1) {\n\t\tif (!obj2.hasOwnProperty(k))\n\t\t\treturn (false);\n\n\t\tif (!deepEqual(obj1[k], obj2[k]))\n\t\t\treturn (false);\n\t}\n\n\tfor (k in obj2) {\n\t\tif (!obj1.hasOwnProperty(k))\n\t\t\treturn (false);\n\t}\n\n\treturn (true);\n}\n\nfunction isEmpty(obj)\n{\n\tvar key;\n\tfor (key in obj)\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction hasKey(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (Object.prototype.hasOwnProperty.call(obj, key));\n}\n\nfunction forEachKey(obj, callback)\n{\n\tfor (var key in obj) {\n\t\tif (hasKey(obj, key)) {\n\t\t\tcallback(key, obj[key]);\n\t\t}\n\t}\n}\n\nfunction pluck(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (pluckv(obj, key));\n}\n\nfunction pluckv(obj, key)\n{\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (undefined);\n\n\tif (obj.hasOwnProperty(key))\n\t\treturn (obj[key]);\n\n\tvar i = key.indexOf('.');\n\tif (i == -1)\n\t\treturn (undefined);\n\n\tvar key1 = key.substr(0, i);\n\tif (!obj.hasOwnProperty(key1))\n\t\treturn (undefined);\n\n\treturn (pluckv(obj[key1], key.substr(i + 1)));\n}\n\n/*\n * Invoke callback(row) for each entry in the array that would be returned by\n * flattenObject(data, depth). This is just like flattenObject(data,\n * depth).forEach(callback), except that the intermediate array is never\n * created.\n */\nfunction flattenIter(data, depth, callback)\n{\n\tdoFlattenIter(data, depth, [], callback);\n}\n\nfunction doFlattenIter(data, depth, accum, callback)\n{\n\tvar each;\n\tvar key;\n\n\tif (depth === 0) {\n\t\teach = accum.slice(0);\n\t\teach.push(data);\n\t\tcallback(each);\n\t\treturn;\n\t}\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tfor (key in data) {\n\t\teach = accum.slice(0);\n\t\teach.push(key);\n\t\tdoFlattenIter(data[key], depth - 1, each, callback);\n\t}\n}\n\nfunction flattenObject(data, depth)\n{\n\tif (depth === 0)\n\t\treturn ([ data ]);\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tvar rv = [];\n\tvar key;\n\n\tfor (key in data) {\n\t\tflattenObject(data[key], depth - 1).forEach(function (p) {\n\t\t\trv.push([ key ].concat(p));\n\t\t});\n\t}\n\n\treturn (rv);\n}\n\nfunction startsWith(str, prefix)\n{\n\treturn (str.substr(0, prefix.length) == prefix);\n}\n\nfunction endsWith(str, suffix)\n{\n\treturn (str.substr(\n\t str.length - suffix.length, suffix.length) == suffix);\n}\n\nfunction iso8601(d)\n{\n\tif (typeof (d) == 'number')\n\t\td = new Date(d);\n\tmod_assert.ok(d.constructor === Date);\n\treturn (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',\n\t d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),\n\t d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),\n\t d.getUTCMilliseconds()));\n}\n\nvar RFC1123_MONTHS = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar RFC1123_DAYS = [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nfunction rfc1123(date) {\n\treturn (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',\n\t RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),\n\t RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),\n\t date.getUTCHours(), date.getUTCMinutes(),\n\t date.getUTCSeconds()));\n}\n\n/*\n * Parses a date expressed as a string, as either a number of milliseconds since\n * the epoch or any string format that Date accepts, giving preference to the\n * former where these two sets overlap (e.g., small numbers).\n */\nfunction parseDateTime(str)\n{\n\t/*\n\t * This is irritatingly implicit, but significantly more concise than\n\t * alternatives. The \"+str\" will convert a string containing only a\n\t * number directly to a Number, or NaN for other strings. Thus, if the\n\t * conversion succeeds, we use it (this is the milliseconds-since-epoch\n\t * case). Otherwise, we pass the string directly to the Date\n\t * constructor to parse.\n\t */\n\tvar numeric = +str;\n\tif (!isNaN(numeric)) {\n\t\treturn (new Date(numeric));\n\t} else {\n\t\treturn (new Date(str));\n\t}\n}\n\n\n/*\n * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode\n * the ES6 definitions here, while allowing for them to someday be higher.\n */\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n\n\n/*\n * Default options for parseInteger().\n */\nvar PI_DEFAULTS = {\n\tbase: 10,\n\tallowSign: true,\n\tallowPrefix: false,\n\tallowTrailing: false,\n\tallowImprecise: false,\n\ttrimWhitespace: false,\n\tleadingZeroIsOctal: false\n};\n\nvar CP_0 = 0x30;\nvar CP_9 = 0x39;\n\nvar CP_A = 0x41;\nvar CP_B = 0x42;\nvar CP_O = 0x4f;\nvar CP_T = 0x54;\nvar CP_X = 0x58;\nvar CP_Z = 0x5a;\n\nvar CP_a = 0x61;\nvar CP_b = 0x62;\nvar CP_o = 0x6f;\nvar CP_t = 0x74;\nvar CP_x = 0x78;\nvar CP_z = 0x7a;\n\nvar PI_CONV_DEC = 0x30;\nvar PI_CONV_UC = 0x37;\nvar PI_CONV_LC = 0x57;\n\n\n/*\n * A stricter version of parseInt() that provides options for changing what\n * is an acceptable string (for example, disallowing trailing characters).\n */\nfunction parseInteger(str, uopts)\n{\n\tmod_assert.string(str, 'str');\n\tmod_assert.optionalObject(uopts, 'options');\n\n\tvar baseOverride = false;\n\tvar options = PI_DEFAULTS;\n\n\tif (uopts) {\n\t\tbaseOverride = hasKey(uopts, 'base');\n\t\toptions = mergeObjects(options, uopts);\n\t\tmod_assert.number(options.base, 'options.base');\n\t\tmod_assert.ok(options.base >= 2, 'options.base >= 2');\n\t\tmod_assert.ok(options.base <= 36, 'options.base <= 36');\n\t\tmod_assert.bool(options.allowSign, 'options.allowSign');\n\t\tmod_assert.bool(options.allowPrefix, 'options.allowPrefix');\n\t\tmod_assert.bool(options.allowTrailing,\n\t\t 'options.allowTrailing');\n\t\tmod_assert.bool(options.allowImprecise,\n\t\t 'options.allowImprecise');\n\t\tmod_assert.bool(options.trimWhitespace,\n\t\t 'options.trimWhitespace');\n\t\tmod_assert.bool(options.leadingZeroIsOctal,\n\t\t 'options.leadingZeroIsOctal');\n\n\t\tif (options.leadingZeroIsOctal) {\n\t\t\tmod_assert.ok(!baseOverride,\n\t\t\t '\"base\" and \"leadingZeroIsOctal\" are ' +\n\t\t\t 'mutually exclusive');\n\t\t}\n\t}\n\n\tvar c;\n\tvar pbase = -1;\n\tvar base = options.base;\n\tvar start;\n\tvar mult = 1;\n\tvar value = 0;\n\tvar idx = 0;\n\tvar len = str.length;\n\n\t/* Trim any whitespace on the left side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check the number for a leading sign. */\n\tif (options.allowSign) {\n\t\tif (str[idx] === '-') {\n\t\t\tidx += 1;\n\t\t\tmult = -1;\n\t\t} else if (str[idx] === '+') {\n\t\t\tidx += 1;\n\t\t}\n\t}\n\n\t/* Parse the base-indicating prefix if there is one. */\n\tif (str[idx] === '0') {\n\t\tif (options.allowPrefix) {\n\t\t\tpbase = prefixToBase(str.charCodeAt(idx + 1));\n\t\t\tif (pbase !== -1 && (!baseOverride || pbase === base)) {\n\t\t\t\tbase = pbase;\n\t\t\t\tidx += 2;\n\t\t\t}\n\t\t}\n\n\t\tif (pbase === -1 && options.leadingZeroIsOctal) {\n\t\t\tbase = 8;\n\t\t}\n\t}\n\n\t/* Parse the actual digits. */\n\tfor (start = idx; idx < len; ++idx) {\n\t\tc = translateDigit(str.charCodeAt(idx));\n\t\tif (c !== -1 && c < base) {\n\t\t\tvalue *= base;\n\t\t\tvalue += c;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we didn't parse any digits, we have an invalid number. */\n\tif (start === idx) {\n\t\treturn (new Error('invalid number: ' + JSON.stringify(str)));\n\t}\n\n\t/* Trim any whitespace on the right side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check for trailing characters. */\n\tif (idx < len && !options.allowTrailing) {\n\t\treturn (new Error('trailing characters after number: ' +\n\t\t JSON.stringify(str.slice(idx))));\n\t}\n\n\t/* If our value is 0, we return now, to avoid returning -0. */\n\tif (value === 0) {\n\t\treturn (0);\n\t}\n\n\t/* Calculate our final value. */\n\tvar result = value * mult;\n\n\t/*\n\t * If the string represents a value that cannot be precisely represented\n\t * by JavaScript, then we want to check that:\n\t *\n\t * - We never increased the value past MAX_SAFE_INTEGER\n\t * - We don't make the result negative and below MIN_SAFE_INTEGER\n\t *\n\t * Because we only ever increment the value during parsing, there's no\n\t * chance of moving past MAX_SAFE_INTEGER and then dropping below it\n\t * again, losing precision in the process. This means that we only need\n\t * to do our checks here, at the end.\n\t */\n\tif (!options.allowImprecise &&\n\t (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {\n\t\treturn (new Error('number is outside of the supported range: ' +\n\t\t JSON.stringify(str.slice(start, idx))));\n\t}\n\n\treturn (result);\n}\n\n\n/*\n * Interpret a character code as a base-36 digit.\n */\nfunction translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}\n\n\n/*\n * Test if a value matches the ECMAScript definition of trimmable whitespace.\n */\nfunction isSpace(c)\n{\n\treturn (c === 0x20) ||\n\t (c >= 0x0009 && c <= 0x000d) ||\n\t (c === 0x00a0) ||\n\t (c === 0x1680) ||\n\t (c === 0x180e) ||\n\t (c >= 0x2000 && c <= 0x200a) ||\n\t (c === 0x2028) ||\n\t (c === 0x2029) ||\n\t (c === 0x202f) ||\n\t (c === 0x205f) ||\n\t (c === 0x3000) ||\n\t (c === 0xfeff);\n}\n\n\n/*\n * Determine which base a character indicates (e.g., 'x' indicates hex).\n */\nfunction prefixToBase(c)\n{\n\tif (c === CP_b || c === CP_B) {\n\t\t/* 0b/0B (binary) */\n\t\treturn (2);\n\t} else if (c === CP_o || c === CP_O) {\n\t\t/* 0o/0O (octal) */\n\t\treturn (8);\n\t} else if (c === CP_t || c === CP_T) {\n\t\t/* 0t/0T (decimal) */\n\t\treturn (10);\n\t} else if (c === CP_x || c === CP_X) {\n\t\t/* 0x/0X (hexadecimal) */\n\t\treturn (16);\n\t} else {\n\t\t/* Not a meaningful character */\n\t\treturn (-1);\n\t}\n}\n\n\nfunction validateJsonObjectJS(schema, input)\n{\n\tvar report = mod_jsonschema.validate(input, schema);\n\n\tif (report.errors.length === 0)\n\t\treturn (null);\n\n\t/* Currently, we only do anything useful with the first error. */\n\tvar error = report.errors[0];\n\n\t/* The failed property is given by a URI with an irrelevant prefix. */\n\tvar propname = error['property'];\n\tvar reason = error['message'].toLowerCase();\n\tvar i, j;\n\n\t/*\n\t * There's at least one case where the property error message is\n\t * confusing at best. We work around this here.\n\t */\n\tif ((i = reason.indexOf('the property ')) != -1 &&\n\t (j = reason.indexOf(' is not defined in the schema and the ' +\n\t 'schema does not allow additional properties')) != -1) {\n\t\ti += 'the property '.length;\n\t\tif (propname === '')\n\t\t\tpropname = reason.substr(i, j - i);\n\t\telse\n\t\t\tpropname = propname + '.' + reason.substr(i, j - i);\n\n\t\treason = 'unsupported property';\n\t}\n\n\tvar rv = new mod_verror.VError('property \"%s\": %s', propname, reason);\n\trv.jsv_details = error;\n\treturn (rv);\n}\n\nfunction randElt(arr)\n{\n\tmod_assert.ok(Array.isArray(arr) && arr.length > 0,\n\t 'randElt argument must be a non-empty array');\n\n\treturn (arr[Math.floor(Math.random() * arr.length)]);\n}\n\nfunction assertHrtime(a)\n{\n\tmod_assert.ok(a[0] >= 0 && a[1] >= 0,\n\t 'negative numbers not allowed in hrtimes');\n\tmod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');\n}\n\n/*\n * Compute the time elapsed between hrtime readings A and B, where A is later\n * than B. hrtime readings come from Node's process.hrtime(). There is no\n * defined way to represent negative deltas, so it's illegal to diff B from A\n * where the time denoted by B is later than the time denoted by A. If this\n * becomes valuable, we can define a representation and extend the\n * implementation to support it.\n */\nfunction hrtimeDiff(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\tmod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),\n\t 'negative differences not allowed');\n\n\tvar rv = [ a[0] - b[0], 0 ];\n\n\tif (a[1] >= b[1]) {\n\t\trv[1] = a[1] - b[1];\n\t} else {\n\t\trv[0]--;\n\t\trv[1] = 1e9 - (b[1] - a[1]);\n\t}\n\n\treturn (rv);\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of nanoseconds.\n */\nfunction hrtimeNanosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e9 + a[1]));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of microseconds.\n */\nfunction hrtimeMicrosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e6 + a[1] / 1e3));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of milliseconds.\n */\nfunction hrtimeMillisec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e3 + a[1] / 1e6));\n}\n\n/*\n * Add two hrtime readings A and B, overwriting A with the result of the\n * addition. This function is useful for accumulating several hrtime intervals\n * into a counter. Returns A.\n */\nfunction hrtimeAccum(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\n\t/*\n\t * Accumulate the nanosecond component.\n\t */\n\ta[1] += b[1];\n\tif (a[1] >= 1e9) {\n\t\t/*\n\t\t * The nanosecond component overflowed, so carry to the seconds\n\t\t * field.\n\t\t */\n\t\ta[0]++;\n\t\ta[1] -= 1e9;\n\t}\n\n\t/*\n\t * Accumulate the seconds component.\n\t */\n\ta[0] += b[0];\n\n\treturn (a);\n}\n\n/*\n * Add two hrtime readings A and B, returning the result as a new hrtime array.\n * Does not modify either input argument.\n */\nfunction hrtimeAdd(a, b)\n{\n\tassertHrtime(a);\n\n\tvar rv = [ a[0], a[1] ];\n\n\treturn (hrtimeAccum(rv, b));\n}\n\n\n/*\n * Check an object for unexpected properties. Accepts the object to check, and\n * an array of allowed property names (strings). Returns an array of key names\n * that were found on the object, but did not appear in the list of allowed\n * properties. If no properties were found, the returned array will be of\n * zero length.\n */\nfunction extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}\n\n/*\n * Given three sets of properties \"provided\" (may be undefined), \"overrides\"\n * (required), and \"defaults\" (may be undefined), construct an object containing\n * the union of these sets with \"overrides\" overriding \"provided\", and\n * \"provided\" overriding \"defaults\". None of the input objects are modified.\n */\nfunction mergeObjects(provided, overrides, defaults)\n{\n\tvar rv, k;\n\n\trv = {};\n\tif (defaults) {\n\t\tfor (k in defaults)\n\t\t\trv[k] = defaults[k];\n\t}\n\n\tif (provided) {\n\t\tfor (k in provided)\n\t\t\trv[k] = provided[k];\n\t}\n\n\tif (overrides) {\n\t\tfor (k in overrides)\n\t\t\trv[k] = overrides[k];\n\t}\n\n\treturn (rv);\n}\n\n\n//# sourceURL=webpack:///./node_modules/jsprim/lib/jsprim.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/junk/index.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/junk/index.js ***!
|
||
\************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst blacklist = [\n\t// # All\n\t'^npm-debug\\\\.log$', // Error log for npm\n\t'^\\\\..*\\\\.swp$', // Swap file for vim state\n\n\t// # macOS\n\t'^\\\\.DS_Store$', // Stores custom folder attributes\n\t'^\\\\.AppleDouble$', // Stores additional file resources\n\t'^\\\\.LSOverride$', // Contains the absolute path to the app to be used\n\t'^Icon\\\\r$', // Custom Finder icon: http://superuser.com/questions/298785/icon-file-on-os-x-desktop\n\t'^\\\\._.*', // Thumbnail\n\t'^\\\\.Spotlight-V100(?:$|\\\\/)', // Directory that might appear on external disk\n\t'\\\\.Trashes', // File that might appear on external disk\n\t'^__MACOSX$', // Resource fork\n\n\t// # Linux\n\t'~$', // Backup file\n\n\t// # Windows\n\t'^Thumbs\\\\.db$', // Image file cache\n\t'^ehthumbs\\\\.db$', // Folder config file\n\t'^Desktop\\\\.ini$', // Stores custom folder attributes\n\t'@eaDir$' // Synology Diskstation \"hidden\" folder where the server stores thumbnails\n];\n\nexports.re = () => {\n\tthrow new Error('`junk.re` was renamed to `junk.regex`');\n};\n\nexports.regex = new RegExp(blacklist.join('|'));\n\nexports.is = filename => exports.regex.test(filename);\n\nexports.not = filename => !exports.is(filename);\n\n// TODO: Remove this for the next major release\nexports.default = module.exports;\n\n\n//# sourceURL=webpack:///./node_modules/junk/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/just-kebab-case/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/just-kebab-case/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = kebabCase;\n\n/*\n kebabCase('the quick brown fox'); // 'the-quick-brown-fox'\n kebabCase('the-quick-brown-fox'); // 'the-quick-brown-fox'\n kebabCase('the_quick_brown_fox'); // 'the-quick-brown-fox'\n kebabCase('theQuickBrownFox'); // 'the-quick-brown-fox'\n kebabCase('theQuickBrown Fox'); // 'the-quick-brown-fox'\n kebabCase('thequickbrownfox'); // 'thequickbrownfox'\n kebabCase('the - quick * brown# fox'); // 'the-quick-brown-fox'\n kebabCase('theQUICKBrownFox'); // 'the-q-u-i-c-k-brown-fox'\n*/\n\n// any combination of spaces and punctuation characters\n// thanks to http://stackoverflow.com/a/25575009\nvar wordSeparators = /[\\s\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,\\-.\\/:;<=>?@\\[\\]^_`{|}~]+/;\nvar capitals = /[A-Z\\u00C0-\\u00D6\\u00D9-\\u00DD]/g;\n\nfunction kebabCase(str) {\n //replace capitals with space + lower case equivalent for later parsing\n str = str.replace(capitals, function(match) {\n return ' ' + (match.toLowerCase() || match);\n });\n return str\n .trim()\n .split(wordSeparators)\n .join('-');\n}\n\n\n//# sourceURL=webpack:///./node_modules/just-kebab-case/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/just-map-keys/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/just-map-keys/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = map;\n\n/*\nmap({a: 'cow', b: 'sheep', c: pig'}, (value) => value);\n // {cow: 'cow', sheep: 'sheep', pig: pig'}\nmap([4, 5, 6], (value, key) => key + 1); // {1: 4, 2: 5, 3: 6}\nmap({a: 3, b: 5, c: 9}, (value, key) => key + value); // {a3: 3, b5: 5, c9: 9}\nmap({a: 3, b: 5, c: 9}, (value, key, object) => key + object.b);\n // {a5: 3, b5: 5, c5: 9}\n*/\n\nfunction map(obj, predicate) {\n var result = {};\n var keys = Object.keys(obj);\n var len = keys.length;\n for (var i = 0; i < len; i++) {\n var key = keys[i];\n var value = obj[key];\n var newKey = predicate(value, key, obj);\n result[newKey] = value;\n }\n return result;\n}\n\n\n//# sourceURL=webpack:///./node_modules/just-map-keys/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/kind-of/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/kind-of/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var toString = Object.prototype.toString;\n\nmodule.exports = function kindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n\n var type = typeof val;\n if (type === 'boolean') return 'boolean';\n if (type === 'string') return 'string';\n if (type === 'number') return 'number';\n if (type === 'symbol') return 'symbol';\n if (type === 'function') {\n return isGeneratorFn(val) ? 'generatorfunction' : 'function';\n }\n\n if (isArray(val)) return 'array';\n if (isBuffer(val)) return 'buffer';\n if (isArguments(val)) return 'arguments';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n if (isRegexp(val)) return 'regexp';\n\n switch (ctorName(val)) {\n case 'Symbol': return 'symbol';\n case 'Promise': return 'promise';\n\n // Set, Map, WeakSet, WeakMap\n case 'WeakMap': return 'weakmap';\n case 'WeakSet': return 'weakset';\n case 'Map': return 'map';\n case 'Set': return 'set';\n\n // 8-bit typed arrays\n case 'Int8Array': return 'int8array';\n case 'Uint8Array': return 'uint8array';\n case 'Uint8ClampedArray': return 'uint8clampedarray';\n\n // 16-bit typed arrays\n case 'Int16Array': return 'int16array';\n case 'Uint16Array': return 'uint16array';\n\n // 32-bit typed arrays\n case 'Int32Array': return 'int32array';\n case 'Uint32Array': return 'uint32array';\n case 'Float32Array': return 'float32array';\n case 'Float64Array': return 'float64array';\n }\n\n if (isGeneratorObj(val)) {\n return 'generator';\n }\n\n // Non-plain objects\n type = toString.call(val);\n switch (type) {\n case '[object Object]': return 'object';\n // iterators\n case '[object Map Iterator]': return 'mapiterator';\n case '[object Set Iterator]': return 'setiterator';\n case '[object String Iterator]': return 'stringiterator';\n case '[object Array Iterator]': return 'arrayiterator';\n }\n\n // other\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n};\n\nfunction ctorName(val) {\n return val.constructor ? val.constructor.name : null;\n}\n\nfunction isArray(val) {\n if (Array.isArray) return Array.isArray(val);\n return val instanceof Array;\n}\n\nfunction isError(val) {\n return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function'\n && typeof val.getDate === 'function'\n && typeof val.setDate === 'function';\n}\n\nfunction isRegexp(val) {\n if (val instanceof RegExp) return true;\n return typeof val.flags === 'string'\n && typeof val.ignoreCase === 'boolean'\n && typeof val.multiline === 'boolean'\n && typeof val.global === 'boolean';\n}\n\nfunction isGeneratorFn(name, val) {\n return ctorName(name) === 'GeneratorFunction';\n}\n\nfunction isGeneratorObj(val) {\n return typeof val.throw === 'function'\n && typeof val.return === 'function'\n && typeof val.next === 'function';\n}\n\nfunction isArguments(val) {\n try {\n if (typeof val.length === 'number' && typeof val.callee === 'function') {\n return true;\n }\n } catch (err) {\n if (err.message.indexOf('callee') !== -1) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * If you need to support Safari 5-7 (8-10 yr-old browser),\n * take a look at https://github.com/feross/is-buffer\n */\n\nfunction isBuffer(val) {\n if (val.constructor && typeof val.constructor.isBuffer === 'function') {\n return val.constructor.isBuffer(val);\n }\n return false;\n}\n\n\n//# sourceURL=webpack:///./node_modules/kind-of/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/blake.js":
|
||
/*!*******************************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/blake.js ***!
|
||
\*******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst blake = __webpack_require__(/*! blakejs */ \"./node_modules/blakejs/index.js\")\n\nconst toCallback = __webpack_require__(/*! ./utils */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/utils.js\").toCallback\n\nconst minB = 0xb201\nconst minS = 0xb241\n\nconst blake2b = {\n init: blake.blake2bInit,\n update: blake.blake2bUpdate,\n digest: blake.blake2bFinal\n}\n\nconst blake2s = {\n init: blake.blake2sInit,\n update: blake.blake2sUpdate,\n digest: blake.blake2sFinal\n}\n\nconst makeB2Hash = (size, hf) => toCallback((buf) => {\n const ctx = hf.init(size, null)\n hf.update(ctx, buf)\n return Buffer.from(hf.digest(ctx))\n})\n\nmodule.exports = (table) => {\n for (let i = 0; i < 64; i++) {\n table[minB + i] = makeB2Hash(i + 1, blake2b)\n }\n for (let i = 0; i < 32; i++) {\n table[minS + i] = makeB2Hash(i + 1, blake2s)\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/blake.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto-sha1-2-browser.js":
|
||
/*!***********************************************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto-sha1-2-browser.js ***!
|
||
\***********************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* global self */\n\n\n\nconst nodeify = __webpack_require__(/*! nodeify */ \"./node_modules/nodeify/index.js\")\n\nconst webCrypto = getWebCrypto()\n\nfunction getWebCrypto () {\n if (self.crypto) {\n return self.crypto.subtle || self.crypto.webkitSubtle\n }\n\n if (self.msCrypto) {\n return self.msCrypto.subtle\n }\n}\n\nfunction webCryptoHash (type) {\n if (!webCrypto) {\n throw new Error('Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context')\n }\n\n return (data, callback) => {\n const res = webCrypto.digest({ name: type }, data)\n\n if (typeof res.then !== 'function') { // IE11\n res.onerror = () => {\n callback(new Error(`hashing data using ${type}`))\n }\n res.oncomplete = (e) => {\n callback(null, e.target.result)\n }\n return\n }\n\n nodeify(\n res.then((raw) => Buffer.from(new Uint8Array(raw))),\n callback\n )\n }\n}\n\nfunction sha1 (buf, callback) {\n webCryptoHash('SHA-1')(buf, callback)\n}\n\nfunction sha2256 (buf, callback) {\n webCryptoHash('SHA-256')(buf, callback)\n}\n\nfunction sha2512 (buf, callback) {\n webCryptoHash('SHA-512')(buf, callback)\n}\n\nmodule.exports = {\n sha1: sha1,\n sha2256: sha2256,\n sha2512: sha2512\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto-sha1-2-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto.js":
|
||
/*!********************************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto.js ***!
|
||
\********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst sha3 = __webpack_require__(/*! js-sha3 */ \"./node_modules/js-sha3/src/sha3.js\")\nconst murmur3 = __webpack_require__(/*! murmurhash3js */ \"./node_modules/murmurhash3js/index.js\")\n\nconst utils = __webpack_require__(/*! ./utils */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/utils.js\")\nconst sha = __webpack_require__(/*! ./crypto-sha1-2 */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto-sha1-2-browser.js\")\n\nconst toCallback = utils.toCallback\nconst toBuf = utils.toBuf\nconst fromString = utils.fromString\nconst fromNumberTo32BitBuf = utils.fromNumberTo32BitBuf\n\nconst dblSha2256 = (buf, cb) => {\n sha.sha2256(buf, (err, firstHash) => {\n if (err) {\n cb(err)\n }\n sha.sha2256((Buffer.from(firstHash)), cb)\n })\n}\n\nmodule.exports = {\n sha1: sha.sha1,\n sha2256: sha.sha2256,\n sha2512: sha.sha2512,\n sha3512: toCallback(toBuf(sha3.sha3_512)),\n sha3384: toCallback(toBuf(sha3.sha3_384)),\n sha3256: toCallback(toBuf(sha3.sha3_256)),\n sha3224: toCallback(toBuf(sha3.sha3_224)),\n shake128: toCallback(toBuf(sha3.shake_128, 128)),\n shake256: toCallback(toBuf(sha3.shake_256, 256)),\n keccak224: toCallback(toBuf(sha3.keccak_224)),\n keccak256: toCallback(toBuf(sha3.keccak_256)),\n keccak384: toCallback(toBuf(sha3.keccak_384)),\n keccak512: toCallback(toBuf(sha3.keccak_512)),\n murmur3128: toCallback(toBuf(fromString(murmur3.x64.hash128))),\n murmur332: toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),\n addBlake: __webpack_require__(/*! ./blake */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/blake.js\"),\n dblSha2256: dblSha2256\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/index.js":
|
||
/*!*******************************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/index.js ***!
|
||
\*******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst crypto = __webpack_require__(/*! ./crypto */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/crypto.js\")\n\nmodule.exports = Multihashing\n\n/**\n * Hash the given `buf` using the algorithm specified\n * by `func`.\n *\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} func - The algorithm to use.\n * @param {number} [length] - Optionally trim the result to this length.\n * @param {function(Error, Buffer)} callback\n * @returns {undefined}\n */\nfunction Multihashing (buf, func, length, callback) {\n if (typeof length === 'function') {\n callback = length\n length = undefined\n }\n\n if (!callback) {\n throw new Error('Missing callback')\n }\n\n Multihashing.digest(buf, func, length, (err, digest) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, multihash.encode(digest, func, length))\n })\n}\n\n/**\n * The `buffer` module for easy use in the browser.\n *\n * @type {Buffer}\n */\nMultihashing.Buffer = Buffer // for browser things\n\n/**\n * Expose multihash itself, to avoid silly double requires.\n */\nMultihashing.multihash = multihash\n\n/**\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} func - The algorithm to use.\n * @param {number} [length] - Optionally trim the result to this length.\n * @param {function(Error, Buffer)} callback\n * @returns {undefined}\n */\nMultihashing.digest = function (buf, func, length, callback) {\n if (typeof length === 'function') {\n callback = length\n length = undefined\n }\n\n if (!callback) {\n throw new Error('Missing callback')\n }\n\n let cb = callback\n if (length) {\n cb = (err, digest) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, digest.slice(0, length))\n }\n }\n\n let hash\n try {\n hash = Multihashing.createHash(func)\n } catch (err) {\n return cb(err)\n }\n\n hash(buf, cb)\n}\n\n/**\n * @param {string|number} func\n *\n * @returns {function} - The to `func` corresponding hash function.\n */\nMultihashing.createHash = function (func) {\n func = multihash.coerceCode(func)\n if (!Multihashing.functions[func]) {\n throw new Error('multihash function ' + func + ' not yet supported')\n }\n\n return Multihashing.functions[func]\n}\n\n/**\n * Mapping of multihash codes to their hashing functions.\n * @type {Object}\n */\nMultihashing.functions = {\n // sha1\n 0x11: crypto.sha1,\n // sha2-256\n 0x12: crypto.sha2256,\n // sha2-512\n 0x13: crypto.sha2512,\n // sha3-512\n 0x14: crypto.sha3512,\n // sha3-384\n 0x15: crypto.sha3384,\n // sha3-256\n 0x16: crypto.sha3256,\n // sha3-224\n 0x17: crypto.sha3224,\n // shake-128\n 0x18: crypto.shake128,\n // shake-256\n 0x19: crypto.shake256,\n // keccak-224\n 0x1A: crypto.keccak224,\n // keccak-256\n 0x1B: crypto.keccak256,\n // keccak-384\n 0x1C: crypto.keccak384,\n // keccak-512\n 0x1D: crypto.keccak512,\n // murmur3-128\n 0x22: crypto.murmur3128,\n // murmur3-32\n 0x23: crypto.murmur332,\n // dbl-sha2-256\n 0x56: crypto.dblSha2256\n}\n\n// add blake functions\ncrypto.addBlake(Multihashing.functions)\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/utils.js":
|
||
/*!*******************************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/utils.js ***!
|
||
\*******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {\n\nexports.toCallback = (doWork) => {\n return function (input, callback) {\n let res\n try {\n res = doWork(input)\n } catch (err) {\n process.nextTick(callback, err)\n return\n }\n\n process.nextTick(callback, null, res)\n }\n}\n\nexports.toBuf = (doWork, other) => (input) => {\n let result = doWork(input, other)\n return Buffer.from(result, 'hex')\n}\n\nexports.fromString = (doWork, other) => (_input) => {\n const input = Buffer.isBuffer(_input) ? _input.toString() : _input\n return doWork(input, other)\n}\n\nexports.fromNumberTo32BitBuf = (doWork, other) => (input) => {\n let number = doWork(input, other)\n const bytes = new Array(4)\n\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 0xff\n number = number >> 8\n }\n\n return Buffer.from(bytes)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/src/crypto.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/src/crypto.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst secp256k1 = __webpack_require__(/*! secp256k1 */ \"./node_modules/secp256k1/js.js\")\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/index.js\")\nconst setImmediate = __webpack_require__(/*! async/setImmediate */ \"./node_modules/async/setImmediate.js\")\n\nconst HASH_ALGORITHM = 'sha2-256'\n\nmodule.exports = (randomBytes) => {\n const privateKeyLength = 32\n\n function generateKey (callback) {\n const done = (err, res) => setImmediate(() => callback(err, res))\n\n let privateKey\n do {\n privateKey = randomBytes(32)\n } while (!secp256k1.privateKeyVerify(privateKey))\n\n done(null, privateKey)\n }\n\n function hashAndSign (key, msg, callback) {\n const done = (err, res) => setImmediate(() => callback(err, res))\n\n multihashing.digest(msg, HASH_ALGORITHM, (err, digest) => {\n if (err) { return done(err) }\n\n try {\n const sig = secp256k1.sign(digest, key)\n const sigDER = secp256k1.signatureExport(sig.signature)\n return done(null, sigDER)\n } catch (err) { done(err) }\n })\n }\n\n function hashAndVerify (key, sig, msg, callback) {\n const done = (err, res) => setImmediate(() => callback(err, res))\n\n multihashing.digest(msg, HASH_ALGORITHM, (err, digest) => {\n if (err) { return done(err) }\n try {\n sig = secp256k1.signatureImport(sig)\n const valid = secp256k1.verify(digest, sig, key)\n return done(null, valid)\n } catch (err) { done(err) }\n })\n }\n\n function compressPublicKey (key) {\n if (!secp256k1.publicKeyVerify(key)) {\n throw new Error('Invalid public key')\n }\n return secp256k1.publicKeyConvert(key, true)\n }\n\n function decompressPublicKey (key) {\n return secp256k1.publicKeyConvert(key, false)\n }\n\n function validatePrivateKey (key) {\n if (!secp256k1.privateKeyVerify(key)) {\n throw new Error('Invalid private key')\n }\n }\n\n function validatePublicKey (key) {\n if (!secp256k1.publicKeyVerify(key)) {\n throw new Error('Invalid public key')\n }\n }\n\n function computePublicKey (privateKey) {\n validatePrivateKey(privateKey)\n return secp256k1.publicKeyCreate(privateKey)\n }\n\n return {\n generateKey: generateKey,\n privateKeyLength: privateKeyLength,\n hashAndSign: hashAndSign,\n hashAndVerify: hashAndVerify,\n compressPublicKey: compressPublicKey,\n decompressPublicKey: decompressPublicKey,\n validatePrivateKey: validatePrivateKey,\n validatePublicKey: validatePublicKey,\n computePublicKey: computePublicKey\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/src/crypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto-secp256k1/src/index.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto-secp256k1/src/index.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/libp2p-crypto-secp256k1/node_modules/multihashing-async/src/index.js\")\n\nmodule.exports = (keysProtobuf, randomBytes, crypto) => {\n crypto = crypto || __webpack_require__(/*! ./crypto */ \"./node_modules/libp2p-crypto-secp256k1/src/crypto.js\")(randomBytes)\n\n class Secp256k1PublicKey {\n constructor (key) {\n crypto.validatePublicKey(key)\n this._key = key\n }\n\n verify (data, sig, callback) {\n ensure(callback)\n crypto.hashAndVerify(this._key, sig, data, callback)\n }\n\n marshal () {\n return crypto.compressPublicKey(this._key)\n }\n\n get bytes () {\n return keysProtobuf.PublicKey.encode({\n Type: keysProtobuf.KeyType.Secp256k1,\n Data: this.marshal()\n })\n }\n\n equals (key) {\n return this.bytes.equals(key.bytes)\n }\n\n hash (callback) {\n ensure(callback)\n multihashing(this.bytes, 'sha2-256', callback)\n }\n }\n\n class Secp256k1PrivateKey {\n constructor (key, publicKey) {\n this._key = key\n this._publicKey = publicKey || crypto.computePublicKey(key)\n crypto.validatePrivateKey(this._key)\n crypto.validatePublicKey(this._publicKey)\n }\n\n sign (message, callback) {\n ensure(callback)\n crypto.hashAndSign(this._key, message, callback)\n }\n\n get public () {\n return new Secp256k1PublicKey(this._publicKey)\n }\n\n marshal () {\n return this._key\n }\n\n get bytes () {\n return keysProtobuf.PrivateKey.encode({\n Type: keysProtobuf.KeyType.Secp256k1,\n Data: this.marshal()\n })\n }\n\n equals (key) {\n return this.bytes.equals(key.bytes)\n }\n\n hash (callback) {\n ensure(callback)\n multihashing(this.bytes, 'sha2-256', callback)\n }\n\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n *\n * @param {function(Error, id)} callback\n * @returns {undefined}\n */\n id (callback) {\n this.public.hash((err, hash) => {\n if (err) {\n return callback(err)\n }\n callback(null, bs58.encode(hash))\n })\n }\n }\n\n function unmarshalSecp256k1PrivateKey (bytes, callback) {\n callback(null, new Secp256k1PrivateKey(bytes), null)\n }\n\n function unmarshalSecp256k1PublicKey (bytes) {\n return new Secp256k1PublicKey(bytes)\n }\n\n function generateKeyPair (_bits, callback) {\n if (callback === undefined && typeof _bits === 'function') {\n callback = _bits\n }\n\n ensure(callback)\n\n crypto.generateKey((err, privateKeyBytes) => {\n if (err) { return callback(err) }\n\n let privkey\n try {\n privkey = new Secp256k1PrivateKey(privateKeyBytes)\n } catch (err) { return callback(err) }\n\n callback(null, privkey)\n })\n }\n\n function ensure (callback) {\n if (typeof callback !== 'function') {\n throw new Error('callback is required')\n }\n }\n\n return {\n Secp256k1PublicKey,\n Secp256k1PrivateKey,\n unmarshalSecp256k1PrivateKey,\n unmarshalSecp256k1PublicKey,\n generateKeyPair\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto-secp256k1/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/node_modules/multihashing-async/src/blake.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/node_modules/multihashing-async/src/blake.js ***!
|
||
\*********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst blake = __webpack_require__(/*! blakejs */ \"./node_modules/blakejs/index.js\")\n\nconst toCallback = __webpack_require__(/*! ./utils */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/utils.js\").toCallback\n\nconst minB = 0xb201\nconst minS = 0xb241\n\nconst blake2b = {\n init: blake.blake2bInit,\n update: blake.blake2bUpdate,\n digest: blake.blake2bFinal\n}\n\nconst blake2s = {\n init: blake.blake2sInit,\n update: blake.blake2sUpdate,\n digest: blake.blake2sFinal\n}\n\nconst makeB2Hash = (size, hf) => toCallback((buf) => {\n const ctx = hf.init(size, null)\n hf.update(ctx, buf)\n return Buffer.from(hf.digest(ctx))\n})\n\nmodule.exports = (table) => {\n for (let i = 0; i < 64; i++) {\n table[minB + i] = makeB2Hash(i + 1, blake2b)\n }\n for (let i = 0; i < 32; i++) {\n table[minS + i] = makeB2Hash(i + 1, blake2s)\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/node_modules/multihashing-async/src/blake.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto-sha1-2-browser.js":
|
||
/*!*************************************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto-sha1-2-browser.js ***!
|
||
\*************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* global self */\n\n\n\nconst nodeify = __webpack_require__(/*! nodeify */ \"./node_modules/nodeify/index.js\")\n\nconst webCrypto = getWebCrypto()\n\nfunction getWebCrypto () {\n if (self.crypto) {\n return self.crypto.subtle || self.crypto.webkitSubtle\n }\n\n if (self.msCrypto) {\n return self.msCrypto.subtle\n }\n}\n\nfunction webCryptoHash (type) {\n if (!webCrypto) {\n throw new Error('Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context')\n }\n\n return (data, callback) => {\n const res = webCrypto.digest({ name: type }, data)\n\n if (typeof res.then !== 'function') { // IE11\n res.onerror = () => {\n callback(new Error(`hashing data using ${type}`))\n }\n res.oncomplete = (e) => {\n callback(null, e.target.result)\n }\n return\n }\n\n nodeify(\n res.then((raw) => Buffer.from(new Uint8Array(raw))),\n callback\n )\n }\n}\n\nfunction sha1 (buf, callback) {\n webCryptoHash('SHA-1')(buf, callback)\n}\n\nfunction sha2256 (buf, callback) {\n webCryptoHash('SHA-256')(buf, callback)\n}\n\nfunction sha2512 (buf, callback) {\n webCryptoHash('SHA-512')(buf, callback)\n}\n\nmodule.exports = {\n sha1: sha1,\n sha2256: sha2256,\n sha2512: sha2512\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto-sha1-2-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto.js ***!
|
||
\**********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst sha3 = __webpack_require__(/*! js-sha3 */ \"./node_modules/js-sha3/src/sha3.js\")\nconst murmur3 = __webpack_require__(/*! murmurhash3js */ \"./node_modules/murmurhash3js/index.js\")\n\nconst utils = __webpack_require__(/*! ./utils */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/utils.js\")\nconst sha = __webpack_require__(/*! ./crypto-sha1-2 */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto-sha1-2-browser.js\")\n\nconst toCallback = utils.toCallback\nconst toBuf = utils.toBuf\nconst fromString = utils.fromString\nconst fromNumberTo32BitBuf = utils.fromNumberTo32BitBuf\n\nconst dblSha2256 = (buf, cb) => {\n sha.sha2256(buf, (err, firstHash) => {\n if (err) {\n cb(err)\n }\n sha.sha2256((Buffer.from(firstHash)), cb)\n })\n}\n\nmodule.exports = {\n sha1: sha.sha1,\n sha2256: sha.sha2256,\n sha2512: sha.sha2512,\n sha3512: toCallback(toBuf(sha3.sha3_512)),\n sha3384: toCallback(toBuf(sha3.sha3_384)),\n sha3256: toCallback(toBuf(sha3.sha3_256)),\n sha3224: toCallback(toBuf(sha3.sha3_224)),\n shake128: toCallback(toBuf(sha3.shake_128, 128)),\n shake256: toCallback(toBuf(sha3.shake_256, 256)),\n keccak224: toCallback(toBuf(sha3.keccak_224)),\n keccak256: toCallback(toBuf(sha3.keccak_256)),\n keccak384: toCallback(toBuf(sha3.keccak_384)),\n keccak512: toCallback(toBuf(sha3.keccak_512)),\n murmur3128: toCallback(toBuf(fromString(murmur3.x64.hash128))),\n murmur332: toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),\n addBlake: __webpack_require__(/*! ./blake */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/blake.js\"),\n dblSha2256: dblSha2256\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/node_modules/multihashing-async/src/index.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/node_modules/multihashing-async/src/index.js ***!
|
||
\*********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst crypto = __webpack_require__(/*! ./crypto */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/crypto.js\")\n\nmodule.exports = Multihashing\n\n/**\n * Hash the given `buf` using the algorithm specified\n * by `func`.\n *\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} func - The algorithm to use.\n * @param {number} [length] - Optionally trim the result to this length.\n * @param {function(Error, Buffer)} callback\n * @returns {undefined}\n */\nfunction Multihashing (buf, func, length, callback) {\n if (typeof length === 'function') {\n callback = length\n length = undefined\n }\n\n if (!callback) {\n throw new Error('Missing callback')\n }\n\n Multihashing.digest(buf, func, length, (err, digest) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, multihash.encode(digest, func, length))\n })\n}\n\n/**\n * The `buffer` module for easy use in the browser.\n *\n * @type {Buffer}\n */\nMultihashing.Buffer = Buffer // for browser things\n\n/**\n * Expose multihash itself, to avoid silly double requires.\n */\nMultihashing.multihash = multihash\n\n/**\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} func - The algorithm to use.\n * @param {number} [length] - Optionally trim the result to this length.\n * @param {function(Error, Buffer)} callback\n * @returns {undefined}\n */\nMultihashing.digest = function (buf, func, length, callback) {\n if (typeof length === 'function') {\n callback = length\n length = undefined\n }\n\n if (!callback) {\n throw new Error('Missing callback')\n }\n\n let cb = callback\n if (length) {\n cb = (err, digest) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, digest.slice(0, length))\n }\n }\n\n let hash\n try {\n hash = Multihashing.createHash(func)\n } catch (err) {\n return cb(err)\n }\n\n hash(buf, cb)\n}\n\n/**\n * @param {string|number} func\n *\n * @returns {function} - The to `func` corresponding hash function.\n */\nMultihashing.createHash = function (func) {\n func = multihash.coerceCode(func)\n if (!Multihashing.functions[func]) {\n throw new Error('multihash function ' + func + ' not yet supported')\n }\n\n return Multihashing.functions[func]\n}\n\n/**\n * Mapping of multihash codes to their hashing functions.\n * @type {Object}\n */\nMultihashing.functions = {\n // sha1\n 0x11: crypto.sha1,\n // sha2-256\n 0x12: crypto.sha2256,\n // sha2-512\n 0x13: crypto.sha2512,\n // sha3-512\n 0x14: crypto.sha3512,\n // sha3-384\n 0x15: crypto.sha3384,\n // sha3-256\n 0x16: crypto.sha3256,\n // sha3-224\n 0x17: crypto.sha3224,\n // shake-128\n 0x18: crypto.shake128,\n // shake-256\n 0x19: crypto.shake256,\n // keccak-224\n 0x1A: crypto.keccak224,\n // keccak-256\n 0x1B: crypto.keccak256,\n // keccak-384\n 0x1C: crypto.keccak384,\n // keccak-512\n 0x1D: crypto.keccak512,\n // murmur3-128\n 0x22: crypto.murmur3128,\n // murmur3-32\n 0x23: crypto.murmur332,\n // dbl-sha2-256\n 0x56: crypto.dblSha2256\n}\n\n// add blake functions\ncrypto.addBlake(Multihashing.functions)\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/node_modules/multihashing-async/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/node_modules/multihashing-async/src/utils.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/node_modules/multihashing-async/src/utils.js ***!
|
||
\*********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {\n\nexports.toCallback = (doWork) => {\n return function (input, callback) {\n let res\n try {\n res = doWork(input)\n } catch (err) {\n process.nextTick(callback, err)\n return\n }\n\n process.nextTick(callback, null, res)\n }\n}\n\nexports.toBuf = (doWork, other) => (input) => {\n let result = doWork(input, other)\n return Buffer.from(result, 'hex')\n}\n\nexports.fromString = (doWork, other) => (_input) => {\n const input = Buffer.isBuffer(_input) ? _input.toString() : _input\n return doWork(input, other)\n}\n\nexports.fromNumberTo32BitBuf = (doWork, other) => (input) => {\n let number = doWork(input, other)\n const bytes = new Array(4)\n\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 0xff\n number = number >> 8\n }\n\n return Buffer.from(bytes)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/node_modules/multihashing-async/src/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/node_modules/tweetnacl/nacl-fast.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/node_modules/tweetnacl/nacl-fast.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n var i, r = new Float64Array(16);\n if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n return r;\n};\n\n// Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n gf1 = gf([1]),\n _121665 = gf([0xdb41, 1]),\n D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n x[i] = (h >> 24) & 0xff;\n x[i+1] = (h >> 16) & 0xff;\n x[i+2] = (h >> 8) & 0xff;\n x[i+3] = h & 0xff;\n x[i+4] = (l >> 24) & 0xff;\n x[i+5] = (l >> 16) & 0xff;\n x[i+6] = (l >> 8) & 0xff;\n x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n var i,d = 0;\n for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n x0 = x0 + j0 | 0;\n x1 = x1 + j1 | 0;\n x2 = x2 + j2 | 0;\n x3 = x3 + j3 | 0;\n x4 = x4 + j4 | 0;\n x5 = x5 + j5 | 0;\n x6 = x6 + j6 | 0;\n x7 = x7 + j7 | 0;\n x8 = x8 + j8 | 0;\n x9 = x9 + j9 | 0;\n x10 = x10 + j10 | 0;\n x11 = x11 + j11 | 0;\n x12 = x12 + j12 | 0;\n x13 = x13 + j13 | 0;\n x14 = x14 + j14 | 0;\n x15 = x15 + j15 | 0;\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x1 >>> 0 & 0xff;\n o[ 5] = x1 >>> 8 & 0xff;\n o[ 6] = x1 >>> 16 & 0xff;\n o[ 7] = x1 >>> 24 & 0xff;\n\n o[ 8] = x2 >>> 0 & 0xff;\n o[ 9] = x2 >>> 8 & 0xff;\n o[10] = x2 >>> 16 & 0xff;\n o[11] = x2 >>> 24 & 0xff;\n\n o[12] = x3 >>> 0 & 0xff;\n o[13] = x3 >>> 8 & 0xff;\n o[14] = x3 >>> 16 & 0xff;\n o[15] = x3 >>> 24 & 0xff;\n\n o[16] = x4 >>> 0 & 0xff;\n o[17] = x4 >>> 8 & 0xff;\n o[18] = x4 >>> 16 & 0xff;\n o[19] = x4 >>> 24 & 0xff;\n\n o[20] = x5 >>> 0 & 0xff;\n o[21] = x5 >>> 8 & 0xff;\n o[22] = x5 >>> 16 & 0xff;\n o[23] = x5 >>> 24 & 0xff;\n\n o[24] = x6 >>> 0 & 0xff;\n o[25] = x6 >>> 8 & 0xff;\n o[26] = x6 >>> 16 & 0xff;\n o[27] = x6 >>> 24 & 0xff;\n\n o[28] = x7 >>> 0 & 0xff;\n o[29] = x7 >>> 8 & 0xff;\n o[30] = x7 >>> 16 & 0xff;\n o[31] = x7 >>> 24 & 0xff;\n\n o[32] = x8 >>> 0 & 0xff;\n o[33] = x8 >>> 8 & 0xff;\n o[34] = x8 >>> 16 & 0xff;\n o[35] = x8 >>> 24 & 0xff;\n\n o[36] = x9 >>> 0 & 0xff;\n o[37] = x9 >>> 8 & 0xff;\n o[38] = x9 >>> 16 & 0xff;\n o[39] = x9 >>> 24 & 0xff;\n\n o[40] = x10 >>> 0 & 0xff;\n o[41] = x10 >>> 8 & 0xff;\n o[42] = x10 >>> 16 & 0xff;\n o[43] = x10 >>> 24 & 0xff;\n\n o[44] = x11 >>> 0 & 0xff;\n o[45] = x11 >>> 8 & 0xff;\n o[46] = x11 >>> 16 & 0xff;\n o[47] = x11 >>> 24 & 0xff;\n\n o[48] = x12 >>> 0 & 0xff;\n o[49] = x12 >>> 8 & 0xff;\n o[50] = x12 >>> 16 & 0xff;\n o[51] = x12 >>> 24 & 0xff;\n\n o[52] = x13 >>> 0 & 0xff;\n o[53] = x13 >>> 8 & 0xff;\n o[54] = x13 >>> 16 & 0xff;\n o[55] = x13 >>> 24 & 0xff;\n\n o[56] = x14 >>> 0 & 0xff;\n o[57] = x14 >>> 8 & 0xff;\n o[58] = x14 >>> 16 & 0xff;\n o[59] = x14 >>> 24 & 0xff;\n\n o[60] = x15 >>> 0 & 0xff;\n o[61] = x15 >>> 8 & 0xff;\n o[62] = x15 >>> 16 & 0xff;\n o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x5 >>> 0 & 0xff;\n o[ 5] = x5 >>> 8 & 0xff;\n o[ 6] = x5 >>> 16 & 0xff;\n o[ 7] = x5 >>> 24 & 0xff;\n\n o[ 8] = x10 >>> 0 & 0xff;\n o[ 9] = x10 >>> 8 & 0xff;\n o[10] = x10 >>> 16 & 0xff;\n o[11] = x10 >>> 24 & 0xff;\n\n o[12] = x15 >>> 0 & 0xff;\n o[13] = x15 >>> 8 & 0xff;\n o[14] = x15 >>> 16 & 0xff;\n o[15] = x15 >>> 24 & 0xff;\n\n o[16] = x6 >>> 0 & 0xff;\n o[17] = x6 >>> 8 & 0xff;\n o[18] = x6 >>> 16 & 0xff;\n o[19] = x6 >>> 24 & 0xff;\n\n o[20] = x7 >>> 0 & 0xff;\n o[21] = x7 >>> 8 & 0xff;\n o[22] = x7 >>> 16 & 0xff;\n o[23] = x7 >>> 24 & 0xff;\n\n o[24] = x8 >>> 0 & 0xff;\n o[25] = x8 >>> 8 & 0xff;\n o[26] = x8 >>> 16 & 0xff;\n o[27] = x8 >>> 24 & 0xff;\n\n o[28] = x9 >>> 0 & 0xff;\n o[29] = x9 >>> 8 & 0xff;\n o[30] = x9 >>> 16 & 0xff;\n o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n mpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n }\n return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = x[i];\n }\n return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n this.buffer = new Uint8Array(16);\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.leftover = 0;\n this.fin = 0;\n\n var t0, t1, t2, t3, t4, t5, t6, t7;\n\n t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;\n t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\n t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\n this.r[5] = ((t4 >>> 1)) & 0x1ffe;\n t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\n t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n this.r[9] = ((t7 >>> 5)) & 0x007f;\n\n this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n var hibit = this.fin ? 0 : (1 << 11);\n var t0, t1, t2, t3, t4, t5, t6, t7, c;\n var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n var h0 = this.h[0],\n h1 = this.h[1],\n h2 = this.h[2],\n h3 = this.h[3],\n h4 = this.h[4],\n h5 = this.h[5],\n h6 = this.h[6],\n h7 = this.h[7],\n h8 = this.h[8],\n h9 = this.h[9];\n\n var r0 = this.r[0],\n r1 = this.r[1],\n r2 = this.r[2],\n r3 = this.r[3],\n r4 = this.r[4],\n r5 = this.r[5],\n r6 = this.r[6],\n r7 = this.r[7],\n r8 = this.r[8],\n r9 = this.r[9];\n\n while (bytes >= 16) {\n t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;\n t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;\n t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;\n h5 += ((t4 >>> 1)) & 0x1fff;\n t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;\n t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n h9 += ((t7 >>> 5)) | hibit;\n\n c = 0;\n\n d0 = c;\n d0 += h0 * r0;\n d0 += h1 * (5 * r9);\n d0 += h2 * (5 * r8);\n d0 += h3 * (5 * r7);\n d0 += h4 * (5 * r6);\n c = (d0 >>> 13); d0 &= 0x1fff;\n d0 += h5 * (5 * r5);\n d0 += h6 * (5 * r4);\n d0 += h7 * (5 * r3);\n d0 += h8 * (5 * r2);\n d0 += h9 * (5 * r1);\n c += (d0 >>> 13); d0 &= 0x1fff;\n\n d1 = c;\n d1 += h0 * r1;\n d1 += h1 * r0;\n d1 += h2 * (5 * r9);\n d1 += h3 * (5 * r8);\n d1 += h4 * (5 * r7);\n c = (d1 >>> 13); d1 &= 0x1fff;\n d1 += h5 * (5 * r6);\n d1 += h6 * (5 * r5);\n d1 += h7 * (5 * r4);\n d1 += h8 * (5 * r3);\n d1 += h9 * (5 * r2);\n c += (d1 >>> 13); d1 &= 0x1fff;\n\n d2 = c;\n d2 += h0 * r2;\n d2 += h1 * r1;\n d2 += h2 * r0;\n d2 += h3 * (5 * r9);\n d2 += h4 * (5 * r8);\n c = (d2 >>> 13); d2 &= 0x1fff;\n d2 += h5 * (5 * r7);\n d2 += h6 * (5 * r6);\n d2 += h7 * (5 * r5);\n d2 += h8 * (5 * r4);\n d2 += h9 * (5 * r3);\n c += (d2 >>> 13); d2 &= 0x1fff;\n\n d3 = c;\n d3 += h0 * r3;\n d3 += h1 * r2;\n d3 += h2 * r1;\n d3 += h3 * r0;\n d3 += h4 * (5 * r9);\n c = (d3 >>> 13); d3 &= 0x1fff;\n d3 += h5 * (5 * r8);\n d3 += h6 * (5 * r7);\n d3 += h7 * (5 * r6);\n d3 += h8 * (5 * r5);\n d3 += h9 * (5 * r4);\n c += (d3 >>> 13); d3 &= 0x1fff;\n\n d4 = c;\n d4 += h0 * r4;\n d4 += h1 * r3;\n d4 += h2 * r2;\n d4 += h3 * r1;\n d4 += h4 * r0;\n c = (d4 >>> 13); d4 &= 0x1fff;\n d4 += h5 * (5 * r9);\n d4 += h6 * (5 * r8);\n d4 += h7 * (5 * r7);\n d4 += h8 * (5 * r6);\n d4 += h9 * (5 * r5);\n c += (d4 >>> 13); d4 &= 0x1fff;\n\n d5 = c;\n d5 += h0 * r5;\n d5 += h1 * r4;\n d5 += h2 * r3;\n d5 += h3 * r2;\n d5 += h4 * r1;\n c = (d5 >>> 13); d5 &= 0x1fff;\n d5 += h5 * r0;\n d5 += h6 * (5 * r9);\n d5 += h7 * (5 * r8);\n d5 += h8 * (5 * r7);\n d5 += h9 * (5 * r6);\n c += (d5 >>> 13); d5 &= 0x1fff;\n\n d6 = c;\n d6 += h0 * r6;\n d6 += h1 * r5;\n d6 += h2 * r4;\n d6 += h3 * r3;\n d6 += h4 * r2;\n c = (d6 >>> 13); d6 &= 0x1fff;\n d6 += h5 * r1;\n d6 += h6 * r0;\n d6 += h7 * (5 * r9);\n d6 += h8 * (5 * r8);\n d6 += h9 * (5 * r7);\n c += (d6 >>> 13); d6 &= 0x1fff;\n\n d7 = c;\n d7 += h0 * r7;\n d7 += h1 * r6;\n d7 += h2 * r5;\n d7 += h3 * r4;\n d7 += h4 * r3;\n c = (d7 >>> 13); d7 &= 0x1fff;\n d7 += h5 * r2;\n d7 += h6 * r1;\n d7 += h7 * r0;\n d7 += h8 * (5 * r9);\n d7 += h9 * (5 * r8);\n c += (d7 >>> 13); d7 &= 0x1fff;\n\n d8 = c;\n d8 += h0 * r8;\n d8 += h1 * r7;\n d8 += h2 * r6;\n d8 += h3 * r5;\n d8 += h4 * r4;\n c = (d8 >>> 13); d8 &= 0x1fff;\n d8 += h5 * r3;\n d8 += h6 * r2;\n d8 += h7 * r1;\n d8 += h8 * r0;\n d8 += h9 * (5 * r9);\n c += (d8 >>> 13); d8 &= 0x1fff;\n\n d9 = c;\n d9 += h0 * r9;\n d9 += h1 * r8;\n d9 += h2 * r7;\n d9 += h3 * r6;\n d9 += h4 * r5;\n c = (d9 >>> 13); d9 &= 0x1fff;\n d9 += h5 * r4;\n d9 += h6 * r3;\n d9 += h7 * r2;\n d9 += h8 * r1;\n d9 += h9 * r0;\n c += (d9 >>> 13); d9 &= 0x1fff;\n\n c = (((c << 2) + c)) | 0;\n c = (c + d0) | 0;\n d0 = c & 0x1fff;\n c = (c >>> 13);\n d1 += c;\n\n h0 = d0;\n h1 = d1;\n h2 = d2;\n h3 = d3;\n h4 = d4;\n h5 = d5;\n h6 = d6;\n h7 = d7;\n h8 = d8;\n h9 = d9;\n\n mpos += 16;\n bytes -= 16;\n }\n this.h[0] = h0;\n this.h[1] = h1;\n this.h[2] = h2;\n this.h[3] = h3;\n this.h[4] = h4;\n this.h[5] = h5;\n this.h[6] = h6;\n this.h[7] = h7;\n this.h[8] = h8;\n this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n var g = new Uint16Array(10);\n var c, mask, f, i;\n\n if (this.leftover) {\n i = this.leftover;\n this.buffer[i++] = 1;\n for (; i < 16; i++) this.buffer[i] = 0;\n this.fin = 1;\n this.blocks(this.buffer, 0, 16);\n }\n\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n for (i = 2; i < 10; i++) {\n this.h[i] += c;\n c = this.h[i] >>> 13;\n this.h[i] &= 0x1fff;\n }\n this.h[0] += (c * 5);\n c = this.h[0] >>> 13;\n this.h[0] &= 0x1fff;\n this.h[1] += c;\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n this.h[2] += c;\n\n g[0] = this.h[0] + 5;\n c = g[0] >>> 13;\n g[0] &= 0x1fff;\n for (i = 1; i < 10; i++) {\n g[i] = this.h[i] + c;\n c = g[i] >>> 13;\n g[i] &= 0x1fff;\n }\n g[9] -= (1 << 13);\n\n mask = (c ^ 1) - 1;\n for (i = 0; i < 10; i++) g[i] &= mask;\n mask = ~mask;\n for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;\n this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;\n this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;\n this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;\n this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;\n this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;\n this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;\n this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;\n\n f = this.h[0] + this.pad[0];\n this.h[0] = f & 0xffff;\n for (i = 1; i < 8; i++) {\n f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n this.h[i] = f & 0xffff;\n }\n\n mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n var i, want;\n\n if (this.leftover) {\n want = (16 - this.leftover);\n if (want > bytes)\n want = bytes;\n for (i = 0; i < want; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n bytes -= want;\n mpos += want;\n this.leftover += want;\n if (this.leftover < 16)\n return;\n this.blocks(this.buffer, 0, 16);\n this.leftover = 0;\n }\n\n if (bytes >= 16) {\n want = bytes - (bytes % 16);\n this.blocks(m, mpos, want);\n mpos += want;\n bytes -= want;\n }\n\n if (bytes) {\n for (i = 0; i < bytes; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n this.leftover += bytes;\n }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n var s = new poly1305(k);\n s.update(m, mpos, n);\n s.finish(out, outpos);\n return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n var x = new Uint8Array(16);\n crypto_onetimeauth(x,0,m,mpos,n,k);\n return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n var i;\n if (d < 32) return -1;\n crypto_stream_xor(c,0,m,0,d,n,k);\n crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n for (i = 0; i < 16; i++) c[i] = 0;\n return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n var i;\n var x = new Uint8Array(32);\n if (d < 32) return -1;\n crypto_stream(x,0,32,n,k);\n if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n crypto_stream_xor(m,0,c,0,d,n,k);\n for (i = 0; i < 32; i++) m[i] = 0;\n return 0;\n}\n\nfunction set25519(r, a) {\n var i;\n for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n var i, v, c = 1;\n for (i = 0; i < 16; i++) {\n v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n var t, c = ~(b-1);\n for (var i = 0; i < 16; i++) {\n t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\n\nfunction pack25519(o, n) {\n var i, j, b;\n var m = gf(), t = gf();\n for (i = 0; i < 16; i++) t[i] = n[i];\n car25519(t);\n car25519(t);\n car25519(t);\n for (j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n m[i-1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n b = (m[15]>>16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1-b);\n }\n for (i = 0; i < 16; i++) {\n o[2*i] = t[i] & 0xff;\n o[2*i+1] = t[i]>>8;\n }\n}\n\nfunction neq25519(a, b) {\n var c = new Uint8Array(32), d = new Uint8Array(32);\n pack25519(c, a);\n pack25519(d, b);\n return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n var d = new Uint8Array(32);\n pack25519(d, a);\n return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n var i;\n for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n var v, c,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11],\n b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n\n // first car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n // second car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n o[ 0] = t0;\n o[ 1] = t1;\n o[ 2] = t2;\n o[ 3] = t3;\n o[ 4] = t4;\n o[ 5] = t5;\n o[ 6] = t6;\n o[ 7] = t7;\n o[ 8] = t8;\n o[ 9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\n\nfunction S(o, a) {\n M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 253; a >= 0; a--) {\n S(c, c);\n if(a !== 2 && a !== 4) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 250; a >= 0; a--) {\n S(c, c);\n if(a !== 1) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n var z = new Uint8Array(32);\n var x = new Float64Array(80), r, i;\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf();\n for (i = 0; i < 31; i++) z[i] = n[i];\n z[31]=(n[31]&127)|64;\n z[0]&=248;\n unpack25519(x,p);\n for (i = 0; i < 16; i++) {\n b[i]=x[i];\n d[i]=a[i]=c[i]=0;\n }\n a[0]=d[0]=1;\n for (i=254; i>=0; --i) {\n r=(z[i>>>3]>>>(i&7))&1;\n sel25519(a,b,r);\n sel25519(c,d,r);\n A(e,a,c);\n Z(a,a,c);\n A(c,b,d);\n Z(b,b,d);\n S(d,e);\n S(f,a);\n M(a,c,a);\n M(c,b,e);\n A(e,a,c);\n Z(a,a,c);\n S(b,a);\n Z(c,d,f);\n M(a,c,_121665);\n A(a,a,d);\n M(c,c,a);\n M(a,d,f);\n M(d,b,x);\n S(b,e);\n sel25519(a,b,r);\n sel25519(c,d,r);\n }\n for (i = 0; i < 16; i++) {\n x[i+16]=a[i];\n x[i+32]=c[i];\n x[i+48]=b[i];\n x[i+64]=d[i];\n }\n var x32 = x.subarray(32);\n var x16 = x.subarray(16);\n inv25519(x32,x32);\n M(x16,x16,x32);\n pack25519(q,x16);\n return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n randombytes(x, 32);\n return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n var s = new Uint8Array(32);\n crypto_scalarmult(s, x, y);\n return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n var wh = new Int32Array(16), wl = new Int32Array(16),\n bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n th, tl, i, j, h, l, a, b, c, d;\n\n var ah0 = hh[0],\n ah1 = hh[1],\n ah2 = hh[2],\n ah3 = hh[3],\n ah4 = hh[4],\n ah5 = hh[5],\n ah6 = hh[6],\n ah7 = hh[7],\n\n al0 = hl[0],\n al1 = hl[1],\n al2 = hl[2],\n al3 = hl[3],\n al4 = hl[4],\n al5 = hl[5],\n al6 = hl[6],\n al7 = hl[7];\n\n var pos = 0;\n while (n >= 128) {\n for (i = 0; i < 16; i++) {\n j = 8 * i + pos;\n wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n }\n for (i = 0; i < 80; i++) {\n bh0 = ah0;\n bh1 = ah1;\n bh2 = ah2;\n bh3 = ah3;\n bh4 = ah4;\n bh5 = ah5;\n bh6 = ah6;\n bh7 = ah7;\n\n bl0 = al0;\n bl1 = al1;\n bl2 = al2;\n bl3 = al3;\n bl4 = al4;\n bl5 = al5;\n bl6 = al6;\n bl7 = al7;\n\n // add\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma1\n h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Ch\n h = (ah4 & ah5) ^ (~ah4 & ah6);\n l = (al4 & al5) ^ (~al4 & al6);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // K\n h = K[i*2];\n l = K[i*2+1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // w\n h = wh[i%16];\n l = wl[i%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n th = c & 0xffff | d << 16;\n tl = a & 0xffff | b << 16;\n\n // add\n h = th;\n l = tl;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma0\n h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Maj\n h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh7 = (c & 0xffff) | (d << 16);\n bl7 = (a & 0xffff) | (b << 16);\n\n // add\n h = bh3;\n l = bl3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = th;\n l = tl;\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh3 = (c & 0xffff) | (d << 16);\n bl3 = (a & 0xffff) | (b << 16);\n\n ah1 = bh0;\n ah2 = bh1;\n ah3 = bh2;\n ah4 = bh3;\n ah5 = bh4;\n ah6 = bh5;\n ah7 = bh6;\n ah0 = bh7;\n\n al1 = bl0;\n al2 = bl1;\n al3 = bl2;\n al4 = bl3;\n al5 = bl4;\n al6 = bl5;\n al7 = bl6;\n al0 = bl7;\n\n if (i%16 === 15) {\n for (j = 0; j < 16; j++) {\n // add\n h = wh[j];\n l = wl[j];\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = wh[(j+9)%16];\n l = wl[(j+9)%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma0\n th = wh[(j+1)%16];\n tl = wl[(j+1)%16];\n h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma1\n th = wh[(j+14)%16];\n tl = wl[(j+14)%16];\n h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n wh[j] = (c & 0xffff) | (d << 16);\n wl[j] = (a & 0xffff) | (b << 16);\n }\n }\n }\n\n // add\n h = ah0;\n l = al0;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[0];\n l = hl[0];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[0] = ah0 = (c & 0xffff) | (d << 16);\n hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n h = ah1;\n l = al1;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[1];\n l = hl[1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[1] = ah1 = (c & 0xffff) | (d << 16);\n hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n h = ah2;\n l = al2;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[2];\n l = hl[2];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[2] = ah2 = (c & 0xffff) | (d << 16);\n hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n h = ah3;\n l = al3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[3];\n l = hl[3];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[3] = ah3 = (c & 0xffff) | (d << 16);\n hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n h = ah4;\n l = al4;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[4];\n l = hl[4];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[4] = ah4 = (c & 0xffff) | (d << 16);\n hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n h = ah5;\n l = al5;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[5];\n l = hl[5];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[5] = ah5 = (c & 0xffff) | (d << 16);\n hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n h = ah6;\n l = al6;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[6];\n l = hl[6];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[6] = ah6 = (c & 0xffff) | (d << 16);\n hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[7];\n l = hl[7];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[7] = ah7 = (c & 0xffff) | (d << 16);\n hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n pos += 128;\n n -= 128;\n }\n\n return n;\n}\n\nfunction crypto_hash(out, m, n) {\n var hh = new Int32Array(8),\n hl = new Int32Array(8),\n x = new Uint8Array(256),\n i, b = n;\n\n hh[0] = 0x6a09e667;\n hh[1] = 0xbb67ae85;\n hh[2] = 0x3c6ef372;\n hh[3] = 0xa54ff53a;\n hh[4] = 0x510e527f;\n hh[5] = 0x9b05688c;\n hh[6] = 0x1f83d9ab;\n hh[7] = 0x5be0cd19;\n\n hl[0] = 0xf3bcc908;\n hl[1] = 0x84caa73b;\n hl[2] = 0xfe94f82b;\n hl[3] = 0x5f1d36f1;\n hl[4] = 0xade682d1;\n hl[5] = 0x2b3e6c1f;\n hl[6] = 0xfb41bd6b;\n hl[7] = 0x137e2179;\n\n crypto_hashblocks_hl(hh, hl, m, n);\n n %= 128;\n\n for (i = 0; i < n; i++) x[i] = m[b-n+i];\n x[n] = 128;\n\n n = 256-128*(n<112?1:0);\n x[n-9] = 0;\n ts64(x, n-8, (b / 0x20000000) | 0, b << 3);\n crypto_hashblocks_hl(hh, hl, x, n);\n\n for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n return 0;\n}\n\nfunction add(p, q) {\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf(),\n g = gf(), h = gf(), t = gf();\n\n Z(a, p[1], p[0]);\n Z(t, q[1], q[0]);\n M(a, a, t);\n A(b, p[0], p[1]);\n A(t, q[0], q[1]);\n M(b, b, t);\n M(c, p[3], q[3]);\n M(c, c, D2);\n M(d, p[2], q[2]);\n A(d, d, d);\n Z(e, b, a);\n Z(f, d, c);\n A(g, d, c);\n A(h, b, a);\n\n M(p[0], e, f);\n M(p[1], h, g);\n M(p[2], g, f);\n M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n var i;\n for (i = 0; i < 4; i++) {\n sel25519(p[i], q[i], b);\n }\n}\n\nfunction pack(r, p) {\n var tx = gf(), ty = gf(), zi = gf();\n inv25519(zi, p[2]);\n M(tx, p[0], zi);\n M(ty, p[1], zi);\n pack25519(r, ty);\n r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n var b, i;\n set25519(p[0], gf0);\n set25519(p[1], gf1);\n set25519(p[2], gf1);\n set25519(p[3], gf0);\n for (i = 255; i >= 0; --i) {\n b = (s[(i/8)|0] >> (i&7)) & 1;\n cswap(p, q, b);\n add(q, p);\n add(p, p);\n cswap(p, q, b);\n }\n}\n\nfunction scalarbase(p, s) {\n var q = [gf(), gf(), gf(), gf()];\n set25519(q[0], X);\n set25519(q[1], Y);\n set25519(q[2], gf1);\n M(q[3], X, Y);\n scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n var d = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()];\n var i;\n\n if (!seeded) randombytes(sk, 32);\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n scalarbase(p, d);\n pack(pk, p);\n\n for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n var carry, i, j, k;\n for (i = 63; i >= 32; --i) {\n carry = 0;\n for (j = i - 32, k = i - 12; j < k; ++j) {\n x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n carry = (x[j] + 128) >> 8;\n x[j] -= carry * 256;\n }\n x[j] += carry;\n x[i] = 0;\n }\n carry = 0;\n for (j = 0; j < 32; j++) {\n x[j] += carry - (x[31] >> 4) * L[j];\n carry = x[j] >> 8;\n x[j] &= 255;\n }\n for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n for (i = 0; i < 32; i++) {\n x[i+1] += x[i] >> 8;\n r[i] = x[i] & 255;\n }\n}\n\nfunction reduce(r) {\n var x = new Float64Array(64), i;\n for (i = 0; i < 64; i++) x[i] = r[i];\n for (i = 0; i < 64; i++) r[i] = 0;\n modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n var i, j, x = new Float64Array(64);\n var p = [gf(), gf(), gf(), gf()];\n\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n var smlen = n + 64;\n for (i = 0; i < n; i++) sm[64 + i] = m[i];\n for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n crypto_hash(r, sm.subarray(32), n+32);\n reduce(r);\n scalarbase(p, r);\n pack(sm, p);\n\n for (i = 32; i < 64; i++) sm[i] = sk[i];\n crypto_hash(h, sm, n + 64);\n reduce(h);\n\n for (i = 0; i < 64; i++) x[i] = 0;\n for (i = 0; i < 32; i++) x[i] = r[i];\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 32; j++) {\n x[i+j] += h[i] * d[j];\n }\n }\n\n modL(sm.subarray(32), x);\n return smlen;\n}\n\nfunction unpackneg(r, p) {\n var t = gf(), chk = gf(), num = gf(),\n den = gf(), den2 = gf(), den4 = gf(),\n den6 = gf();\n\n set25519(r[2], gf1);\n unpack25519(r[1], p);\n S(num, r[1]);\n M(den, num, D);\n Z(num, num, r[2]);\n A(den, r[2], den);\n\n S(den2, den);\n S(den4, den2);\n M(den6, den4, den2);\n M(t, den6, num);\n M(t, t, den);\n\n pow2523(t, t);\n M(t, t, num);\n M(t, t, den);\n M(t, t, den);\n M(r[0], t, den);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) M(r[0], r[0], I);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) return -1;\n\n if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n M(r[3], r[0], r[1]);\n return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n var i, mlen;\n var t = new Uint8Array(32), h = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()],\n q = [gf(), gf(), gf(), gf()];\n\n mlen = -1;\n if (n < 64) return -1;\n\n if (unpackneg(q, pk)) return -1;\n\n for (i = 0; i < n; i++) m[i] = sm[i];\n for (i = 0; i < 32; i++) m[i+32] = pk[i];\n crypto_hash(h, m, n);\n reduce(h);\n scalarmult(p, q, h);\n\n scalarbase(q, sm.subarray(32));\n add(p, q);\n pack(t, p);\n\n n -= 64;\n if (crypto_verify_32(sm, 0, t, 0)) {\n for (i = 0; i < n; i++) m[i] = 0;\n return -1;\n }\n\n for (i = 0; i < n; i++) m[i] = sm[i + 64];\n mlen = n;\n return mlen;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n crypto_secretbox_NONCEBYTES = 24,\n crypto_secretbox_ZEROBYTES = 32,\n crypto_secretbox_BOXZEROBYTES = 16,\n crypto_scalarmult_BYTES = 32,\n crypto_scalarmult_SCALARBYTES = 32,\n crypto_box_PUBLICKEYBYTES = 32,\n crypto_box_SECRETKEYBYTES = 32,\n crypto_box_BEFORENMBYTES = 32,\n crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n crypto_sign_BYTES = 64,\n crypto_sign_PUBLICKEYBYTES = 32,\n crypto_sign_SECRETKEYBYTES = 64,\n crypto_sign_SEEDBYTES = 32,\n crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n crypto_core_hsalsa20: crypto_core_hsalsa20,\n crypto_stream_xor: crypto_stream_xor,\n crypto_stream: crypto_stream,\n crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n crypto_stream_salsa20: crypto_stream_salsa20,\n crypto_onetimeauth: crypto_onetimeauth,\n crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n crypto_verify_16: crypto_verify_16,\n crypto_verify_32: crypto_verify_32,\n crypto_secretbox: crypto_secretbox,\n crypto_secretbox_open: crypto_secretbox_open,\n crypto_scalarmult: crypto_scalarmult,\n crypto_scalarmult_base: crypto_scalarmult_base,\n crypto_box_beforenm: crypto_box_beforenm,\n crypto_box_afternm: crypto_box_afternm,\n crypto_box: crypto_box,\n crypto_box_open: crypto_box_open,\n crypto_box_keypair: crypto_box_keypair,\n crypto_hash: crypto_hash,\n crypto_sign: crypto_sign,\n crypto_sign_keypair: crypto_sign_keypair,\n crypto_sign_open: crypto_sign_open,\n\n crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n crypto_sign_BYTES: crypto_sign_BYTES,\n crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n crypto_hash_BYTES: crypto_hash_BYTES\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n for (var i = 0; i < arguments.length; i++) {\n if (!(arguments[i] instanceof Uint8Array))\n throw new TypeError('unexpected type, use Uint8Array');\n }\n}\n\nfunction cleanup(arr) {\n for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\nnacl.randomBytes = function(n) {\n var b = new Uint8Array(n);\n randombytes(b, n);\n return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n checkArrayTypes(msg, nonce, key);\n checkLengths(key, nonce);\n var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n var c = new Uint8Array(m.length);\n for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n crypto_secretbox(c, m, m.length, nonce, key);\n return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n checkArrayTypes(box, nonce, key);\n checkLengths(key, nonce);\n var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n var m = new Uint8Array(c.length);\n for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n if (c.length < 32) return null;\n if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return null;\n return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n checkArrayTypes(n, p);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult(q, n, p);\n return q;\n};\n\nnacl.scalarMult.base = function(n) {\n checkArrayTypes(n);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult_base(q, n);\n return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n checkArrayTypes(publicKey, secretKey);\n checkBoxLengths(publicKey, secretKey);\n var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n crypto_box_beforenm(k, publicKey, secretKey);\n return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n crypto_box_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n crypto_scalarmult_base(pk, secretKey);\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n checkArrayTypes(msg, secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n crypto_sign(signedMsg, msg, msg.length, secretKey);\n return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n checkArrayTypes(signedMsg, publicKey);\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var tmp = new Uint8Array(signedMsg.length);\n var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n if (mlen < 0) return null;\n var m = new Uint8Array(mlen);\n for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n var signedMsg = nacl.sign(msg, secretKey);\n var sig = new Uint8Array(crypto_sign_BYTES);\n for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n checkArrayTypes(msg, sig, publicKey);\n if (sig.length !== crypto_sign_BYTES)\n throw new Error('bad signature size');\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n var i;\n for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n crypto_sign_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n checkArrayTypes(seed);\n if (seed.length !== crypto_sign_SEEDBYTES)\n throw new Error('bad seed size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n for (var i = 0; i < 32; i++) sk[i] = seed[i];\n crypto_sign_keypair(pk, sk, true);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n checkArrayTypes(msg);\n var h = new Uint8Array(crypto_hash_BYTES);\n crypto_hash(h, msg, msg.length);\n return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n checkArrayTypes(x, y);\n // Zero length arguments are considered not equal.\n if (x.length === 0 || y.length === 0) return false;\n if (x.length !== y.length) return false;\n return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n randombytes = fn;\n};\n\n(function() {\n // Initialize PRNG if environment provides CSPRNG.\n // If not, methods calling randombytes will throw.\n var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n if (crypto && crypto.getRandomValues) {\n // Browsers.\n var QUOTA = 65536;\n nacl.setPRNG(function(x, n) {\n var i, v = new Uint8Array(n);\n for (i = 0; i < n; i += QUOTA) {\n crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n }\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n } else if (true) {\n // Node.js.\n crypto = __webpack_require__(/*! crypto */ 5);\n if (crypto && crypto.randomBytes) {\n nacl.setPRNG(function(x, n) {\n var i, v = crypto.randomBytes(n);\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n }\n }\n})();\n\n})( true && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/node_modules/tweetnacl/nacl-fast.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/hmac/index-browser.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/hmac/index-browser.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst nodeify = __webpack_require__(/*! ../nodeify */ \"./node_modules/libp2p-crypto/src/nodeify.js\")\n\nconst crypto = __webpack_require__(/*! ../webcrypto */ \"./node_modules/libp2p-crypto/src/webcrypto.js\")\nconst lengths = __webpack_require__(/*! ./lengths */ \"./node_modules/libp2p-crypto/src/hmac/lengths.js\")\n\nconst hashTypes = {\n SHA1: 'SHA-1',\n SHA256: 'SHA-256',\n SHA512: 'SHA-512'\n}\n\nconst sign = (key, data, cb) => {\n nodeify(crypto.subtle.sign({ name: 'HMAC' }, key, data)\n .then((raw) => Buffer.from(raw)), cb)\n}\n\nexports.create = function (hashType, secret, callback) {\n const hash = hashTypes[hashType]\n\n nodeify(crypto.subtle.importKey(\n 'raw',\n secret,\n {\n name: 'HMAC',\n hash: { name: hash }\n },\n false,\n ['sign']\n ).then((key) => {\n return {\n digest (data, cb) {\n sign(key, data, cb)\n },\n length: lengths[hashType]\n }\n }), callback)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/hmac/index-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/hmac/lengths.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/hmac/lengths.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = {\n SHA1: 20,\n SHA256: 32,\n SHA512: 64\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/hmac/lengths.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/ecdh-browser.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/ecdh-browser.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst webcrypto = __webpack_require__(/*! ../webcrypto */ \"./node_modules/libp2p-crypto/src/webcrypto.js\")\nconst nodeify = __webpack_require__(/*! ../nodeify */ \"./node_modules/libp2p-crypto/src/nodeify.js\")\nconst BN = __webpack_require__(/*! asn1.js */ \"./node_modules/asn1.js/lib/asn1.js\").bignum\n\nconst util = __webpack_require__(/*! ../util */ \"./node_modules/libp2p-crypto/src/util.js\")\nconst toBase64 = util.toBase64\nconst toBn = util.toBn\n\nconst bits = {\n 'P-256': 256,\n 'P-384': 384,\n 'P-521': 521\n}\n\nexports.generateEphmeralKeyPair = function (curve, callback) {\n nodeify(webcrypto.subtle.generateKey(\n {\n name: 'ECDH',\n namedCurve: curve\n },\n true,\n ['deriveBits']\n ).then((pair) => {\n // forcePrivate is used for testing only\n const genSharedKey = (theirPub, forcePrivate, cb) => {\n if (typeof forcePrivate === 'function') {\n cb = forcePrivate\n forcePrivate = undefined\n }\n\n let privateKey\n\n if (forcePrivate) {\n privateKey = webcrypto.subtle.importKey(\n 'jwk',\n unmarshalPrivateKey(curve, forcePrivate),\n {\n name: 'ECDH',\n namedCurve: curve\n },\n false,\n ['deriveBits']\n )\n } else {\n privateKey = Promise.resolve(pair.privateKey)\n }\n\n const keys = Promise.all([\n webcrypto.subtle.importKey(\n 'jwk',\n unmarshalPublicKey(curve, theirPub),\n {\n name: 'ECDH',\n namedCurve: curve\n },\n false,\n []\n ),\n privateKey\n ])\n\n nodeify(keys.then((keys) => webcrypto.subtle.deriveBits(\n {\n name: 'ECDH',\n namedCurve: curve,\n public: keys[0]\n },\n keys[1],\n bits[curve]\n )).then((bits) => Buffer.from(bits)), cb)\n }\n\n return webcrypto.subtle.exportKey('jwk', pair.publicKey)\n .then((publicKey) => {\n return {\n key: marshalPublicKey(publicKey),\n genSharedKey\n }\n })\n }), callback)\n}\n\nconst curveLengths = {\n 'P-256': 32,\n 'P-384': 48,\n 'P-521': 66\n}\n\n// Marshal converts a jwk encodec ECDH public key into the\n// form specified in section 4.3.6 of ANSI X9.62. (This is the format\n// go-ipfs uses)\nfunction marshalPublicKey (jwk) {\n const byteLen = curveLengths[jwk.crv]\n\n return Buffer.concat([\n Buffer.from([4]), // uncompressed point\n toBn(jwk.x).toArrayLike(Buffer, 'be', byteLen),\n toBn(jwk.y).toArrayLike(Buffer, 'be', byteLen)\n ], 1 + byteLen * 2)\n}\n\n// Unmarshal converts a point, serialized by Marshal, into an jwk encoded key\nfunction unmarshalPublicKey (curve, key) {\n const byteLen = curveLengths[curve]\n\n if (!key.slice(0, 1).equals(Buffer.from([4]))) {\n throw new Error('Invalid key format')\n }\n const x = new BN(key.slice(1, byteLen + 1))\n const y = new BN(key.slice(1 + byteLen))\n\n return {\n kty: 'EC',\n crv: curve,\n x: toBase64(x, byteLen),\n y: toBase64(y, byteLen),\n ext: true\n }\n}\n\nfunction unmarshalPrivateKey (curve, key) {\n const result = unmarshalPublicKey(curve, key.public)\n result.d = toBase64(new BN(key.private))\n return result\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/ecdh-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/ed25519-class.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/ed25519-class.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/index.js\")\nconst protobuf = __webpack_require__(/*! protons */ \"./node_modules/protons/src/index.js\")\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\n\nconst crypto = __webpack_require__(/*! ./ed25519 */ \"./node_modules/libp2p-crypto/src/keys/ed25519.js\")\nconst pbm = protobuf(__webpack_require__(/*! ./keys.proto */ \"./node_modules/libp2p-crypto/src/keys/keys.proto.js\"))\n\nclass Ed25519PublicKey {\n constructor (key) {\n this._key = ensureKey(key, crypto.publicKeyLength)\n }\n\n verify (data, sig, callback) {\n ensure(callback)\n crypto.hashAndVerify(this._key, sig, data, callback)\n }\n\n marshal () {\n return Buffer.from(this._key)\n }\n\n get bytes () {\n return pbm.PublicKey.encode({\n Type: pbm.KeyType.Ed25519,\n Data: this.marshal()\n })\n }\n\n equals (key) {\n return this.bytes.equals(key.bytes)\n }\n\n hash (callback) {\n ensure(callback)\n multihashing(this.bytes, 'sha2-256', callback)\n }\n}\n\nclass Ed25519PrivateKey {\n // key - 64 byte Uint8Array or Buffer containing private key\n // publicKey - 32 byte Uint8Array or Buffer containing public key\n constructor (key, publicKey) {\n this._key = ensureKey(key, crypto.privateKeyLength)\n this._publicKey = ensureKey(publicKey, crypto.publicKeyLength)\n }\n\n sign (message, callback) {\n ensure(callback)\n crypto.hashAndSign(this._key, message, callback)\n }\n\n get public () {\n if (!this._publicKey) {\n throw new Error('public key not provided')\n }\n\n return new Ed25519PublicKey(this._publicKey)\n }\n\n marshal () {\n return Buffer.concat([Buffer.from(this._key), Buffer.from(this._publicKey)])\n }\n\n get bytes () {\n return pbm.PrivateKey.encode({\n Type: pbm.KeyType.Ed25519,\n Data: this.marshal()\n })\n }\n\n equals (key) {\n return this.bytes.equals(key.bytes)\n }\n\n hash (callback) {\n ensure(callback)\n multihashing(this.bytes, 'sha2-256', callback)\n }\n\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n *\n * @param {function(Error, id)} callback\n * @returns {undefined}\n */\n id (callback) {\n this.public.hash((err, hash) => {\n if (err) {\n return callback(err)\n }\n callback(null, bs58.encode(hash))\n })\n }\n}\n\nfunction unmarshalEd25519PrivateKey (bytes, callback) {\n try {\n bytes = ensureKey(bytes, crypto.privateKeyLength + crypto.publicKeyLength)\n } catch (err) {\n return callback(err)\n }\n const privateKeyBytes = bytes.slice(0, crypto.privateKeyLength)\n const publicKeyBytes = bytes.slice(crypto.privateKeyLength, bytes.length)\n callback(null, new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes))\n}\n\nfunction unmarshalEd25519PublicKey (bytes) {\n bytes = ensureKey(bytes, crypto.publicKeyLength)\n return new Ed25519PublicKey(bytes)\n}\n\nfunction generateKeyPair (_bits, cb) {\n if (cb === undefined && typeof _bits === 'function') {\n cb = _bits\n }\n\n crypto.generateKey((err, keys) => {\n if (err) {\n return cb(err)\n }\n let privkey\n try {\n privkey = new Ed25519PrivateKey(keys.secretKey, keys.publicKey)\n } catch (err) {\n cb(err)\n return\n }\n\n cb(null, privkey)\n })\n}\n\nfunction generateKeyPairFromSeed (seed, _bits, cb) {\n if (cb === undefined && typeof _bits === 'function') {\n cb = _bits\n }\n\n crypto.generateKeyFromSeed(seed, (err, keys) => {\n if (err) {\n return cb(err)\n }\n let privkey\n try {\n privkey = new Ed25519PrivateKey(keys.secretKey, keys.publicKey)\n } catch (err) {\n cb(err)\n return\n }\n\n cb(null, privkey)\n })\n}\n\nfunction ensure (cb) {\n if (typeof cb !== 'function') {\n throw new Error('callback is required')\n }\n}\n\nfunction ensureKey (key, length) {\n if (Buffer.isBuffer(key)) {\n key = new Uint8Array(key)\n }\n if (!(key instanceof Uint8Array) || key.length !== length) {\n throw new Error('Key must be a Uint8Array or Buffer of length ' + length)\n }\n return key\n}\n\nmodule.exports = {\n Ed25519PublicKey,\n Ed25519PrivateKey,\n unmarshalEd25519PrivateKey,\n unmarshalEd25519PublicKey,\n generateKeyPair,\n generateKeyPairFromSeed\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/ed25519-class.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/ed25519.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/ed25519.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst nacl = __webpack_require__(/*! tweetnacl */ \"./node_modules/libp2p-crypto/node_modules/tweetnacl/nacl-fast.js\")\nconst nextTick = __webpack_require__(/*! async/nextTick */ \"./node_modules/async/nextTick.js\")\n\nexports.publicKeyLength = nacl.sign.publicKeyLength\nexports.privateKeyLength = nacl.sign.secretKeyLength\n\nexports.generateKey = function (callback) {\n nextTick(() => {\n let result\n try {\n result = nacl.sign.keyPair()\n } catch (err) {\n return callback(err)\n }\n callback(null, result)\n })\n}\n\n// seed should be a 32 byte uint8array\nexports.generateKeyFromSeed = function (seed, callback) {\n nextTick(() => {\n let result\n try {\n result = nacl.sign.keyPair.fromSeed(seed)\n } catch (err) {\n return callback(err)\n }\n callback(null, result)\n })\n}\n\nexports.hashAndSign = function (key, msg, callback) {\n nextTick(() => {\n callback(null, Buffer.from(nacl.sign.detached(msg, key)))\n })\n}\n\nexports.hashAndVerify = function (key, sig, msg, callback) {\n nextTick(() => {\n let result\n try {\n result = nacl.sign.detached.verify(msg, sig, key)\n } catch (err) {\n return callback(err)\n }\n\n callback(null, result)\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/ed25519.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/ephemeral-keys.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/ephemeral-keys.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst ecdh = __webpack_require__(/*! ./ecdh */ \"./node_modules/libp2p-crypto/src/keys/ecdh-browser.js\")\n\n// Generates an ephemeral public key and returns a function that will compute\n// the shared secret key.\n//\n// Focuses only on ECDH now, but can be made more general in the future.\nmodule.exports = (curve, callback) => {\n ecdh.generateEphmeralKeyPair(curve, callback)\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/ephemeral-keys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/index.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/index.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst protobuf = __webpack_require__(/*! protons */ \"./node_modules/protons/src/index.js\")\nconst keysPBM = protobuf(__webpack_require__(/*! ./keys.proto */ \"./node_modules/libp2p-crypto/src/keys/keys.proto.js\"))\n__webpack_require__(/*! node-forge/lib/asn1 */ \"./node_modules/node-forge/lib/asn1.js\")\n__webpack_require__(/*! node-forge/lib/rsa */ \"./node_modules/node-forge/lib/rsa.js\")\n__webpack_require__(/*! node-forge/lib/pbe */ \"./node_modules/node-forge/lib/pbe.js\")\nconst forge = __webpack_require__(/*! node-forge/lib/forge */ \"./node_modules/node-forge/lib/forge.js\")\n\nexports = module.exports\n\nconst supportedKeys = {\n rsa: __webpack_require__(/*! ./rsa-class */ \"./node_modules/libp2p-crypto/src/keys/rsa-class.js\"),\n ed25519: __webpack_require__(/*! ./ed25519-class */ \"./node_modules/libp2p-crypto/src/keys/ed25519-class.js\"),\n secp256k1: __webpack_require__(/*! libp2p-crypto-secp256k1 */ \"./node_modules/libp2p-crypto-secp256k1/src/index.js\")(keysPBM, __webpack_require__(/*! ../random-bytes */ \"./node_modules/libp2p-crypto/src/random-bytes.js\"))\n}\n\nexports.supportedKeys = supportedKeys\nexports.keysPBM = keysPBM\n\nfunction isValidKeyType (keyType) {\n const key = supportedKeys[keyType.toLowerCase()]\n return key !== undefined\n}\n\nexports.keyStretcher = __webpack_require__(/*! ./key-stretcher */ \"./node_modules/libp2p-crypto/src/keys/key-stretcher.js\")\nexports.generateEphemeralKeyPair = __webpack_require__(/*! ./ephemeral-keys */ \"./node_modules/libp2p-crypto/src/keys/ephemeral-keys.js\")\n\n// Generates a keypair of the given type and bitsize\nexports.generateKeyPair = (type, bits, cb) => {\n let key = supportedKeys[type.toLowerCase()]\n\n if (!key) {\n return cb(new Error('invalid or unsupported key type'))\n }\n\n key.generateKeyPair(bits, cb)\n}\n\n// Generates a keypair of the given type and bitsize\n// seed is a 32 byte uint8array\nexports.generateKeyPairFromSeed = (type, seed, bits, cb) => {\n let key = supportedKeys[type.toLowerCase()]\n if (!key) {\n return cb(new Error('invalid or unsupported key type'))\n }\n if (type.toLowerCase() !== 'ed25519') {\n return cb(new Error('Seed key derivation is unimplemented for RSA or secp256k1'))\n }\n key.generateKeyPairFromSeed(seed, bits, cb)\n}\n\n// Converts a protobuf serialized public key into its\n// representative object\nexports.unmarshalPublicKey = (buf) => {\n const decoded = keysPBM.PublicKey.decode(buf)\n const data = decoded.Data\n\n switch (decoded.Type) {\n case keysPBM.KeyType.RSA:\n return supportedKeys.rsa.unmarshalRsaPublicKey(data)\n case keysPBM.KeyType.Ed25519:\n return supportedKeys.ed25519.unmarshalEd25519PublicKey(data)\n case keysPBM.KeyType.Secp256k1:\n if (supportedKeys.secp256k1) {\n return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data)\n } else {\n throw new Error('secp256k1 support requires libp2p-crypto-secp256k1 package')\n }\n default:\n throw new Error('invalid or unsupported key type')\n }\n}\n\n// Converts a public key object into a protobuf serialized public key\nexports.marshalPublicKey = (key, type) => {\n type = (type || 'rsa').toLowerCase()\n if (!isValidKeyType(type)) {\n throw new Error('invalid or unsupported key type')\n }\n\n return key.bytes\n}\n\n// Converts a protobuf serialized private key into its\n// representative object\nexports.unmarshalPrivateKey = (buf, callback) => {\n let decoded\n try {\n decoded = keysPBM.PrivateKey.decode(buf)\n } catch (err) {\n return callback(err)\n }\n\n const data = decoded.Data\n\n switch (decoded.Type) {\n case keysPBM.KeyType.RSA:\n return supportedKeys.rsa.unmarshalRsaPrivateKey(data, callback)\n case keysPBM.KeyType.Ed25519:\n return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data, callback)\n case keysPBM.KeyType.Secp256k1:\n if (supportedKeys.secp256k1) {\n return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data, callback)\n } else {\n return callback(new Error('secp256k1 support requires libp2p-crypto-secp256k1 package'))\n }\n default:\n callback(new Error('invalid or unsupported key type'))\n }\n}\n\n// Converts a private key object into a protobuf serialized private key\nexports.marshalPrivateKey = (key, type) => {\n type = (type || 'rsa').toLowerCase()\n if (!isValidKeyType(type)) {\n throw new Error('invalid or unsupported key type')\n }\n\n return key.bytes\n}\n\nexports.import = (pem, password, callback) => {\n try {\n const key = forge.pki.decryptRsaPrivateKey(pem, password)\n if (key === null) {\n throw new Error('Cannot read the key, most likely the password is wrong or not a RSA key')\n }\n let der = forge.asn1.toDer(forge.pki.privateKeyToAsn1(key))\n der = Buffer.from(der.getBytes(), 'binary')\n return supportedKeys.rsa.unmarshalRsaPrivateKey(der, callback)\n } catch (err) {\n callback(err)\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/key-stretcher.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/key-stretcher.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst whilst = __webpack_require__(/*! async/whilst */ \"./node_modules/async/whilst.js\")\nconst hmac = __webpack_require__(/*! ../hmac */ \"./node_modules/libp2p-crypto/src/hmac/index-browser.js\")\n\nconst cipherMap = {\n 'AES-128': {\n ivSize: 16,\n keySize: 16\n },\n 'AES-256': {\n ivSize: 16,\n keySize: 32\n },\n Blowfish: {\n ivSize: 8,\n cipherKeySize: 32\n }\n}\n\n// Generates a set of keys for each party by stretching the shared key.\n// (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey)\nmodule.exports = (cipherType, hash, secret, callback) => {\n const cipher = cipherMap[cipherType]\n\n if (!cipher) {\n return callback(new Error('unkown cipherType passed'))\n }\n\n if (!hash) {\n return callback(new Error('unkown hashType passed'))\n }\n\n const cipherKeySize = cipher.keySize\n const ivSize = cipher.ivSize\n const hmacKeySize = 20\n const seed = Buffer.from('key expansion')\n const resultLength = 2 * (ivSize + cipherKeySize + hmacKeySize)\n\n hmac.create(hash, secret, (err, m) => {\n if (err) {\n return callback(err)\n }\n\n m.digest(seed, (err, a) => {\n if (err) {\n return callback(err)\n }\n\n let result = []\n let j = 0\n\n whilst(\n () => j < resultLength,\n stretch,\n finish\n )\n\n function stretch (cb) {\n m.digest(Buffer.concat([a, seed]), (err, b) => {\n if (err) {\n return cb(err)\n }\n\n let todo = b.length\n\n if (j + todo > resultLength) {\n todo = resultLength - j\n }\n\n result.push(b)\n\n j += todo\n\n m.digest(a, (err, _a) => {\n if (err) {\n return cb(err)\n }\n a = _a\n cb()\n })\n })\n }\n\n function finish (err) {\n if (err) {\n return callback(err)\n }\n\n const half = resultLength / 2\n const resultBuffer = Buffer.concat(result)\n const r1 = resultBuffer.slice(0, half)\n const r2 = resultBuffer.slice(half, resultLength)\n\n const createKey = (res) => ({\n iv: res.slice(0, ivSize),\n cipherKey: res.slice(ivSize, ivSize + cipherKeySize),\n macKey: res.slice(ivSize + cipherKeySize)\n })\n\n callback(null, {\n k1: createKey(r1),\n k2: createKey(r2)\n })\n }\n })\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/key-stretcher.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/keys.proto.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/keys.proto.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = `enum KeyType {\n RSA = 0;\n Ed25519 = 1;\n Secp256k1 = 2;\n}\nmessage PublicKey {\n required KeyType Type = 1;\n required bytes Data = 2;\n}\nmessage PrivateKey {\n required KeyType Type = 1;\n required bytes Data = 2;\n}`\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/keys.proto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/rsa-browser.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/rsa-browser.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst nodeify = __webpack_require__(/*! ../nodeify */ \"./node_modules/libp2p-crypto/src/nodeify.js\")\nconst webcrypto = __webpack_require__(/*! ../webcrypto */ \"./node_modules/libp2p-crypto/src/webcrypto.js\")\nconst randomBytes = __webpack_require__(/*! ../random-bytes */ \"./node_modules/libp2p-crypto/src/random-bytes.js\")\n\nexports.utils = __webpack_require__(/*! ./rsa-utils */ \"./node_modules/libp2p-crypto/src/keys/rsa-utils.js\")\n\nexports.generateKey = function (bits, callback) {\n nodeify(webcrypto.subtle.generateKey(\n {\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: bits,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: 'SHA-256' }\n },\n true,\n ['sign', 'verify']\n )\n .then(exportKey)\n .then((keys) => ({\n privateKey: keys[0],\n publicKey: keys[1]\n })), callback)\n}\n\n// Takes a jwk key\nexports.unmarshalPrivateKey = function (key, callback) {\n const privateKey = webcrypto.subtle.importKey(\n 'jwk',\n key,\n {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n },\n true,\n ['sign']\n )\n\n nodeify(Promise.all([\n privateKey,\n derivePublicFromPrivate(key)\n ]).then((keys) => exportKey({\n privateKey: keys[0],\n publicKey: keys[1]\n })).then((keys) => ({\n privateKey: keys[0],\n publicKey: keys[1]\n })), callback)\n}\n\nexports.getRandomValues = randomBytes\n\nexports.hashAndSign = function (key, msg, callback) {\n nodeify(webcrypto.subtle.importKey(\n 'jwk',\n key,\n {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n },\n false,\n ['sign']\n ).then((privateKey) => {\n return webcrypto.subtle.sign(\n { name: 'RSASSA-PKCS1-v1_5' },\n privateKey,\n Uint8Array.from(msg)\n )\n }).then((sig) => Buffer.from(sig)), callback)\n}\n\nexports.hashAndVerify = function (key, sig, msg, callback) {\n nodeify(webcrypto.subtle.importKey(\n 'jwk',\n key,\n {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n },\n false,\n ['verify']\n ).then((publicKey) => {\n return webcrypto.subtle.verify(\n { name: 'RSASSA-PKCS1-v1_5' },\n publicKey,\n sig,\n msg\n )\n }), callback)\n}\n\nfunction exportKey (pair) {\n return Promise.all([\n webcrypto.subtle.exportKey('jwk', pair.privateKey),\n webcrypto.subtle.exportKey('jwk', pair.publicKey)\n ])\n}\n\nfunction derivePublicFromPrivate (jwKey) {\n return webcrypto.subtle.importKey(\n 'jwk',\n {\n kty: jwKey.kty,\n n: jwKey.n,\n e: jwKey.e\n },\n {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n },\n true,\n ['verify']\n )\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/rsa-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/rsa-class.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/rsa-class.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst multihashing = __webpack_require__(/*! multihashing-async */ \"./node_modules/libp2p-crypto/node_modules/multihashing-async/src/index.js\")\nconst protobuf = __webpack_require__(/*! protons */ \"./node_modules/protons/src/index.js\")\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\nconst nextTick = __webpack_require__(/*! async/nextTick */ \"./node_modules/async/nextTick.js\")\n\nconst crypto = __webpack_require__(/*! ./rsa */ \"./node_modules/libp2p-crypto/src/keys/rsa-browser.js\")\nconst pbm = protobuf(__webpack_require__(/*! ./keys.proto */ \"./node_modules/libp2p-crypto/src/keys/keys.proto.js\"))\n__webpack_require__(/*! node-forge/lib/sha512 */ \"./node_modules/node-forge/lib/sha512.js\")\n__webpack_require__(/*! node-forge/lib/pbe */ \"./node_modules/node-forge/lib/pbe.js\")\nconst forge = __webpack_require__(/*! node-forge/lib/forge */ \"./node_modules/node-forge/lib/forge.js\")\n\nclass RsaPublicKey {\n constructor (key) {\n this._key = key\n }\n\n verify (data, sig, callback) {\n ensure(callback)\n crypto.hashAndVerify(this._key, sig, data, callback)\n }\n\n marshal () {\n return crypto.utils.jwkToPkix(this._key)\n }\n\n get bytes () {\n return pbm.PublicKey.encode({\n Type: pbm.KeyType.RSA,\n Data: this.marshal()\n })\n }\n\n encrypt (bytes) {\n return this._key.encrypt(bytes, 'RSAES-PKCS1-V1_5')\n }\n\n equals (key) {\n return this.bytes.equals(key.bytes)\n }\n\n hash (callback) {\n ensure(callback)\n multihashing(this.bytes, 'sha2-256', callback)\n }\n}\n\nclass RsaPrivateKey {\n // key - Object of the jwk format\n // publicKey - Buffer of the spki format\n constructor (key, publicKey) {\n this._key = key\n this._publicKey = publicKey\n }\n\n genSecret () {\n return crypto.getRandomValues(16)\n }\n\n sign (message, callback) {\n ensure(callback)\n crypto.hashAndSign(this._key, message, callback)\n }\n\n get public () {\n if (!this._publicKey) {\n throw new Error('public key not provided')\n }\n\n return new RsaPublicKey(this._publicKey)\n }\n\n decrypt (msg, callback) {\n crypto.decrypt(this._key, msg, callback)\n }\n\n marshal () {\n return crypto.utils.jwkToPkcs1(this._key)\n }\n\n get bytes () {\n return pbm.PrivateKey.encode({\n Type: pbm.KeyType.RSA,\n Data: this.marshal()\n })\n }\n\n equals (key) {\n return this.bytes.equals(key.bytes)\n }\n\n hash (callback) {\n ensure(callback)\n multihashing(this.bytes, 'sha2-256', callback)\n }\n\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n *\n * @param {function(Error, id)} callback\n * @returns {undefined}\n */\n id (callback) {\n this.public.hash((err, hash) => {\n if (err) {\n return callback(err)\n }\n callback(null, bs58.encode(hash))\n })\n }\n\n /**\n * Exports the key into a password protected PEM format\n *\n * @param {string} [format] - Defaults to 'pkcs-8'.\n * @param {string} password - The password to read the encrypted PEM\n * @param {function(Error, KeyInfo)} callback\n * @returns {undefined}\n */\n export (format, password, callback) {\n if (typeof password === 'function') {\n callback = password\n password = format\n format = 'pkcs-8'\n }\n\n ensure(callback)\n\n nextTick(() => {\n let err = null\n let pem = null\n try {\n const buffer = new forge.util.ByteBuffer(this.marshal())\n const asn1 = forge.asn1.fromDer(buffer)\n const privateKey = forge.pki.privateKeyFromAsn1(asn1)\n if (format === 'pkcs-8') {\n const options = {\n algorithm: 'aes256',\n count: 10000,\n saltSize: 128 / 8,\n prfAlgorithm: 'sha512'\n }\n pem = forge.pki.encryptRsaPrivateKey(privateKey, password, options)\n } else {\n err = new Error(`Unknown export format '${format}'`)\n }\n } catch (_err) {\n err = _err\n }\n\n callback(err, pem)\n })\n }\n}\n\nfunction unmarshalRsaPrivateKey (bytes, callback) {\n const jwk = crypto.utils.pkcs1ToJwk(bytes)\n\n crypto.unmarshalPrivateKey(jwk, (err, keys) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new RsaPrivateKey(keys.privateKey, keys.publicKey))\n })\n}\n\nfunction unmarshalRsaPublicKey (bytes) {\n const jwk = crypto.utils.pkixToJwk(bytes)\n\n return new RsaPublicKey(jwk)\n}\n\nfunction fromJwk (jwk, callback) {\n crypto.unmarshalPrivateKey(jwk, (err, keys) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new RsaPrivateKey(keys.privateKey, keys.publicKey))\n })\n}\n\nfunction generateKeyPair (bits, callback) {\n crypto.generateKey(bits, (err, keys) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new RsaPrivateKey(keys.privateKey, keys.publicKey))\n })\n}\n\nfunction ensure (callback) {\n if (typeof callback !== 'function') {\n throw new Error('callback is required')\n }\n}\n\nmodule.exports = {\n RsaPublicKey,\n RsaPrivateKey,\n unmarshalRsaPublicKey,\n unmarshalRsaPrivateKey,\n generateKeyPair,\n fromJwk\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/rsa-class.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/keys/rsa-utils.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/keys/rsa-utils.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst asn1 = __webpack_require__(/*! asn1.js */ \"./node_modules/asn1.js/lib/asn1.js\")\n\nconst util = __webpack_require__(/*! ./../util */ \"./node_modules/libp2p-crypto/src/util.js\")\nconst toBase64 = util.toBase64\nconst toBn = util.toBn\n\nconst RSAPrivateKey = asn1.define('RSAPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('modulus').int(),\n this.key('publicExponent').int(),\n this.key('privateExponent').int(),\n this.key('prime1').int(),\n this.key('prime2').int(),\n this.key('exponent1').int(),\n this.key('exponent2').int(),\n this.key('coefficient').int()\n )\n})\n\nconst AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {\n this.seq().obj(\n this.key('algorithm').objid({\n '1.2.840.113549.1.1.1': 'rsa'\n }),\n this.key('none').optional().null_(),\n this.key('curve').optional().objid(),\n this.key('params').optional().seq().obj(\n this.key('p').int(),\n this.key('q').int(),\n this.key('g').int()\n )\n )\n})\n\nconst PublicKey = asn1.define('RSAPublicKey', function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPublicKey').bitstr()\n )\n})\n\nconst RSAPublicKey = asn1.define('RSAPublicKey', function () {\n this.seq().obj(\n this.key('modulus').int(),\n this.key('publicExponent').int()\n )\n})\n\n// Convert a PKCS#1 in ASN1 DER format to a JWK key\nexports.pkcs1ToJwk = function (bytes) {\n const asn1 = RSAPrivateKey.decode(bytes, 'der')\n\n return {\n kty: 'RSA',\n n: toBase64(asn1.modulus),\n e: toBase64(asn1.publicExponent),\n d: toBase64(asn1.privateExponent),\n p: toBase64(asn1.prime1),\n q: toBase64(asn1.prime2),\n dp: toBase64(asn1.exponent1),\n dq: toBase64(asn1.exponent2),\n qi: toBase64(asn1.coefficient),\n alg: 'RS256',\n kid: '2011-04-29'\n }\n}\n\n// Convert a JWK key into PKCS#1 in ASN1 DER format\nexports.jwkToPkcs1 = function (jwk) {\n return RSAPrivateKey.encode({\n version: 0,\n modulus: toBn(jwk.n),\n publicExponent: toBn(jwk.e),\n privateExponent: toBn(jwk.d),\n prime1: toBn(jwk.p),\n prime2: toBn(jwk.q),\n exponent1: toBn(jwk.dp),\n exponent2: toBn(jwk.dq),\n coefficient: toBn(jwk.qi)\n }, 'der')\n}\n\n// Convert a PKCIX in ASN1 DER format to a JWK key\nexports.pkixToJwk = function (bytes) {\n const ndata = PublicKey.decode(bytes, 'der')\n const asn1 = RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')\n\n return {\n kty: 'RSA',\n n: toBase64(asn1.modulus),\n e: toBase64(asn1.publicExponent),\n alg: 'RS256',\n kid: '2011-04-29'\n }\n}\n\n// Convert a JWK key to PKCIX in ASN1 DER format\nexports.jwkToPkix = function (jwk) {\n return PublicKey.encode({\n algorithm: {\n algorithm: 'rsa',\n none: null\n },\n subjectPublicKey: {\n data: RSAPublicKey.encode({\n modulus: toBn(jwk.n),\n publicExponent: toBn(jwk.e)\n }, 'der')\n }\n }, 'der')\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/keys/rsa-utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/nodeify.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/nodeify.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// Based on npmjs.com/nodeify but without additional `nextTick` calls\n// to keep the overhead low\nmodule.exports = function nodeify (promise, cb) {\n return promise.then((res) => {\n cb(null, res)\n }, (err) => {\n cb(err)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/nodeify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/random-bytes.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/random-bytes.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nconst randomBytes = __webpack_require__(/*! iso-random-stream/src/random */ \"./node_modules/iso-random-stream/src/random.browser.js\")\n\nmodule.exports = function (number) {\n if (!number || typeof number !== 'number') {\n throw new Error('first argument must be a Number bigger than 0')\n }\n return randomBytes(number)\n}\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/random-bytes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/util.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/util.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst BN = __webpack_require__(/*! asn1.js */ \"./node_modules/asn1.js/lib/asn1.js\").bignum\n\n// Convert a BN.js instance to a base64 encoded string without padding\n// Adapted from https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#appendix-C\nexports.toBase64 = function toBase64 (bn, len) {\n // if len is defined then the bytes are leading-0 padded to the length\n let s = bn.toArrayLike(Buffer, 'be', len).toString('base64')\n\n return s\n .replace(/(=*)$/, '') // Remove any trailing '='s\n .replace(/\\+/g, '-') // 62nd char of encoding\n .replace(/\\//g, '_') // 63rd char of encoding\n}\n\n// Convert a base64 encoded string to a BN.js instance\nexports.toBn = function toBn (str) {\n return new BN(Buffer.from(str, 'base64'))\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/libp2p-crypto/src/webcrypto.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/libp2p-crypto/src/webcrypto.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global self */\n\n\n\nmodule.exports = self.crypto || self.msCrypto\n\n\n//# sourceURL=webpack:///./node_modules/libp2p-crypto/src/webcrypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash.clonedeep/index.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/lodash.clonedeep/index.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/lodash.clonedeep/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash.pullat/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/lodash.pullat/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths of elements to pick.\n * @returns {Array} Returns the picked elements.\n */\nfunction baseAt(object, paths) {\n var index = -1,\n isNil = object == null,\n length = paths.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = isNil ? undefined : get(object, paths[index]);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n }\n else if (!isKey(index, array)) {\n var path = castPath(index),\n object = parent(array, path);\n\n if (object != null) {\n delete object[toKey(last(path))];\n }\n }\n else {\n delete array[toKey(index)];\n }\n }\n }\n return array;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n}\n\n/**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\nvar pullAt = baseRest(function(array, indexes) {\n indexes = baseFlatten(indexes, 1);\n\n var length = array ? array.length : 0,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n});\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = pullAt;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/lodash.pullat/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_Symbol.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/lodash/_Symbol.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_Symbol.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_arrayLikeKeys.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/lodash/_arrayLikeKeys.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseTimes = __webpack_require__(/*! ./_baseTimes */ \"./node_modules/lodash/_baseTimes.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isIndex = __webpack_require__(/*! ./_isIndex */ \"./node_modules/lodash/_isIndex.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_arrayLikeKeys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseFindIndex.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/lodash/_baseFindIndex.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseFindIndex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseGetTag.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/lodash/_baseGetTag.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ \"./node_modules/lodash/_getRawTag.js\"),\n objectToString = __webpack_require__(/*! ./_objectToString */ \"./node_modules/lodash/_objectToString.js\");\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseGetTag.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseIndexOf.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/lodash/_baseIndexOf.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ \"./node_modules/lodash/_baseFindIndex.js\"),\n baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ \"./node_modules/lodash/_baseIsNaN.js\"),\n strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ \"./node_modules/lodash/_strictIndexOf.js\");\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseIndexOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseIsArguments.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/lodash/_baseIsArguments.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseIsArguments.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseIsNaN.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/lodash/_baseIsNaN.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseIsNaN.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseIsTypedArray.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/lodash/_baseIsTypedArray.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isLength = __webpack_require__(/*! ./isLength */ \"./node_modules/lodash/isLength.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseIsTypedArray.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseKeys.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/lodash/_baseKeys.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\"),\n nativeKeys = __webpack_require__(/*! ./_nativeKeys */ \"./node_modules/lodash/_nativeKeys.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseKeys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseTimes.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/lodash/_baseTimes.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseTimes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_baseUnary.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/lodash/_baseUnary.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseUnary.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_freeGlobal.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/lodash/_freeGlobal.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/lodash/_freeGlobal.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_getRawTag.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/lodash/_getRawTag.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_getRawTag.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_isIndex.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/lodash/_isIndex.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_isIndex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_isPrototype.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/lodash/_isPrototype.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_isPrototype.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_nativeKeys.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/lodash/_nativeKeys.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var overArg = __webpack_require__(/*! ./_overArg */ \"./node_modules/lodash/_overArg.js\");\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_nativeKeys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_nodeUtil.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/lodash/_nodeUtil.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/lodash/_nodeUtil.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_objectToString.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/lodash/_objectToString.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_objectToString.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_overArg.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/lodash/_overArg.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_overArg.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_root.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/lodash/_root.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_root.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/_strictIndexOf.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/lodash/_strictIndexOf.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_strictIndexOf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isArguments.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/lodash/isArguments.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isArguments.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isArray.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/lodash/isArray.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isArray.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isArrayLike.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/lodash/isArrayLike.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var isFunction = __webpack_require__(/*! ./isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isLength = __webpack_require__(/*! ./isLength */ \"./node_modules/lodash/isLength.js\");\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isArrayLike.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isBuffer.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/lodash/isBuffer.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\"),\n stubFalse = __webpack_require__(/*! ./stubFalse */ \"./node_modules/lodash/stubFalse.js\");\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/lodash/isBuffer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isFunction.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/lodash/isFunction.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\");\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isFunction.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isLength.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/lodash/isLength.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isLength.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isObject.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/lodash/isObject.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isObject.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isObjectLike.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/lodash/isObjectLike.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isObjectLike.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isString.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/lodash/isString.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isString.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isTypedArray.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/lodash/isTypedArray.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ \"./node_modules/lodash/_baseIsTypedArray.js\"),\n baseUnary = __webpack_require__(/*! ./_baseUnary */ \"./node_modules/lodash/_baseUnary.js\"),\n nodeUtil = __webpack_require__(/*! ./_nodeUtil */ \"./node_modules/lodash/_nodeUtil.js\");\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isTypedArray.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/isUndefined.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/lodash/isUndefined.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nmodule.exports = isUndefined;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isUndefined.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/keys.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/lodash/keys.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ \"./node_modules/lodash/_arrayLikeKeys.js\"),\n baseKeys = __webpack_require__(/*! ./_baseKeys */ \"./node_modules/lodash/_baseKeys.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/keys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/noop.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/lodash/noop.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/noop.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash/stubFalse.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/lodash/stubFalse.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/stubFalse.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/looper/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/looper/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\nvar looper = module.exports = function (fun) {\n (function next () {\n var loop = true, returned = false, sync = false\n do {\n sync = true; loop = false\n fun.call(this, function () {\n if(sync) loop = true\n else next()\n })\n sync = false\n } while(loop)\n })()\n}\n\n\n//# sourceURL=webpack:///./node_modules/looper/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mafmt/src/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/mafmt/src/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\n\n/*\n * Valid combinations\n */\nconst DNS4 = base('dns4')\nconst DNS6 = base('dns6')\nconst _DNS = or(\n base('dnsaddr'),\n DNS4,\n DNS6\n)\n\nconst IP = or(base('ip4'), base('ip6'))\nconst TCP = or(\n and(IP, base('tcp')),\n and(_DNS, base('tcp'))\n)\nconst UDP = and(IP, base('udp'))\nconst UTP = and(UDP, base('utp'))\n\nconst DNS = or(\n and(_DNS, base('tcp')),\n _DNS\n)\n\nconst WebSockets = or(\n and(TCP, base('ws')),\n and(DNS, base('ws'))\n)\n\nconst WebSocketsSecure = or(\n and(TCP, base('wss')),\n and(DNS, base('wss'))\n)\n\nconst HTTP = or(\n and(TCP, base('http')),\n and(IP, base('http')),\n and(DNS, base('http')),\n and(DNS)\n)\n\nconst HTTPS = or(\n and(TCP, base('https')),\n and(IP, base('https')),\n and(DNS, base('https'))\n)\n\nconst WebRTCStar = or(\n and(WebSockets, base('p2p-webrtc-star'), base('ipfs')),\n and(WebSocketsSecure, base('p2p-webrtc-star'), base('ipfs'))\n)\n\nconst WebSocketStar = or(\n and(WebSockets, base('p2p-websocket-star'), base('ipfs')),\n and(WebSocketsSecure, base('p2p-websocket-star'), base('ipfs')),\n and(WebSockets, base('p2p-websocket-star')),\n and(WebSocketsSecure, base('p2p-websocket-star'))\n)\n\nconst WebRTCDirect = or(\n and(HTTP, base('p2p-webrtc-direct')),\n and(HTTPS, base('p2p-webrtc-direct'))\n)\n\nconst Reliable = or(\n WebSockets,\n WebSocketsSecure,\n HTTP,\n HTTPS,\n WebRTCStar,\n WebRTCDirect,\n TCP,\n UTP\n)\n\n// Unlike ws-star, stardust can run over any transport thus removing the requirement for websockets (but don't even think about running a stardust server over webrtc-star ;) )\nconst Stardust = or(\n and(Reliable, base('p2p-stardust'), base('ipfs')),\n and(Reliable, base('p2p-stardust'))\n)\n\nlet _IPFS = or(\n and(Reliable, base('ipfs')),\n WebRTCStar,\n base('ipfs')\n)\n\nconst _Circuit = or(\n and(_IPFS, base('p2p-circuit'), _IPFS),\n and(_IPFS, base('p2p-circuit')),\n and(base('p2p-circuit'), _IPFS),\n and(Reliable, base('p2p-circuit')),\n and(base('p2p-circuit'), Reliable),\n base('p2p-circuit')\n)\n\nconst CircuitRecursive = () => or(\n and(_Circuit, CircuitRecursive),\n _Circuit\n)\n\nconst Circuit = CircuitRecursive()\n\nconst IPFS = or(\n and(Circuit, _IPFS, Circuit),\n and(_IPFS, Circuit),\n and(Circuit, _IPFS),\n Circuit,\n _IPFS\n)\n\nexports.DNS = DNS\nexports.DNS4 = DNS4\nexports.DNS6 = DNS6\nexports.IP = IP\nexports.TCP = TCP\nexports.UDP = UDP\nexports.UTP = UTP\nexports.HTTP = HTTP\nexports.HTTPS = HTTPS\nexports.WebSockets = WebSockets\nexports.WebSocketsSecure = WebSocketsSecure\nexports.WebSocketStar = WebSocketStar\nexports.WebRTCStar = WebRTCStar\nexports.WebRTCDirect = WebRTCDirect\nexports.Reliable = Reliable\nexports.Stardust = Stardust\nexports.Circuit = Circuit\nexports.IPFS = IPFS\n\n/*\n * Validation funcs\n */\n\nfunction makeMatchesFunction (partialMatch) {\n return function matches (a) {\n if (!multiaddr.isMultiaddr(a)) {\n try {\n a = multiaddr(a)\n } catch (err) { // catch error\n return false // also if it's invalid it's propably not matching as well so return false\n }\n }\n let out = partialMatch(a.protoNames())\n if (out === null) {\n return false\n }\n return out.length === 0\n }\n}\n\nfunction and () {\n const args = Array.from(arguments)\n function partialMatch (a) {\n if (a.length < args.length) {\n return null\n }\n args.some((arg) => {\n a = typeof arg === 'function'\n ? arg().partialMatch(a)\n : arg.partialMatch(a)\n\n if (a === null) {\n return true\n }\n })\n\n return a\n }\n\n return {\n toString: function () { return '{ ' + args.join(' ') + ' }' },\n input: args,\n matches: makeMatchesFunction(partialMatch),\n partialMatch: partialMatch\n }\n}\n\nfunction or () {\n const args = Array.from(arguments)\n\n function partialMatch (a) {\n let out = null\n args.some((arg) => {\n const res = typeof arg === 'function'\n ? arg().partialMatch(a)\n : arg.partialMatch(a)\n if (res) {\n out = res\n return true\n }\n })\n\n return out\n }\n\n const result = {\n toString: function () { return '{ ' + args.join(' ') + ' }' },\n input: args,\n matches: makeMatchesFunction(partialMatch),\n partialMatch: partialMatch\n }\n\n return result\n}\n\nfunction base (n) {\n const name = n\n\n function matches (a) {\n if (typeof a === 'string') {\n try {\n a = multiaddr(a)\n } catch (err) { // catch error\n return false // also if it's invalid it's propably not matching as well so return false\n }\n }\n\n const pnames = a.protoNames()\n if (pnames.length === 1 && pnames[0] === name) {\n return true\n }\n return false\n }\n\n function partialMatch (protos) {\n if (protos.length === 0) {\n return null\n }\n\n if (protos[0] === name) {\n return protos.slice(1)\n }\n return null\n }\n\n return {\n toString: function () { return name },\n matches: matches,\n partialMatch: partialMatch\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/mafmt/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/magnet-uri/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/magnet-uri/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = magnetURIDecode\nmodule.exports.decode = magnetURIDecode\nmodule.exports.encode = magnetURIEncode\n\nconst base32 = __webpack_require__(/*! thirty-two */ \"./node_modules/thirty-two/lib/thirty-two/index.js\")\nconst uniq = __webpack_require__(/*! uniq */ \"./node_modules/uniq/uniq.js\")\n\n/**\n * Parse a magnet URI and return an object of keys/values\n *\n * @param {string} uri\n * @return {Object} parsed uri\n */\nfunction magnetURIDecode (uri) {\n const result = {}\n\n // Support 'magnet:' and 'stream-magnet:' uris\n const data = uri.split('magnet:?')[1]\n\n const params = (data && data.length >= 0)\n ? data.split('&')\n : []\n\n params.forEach(param => {\n const keyval = param.split('=')\n\n // This keyval is invalid, skip it\n if (keyval.length !== 2) return\n\n const key = keyval[0]\n let val = keyval[1]\n\n // Clean up torrent name\n if (key === 'dn') val = decodeURIComponent(val).replace(/\\+/g, ' ')\n\n // Address tracker (tr), exact source (xs), and acceptable source (as) are encoded\n // URIs, so decode them\n if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') {\n val = decodeURIComponent(val)\n }\n\n // Return keywords as an array\n if (key === 'kt') val = decodeURIComponent(val).split('+')\n\n // Cast file index (ix) to a number\n if (key === 'ix') val = Number(val)\n\n // If there are repeated parameters, return an array of values\n if (result[key]) {\n if (Array.isArray(result[key])) {\n result[key].push(val)\n } else {\n const old = result[key]\n result[key] = [old, val]\n }\n } else {\n result[key] = val\n }\n })\n\n // Convenience properties for parity with `parse-torrent-file` module\n let m\n if (result.xt) {\n const xts = Array.isArray(result.xt) ? result.xt : [ result.xt ]\n xts.forEach(xt => {\n if ((m = xt.match(/^urn:btih:(.{40})/))) {\n result.infoHash = m[1].toLowerCase()\n } else if ((m = xt.match(/^urn:btih:(.{32})/))) {\n const decodedStr = base32.decode(m[1])\n result.infoHash = Buffer.from(decodedStr, 'binary').toString('hex')\n }\n })\n }\n if (result.infoHash) result.infoHashBuffer = Buffer.from(result.infoHash, 'hex')\n\n if (result.dn) result.name = result.dn\n if (result.kt) result.keywords = result.kt\n\n if (typeof result.tr === 'string') result.announce = [ result.tr ]\n else if (Array.isArray(result.tr)) result.announce = result.tr\n else result.announce = []\n\n result.urlList = []\n if (typeof result.as === 'string' || Array.isArray(result.as)) {\n result.urlList = result.urlList.concat(result.as)\n }\n if (typeof result.ws === 'string' || Array.isArray(result.ws)) {\n result.urlList = result.urlList.concat(result.ws)\n }\n\n uniq(result.announce)\n uniq(result.urlList)\n\n return result\n}\n\nfunction magnetURIEncode (obj) {\n obj = Object.assign({}, obj) // clone obj, so we can mutate it\n\n // support using convenience names, in addition to spec names\n // (example: `infoHash` for `xt`, `name` for `dn`)\n if (obj.infoHashBuffer) obj.xt = `urn:btih:${obj.infoHashBuffer.toString('hex')}`\n if (obj.infoHash) obj.xt = `urn:btih:${obj.infoHash}`\n if (obj.name) obj.dn = obj.name\n if (obj.keywords) obj.kt = obj.keywords\n if (obj.announce) obj.tr = obj.announce\n if (obj.urlList) {\n obj.ws = obj.urlList\n delete obj.as\n }\n\n let result = 'magnet:?'\n Object.keys(obj)\n .filter(key => key.length === 2)\n .forEach((key, i) => {\n const values = Array.isArray(obj[key]) ? obj[key] : [ obj[key] ]\n values.forEach((val, j) => {\n if ((i > 0 || j > 0) && (key !== 'kt' || j === 0)) result += '&'\n\n if (key === 'dn') val = encodeURIComponent(val).replace(/%20/g, '+')\n if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') {\n val = encodeURIComponent(val)\n }\n if (key === 'kt') val = encodeURIComponent(val)\n\n if (key === 'kt' && j > 0) result += `+${val}`\n else result += `${key}=${val}`\n })\n })\n\n return result\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/magnet-uri/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/md5.js/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/md5.js/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar HashBase = __webpack_require__(/*! hash-base */ \"./node_modules/hash-base/index.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar ARRAY16 = new Array(16)\n\nfunction MD5 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n}\n\ninherits(MD5, HashBase)\n\nMD5.prototype._update = function () {\n var M = ARRAY16\n for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)\n\n var a = this._a\n var b = this._b\n var c = this._c\n var d = this._d\n\n a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)\n d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)\n c = fnF(c, d, a, b, M[2], 0x242070db, 17)\n b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)\n a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)\n d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)\n c = fnF(c, d, a, b, M[6], 0xa8304613, 17)\n b = fnF(b, c, d, a, M[7], 0xfd469501, 22)\n a = fnF(a, b, c, d, M[8], 0x698098d8, 7)\n d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)\n c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)\n b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)\n a = fnF(a, b, c, d, M[12], 0x6b901122, 7)\n d = fnF(d, a, b, c, M[13], 0xfd987193, 12)\n c = fnF(c, d, a, b, M[14], 0xa679438e, 17)\n b = fnF(b, c, d, a, M[15], 0x49b40821, 22)\n\n a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)\n d = fnG(d, a, b, c, M[6], 0xc040b340, 9)\n c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)\n b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)\n a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)\n d = fnG(d, a, b, c, M[10], 0x02441453, 9)\n c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)\n b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)\n a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)\n d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)\n c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)\n b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)\n a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)\n d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)\n c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)\n b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)\n\n a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)\n d = fnH(d, a, b, c, M[8], 0x8771f681, 11)\n c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)\n b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)\n a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)\n d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)\n c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)\n b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)\n a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)\n d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)\n c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)\n b = fnH(b, c, d, a, M[6], 0x04881d05, 23)\n a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)\n d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)\n c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)\n b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)\n\n a = fnI(a, b, c, d, M[0], 0xf4292244, 6)\n d = fnI(d, a, b, c, M[7], 0x432aff97, 10)\n c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)\n b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)\n a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)\n d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)\n c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)\n b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)\n a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)\n d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)\n c = fnI(c, d, a, b, M[6], 0xa3014314, 15)\n b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)\n a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)\n d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)\n c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)\n b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)\n\n this._a = (this._a + a) | 0\n this._b = (this._b + b) | 0\n this._c = (this._c + c) | 0\n this._d = (this._d + d) | 0\n}\n\nMD5.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.allocUnsafe(16)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fnF (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnG (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnH (a, b, c, d, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnI (a, b, c, d, m, k, s) {\n return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0\n}\n\nmodule.exports = MD5\n\n\n//# sourceURL=webpack:///./node_modules/md5.js/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mediasource/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/mediasource/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = MediaElementWrapper\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nvar toArrayBuffer = __webpack_require__(/*! to-arraybuffer */ \"./node_modules/to-arraybuffer/index.js\")\n\nvar MediaSource = typeof window !== 'undefined' && window.MediaSource\n\nvar DEFAULT_BUFFER_DURATION = 60 // seconds\n\nfunction MediaElementWrapper (elem, opts) {\n var self = this\n if (!(self instanceof MediaElementWrapper)) return new MediaElementWrapper(elem, opts)\n\n if (!MediaSource) throw new Error('web browser lacks MediaSource support')\n\n if (!opts) opts = {}\n self._debug = opts.debug\n self._bufferDuration = opts.bufferDuration || DEFAULT_BUFFER_DURATION\n self._elem = elem\n self._mediaSource = new MediaSource()\n self._streams = []\n self.detailedError = null\n\n self._errorHandler = function () {\n self._elem.removeEventListener('error', self._errorHandler)\n var streams = self._streams.slice()\n streams.forEach(function (stream) {\n stream.destroy(self._elem.error)\n })\n }\n self._elem.addEventListener('error', self._errorHandler)\n\n self._elem.src = window.URL.createObjectURL(self._mediaSource)\n}\n\n/*\n * `obj` can be a previous value returned by this function\n * or a string\n */\nMediaElementWrapper.prototype.createWriteStream = function (obj) {\n var self = this\n\n return new MediaSourceStream(self, obj)\n}\n\n/*\n * Use to trigger an error on the underlying media element\n */\nMediaElementWrapper.prototype.error = function (err) {\n var self = this\n\n // be careful not to overwrite any existing detailedError values\n if (!self.detailedError) {\n self.detailedError = err\n }\n self._dumpDebugData()\n try {\n self._mediaSource.endOfStream('decode')\n } catch (err) {}\n\n try {\n // Attempt to clean up object URL\n window.URL.revokeObjectURL(self._elem.src)\n } catch (err) {}\n}\n\n/*\n * When self._debug is set, dump all data to files\n */\nMediaElementWrapper.prototype._dumpDebugData = function () {\n var self = this\n\n if (self._debug) {\n self._debug = false // prevent multiple dumps on multiple errors\n self._streams.forEach(function (stream, i) {\n downloadBuffers(stream._debugBuffers, 'mediasource-stream-' + i)\n })\n }\n}\n\ninherits(MediaSourceStream, stream.Writable)\n\nfunction MediaSourceStream (wrapper, obj) {\n var self = this\n stream.Writable.call(self)\n\n self._wrapper = wrapper\n self._elem = wrapper._elem\n self._mediaSource = wrapper._mediaSource\n self._allStreams = wrapper._streams\n self._allStreams.push(self)\n self._bufferDuration = wrapper._bufferDuration\n self._sourceBuffer = null\n self._debugBuffers = []\n\n self._openHandler = function () {\n self._onSourceOpen()\n }\n self._flowHandler = function () {\n self._flow()\n }\n self._errorHandler = function (err) {\n if (!self.destroyed) {\n self.emit('error', err)\n }\n }\n\n if (typeof obj === 'string') {\n self._type = obj\n // Need to create a new sourceBuffer\n if (self._mediaSource.readyState === 'open') {\n self._createSourceBuffer()\n } else {\n self._mediaSource.addEventListener('sourceopen', self._openHandler)\n }\n } else if (obj._sourceBuffer === null) {\n obj.destroy()\n self._type = obj._type // The old stream was created but hasn't finished initializing\n self._mediaSource.addEventListener('sourceopen', self._openHandler)\n } else if (obj._sourceBuffer) {\n obj.destroy()\n self._type = obj._type\n self._sourceBuffer = obj._sourceBuffer // Copy over the old sourceBuffer\n self._debugBuffers = obj._debugBuffers // Copy over previous debug data\n self._sourceBuffer.addEventListener('updateend', self._flowHandler)\n self._sourceBuffer.addEventListener('error', self._errorHandler)\n } else {\n throw new Error('The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function')\n }\n\n self._elem.addEventListener('timeupdate', self._flowHandler)\n\n self.on('error', function (err) {\n self._wrapper.error(err)\n })\n\n self.on('finish', function () {\n if (self.destroyed) return\n self._finished = true\n if (self._allStreams.every(function (other) { return other._finished })) {\n self._wrapper._dumpDebugData()\n try {\n self._mediaSource.endOfStream()\n } catch (err) {}\n }\n })\n}\n\nMediaSourceStream.prototype._onSourceOpen = function () {\n var self = this\n if (self.destroyed) return\n\n self._mediaSource.removeEventListener('sourceopen', self._openHandler)\n self._createSourceBuffer()\n}\n\nMediaSourceStream.prototype.destroy = function (err) {\n var self = this\n if (self.destroyed) return\n self.destroyed = true\n\n // Remove from allStreams\n self._allStreams.splice(self._allStreams.indexOf(self), 1)\n\n self._mediaSource.removeEventListener('sourceopen', self._openHandler)\n self._elem.removeEventListener('timeupdate', self._flowHandler)\n if (self._sourceBuffer) {\n self._sourceBuffer.removeEventListener('updateend', self._flowHandler)\n self._sourceBuffer.removeEventListener('error', self._errorHandler)\n if (self._mediaSource.readyState === 'open') {\n self._sourceBuffer.abort()\n }\n }\n\n if (err) self.emit('error', err)\n self.emit('close')\n}\n\nMediaSourceStream.prototype._createSourceBuffer = function () {\n var self = this\n if (self.destroyed) return\n\n if (MediaSource.isTypeSupported(self._type)) {\n self._sourceBuffer = self._mediaSource.addSourceBuffer(self._type)\n self._sourceBuffer.addEventListener('updateend', self._flowHandler)\n self._sourceBuffer.addEventListener('error', self._errorHandler)\n if (self._cb) {\n var cb = self._cb\n self._cb = null\n cb()\n }\n } else {\n self.destroy(new Error('The provided type is not supported'))\n }\n}\n\nMediaSourceStream.prototype._write = function (chunk, encoding, cb) {\n var self = this\n if (self.destroyed) return\n if (!self._sourceBuffer) {\n self._cb = function (err) {\n if (err) return cb(err)\n self._write(chunk, encoding, cb)\n }\n return\n }\n\n if (self._sourceBuffer.updating) {\n return cb(new Error('Cannot append buffer while source buffer updating'))\n }\n\n var arr = toArrayBuffer(chunk)\n if (self._wrapper._debug) {\n self._debugBuffers.push(arr)\n }\n\n try {\n self._sourceBuffer.appendBuffer(arr)\n } catch (err) {\n // appendBuffer can throw for a number of reasons, most notably when the data\n // being appended is invalid or if appendBuffer is called after another error\n // already occurred on the media element. In Chrome, there may be useful debugging\n // info in chrome://media-internals\n self.destroy(err)\n return\n }\n self._cb = cb\n}\n\nMediaSourceStream.prototype._flow = function () {\n var self = this\n\n if (self.destroyed || !self._sourceBuffer || self._sourceBuffer.updating) {\n return\n }\n\n if (self._mediaSource.readyState === 'open') {\n // check buffer size\n if (self._getBufferDuration() > self._bufferDuration) {\n return\n }\n }\n\n if (self._cb) {\n var cb = self._cb\n self._cb = null\n cb()\n }\n}\n\n// TODO: if zero actually works in all browsers, remove the logic associated with this below\nvar EPSILON = 0\n\nMediaSourceStream.prototype._getBufferDuration = function () {\n var self = this\n\n var buffered = self._sourceBuffer.buffered\n var currentTime = self._elem.currentTime\n var bufferEnd = -1 // end of the buffer\n // This is a little over complex because some browsers seem to separate the\n // buffered region into multiple sections with slight gaps.\n for (var i = 0; i < buffered.length; i++) {\n var start = buffered.start(i)\n var end = buffered.end(i) + EPSILON\n\n if (start > currentTime) {\n // Reached past the joined buffer\n break\n } else if (bufferEnd >= 0 || currentTime <= end) {\n // Found the start/continuation of the joined buffer\n bufferEnd = end\n }\n }\n\n var bufferedTime = bufferEnd - currentTime\n if (bufferedTime < 0) {\n bufferedTime = 0\n }\n\n return bufferedTime\n}\n\nfunction downloadBuffers (bufs, name) {\n var a = document.createElement('a')\n a.href = window.URL.createObjectURL(new window.Blob(bufs))\n a.download = name\n a.click()\n}\n\n\n//# sourceURL=webpack:///./node_modules/mediasource/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/memory-chunk-store/index.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/memory-chunk-store/index.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {module.exports = Storage\n\nfunction Storage (chunkLength, opts) {\n if (!(this instanceof Storage)) return new Storage(chunkLength, opts)\n if (!opts) opts = {}\n\n this.chunkLength = Number(chunkLength)\n if (!this.chunkLength) throw new Error('First argument must be a chunk length')\n\n this.chunks = []\n this.closed = false\n this.length = Number(opts.length) || Infinity\n\n if (this.length !== Infinity) {\n this.lastChunkLength = (this.length % this.chunkLength) || this.chunkLength\n this.lastChunkIndex = Math.ceil(this.length / this.chunkLength) - 1\n }\n}\n\nStorage.prototype.put = function (index, buf, cb) {\n if (this.closed) return nextTick(cb, new Error('Storage is closed'))\n\n var isLastChunk = (index === this.lastChunkIndex)\n if (isLastChunk && buf.length !== this.lastChunkLength) {\n return nextTick(cb, new Error('Last chunk length must be ' + this.lastChunkLength))\n }\n if (!isLastChunk && buf.length !== this.chunkLength) {\n return nextTick(cb, new Error('Chunk length must be ' + this.chunkLength))\n }\n this.chunks[index] = buf\n nextTick(cb, null)\n}\n\nStorage.prototype.get = function (index, opts, cb) {\n if (typeof opts === 'function') return this.get(index, null, opts)\n if (this.closed) return nextTick(cb, new Error('Storage is closed'))\n var buf = this.chunks[index]\n if (!buf) {\n var err = new Error('Chunk not found')\n err.notFound = true\n return nextTick(cb, err)\n }\n if (!opts) return nextTick(cb, null, buf)\n var offset = opts.offset || 0\n var len = opts.length || (buf.length - offset)\n nextTick(cb, null, buf.slice(offset, len + offset))\n}\n\nStorage.prototype.close = Storage.prototype.destroy = function (cb) {\n if (this.closed) return nextTick(cb, new Error('Storage is closed'))\n this.closed = true\n this.chunks = null\n nextTick(cb, null)\n}\n\nfunction nextTick (cb, err, val) {\n process.nextTick(function () {\n if (cb) cb(err, val)\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/memory-chunk-store/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mime-db/db.json":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/mime-db/db.json ***!
|
||
\**************************************/
|
||
/*! exports provided: application/1d-interleaved-parityfec, application/3gpdash-qoe-report+xml, application/3gpp-ims+xml, application/a2l, application/activemessage, application/activity+json, application/alto-costmap+json, application/alto-costmapfilter+json, application/alto-directory+json, application/alto-endpointcost+json, application/alto-endpointcostparams+json, application/alto-endpointprop+json, application/alto-endpointpropparams+json, application/alto-error+json, application/alto-networkmap+json, application/alto-networkmapfilter+json, application/aml, application/andrew-inset, application/applefile, application/applixware, application/atf, application/atfx, application/atom+xml, application/atomcat+xml, application/atomdeleted+xml, application/atomicmail, application/atomsvc+xml, application/atsc-dwd+xml, application/atsc-held+xml, application/atsc-rsat+xml, application/atxml, application/auth-policy+xml, application/bacnet-xdd+zip, application/batch-smtp, application/bdoc, application/beep+xml, application/calendar+json, application/calendar+xml, application/call-completion, application/cals-1840, application/cbor, application/cccex, application/ccmp+xml, application/ccxml+xml, application/cdfx+xml, application/cdmi-capability, application/cdmi-container, application/cdmi-domain, application/cdmi-object, application/cdmi-queue, application/cdni, application/cea, application/cea-2018+xml, application/cellml+xml, application/cfw, application/clue_info+xml, application/cms, application/cnrp+xml, application/coap-group+json, application/coap-payload, application/commonground, application/conference-info+xml, application/cose, application/cose-key, application/cose-key-set, application/cpl+xml, application/csrattrs, application/csta+xml, application/cstadata+xml, application/csvm+json, application/cu-seeme, application/cwt, application/cybercash, application/dart, application/dash+xml, application/dashdelta, application/davmount+xml, application/dca-rft, application/dcd, application/dec-dx, application/dialog-info+xml, application/dicom, application/dicom+json, application/dicom+xml, application/dii, application/dit, application/dns, application/dns+json, application/dns-message, application/docbook+xml, application/dskpp+xml, application/dssc+der, application/dssc+xml, application/dvcs, application/ecmascript, application/edi-consent, application/edi-x12, application/edifact, application/efi, application/emergencycalldata.comment+xml, application/emergencycalldata.control+xml, application/emergencycalldata.deviceinfo+xml, application/emergencycalldata.ecall.msd, application/emergencycalldata.providerinfo+xml, application/emergencycalldata.serviceinfo+xml, application/emergencycalldata.subscriberinfo+xml, application/emergencycalldata.veds+xml, application/emma+xml, application/emotionml+xml, application/encaprtp, application/epp+xml, application/epub+zip, application/eshop, application/exi, application/expect-ct-report+json, application/fastinfoset, application/fastsoap, application/fdt+xml, application/fhir+json, application/fhir+xml, application/fido.trusted-apps+json, application/fits, application/font-sfnt, application/font-tdpfr, application/font-woff, application/framework-attributes+xml, application/geo+json, application/geo+json-seq, application/geopackage+sqlite3, application/geoxacml+xml, application/gltf-buffer, application/gml+xml, application/gpx+xml, application/gxf, application/gzip, application/h224, application/held+xml, application/hjson, application/http, application/hyperstudio, application/ibe-key-request+xml, application/ibe-pkg-reply+xml, application/ibe-pp-data, application/iges, application/im-iscomposing+xml, application/index, application/index.cmd, application/index.obj, application/index.response, application/index.vnd, application/inkml+xml, application/iotp, application/ipfix, application/ipp, application/isup, application/its+xml, application/java-archive, application/java-serialized-object, application/java-vm, application/javascript, application/jf2feed+json, application/jose, application/jose+json, application/jrd+json, application/json, application/json-patch+json, application/json-seq, application/json5, application/jsonml+json, application/jwk+json, application/jwk-set+json, application/jwt, application/kpml-request+xml, application/kpml-response+xml, application/ld+json, application/lgr+xml, application/link-format, application/load-control+xml, application/lost+xml, application/lostsync+xml, application/lxf, application/mac-binhex40, application/mac-compactpro, application/macwriteii, application/mads+xml, application/manifest+json, application/marc, application/marcxml+xml, application/mathematica, application/mathml+xml, application/mathml-content+xml, application/mathml-presentation+xml, application/mbms-associated-procedure-description+xml, application/mbms-deregister+xml, application/mbms-envelope+xml, application/mbms-msk+xml, application/mbms-msk-response+xml, application/mbms-protection-description+xml, application/mbms-reception-report+xml, application/mbms-register+xml, application/mbms-register-response+xml, application/mbms-schedule+xml, application/mbms-user-service-description+xml, application/mbox, application/media-policy-dataset+xml, application/media_control+xml, application/mediaservercontrol+xml, application/merge-patch+json, application/metalink+xml, application/metalink4+xml, application/mets+xml, application/mf4, application/mikey, application/mmt-aei+xml, application/mmt-usd+xml, application/mods+xml, application/moss-keys, application/moss-signature, application/mosskey-data, application/mosskey-request, application/mp21, application/mp4, application/mpeg4-generic, application/mpeg4-iod, application/mpeg4-iod-xmt, application/mrb-consumer+xml, application/mrb-publish+xml, application/msc-ivr+xml, application/msc-mixer+xml, application/msword, application/mud+json, application/mxf, application/n-quads, application/n-triples, application/nasdata, application/news-checkgroups, application/news-groupinfo, application/news-transmission, application/nlsml+xml, application/node, application/nss, application/ocsp-request, application/ocsp-response, application/octet-stream, application/oda, application/odm+xml, application/odx, application/oebps-package+xml, application/ogg, application/omdoc+xml, application/onenote, application/oscore, application/oxps, application/p2p-overlay+xml, application/parityfec, application/passport, application/patch-ops-error+xml, application/pdf, application/pdx, application/pem-certificate-chain, application/pgp-encrypted, application/pgp-keys, application/pgp-signature, application/pics-rules, application/pidf+xml, application/pidf-diff+xml, application/pkcs10, application/pkcs12, application/pkcs7-mime, application/pkcs7-signature, application/pkcs8, application/pkcs8-encrypted, application/pkix-attr-cert, application/pkix-cert, application/pkix-crl, application/pkix-pkipath, application/pkixcmp, application/pls+xml, application/poc-settings+xml, application/postscript, application/ppsp-tracker+json, application/problem+json, application/problem+xml, application/provenance+xml, application/prs.alvestrand.titrax-sheet, application/prs.cww, application/prs.hpub+zip, application/prs.nprend, application/prs.plucker, application/prs.rdf-xml-crypt, application/prs.xsf+xml, application/pskc+xml, application/qsig, application/raml+yaml, application/raptorfec, application/rdap+json, application/rdf+xml, application/reginfo+xml, application/relax-ng-compact-syntax, application/remote-printing, application/reputon+json, application/resource-lists+xml, application/resource-lists-diff+xml, application/rfc+xml, application/riscos, application/rlmi+xml, application/rls-services+xml, application/route-apd+xml, application/route-s-tsid+xml, application/route-usd+xml, application/rpki-ghostbusters, application/rpki-manifest, application/rpki-publication, application/rpki-roa, application/rpki-updown, application/rsd+xml, application/rss+xml, application/rtf, application/rtploopback, application/rtx, application/samlassertion+xml, application/samlmetadata+xml, application/sbml+xml, application/scaip+xml, application/scim+json, application/scvp-cv-request, application/scvp-cv-response, application/scvp-vp-request, application/scvp-vp-response, application/sdp, application/secevent+jwt, application/senml+cbor, application/senml+json, application/senml+xml, application/senml-exi, application/sensml+cbor, application/sensml+json, application/sensml+xml, application/sensml-exi, application/sep+xml, application/sep-exi, application/session-info, application/set-payment, application/set-payment-initiation, application/set-registration, application/set-registration-initiation, application/sgml, application/sgml-open-catalog, application/shf+xml, application/sieve, application/simple-filter+xml, application/simple-message-summary, application/simplesymbolcontainer, application/slate, application/smil, application/smil+xml, application/smpte336m, application/soap+fastinfoset, application/soap+xml, application/sparql-query, application/sparql-results+xml, application/spirits-event+xml, application/sql, application/srgs, application/srgs+xml, application/sru+xml, application/ssdl+xml, application/ssml+xml, application/stix+json, application/tamp-apex-update, application/tamp-apex-update-confirm, application/tamp-community-update, application/tamp-community-update-confirm, application/tamp-error, application/tamp-sequence-adjust, application/tamp-sequence-adjust-confirm, application/tamp-status-query, application/tamp-status-response, application/tamp-update, application/tamp-update-confirm, application/tar, application/taxii+json, application/tei+xml, application/tetra_isi, application/thraud+xml, application/timestamp-query, application/timestamp-reply, application/timestamped-data, application/tlsrpt+gzip, application/tlsrpt+json, application/tnauthlist, application/trickle-ice-sdpfrag, application/trig, application/ttml+xml, application/tve-trigger, application/tzif, application/tzif-leap, application/ulpfec, application/urc-grpsheet+xml, application/urc-ressheet+xml, application/urc-targetdesc+xml, application/urc-uisocketdesc+xml, application/vcard+json, application/vcard+xml, application/vemmi, application/vividence.scriptfile, application/vnd.1000minds.decision-model+xml, application/vnd.3gpp-prose+xml, application/vnd.3gpp-prose-pc3ch+xml, application/vnd.3gpp-v2x-local-service-information, application/vnd.3gpp.access-transfer-events+xml, application/vnd.3gpp.bsf+xml, application/vnd.3gpp.gmop+xml, application/vnd.3gpp.mc-signalling-ear, application/vnd.3gpp.mcdata-affiliation-command+xml, application/vnd.3gpp.mcdata-info+xml, application/vnd.3gpp.mcdata-payload, application/vnd.3gpp.mcdata-service-config+xml, application/vnd.3gpp.mcdata-signalling, application/vnd.3gpp.mcdata-ue-config+xml, application/vnd.3gpp.mcdata-user-profile+xml, application/vnd.3gpp.mcptt-affiliation-command+xml, application/vnd.3gpp.mcptt-floor-request+xml, application/vnd.3gpp.mcptt-info+xml, application/vnd.3gpp.mcptt-location-info+xml, application/vnd.3gpp.mcptt-mbms-usage-info+xml, application/vnd.3gpp.mcptt-service-config+xml, application/vnd.3gpp.mcptt-signed+xml, application/vnd.3gpp.mcptt-ue-config+xml, application/vnd.3gpp.mcptt-ue-init-config+xml, application/vnd.3gpp.mcptt-user-profile+xml, application/vnd.3gpp.mcvideo-affiliation-command+xml, application/vnd.3gpp.mcvideo-affiliation-info+xml, application/vnd.3gpp.mcvideo-location-info+xml, application/vnd.3gpp.mcvideo-mbms-usage-info+xml, application/vnd.3gpp.mcvideo-service-config+xml, application/vnd.3gpp.mcvideo-transmission-request+xml, application/vnd.3gpp.mcvideo-ue-config+xml, application/vnd.3gpp.mcvideo-user-profile+xml, application/vnd.3gpp.mid-call+xml, application/vnd.3gpp.pic-bw-large, application/vnd.3gpp.pic-bw-small, application/vnd.3gpp.pic-bw-var, application/vnd.3gpp.sms, application/vnd.3gpp.sms+xml, application/vnd.3gpp.srvcc-ext+xml, application/vnd.3gpp.srvcc-info+xml, application/vnd.3gpp.state-and-event-info+xml, application/vnd.3gpp.ussd+xml, application/vnd.3gpp2.bcmcsinfo+xml, application/vnd.3gpp2.sms, application/vnd.3gpp2.tcap, application/vnd.3lightssoftware.imagescal, application/vnd.3m.post-it-notes, application/vnd.accpac.simply.aso, application/vnd.accpac.simply.imp, application/vnd.acucobol, application/vnd.acucorp, application/vnd.adobe.air-application-installer-package+zip, application/vnd.adobe.flash.movie, application/vnd.adobe.formscentral.fcdt, application/vnd.adobe.fxp, application/vnd.adobe.partial-upload, application/vnd.adobe.xdp+xml, application/vnd.adobe.xfdf, application/vnd.aether.imp, application/vnd.afpc.afplinedata, application/vnd.afpc.modca, application/vnd.ah-barcode, application/vnd.ahead.space, application/vnd.airzip.filesecure.azf, application/vnd.airzip.filesecure.azs, application/vnd.amadeus+json, application/vnd.amazon.ebook, application/vnd.amazon.mobi8-ebook, application/vnd.americandynamics.acc, application/vnd.amiga.ami, application/vnd.amundsen.maze+xml, application/vnd.android.package-archive, application/vnd.anki, application/vnd.anser-web-certificate-issue-initiation, application/vnd.anser-web-funds-transfer-initiation, application/vnd.antix.game-component, application/vnd.apache.thrift.binary, application/vnd.apache.thrift.compact, application/vnd.apache.thrift.json, application/vnd.api+json, application/vnd.apothekende.reservation+json, application/vnd.apple.installer+xml, application/vnd.apple.keynote, application/vnd.apple.mpegurl, application/vnd.apple.numbers, application/vnd.apple.pages, application/vnd.apple.pkpass, application/vnd.arastra.swi, application/vnd.aristanetworks.swi, application/vnd.artisan+json, application/vnd.artsquare, application/vnd.astraea-software.iota, application/vnd.audiograph, application/vnd.autopackage, application/vnd.avalon+json, application/vnd.avistar+xml, application/vnd.balsamiq.bmml+xml, application/vnd.balsamiq.bmpr, application/vnd.banana-accounting, application/vnd.bbf.usp.msg, application/vnd.bbf.usp.msg+json, application/vnd.bekitzur-stech+json, application/vnd.bint.med-content, application/vnd.biopax.rdf+xml, application/vnd.blink-idb-value-wrapper, application/vnd.blueice.multipass, application/vnd.bluetooth.ep.oob, application/vnd.bluetooth.le.oob, application/vnd.bmi, application/vnd.businessobjects, application/vnd.byu.uapi+json, application/vnd.cab-jscript, application/vnd.canon-cpdl, application/vnd.canon-lips, application/vnd.capasystems-pg+json, application/vnd.cendio.thinlinc.clientconf, application/vnd.century-systems.tcp_stream, application/vnd.chemdraw+xml, application/vnd.chess-pgn, application/vnd.chipnuts.karaoke-mmd, application/vnd.cinderella, application/vnd.cirpack.isdn-ext, application/vnd.citationstyles.style+xml, application/vnd.claymore, application/vnd.cloanto.rp9, application/vnd.clonk.c4group, application/vnd.cluetrust.cartomobile-config, application/vnd.cluetrust.cartomobile-config-pkg, application/vnd.coffeescript, application/vnd.collabio.xodocuments.document, application/vnd.collabio.xodocuments.document-template, application/vnd.collabio.xodocuments.presentation, application/vnd.collabio.xodocuments.presentation-template, application/vnd.collabio.xodocuments.spreadsheet, application/vnd.collabio.xodocuments.spreadsheet-template, application/vnd.collection+json, application/vnd.collection.doc+json, application/vnd.collection.next+json, application/vnd.comicbook+zip, application/vnd.comicbook-rar, application/vnd.commerce-battelle, application/vnd.commonspace, application/vnd.contact.cmsg, application/vnd.coreos.ignition+json, application/vnd.cosmocaller, application/vnd.crick.clicker, application/vnd.crick.clicker.keyboard, application/vnd.crick.clicker.palette, application/vnd.crick.clicker.template, application/vnd.crick.clicker.wordbank, application/vnd.criticaltools.wbs+xml, application/vnd.ctc-posml, application/vnd.ctct.ws+xml, application/vnd.cups-pdf, application/vnd.cups-postscript, application/vnd.cups-ppd, application/vnd.cups-raster, application/vnd.cups-raw, application/vnd.curl, application/vnd.curl.car, application/vnd.curl.pcurl, application/vnd.cyan.dean.root+xml, application/vnd.cybank, application/vnd.d2l.coursepackage1p0+zip, application/vnd.dart, application/vnd.data-vision.rdz, application/vnd.datapackage+json, application/vnd.dataresource+json, application/vnd.debian.binary-package, application/vnd.dece.data, application/vnd.dece.ttml+xml, application/vnd.dece.unspecified, application/vnd.dece.zip, application/vnd.denovo.fcselayout-link, application/vnd.desmume.movie, application/vnd.dir-bi.plate-dl-nosuffix, application/vnd.dm.delegation+xml, application/vnd.dna, application/vnd.document+json, application/vnd.dolby.mlp, application/vnd.dolby.mobile.1, application/vnd.dolby.mobile.2, application/vnd.doremir.scorecloud-binary-document, application/vnd.dpgraph, application/vnd.dreamfactory, application/vnd.drive+json, application/vnd.ds-keypoint, application/vnd.dtg.local, application/vnd.dtg.local.flash, application/vnd.dtg.local.html, application/vnd.dvb.ait, application/vnd.dvb.dvbj, application/vnd.dvb.esgcontainer, application/vnd.dvb.ipdcdftnotifaccess, application/vnd.dvb.ipdcesgaccess, application/vnd.dvb.ipdcesgaccess2, application/vnd.dvb.ipdcesgpdd, application/vnd.dvb.ipdcroaming, application/vnd.dvb.iptv.alfec-base, application/vnd.dvb.iptv.alfec-enhancement, application/vnd.dvb.notif-aggregate-root+xml, application/vnd.dvb.notif-container+xml, application/vnd.dvb.notif-generic+xml, application/vnd.dvb.notif-ia-msglist+xml, application/vnd.dvb.notif-ia-registration-request+xml, application/vnd.dvb.notif-ia-registration-response+xml, application/vnd.dvb.notif-init+xml, application/vnd.dvb.pfr, application/vnd.dvb.service, application/vnd.dxr, application/vnd.dynageo, application/vnd.dzr, application/vnd.easykaraoke.cdgdownload, application/vnd.ecdis-update, application/vnd.ecip.rlp, application/vnd.ecowin.chart, application/vnd.ecowin.filerequest, application/vnd.ecowin.fileupdate, application/vnd.ecowin.series, application/vnd.ecowin.seriesrequest, application/vnd.ecowin.seriesupdate, application/vnd.efi.img, application/vnd.efi.iso, application/vnd.emclient.accessrequest+xml, application/vnd.enliven, application/vnd.enphase.envoy, application/vnd.eprints.data+xml, application/vnd.epson.esf, application/vnd.epson.msf, application/vnd.epson.quickanime, application/vnd.epson.salt, application/vnd.epson.ssf, application/vnd.ericsson.quickcall, application/vnd.espass-espass+zip, application/vnd.eszigno3+xml, application/vnd.etsi.aoc+xml, application/vnd.etsi.asic-e+zip, application/vnd.etsi.asic-s+zip, application/vnd.etsi.cug+xml, application/vnd.etsi.iptvcommand+xml, application/vnd.etsi.iptvdiscovery+xml, application/vnd.etsi.iptvprofile+xml, application/vnd.etsi.iptvsad-bc+xml, application/vnd.etsi.iptvsad-cod+xml, application/vnd.etsi.iptvsad-npvr+xml, application/vnd.etsi.iptvservice+xml, application/vnd.etsi.iptvsync+xml, application/vnd.etsi.iptvueprofile+xml, application/vnd.etsi.mcid+xml, application/vnd.etsi.mheg5, application/vnd.etsi.overload-control-policy-dataset+xml, application/vnd.etsi.pstn+xml, application/vnd.etsi.sci+xml, application/vnd.etsi.simservs+xml, application/vnd.etsi.timestamp-token, application/vnd.etsi.tsl+xml, application/vnd.etsi.tsl.der, application/vnd.eudora.data, application/vnd.evolv.ecig.profile, application/vnd.evolv.ecig.settings, application/vnd.evolv.ecig.theme, application/vnd.exstream-empower+zip, application/vnd.exstream-package, application/vnd.ezpix-album, application/vnd.ezpix-package, application/vnd.f-secure.mobile, application/vnd.fastcopy-disk-image, application/vnd.fdf, application/vnd.fdsn.mseed, application/vnd.fdsn.seed, application/vnd.ffsns, application/vnd.filmit.zfc, application/vnd.fints, application/vnd.firemonkeys.cloudcell, application/vnd.flographit, application/vnd.fluxtime.clip, application/vnd.font-fontforge-sfd, application/vnd.framemaker, application/vnd.frogans.fnc, application/vnd.frogans.ltf, application/vnd.fsc.weblaunch, application/vnd.fujitsu.oasys, application/vnd.fujitsu.oasys2, application/vnd.fujitsu.oasys3, application/vnd.fujitsu.oasysgp, application/vnd.fujitsu.oasysprs, application/vnd.fujixerox.art-ex, application/vnd.fujixerox.art4, application/vnd.fujixerox.ddd, application/vnd.fujixerox.docuworks, application/vnd.fujixerox.docuworks.binder, application/vnd.fujixerox.docuworks.container, application/vnd.fujixerox.hbpl, application/vnd.fut-misnet, application/vnd.futoin+cbor, application/vnd.futoin+json, application/vnd.fuzzysheet, application/vnd.genomatix.tuxedo, application/vnd.geo+json, application/vnd.geocube+xml, application/vnd.geogebra.file, application/vnd.geogebra.tool, application/vnd.geometry-explorer, application/vnd.geonext, application/vnd.geoplan, application/vnd.geospace, application/vnd.gerber, application/vnd.globalplatform.card-content-mgt, application/vnd.globalplatform.card-content-mgt-response, application/vnd.gmx, application/vnd.google-apps.document, application/vnd.google-apps.presentation, application/vnd.google-apps.spreadsheet, application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, application/vnd.gov.sk.e-form+xml, application/vnd.gov.sk.e-form+zip, application/vnd.gov.sk.xmldatacontainer+xml, application/vnd.grafeq, application/vnd.gridmp, application/vnd.groove-account, application/vnd.groove-help, application/vnd.groove-identity-message, application/vnd.groove-injector, application/vnd.groove-tool-message, application/vnd.groove-tool-template, application/vnd.groove-vcard, application/vnd.hal+json, application/vnd.hal+xml, application/vnd.handheld-entertainment+xml, application/vnd.hbci, application/vnd.hc+json, application/vnd.hcl-bireports, application/vnd.hdt, application/vnd.heroku+json, application/vnd.hhe.lesson-player, application/vnd.hp-hpgl, application/vnd.hp-hpid, application/vnd.hp-hps, application/vnd.hp-jlyt, application/vnd.hp-pcl, application/vnd.hp-pclxl, application/vnd.httphone, application/vnd.hydrostatix.sof-data, application/vnd.hyper+json, application/vnd.hyper-item+json, application/vnd.hyperdrive+json, application/vnd.hzn-3d-crossword, application/vnd.ibm.afplinedata, application/vnd.ibm.electronic-media, application/vnd.ibm.minipay, application/vnd.ibm.modcap, application/vnd.ibm.rights-management, application/vnd.ibm.secure-container, application/vnd.iccprofile, application/vnd.ieee.1905, application/vnd.igloader, application/vnd.imagemeter.folder+zip, application/vnd.imagemeter.image+zip, application/vnd.immervision-ivp, application/vnd.immervision-ivu, application/vnd.ims.imsccv1p1, application/vnd.ims.imsccv1p2, application/vnd.ims.imsccv1p3, application/vnd.ims.lis.v2.result+json, application/vnd.ims.lti.v2.toolconsumerprofile+json, application/vnd.ims.lti.v2.toolproxy+json, application/vnd.ims.lti.v2.toolproxy.id+json, application/vnd.ims.lti.v2.toolsettings+json, application/vnd.ims.lti.v2.toolsettings.simple+json, application/vnd.informedcontrol.rms+xml, application/vnd.informix-visionary, application/vnd.infotech.project, application/vnd.infotech.project+xml, application/vnd.innopath.wamp.notification, application/vnd.insors.igm, application/vnd.intercon.formnet, application/vnd.intergeo, application/vnd.intertrust.digibox, application/vnd.intertrust.nncp, application/vnd.intu.qbo, application/vnd.intu.qfx, application/vnd.iptc.g2.catalogitem+xml, application/vnd.iptc.g2.conceptitem+xml, application/vnd.iptc.g2.knowledgeitem+xml, application/vnd.iptc.g2.newsitem+xml, application/vnd.iptc.g2.newsmessage+xml, application/vnd.iptc.g2.packageitem+xml, application/vnd.iptc.g2.planningitem+xml, application/vnd.ipunplugged.rcprofile, application/vnd.irepository.package+xml, application/vnd.is-xpr, application/vnd.isac.fcs, application/vnd.jam, application/vnd.japannet-directory-service, application/vnd.japannet-jpnstore-wakeup, application/vnd.japannet-payment-wakeup, application/vnd.japannet-registration, application/vnd.japannet-registration-wakeup, application/vnd.japannet-setstore-wakeup, application/vnd.japannet-verification, application/vnd.japannet-verification-wakeup, application/vnd.jcp.javame.midlet-rms, application/vnd.jisp, application/vnd.joost.joda-archive, application/vnd.jsk.isdn-ngn, application/vnd.kahootz, application/vnd.kde.karbon, application/vnd.kde.kchart, application/vnd.kde.kformula, application/vnd.kde.kivio, application/vnd.kde.kontour, application/vnd.kde.kpresenter, application/vnd.kde.kspread, application/vnd.kde.kword, application/vnd.kenameaapp, application/vnd.kidspiration, application/vnd.kinar, application/vnd.koan, application/vnd.kodak-descriptor, application/vnd.las.las+json, application/vnd.las.las+xml, application/vnd.leap+json, application/vnd.liberty-request+xml, application/vnd.llamagraphics.life-balance.desktop, application/vnd.llamagraphics.life-balance.exchange+xml, application/vnd.lotus-1-2-3, application/vnd.lotus-approach, application/vnd.lotus-freelance, application/vnd.lotus-notes, application/vnd.lotus-organizer, application/vnd.lotus-screencam, application/vnd.lotus-wordpro, application/vnd.macports.portpkg, application/vnd.mapbox-vector-tile, application/vnd.marlin.drm.actiontoken+xml, application/vnd.marlin.drm.conftoken+xml, application/vnd.marlin.drm.license+xml, application/vnd.marlin.drm.mdcf, application/vnd.mason+json, application/vnd.maxmind.maxmind-db, application/vnd.mcd, application/vnd.medcalcdata, application/vnd.mediastation.cdkey, application/vnd.meridian-slingshot, application/vnd.mfer, application/vnd.mfmp, application/vnd.micro+json, application/vnd.micrografx.flo, application/vnd.micrografx.igx, application/vnd.microsoft.portable-executable, application/vnd.microsoft.windows.thumbnail-cache, application/vnd.miele+json, application/vnd.mif, application/vnd.minisoft-hp3000-save, application/vnd.mitsubishi.misty-guard.trustweb, application/vnd.mobius.daf, application/vnd.mobius.dis, application/vnd.mobius.mbk, application/vnd.mobius.mqy, application/vnd.mobius.msl, application/vnd.mobius.plc, application/vnd.mobius.txf, application/vnd.mophun.application, application/vnd.mophun.certificate, application/vnd.motorola.flexsuite, application/vnd.motorola.flexsuite.adsi, application/vnd.motorola.flexsuite.fis, application/vnd.motorola.flexsuite.gotap, application/vnd.motorola.flexsuite.kmr, application/vnd.motorola.flexsuite.ttc, application/vnd.motorola.flexsuite.wem, application/vnd.motorola.iprm, application/vnd.mozilla.xul+xml, application/vnd.ms-3mfdocument, application/vnd.ms-artgalry, application/vnd.ms-asf, application/vnd.ms-cab-compressed, application/vnd.ms-color.iccprofile, application/vnd.ms-excel, application/vnd.ms-excel.addin.macroenabled.12, application/vnd.ms-excel.sheet.binary.macroenabled.12, application/vnd.ms-excel.sheet.macroenabled.12, application/vnd.ms-excel.template.macroenabled.12, application/vnd.ms-fontobject, application/vnd.ms-htmlhelp, application/vnd.ms-ims, application/vnd.ms-lrm, application/vnd.ms-office.activex+xml, application/vnd.ms-officetheme, application/vnd.ms-opentype, application/vnd.ms-outlook, application/vnd.ms-package.obfuscated-opentype, application/vnd.ms-pki.seccat, application/vnd.ms-pki.stl, application/vnd.ms-playready.initiator+xml, application/vnd.ms-powerpoint, application/vnd.ms-powerpoint.addin.macroenabled.12, application/vnd.ms-powerpoint.presentation.macroenabled.12, application/vnd.ms-powerpoint.slide.macroenabled.12, application/vnd.ms-powerpoint.slideshow.macroenabled.12, application/vnd.ms-powerpoint.template.macroenabled.12, application/vnd.ms-printdevicecapabilities+xml, application/vnd.ms-printing.printticket+xml, application/vnd.ms-printschematicket+xml, application/vnd.ms-project, application/vnd.ms-tnef, application/vnd.ms-windows.devicepairing, application/vnd.ms-windows.nwprinting.oob, application/vnd.ms-windows.printerpairing, application/vnd.ms-windows.wsd.oob, application/vnd.ms-wmdrm.lic-chlg-req, application/vnd.ms-wmdrm.lic-resp, application/vnd.ms-wmdrm.meter-chlg-req, application/vnd.ms-wmdrm.meter-resp, application/vnd.ms-word.document.macroenabled.12, application/vnd.ms-word.template.macroenabled.12, application/vnd.ms-works, application/vnd.ms-wpl, application/vnd.ms-xpsdocument, application/vnd.msa-disk-image, application/vnd.mseq, application/vnd.msign, application/vnd.multiad.creator, application/vnd.multiad.creator.cif, application/vnd.music-niff, application/vnd.musician, application/vnd.muvee.style, application/vnd.mynfc, application/vnd.ncd.control, application/vnd.ncd.reference, application/vnd.nearst.inv+json, application/vnd.nervana, application/vnd.netfpx, application/vnd.neurolanguage.nlu, application/vnd.nimn, application/vnd.nintendo.nitro.rom, application/vnd.nintendo.snes.rom, application/vnd.nitf, application/vnd.noblenet-directory, application/vnd.noblenet-sealer, application/vnd.noblenet-web, application/vnd.nokia.catalogs, application/vnd.nokia.conml+wbxml, application/vnd.nokia.conml+xml, application/vnd.nokia.iptv.config+xml, application/vnd.nokia.isds-radio-presets, application/vnd.nokia.landmark+wbxml, application/vnd.nokia.landmark+xml, application/vnd.nokia.landmarkcollection+xml, application/vnd.nokia.n-gage.ac+xml, application/vnd.nokia.n-gage.data, application/vnd.nokia.n-gage.symbian.install, application/vnd.nokia.ncd, application/vnd.nokia.pcd+wbxml, application/vnd.nokia.pcd+xml, application/vnd.nokia.radio-preset, application/vnd.nokia.radio-presets, application/vnd.novadigm.edm, application/vnd.novadigm.edx, application/vnd.novadigm.ext, application/vnd.ntt-local.content-share, application/vnd.ntt-local.file-transfer, application/vnd.ntt-local.ogw_remote-access, application/vnd.ntt-local.sip-ta_remote, application/vnd.ntt-local.sip-ta_tcp_stream, application/vnd.oasis.opendocument.chart, application/vnd.oasis.opendocument.chart-template, application/vnd.oasis.opendocument.database, application/vnd.oasis.opendocument.formula, application/vnd.oasis.opendocument.formula-template, application/vnd.oasis.opendocument.graphics, application/vnd.oasis.opendocument.graphics-template, application/vnd.oasis.opendocument.image, application/vnd.oasis.opendocument.image-template, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.presentation-template, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.spreadsheet-template, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.text-master, application/vnd.oasis.opendocument.text-template, application/vnd.oasis.opendocument.text-web, application/vnd.obn, application/vnd.ocf+cbor, application/vnd.oftn.l10n+json, application/vnd.oipf.contentaccessdownload+xml, application/vnd.oipf.contentaccessstreaming+xml, application/vnd.oipf.cspg-hexbinary, application/vnd.oipf.dae.svg+xml, application/vnd.oipf.dae.xhtml+xml, application/vnd.oipf.mippvcontrolmessage+xml, application/vnd.oipf.pae.gem, application/vnd.oipf.spdiscovery+xml, application/vnd.oipf.spdlist+xml, application/vnd.oipf.ueprofile+xml, application/vnd.oipf.userprofile+xml, application/vnd.olpc-sugar, application/vnd.oma-scws-config, application/vnd.oma-scws-http-request, application/vnd.oma-scws-http-response, application/vnd.oma.bcast.associated-procedure-parameter+xml, application/vnd.oma.bcast.drm-trigger+xml, application/vnd.oma.bcast.imd+xml, application/vnd.oma.bcast.ltkm, application/vnd.oma.bcast.notification+xml, application/vnd.oma.bcast.provisioningtrigger, application/vnd.oma.bcast.sgboot, application/vnd.oma.bcast.sgdd+xml, application/vnd.oma.bcast.sgdu, application/vnd.oma.bcast.simple-symbol-container, application/vnd.oma.bcast.smartcard-trigger+xml, application/vnd.oma.bcast.sprov+xml, application/vnd.oma.bcast.stkm, application/vnd.oma.cab-address-book+xml, application/vnd.oma.cab-feature-handler+xml, application/vnd.oma.cab-pcc+xml, application/vnd.oma.cab-subs-invite+xml, application/vnd.oma.cab-user-prefs+xml, application/vnd.oma.dcd, application/vnd.oma.dcdc, application/vnd.oma.dd2+xml, application/vnd.oma.drm.risd+xml, application/vnd.oma.group-usage-list+xml, application/vnd.oma.lwm2m+json, application/vnd.oma.lwm2m+tlv, application/vnd.oma.pal+xml, application/vnd.oma.poc.detailed-progress-report+xml, application/vnd.oma.poc.final-report+xml, application/vnd.oma.poc.groups+xml, application/vnd.oma.poc.invocation-descriptor+xml, application/vnd.oma.poc.optimized-progress-report+xml, application/vnd.oma.push, application/vnd.oma.scidm.messages+xml, application/vnd.oma.xcap-directory+xml, application/vnd.omads-email+xml, application/vnd.omads-file+xml, application/vnd.omads-folder+xml, application/vnd.omaloc-supl-init, application/vnd.onepager, application/vnd.onepagertamp, application/vnd.onepagertamx, application/vnd.onepagertat, application/vnd.onepagertatp, application/vnd.onepagertatx, application/vnd.openblox.game+xml, application/vnd.openblox.game-binary, application/vnd.openeye.oeb, application/vnd.openofficeorg.extension, application/vnd.openstreetmap.data+xml, application/vnd.openxmlformats-officedocument.custom-properties+xml, application/vnd.openxmlformats-officedocument.customxmlproperties+xml, application/vnd.openxmlformats-officedocument.drawing+xml, application/vnd.openxmlformats-officedocument.drawingml.chart+xml, application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml, application/vnd.openxmlformats-officedocument.extended-properties+xml, application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml, application/vnd.openxmlformats-officedocument.presentationml.comments+xml, application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml, application/vnd.openxmlformats-officedocument.presentationml.presprops+xml, application/vnd.openxmlformats-officedocument.presentationml.slide, application/vnd.openxmlformats-officedocument.presentationml.slide+xml, application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml, application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml, application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml, application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml, application/vnd.openxmlformats-officedocument.presentationml.tags+xml, application/vnd.openxmlformats-officedocument.presentationml.template, application/vnd.openxmlformats-officedocument.presentationml.template.main+xml, application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.template, application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml, application/vnd.openxmlformats-officedocument.theme+xml, application/vnd.openxmlformats-officedocument.themeoverride+xml, application/vnd.openxmlformats-officedocument.vmldrawing, application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.template, application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml, application/vnd.openxmlformats-package.core-properties+xml, application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml, application/vnd.openxmlformats-package.relationships+xml, application/vnd.oracle.resource+json, application/vnd.orange.indata, application/vnd.osa.netdeploy, application/vnd.osgeo.mapguide.package, application/vnd.osgi.bundle, application/vnd.osgi.dp, application/vnd.osgi.subsystem, application/vnd.otps.ct-kip+xml, application/vnd.oxli.countgraph, application/vnd.pagerduty+json, application/vnd.palm, application/vnd.panoply, application/vnd.paos.xml, application/vnd.patentdive, application/vnd.patientecommsdoc, application/vnd.pawaafile, application/vnd.pcos, application/vnd.pg.format, application/vnd.pg.osasli, application/vnd.piaccess.application-licence, application/vnd.picsel, application/vnd.pmi.widget, application/vnd.poc.group-advertisement+xml, application/vnd.pocketlearn, application/vnd.powerbuilder6, application/vnd.powerbuilder6-s, application/vnd.powerbuilder7, application/vnd.powerbuilder7-s, application/vnd.powerbuilder75, application/vnd.powerbuilder75-s, application/vnd.preminet, application/vnd.previewsystems.box, application/vnd.proteus.magazine, application/vnd.psfs, application/vnd.publishare-delta-tree, application/vnd.pvi.ptid1, application/vnd.pwg-multiplexed, application/vnd.pwg-xhtml-print+xml, application/vnd.qualcomm.brew-app-res, application/vnd.quarantainenet, application/vnd.quark.quarkxpress, application/vnd.quobject-quoxdocument, application/vnd.radisys.moml+xml, application/vnd.radisys.msml+xml, application/vnd.radisys.msml-audit+xml, application/vnd.radisys.msml-audit-conf+xml, application/vnd.radisys.msml-audit-conn+xml, application/vnd.radisys.msml-audit-dialog+xml, application/vnd.radisys.msml-audit-stream+xml, application/vnd.radisys.msml-conf+xml, application/vnd.radisys.msml-dialog+xml, application/vnd.radisys.msml-dialog-base+xml, application/vnd.radisys.msml-dialog-fax-detect+xml, application/vnd.radisys.msml-dialog-fax-sendrecv+xml, application/vnd.radisys.msml-dialog-group+xml, application/vnd.radisys.msml-dialog-speech+xml, application/vnd.radisys.msml-dialog-transform+xml, application/vnd.rainstor.data, application/vnd.rapid, application/vnd.rar, application/vnd.realvnc.bed, application/vnd.recordare.musicxml, application/vnd.recordare.musicxml+xml, application/vnd.renlearn.rlprint, application/vnd.restful+json, application/vnd.rig.cryptonote, application/vnd.rim.cod, application/vnd.rn-realmedia, application/vnd.rn-realmedia-vbr, application/vnd.route66.link66+xml, application/vnd.rs-274x, application/vnd.ruckus.download, application/vnd.s3sms, application/vnd.sailingtracker.track, application/vnd.sbm.cid, application/vnd.sbm.mid2, application/vnd.scribus, application/vnd.sealed.3df, application/vnd.sealed.csf, application/vnd.sealed.doc, application/vnd.sealed.eml, application/vnd.sealed.mht, application/vnd.sealed.net, application/vnd.sealed.ppt, application/vnd.sealed.tiff, application/vnd.sealed.xls, application/vnd.sealedmedia.softseal.html, application/vnd.sealedmedia.softseal.pdf, application/vnd.seemail, application/vnd.sema, application/vnd.semd, application/vnd.semf, application/vnd.shana.informed.formdata, application/vnd.shana.informed.formtemplate, application/vnd.shana.informed.interchange, application/vnd.shana.informed.package, application/vnd.shootproof+json, application/vnd.sigrok.session, application/vnd.simtech-mindmapper, application/vnd.siren+json, application/vnd.smaf, application/vnd.smart.notebook, application/vnd.smart.teacher, application/vnd.software602.filler.form+xml, application/vnd.software602.filler.form-xml-zip, application/vnd.solent.sdkm+xml, application/vnd.spotfire.dxp, application/vnd.spotfire.sfs, application/vnd.sqlite3, application/vnd.sss-cod, application/vnd.sss-dtf, application/vnd.sss-ntf, application/vnd.stardivision.calc, application/vnd.stardivision.draw, application/vnd.stardivision.impress, application/vnd.stardivision.math, application/vnd.stardivision.writer, application/vnd.stardivision.writer-global, application/vnd.stepmania.package, application/vnd.stepmania.stepchart, application/vnd.street-stream, application/vnd.sun.wadl+xml, application/vnd.sun.xml.calc, application/vnd.sun.xml.calc.template, application/vnd.sun.xml.draw, application/vnd.sun.xml.draw.template, application/vnd.sun.xml.impress, application/vnd.sun.xml.impress.template, application/vnd.sun.xml.math, application/vnd.sun.xml.writer, application/vnd.sun.xml.writer.global, application/vnd.sun.xml.writer.template, application/vnd.sus-calendar, application/vnd.svd, application/vnd.swiftview-ics, application/vnd.symbian.install, application/vnd.syncml+xml, application/vnd.syncml.dm+wbxml, application/vnd.syncml.dm+xml, application/vnd.syncml.dm.notification, application/vnd.syncml.dmddf+wbxml, application/vnd.syncml.dmddf+xml, application/vnd.syncml.dmtnds+wbxml, application/vnd.syncml.dmtnds+xml, application/vnd.syncml.ds.notification, application/vnd.tableschema+json, application/vnd.tao.intent-module-archive, application/vnd.tcpdump.pcap, application/vnd.think-cell.ppttc+json, application/vnd.tmd.mediaflex.api+xml, application/vnd.tml, application/vnd.tmobile-livetv, application/vnd.tri.onesource, application/vnd.trid.tpt, application/vnd.triscape.mxs, application/vnd.trueapp, application/vnd.truedoc, application/vnd.ubisoft.webplayer, application/vnd.ufdl, application/vnd.uiq.theme, application/vnd.umajin, application/vnd.unity, application/vnd.uoml+xml, application/vnd.uplanet.alert, application/vnd.uplanet.alert-wbxml, application/vnd.uplanet.bearer-choice, application/vnd.uplanet.bearer-choice-wbxml, application/vnd.uplanet.cacheop, application/vnd.uplanet.cacheop-wbxml, application/vnd.uplanet.channel, application/vnd.uplanet.channel-wbxml, application/vnd.uplanet.list, application/vnd.uplanet.list-wbxml, application/vnd.uplanet.listcmd, application/vnd.uplanet.listcmd-wbxml, application/vnd.uplanet.signal, application/vnd.uri-map, application/vnd.valve.source.material, application/vnd.vcx, application/vnd.vd-study, application/vnd.vectorworks, application/vnd.vel+json, application/vnd.verimatrix.vcas, application/vnd.veryant.thin, application/vnd.vidsoft.vidconference, application/vnd.visio, application/vnd.visionary, application/vnd.vividence.scriptfile, application/vnd.vsf, application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.wbxml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.webturbo, application/vnd.wfa.p2p, application/vnd.wfa.wsc, application/vnd.windows.devicepairing, application/vnd.wmc, application/vnd.wmf.bootstrap, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.player, application/vnd.wordperfect, application/vnd.wqd, application/vnd.wrq-hp3000-labelled, application/vnd.wt.stf, application/vnd.wv.csp+wbxml, application/vnd.wv.csp+xml, application/vnd.wv.ssp+xml, application/vnd.xacml+json, application/vnd.xara, application/vnd.xfdl, application/vnd.xfdl.webform, application/vnd.xmi+xml, application/vnd.xmpie.cpkg, application/vnd.xmpie.dpkg, application/vnd.xmpie.plan, application/vnd.xmpie.ppkg, application/vnd.xmpie.xlim, application/vnd.yamaha.hv-dic, application/vnd.yamaha.hv-script, application/vnd.yamaha.hv-voice, application/vnd.yamaha.openscoreformat, application/vnd.yamaha.openscoreformat.osfpvg+xml, application/vnd.yamaha.remote-setup, application/vnd.yamaha.smaf-audio, application/vnd.yamaha.smaf-phrase, application/vnd.yamaha.through-ngn, application/vnd.yamaha.tunnel-udpencap, application/vnd.yaoweme, application/vnd.yellowriver-custom-menu, application/vnd.youtube.yt, application/vnd.zul, application/vnd.zzazz.deck+xml, application/voicexml+xml, application/voucher-cms+json, application/vq-rtcpxr, application/wasm, application/watcherinfo+xml, application/webpush-options+json, application/whoispp-query, application/whoispp-response, application/widget, application/winhlp, application/wita, application/wordperfect5.1, application/wsdl+xml, application/wspolicy+xml, application/x-7z-compressed, application/x-abiword, application/x-ace-compressed, application/x-amf, application/x-apple-diskimage, application/x-arj, application/x-authorware-bin, application/x-authorware-map, application/x-authorware-seg, application/x-bcpio, application/x-bdoc, application/x-bittorrent, application/x-blorb, application/x-bzip, application/x-bzip2, application/x-cbr, application/x-cdlink, application/x-cfs-compressed, application/x-chat, application/x-chess-pgn, application/x-chrome-extension, application/x-cocoa, application/x-compress, application/x-conference, application/x-cpio, application/x-csh, application/x-deb, application/x-debian-package, application/x-dgc-compressed, application/x-director, application/x-doom, application/x-dtbncx+xml, application/x-dtbook+xml, application/x-dtbresource+xml, application/x-dvi, application/x-envoy, application/x-eva, application/x-font-bdf, application/x-font-dos, application/x-font-framemaker, application/x-font-ghostscript, application/x-font-libgrx, application/x-font-linux-psf, application/x-font-pcf, application/x-font-snf, application/x-font-speedo, application/x-font-sunos-news, application/x-font-type1, application/x-font-vfont, application/x-freearc, application/x-futuresplash, application/x-gca-compressed, application/x-glulx, application/x-gnumeric, application/x-gramps-xml, application/x-gtar, application/x-gzip, application/x-hdf, application/x-httpd-php, application/x-install-instructions, application/x-iso9660-image, application/x-java-archive-diff, application/x-java-jnlp-file, application/x-javascript, application/x-latex, application/x-lua-bytecode, application/x-lzh-compressed, application/x-makeself, application/x-mie, application/x-mobipocket-ebook, application/x-mpegurl, application/x-ms-application, application/x-ms-shortcut, application/x-ms-wmd, application/x-ms-wmz, application/x-ms-xbap, application/x-msaccess, application/x-msbinder, application/x-mscardfile, application/x-msclip, application/x-msdos-program, application/x-msdownload, application/x-msmediaview, application/x-msmetafile, application/x-msmoney, application/x-mspublisher, application/x-msschedule, application/x-msterminal, application/x-mswrite, application/x-netcdf, application/x-ns-proxy-autoconfig, application/x-nzb, application/x-perl, application/x-pilot, application/x-pkcs12, application/x-pkcs7-certificates, application/x-pkcs7-certreqresp, application/x-rar-compressed, application/x-redhat-package-manager, application/x-research-info-systems, application/x-sea, application/x-sh, application/x-shar, application/x-shockwave-flash, application/x-silverlight-app, application/x-sql, application/x-stuffit, application/x-stuffitx, application/x-subrip, application/x-sv4cpio, application/x-sv4crc, application/x-t3vm-image, application/x-tads, application/x-tar, application/x-tcl, application/x-tex, application/x-tex-tfm, application/x-texinfo, application/x-tgif, application/x-ustar, application/x-virtualbox-hdd, application/x-virtualbox-ova, application/x-virtualbox-ovf, application/x-virtualbox-vbox, application/x-virtualbox-vbox-extpack, application/x-virtualbox-vdi, application/x-virtualbox-vhd, application/x-virtualbox-vmdk, application/x-wais-source, application/x-web-app-manifest+json, application/x-www-form-urlencoded, application/x-x509-ca-cert, application/x-xfig, application/x-xliff+xml, application/x-xpinstall, application/x-xz, application/x-zmachine, application/x400-bp, application/xacml+xml, application/xaml+xml, application/xcap-att+xml, application/xcap-caps+xml, application/xcap-diff+xml, application/xcap-el+xml, application/xcap-error+xml, application/xcap-ns+xml, application/xcon-conference-info+xml, application/xcon-conference-info-diff+xml, application/xenc+xml, application/xhtml+xml, application/xhtml-voice+xml, application/xliff+xml, application/xml, application/xml-dtd, application/xml-external-parsed-entity, application/xml-patch+xml, application/xmpp+xml, application/xop+xml, application/xproc+xml, application/xslt+xml, application/xspf+xml, application/xv+xml, application/yang, application/yang-data+json, application/yang-data+xml, application/yang-patch+json, application/yang-patch+xml, application/yin+xml, application/zip, application/zlib, application/zstd, audio/1d-interleaved-parityfec, audio/32kadpcm, audio/3gpp, audio/3gpp2, audio/aac, audio/ac3, audio/adpcm, audio/amr, audio/amr-wb, audio/amr-wb+, audio/aptx, audio/asc, audio/atrac-advanced-lossless, audio/atrac-x, audio/atrac3, audio/basic, audio/bv16, audio/bv32, audio/clearmode, audio/cn, audio/dat12, audio/dls, audio/dsr-es201108, audio/dsr-es202050, audio/dsr-es202211, audio/dsr-es202212, audio/dv, audio/dvi4, audio/eac3, audio/encaprtp, audio/evrc, audio/evrc-qcp, audio/evrc0, audio/evrc1, audio/evrcb, audio/evrcb0, audio/evrcb1, audio/evrcnw, audio/evrcnw0, audio/evrcnw1, audio/evrcwb, audio/evrcwb0, audio/evrcwb1, audio/evs, audio/fwdred, audio/g711-0, audio/g719, audio/g722, audio/g7221, audio/g723, audio/g726-16, audio/g726-24, audio/g726-32, audio/g726-40, audio/g728, audio/g729, audio/g7291, audio/g729d, audio/g729e, audio/gsm, audio/gsm-efr, audio/gsm-hr-08, audio/ilbc, audio/ip-mr_v2.5, audio/isac, audio/l16, audio/l20, audio/l24, audio/l8, audio/lpc, audio/melp, audio/melp1200, audio/melp2400, audio/melp600, audio/midi, audio/mobile-xmf, audio/mp3, audio/mp4, audio/mp4a-latm, audio/mpa, audio/mpa-robust, audio/mpeg, audio/mpeg4-generic, audio/musepack, audio/ogg, audio/opus, audio/parityfec, audio/pcma, audio/pcma-wb, audio/pcmu, audio/pcmu-wb, audio/prs.sid, audio/qcelp, audio/raptorfec, audio/red, audio/rtp-enc-aescm128, audio/rtp-midi, audio/rtploopback, audio/rtx, audio/s3m, audio/silk, audio/smv, audio/smv-qcp, audio/smv0, audio/sp-midi, audio/speex, audio/t140c, audio/t38, audio/telephone-event, audio/tetra_acelp, audio/tone, audio/uemclip, audio/ulpfec, audio/usac, audio/vdvi, audio/vmr-wb, audio/vnd.3gpp.iufp, audio/vnd.4sb, audio/vnd.audiokoz, audio/vnd.celp, audio/vnd.cisco.nse, audio/vnd.cmles.radio-events, audio/vnd.cns.anp1, audio/vnd.cns.inf1, audio/vnd.dece.audio, audio/vnd.digital-winds, audio/vnd.dlna.adts, audio/vnd.dolby.heaac.1, audio/vnd.dolby.heaac.2, audio/vnd.dolby.mlp, audio/vnd.dolby.mps, audio/vnd.dolby.pl2, audio/vnd.dolby.pl2x, audio/vnd.dolby.pl2z, audio/vnd.dolby.pulse.1, audio/vnd.dra, audio/vnd.dts, audio/vnd.dts.hd, audio/vnd.dts.uhd, audio/vnd.dvb.file, audio/vnd.everad.plj, audio/vnd.hns.audio, audio/vnd.lucent.voice, audio/vnd.ms-playready.media.pya, audio/vnd.nokia.mobile-xmf, audio/vnd.nortel.vbk, audio/vnd.nuera.ecelp4800, audio/vnd.nuera.ecelp7470, audio/vnd.nuera.ecelp9600, audio/vnd.octel.sbc, audio/vnd.presonus.multitrack, audio/vnd.qcelp, audio/vnd.rhetorex.32kadpcm, audio/vnd.rip, audio/vnd.rn-realaudio, audio/vnd.sealedmedia.softseal.mpeg, audio/vnd.vmx.cvsd, audio/vnd.wave, audio/vorbis, audio/vorbis-config, audio/wav, audio/wave, audio/webm, audio/x-aac, audio/x-aiff, audio/x-caf, audio/x-flac, audio/x-m4a, audio/x-matroska, audio/x-mpegurl, audio/x-ms-wax, audio/x-ms-wma, audio/x-pn-realaudio, audio/x-pn-realaudio-plugin, audio/x-realaudio, audio/x-tta, audio/x-wav, audio/xm, chemical/x-cdx, chemical/x-cif, chemical/x-cmdf, chemical/x-cml, chemical/x-csml, chemical/x-pdb, chemical/x-xyz, font/collection, font/otf, font/sfnt, font/ttf, font/woff, font/woff2, image/aces, image/apng, image/avci, image/avcs, image/bmp, image/cgm, image/dicom-rle, image/emf, image/fits, image/g3fax, image/gif, image/heic, image/heic-sequence, image/heif, image/heif-sequence, image/ief, image/jls, image/jp2, image/jpeg, image/jpm, image/jpx, image/jxr, image/ktx, image/naplps, image/pjpeg, image/png, image/prs.btif, image/prs.pti, image/pwg-raster, image/sgi, image/svg+xml, image/t38, image/tiff, image/tiff-fx, image/vnd.adobe.photoshop, image/vnd.airzip.accelerator.azv, image/vnd.cns.inf2, image/vnd.dece.graphic, image/vnd.djvu, image/vnd.dvb.subtitle, image/vnd.dwg, image/vnd.dxf, image/vnd.fastbidsheet, image/vnd.fpx, image/vnd.fst, image/vnd.fujixerox.edmics-mmr, image/vnd.fujixerox.edmics-rlc, image/vnd.globalgraphics.pgb, image/vnd.microsoft.icon, image/vnd.mix, image/vnd.mozilla.apng, image/vnd.ms-modi, image/vnd.ms-photo, image/vnd.net-fpx, image/vnd.radiance, image/vnd.sealed.png, image/vnd.sealedmedia.softseal.gif, image/vnd.sealedmedia.softseal.jpg, image/vnd.svf, image/vnd.tencent.tap, image/vnd.valve.source.texture, image/vnd.wap.wbmp, image/vnd.xiff, image/vnd.zbrush.pcx, image/webp, image/wmf, image/x-3ds, image/x-cmu-raster, image/x-cmx, image/x-freehand, image/x-icon, image/x-jng, image/x-mrsid-image, image/x-ms-bmp, image/x-pcx, image/x-pict, image/x-portable-anymap, image/x-portable-bitmap, image/x-portable-graymap, image/x-portable-pixmap, image/x-rgb, image/x-tga, image/x-xbitmap, image/x-xcf, image/x-xpixmap, image/x-xwindowdump, message/cpim, message/delivery-status, message/disposition-notification, message/external-body, message/feedback-report, message/global, message/global-delivery-status, message/global-disposition-notification, message/global-headers, message/http, message/imdn+xml, message/news, message/partial, message/rfc822, message/s-http, message/sip, message/sipfrag, message/tracking-status, message/vnd.si.simp, message/vnd.wfa.wsc, model/3mf, model/gltf+json, model/gltf-binary, model/iges, model/mesh, model/stl, model/vnd.collada+xml, model/vnd.dwf, model/vnd.flatland.3dml, model/vnd.gdl, model/vnd.gs-gdl, model/vnd.gs.gdl, model/vnd.gtw, model/vnd.moml+xml, model/vnd.mts, model/vnd.opengex, model/vnd.parasolid.transmit.binary, model/vnd.parasolid.transmit.text, model/vnd.rosette.annotated-data-model, model/vnd.usdz+zip, model/vnd.valve.source.compiled-map, model/vnd.vtu, model/vrml, model/x3d+binary, model/x3d+fastinfoset, model/x3d+vrml, model/x3d+xml, model/x3d-vrml, multipart/alternative, multipart/appledouble, multipart/byteranges, multipart/digest, multipart/encrypted, multipart/form-data, multipart/header-set, multipart/mixed, multipart/multilingual, multipart/parallel, multipart/related, multipart/report, multipart/signed, multipart/vnd.bint.med-plus, multipart/voice-message, multipart/x-mixed-replace, text/1d-interleaved-parityfec, text/cache-manifest, text/calendar, text/calender, text/cmd, text/coffeescript, text/css, text/csv, text/csv-schema, text/directory, text/dns, text/ecmascript, text/encaprtp, text/enriched, text/fwdred, text/grammar-ref-list, text/html, text/jade, text/javascript, text/jcr-cnd, text/jsx, text/less, text/markdown, text/mathml, text/mdx, text/mizar, text/n3, text/parameters, text/parityfec, text/plain, text/provenance-notation, text/prs.fallenstein.rst, text/prs.lines.tag, text/prs.prop.logic, text/raptorfec, text/red, text/rfc822-headers, text/richtext, text/rtf, text/rtp-enc-aescm128, text/rtploopback, text/rtx, text/sgml, text/shex, text/slim, text/strings, text/stylus, text/t140, text/tab-separated-values, text/troff, text/turtle, text/ulpfec, text/uri-list, text/vcard, text/vnd.a, text/vnd.abc, text/vnd.ascii-art, text/vnd.curl, text/vnd.curl.dcurl, text/vnd.curl.mcurl, text/vnd.curl.scurl, text/vnd.debian.copyright, text/vnd.dmclientscript, text/vnd.dvb.subtitle, text/vnd.esmertec.theme-descriptor, text/vnd.fly, text/vnd.fmi.flexstor, text/vnd.gml, text/vnd.graphviz, text/vnd.hgl, text/vnd.in3d.3dml, text/vnd.in3d.spot, text/vnd.iptc.newsml, text/vnd.iptc.nitf, text/vnd.latex-z, text/vnd.motorola.reflex, text/vnd.ms-mediapackage, text/vnd.net2phone.commcenter.command, text/vnd.radisys.msml-basic-layout, text/vnd.senx.warpscript, text/vnd.si.uricatalogue, text/vnd.sun.j2me.app-descriptor, text/vnd.trolltech.linguist, text/vnd.wap.si, text/vnd.wap.sl, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/vtt, text/x-asm, text/x-c, text/x-component, text/x-fortran, text/x-gwt-rpc, text/x-handlebars-template, text/x-java-source, text/x-jquery-tmpl, text/x-lua, text/x-markdown, text/x-nfo, text/x-opml, text/x-org, text/x-pascal, text/x-processing, text/x-sass, text/x-scss, text/x-setext, text/x-sfv, text/x-suse-ymp, text/x-uuencode, text/x-vcalendar, text/x-vcard, text/xml, text/xml-external-parsed-entity, text/yaml, video/1d-interleaved-parityfec, video/3gpp, video/3gpp-tt, video/3gpp2, video/bmpeg, video/bt656, video/celb, video/dv, video/encaprtp, video/h261, video/h263, video/h263-1998, video/h263-2000, video/h264, video/h264-rcdo, video/h264-svc, video/h265, video/iso.segment, video/jpeg, video/jpeg2000, video/jpm, video/mj2, video/mp1s, video/mp2p, video/mp2t, video/mp4, video/mp4v-es, video/mpeg, video/mpeg4-generic, video/mpv, video/nv, video/ogg, video/parityfec, video/pointer, video/quicktime, video/raptorfec, video/raw, video/rtp-enc-aescm128, video/rtploopback, video/rtx, video/smpte291, video/smpte292m, video/ulpfec, video/vc1, video/vc2, video/vnd.cctv, video/vnd.dece.hd, video/vnd.dece.mobile, video/vnd.dece.mp4, video/vnd.dece.pd, video/vnd.dece.sd, video/vnd.dece.video, video/vnd.directv.mpeg, video/vnd.directv.mpeg-tts, video/vnd.dlna.mpeg-tts, video/vnd.dvb.file, video/vnd.fvt, video/vnd.hns.video, video/vnd.iptvforum.1dparityfec-1010, video/vnd.iptvforum.1dparityfec-2005, video/vnd.iptvforum.2dparityfec-1010, video/vnd.iptvforum.2dparityfec-2005, video/vnd.iptvforum.ttsavc, video/vnd.iptvforum.ttsmpeg2, video/vnd.motorola.video, video/vnd.motorola.videop, video/vnd.mpegurl, video/vnd.ms-playready.media.pyv, video/vnd.nokia.interleaved-multimedia, video/vnd.nokia.mp4vr, video/vnd.nokia.videovoip, video/vnd.objectvideo, video/vnd.radgamettools.bink, video/vnd.radgamettools.smacker, video/vnd.sealed.mpeg1, video/vnd.sealed.mpeg4, video/vnd.sealed.swf, video/vnd.sealedmedia.softseal.mov, video/vnd.uvvu.mp4, video/vnd.vivo, video/vp8, video/webm, video/x-f4v, video/x-fli, video/x-flv, video/x-m4v, video/x-matroska, video/x-mng, video/x-ms-asf, video/x-ms-vob, video/x-ms-wm, video/x-ms-wmv, video/x-ms-wmx, video/x-ms-wvx, video/x-msvideo, video/x-sgi-movie, video/x-smv, x-conference/x-cooltalk, x-shader/x-fragment, x-shader/x-vertex, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"application/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"application/3gpdash-qoe-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/3gpp-ims+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/a2l\":{\"source\":\"iana\"},\"application/activemessage\":{\"source\":\"iana\"},\"application/activity+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-directory+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcost+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcostparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointprop+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointpropparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-error+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/aml\":{\"source\":\"iana\"},\"application/andrew-inset\":{\"source\":\"iana\",\"extensions\":[\"ez\"]},\"application/applefile\":{\"source\":\"iana\"},\"application/applixware\":{\"source\":\"apache\",\"extensions\":[\"aw\"]},\"application/atf\":{\"source\":\"iana\"},\"application/atfx\":{\"source\":\"iana\"},\"application/atom+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atom\"]},\"application/atomcat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomcat\"]},\"application/atomdeleted+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atomicmail\":{\"source\":\"iana\"},\"application/atomsvc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomsvc\"]},\"application/atsc-dwd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-rsat+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/atxml\":{\"source\":\"iana\"},\"application/auth-policy+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/bacnet-xdd+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/batch-smtp\":{\"source\":\"iana\"},\"application/bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/beep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/call-completion\":{\"source\":\"iana\"},\"application/cals-1840\":{\"source\":\"iana\"},\"application/cbor\":{\"source\":\"iana\"},\"application/cccex\":{\"source\":\"iana\"},\"application/ccmp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ccxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ccxml\"]},\"application/cdfx+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cdmi-capability\":{\"source\":\"iana\",\"extensions\":[\"cdmia\"]},\"application/cdmi-container\":{\"source\":\"iana\",\"extensions\":[\"cdmic\"]},\"application/cdmi-domain\":{\"source\":\"iana\",\"extensions\":[\"cdmid\"]},\"application/cdmi-object\":{\"source\":\"iana\",\"extensions\":[\"cdmio\"]},\"application/cdmi-queue\":{\"source\":\"iana\",\"extensions\":[\"cdmiq\"]},\"application/cdni\":{\"source\":\"iana\"},\"application/cea\":{\"source\":\"iana\"},\"application/cea-2018+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cellml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cfw\":{\"source\":\"iana\"},\"application/clue_info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cms\":{\"source\":\"iana\"},\"application/cnrp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-group+json\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-payload\":{\"source\":\"iana\"},\"application/commonground\":{\"source\":\"iana\"},\"application/conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cose\":{\"source\":\"iana\"},\"application/cose-key\":{\"source\":\"iana\"},\"application/cose-key-set\":{\"source\":\"iana\"},\"application/cpl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csrattrs\":{\"source\":\"iana\"},\"application/csta+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cstadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csvm+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cu-seeme\":{\"source\":\"apache\",\"extensions\":[\"cu\"]},\"application/cwt\":{\"source\":\"iana\"},\"application/cybercash\":{\"source\":\"iana\"},\"application/dart\":{\"compressible\":true},\"application/dash+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpd\"]},\"application/dashdelta\":{\"source\":\"iana\"},\"application/davmount+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"davmount\"]},\"application/dca-rft\":{\"source\":\"iana\"},\"application/dcd\":{\"source\":\"iana\"},\"application/dec-dx\":{\"source\":\"iana\"},\"application/dialog-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom\":{\"source\":\"iana\"},\"application/dicom+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dii\":{\"source\":\"iana\"},\"application/dit\":{\"source\":\"iana\"},\"application/dns\":{\"source\":\"iana\"},\"application/dns+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dns-message\":{\"source\":\"iana\"},\"application/docbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dbk\"]},\"application/dskpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dssc+der\":{\"source\":\"iana\",\"extensions\":[\"dssc\"]},\"application/dssc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdssc\"]},\"application/dvcs\":{\"source\":\"iana\"},\"application/ecmascript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ecma\",\"es\"]},\"application/edi-consent\":{\"source\":\"iana\"},\"application/edi-x12\":{\"source\":\"iana\",\"compressible\":false},\"application/edifact\":{\"source\":\"iana\",\"compressible\":false},\"application/efi\":{\"source\":\"iana\"},\"application/emergencycalldata.comment+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.deviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.ecall.msd\":{\"source\":\"iana\"},\"application/emergencycalldata.providerinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.serviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.subscriberinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.veds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emma+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emma\"]},\"application/emotionml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/encaprtp\":{\"source\":\"iana\"},\"application/epp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/epub+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"epub\"]},\"application/eshop\":{\"source\":\"iana\"},\"application/exi\":{\"source\":\"iana\",\"extensions\":[\"exi\"]},\"application/expect-ct-report+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fastinfoset\":{\"source\":\"iana\"},\"application/fastsoap\":{\"source\":\"iana\"},\"application/fdt+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fido.trusted-apps+json\":{\"compressible\":true},\"application/fits\":{\"source\":\"iana\"},\"application/font-sfnt\":{\"source\":\"iana\"},\"application/font-tdpfr\":{\"source\":\"iana\",\"extensions\":[\"pfr\"]},\"application/font-woff\":{\"source\":\"iana\",\"compressible\":false},\"application/framework-attributes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/geo+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"geojson\"]},\"application/geo+json-seq\":{\"source\":\"iana\"},\"application/geopackage+sqlite3\":{\"source\":\"iana\"},\"application/geoxacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/gltf-buffer\":{\"source\":\"iana\"},\"application/gml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gml\"]},\"application/gpx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"gpx\"]},\"application/gxf\":{\"source\":\"apache\",\"extensions\":[\"gxf\"]},\"application/gzip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gz\"]},\"application/h224\":{\"source\":\"iana\"},\"application/held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/hjson\":{\"extensions\":[\"hjson\"]},\"application/http\":{\"source\":\"iana\"},\"application/hyperstudio\":{\"source\":\"iana\",\"extensions\":[\"stk\"]},\"application/ibe-key-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pkg-reply+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pp-data\":{\"source\":\"iana\"},\"application/iges\":{\"source\":\"iana\"},\"application/im-iscomposing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/index\":{\"source\":\"iana\"},\"application/index.cmd\":{\"source\":\"iana\"},\"application/index.obj\":{\"source\":\"iana\"},\"application/index.response\":{\"source\":\"iana\"},\"application/index.vnd\":{\"source\":\"iana\"},\"application/inkml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ink\",\"inkml\"]},\"application/iotp\":{\"source\":\"iana\"},\"application/ipfix\":{\"source\":\"iana\",\"extensions\":[\"ipfix\"]},\"application/ipp\":{\"source\":\"iana\"},\"application/isup\":{\"source\":\"iana\"},\"application/its+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/java-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jar\",\"war\",\"ear\"]},\"application/java-serialized-object\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"ser\"]},\"application/java-vm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"class\"]},\"application/javascript\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"js\",\"mjs\"]},\"application/jf2feed+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jose\":{\"source\":\"iana\"},\"application/jose+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jrd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"json\",\"map\"]},\"application/json-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json-seq\":{\"source\":\"iana\"},\"application/json5\":{\"extensions\":[\"json5\"]},\"application/jsonml+json\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"jsonml\"]},\"application/jwk+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwk-set+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwt\":{\"source\":\"iana\"},\"application/kpml-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/kpml-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ld+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"jsonld\"]},\"application/lgr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/link-format\":{\"source\":\"iana\"},\"application/load-control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lost+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lostxml\"]},\"application/lostsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lxf\":{\"source\":\"iana\"},\"application/mac-binhex40\":{\"source\":\"iana\",\"extensions\":[\"hqx\"]},\"application/mac-compactpro\":{\"source\":\"apache\",\"extensions\":[\"cpt\"]},\"application/macwriteii\":{\"source\":\"iana\"},\"application/mads+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mads\"]},\"application/manifest+json\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"webmanifest\"]},\"application/marc\":{\"source\":\"iana\",\"extensions\":[\"mrc\"]},\"application/marcxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mrcx\"]},\"application/mathematica\":{\"source\":\"iana\",\"extensions\":[\"ma\",\"nb\",\"mb\"]},\"application/mathml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mathml\"]},\"application/mathml-content+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mathml-presentation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-associated-procedure-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-deregister+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-envelope+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-protection-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-reception-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-schedule+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-user-service-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbox\":{\"source\":\"iana\",\"extensions\":[\"mbox\"]},\"application/media-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/media_control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mediaservercontrol+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mscml\"]},\"application/merge-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/metalink+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"metalink\"]},\"application/metalink4+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"meta4\"]},\"application/mets+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mets\"]},\"application/mf4\":{\"source\":\"iana\"},\"application/mikey\":{\"source\":\"iana\"},\"application/mmt-aei+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mmt-usd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mods+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mods\"]},\"application/moss-keys\":{\"source\":\"iana\"},\"application/moss-signature\":{\"source\":\"iana\"},\"application/mosskey-data\":{\"source\":\"iana\"},\"application/mosskey-request\":{\"source\":\"iana\"},\"application/mp21\":{\"source\":\"iana\",\"extensions\":[\"m21\",\"mp21\"]},\"application/mp4\":{\"source\":\"iana\",\"extensions\":[\"mp4s\",\"m4p\"]},\"application/mpeg4-generic\":{\"source\":\"iana\"},\"application/mpeg4-iod\":{\"source\":\"iana\"},\"application/mpeg4-iod-xmt\":{\"source\":\"iana\"},\"application/mrb-consumer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mrb-publish+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-ivr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-mixer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msword\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"doc\",\"dot\"]},\"application/mud+json\":{\"source\":\"iana\",\"compressible\":true},\"application/mxf\":{\"source\":\"iana\",\"extensions\":[\"mxf\"]},\"application/n-quads\":{\"source\":\"iana\",\"extensions\":[\"nq\"]},\"application/n-triples\":{\"source\":\"iana\",\"extensions\":[\"nt\"]},\"application/nasdata\":{\"source\":\"iana\"},\"application/news-checkgroups\":{\"source\":\"iana\"},\"application/news-groupinfo\":{\"source\":\"iana\"},\"application/news-transmission\":{\"source\":\"iana\"},\"application/nlsml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/node\":{\"source\":\"iana\"},\"application/nss\":{\"source\":\"iana\"},\"application/ocsp-request\":{\"source\":\"iana\"},\"application/ocsp-response\":{\"source\":\"iana\"},\"application/octet-stream\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"]},\"application/oda\":{\"source\":\"iana\",\"extensions\":[\"oda\"]},\"application/odm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/odx\":{\"source\":\"iana\"},\"application/oebps-package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"opf\"]},\"application/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogx\"]},\"application/omdoc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"omdoc\"]},\"application/onenote\":{\"source\":\"apache\",\"extensions\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"]},\"application/oscore\":{\"source\":\"iana\"},\"application/oxps\":{\"source\":\"iana\",\"extensions\":[\"oxps\"]},\"application/p2p-overlay+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/parityfec\":{\"source\":\"iana\"},\"application/passport\":{\"source\":\"iana\"},\"application/patch-ops-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/pdf\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pdf\"]},\"application/pdx\":{\"source\":\"iana\"},\"application/pem-certificate-chain\":{\"source\":\"iana\"},\"application/pgp-encrypted\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pgp\"]},\"application/pgp-keys\":{\"source\":\"iana\"},\"application/pgp-signature\":{\"source\":\"iana\",\"extensions\":[\"asc\",\"sig\"]},\"application/pics-rules\":{\"source\":\"apache\",\"extensions\":[\"prf\"]},\"application/pidf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pidf-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pkcs10\":{\"source\":\"iana\",\"extensions\":[\"p10\"]},\"application/pkcs12\":{\"source\":\"iana\"},\"application/pkcs7-mime\":{\"source\":\"iana\",\"extensions\":[\"p7m\",\"p7c\"]},\"application/pkcs7-signature\":{\"source\":\"iana\",\"extensions\":[\"p7s\"]},\"application/pkcs8\":{\"source\":\"iana\",\"extensions\":[\"p8\"]},\"application/pkcs8-encrypted\":{\"source\":\"iana\"},\"application/pkix-attr-cert\":{\"source\":\"iana\",\"extensions\":[\"ac\"]},\"application/pkix-cert\":{\"source\":\"iana\",\"extensions\":[\"cer\"]},\"application/pkix-crl\":{\"source\":\"iana\",\"extensions\":[\"crl\"]},\"application/pkix-pkipath\":{\"source\":\"iana\",\"extensions\":[\"pkipath\"]},\"application/pkixcmp\":{\"source\":\"iana\",\"extensions\":[\"pki\"]},\"application/pls+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pls\"]},\"application/poc-settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/postscript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ai\",\"eps\",\"ps\"]},\"application/ppsp-tracker+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/provenance+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/prs.alvestrand.titrax-sheet\":{\"source\":\"iana\"},\"application/prs.cww\":{\"source\":\"iana\",\"extensions\":[\"cww\"]},\"application/prs.hpub+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/prs.nprend\":{\"source\":\"iana\"},\"application/prs.plucker\":{\"source\":\"iana\"},\"application/prs.rdf-xml-crypt\":{\"source\":\"iana\"},\"application/prs.xsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pskc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pskcxml\"]},\"application/qsig\":{\"source\":\"iana\"},\"application/raml+yaml\":{\"compressible\":true,\"extensions\":[\"raml\"]},\"application/raptorfec\":{\"source\":\"iana\"},\"application/rdap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/rdf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rdf\",\"owl\"]},\"application/reginfo+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rif\"]},\"application/relax-ng-compact-syntax\":{\"source\":\"iana\",\"extensions\":[\"rnc\"]},\"application/remote-printing\":{\"source\":\"iana\"},\"application/reputon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/resource-lists+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rl\"]},\"application/resource-lists-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rld\"]},\"application/rfc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/riscos\":{\"source\":\"iana\"},\"application/rlmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rls-services+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rs\"]},\"application/route-apd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/route-s-tsid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/route-usd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rpki-ghostbusters\":{\"source\":\"iana\",\"extensions\":[\"gbr\"]},\"application/rpki-manifest\":{\"source\":\"iana\",\"extensions\":[\"mft\"]},\"application/rpki-publication\":{\"source\":\"iana\"},\"application/rpki-roa\":{\"source\":\"iana\",\"extensions\":[\"roa\"]},\"application/rpki-updown\":{\"source\":\"iana\"},\"application/rsd+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rsd\"]},\"application/rss+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rss\"]},\"application/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"application/rtploopback\":{\"source\":\"iana\"},\"application/rtx\":{\"source\":\"iana\"},\"application/samlassertion+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/samlmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sbml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sbml\"]},\"application/scaip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/scim+json\":{\"source\":\"iana\",\"compressible\":true},\"application/scvp-cv-request\":{\"source\":\"iana\",\"extensions\":[\"scq\"]},\"application/scvp-cv-response\":{\"source\":\"iana\",\"extensions\":[\"scs\"]},\"application/scvp-vp-request\":{\"source\":\"iana\",\"extensions\":[\"spq\"]},\"application/scvp-vp-response\":{\"source\":\"iana\",\"extensions\":[\"spp\"]},\"application/sdp\":{\"source\":\"iana\",\"extensions\":[\"sdp\"]},\"application/secevent+jwt\":{\"source\":\"iana\"},\"application/senml+cbor\":{\"source\":\"iana\"},\"application/senml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/senml-exi\":{\"source\":\"iana\"},\"application/sensml+cbor\":{\"source\":\"iana\"},\"application/sensml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml-exi\":{\"source\":\"iana\"},\"application/sep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sep-exi\":{\"source\":\"iana\"},\"application/session-info\":{\"source\":\"iana\"},\"application/set-payment\":{\"source\":\"iana\"},\"application/set-payment-initiation\":{\"source\":\"iana\",\"extensions\":[\"setpay\"]},\"application/set-registration\":{\"source\":\"iana\"},\"application/set-registration-initiation\":{\"source\":\"iana\",\"extensions\":[\"setreg\"]},\"application/sgml\":{\"source\":\"iana\"},\"application/sgml-open-catalog\":{\"source\":\"iana\"},\"application/shf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"shf\"]},\"application/sieve\":{\"source\":\"iana\",\"extensions\":[\"siv\",\"sieve\"]},\"application/simple-filter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/simple-message-summary\":{\"source\":\"iana\"},\"application/simplesymbolcontainer\":{\"source\":\"iana\"},\"application/slate\":{\"source\":\"iana\"},\"application/smil\":{\"source\":\"iana\"},\"application/smil+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"smi\",\"smil\"]},\"application/smpte336m\":{\"source\":\"iana\"},\"application/soap+fastinfoset\":{\"source\":\"iana\"},\"application/soap+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sparql-query\":{\"source\":\"iana\",\"extensions\":[\"rq\"]},\"application/sparql-results+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"srx\"]},\"application/spirits-event+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sql\":{\"source\":\"iana\"},\"application/srgs\":{\"source\":\"iana\",\"extensions\":[\"gram\"]},\"application/srgs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"grxml\"]},\"application/sru+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sru\"]},\"application/ssdl+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ssdl\"]},\"application/ssml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ssml\"]},\"application/stix+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tamp-apex-update\":{\"source\":\"iana\"},\"application/tamp-apex-update-confirm\":{\"source\":\"iana\"},\"application/tamp-community-update\":{\"source\":\"iana\"},\"application/tamp-community-update-confirm\":{\"source\":\"iana\"},\"application/tamp-error\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust-confirm\":{\"source\":\"iana\"},\"application/tamp-status-query\":{\"source\":\"iana\"},\"application/tamp-status-response\":{\"source\":\"iana\"},\"application/tamp-update\":{\"source\":\"iana\"},\"application/tamp-update-confirm\":{\"source\":\"iana\"},\"application/tar\":{\"compressible\":true},\"application/taxii+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tei\",\"teicorpus\"]},\"application/tetra_isi\":{\"source\":\"iana\"},\"application/thraud+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tfi\"]},\"application/timestamp-query\":{\"source\":\"iana\"},\"application/timestamp-reply\":{\"source\":\"iana\"},\"application/timestamped-data\":{\"source\":\"iana\",\"extensions\":[\"tsd\"]},\"application/tlsrpt+gzip\":{\"source\":\"iana\"},\"application/tlsrpt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tnauthlist\":{\"source\":\"iana\"},\"application/trickle-ice-sdpfrag\":{\"source\":\"iana\"},\"application/trig\":{\"source\":\"iana\"},\"application/ttml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/tve-trigger\":{\"source\":\"iana\"},\"application/tzif\":{\"source\":\"iana\"},\"application/tzif-leap\":{\"source\":\"iana\"},\"application/ulpfec\":{\"source\":\"iana\"},\"application/urc-grpsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-ressheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-targetdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-uisocketdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vemmi\":{\"source\":\"iana\"},\"application/vividence.scriptfile\":{\"source\":\"apache\"},\"application/vnd.1000minds.decision-model+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose-pc3ch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-v2x-local-service-information\":{\"source\":\"iana\"},\"application/vnd.3gpp.access-transfer-events+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.bsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.gmop+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mc-signalling-ear\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-payload\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-signalling\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-floor-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-signed+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-init-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-transmission-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mid-call+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.pic-bw-large\":{\"source\":\"iana\",\"extensions\":[\"plb\"]},\"application/vnd.3gpp.pic-bw-small\":{\"source\":\"iana\",\"extensions\":[\"psb\"]},\"application/vnd.3gpp.pic-bw-var\":{\"source\":\"iana\",\"extensions\":[\"pvb\"]},\"application/vnd.3gpp.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp.sms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-ext+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.state-and-event-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.ussd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.bcmcsinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp2.tcap\":{\"source\":\"iana\",\"extensions\":[\"tcap\"]},\"application/vnd.3lightssoftware.imagescal\":{\"source\":\"iana\"},\"application/vnd.3m.post-it-notes\":{\"source\":\"iana\",\"extensions\":[\"pwn\"]},\"application/vnd.accpac.simply.aso\":{\"source\":\"iana\",\"extensions\":[\"aso\"]},\"application/vnd.accpac.simply.imp\":{\"source\":\"iana\",\"extensions\":[\"imp\"]},\"application/vnd.acucobol\":{\"source\":\"iana\",\"extensions\":[\"acu\"]},\"application/vnd.acucorp\":{\"source\":\"iana\",\"extensions\":[\"atc\",\"acutc\"]},\"application/vnd.adobe.air-application-installer-package+zip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"air\"]},\"application/vnd.adobe.flash.movie\":{\"source\":\"iana\"},\"application/vnd.adobe.formscentral.fcdt\":{\"source\":\"iana\",\"extensions\":[\"fcdt\"]},\"application/vnd.adobe.fxp\":{\"source\":\"iana\",\"extensions\":[\"fxp\",\"fxpl\"]},\"application/vnd.adobe.partial-upload\":{\"source\":\"iana\"},\"application/vnd.adobe.xdp+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdp\"]},\"application/vnd.adobe.xfdf\":{\"source\":\"iana\",\"extensions\":[\"xfdf\"]},\"application/vnd.aether.imp\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata\":{\"source\":\"iana\"},\"application/vnd.afpc.modca\":{\"source\":\"iana\"},\"application/vnd.ah-barcode\":{\"source\":\"iana\"},\"application/vnd.ahead.space\":{\"source\":\"iana\",\"extensions\":[\"ahead\"]},\"application/vnd.airzip.filesecure.azf\":{\"source\":\"iana\",\"extensions\":[\"azf\"]},\"application/vnd.airzip.filesecure.azs\":{\"source\":\"iana\",\"extensions\":[\"azs\"]},\"application/vnd.amadeus+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.amazon.ebook\":{\"source\":\"apache\",\"extensions\":[\"azw\"]},\"application/vnd.amazon.mobi8-ebook\":{\"source\":\"iana\"},\"application/vnd.americandynamics.acc\":{\"source\":\"iana\",\"extensions\":[\"acc\"]},\"application/vnd.amiga.ami\":{\"source\":\"iana\",\"extensions\":[\"ami\"]},\"application/vnd.amundsen.maze+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.android.package-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"apk\"]},\"application/vnd.anki\":{\"source\":\"iana\"},\"application/vnd.anser-web-certificate-issue-initiation\":{\"source\":\"iana\",\"extensions\":[\"cii\"]},\"application/vnd.anser-web-funds-transfer-initiation\":{\"source\":\"apache\",\"extensions\":[\"fti\"]},\"application/vnd.antix.game-component\":{\"source\":\"iana\",\"extensions\":[\"atx\"]},\"application/vnd.apache.thrift.binary\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.compact\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.json\":{\"source\":\"iana\"},\"application/vnd.api+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apothekende.reservation+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apple.installer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpkg\"]},\"application/vnd.apple.keynote\":{\"source\":\"iana\",\"extensions\":[\"keynote\"]},\"application/vnd.apple.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"m3u8\"]},\"application/vnd.apple.numbers\":{\"source\":\"iana\",\"extensions\":[\"numbers\"]},\"application/vnd.apple.pages\":{\"source\":\"iana\",\"extensions\":[\"pages\"]},\"application/vnd.apple.pkpass\":{\"compressible\":false,\"extensions\":[\"pkpass\"]},\"application/vnd.arastra.swi\":{\"source\":\"iana\"},\"application/vnd.aristanetworks.swi\":{\"source\":\"iana\",\"extensions\":[\"swi\"]},\"application/vnd.artisan+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.artsquare\":{\"source\":\"iana\"},\"application/vnd.astraea-software.iota\":{\"source\":\"iana\",\"extensions\":[\"iota\"]},\"application/vnd.audiograph\":{\"source\":\"iana\",\"extensions\":[\"aep\"]},\"application/vnd.autopackage\":{\"source\":\"iana\"},\"application/vnd.avalon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.avistar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmpr\":{\"source\":\"iana\"},\"application/vnd.banana-accounting\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bekitzur-stech+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bint.med-content\":{\"source\":\"iana\"},\"application/vnd.biopax.rdf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.blink-idb-value-wrapper\":{\"source\":\"iana\"},\"application/vnd.blueice.multipass\":{\"source\":\"iana\",\"extensions\":[\"mpm\"]},\"application/vnd.bluetooth.ep.oob\":{\"source\":\"iana\"},\"application/vnd.bluetooth.le.oob\":{\"source\":\"iana\"},\"application/vnd.bmi\":{\"source\":\"iana\",\"extensions\":[\"bmi\"]},\"application/vnd.businessobjects\":{\"source\":\"iana\",\"extensions\":[\"rep\"]},\"application/vnd.byu.uapi+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cab-jscript\":{\"source\":\"iana\"},\"application/vnd.canon-cpdl\":{\"source\":\"iana\"},\"application/vnd.canon-lips\":{\"source\":\"iana\"},\"application/vnd.capasystems-pg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cendio.thinlinc.clientconf\":{\"source\":\"iana\"},\"application/vnd.century-systems.tcp_stream\":{\"source\":\"iana\"},\"application/vnd.chemdraw+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdxml\"]},\"application/vnd.chess-pgn\":{\"source\":\"iana\"},\"application/vnd.chipnuts.karaoke-mmd\":{\"source\":\"iana\",\"extensions\":[\"mmd\"]},\"application/vnd.cinderella\":{\"source\":\"iana\",\"extensions\":[\"cdy\"]},\"application/vnd.cirpack.isdn-ext\":{\"source\":\"iana\"},\"application/vnd.citationstyles.style+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csl\"]},\"application/vnd.claymore\":{\"source\":\"iana\",\"extensions\":[\"cla\"]},\"application/vnd.cloanto.rp9\":{\"source\":\"iana\",\"extensions\":[\"rp9\"]},\"application/vnd.clonk.c4group\":{\"source\":\"iana\",\"extensions\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"]},\"application/vnd.cluetrust.cartomobile-config\":{\"source\":\"iana\",\"extensions\":[\"c11amc\"]},\"application/vnd.cluetrust.cartomobile-config-pkg\":{\"source\":\"iana\",\"extensions\":[\"c11amz\"]},\"application/vnd.coffeescript\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet-template\":{\"source\":\"iana\"},\"application/vnd.collection+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.doc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.next+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.comicbook+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.comicbook-rar\":{\"source\":\"iana\"},\"application/vnd.commerce-battelle\":{\"source\":\"iana\"},\"application/vnd.commonspace\":{\"source\":\"iana\",\"extensions\":[\"csp\"]},\"application/vnd.contact.cmsg\":{\"source\":\"iana\",\"extensions\":[\"cdbcmsg\"]},\"application/vnd.coreos.ignition+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cosmocaller\":{\"source\":\"iana\",\"extensions\":[\"cmc\"]},\"application/vnd.crick.clicker\":{\"source\":\"iana\",\"extensions\":[\"clkx\"]},\"application/vnd.crick.clicker.keyboard\":{\"source\":\"iana\",\"extensions\":[\"clkk\"]},\"application/vnd.crick.clicker.palette\":{\"source\":\"iana\",\"extensions\":[\"clkp\"]},\"application/vnd.crick.clicker.template\":{\"source\":\"iana\",\"extensions\":[\"clkt\"]},\"application/vnd.crick.clicker.wordbank\":{\"source\":\"iana\",\"extensions\":[\"clkw\"]},\"application/vnd.criticaltools.wbs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wbs\"]},\"application/vnd.ctc-posml\":{\"source\":\"iana\",\"extensions\":[\"pml\"]},\"application/vnd.ctct.ws+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cups-pdf\":{\"source\":\"iana\"},\"application/vnd.cups-postscript\":{\"source\":\"iana\"},\"application/vnd.cups-ppd\":{\"source\":\"iana\",\"extensions\":[\"ppd\"]},\"application/vnd.cups-raster\":{\"source\":\"iana\"},\"application/vnd.cups-raw\":{\"source\":\"iana\"},\"application/vnd.curl\":{\"source\":\"iana\"},\"application/vnd.curl.car\":{\"source\":\"apache\",\"extensions\":[\"car\"]},\"application/vnd.curl.pcurl\":{\"source\":\"apache\",\"extensions\":[\"pcurl\"]},\"application/vnd.cyan.dean.root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cybank\":{\"source\":\"iana\"},\"application/vnd.d2l.coursepackage1p0+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.dart\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dart\"]},\"application/vnd.data-vision.rdz\":{\"source\":\"iana\",\"extensions\":[\"rdz\"]},\"application/vnd.datapackage+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dataresource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.debian.binary-package\":{\"source\":\"iana\"},\"application/vnd.dece.data\":{\"source\":\"iana\",\"extensions\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"]},\"application/vnd.dece.ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uvt\",\"uvvt\"]},\"application/vnd.dece.unspecified\":{\"source\":\"iana\",\"extensions\":[\"uvx\",\"uvvx\"]},\"application/vnd.dece.zip\":{\"source\":\"iana\",\"extensions\":[\"uvz\",\"uvvz\"]},\"application/vnd.denovo.fcselayout-link\":{\"source\":\"iana\",\"extensions\":[\"fe_launch\"]},\"application/vnd.desmume.movie\":{\"source\":\"iana\"},\"application/vnd.dir-bi.plate-dl-nosuffix\":{\"source\":\"iana\"},\"application/vnd.dm.delegation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dna\":{\"source\":\"iana\",\"extensions\":[\"dna\"]},\"application/vnd.document+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dolby.mlp\":{\"source\":\"apache\",\"extensions\":[\"mlp\"]},\"application/vnd.dolby.mobile.1\":{\"source\":\"iana\"},\"application/vnd.dolby.mobile.2\":{\"source\":\"iana\"},\"application/vnd.doremir.scorecloud-binary-document\":{\"source\":\"iana\"},\"application/vnd.dpgraph\":{\"source\":\"iana\",\"extensions\":[\"dpg\"]},\"application/vnd.dreamfactory\":{\"source\":\"iana\",\"extensions\":[\"dfac\"]},\"application/vnd.drive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ds-keypoint\":{\"source\":\"apache\",\"extensions\":[\"kpxx\"]},\"application/vnd.dtg.local\":{\"source\":\"iana\"},\"application/vnd.dtg.local.flash\":{\"source\":\"iana\"},\"application/vnd.dtg.local.html\":{\"source\":\"iana\"},\"application/vnd.dvb.ait\":{\"source\":\"iana\",\"extensions\":[\"ait\"]},\"application/vnd.dvb.dvbj\":{\"source\":\"iana\"},\"application/vnd.dvb.esgcontainer\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcdftnotifaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess2\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgpdd\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcroaming\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-base\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-enhancement\":{\"source\":\"iana\"},\"application/vnd.dvb.notif-aggregate-root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-container+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-generic+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-msglist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-init+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.pfr\":{\"source\":\"iana\"},\"application/vnd.dvb.service\":{\"source\":\"iana\",\"extensions\":[\"svc\"]},\"application/vnd.dxr\":{\"source\":\"iana\"},\"application/vnd.dynageo\":{\"source\":\"iana\",\"extensions\":[\"geo\"]},\"application/vnd.dzr\":{\"source\":\"iana\"},\"application/vnd.easykaraoke.cdgdownload\":{\"source\":\"iana\"},\"application/vnd.ecdis-update\":{\"source\":\"iana\"},\"application/vnd.ecip.rlp\":{\"source\":\"iana\"},\"application/vnd.ecowin.chart\":{\"source\":\"iana\",\"extensions\":[\"mag\"]},\"application/vnd.ecowin.filerequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.fileupdate\":{\"source\":\"iana\"},\"application/vnd.ecowin.series\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesrequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesupdate\":{\"source\":\"iana\"},\"application/vnd.efi.img\":{\"source\":\"iana\"},\"application/vnd.efi.iso\":{\"source\":\"iana\"},\"application/vnd.emclient.accessrequest+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.enliven\":{\"source\":\"iana\",\"extensions\":[\"nml\"]},\"application/vnd.enphase.envoy\":{\"source\":\"iana\"},\"application/vnd.eprints.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.epson.esf\":{\"source\":\"iana\",\"extensions\":[\"esf\"]},\"application/vnd.epson.msf\":{\"source\":\"iana\",\"extensions\":[\"msf\"]},\"application/vnd.epson.quickanime\":{\"source\":\"iana\",\"extensions\":[\"qam\"]},\"application/vnd.epson.salt\":{\"source\":\"iana\",\"extensions\":[\"slt\"]},\"application/vnd.epson.ssf\":{\"source\":\"iana\",\"extensions\":[\"ssf\"]},\"application/vnd.ericsson.quickcall\":{\"source\":\"iana\"},\"application/vnd.espass-espass+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.eszigno3+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es3\",\"et3\"]},\"application/vnd.etsi.aoc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.asic-e+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.asic-s+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.cug+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvcommand+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-bc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-cod+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-npvr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvservice+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mcid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mheg5\":{\"source\":\"iana\"},\"application/vnd.etsi.overload-control-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.pstn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.sci+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.simservs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.timestamp-token\":{\"source\":\"iana\"},\"application/vnd.etsi.tsl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.tsl.der\":{\"source\":\"iana\"},\"application/vnd.eudora.data\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.profile\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.settings\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.theme\":{\"source\":\"iana\"},\"application/vnd.exstream-empower+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.exstream-package\":{\"source\":\"iana\"},\"application/vnd.ezpix-album\":{\"source\":\"iana\",\"extensions\":[\"ez2\"]},\"application/vnd.ezpix-package\":{\"source\":\"iana\",\"extensions\":[\"ez3\"]},\"application/vnd.f-secure.mobile\":{\"source\":\"iana\"},\"application/vnd.fastcopy-disk-image\":{\"source\":\"iana\"},\"application/vnd.fdf\":{\"source\":\"iana\",\"extensions\":[\"fdf\"]},\"application/vnd.fdsn.mseed\":{\"source\":\"iana\",\"extensions\":[\"mseed\"]},\"application/vnd.fdsn.seed\":{\"source\":\"iana\",\"extensions\":[\"seed\",\"dataless\"]},\"application/vnd.ffsns\":{\"source\":\"iana\"},\"application/vnd.filmit.zfc\":{\"source\":\"iana\"},\"application/vnd.fints\":{\"source\":\"iana\"},\"application/vnd.firemonkeys.cloudcell\":{\"source\":\"iana\"},\"application/vnd.flographit\":{\"source\":\"iana\",\"extensions\":[\"gph\"]},\"application/vnd.fluxtime.clip\":{\"source\":\"iana\",\"extensions\":[\"ftc\"]},\"application/vnd.font-fontforge-sfd\":{\"source\":\"iana\"},\"application/vnd.framemaker\":{\"source\":\"iana\",\"extensions\":[\"fm\",\"frame\",\"maker\",\"book\"]},\"application/vnd.frogans.fnc\":{\"source\":\"iana\",\"extensions\":[\"fnc\"]},\"application/vnd.frogans.ltf\":{\"source\":\"iana\",\"extensions\":[\"ltf\"]},\"application/vnd.fsc.weblaunch\":{\"source\":\"iana\",\"extensions\":[\"fsc\"]},\"application/vnd.fujitsu.oasys\":{\"source\":\"iana\",\"extensions\":[\"oas\"]},\"application/vnd.fujitsu.oasys2\":{\"source\":\"iana\",\"extensions\":[\"oa2\"]},\"application/vnd.fujitsu.oasys3\":{\"source\":\"iana\",\"extensions\":[\"oa3\"]},\"application/vnd.fujitsu.oasysgp\":{\"source\":\"iana\",\"extensions\":[\"fg5\"]},\"application/vnd.fujitsu.oasysprs\":{\"source\":\"iana\",\"extensions\":[\"bh2\"]},\"application/vnd.fujixerox.art-ex\":{\"source\":\"iana\"},\"application/vnd.fujixerox.art4\":{\"source\":\"iana\"},\"application/vnd.fujixerox.ddd\":{\"source\":\"iana\",\"extensions\":[\"ddd\"]},\"application/vnd.fujixerox.docuworks\":{\"source\":\"iana\",\"extensions\":[\"xdw\"]},\"application/vnd.fujixerox.docuworks.binder\":{\"source\":\"iana\",\"extensions\":[\"xbd\"]},\"application/vnd.fujixerox.docuworks.container\":{\"source\":\"iana\"},\"application/vnd.fujixerox.hbpl\":{\"source\":\"iana\"},\"application/vnd.fut-misnet\":{\"source\":\"iana\"},\"application/vnd.futoin+cbor\":{\"source\":\"iana\"},\"application/vnd.futoin+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.fuzzysheet\":{\"source\":\"iana\",\"extensions\":[\"fzs\"]},\"application/vnd.genomatix.tuxedo\":{\"source\":\"iana\",\"extensions\":[\"txd\"]},\"application/vnd.geo+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geocube+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geogebra.file\":{\"source\":\"iana\",\"extensions\":[\"ggb\"]},\"application/vnd.geogebra.tool\":{\"source\":\"iana\",\"extensions\":[\"ggt\"]},\"application/vnd.geometry-explorer\":{\"source\":\"iana\",\"extensions\":[\"gex\",\"gre\"]},\"application/vnd.geonext\":{\"source\":\"iana\",\"extensions\":[\"gxt\"]},\"application/vnd.geoplan\":{\"source\":\"iana\",\"extensions\":[\"g2w\"]},\"application/vnd.geospace\":{\"source\":\"iana\",\"extensions\":[\"g3w\"]},\"application/vnd.gerber\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt-response\":{\"source\":\"iana\"},\"application/vnd.gmx\":{\"source\":\"iana\",\"extensions\":[\"gmx\"]},\"application/vnd.google-apps.document\":{\"compressible\":false,\"extensions\":[\"gdoc\"]},\"application/vnd.google-apps.presentation\":{\"compressible\":false,\"extensions\":[\"gslides\"]},\"application/vnd.google-apps.spreadsheet\":{\"compressible\":false,\"extensions\":[\"gsheet\"]},\"application/vnd.google-earth.kml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"kml\"]},\"application/vnd.google-earth.kmz\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"kmz\"]},\"application/vnd.gov.sk.e-form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.gov.sk.e-form+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.gov.sk.xmldatacontainer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.grafeq\":{\"source\":\"iana\",\"extensions\":[\"gqf\",\"gqs\"]},\"application/vnd.gridmp\":{\"source\":\"iana\"},\"application/vnd.groove-account\":{\"source\":\"iana\",\"extensions\":[\"gac\"]},\"application/vnd.groove-help\":{\"source\":\"iana\",\"extensions\":[\"ghf\"]},\"application/vnd.groove-identity-message\":{\"source\":\"iana\",\"extensions\":[\"gim\"]},\"application/vnd.groove-injector\":{\"source\":\"iana\",\"extensions\":[\"grv\"]},\"application/vnd.groove-tool-message\":{\"source\":\"iana\",\"extensions\":[\"gtm\"]},\"application/vnd.groove-tool-template\":{\"source\":\"iana\",\"extensions\":[\"tpl\"]},\"application/vnd.groove-vcard\":{\"source\":\"iana\",\"extensions\":[\"vcg\"]},\"application/vnd.hal+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hal+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"hal\"]},\"application/vnd.handheld-entertainment+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zmm\"]},\"application/vnd.hbci\":{\"source\":\"iana\",\"extensions\":[\"hbci\"]},\"application/vnd.hc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hcl-bireports\":{\"source\":\"iana\"},\"application/vnd.hdt\":{\"source\":\"iana\"},\"application/vnd.heroku+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hhe.lesson-player\":{\"source\":\"iana\",\"extensions\":[\"les\"]},\"application/vnd.hp-hpgl\":{\"source\":\"iana\",\"extensions\":[\"hpgl\"]},\"application/vnd.hp-hpid\":{\"source\":\"iana\",\"extensions\":[\"hpid\"]},\"application/vnd.hp-hps\":{\"source\":\"iana\",\"extensions\":[\"hps\"]},\"application/vnd.hp-jlyt\":{\"source\":\"iana\",\"extensions\":[\"jlt\"]},\"application/vnd.hp-pcl\":{\"source\":\"iana\",\"extensions\":[\"pcl\"]},\"application/vnd.hp-pclxl\":{\"source\":\"iana\",\"extensions\":[\"pclxl\"]},\"application/vnd.httphone\":{\"source\":\"iana\"},\"application/vnd.hydrostatix.sof-data\":{\"source\":\"iana\",\"extensions\":[\"sfd-hdstx\"]},\"application/vnd.hyper+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyper-item+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyperdrive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hzn-3d-crossword\":{\"source\":\"iana\"},\"application/vnd.ibm.afplinedata\":{\"source\":\"iana\"},\"application/vnd.ibm.electronic-media\":{\"source\":\"iana\"},\"application/vnd.ibm.minipay\":{\"source\":\"iana\",\"extensions\":[\"mpy\"]},\"application/vnd.ibm.modcap\":{\"source\":\"iana\",\"extensions\":[\"afp\",\"listafp\",\"list3820\"]},\"application/vnd.ibm.rights-management\":{\"source\":\"iana\",\"extensions\":[\"irm\"]},\"application/vnd.ibm.secure-container\":{\"source\":\"iana\",\"extensions\":[\"sc\"]},\"application/vnd.iccprofile\":{\"source\":\"iana\",\"extensions\":[\"icc\",\"icm\"]},\"application/vnd.ieee.1905\":{\"source\":\"iana\"},\"application/vnd.igloader\":{\"source\":\"iana\",\"extensions\":[\"igl\"]},\"application/vnd.imagemeter.folder+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.imagemeter.image+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.immervision-ivp\":{\"source\":\"iana\",\"extensions\":[\"ivp\"]},\"application/vnd.immervision-ivu\":{\"source\":\"iana\",\"extensions\":[\"ivu\"]},\"application/vnd.ims.imsccv1p1\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p2\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p3\":{\"source\":\"iana\"},\"application/vnd.ims.lis.v2.result+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolconsumerprofile+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy.id+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings.simple+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informedcontrol.rms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informix-visionary\":{\"source\":\"iana\"},\"application/vnd.infotech.project\":{\"source\":\"iana\"},\"application/vnd.infotech.project+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.innopath.wamp.notification\":{\"source\":\"iana\"},\"application/vnd.insors.igm\":{\"source\":\"iana\",\"extensions\":[\"igm\"]},\"application/vnd.intercon.formnet\":{\"source\":\"iana\",\"extensions\":[\"xpw\",\"xpx\"]},\"application/vnd.intergeo\":{\"source\":\"iana\",\"extensions\":[\"i2g\"]},\"application/vnd.intertrust.digibox\":{\"source\":\"iana\"},\"application/vnd.intertrust.nncp\":{\"source\":\"iana\"},\"application/vnd.intu.qbo\":{\"source\":\"iana\",\"extensions\":[\"qbo\"]},\"application/vnd.intu.qfx\":{\"source\":\"iana\",\"extensions\":[\"qfx\"]},\"application/vnd.iptc.g2.catalogitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.conceptitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.knowledgeitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.packageitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.planningitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ipunplugged.rcprofile\":{\"source\":\"iana\",\"extensions\":[\"rcprofile\"]},\"application/vnd.irepository.package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"irp\"]},\"application/vnd.is-xpr\":{\"source\":\"iana\",\"extensions\":[\"xpr\"]},\"application/vnd.isac.fcs\":{\"source\":\"iana\",\"extensions\":[\"fcs\"]},\"application/vnd.jam\":{\"source\":\"iana\",\"extensions\":[\"jam\"]},\"application/vnd.japannet-directory-service\":{\"source\":\"iana\"},\"application/vnd.japannet-jpnstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-payment-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-registration\":{\"source\":\"iana\"},\"application/vnd.japannet-registration-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-setstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-verification\":{\"source\":\"iana\"},\"application/vnd.japannet-verification-wakeup\":{\"source\":\"iana\"},\"application/vnd.jcp.javame.midlet-rms\":{\"source\":\"iana\",\"extensions\":[\"rms\"]},\"application/vnd.jisp\":{\"source\":\"iana\",\"extensions\":[\"jisp\"]},\"application/vnd.joost.joda-archive\":{\"source\":\"iana\",\"extensions\":[\"joda\"]},\"application/vnd.jsk.isdn-ngn\":{\"source\":\"iana\"},\"application/vnd.kahootz\":{\"source\":\"iana\",\"extensions\":[\"ktz\",\"ktr\"]},\"application/vnd.kde.karbon\":{\"source\":\"iana\",\"extensions\":[\"karbon\"]},\"application/vnd.kde.kchart\":{\"source\":\"iana\",\"extensions\":[\"chrt\"]},\"application/vnd.kde.kformula\":{\"source\":\"iana\",\"extensions\":[\"kfo\"]},\"application/vnd.kde.kivio\":{\"source\":\"iana\",\"extensions\":[\"flw\"]},\"application/vnd.kde.kontour\":{\"source\":\"iana\",\"extensions\":[\"kon\"]},\"application/vnd.kde.kpresenter\":{\"source\":\"iana\",\"extensions\":[\"kpr\",\"kpt\"]},\"application/vnd.kde.kspread\":{\"source\":\"iana\",\"extensions\":[\"ksp\"]},\"application/vnd.kde.kword\":{\"source\":\"iana\",\"extensions\":[\"kwd\",\"kwt\"]},\"application/vnd.kenameaapp\":{\"source\":\"iana\",\"extensions\":[\"htke\"]},\"application/vnd.kidspiration\":{\"source\":\"iana\",\"extensions\":[\"kia\"]},\"application/vnd.kinar\":{\"source\":\"iana\",\"extensions\":[\"kne\",\"knp\"]},\"application/vnd.koan\":{\"source\":\"iana\",\"extensions\":[\"skp\",\"skd\",\"skt\",\"skm\"]},\"application/vnd.kodak-descriptor\":{\"source\":\"iana\",\"extensions\":[\"sse\"]},\"application/vnd.las.las+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.las.las+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lasxml\"]},\"application/vnd.leap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.liberty-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.llamagraphics.life-balance.desktop\":{\"source\":\"iana\",\"extensions\":[\"lbd\"]},\"application/vnd.llamagraphics.life-balance.exchange+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lbe\"]},\"application/vnd.lotus-1-2-3\":{\"source\":\"iana\",\"extensions\":[\"123\"]},\"application/vnd.lotus-approach\":{\"source\":\"iana\",\"extensions\":[\"apr\"]},\"application/vnd.lotus-freelance\":{\"source\":\"iana\",\"extensions\":[\"pre\"]},\"application/vnd.lotus-notes\":{\"source\":\"iana\",\"extensions\":[\"nsf\"]},\"application/vnd.lotus-organizer\":{\"source\":\"iana\",\"extensions\":[\"org\"]},\"application/vnd.lotus-screencam\":{\"source\":\"iana\",\"extensions\":[\"scm\"]},\"application/vnd.lotus-wordpro\":{\"source\":\"iana\",\"extensions\":[\"lwp\"]},\"application/vnd.macports.portpkg\":{\"source\":\"iana\",\"extensions\":[\"portpkg\"]},\"application/vnd.mapbox-vector-tile\":{\"source\":\"iana\"},\"application/vnd.marlin.drm.actiontoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.conftoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.license+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.mdcf\":{\"source\":\"iana\"},\"application/vnd.mason+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.maxmind.maxmind-db\":{\"source\":\"iana\"},\"application/vnd.mcd\":{\"source\":\"iana\",\"extensions\":[\"mcd\"]},\"application/vnd.medcalcdata\":{\"source\":\"iana\",\"extensions\":[\"mc1\"]},\"application/vnd.mediastation.cdkey\":{\"source\":\"iana\",\"extensions\":[\"cdkey\"]},\"application/vnd.meridian-slingshot\":{\"source\":\"iana\"},\"application/vnd.mfer\":{\"source\":\"iana\",\"extensions\":[\"mwf\"]},\"application/vnd.mfmp\":{\"source\":\"iana\",\"extensions\":[\"mfm\"]},\"application/vnd.micro+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.micrografx.flo\":{\"source\":\"iana\",\"extensions\":[\"flo\"]},\"application/vnd.micrografx.igx\":{\"source\":\"iana\",\"extensions\":[\"igx\"]},\"application/vnd.microsoft.portable-executable\":{\"source\":\"iana\"},\"application/vnd.microsoft.windows.thumbnail-cache\":{\"source\":\"iana\"},\"application/vnd.miele+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.mif\":{\"source\":\"iana\",\"extensions\":[\"mif\"]},\"application/vnd.minisoft-hp3000-save\":{\"source\":\"iana\"},\"application/vnd.mitsubishi.misty-guard.trustweb\":{\"source\":\"iana\"},\"application/vnd.mobius.daf\":{\"source\":\"iana\",\"extensions\":[\"daf\"]},\"application/vnd.mobius.dis\":{\"source\":\"iana\",\"extensions\":[\"dis\"]},\"application/vnd.mobius.mbk\":{\"source\":\"iana\",\"extensions\":[\"mbk\"]},\"application/vnd.mobius.mqy\":{\"source\":\"iana\",\"extensions\":[\"mqy\"]},\"application/vnd.mobius.msl\":{\"source\":\"iana\",\"extensions\":[\"msl\"]},\"application/vnd.mobius.plc\":{\"source\":\"iana\",\"extensions\":[\"plc\"]},\"application/vnd.mobius.txf\":{\"source\":\"iana\",\"extensions\":[\"txf\"]},\"application/vnd.mophun.application\":{\"source\":\"iana\",\"extensions\":[\"mpn\"]},\"application/vnd.mophun.certificate\":{\"source\":\"iana\",\"extensions\":[\"mpc\"]},\"application/vnd.motorola.flexsuite\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.adsi\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.fis\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.gotap\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.kmr\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.ttc\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.wem\":{\"source\":\"iana\"},\"application/vnd.motorola.iprm\":{\"source\":\"iana\"},\"application/vnd.mozilla.xul+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xul\"]},\"application/vnd.ms-3mfdocument\":{\"source\":\"iana\"},\"application/vnd.ms-artgalry\":{\"source\":\"iana\",\"extensions\":[\"cil\"]},\"application/vnd.ms-asf\":{\"source\":\"iana\"},\"application/vnd.ms-cab-compressed\":{\"source\":\"iana\",\"extensions\":[\"cab\"]},\"application/vnd.ms-color.iccprofile\":{\"source\":\"apache\"},\"application/vnd.ms-excel\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"]},\"application/vnd.ms-excel.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlam\"]},\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsb\"]},\"application/vnd.ms-excel.sheet.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsm\"]},\"application/vnd.ms-excel.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xltm\"]},\"application/vnd.ms-fontobject\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eot\"]},\"application/vnd.ms-htmlhelp\":{\"source\":\"iana\",\"extensions\":[\"chm\"]},\"application/vnd.ms-ims\":{\"source\":\"iana\",\"extensions\":[\"ims\"]},\"application/vnd.ms-lrm\":{\"source\":\"iana\",\"extensions\":[\"lrm\"]},\"application/vnd.ms-office.activex+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-officetheme\":{\"source\":\"iana\",\"extensions\":[\"thmx\"]},\"application/vnd.ms-opentype\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-outlook\":{\"compressible\":false,\"extensions\":[\"msg\"]},\"application/vnd.ms-package.obfuscated-opentype\":{\"source\":\"apache\"},\"application/vnd.ms-pki.seccat\":{\"source\":\"apache\",\"extensions\":[\"cat\"]},\"application/vnd.ms-pki.stl\":{\"source\":\"apache\",\"extensions\":[\"stl\"]},\"application/vnd.ms-playready.initiator+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-powerpoint\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ppt\",\"pps\",\"pot\"]},\"application/vnd.ms-powerpoint.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppam\"]},\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"pptm\"]},\"application/vnd.ms-powerpoint.slide.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"sldm\"]},\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppsm\"]},\"application/vnd.ms-powerpoint.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"potm\"]},\"application/vnd.ms-printdevicecapabilities+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-printing.printticket+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-printschematicket+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-project\":{\"source\":\"iana\",\"extensions\":[\"mpp\",\"mpt\"]},\"application/vnd.ms-tnef\":{\"source\":\"iana\"},\"application/vnd.ms-windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.nwprinting.oob\":{\"source\":\"iana\"},\"application/vnd.ms-windows.printerpairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.wsd.oob\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-resp\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-resp\":{\"source\":\"iana\"},\"application/vnd.ms-word.document.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"docm\"]},\"application/vnd.ms-word.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"dotm\"]},\"application/vnd.ms-works\":{\"source\":\"iana\",\"extensions\":[\"wps\",\"wks\",\"wcm\",\"wdb\"]},\"application/vnd.ms-wpl\":{\"source\":\"iana\",\"extensions\":[\"wpl\"]},\"application/vnd.ms-xpsdocument\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xps\"]},\"application/vnd.msa-disk-image\":{\"source\":\"iana\"},\"application/vnd.mseq\":{\"source\":\"iana\",\"extensions\":[\"mseq\"]},\"application/vnd.msign\":{\"source\":\"iana\"},\"application/vnd.multiad.creator\":{\"source\":\"iana\"},\"application/vnd.multiad.creator.cif\":{\"source\":\"iana\"},\"application/vnd.music-niff\":{\"source\":\"iana\"},\"application/vnd.musician\":{\"source\":\"iana\",\"extensions\":[\"mus\"]},\"application/vnd.muvee.style\":{\"source\":\"iana\",\"extensions\":[\"msty\"]},\"application/vnd.mynfc\":{\"source\":\"iana\",\"extensions\":[\"taglet\"]},\"application/vnd.ncd.control\":{\"source\":\"iana\"},\"application/vnd.ncd.reference\":{\"source\":\"iana\"},\"application/vnd.nearst.inv+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nervana\":{\"source\":\"iana\"},\"application/vnd.netfpx\":{\"source\":\"iana\"},\"application/vnd.neurolanguage.nlu\":{\"source\":\"iana\",\"extensions\":[\"nlu\"]},\"application/vnd.nimn\":{\"source\":\"iana\"},\"application/vnd.nintendo.nitro.rom\":{\"source\":\"iana\"},\"application/vnd.nintendo.snes.rom\":{\"source\":\"iana\"},\"application/vnd.nitf\":{\"source\":\"iana\",\"extensions\":[\"ntf\",\"nitf\"]},\"application/vnd.noblenet-directory\":{\"source\":\"iana\",\"extensions\":[\"nnd\"]},\"application/vnd.noblenet-sealer\":{\"source\":\"iana\",\"extensions\":[\"nns\"]},\"application/vnd.noblenet-web\":{\"source\":\"iana\",\"extensions\":[\"nnw\"]},\"application/vnd.nokia.catalogs\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.iptv.config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.isds-radio-presets\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.landmarkcollection+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.ac+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.data\":{\"source\":\"iana\",\"extensions\":[\"ngdat\"]},\"application/vnd.nokia.n-gage.symbian.install\":{\"source\":\"iana\",\"extensions\":[\"n-gage\"]},\"application/vnd.nokia.ncd\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.radio-preset\":{\"source\":\"iana\",\"extensions\":[\"rpst\"]},\"application/vnd.nokia.radio-presets\":{\"source\":\"iana\",\"extensions\":[\"rpss\"]},\"application/vnd.novadigm.edm\":{\"source\":\"iana\",\"extensions\":[\"edm\"]},\"application/vnd.novadigm.edx\":{\"source\":\"iana\",\"extensions\":[\"edx\"]},\"application/vnd.novadigm.ext\":{\"source\":\"iana\",\"extensions\":[\"ext\"]},\"application/vnd.ntt-local.content-share\":{\"source\":\"iana\"},\"application/vnd.ntt-local.file-transfer\":{\"source\":\"iana\"},\"application/vnd.ntt-local.ogw_remote-access\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_remote\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_tcp_stream\":{\"source\":\"iana\"},\"application/vnd.oasis.opendocument.chart\":{\"source\":\"iana\",\"extensions\":[\"odc\"]},\"application/vnd.oasis.opendocument.chart-template\":{\"source\":\"iana\",\"extensions\":[\"otc\"]},\"application/vnd.oasis.opendocument.database\":{\"source\":\"iana\",\"extensions\":[\"odb\"]},\"application/vnd.oasis.opendocument.formula\":{\"source\":\"iana\",\"extensions\":[\"odf\"]},\"application/vnd.oasis.opendocument.formula-template\":{\"source\":\"iana\",\"extensions\":[\"odft\"]},\"application/vnd.oasis.opendocument.graphics\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odg\"]},\"application/vnd.oasis.opendocument.graphics-template\":{\"source\":\"iana\",\"extensions\":[\"otg\"]},\"application/vnd.oasis.opendocument.image\":{\"source\":\"iana\",\"extensions\":[\"odi\"]},\"application/vnd.oasis.opendocument.image-template\":{\"source\":\"iana\",\"extensions\":[\"oti\"]},\"application/vnd.oasis.opendocument.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odp\"]},\"application/vnd.oasis.opendocument.presentation-template\":{\"source\":\"iana\",\"extensions\":[\"otp\"]},\"application/vnd.oasis.opendocument.spreadsheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ods\"]},\"application/vnd.oasis.opendocument.spreadsheet-template\":{\"source\":\"iana\",\"extensions\":[\"ots\"]},\"application/vnd.oasis.opendocument.text\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odt\"]},\"application/vnd.oasis.opendocument.text-master\":{\"source\":\"iana\",\"extensions\":[\"odm\"]},\"application/vnd.oasis.opendocument.text-template\":{\"source\":\"iana\",\"extensions\":[\"ott\"]},\"application/vnd.oasis.opendocument.text-web\":{\"source\":\"iana\",\"extensions\":[\"oth\"]},\"application/vnd.obn\":{\"source\":\"iana\"},\"application/vnd.ocf+cbor\":{\"source\":\"iana\"},\"application/vnd.oftn.l10n+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessdownload+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessstreaming+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.cspg-hexbinary\":{\"source\":\"iana\"},\"application/vnd.oipf.dae.svg+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.dae.xhtml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.mippvcontrolmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.pae.gem\":{\"source\":\"iana\"},\"application/vnd.oipf.spdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.spdlist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.ueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.userprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.olpc-sugar\":{\"source\":\"iana\",\"extensions\":[\"xo\"]},\"application/vnd.oma-scws-config\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-request\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-response\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.associated-procedure-parameter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.drm-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.imd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.ltkm\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.notification+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.provisioningtrigger\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgboot\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgdd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sgdu\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.simple-symbol-container\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.smartcard-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sprov+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.stkm\":{\"source\":\"iana\"},\"application/vnd.oma.cab-address-book+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-feature-handler+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-pcc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-subs-invite+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-user-prefs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.dcd\":{\"source\":\"iana\"},\"application/vnd.oma.dcdc\":{\"source\":\"iana\"},\"application/vnd.oma.dd2+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dd2\"]},\"application/vnd.oma.drm.risd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.group-usage-list+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+tlv\":{\"source\":\"iana\"},\"application/vnd.oma.pal+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.detailed-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.final-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.groups+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.invocation-descriptor+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.optimized-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.push\":{\"source\":\"iana\"},\"application/vnd.oma.scidm.messages+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.xcap-directory+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-email+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-file+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-folder+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omaloc-supl-init\":{\"source\":\"iana\"},\"application/vnd.onepager\":{\"source\":\"iana\"},\"application/vnd.onepagertamp\":{\"source\":\"iana\"},\"application/vnd.onepagertamx\":{\"source\":\"iana\"},\"application/vnd.onepagertat\":{\"source\":\"iana\"},\"application/vnd.onepagertatp\":{\"source\":\"iana\"},\"application/vnd.onepagertatx\":{\"source\":\"iana\"},\"application/vnd.openblox.game+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openblox.game-binary\":{\"source\":\"iana\"},\"application/vnd.openeye.oeb\":{\"source\":\"iana\"},\"application/vnd.openofficeorg.extension\":{\"source\":\"apache\",\"extensions\":[\"oxt\"]},\"application/vnd.openstreetmap.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.custom-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.customxmlproperties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.extended-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pptx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slide\":{\"source\":\"iana\",\"extensions\":[\"sldx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":{\"source\":\"iana\",\"extensions\":[\"ppsx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tags+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.template\":{\"source\":\"iana\",\"extensions\":[\"potx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xlsx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":{\"source\":\"iana\",\"extensions\":[\"xltx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.theme+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.themeoverride+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.vmldrawing\":{\"source\":\"iana\"},\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"docx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":{\"source\":\"iana\",\"extensions\":[\"dotx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.core-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.relationships+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oracle.resource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.orange.indata\":{\"source\":\"iana\"},\"application/vnd.osa.netdeploy\":{\"source\":\"iana\"},\"application/vnd.osgeo.mapguide.package\":{\"source\":\"iana\",\"extensions\":[\"mgp\"]},\"application/vnd.osgi.bundle\":{\"source\":\"iana\"},\"application/vnd.osgi.dp\":{\"source\":\"iana\",\"extensions\":[\"dp\"]},\"application/vnd.osgi.subsystem\":{\"source\":\"iana\",\"extensions\":[\"esa\"]},\"application/vnd.otps.ct-kip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oxli.countgraph\":{\"source\":\"iana\"},\"application/vnd.pagerduty+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.palm\":{\"source\":\"iana\",\"extensions\":[\"pdb\",\"pqa\",\"oprc\"]},\"application/vnd.panoply\":{\"source\":\"iana\"},\"application/vnd.paos.xml\":{\"source\":\"iana\"},\"application/vnd.patentdive\":{\"source\":\"iana\"},\"application/vnd.patientecommsdoc\":{\"source\":\"iana\"},\"application/vnd.pawaafile\":{\"source\":\"iana\",\"extensions\":[\"paw\"]},\"application/vnd.pcos\":{\"source\":\"iana\"},\"application/vnd.pg.format\":{\"source\":\"iana\",\"extensions\":[\"str\"]},\"application/vnd.pg.osasli\":{\"source\":\"iana\",\"extensions\":[\"ei6\"]},\"application/vnd.piaccess.application-licence\":{\"source\":\"iana\"},\"application/vnd.picsel\":{\"source\":\"iana\",\"extensions\":[\"efif\"]},\"application/vnd.pmi.widget\":{\"source\":\"iana\",\"extensions\":[\"wg\"]},\"application/vnd.poc.group-advertisement+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.pocketlearn\":{\"source\":\"iana\",\"extensions\":[\"plf\"]},\"application/vnd.powerbuilder6\":{\"source\":\"iana\",\"extensions\":[\"pbd\"]},\"application/vnd.powerbuilder6-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75-s\":{\"source\":\"iana\"},\"application/vnd.preminet\":{\"source\":\"iana\"},\"application/vnd.previewsystems.box\":{\"source\":\"iana\",\"extensions\":[\"box\"]},\"application/vnd.proteus.magazine\":{\"source\":\"iana\",\"extensions\":[\"mgz\"]},\"application/vnd.psfs\":{\"source\":\"iana\"},\"application/vnd.publishare-delta-tree\":{\"source\":\"iana\",\"extensions\":[\"qps\"]},\"application/vnd.pvi.ptid1\":{\"source\":\"iana\",\"extensions\":[\"ptid\"]},\"application/vnd.pwg-multiplexed\":{\"source\":\"iana\"},\"application/vnd.pwg-xhtml-print+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.qualcomm.brew-app-res\":{\"source\":\"iana\"},\"application/vnd.quarantainenet\":{\"source\":\"iana\"},\"application/vnd.quark.quarkxpress\":{\"source\":\"iana\",\"extensions\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"]},\"application/vnd.quobject-quoxdocument\":{\"source\":\"iana\"},\"application/vnd.radisys.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-stream+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-base+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-detect+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-sendrecv+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-group+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-speech+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-transform+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rainstor.data\":{\"source\":\"iana\"},\"application/vnd.rapid\":{\"source\":\"iana\"},\"application/vnd.rar\":{\"source\":\"iana\"},\"application/vnd.realvnc.bed\":{\"source\":\"iana\",\"extensions\":[\"bed\"]},\"application/vnd.recordare.musicxml\":{\"source\":\"iana\",\"extensions\":[\"mxl\"]},\"application/vnd.recordare.musicxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musicxml\"]},\"application/vnd.renlearn.rlprint\":{\"source\":\"iana\"},\"application/vnd.restful+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rig.cryptonote\":{\"source\":\"iana\",\"extensions\":[\"cryptonote\"]},\"application/vnd.rim.cod\":{\"source\":\"apache\",\"extensions\":[\"cod\"]},\"application/vnd.rn-realmedia\":{\"source\":\"apache\",\"extensions\":[\"rm\"]},\"application/vnd.rn-realmedia-vbr\":{\"source\":\"apache\",\"extensions\":[\"rmvb\"]},\"application/vnd.route66.link66+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"link66\"]},\"application/vnd.rs-274x\":{\"source\":\"iana\"},\"application/vnd.ruckus.download\":{\"source\":\"iana\"},\"application/vnd.s3sms\":{\"source\":\"iana\"},\"application/vnd.sailingtracker.track\":{\"source\":\"iana\",\"extensions\":[\"st\"]},\"application/vnd.sbm.cid\":{\"source\":\"iana\"},\"application/vnd.sbm.mid2\":{\"source\":\"iana\"},\"application/vnd.scribus\":{\"source\":\"iana\"},\"application/vnd.sealed.3df\":{\"source\":\"iana\"},\"application/vnd.sealed.csf\":{\"source\":\"iana\"},\"application/vnd.sealed.doc\":{\"source\":\"iana\"},\"application/vnd.sealed.eml\":{\"source\":\"iana\"},\"application/vnd.sealed.mht\":{\"source\":\"iana\"},\"application/vnd.sealed.net\":{\"source\":\"iana\"},\"application/vnd.sealed.ppt\":{\"source\":\"iana\"},\"application/vnd.sealed.tiff\":{\"source\":\"iana\"},\"application/vnd.sealed.xls\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.html\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.pdf\":{\"source\":\"iana\"},\"application/vnd.seemail\":{\"source\":\"iana\",\"extensions\":[\"see\"]},\"application/vnd.sema\":{\"source\":\"iana\",\"extensions\":[\"sema\"]},\"application/vnd.semd\":{\"source\":\"iana\",\"extensions\":[\"semd\"]},\"application/vnd.semf\":{\"source\":\"iana\",\"extensions\":[\"semf\"]},\"application/vnd.shana.informed.formdata\":{\"source\":\"iana\",\"extensions\":[\"ifm\"]},\"application/vnd.shana.informed.formtemplate\":{\"source\":\"iana\",\"extensions\":[\"itp\"]},\"application/vnd.shana.informed.interchange\":{\"source\":\"iana\",\"extensions\":[\"iif\"]},\"application/vnd.shana.informed.package\":{\"source\":\"iana\",\"extensions\":[\"ipk\"]},\"application/vnd.shootproof+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.sigrok.session\":{\"source\":\"iana\"},\"application/vnd.simtech-mindmapper\":{\"source\":\"iana\",\"extensions\":[\"twd\",\"twds\"]},\"application/vnd.siren+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.smaf\":{\"source\":\"iana\",\"extensions\":[\"mmf\"]},\"application/vnd.smart.notebook\":{\"source\":\"iana\"},\"application/vnd.smart.teacher\":{\"source\":\"iana\",\"extensions\":[\"teacher\"]},\"application/vnd.software602.filler.form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.software602.filler.form-xml-zip\":{\"source\":\"iana\"},\"application/vnd.solent.sdkm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sdkm\",\"sdkd\"]},\"application/vnd.spotfire.dxp\":{\"source\":\"iana\",\"extensions\":[\"dxp\"]},\"application/vnd.spotfire.sfs\":{\"source\":\"iana\",\"extensions\":[\"sfs\"]},\"application/vnd.sqlite3\":{\"source\":\"iana\"},\"application/vnd.sss-cod\":{\"source\":\"iana\"},\"application/vnd.sss-dtf\":{\"source\":\"iana\"},\"application/vnd.sss-ntf\":{\"source\":\"iana\"},\"application/vnd.stardivision.calc\":{\"source\":\"apache\",\"extensions\":[\"sdc\"]},\"application/vnd.stardivision.draw\":{\"source\":\"apache\",\"extensions\":[\"sda\"]},\"application/vnd.stardivision.impress\":{\"source\":\"apache\",\"extensions\":[\"sdd\"]},\"application/vnd.stardivision.math\":{\"source\":\"apache\",\"extensions\":[\"smf\"]},\"application/vnd.stardivision.writer\":{\"source\":\"apache\",\"extensions\":[\"sdw\",\"vor\"]},\"application/vnd.stardivision.writer-global\":{\"source\":\"apache\",\"extensions\":[\"sgl\"]},\"application/vnd.stepmania.package\":{\"source\":\"iana\",\"extensions\":[\"smzip\"]},\"application/vnd.stepmania.stepchart\":{\"source\":\"iana\",\"extensions\":[\"sm\"]},\"application/vnd.street-stream\":{\"source\":\"iana\"},\"application/vnd.sun.wadl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wadl\"]},\"application/vnd.sun.xml.calc\":{\"source\":\"apache\",\"extensions\":[\"sxc\"]},\"application/vnd.sun.xml.calc.template\":{\"source\":\"apache\",\"extensions\":[\"stc\"]},\"application/vnd.sun.xml.draw\":{\"source\":\"apache\",\"extensions\":[\"sxd\"]},\"application/vnd.sun.xml.draw.template\":{\"source\":\"apache\",\"extensions\":[\"std\"]},\"application/vnd.sun.xml.impress\":{\"source\":\"apache\",\"extensions\":[\"sxi\"]},\"application/vnd.sun.xml.impress.template\":{\"source\":\"apache\",\"extensions\":[\"sti\"]},\"application/vnd.sun.xml.math\":{\"source\":\"apache\",\"extensions\":[\"sxm\"]},\"application/vnd.sun.xml.writer\":{\"source\":\"apache\",\"extensions\":[\"sxw\"]},\"application/vnd.sun.xml.writer.global\":{\"source\":\"apache\",\"extensions\":[\"sxg\"]},\"application/vnd.sun.xml.writer.template\":{\"source\":\"apache\",\"extensions\":[\"stw\"]},\"application/vnd.sus-calendar\":{\"source\":\"iana\",\"extensions\":[\"sus\",\"susp\"]},\"application/vnd.svd\":{\"source\":\"iana\",\"extensions\":[\"svd\"]},\"application/vnd.swiftview-ics\":{\"source\":\"iana\"},\"application/vnd.symbian.install\":{\"source\":\"apache\",\"extensions\":[\"sis\",\"sisx\"]},\"application/vnd.syncml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xsm\"]},\"application/vnd.syncml.dm+wbxml\":{\"source\":\"iana\",\"extensions\":[\"bdm\"]},\"application/vnd.syncml.dm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdm\"]},\"application/vnd.syncml.dm.notification\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.dmtnds+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmtnds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.ds.notification\":{\"source\":\"iana\"},\"application/vnd.tableschema+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tao.intent-module-archive\":{\"source\":\"iana\",\"extensions\":[\"tao\"]},\"application/vnd.tcpdump.pcap\":{\"source\":\"iana\",\"extensions\":[\"pcap\",\"cap\",\"dmp\"]},\"application/vnd.think-cell.ppttc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tmd.mediaflex.api+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tml\":{\"source\":\"iana\"},\"application/vnd.tmobile-livetv\":{\"source\":\"iana\",\"extensions\":[\"tmo\"]},\"application/vnd.tri.onesource\":{\"source\":\"iana\"},\"application/vnd.trid.tpt\":{\"source\":\"iana\",\"extensions\":[\"tpt\"]},\"application/vnd.triscape.mxs\":{\"source\":\"iana\",\"extensions\":[\"mxs\"]},\"application/vnd.trueapp\":{\"source\":\"iana\",\"extensions\":[\"tra\"]},\"application/vnd.truedoc\":{\"source\":\"iana\"},\"application/vnd.ubisoft.webplayer\":{\"source\":\"iana\"},\"application/vnd.ufdl\":{\"source\":\"iana\",\"extensions\":[\"ufd\",\"ufdl\"]},\"application/vnd.uiq.theme\":{\"source\":\"iana\",\"extensions\":[\"utz\"]},\"application/vnd.umajin\":{\"source\":\"iana\",\"extensions\":[\"umj\"]},\"application/vnd.unity\":{\"source\":\"iana\",\"extensions\":[\"unityweb\"]},\"application/vnd.uoml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uoml\"]},\"application/vnd.uplanet.alert\":{\"source\":\"iana\"},\"application/vnd.uplanet.alert-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.list\":{\"source\":\"iana\"},\"application/vnd.uplanet.list-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.signal\":{\"source\":\"iana\"},\"application/vnd.uri-map\":{\"source\":\"iana\"},\"application/vnd.valve.source.material\":{\"source\":\"iana\"},\"application/vnd.vcx\":{\"source\":\"iana\",\"extensions\":[\"vcx\"]},\"application/vnd.vd-study\":{\"source\":\"iana\"},\"application/vnd.vectorworks\":{\"source\":\"iana\"},\"application/vnd.vel+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.verimatrix.vcas\":{\"source\":\"iana\"},\"application/vnd.veryant.thin\":{\"source\":\"iana\"},\"application/vnd.vidsoft.vidconference\":{\"source\":\"iana\"},\"application/vnd.visio\":{\"source\":\"iana\",\"extensions\":[\"vsd\",\"vst\",\"vss\",\"vsw\"]},\"application/vnd.visionary\":{\"source\":\"iana\",\"extensions\":[\"vis\"]},\"application/vnd.vividence.scriptfile\":{\"source\":\"iana\"},\"application/vnd.vsf\":{\"source\":\"iana\",\"extensions\":[\"vsf\"]},\"application/vnd.wap.sic\":{\"source\":\"iana\"},\"application/vnd.wap.slc\":{\"source\":\"iana\"},\"application/vnd.wap.wbxml\":{\"source\":\"iana\",\"extensions\":[\"wbxml\"]},\"application/vnd.wap.wmlc\":{\"source\":\"iana\",\"extensions\":[\"wmlc\"]},\"application/vnd.wap.wmlscriptc\":{\"source\":\"iana\",\"extensions\":[\"wmlsc\"]},\"application/vnd.webturbo\":{\"source\":\"iana\",\"extensions\":[\"wtb\"]},\"application/vnd.wfa.p2p\":{\"source\":\"iana\"},\"application/vnd.wfa.wsc\":{\"source\":\"iana\"},\"application/vnd.windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.wmc\":{\"source\":\"iana\"},\"application/vnd.wmf.bootstrap\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica.package\":{\"source\":\"iana\"},\"application/vnd.wolfram.player\":{\"source\":\"iana\",\"extensions\":[\"nbp\"]},\"application/vnd.wordperfect\":{\"source\":\"iana\",\"extensions\":[\"wpd\"]},\"application/vnd.wqd\":{\"source\":\"iana\",\"extensions\":[\"wqd\"]},\"application/vnd.wrq-hp3000-labelled\":{\"source\":\"iana\"},\"application/vnd.wt.stf\":{\"source\":\"iana\",\"extensions\":[\"stf\"]},\"application/vnd.wv.csp+wbxml\":{\"source\":\"iana\"},\"application/vnd.wv.csp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.wv.ssp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xacml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xara\":{\"source\":\"iana\",\"extensions\":[\"xar\"]},\"application/vnd.xfdl\":{\"source\":\"iana\",\"extensions\":[\"xfdl\"]},\"application/vnd.xfdl.webform\":{\"source\":\"iana\"},\"application/vnd.xmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xmpie.cpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.dpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.plan\":{\"source\":\"iana\"},\"application/vnd.xmpie.ppkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.xlim\":{\"source\":\"iana\"},\"application/vnd.yamaha.hv-dic\":{\"source\":\"iana\",\"extensions\":[\"hvd\"]},\"application/vnd.yamaha.hv-script\":{\"source\":\"iana\",\"extensions\":[\"hvs\"]},\"application/vnd.yamaha.hv-voice\":{\"source\":\"iana\",\"extensions\":[\"hvp\"]},\"application/vnd.yamaha.openscoreformat\":{\"source\":\"iana\",\"extensions\":[\"osf\"]},\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osfpvg\"]},\"application/vnd.yamaha.remote-setup\":{\"source\":\"iana\"},\"application/vnd.yamaha.smaf-audio\":{\"source\":\"iana\",\"extensions\":[\"saf\"]},\"application/vnd.yamaha.smaf-phrase\":{\"source\":\"iana\",\"extensions\":[\"spf\"]},\"application/vnd.yamaha.through-ngn\":{\"source\":\"iana\"},\"application/vnd.yamaha.tunnel-udpencap\":{\"source\":\"iana\"},\"application/vnd.yaoweme\":{\"source\":\"iana\"},\"application/vnd.yellowriver-custom-menu\":{\"source\":\"iana\",\"extensions\":[\"cmp\"]},\"application/vnd.youtube.yt\":{\"source\":\"iana\"},\"application/vnd.zul\":{\"source\":\"iana\",\"extensions\":[\"zir\",\"zirz\"]},\"application/vnd.zzazz.deck+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zaz\"]},\"application/voicexml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vxml\"]},\"application/voucher-cms+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vq-rtcpxr\":{\"source\":\"iana\"},\"application/wasm\":{\"compressible\":true,\"extensions\":[\"wasm\"]},\"application/watcherinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/webpush-options+json\":{\"source\":\"iana\",\"compressible\":true},\"application/whoispp-query\":{\"source\":\"iana\"},\"application/whoispp-response\":{\"source\":\"iana\"},\"application/widget\":{\"source\":\"iana\",\"extensions\":[\"wgt\"]},\"application/winhlp\":{\"source\":\"apache\",\"extensions\":[\"hlp\"]},\"application/wita\":{\"source\":\"iana\"},\"application/wordperfect5.1\":{\"source\":\"iana\"},\"application/wsdl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wsdl\"]},\"application/wspolicy+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wspolicy\"]},\"application/x-7z-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"7z\"]},\"application/x-abiword\":{\"source\":\"apache\",\"extensions\":[\"abw\"]},\"application/x-ace-compressed\":{\"source\":\"apache\",\"extensions\":[\"ace\"]},\"application/x-amf\":{\"source\":\"apache\"},\"application/x-apple-diskimage\":{\"source\":\"apache\",\"extensions\":[\"dmg\"]},\"application/x-arj\":{\"compressible\":false,\"extensions\":[\"arj\"]},\"application/x-authorware-bin\":{\"source\":\"apache\",\"extensions\":[\"aab\",\"x32\",\"u32\",\"vox\"]},\"application/x-authorware-map\":{\"source\":\"apache\",\"extensions\":[\"aam\"]},\"application/x-authorware-seg\":{\"source\":\"apache\",\"extensions\":[\"aas\"]},\"application/x-bcpio\":{\"source\":\"apache\",\"extensions\":[\"bcpio\"]},\"application/x-bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/x-bittorrent\":{\"source\":\"apache\",\"extensions\":[\"torrent\"]},\"application/x-blorb\":{\"source\":\"apache\",\"extensions\":[\"blb\",\"blorb\"]},\"application/x-bzip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz\"]},\"application/x-bzip2\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz2\",\"boz\"]},\"application/x-cbr\":{\"source\":\"apache\",\"extensions\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"]},\"application/x-cdlink\":{\"source\":\"apache\",\"extensions\":[\"vcd\"]},\"application/x-cfs-compressed\":{\"source\":\"apache\",\"extensions\":[\"cfs\"]},\"application/x-chat\":{\"source\":\"apache\",\"extensions\":[\"chat\"]},\"application/x-chess-pgn\":{\"source\":\"apache\",\"extensions\":[\"pgn\"]},\"application/x-chrome-extension\":{\"extensions\":[\"crx\"]},\"application/x-cocoa\":{\"source\":\"nginx\",\"extensions\":[\"cco\"]},\"application/x-compress\":{\"source\":\"apache\"},\"application/x-conference\":{\"source\":\"apache\",\"extensions\":[\"nsc\"]},\"application/x-cpio\":{\"source\":\"apache\",\"extensions\":[\"cpio\"]},\"application/x-csh\":{\"source\":\"apache\",\"extensions\":[\"csh\"]},\"application/x-deb\":{\"compressible\":false},\"application/x-debian-package\":{\"source\":\"apache\",\"extensions\":[\"deb\",\"udeb\"]},\"application/x-dgc-compressed\":{\"source\":\"apache\",\"extensions\":[\"dgc\"]},\"application/x-director\":{\"source\":\"apache\",\"extensions\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"]},\"application/x-doom\":{\"source\":\"apache\",\"extensions\":[\"wad\"]},\"application/x-dtbncx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ncx\"]},\"application/x-dtbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dtb\"]},\"application/x-dtbresource+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"res\"]},\"application/x-dvi\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"dvi\"]},\"application/x-envoy\":{\"source\":\"apache\",\"extensions\":[\"evy\"]},\"application/x-eva\":{\"source\":\"apache\",\"extensions\":[\"eva\"]},\"application/x-font-bdf\":{\"source\":\"apache\",\"extensions\":[\"bdf\"]},\"application/x-font-dos\":{\"source\":\"apache\"},\"application/x-font-framemaker\":{\"source\":\"apache\"},\"application/x-font-ghostscript\":{\"source\":\"apache\",\"extensions\":[\"gsf\"]},\"application/x-font-libgrx\":{\"source\":\"apache\"},\"application/x-font-linux-psf\":{\"source\":\"apache\",\"extensions\":[\"psf\"]},\"application/x-font-pcf\":{\"source\":\"apache\",\"extensions\":[\"pcf\"]},\"application/x-font-snf\":{\"source\":\"apache\",\"extensions\":[\"snf\"]},\"application/x-font-speedo\":{\"source\":\"apache\"},\"application/x-font-sunos-news\":{\"source\":\"apache\"},\"application/x-font-type1\":{\"source\":\"apache\",\"extensions\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"]},\"application/x-font-vfont\":{\"source\":\"apache\"},\"application/x-freearc\":{\"source\":\"apache\",\"extensions\":[\"arc\"]},\"application/x-futuresplash\":{\"source\":\"apache\",\"extensions\":[\"spl\"]},\"application/x-gca-compressed\":{\"source\":\"apache\",\"extensions\":[\"gca\"]},\"application/x-glulx\":{\"source\":\"apache\",\"extensions\":[\"ulx\"]},\"application/x-gnumeric\":{\"source\":\"apache\",\"extensions\":[\"gnumeric\"]},\"application/x-gramps-xml\":{\"source\":\"apache\",\"extensions\":[\"gramps\"]},\"application/x-gtar\":{\"source\":\"apache\",\"extensions\":[\"gtar\"]},\"application/x-gzip\":{\"source\":\"apache\"},\"application/x-hdf\":{\"source\":\"apache\",\"extensions\":[\"hdf\"]},\"application/x-httpd-php\":{\"compressible\":true,\"extensions\":[\"php\"]},\"application/x-install-instructions\":{\"source\":\"apache\",\"extensions\":[\"install\"]},\"application/x-iso9660-image\":{\"source\":\"apache\",\"extensions\":[\"iso\"]},\"application/x-java-archive-diff\":{\"source\":\"nginx\",\"extensions\":[\"jardiff\"]},\"application/x-java-jnlp-file\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jnlp\"]},\"application/x-javascript\":{\"compressible\":true},\"application/x-latex\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"latex\"]},\"application/x-lua-bytecode\":{\"extensions\":[\"luac\"]},\"application/x-lzh-compressed\":{\"source\":\"apache\",\"extensions\":[\"lzh\",\"lha\"]},\"application/x-makeself\":{\"source\":\"nginx\",\"extensions\":[\"run\"]},\"application/x-mie\":{\"source\":\"apache\",\"extensions\":[\"mie\"]},\"application/x-mobipocket-ebook\":{\"source\":\"apache\",\"extensions\":[\"prc\",\"mobi\"]},\"application/x-mpegurl\":{\"compressible\":false},\"application/x-ms-application\":{\"source\":\"apache\",\"extensions\":[\"application\"]},\"application/x-ms-shortcut\":{\"source\":\"apache\",\"extensions\":[\"lnk\"]},\"application/x-ms-wmd\":{\"source\":\"apache\",\"extensions\":[\"wmd\"]},\"application/x-ms-wmz\":{\"source\":\"apache\",\"extensions\":[\"wmz\"]},\"application/x-ms-xbap\":{\"source\":\"apache\",\"extensions\":[\"xbap\"]},\"application/x-msaccess\":{\"source\":\"apache\",\"extensions\":[\"mdb\"]},\"application/x-msbinder\":{\"source\":\"apache\",\"extensions\":[\"obd\"]},\"application/x-mscardfile\":{\"source\":\"apache\",\"extensions\":[\"crd\"]},\"application/x-msclip\":{\"source\":\"apache\",\"extensions\":[\"clp\"]},\"application/x-msdos-program\":{\"extensions\":[\"exe\"]},\"application/x-msdownload\":{\"source\":\"apache\",\"extensions\":[\"exe\",\"dll\",\"com\",\"bat\",\"msi\"]},\"application/x-msmediaview\":{\"source\":\"apache\",\"extensions\":[\"mvb\",\"m13\",\"m14\"]},\"application/x-msmetafile\":{\"source\":\"apache\",\"extensions\":[\"wmf\",\"wmz\",\"emf\",\"emz\"]},\"application/x-msmoney\":{\"source\":\"apache\",\"extensions\":[\"mny\"]},\"application/x-mspublisher\":{\"source\":\"apache\",\"extensions\":[\"pub\"]},\"application/x-msschedule\":{\"source\":\"apache\",\"extensions\":[\"scd\"]},\"application/x-msterminal\":{\"source\":\"apache\",\"extensions\":[\"trm\"]},\"application/x-mswrite\":{\"source\":\"apache\",\"extensions\":[\"wri\"]},\"application/x-netcdf\":{\"source\":\"apache\",\"extensions\":[\"nc\",\"cdf\"]},\"application/x-ns-proxy-autoconfig\":{\"compressible\":true,\"extensions\":[\"pac\"]},\"application/x-nzb\":{\"source\":\"apache\",\"extensions\":[\"nzb\"]},\"application/x-perl\":{\"source\":\"nginx\",\"extensions\":[\"pl\",\"pm\"]},\"application/x-pilot\":{\"source\":\"nginx\",\"extensions\":[\"prc\",\"pdb\"]},\"application/x-pkcs12\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"p12\",\"pfx\"]},\"application/x-pkcs7-certificates\":{\"source\":\"apache\",\"extensions\":[\"p7b\",\"spc\"]},\"application/x-pkcs7-certreqresp\":{\"source\":\"apache\",\"extensions\":[\"p7r\"]},\"application/x-rar-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"rar\"]},\"application/x-redhat-package-manager\":{\"source\":\"nginx\",\"extensions\":[\"rpm\"]},\"application/x-research-info-systems\":{\"source\":\"apache\",\"extensions\":[\"ris\"]},\"application/x-sea\":{\"source\":\"nginx\",\"extensions\":[\"sea\"]},\"application/x-sh\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"sh\"]},\"application/x-shar\":{\"source\":\"apache\",\"extensions\":[\"shar\"]},\"application/x-shockwave-flash\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"swf\"]},\"application/x-silverlight-app\":{\"source\":\"apache\",\"extensions\":[\"xap\"]},\"application/x-sql\":{\"source\":\"apache\",\"extensions\":[\"sql\"]},\"application/x-stuffit\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"sit\"]},\"application/x-stuffitx\":{\"source\":\"apache\",\"extensions\":[\"sitx\"]},\"application/x-subrip\":{\"source\":\"apache\",\"extensions\":[\"srt\"]},\"application/x-sv4cpio\":{\"source\":\"apache\",\"extensions\":[\"sv4cpio\"]},\"application/x-sv4crc\":{\"source\":\"apache\",\"extensions\":[\"sv4crc\"]},\"application/x-t3vm-image\":{\"source\":\"apache\",\"extensions\":[\"t3\"]},\"application/x-tads\":{\"source\":\"apache\",\"extensions\":[\"gam\"]},\"application/x-tar\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"tar\"]},\"application/x-tcl\":{\"source\":\"apache\",\"extensions\":[\"tcl\",\"tk\"]},\"application/x-tex\":{\"source\":\"apache\",\"extensions\":[\"tex\"]},\"application/x-tex-tfm\":{\"source\":\"apache\",\"extensions\":[\"tfm\"]},\"application/x-texinfo\":{\"source\":\"apache\",\"extensions\":[\"texinfo\",\"texi\"]},\"application/x-tgif\":{\"source\":\"apache\",\"extensions\":[\"obj\"]},\"application/x-ustar\":{\"source\":\"apache\",\"extensions\":[\"ustar\"]},\"application/x-virtualbox-hdd\":{\"compressible\":true,\"extensions\":[\"hdd\"]},\"application/x-virtualbox-ova\":{\"compressible\":true,\"extensions\":[\"ova\"]},\"application/x-virtualbox-ovf\":{\"compressible\":true,\"extensions\":[\"ovf\"]},\"application/x-virtualbox-vbox\":{\"compressible\":true,\"extensions\":[\"vbox\"]},\"application/x-virtualbox-vbox-extpack\":{\"compressible\":false,\"extensions\":[\"vbox-extpack\"]},\"application/x-virtualbox-vdi\":{\"compressible\":true,\"extensions\":[\"vdi\"]},\"application/x-virtualbox-vhd\":{\"compressible\":true,\"extensions\":[\"vhd\"]},\"application/x-virtualbox-vmdk\":{\"compressible\":true,\"extensions\":[\"vmdk\"]},\"application/x-wais-source\":{\"source\":\"apache\",\"extensions\":[\"src\"]},\"application/x-web-app-manifest+json\":{\"compressible\":true,\"extensions\":[\"webapp\"]},\"application/x-www-form-urlencoded\":{\"source\":\"iana\",\"compressible\":true},\"application/x-x509-ca-cert\":{\"source\":\"apache\",\"extensions\":[\"der\",\"crt\",\"pem\"]},\"application/x-xfig\":{\"source\":\"apache\",\"extensions\":[\"fig\"]},\"application/x-xliff+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/x-xpinstall\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"xpi\"]},\"application/x-xz\":{\"source\":\"apache\",\"extensions\":[\"xz\"]},\"application/x-zmachine\":{\"source\":\"apache\",\"extensions\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"]},\"application/x400-bp\":{\"source\":\"iana\"},\"application/xacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xaml+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xaml\"]},\"application/xcap-att+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-caps+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/xcap-el+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-error+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-ns+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xenc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xenc\"]},\"application/xhtml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xhtml\",\"xht\"]},\"application/xhtml-voice+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/xliff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\",\"xsl\",\"xsd\",\"rng\"]},\"application/xml-dtd\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dtd\"]},\"application/xml-external-parsed-entity\":{\"source\":\"iana\"},\"application/xml-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xmpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xop+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xop\"]},\"application/xproc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xpl\"]},\"application/xslt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xslt\"]},\"application/xspf+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xspf\"]},\"application/xv+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"]},\"application/yang\":{\"source\":\"iana\",\"extensions\":[\"yang\"]},\"application/yang-data+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yin+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"yin\"]},\"application/zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"zip\"]},\"application/zlib\":{\"source\":\"iana\"},\"application/zstd\":{\"source\":\"iana\"},\"audio/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"audio/32kadpcm\":{\"source\":\"iana\"},\"audio/3gpp\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"3gpp\"]},\"audio/3gpp2\":{\"source\":\"iana\"},\"audio/aac\":{\"source\":\"iana\"},\"audio/ac3\":{\"source\":\"iana\"},\"audio/adpcm\":{\"source\":\"apache\",\"extensions\":[\"adp\"]},\"audio/amr\":{\"source\":\"iana\"},\"audio/amr-wb\":{\"source\":\"iana\"},\"audio/amr-wb+\":{\"source\":\"iana\"},\"audio/aptx\":{\"source\":\"iana\"},\"audio/asc\":{\"source\":\"iana\"},\"audio/atrac-advanced-lossless\":{\"source\":\"iana\"},\"audio/atrac-x\":{\"source\":\"iana\"},\"audio/atrac3\":{\"source\":\"iana\"},\"audio/basic\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"au\",\"snd\"]},\"audio/bv16\":{\"source\":\"iana\"},\"audio/bv32\":{\"source\":\"iana\"},\"audio/clearmode\":{\"source\":\"iana\"},\"audio/cn\":{\"source\":\"iana\"},\"audio/dat12\":{\"source\":\"iana\"},\"audio/dls\":{\"source\":\"iana\"},\"audio/dsr-es201108\":{\"source\":\"iana\"},\"audio/dsr-es202050\":{\"source\":\"iana\"},\"audio/dsr-es202211\":{\"source\":\"iana\"},\"audio/dsr-es202212\":{\"source\":\"iana\"},\"audio/dv\":{\"source\":\"iana\"},\"audio/dvi4\":{\"source\":\"iana\"},\"audio/eac3\":{\"source\":\"iana\"},\"audio/encaprtp\":{\"source\":\"iana\"},\"audio/evrc\":{\"source\":\"iana\"},\"audio/evrc-qcp\":{\"source\":\"iana\"},\"audio/evrc0\":{\"source\":\"iana\"},\"audio/evrc1\":{\"source\":\"iana\"},\"audio/evrcb\":{\"source\":\"iana\"},\"audio/evrcb0\":{\"source\":\"iana\"},\"audio/evrcb1\":{\"source\":\"iana\"},\"audio/evrcnw\":{\"source\":\"iana\"},\"audio/evrcnw0\":{\"source\":\"iana\"},\"audio/evrcnw1\":{\"source\":\"iana\"},\"audio/evrcwb\":{\"source\":\"iana\"},\"audio/evrcwb0\":{\"source\":\"iana\"},\"audio/evrcwb1\":{\"source\":\"iana\"},\"audio/evs\":{\"source\":\"iana\"},\"audio/fwdred\":{\"source\":\"iana\"},\"audio/g711-0\":{\"source\":\"iana\"},\"audio/g719\":{\"source\":\"iana\"},\"audio/g722\":{\"source\":\"iana\"},\"audio/g7221\":{\"source\":\"iana\"},\"audio/g723\":{\"source\":\"iana\"},\"audio/g726-16\":{\"source\":\"iana\"},\"audio/g726-24\":{\"source\":\"iana\"},\"audio/g726-32\":{\"source\":\"iana\"},\"audio/g726-40\":{\"source\":\"iana\"},\"audio/g728\":{\"source\":\"iana\"},\"audio/g729\":{\"source\":\"iana\"},\"audio/g7291\":{\"source\":\"iana\"},\"audio/g729d\":{\"source\":\"iana\"},\"audio/g729e\":{\"source\":\"iana\"},\"audio/gsm\":{\"source\":\"iana\"},\"audio/gsm-efr\":{\"source\":\"iana\"},\"audio/gsm-hr-08\":{\"source\":\"iana\"},\"audio/ilbc\":{\"source\":\"iana\"},\"audio/ip-mr_v2.5\":{\"source\":\"iana\"},\"audio/isac\":{\"source\":\"apache\"},\"audio/l16\":{\"source\":\"iana\"},\"audio/l20\":{\"source\":\"iana\"},\"audio/l24\":{\"source\":\"iana\",\"compressible\":false},\"audio/l8\":{\"source\":\"iana\"},\"audio/lpc\":{\"source\":\"iana\"},\"audio/melp\":{\"source\":\"iana\"},\"audio/melp1200\":{\"source\":\"iana\"},\"audio/melp2400\":{\"source\":\"iana\"},\"audio/melp600\":{\"source\":\"iana\"},\"audio/midi\":{\"source\":\"apache\",\"extensions\":[\"mid\",\"midi\",\"kar\",\"rmi\"]},\"audio/mobile-xmf\":{\"source\":\"iana\"},\"audio/mp3\":{\"compressible\":false,\"extensions\":[\"mp3\"]},\"audio/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"m4a\",\"mp4a\"]},\"audio/mp4a-latm\":{\"source\":\"iana\"},\"audio/mpa\":{\"source\":\"iana\"},\"audio/mpa-robust\":{\"source\":\"iana\"},\"audio/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"]},\"audio/mpeg4-generic\":{\"source\":\"iana\"},\"audio/musepack\":{\"source\":\"apache\"},\"audio/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"oga\",\"ogg\",\"spx\"]},\"audio/opus\":{\"source\":\"iana\"},\"audio/parityfec\":{\"source\":\"iana\"},\"audio/pcma\":{\"source\":\"iana\"},\"audio/pcma-wb\":{\"source\":\"iana\"},\"audio/pcmu\":{\"source\":\"iana\"},\"audio/pcmu-wb\":{\"source\":\"iana\"},\"audio/prs.sid\":{\"source\":\"iana\"},\"audio/qcelp\":{\"source\":\"iana\"},\"audio/raptorfec\":{\"source\":\"iana\"},\"audio/red\":{\"source\":\"iana\"},\"audio/rtp-enc-aescm128\":{\"source\":\"iana\"},\"audio/rtp-midi\":{\"source\":\"iana\"},\"audio/rtploopback\":{\"source\":\"iana\"},\"audio/rtx\":{\"source\":\"iana\"},\"audio/s3m\":{\"source\":\"apache\",\"extensions\":[\"s3m\"]},\"audio/silk\":{\"source\":\"apache\",\"extensions\":[\"sil\"]},\"audio/smv\":{\"source\":\"iana\"},\"audio/smv-qcp\":{\"source\":\"iana\"},\"audio/smv0\":{\"source\":\"iana\"},\"audio/sp-midi\":{\"source\":\"iana\"},\"audio/speex\":{\"source\":\"iana\"},\"audio/t140c\":{\"source\":\"iana\"},\"audio/t38\":{\"source\":\"iana\"},\"audio/telephone-event\":{\"source\":\"iana\"},\"audio/tetra_acelp\":{\"source\":\"iana\"},\"audio/tone\":{\"source\":\"iana\"},\"audio/uemclip\":{\"source\":\"iana\"},\"audio/ulpfec\":{\"source\":\"iana\"},\"audio/usac\":{\"source\":\"iana\"},\"audio/vdvi\":{\"source\":\"iana\"},\"audio/vmr-wb\":{\"source\":\"iana\"},\"audio/vnd.3gpp.iufp\":{\"source\":\"iana\"},\"audio/vnd.4sb\":{\"source\":\"iana\"},\"audio/vnd.audiokoz\":{\"source\":\"iana\"},\"audio/vnd.celp\":{\"source\":\"iana\"},\"audio/vnd.cisco.nse\":{\"source\":\"iana\"},\"audio/vnd.cmles.radio-events\":{\"source\":\"iana\"},\"audio/vnd.cns.anp1\":{\"source\":\"iana\"},\"audio/vnd.cns.inf1\":{\"source\":\"iana\"},\"audio/vnd.dece.audio\":{\"source\":\"iana\",\"extensions\":[\"uva\",\"uvva\"]},\"audio/vnd.digital-winds\":{\"source\":\"iana\",\"extensions\":[\"eol\"]},\"audio/vnd.dlna.adts\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.1\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.2\":{\"source\":\"iana\"},\"audio/vnd.dolby.mlp\":{\"source\":\"iana\"},\"audio/vnd.dolby.mps\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2x\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2z\":{\"source\":\"iana\"},\"audio/vnd.dolby.pulse.1\":{\"source\":\"iana\"},\"audio/vnd.dra\":{\"source\":\"iana\",\"extensions\":[\"dra\"]},\"audio/vnd.dts\":{\"source\":\"iana\",\"extensions\":[\"dts\"]},\"audio/vnd.dts.hd\":{\"source\":\"iana\",\"extensions\":[\"dtshd\"]},\"audio/vnd.dts.uhd\":{\"source\":\"iana\"},\"audio/vnd.dvb.file\":{\"source\":\"iana\"},\"audio/vnd.everad.plj\":{\"source\":\"iana\"},\"audio/vnd.hns.audio\":{\"source\":\"iana\"},\"audio/vnd.lucent.voice\":{\"source\":\"iana\",\"extensions\":[\"lvp\"]},\"audio/vnd.ms-playready.media.pya\":{\"source\":\"iana\",\"extensions\":[\"pya\"]},\"audio/vnd.nokia.mobile-xmf\":{\"source\":\"iana\"},\"audio/vnd.nortel.vbk\":{\"source\":\"iana\"},\"audio/vnd.nuera.ecelp4800\":{\"source\":\"iana\",\"extensions\":[\"ecelp4800\"]},\"audio/vnd.nuera.ecelp7470\":{\"source\":\"iana\",\"extensions\":[\"ecelp7470\"]},\"audio/vnd.nuera.ecelp9600\":{\"source\":\"iana\",\"extensions\":[\"ecelp9600\"]},\"audio/vnd.octel.sbc\":{\"source\":\"iana\"},\"audio/vnd.presonus.multitrack\":{\"source\":\"iana\"},\"audio/vnd.qcelp\":{\"source\":\"iana\"},\"audio/vnd.rhetorex.32kadpcm\":{\"source\":\"iana\"},\"audio/vnd.rip\":{\"source\":\"iana\",\"extensions\":[\"rip\"]},\"audio/vnd.rn-realaudio\":{\"compressible\":false},\"audio/vnd.sealedmedia.softseal.mpeg\":{\"source\":\"iana\"},\"audio/vnd.vmx.cvsd\":{\"source\":\"iana\"},\"audio/vnd.wave\":{\"compressible\":false},\"audio/vorbis\":{\"source\":\"iana\",\"compressible\":false},\"audio/vorbis-config\":{\"source\":\"iana\"},\"audio/wav\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/wave\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"weba\"]},\"audio/x-aac\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"aac\"]},\"audio/x-aiff\":{\"source\":\"apache\",\"extensions\":[\"aif\",\"aiff\",\"aifc\"]},\"audio/x-caf\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"caf\"]},\"audio/x-flac\":{\"source\":\"apache\",\"extensions\":[\"flac\"]},\"audio/x-m4a\":{\"source\":\"nginx\",\"extensions\":[\"m4a\"]},\"audio/x-matroska\":{\"source\":\"apache\",\"extensions\":[\"mka\"]},\"audio/x-mpegurl\":{\"source\":\"apache\",\"extensions\":[\"m3u\"]},\"audio/x-ms-wax\":{\"source\":\"apache\",\"extensions\":[\"wax\"]},\"audio/x-ms-wma\":{\"source\":\"apache\",\"extensions\":[\"wma\"]},\"audio/x-pn-realaudio\":{\"source\":\"apache\",\"extensions\":[\"ram\",\"ra\"]},\"audio/x-pn-realaudio-plugin\":{\"source\":\"apache\",\"extensions\":[\"rmp\"]},\"audio/x-realaudio\":{\"source\":\"nginx\",\"extensions\":[\"ra\"]},\"audio/x-tta\":{\"source\":\"apache\"},\"audio/x-wav\":{\"source\":\"apache\",\"extensions\":[\"wav\"]},\"audio/xm\":{\"source\":\"apache\",\"extensions\":[\"xm\"]},\"chemical/x-cdx\":{\"source\":\"apache\",\"extensions\":[\"cdx\"]},\"chemical/x-cif\":{\"source\":\"apache\",\"extensions\":[\"cif\"]},\"chemical/x-cmdf\":{\"source\":\"apache\",\"extensions\":[\"cmdf\"]},\"chemical/x-cml\":{\"source\":\"apache\",\"extensions\":[\"cml\"]},\"chemical/x-csml\":{\"source\":\"apache\",\"extensions\":[\"csml\"]},\"chemical/x-pdb\":{\"source\":\"apache\"},\"chemical/x-xyz\":{\"source\":\"apache\",\"extensions\":[\"xyz\"]},\"font/collection\":{\"source\":\"iana\",\"extensions\":[\"ttc\"]},\"font/otf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"otf\"]},\"font/sfnt\":{\"source\":\"iana\"},\"font/ttf\":{\"source\":\"iana\",\"extensions\":[\"ttf\"]},\"font/woff\":{\"source\":\"iana\",\"extensions\":[\"woff\"]},\"font/woff2\":{\"source\":\"iana\",\"extensions\":[\"woff2\"]},\"image/aces\":{\"source\":\"iana\",\"extensions\":[\"exr\"]},\"image/apng\":{\"compressible\":false,\"extensions\":[\"apng\"]},\"image/avci\":{\"source\":\"iana\"},\"image/avcs\":{\"source\":\"iana\"},\"image/bmp\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/cgm\":{\"source\":\"iana\",\"extensions\":[\"cgm\"]},\"image/dicom-rle\":{\"source\":\"iana\",\"extensions\":[\"drle\"]},\"image/emf\":{\"source\":\"iana\",\"extensions\":[\"emf\"]},\"image/fits\":{\"source\":\"iana\",\"extensions\":[\"fits\"]},\"image/g3fax\":{\"source\":\"iana\",\"extensions\":[\"g3\"]},\"image/gif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gif\"]},\"image/heic\":{\"source\":\"iana\",\"extensions\":[\"heic\"]},\"image/heic-sequence\":{\"source\":\"iana\",\"extensions\":[\"heics\"]},\"image/heif\":{\"source\":\"iana\",\"extensions\":[\"heif\"]},\"image/heif-sequence\":{\"source\":\"iana\",\"extensions\":[\"heifs\"]},\"image/ief\":{\"source\":\"iana\",\"extensions\":[\"ief\"]},\"image/jls\":{\"source\":\"iana\",\"extensions\":[\"jls\"]},\"image/jp2\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jp2\",\"jpg2\"]},\"image/jpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpeg\",\"jpg\",\"jpe\"]},\"image/jpm\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpm\"]},\"image/jpx\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpx\",\"jpf\"]},\"image/jxr\":{\"source\":\"iana\",\"extensions\":[\"jxr\"]},\"image/ktx\":{\"source\":\"iana\",\"extensions\":[\"ktx\"]},\"image/naplps\":{\"source\":\"iana\"},\"image/pjpeg\":{\"compressible\":false},\"image/png\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"png\"]},\"image/prs.btif\":{\"source\":\"iana\",\"extensions\":[\"btif\"]},\"image/prs.pti\":{\"source\":\"iana\",\"extensions\":[\"pti\"]},\"image/pwg-raster\":{\"source\":\"iana\"},\"image/sgi\":{\"source\":\"apache\",\"extensions\":[\"sgi\"]},\"image/svg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"svg\",\"svgz\"]},\"image/t38\":{\"source\":\"iana\",\"extensions\":[\"t38\"]},\"image/tiff\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"tif\",\"tiff\"]},\"image/tiff-fx\":{\"source\":\"iana\",\"extensions\":[\"tfx\"]},\"image/vnd.adobe.photoshop\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"psd\"]},\"image/vnd.airzip.accelerator.azv\":{\"source\":\"iana\",\"extensions\":[\"azv\"]},\"image/vnd.cns.inf2\":{\"source\":\"iana\"},\"image/vnd.dece.graphic\":{\"source\":\"iana\",\"extensions\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"]},\"image/vnd.djvu\":{\"source\":\"iana\",\"extensions\":[\"djvu\",\"djv\"]},\"image/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"image/vnd.dwg\":{\"source\":\"iana\",\"extensions\":[\"dwg\"]},\"image/vnd.dxf\":{\"source\":\"iana\",\"extensions\":[\"dxf\"]},\"image/vnd.fastbidsheet\":{\"source\":\"iana\",\"extensions\":[\"fbs\"]},\"image/vnd.fpx\":{\"source\":\"iana\",\"extensions\":[\"fpx\"]},\"image/vnd.fst\":{\"source\":\"iana\",\"extensions\":[\"fst\"]},\"image/vnd.fujixerox.edmics-mmr\":{\"source\":\"iana\",\"extensions\":[\"mmr\"]},\"image/vnd.fujixerox.edmics-rlc\":{\"source\":\"iana\",\"extensions\":[\"rlc\"]},\"image/vnd.globalgraphics.pgb\":{\"source\":\"iana\"},\"image/vnd.microsoft.icon\":{\"source\":\"iana\",\"extensions\":[\"ico\"]},\"image/vnd.mix\":{\"source\":\"iana\"},\"image/vnd.mozilla.apng\":{\"source\":\"iana\"},\"image/vnd.ms-modi\":{\"source\":\"iana\",\"extensions\":[\"mdi\"]},\"image/vnd.ms-photo\":{\"source\":\"apache\",\"extensions\":[\"wdp\"]},\"image/vnd.net-fpx\":{\"source\":\"iana\",\"extensions\":[\"npx\"]},\"image/vnd.radiance\":{\"source\":\"iana\"},\"image/vnd.sealed.png\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.gif\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.jpg\":{\"source\":\"iana\"},\"image/vnd.svf\":{\"source\":\"iana\"},\"image/vnd.tencent.tap\":{\"source\":\"iana\",\"extensions\":[\"tap\"]},\"image/vnd.valve.source.texture\":{\"source\":\"iana\",\"extensions\":[\"vtf\"]},\"image/vnd.wap.wbmp\":{\"source\":\"iana\",\"extensions\":[\"wbmp\"]},\"image/vnd.xiff\":{\"source\":\"iana\",\"extensions\":[\"xif\"]},\"image/vnd.zbrush.pcx\":{\"source\":\"iana\",\"extensions\":[\"pcx\"]},\"image/webp\":{\"source\":\"apache\",\"extensions\":[\"webp\"]},\"image/wmf\":{\"source\":\"iana\",\"extensions\":[\"wmf\"]},\"image/x-3ds\":{\"source\":\"apache\",\"extensions\":[\"3ds\"]},\"image/x-cmu-raster\":{\"source\":\"apache\",\"extensions\":[\"ras\"]},\"image/x-cmx\":{\"source\":\"apache\",\"extensions\":[\"cmx\"]},\"image/x-freehand\":{\"source\":\"apache\",\"extensions\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"]},\"image/x-icon\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ico\"]},\"image/x-jng\":{\"source\":\"nginx\",\"extensions\":[\"jng\"]},\"image/x-mrsid-image\":{\"source\":\"apache\",\"extensions\":[\"sid\"]},\"image/x-ms-bmp\":{\"source\":\"nginx\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/x-pcx\":{\"source\":\"apache\",\"extensions\":[\"pcx\"]},\"image/x-pict\":{\"source\":\"apache\",\"extensions\":[\"pic\",\"pct\"]},\"image/x-portable-anymap\":{\"source\":\"apache\",\"extensions\":[\"pnm\"]},\"image/x-portable-bitmap\":{\"source\":\"apache\",\"extensions\":[\"pbm\"]},\"image/x-portable-graymap\":{\"source\":\"apache\",\"extensions\":[\"pgm\"]},\"image/x-portable-pixmap\":{\"source\":\"apache\",\"extensions\":[\"ppm\"]},\"image/x-rgb\":{\"source\":\"apache\",\"extensions\":[\"rgb\"]},\"image/x-tga\":{\"source\":\"apache\",\"extensions\":[\"tga\"]},\"image/x-xbitmap\":{\"source\":\"apache\",\"extensions\":[\"xbm\"]},\"image/x-xcf\":{\"compressible\":false},\"image/x-xpixmap\":{\"source\":\"apache\",\"extensions\":[\"xpm\"]},\"image/x-xwindowdump\":{\"source\":\"apache\",\"extensions\":[\"xwd\"]},\"message/cpim\":{\"source\":\"iana\"},\"message/delivery-status\":{\"source\":\"iana\"},\"message/disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"disposition-notification\"]},\"message/external-body\":{\"source\":\"iana\"},\"message/feedback-report\":{\"source\":\"iana\"},\"message/global\":{\"source\":\"iana\",\"extensions\":[\"u8msg\"]},\"message/global-delivery-status\":{\"source\":\"iana\",\"extensions\":[\"u8dsn\"]},\"message/global-disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"u8mdn\"]},\"message/global-headers\":{\"source\":\"iana\",\"extensions\":[\"u8hdr\"]},\"message/http\":{\"source\":\"iana\",\"compressible\":false},\"message/imdn+xml\":{\"source\":\"iana\",\"compressible\":true},\"message/news\":{\"source\":\"iana\"},\"message/partial\":{\"source\":\"iana\",\"compressible\":false},\"message/rfc822\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eml\",\"mime\"]},\"message/s-http\":{\"source\":\"iana\"},\"message/sip\":{\"source\":\"iana\"},\"message/sipfrag\":{\"source\":\"iana\"},\"message/tracking-status\":{\"source\":\"iana\"},\"message/vnd.si.simp\":{\"source\":\"iana\"},\"message/vnd.wfa.wsc\":{\"source\":\"iana\",\"extensions\":[\"wsc\"]},\"model/3mf\":{\"source\":\"iana\",\"extensions\":[\"3mf\"]},\"model/gltf+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gltf\"]},\"model/gltf-binary\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"glb\"]},\"model/iges\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"igs\",\"iges\"]},\"model/mesh\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"msh\",\"mesh\",\"silo\"]},\"model/stl\":{\"source\":\"iana\",\"extensions\":[\"stl\"]},\"model/vnd.collada+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dae\"]},\"model/vnd.dwf\":{\"source\":\"iana\",\"extensions\":[\"dwf\"]},\"model/vnd.flatland.3dml\":{\"source\":\"iana\"},\"model/vnd.gdl\":{\"source\":\"iana\",\"extensions\":[\"gdl\"]},\"model/vnd.gs-gdl\":{\"source\":\"apache\"},\"model/vnd.gs.gdl\":{\"source\":\"iana\"},\"model/vnd.gtw\":{\"source\":\"iana\",\"extensions\":[\"gtw\"]},\"model/vnd.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"model/vnd.mts\":{\"source\":\"iana\",\"extensions\":[\"mts\"]},\"model/vnd.opengex\":{\"source\":\"iana\",\"extensions\":[\"ogex\"]},\"model/vnd.parasolid.transmit.binary\":{\"source\":\"iana\",\"extensions\":[\"x_b\"]},\"model/vnd.parasolid.transmit.text\":{\"source\":\"iana\",\"extensions\":[\"x_t\"]},\"model/vnd.rosette.annotated-data-model\":{\"source\":\"iana\"},\"model/vnd.usdz+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"usdz\"]},\"model/vnd.valve.source.compiled-map\":{\"source\":\"iana\",\"extensions\":[\"bsp\"]},\"model/vnd.vtu\":{\"source\":\"iana\",\"extensions\":[\"vtu\"]},\"model/vrml\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"wrl\",\"vrml\"]},\"model/x3d+binary\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3db\",\"x3dbz\"]},\"model/x3d+fastinfoset\":{\"source\":\"iana\",\"extensions\":[\"x3db\"]},\"model/x3d+vrml\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3dv\",\"x3dvz\"]},\"model/x3d+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"x3d\",\"x3dz\"]},\"model/x3d-vrml\":{\"source\":\"iana\",\"extensions\":[\"x3dv\"]},\"multipart/alternative\":{\"source\":\"iana\",\"compressible\":false},\"multipart/appledouble\":{\"source\":\"iana\"},\"multipart/byteranges\":{\"source\":\"iana\"},\"multipart/digest\":{\"source\":\"iana\"},\"multipart/encrypted\":{\"source\":\"iana\",\"compressible\":false},\"multipart/form-data\":{\"source\":\"iana\",\"compressible\":false},\"multipart/header-set\":{\"source\":\"iana\"},\"multipart/mixed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/multilingual\":{\"source\":\"iana\"},\"multipart/parallel\":{\"source\":\"iana\"},\"multipart/related\":{\"source\":\"iana\",\"compressible\":false},\"multipart/report\":{\"source\":\"iana\"},\"multipart/signed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/vnd.bint.med-plus\":{\"source\":\"iana\"},\"multipart/voice-message\":{\"source\":\"iana\"},\"multipart/x-mixed-replace\":{\"source\":\"iana\"},\"text/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"text/cache-manifest\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"appcache\",\"manifest\"]},\"text/calendar\":{\"source\":\"iana\",\"extensions\":[\"ics\",\"ifb\"]},\"text/calender\":{\"compressible\":true},\"text/cmd\":{\"compressible\":true},\"text/coffeescript\":{\"extensions\":[\"coffee\",\"litcoffee\"]},\"text/css\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"css\"]},\"text/csv\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csv\"]},\"text/csv-schema\":{\"source\":\"iana\"},\"text/directory\":{\"source\":\"iana\"},\"text/dns\":{\"source\":\"iana\"},\"text/ecmascript\":{\"source\":\"iana\"},\"text/encaprtp\":{\"source\":\"iana\"},\"text/enriched\":{\"source\":\"iana\"},\"text/fwdred\":{\"source\":\"iana\"},\"text/grammar-ref-list\":{\"source\":\"iana\"},\"text/html\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"html\",\"htm\",\"shtml\"]},\"text/jade\":{\"extensions\":[\"jade\"]},\"text/javascript\":{\"source\":\"iana\",\"compressible\":true},\"text/jcr-cnd\":{\"source\":\"iana\"},\"text/jsx\":{\"compressible\":true,\"extensions\":[\"jsx\"]},\"text/less\":{\"compressible\":true,\"extensions\":[\"less\"]},\"text/markdown\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"markdown\",\"md\"]},\"text/mathml\":{\"source\":\"nginx\",\"extensions\":[\"mml\"]},\"text/mdx\":{\"compressible\":true,\"extensions\":[\"mdx\"]},\"text/mizar\":{\"source\":\"iana\"},\"text/n3\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"n3\"]},\"text/parameters\":{\"source\":\"iana\"},\"text/parityfec\":{\"source\":\"iana\"},\"text/plain\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"]},\"text/provenance-notation\":{\"source\":\"iana\"},\"text/prs.fallenstein.rst\":{\"source\":\"iana\"},\"text/prs.lines.tag\":{\"source\":\"iana\",\"extensions\":[\"dsc\"]},\"text/prs.prop.logic\":{\"source\":\"iana\"},\"text/raptorfec\":{\"source\":\"iana\"},\"text/red\":{\"source\":\"iana\"},\"text/rfc822-headers\":{\"source\":\"iana\"},\"text/richtext\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtx\"]},\"text/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"text/rtp-enc-aescm128\":{\"source\":\"iana\"},\"text/rtploopback\":{\"source\":\"iana\"},\"text/rtx\":{\"source\":\"iana\"},\"text/sgml\":{\"source\":\"iana\",\"extensions\":[\"sgml\",\"sgm\"]},\"text/shex\":{\"extensions\":[\"shex\"]},\"text/slim\":{\"extensions\":[\"slim\",\"slm\"]},\"text/strings\":{\"source\":\"iana\"},\"text/stylus\":{\"extensions\":[\"stylus\",\"styl\"]},\"text/t140\":{\"source\":\"iana\"},\"text/tab-separated-values\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tsv\"]},\"text/troff\":{\"source\":\"iana\",\"extensions\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"]},\"text/turtle\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"ttl\"]},\"text/ulpfec\":{\"source\":\"iana\"},\"text/uri-list\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uri\",\"uris\",\"urls\"]},\"text/vcard\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vcard\"]},\"text/vnd.a\":{\"source\":\"iana\"},\"text/vnd.abc\":{\"source\":\"iana\"},\"text/vnd.ascii-art\":{\"source\":\"iana\"},\"text/vnd.curl\":{\"source\":\"iana\",\"extensions\":[\"curl\"]},\"text/vnd.curl.dcurl\":{\"source\":\"apache\",\"extensions\":[\"dcurl\"]},\"text/vnd.curl.mcurl\":{\"source\":\"apache\",\"extensions\":[\"mcurl\"]},\"text/vnd.curl.scurl\":{\"source\":\"apache\",\"extensions\":[\"scurl\"]},\"text/vnd.debian.copyright\":{\"source\":\"iana\"},\"text/vnd.dmclientscript\":{\"source\":\"iana\"},\"text/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"text/vnd.esmertec.theme-descriptor\":{\"source\":\"iana\"},\"text/vnd.fly\":{\"source\":\"iana\",\"extensions\":[\"fly\"]},\"text/vnd.fmi.flexstor\":{\"source\":\"iana\",\"extensions\":[\"flx\"]},\"text/vnd.gml\":{\"source\":\"iana\"},\"text/vnd.graphviz\":{\"source\":\"iana\",\"extensions\":[\"gv\"]},\"text/vnd.hgl\":{\"source\":\"iana\"},\"text/vnd.in3d.3dml\":{\"source\":\"iana\",\"extensions\":[\"3dml\"]},\"text/vnd.in3d.spot\":{\"source\":\"iana\",\"extensions\":[\"spot\"]},\"text/vnd.iptc.newsml\":{\"source\":\"iana\"},\"text/vnd.iptc.nitf\":{\"source\":\"iana\"},\"text/vnd.latex-z\":{\"source\":\"iana\"},\"text/vnd.motorola.reflex\":{\"source\":\"iana\"},\"text/vnd.ms-mediapackage\":{\"source\":\"iana\"},\"text/vnd.net2phone.commcenter.command\":{\"source\":\"iana\"},\"text/vnd.radisys.msml-basic-layout\":{\"source\":\"iana\"},\"text/vnd.senx.warpscript\":{\"source\":\"iana\"},\"text/vnd.si.uricatalogue\":{\"source\":\"iana\"},\"text/vnd.sun.j2me.app-descriptor\":{\"source\":\"iana\",\"extensions\":[\"jad\"]},\"text/vnd.trolltech.linguist\":{\"source\":\"iana\"},\"text/vnd.wap.si\":{\"source\":\"iana\"},\"text/vnd.wap.sl\":{\"source\":\"iana\"},\"text/vnd.wap.wml\":{\"source\":\"iana\",\"extensions\":[\"wml\"]},\"text/vnd.wap.wmlscript\":{\"source\":\"iana\",\"extensions\":[\"wmls\"]},\"text/vtt\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"vtt\"]},\"text/x-asm\":{\"source\":\"apache\",\"extensions\":[\"s\",\"asm\"]},\"text/x-c\":{\"source\":\"apache\",\"extensions\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"]},\"text/x-component\":{\"source\":\"nginx\",\"extensions\":[\"htc\"]},\"text/x-fortran\":{\"source\":\"apache\",\"extensions\":[\"f\",\"for\",\"f77\",\"f90\"]},\"text/x-gwt-rpc\":{\"compressible\":true},\"text/x-handlebars-template\":{\"extensions\":[\"hbs\"]},\"text/x-java-source\":{\"source\":\"apache\",\"extensions\":[\"java\"]},\"text/x-jquery-tmpl\":{\"compressible\":true},\"text/x-lua\":{\"extensions\":[\"lua\"]},\"text/x-markdown\":{\"compressible\":true,\"extensions\":[\"mkd\"]},\"text/x-nfo\":{\"source\":\"apache\",\"extensions\":[\"nfo\"]},\"text/x-opml\":{\"source\":\"apache\",\"extensions\":[\"opml\"]},\"text/x-org\":{\"compressible\":true,\"extensions\":[\"org\"]},\"text/x-pascal\":{\"source\":\"apache\",\"extensions\":[\"p\",\"pas\"]},\"text/x-processing\":{\"compressible\":true,\"extensions\":[\"pde\"]},\"text/x-sass\":{\"extensions\":[\"sass\"]},\"text/x-scss\":{\"extensions\":[\"scss\"]},\"text/x-setext\":{\"source\":\"apache\",\"extensions\":[\"etx\"]},\"text/x-sfv\":{\"source\":\"apache\",\"extensions\":[\"sfv\"]},\"text/x-suse-ymp\":{\"compressible\":true,\"extensions\":[\"ymp\"]},\"text/x-uuencode\":{\"source\":\"apache\",\"extensions\":[\"uu\"]},\"text/x-vcalendar\":{\"source\":\"apache\",\"extensions\":[\"vcs\"]},\"text/x-vcard\":{\"source\":\"apache\",\"extensions\":[\"vcf\"]},\"text/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\"]},\"text/xml-external-parsed-entity\":{\"source\":\"iana\"},\"text/yaml\":{\"extensions\":[\"yaml\",\"yml\"]},\"video/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"video/3gpp\":{\"source\":\"iana\",\"extensions\":[\"3gp\",\"3gpp\"]},\"video/3gpp-tt\":{\"source\":\"iana\"},\"video/3gpp2\":{\"source\":\"iana\",\"extensions\":[\"3g2\"]},\"video/bmpeg\":{\"source\":\"iana\"},\"video/bt656\":{\"source\":\"iana\"},\"video/celb\":{\"source\":\"iana\"},\"video/dv\":{\"source\":\"iana\"},\"video/encaprtp\":{\"source\":\"iana\"},\"video/h261\":{\"source\":\"iana\",\"extensions\":[\"h261\"]},\"video/h263\":{\"source\":\"iana\",\"extensions\":[\"h263\"]},\"video/h263-1998\":{\"source\":\"iana\"},\"video/h263-2000\":{\"source\":\"iana\"},\"video/h264\":{\"source\":\"iana\",\"extensions\":[\"h264\"]},\"video/h264-rcdo\":{\"source\":\"iana\"},\"video/h264-svc\":{\"source\":\"iana\"},\"video/h265\":{\"source\":\"iana\"},\"video/iso.segment\":{\"source\":\"iana\"},\"video/jpeg\":{\"source\":\"iana\",\"extensions\":[\"jpgv\"]},\"video/jpeg2000\":{\"source\":\"iana\"},\"video/jpm\":{\"source\":\"apache\",\"extensions\":[\"jpm\",\"jpgm\"]},\"video/mj2\":{\"source\":\"iana\",\"extensions\":[\"mj2\",\"mjp2\"]},\"video/mp1s\":{\"source\":\"iana\"},\"video/mp2p\":{\"source\":\"iana\"},\"video/mp2t\":{\"source\":\"iana\",\"extensions\":[\"ts\"]},\"video/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mp4\",\"mp4v\",\"mpg4\"]},\"video/mp4v-es\":{\"source\":\"iana\"},\"video/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"]},\"video/mpeg4-generic\":{\"source\":\"iana\"},\"video/mpv\":{\"source\":\"iana\"},\"video/nv\":{\"source\":\"iana\"},\"video/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogv\"]},\"video/parityfec\":{\"source\":\"iana\"},\"video/pointer\":{\"source\":\"iana\"},\"video/quicktime\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"qt\",\"mov\"]},\"video/raptorfec\":{\"source\":\"iana\"},\"video/raw\":{\"source\":\"iana\"},\"video/rtp-enc-aescm128\":{\"source\":\"iana\"},\"video/rtploopback\":{\"source\":\"iana\"},\"video/rtx\":{\"source\":\"iana\"},\"video/smpte291\":{\"source\":\"iana\"},\"video/smpte292m\":{\"source\":\"iana\"},\"video/ulpfec\":{\"source\":\"iana\"},\"video/vc1\":{\"source\":\"iana\"},\"video/vc2\":{\"source\":\"iana\"},\"video/vnd.cctv\":{\"source\":\"iana\"},\"video/vnd.dece.hd\":{\"source\":\"iana\",\"extensions\":[\"uvh\",\"uvvh\"]},\"video/vnd.dece.mobile\":{\"source\":\"iana\",\"extensions\":[\"uvm\",\"uvvm\"]},\"video/vnd.dece.mp4\":{\"source\":\"iana\"},\"video/vnd.dece.pd\":{\"source\":\"iana\",\"extensions\":[\"uvp\",\"uvvp\"]},\"video/vnd.dece.sd\":{\"source\":\"iana\",\"extensions\":[\"uvs\",\"uvvs\"]},\"video/vnd.dece.video\":{\"source\":\"iana\",\"extensions\":[\"uvv\",\"uvvv\"]},\"video/vnd.directv.mpeg\":{\"source\":\"iana\"},\"video/vnd.directv.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dlna.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dvb.file\":{\"source\":\"iana\",\"extensions\":[\"dvb\"]},\"video/vnd.fvt\":{\"source\":\"iana\",\"extensions\":[\"fvt\"]},\"video/vnd.hns.video\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsavc\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsmpeg2\":{\"source\":\"iana\"},\"video/vnd.motorola.video\":{\"source\":\"iana\"},\"video/vnd.motorola.videop\":{\"source\":\"iana\"},\"video/vnd.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"mxu\",\"m4u\"]},\"video/vnd.ms-playready.media.pyv\":{\"source\":\"iana\",\"extensions\":[\"pyv\"]},\"video/vnd.nokia.interleaved-multimedia\":{\"source\":\"iana\"},\"video/vnd.nokia.mp4vr\":{\"source\":\"iana\"},\"video/vnd.nokia.videovoip\":{\"source\":\"iana\"},\"video/vnd.objectvideo\":{\"source\":\"iana\"},\"video/vnd.radgamettools.bink\":{\"source\":\"iana\"},\"video/vnd.radgamettools.smacker\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg1\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg4\":{\"source\":\"iana\"},\"video/vnd.sealed.swf\":{\"source\":\"iana\"},\"video/vnd.sealedmedia.softseal.mov\":{\"source\":\"iana\"},\"video/vnd.uvvu.mp4\":{\"source\":\"iana\",\"extensions\":[\"uvu\",\"uvvu\"]},\"video/vnd.vivo\":{\"source\":\"iana\",\"extensions\":[\"viv\"]},\"video/vp8\":{\"source\":\"iana\"},\"video/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"webm\"]},\"video/x-f4v\":{\"source\":\"apache\",\"extensions\":[\"f4v\"]},\"video/x-fli\":{\"source\":\"apache\",\"extensions\":[\"fli\"]},\"video/x-flv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"flv\"]},\"video/x-m4v\":{\"source\":\"apache\",\"extensions\":[\"m4v\"]},\"video/x-matroska\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"mkv\",\"mk3d\",\"mks\"]},\"video/x-mng\":{\"source\":\"apache\",\"extensions\":[\"mng\"]},\"video/x-ms-asf\":{\"source\":\"apache\",\"extensions\":[\"asf\",\"asx\"]},\"video/x-ms-vob\":{\"source\":\"apache\",\"extensions\":[\"vob\"]},\"video/x-ms-wm\":{\"source\":\"apache\",\"extensions\":[\"wm\"]},\"video/x-ms-wmv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"wmv\"]},\"video/x-ms-wmx\":{\"source\":\"apache\",\"extensions\":[\"wmx\"]},\"video/x-ms-wvx\":{\"source\":\"apache\",\"extensions\":[\"wvx\"]},\"video/x-msvideo\":{\"source\":\"apache\",\"extensions\":[\"avi\"]},\"video/x-sgi-movie\":{\"source\":\"apache\",\"extensions\":[\"movie\"]},\"video/x-smv\":{\"source\":\"apache\",\"extensions\":[\"smv\"]},\"x-conference/x-cooltalk\":{\"source\":\"apache\",\"extensions\":[\"ice\"]},\"x-shader/x-fragment\":{\"compressible\":true},\"x-shader/x-vertex\":{\"compressible\":true}};\n\n//# sourceURL=webpack:///./node_modules/mime-db/db.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mime-db/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/mime-db/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = __webpack_require__(/*! ./db.json */ \"./node_modules/mime-db/db.json\")\n\n\n//# sourceURL=webpack:///./node_modules/mime-db/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mime-types/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/mime-types/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = __webpack_require__(/*! mime-db */ \"./node_modules/mime-db/index.js\")\nvar extname = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\").extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/mime-types/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/minimalistic-assert/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/minimalistic-assert/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n\n\n//# sourceURL=webpack:///./node_modules/minimalistic-assert/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-box-encoding/boxes.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/mp4-box-encoding/boxes.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// This is an intentionally recursive require. I don't like it either.\nvar Box = __webpack_require__(/*! ./index */ \"./node_modules/mp4-box-encoding/index.js\")\nvar Descriptor = __webpack_require__(/*! ./descriptor */ \"./node_modules/mp4-box-encoding/descriptor.js\")\nvar bufferAlloc = __webpack_require__(/*! buffer-alloc */ \"./node_modules/buffer-alloc/index.js\")\nvar bufferFrom = __webpack_require__(/*! buffer-from */ \"./node_modules/buffer-from/index.js\")\nvar uint64be = __webpack_require__(/*! uint64be */ \"./node_modules/uint64be/index.js\")\n\nvar TIME_OFFSET = 2082844800000\n\n/*\nTODO:\ntest these\nadd new box versions\n*/\n\n// These have 'version' and 'flags' fields in the headers\nexports.fullBoxes = {}\nvar fullBoxes = [\n 'mvhd',\n 'tkhd',\n 'mdhd',\n 'vmhd',\n 'smhd',\n 'stsd',\n 'esds',\n 'stsz',\n 'stco',\n 'co64',\n 'stss',\n 'stts',\n 'ctts',\n 'stsc',\n 'dref',\n 'elst',\n 'hdlr',\n 'mehd',\n 'trex',\n 'mfhd',\n 'tfhd',\n 'tfdt',\n 'trun'\n]\nfullBoxes.forEach(function (type) {\n exports.fullBoxes[type] = true\n})\n\nexports.ftyp = {}\nexports.ftyp.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.ftyp.encodingLength(box))\n var brands = box.compatibleBrands || []\n buf.write(box.brand, 0, 4, 'ascii')\n buf.writeUInt32BE(box.brandVersion, 4)\n for (var i = 0; i < brands.length; i++) buf.write(brands[i], 8 + (i * 4), 4, 'ascii')\n exports.ftyp.encode.bytes = 8 + brands.length * 4\n return buf\n}\nexports.ftyp.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var brand = buf.toString('ascii', 0, 4)\n var version = buf.readUInt32BE(4)\n var compatibleBrands = []\n for (var i = 8; i < buf.length; i += 4) compatibleBrands.push(buf.toString('ascii', i, i + 4))\n return {\n brand: brand,\n brandVersion: version,\n compatibleBrands: compatibleBrands\n }\n}\nexports.ftyp.encodingLength = function (box) {\n return 8 + (box.compatibleBrands || []).length * 4\n}\n\nexports.mvhd = {}\nexports.mvhd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(96)\n writeDate(box.ctime || new Date(), buf, 0)\n writeDate(box.mtime || new Date(), buf, 4)\n buf.writeUInt32BE(box.timeScale || 0, 8)\n buf.writeUInt32BE(box.duration || 0, 12)\n writeFixed32(box.preferredRate || 0, buf, 16)\n writeFixed16(box.preferredVolume || 0, buf, 20)\n writeReserved(buf, 22, 32)\n writeMatrix(box.matrix, buf, 32)\n buf.writeUInt32BE(box.previewTime || 0, 68)\n buf.writeUInt32BE(box.previewDuration || 0, 72)\n buf.writeUInt32BE(box.posterTime || 0, 76)\n buf.writeUInt32BE(box.selectionTime || 0, 80)\n buf.writeUInt32BE(box.selectionDuration || 0, 84)\n buf.writeUInt32BE(box.currentTime || 0, 88)\n buf.writeUInt32BE(box.nextTrackId || 0, 92)\n exports.mvhd.encode.bytes = 96\n return buf\n}\nexports.mvhd.decode = function (buf, offset) {\n buf = buf.slice(offset)\n return {\n ctime: readDate(buf, 0),\n mtime: readDate(buf, 4),\n timeScale: buf.readUInt32BE(8),\n duration: buf.readUInt32BE(12),\n preferredRate: readFixed32(buf, 16),\n preferredVolume: readFixed16(buf, 20),\n matrix: readMatrix(buf.slice(32, 68)),\n previewTime: buf.readUInt32BE(68),\n previewDuration: buf.readUInt32BE(72),\n posterTime: buf.readUInt32BE(76),\n selectionTime: buf.readUInt32BE(80),\n selectionDuration: buf.readUInt32BE(84),\n currentTime: buf.readUInt32BE(88),\n nextTrackId: buf.readUInt32BE(92)\n }\n}\nexports.mvhd.encodingLength = function (box) {\n return 96\n}\n\nexports.tkhd = {}\nexports.tkhd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(80)\n writeDate(box.ctime || new Date(), buf, 0)\n writeDate(box.mtime || new Date(), buf, 4)\n buf.writeUInt32BE(box.trackId || 0, 8)\n writeReserved(buf, 12, 16)\n buf.writeUInt32BE(box.duration || 0, 16)\n writeReserved(buf, 20, 28)\n buf.writeUInt16BE(box.layer || 0, 28)\n buf.writeUInt16BE(box.alternateGroup || 0, 30)\n buf.writeUInt16BE(box.volume || 0, 32)\n writeMatrix(box.matrix, buf, 36)\n buf.writeUInt32BE(box.trackWidth || 0, 72)\n buf.writeUInt32BE(box.trackHeight || 0, 76)\n exports.tkhd.encode.bytes = 80\n return buf\n}\nexports.tkhd.decode = function (buf, offset) {\n buf = buf.slice(offset)\n return {\n ctime: readDate(buf, 0),\n mtime: readDate(buf, 4),\n trackId: buf.readUInt32BE(8),\n duration: buf.readUInt32BE(16),\n layer: buf.readUInt16BE(28),\n alternateGroup: buf.readUInt16BE(30),\n volume: buf.readUInt16BE(32),\n matrix: readMatrix(buf.slice(36, 72)),\n trackWidth: buf.readUInt32BE(72),\n trackHeight: buf.readUInt32BE(76)\n }\n}\nexports.tkhd.encodingLength = function (box) {\n return 80\n}\n\nexports.mdhd = {}\nexports.mdhd.encode = function (box, buf, offset) {\n if (box.version === 1) {\n buf = buf ? buf.slice(offset) : bufferAlloc(32)\n writeDate64(box.ctime || new Date(), buf, 0)\n writeDate64(box.mtime || new Date(), buf, 8)\n buf.writeUInt32BE(box.timeScale || 0, 16)\n // Node only supports integer <= 48bit. Waiting for BigInt!\n buf.writeUIntBE(box.duration || 0, 20, 6)\n buf.writeUInt16BE(box.language || 0, 28)\n buf.writeUInt16BE(box.quality || 0, 30)\n exports.mdhd.encode.bytes = 32\n return buf\n }\n\n buf = buf ? buf.slice(offset) : bufferAlloc(20)\n writeDate(box.ctime || new Date(), buf, 0)\n writeDate(box.mtime || new Date(), buf, 4)\n buf.writeUInt32BE(box.timeScale || 0, 8)\n buf.writeUInt32BE(box.duration || 0, 12)\n buf.writeUInt16BE(box.language || 0, 16)\n buf.writeUInt16BE(box.quality || 0, 18)\n exports.mdhd.encode.bytes = 20\n return buf\n}\n\nexports.mdhd.decode = function (buf, offset, end) {\n buf = buf.slice(offset)\n\n var version1 = (end - offset) !== 20\n\n // In version 1 creation time and modification time are unsigned long\n if (version1) {\n return {\n ctime: readDate64(buf, 0),\n mtime: readDate64(buf, 8),\n timeScale: buf.readUInt32BE(16),\n // Node only supports integer <= 48bit. Waiting for BigInt!\n duration: buf.readUIntBE(20, 6),\n language: buf.readUInt16BE(28),\n quality: buf.readUInt16BE(30)\n }\n }\n\n return {\n ctime: readDate(buf, 0),\n mtime: readDate(buf, 4),\n timeScale: buf.readUInt32BE(8),\n duration: buf.readUInt32BE(12),\n language: buf.readUInt16BE(16),\n quality: buf.readUInt16BE(18)\n }\n}\nexports.mdhd.encodingLength = function (box) {\n if (box.version === 1) return 32\n\n return 20\n}\n\nexports.vmhd = {}\nexports.vmhd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(8)\n buf.writeUInt16BE(box.graphicsMode || 0, 0)\n var opcolor = box.opcolor || [0, 0, 0]\n buf.writeUInt16BE(opcolor[0], 2)\n buf.writeUInt16BE(opcolor[1], 4)\n buf.writeUInt16BE(opcolor[2], 6)\n exports.vmhd.encode.bytes = 8\n return buf\n}\nexports.vmhd.decode = function (buf, offset) {\n buf = buf.slice(offset)\n return {\n graphicsMode: buf.readUInt16BE(0),\n opcolor: [buf.readUInt16BE(2), buf.readUInt16BE(4), buf.readUInt16BE(6)]\n }\n}\nexports.vmhd.encodingLength = function (box) {\n return 8\n}\n\nexports.smhd = {}\nexports.smhd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(4)\n buf.writeUInt16BE(box.balance || 0, 0)\n writeReserved(buf, 2, 4)\n exports.smhd.encode.bytes = 4\n return buf\n}\nexports.smhd.decode = function (buf, offset) {\n buf = buf.slice(offset)\n return {\n balance: buf.readUInt16BE(0)\n }\n}\nexports.smhd.encodingLength = function (box) {\n return 4\n}\n\nexports.stsd = {}\nexports.stsd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.stsd.encodingLength(box))\n var entries = box.entries || []\n\n buf.writeUInt32BE(entries.length, 0)\n\n var ptr = 4\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i]\n Box.encode(entry, buf, ptr)\n ptr += Box.encode.bytes\n }\n\n exports.stsd.encode.bytes = ptr\n return buf\n}\nexports.stsd.decode = function (buf, offset, end) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n var ptr = 4\n\n for (var i = 0; i < num; i++) {\n var entry = Box.decode(buf, ptr, end)\n entries[i] = entry\n ptr += entry.length\n }\n\n return {\n entries: entries\n }\n}\nexports.stsd.encodingLength = function (box) {\n var totalSize = 4\n if (!box.entries) return totalSize\n for (var i = 0; i < box.entries.length; i++) {\n totalSize += Box.encodingLength(box.entries[i])\n }\n return totalSize\n}\n\nexports.avc1 = exports.VisualSampleEntry = {}\nexports.VisualSampleEntry.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.VisualSampleEntry.encodingLength(box))\n\n writeReserved(buf, 0, 6)\n buf.writeUInt16BE(box.dataReferenceIndex || 0, 6)\n writeReserved(buf, 8, 24)\n buf.writeUInt16BE(box.width || 0, 24)\n buf.writeUInt16BE(box.height || 0, 26)\n buf.writeUInt32BE(box.hResolution || 0x480000, 28)\n buf.writeUInt32BE(box.vResolution || 0x480000, 32)\n writeReserved(buf, 36, 40)\n buf.writeUInt16BE(box.frameCount || 1, 40)\n var compressorName = box.compressorName || ''\n var nameLen = Math.min(compressorName.length, 31)\n buf.writeUInt8(nameLen, 42)\n buf.write(compressorName, 43, nameLen, 'utf8')\n buf.writeUInt16BE(box.depth || 0x18, 74)\n buf.writeInt16BE(-1, 76)\n\n var ptr = 78\n var children = box.children || []\n children.forEach(function (child) {\n Box.encode(child, buf, ptr)\n ptr += Box.encode.bytes\n })\n exports.VisualSampleEntry.encode.bytes = ptr\n}\nexports.VisualSampleEntry.decode = function (buf, offset, end) {\n buf = buf.slice(offset)\n var length = end - offset\n var nameLen = Math.min(buf.readUInt8(42), 31)\n var box = {\n dataReferenceIndex: buf.readUInt16BE(6),\n width: buf.readUInt16BE(24),\n height: buf.readUInt16BE(26),\n hResolution: buf.readUInt32BE(28),\n vResolution: buf.readUInt32BE(32),\n frameCount: buf.readUInt16BE(40),\n compressorName: buf.toString('utf8', 43, 43 + nameLen),\n depth: buf.readUInt16BE(74),\n children: []\n }\n\n var ptr = 78\n while (length - ptr >= 8) {\n var child = Box.decode(buf, ptr, length)\n box.children.push(child)\n box[child.type] = child\n ptr += child.length\n }\n\n return box\n}\nexports.VisualSampleEntry.encodingLength = function (box) {\n var len = 78\n var children = box.children || []\n children.forEach(function (child) {\n len += Box.encodingLength(child)\n })\n return len\n}\n\nexports.avcC = {}\nexports.avcC.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(box.buffer.length)\n\n box.buffer.copy(buf)\n exports.avcC.encode.bytes = box.buffer.length\n}\nexports.avcC.decode = function (buf, offset, end) {\n buf = buf.slice(offset, end)\n\n return {\n mimeCodec: buf.toString('hex', 1, 4),\n buffer: bufferFrom(buf)\n }\n}\nexports.avcC.encodingLength = function (box) {\n return box.buffer.length\n}\n\nexports.mp4a = exports.AudioSampleEntry = {}\nexports.AudioSampleEntry.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.AudioSampleEntry.encodingLength(box))\n\n writeReserved(buf, 0, 6)\n buf.writeUInt16BE(box.dataReferenceIndex || 0, 6)\n writeReserved(buf, 8, 16)\n buf.writeUInt16BE(box.channelCount || 2, 16)\n buf.writeUInt16BE(box.sampleSize || 16, 18)\n writeReserved(buf, 20, 24)\n buf.writeUInt32BE(box.sampleRate || 0, 24)\n\n var ptr = 28\n var children = box.children || []\n children.forEach(function (child) {\n Box.encode(child, buf, ptr)\n ptr += Box.encode.bytes\n })\n exports.AudioSampleEntry.encode.bytes = ptr\n}\nexports.AudioSampleEntry.decode = function (buf, offset, end) {\n buf = buf.slice(offset, end)\n var length = end - offset\n var box = {\n dataReferenceIndex: buf.readUInt16BE(6),\n channelCount: buf.readUInt16BE(16),\n sampleSize: buf.readUInt16BE(18),\n sampleRate: buf.readUInt32BE(24),\n children: []\n }\n\n var ptr = 28\n while (length - ptr >= 8) {\n var child = Box.decode(buf, ptr, length)\n box.children.push(child)\n box[child.type] = child\n ptr += child.length\n }\n\n return box\n}\nexports.AudioSampleEntry.encodingLength = function (box) {\n var len = 28\n var children = box.children || []\n children.forEach(function (child) {\n len += Box.encodingLength(child)\n })\n return len\n}\n\nexports.esds = {}\nexports.esds.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(box.buffer.length)\n\n box.buffer.copy(buf, 0)\n exports.esds.encode.bytes = box.buffer.length\n}\nexports.esds.decode = function (buf, offset, end) {\n buf = buf.slice(offset, end)\n\n var desc = Descriptor.Descriptor.decode(buf, 0, buf.length)\n var esd = (desc.tagName === 'ESDescriptor') ? desc : {}\n var dcd = esd.DecoderConfigDescriptor || {}\n var oti = dcd.oti || 0\n var dsi = dcd.DecoderSpecificInfo\n var audioConfig = dsi ? (dsi.buffer.readUInt8(0) & 0xf8) >> 3 : 0\n\n var mimeCodec = null\n if (oti) {\n mimeCodec = oti.toString(16)\n if (audioConfig) {\n mimeCodec += '.' + audioConfig\n }\n }\n\n return {\n mimeCodec: mimeCodec,\n buffer: bufferFrom(buf.slice(0))\n }\n}\nexports.esds.encodingLength = function (box) {\n return box.buffer.length\n}\n\n// TODO: integrate the two versions in a saner way\nexports.stsz = {}\nexports.stsz.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.stsz.encodingLength(box))\n\n buf.writeUInt32BE(0, 0)\n buf.writeUInt32BE(entries.length, 4)\n\n for (var i = 0; i < entries.length; i++) {\n buf.writeUInt32BE(entries[i], i * 4 + 8)\n }\n\n exports.stsz.encode.bytes = 8 + entries.length * 4\n return buf\n}\nexports.stsz.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var size = buf.readUInt32BE(0)\n var num = buf.readUInt32BE(4)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n if (size === 0) {\n entries[i] = buf.readUInt32BE(i * 4 + 8)\n } else {\n entries[i] = size\n }\n }\n\n return {\n entries: entries\n }\n}\nexports.stsz.encodingLength = function (box) {\n return 8 + box.entries.length * 4\n}\n\nexports.stss =\nexports.stco = {}\nexports.stco.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.stco.encodingLength(box))\n\n buf.writeUInt32BE(entries.length, 0)\n\n for (var i = 0; i < entries.length; i++) {\n buf.writeUInt32BE(entries[i], i * 4 + 4)\n }\n\n exports.stco.encode.bytes = 4 + entries.length * 4\n return buf\n}\nexports.stco.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n entries[i] = buf.readUInt32BE(i * 4 + 4)\n }\n\n return {\n entries: entries\n }\n}\nexports.stco.encodingLength = function (box) {\n return 4 + box.entries.length * 4\n}\n\nexports.co64 = {}\nexports.co64.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.co64.encodingLength(box))\n\n buf.writeUInt32BE(entries.length, 0)\n\n for (var i = 0; i < entries.length; i++) {\n uint64be.encode(entries[i], buf, i * 8 + 4)\n }\n\n exports.co64.encode.bytes = 4 + entries.length * 8\n return buf\n}\nexports.co64.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n entries[i] = uint64be.decode(buf, i * 8 + 4)\n }\n\n return {\n entries: entries\n }\n}\nexports.co64.encodingLength = function (box) {\n return 4 + box.entries.length * 8\n}\n\nexports.stts = {}\nexports.stts.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.stts.encodingLength(box))\n\n buf.writeUInt32BE(entries.length, 0)\n\n for (var i = 0; i < entries.length; i++) {\n var ptr = i * 8 + 4\n buf.writeUInt32BE(entries[i].count || 0, ptr)\n buf.writeUInt32BE(entries[i].duration || 0, ptr + 4)\n }\n\n exports.stts.encode.bytes = 4 + box.entries.length * 8\n return buf\n}\nexports.stts.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n var ptr = i * 8 + 4\n entries[i] = {\n count: buf.readUInt32BE(ptr),\n duration: buf.readUInt32BE(ptr + 4)\n }\n }\n\n return {\n entries: entries\n }\n}\nexports.stts.encodingLength = function (box) {\n return 4 + box.entries.length * 8\n}\n\nexports.ctts = {}\nexports.ctts.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.ctts.encodingLength(box))\n\n buf.writeUInt32BE(entries.length, 0)\n\n for (var i = 0; i < entries.length; i++) {\n var ptr = i * 8 + 4\n buf.writeUInt32BE(entries[i].count || 0, ptr)\n buf.writeUInt32BE(entries[i].compositionOffset || 0, ptr + 4)\n }\n\n exports.ctts.encode.bytes = 4 + entries.length * 8\n return buf\n}\nexports.ctts.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n var ptr = i * 8 + 4\n entries[i] = {\n count: buf.readUInt32BE(ptr),\n compositionOffset: buf.readInt32BE(ptr + 4)\n }\n }\n\n return {\n entries: entries\n }\n}\nexports.ctts.encodingLength = function (box) {\n return 4 + box.entries.length * 8\n}\n\nexports.stsc = {}\nexports.stsc.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.stsc.encodingLength(box))\n\n buf.writeUInt32BE(entries.length, 0)\n\n for (var i = 0; i < entries.length; i++) {\n var ptr = i * 12 + 4\n buf.writeUInt32BE(entries[i].firstChunk || 0, ptr)\n buf.writeUInt32BE(entries[i].samplesPerChunk || 0, ptr + 4)\n buf.writeUInt32BE(entries[i].sampleDescriptionId || 0, ptr + 8)\n }\n\n exports.stsc.encode.bytes = 4 + entries.length * 12\n return buf\n}\nexports.stsc.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n var ptr = i * 12 + 4\n entries[i] = {\n firstChunk: buf.readUInt32BE(ptr),\n samplesPerChunk: buf.readUInt32BE(ptr + 4),\n sampleDescriptionId: buf.readUInt32BE(ptr + 8)\n }\n }\n\n return {\n entries: entries\n }\n}\nexports.stsc.encodingLength = function (box) {\n return 4 + box.entries.length * 12\n}\n\nexports.dref = {}\nexports.dref.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.dref.encodingLength(box))\n var entries = box.entries || []\n\n buf.writeUInt32BE(entries.length, 0)\n\n var ptr = 4\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i]\n var size = (entry.buf ? entry.buf.length : 0) + 4 + 4\n\n buf.writeUInt32BE(size, ptr)\n ptr += 4\n\n buf.write(entry.type, ptr, 4, 'ascii')\n ptr += 4\n\n if (entry.buf) {\n entry.buf.copy(buf, ptr)\n ptr += entry.buf.length\n }\n }\n\n exports.dref.encode.bytes = ptr\n return buf\n}\nexports.dref.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n var ptr = 4\n\n for (var i = 0; i < num; i++) {\n var size = buf.readUInt32BE(ptr)\n var type = buf.toString('ascii', ptr + 4, ptr + 8)\n var tmp = buf.slice(ptr + 8, ptr + size)\n ptr += size\n\n entries[i] = {\n type: type,\n buf: tmp\n }\n }\n\n return {\n entries: entries\n }\n}\nexports.dref.encodingLength = function (box) {\n var totalSize = 4\n if (!box.entries) return totalSize\n for (var i = 0; i < box.entries.length; i++) {\n var buf = box.entries[i].buf\n totalSize += (buf ? buf.length : 0) + 4 + 4\n }\n return totalSize\n}\n\nexports.elst = {}\nexports.elst.encode = function (box, buf, offset) {\n var entries = box.entries || []\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.elst.encodingLength(box))\n\n buf.writeUInt32BE(entries.length, 0)\n\n for (var i = 0; i < entries.length; i++) {\n var ptr = i * 12 + 4\n buf.writeUInt32BE(entries[i].trackDuration || 0, ptr)\n buf.writeUInt32BE(entries[i].mediaTime || 0, ptr + 4)\n writeFixed32(entries[i].mediaRate || 0, buf, ptr + 8)\n }\n\n exports.elst.encode.bytes = 4 + entries.length * 12\n return buf\n}\nexports.elst.decode = function (buf, offset) {\n buf = buf.slice(offset)\n var num = buf.readUInt32BE(0)\n var entries = new Array(num)\n\n for (var i = 0; i < num; i++) {\n var ptr = i * 12 + 4\n entries[i] = {\n trackDuration: buf.readUInt32BE(ptr),\n mediaTime: buf.readInt32BE(ptr + 4),\n mediaRate: readFixed32(buf, ptr + 8)\n }\n }\n\n return {\n entries: entries\n }\n}\nexports.elst.encodingLength = function (box) {\n return 4 + box.entries.length * 12\n}\n\nexports.hdlr = {}\nexports.hdlr.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(exports.hdlr.encodingLength(box))\n\n var len = 21 + (box.name || '').length\n buf.fill(0, 0, len)\n\n buf.write(box.handlerType || '', 4, 4, 'ascii')\n writeString(box.name || '', buf, 20)\n\n exports.hdlr.encode.bytes = len\n return buf\n}\nexports.hdlr.decode = function (buf, offset, end) {\n buf = buf.slice(offset)\n return {\n handlerType: buf.toString('ascii', 4, 8),\n name: readString(buf, 20, end)\n }\n}\nexports.hdlr.encodingLength = function (box) {\n return 21 + (box.name || '').length\n}\n\nexports.mehd = {}\nexports.mehd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(4)\n\n buf.writeUInt32BE(box.fragmentDuration || 0, 0)\n exports.mehd.encode.bytes = 4\n return buf\n}\nexports.mehd.decode = function (buf, offset) {\n buf = buf.slice(offset)\n return {\n fragmentDuration: buf.readUInt32BE(0)\n }\n}\nexports.mehd.encodingLength = function (box) {\n return 4\n}\n\nexports.trex = {}\nexports.trex.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(20)\n\n buf.writeUInt32BE(box.trackId || 0, 0)\n buf.writeUInt32BE(box.defaultSampleDescriptionIndex || 0, 4)\n buf.writeUInt32BE(box.defaultSampleDuration || 0, 8)\n buf.writeUInt32BE(box.defaultSampleSize || 0, 12)\n buf.writeUInt32BE(box.defaultSampleFlags || 0, 16)\n exports.trex.encode.bytes = 20\n return buf\n}\nexports.trex.decode = function (buf, offset) {\n buf = buf.slice(offset)\n return {\n trackId: buf.readUInt32BE(0),\n defaultSampleDescriptionIndex: buf.readUInt32BE(4),\n defaultSampleDuration: buf.readUInt32BE(8),\n defaultSampleSize: buf.readUInt32BE(12),\n defaultSampleFlags: buf.readUInt32BE(16)\n }\n}\nexports.trex.encodingLength = function (box) {\n return 20\n}\n\nexports.mfhd = {}\nexports.mfhd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(4)\n\n buf.writeUInt32BE(box.sequenceNumber || 0, 0)\n exports.mfhd.encode.bytes = 4\n return buf\n}\nexports.mfhd.decode = function (buf, offset) {\n return {\n sequenceNumber: buf.readUInt32BE(0)\n }\n}\nexports.mfhd.encodingLength = function (box) {\n return 4\n}\n\nexports.tfhd = {}\nexports.tfhd.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(4)\n buf.writeUInt32BE(box.trackId, 0)\n exports.tfhd.encode.bytes = 4\n return buf\n}\nexports.tfhd.decode = function (buf, offset) {\n // TODO: this\n}\nexports.tfhd.encodingLength = function (box) {\n // TODO: this is wrong!\n return 4\n}\n\nexports.tfdt = {}\nexports.tfdt.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(4)\n\n buf.writeUInt32BE(box.baseMediaDecodeTime || 0, 0)\n exports.tfdt.encode.bytes = 4\n return buf\n}\nexports.tfdt.decode = function (buf, offset) {\n // TODO: this\n}\nexports.tfdt.encodingLength = function (box) {\n return 4\n}\n\nexports.trun = {}\nexports.trun.encode = function (box, buf, offset) {\n buf = buf ? buf.slice(offset) : bufferAlloc(8 + box.entries.length * 16)\n\n // TODO: this is wrong\n buf.writeUInt32BE(box.entries.length, 0)\n buf.writeInt32BE(box.dataOffset, 4)\n var ptr = 8\n for (var i = 0; i < box.entries.length; i++) {\n var entry = box.entries[i]\n buf.writeUInt32BE(entry.sampleDuration, ptr)\n ptr += 4\n\n buf.writeUInt32BE(entry.sampleSize, ptr)\n ptr += 4\n\n buf.writeUInt32BE(entry.sampleFlags, ptr)\n ptr += 4\n\n if ((box.version || 0) === 0) {\n buf.writeUInt32BE(entry.sampleCompositionTimeOffset, ptr)\n } else {\n buf.writeInt32BE(entry.sampleCompositionTimeOffset, ptr)\n }\n ptr += 4\n }\n exports.trun.encode.bytes = ptr\n}\nexports.trun.decode = function (buf, offset) {\n // TODO: this\n}\nexports.trun.encodingLength = function (box) {\n // TODO: this is wrong\n return 8 + box.entries.length * 16\n}\n\nexports.mdat = {}\nexports.mdat.encode = function (box, buf, offset) {\n if (box.buffer) {\n box.buffer.copy(buf, offset)\n exports.mdat.encode.bytes = box.buffer.length\n } else {\n exports.mdat.encode.bytes = exports.mdat.encodingLength(box)\n }\n}\nexports.mdat.decode = function (buf, start, end) {\n return {\n buffer: bufferFrom(buf.slice(start, end))\n }\n}\nexports.mdat.encodingLength = function (box) {\n return box.buffer ? box.buffer.length : box.contentLength\n}\n\nfunction writeReserved (buf, offset, end) {\n for (var i = offset; i < end; i++) buf[i] = 0\n}\n\nfunction writeDate (date, buf, offset) {\n buf.writeUInt32BE(Math.floor((date.getTime() + TIME_OFFSET) / 1000), offset)\n}\n\nfunction writeDate64 (date, buf, offset) {\n // Node only supports integer <= 48bit. Waiting for BigInt!\n buf.writeUIntBE(Math.floor((date.getTime() + TIME_OFFSET) / 1000), offset, 6)\n}\n\n// TODO: think something is wrong here\nfunction writeFixed32 (num, buf, offset) {\n buf.writeUInt16BE(Math.floor(num) % (256 * 256), offset)\n buf.writeUInt16BE(Math.floor(num * 256 * 256) % (256 * 256), offset + 2)\n}\n\nfunction writeFixed16 (num, buf, offset) {\n buf[offset] = Math.floor(num) % 256\n buf[offset + 1] = Math.floor(num * 256) % 256\n}\n\nfunction writeMatrix (list, buf, offset) {\n if (!list) list = [0, 0, 0, 0, 0, 0, 0, 0, 0]\n for (var i = 0; i < list.length; i++) {\n writeFixed32(list[i], buf, offset + i * 4)\n }\n}\n\nfunction writeString (str, buf, offset) {\n var strBuffer = bufferFrom(str, 'utf8')\n strBuffer.copy(buf, offset)\n buf[offset + strBuffer.length] = 0\n}\n\nfunction readMatrix (buf) {\n var list = new Array(buf.length / 4)\n for (var i = 0; i < list.length; i++) list[i] = readFixed32(buf, i * 4)\n return list\n}\n\nfunction readDate64 (buf, offset) {\n // Node only supports integer <= 48bit. Waiting for BigInt!\n return new Date(buf.readUIntBE(offset, 6) * 1000 - TIME_OFFSET)\n}\n\nfunction readDate (buf, offset) {\n return new Date(buf.readUInt32BE(offset) * 1000 - TIME_OFFSET)\n}\n\nfunction readFixed32 (buf, offset) {\n return buf.readUInt16BE(offset) + buf.readUInt16BE(offset + 2) / (256 * 256)\n}\n\nfunction readFixed16 (buf, offset) {\n return buf[offset] + buf[offset + 1] / 256\n}\n\nfunction readString (buf, offset, length) {\n var i\n for (i = 0; i < length; i++) {\n if (buf[offset + i] === 0) {\n break\n }\n }\n return buf.toString('utf8', offset, offset + i)\n}\n\n\n//# sourceURL=webpack:///./node_modules/mp4-box-encoding/boxes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-box-encoding/descriptor.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/mp4-box-encoding/descriptor.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var bufferFrom = __webpack_require__(/*! buffer-from */ \"./node_modules/buffer-from/index.js\")\n\nvar tagToName = {\n 0x03: 'ESDescriptor',\n 0x04: 'DecoderConfigDescriptor',\n 0x05: 'DecoderSpecificInfo',\n 0x06: 'SLConfigDescriptor'\n}\n\nexports.Descriptor = {}\nexports.Descriptor.decode = function (buf, start, end) {\n var tag = buf.readUInt8(start)\n var ptr = start + 1\n var lenByte\n var len = 0\n do {\n lenByte = buf.readUInt8(ptr++)\n len = (len << 7) | (lenByte & 0x7f)\n } while (lenByte & 0x80)\n\n var obj\n var tagName = tagToName[tag] // May be undefined; that's ok\n if (exports[tagName]) {\n obj = exports[tagName].decode(buf, ptr, end)\n } else {\n obj = {\n buffer: bufferFrom(buf.slice(ptr, ptr + len))\n }\n }\n\n obj.tag = tag\n obj.tagName = tagName\n obj.length = (ptr - start) + len\n obj.contentsLen = len\n return obj\n}\n\nexports.DescriptorArray = {}\nexports.DescriptorArray.decode = function (buf, start, end) {\n var ptr = start\n var obj = {}\n while (ptr + 2 <= end) {\n var descriptor = exports.Descriptor.decode(buf, ptr, end)\n ptr += descriptor.length\n var tagName = tagToName[descriptor.tag] || ('Descriptor' + descriptor.tag)\n obj[tagName] = descriptor\n }\n return obj\n}\n\nexports.ESDescriptor = {}\nexports.ESDescriptor.decode = function (buf, start, end) {\n var flags = buf.readUInt8(start + 2)\n var ptr = start + 3\n if (flags & 0x80) {\n ptr += 2\n }\n if (flags & 0x40) {\n var len = buf.readUInt8(ptr)\n ptr += len + 1\n }\n if (flags & 0x20) {\n ptr += 2\n }\n return exports.DescriptorArray.decode(buf, ptr, end)\n}\n\nexports.DecoderConfigDescriptor = {}\nexports.DecoderConfigDescriptor.decode = function (buf, start, end) {\n var oti = buf.readUInt8(start)\n var obj = exports.DescriptorArray.decode(buf, start + 13, end)\n obj.oti = oti\n return obj\n}\n\n\n//# sourceURL=webpack:///./node_modules/mp4-box-encoding/descriptor.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-box-encoding/index.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/mp4-box-encoding/index.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// var assert = require('assert')\nvar uint64be = __webpack_require__(/*! uint64be */ \"./node_modules/uint64be/index.js\")\nvar bufferAlloc = __webpack_require__(/*! buffer-alloc */ \"./node_modules/buffer-alloc/index.js\")\nvar bufferFrom = __webpack_require__(/*! buffer-from */ \"./node_modules/buffer-from/index.js\")\n\nvar boxes = __webpack_require__(/*! ./boxes */ \"./node_modules/mp4-box-encoding/boxes.js\")\n\nvar UINT32_MAX = 4294967295\n\nvar Box = exports\n\n/*\n * Lists the proper order for boxes inside containers.\n * Five-character names ending in 's' indicate arrays instead of single elements.\n */\nvar containers = exports.containers = {\n 'moov': ['mvhd', 'meta', 'traks', 'mvex'],\n 'trak': ['tkhd', 'tref', 'trgr', 'edts', 'meta', 'mdia', 'udta'],\n 'edts': ['elst'],\n 'mdia': ['mdhd', 'hdlr', 'elng', 'minf'],\n 'minf': ['vmhd', 'smhd', 'hmhd', 'sthd', 'nmhd', 'dinf', 'stbl'],\n 'dinf': ['dref'],\n 'stbl': ['stsd', 'stts', 'ctts', 'cslg', 'stsc', 'stsz', 'stz2', 'stco', 'co64', 'stss', 'stsh', 'padb', 'stdp', 'sdtp', 'sbgps', 'sgpds', 'subss', 'saizs', 'saios'],\n 'mvex': ['mehd', 'trexs', 'leva'],\n 'moof': ['mfhd', 'meta', 'trafs'],\n 'traf': ['tfhd', 'tfdt', 'trun', 'sbgps', 'sgpds', 'subss', 'saizs', 'saios', 'meta']\n}\n\nBox.encode = function (obj, buffer, offset) {\n Box.encodingLength(obj) // sets every level appropriately\n offset = offset || 0\n buffer = buffer || bufferAlloc(obj.length)\n return Box._encode(obj, buffer, offset)\n}\n\nBox._encode = function (obj, buffer, offset) {\n var type = obj.type\n var len = obj.length\n if (len > UINT32_MAX) {\n len = 1\n }\n buffer.writeUInt32BE(len, offset)\n buffer.write(obj.type, offset + 4, 4, 'ascii')\n var ptr = offset + 8\n if (len === 1) {\n uint64be.encode(obj.length, buffer, ptr)\n ptr += 8\n }\n if (boxes.fullBoxes[type]) {\n buffer.writeUInt32BE(obj.flags || 0, ptr)\n buffer.writeUInt8(obj.version || 0, ptr)\n ptr += 4\n }\n\n if (containers[type]) {\n var contents = containers[type]\n contents.forEach(function (childType) {\n if (childType.length === 5) {\n var entry = obj[childType] || []\n childType = childType.substr(0, 4)\n entry.forEach(function (child) {\n Box._encode(child, buffer, ptr)\n ptr += Box.encode.bytes\n })\n } else if (obj[childType]) {\n Box._encode(obj[childType], buffer, ptr)\n ptr += Box.encode.bytes\n }\n })\n if (obj.otherBoxes) {\n obj.otherBoxes.forEach(function (child) {\n Box._encode(child, buffer, ptr)\n ptr += Box.encode.bytes\n })\n }\n } else if (boxes[type]) {\n var encode = boxes[type].encode\n encode(obj, buffer, ptr)\n ptr += encode.bytes\n } else if (obj.buffer) {\n var buf = obj.buffer\n buf.copy(buffer, ptr)\n ptr += obj.buffer.length\n } else {\n throw new Error('Either `type` must be set to a known type (not\\'' + type + '\\') or `buffer` must be set')\n }\n\n Box.encode.bytes = ptr - offset\n // assert.equal(ptr - offset, obj.length, 'Error encoding \\'' + type + '\\': wrote ' + ptr - offset + ' bytes, expecting ' + obj.length)\n return buffer\n}\n\n/*\n * Returns an object with `type` and `size` fields,\n * or if there isn't enough data, returns the total\n * number of bytes needed to read the headers\n */\nBox.readHeaders = function (buffer, start, end) {\n start = start || 0\n end = end || buffer.length\n if (end - start < 8) {\n return 8\n }\n\n var len = buffer.readUInt32BE(start)\n var type = buffer.toString('ascii', start + 4, start + 8)\n var ptr = start + 8\n\n if (len === 1) {\n if (end - start < 16) {\n return 16\n }\n\n len = uint64be.decode(buffer, ptr)\n ptr += 8\n }\n\n var version\n var flags\n if (boxes.fullBoxes[type]) {\n version = buffer.readUInt8(ptr)\n flags = buffer.readUInt32BE(ptr) & 0xffffff\n ptr += 4\n }\n\n return {\n length: len,\n headersLen: ptr - start,\n contentLen: len - (ptr - start),\n type: type,\n version: version,\n flags: flags\n }\n}\n\nBox.decode = function (buffer, start, end) {\n start = start || 0\n end = end || buffer.length\n var headers = Box.readHeaders(buffer, start, end)\n if (!headers || headers.length > end - start) {\n throw new Error('Data too short')\n }\n\n return Box.decodeWithoutHeaders(headers, buffer, start + headers.headersLen, start + headers.length)\n}\n\nBox.decodeWithoutHeaders = function (headers, buffer, start, end) {\n start = start || 0\n end = end || buffer.length\n var type = headers.type\n var obj = {}\n if (containers[type]) {\n obj.otherBoxes = []\n var contents = containers[type]\n var ptr = start\n while (end - ptr >= 8) {\n var child = Box.decode(buffer, ptr, end)\n ptr += child.length\n if (contents.indexOf(child.type) >= 0) {\n obj[child.type] = child\n } else if (contents.indexOf(child.type + 's') >= 0) {\n var childType = child.type + 's'\n var entry = obj[childType] = obj[childType] || []\n entry.push(child)\n } else {\n obj.otherBoxes.push(child)\n }\n }\n } else if (boxes[type]) {\n var decode = boxes[type].decode\n obj = decode(buffer, start, end)\n } else {\n obj.buffer = bufferFrom(buffer.slice(start, end))\n }\n\n obj.length = headers.length\n obj.contentLen = headers.contentLen\n obj.type = headers.type\n obj.version = headers.version\n obj.flags = headers.flags\n return obj\n}\n\nBox.encodingLength = function (obj) {\n var type = obj.type\n\n var len = 8\n if (boxes.fullBoxes[type]) {\n len += 4\n }\n\n if (containers[type]) {\n var contents = containers[type]\n contents.forEach(function (childType) {\n if (childType.length === 5) {\n var entry = obj[childType] || []\n childType = childType.substr(0, 4)\n entry.forEach(function (child) {\n child.type = childType\n len += Box.encodingLength(child)\n })\n } else if (obj[childType]) {\n var child = obj[childType]\n child.type = childType\n len += Box.encodingLength(child)\n }\n })\n if (obj.otherBoxes) {\n obj.otherBoxes.forEach(function (child) {\n len += Box.encodingLength(child)\n })\n }\n } else if (boxes[type]) {\n len += boxes[type].encodingLength(obj)\n } else if (obj.buffer) {\n len += obj.buffer.length\n } else {\n throw new Error('Either `type` must be set to a known type (not\\'' + type + '\\') or `buffer` must be set')\n }\n\n if (len > UINT32_MAX) {\n len += 8\n }\n\n obj.length = len\n return len\n}\n\n\n//# sourceURL=webpack:///./node_modules/mp4-box-encoding/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/decode.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/mp4-stream/decode.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var stream = __webpack_require__(/*! readable-stream */ \"./node_modules/mp4-stream/node_modules/readable-stream/readable-browser.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar nextEvent = __webpack_require__(/*! next-event */ \"./node_modules/next-event/index.js\")\nvar Box = __webpack_require__(/*! mp4-box-encoding */ \"./node_modules/mp4-box-encoding/index.js\")\nvar bufferAlloc = __webpack_require__(/*! buffer-alloc */ \"./node_modules/buffer-alloc/index.js\")\n\nvar EMPTY = bufferAlloc(0)\n\nmodule.exports = Decoder\n\nfunction Decoder () {\n if (!(this instanceof Decoder)) return new Decoder()\n stream.Writable.call(this)\n\n this.destroyed = false\n\n this._pending = 0\n this._missing = 0\n this._buf = null\n this._str = null\n this._cb = null\n this._ondrain = null\n this._writeBuffer = null\n this._writeCb = null\n\n this._ondrain = null\n this._kick()\n}\n\ninherits(Decoder, stream.Writable)\n\nDecoder.prototype.destroy = function (err) {\n if (this.destroyed) return\n this.destroyed = true\n if (err) this.emit('error', err)\n this.emit('close')\n}\n\nDecoder.prototype._write = function (data, enc, next) {\n if (this.destroyed) return\n var drained = !this._str || !this._str._writableState.needDrain\n\n while (data.length && !this.destroyed) {\n if (!this._missing) {\n this._writeBuffer = data\n this._writeCb = next\n return\n }\n\n var consumed = data.length < this._missing ? data.length : this._missing\n if (this._buf) data.copy(this._buf, this._buf.length - this._missing)\n else if (this._str) drained = this._str.write(consumed === data.length ? data : data.slice(0, consumed))\n\n this._missing -= consumed\n\n if (!this._missing) {\n var buf = this._buf\n var cb = this._cb\n var stream = this._str\n\n this._buf = this._cb = this._str = this._ondrain = null\n drained = true\n\n if (stream) stream.end()\n if (cb) cb(buf)\n }\n\n data = consumed === data.length ? EMPTY : data.slice(consumed)\n }\n\n if (this._pending && !this._missing) {\n this._writeBuffer = data\n this._writeCb = next\n return\n }\n\n if (drained) next()\n else this._ondrain(next)\n}\n\nDecoder.prototype._buffer = function (size, cb) {\n this._missing = size\n this._buf = bufferAlloc(size)\n this._cb = cb\n}\n\nDecoder.prototype._stream = function (size, cb) {\n var self = this\n this._missing = size\n this._str = new MediaData(this)\n this._ondrain = nextEvent(this._str, 'drain')\n this._pending++\n this._str.on('end', function () {\n self._pending--\n self._kick()\n })\n this._cb = cb\n return this._str\n}\n\nDecoder.prototype._readBox = function () {\n var self = this\n bufferHeaders(8)\n\n function bufferHeaders (len, buf) {\n self._buffer(len, function (additionalBuf) {\n if (buf) {\n buf = Buffer.concat([buf, additionalBuf])\n } else {\n buf = additionalBuf\n }\n var headers = Box.readHeaders(buf)\n if (typeof headers === 'number') {\n bufferHeaders(headers - buf.length, buf)\n } else {\n self._pending++\n self._headers = headers\n self.emit('box', headers)\n }\n })\n }\n}\n\nDecoder.prototype.stream = function () {\n var self = this\n if (!self._headers) throw new Error('this function can only be called once after \\'box\\' is emitted')\n var headers = self._headers\n self._headers = null\n\n return self._stream(headers.contentLen, null)\n}\n\nDecoder.prototype.decode = function (cb) {\n var self = this\n if (!self._headers) throw new Error('this function can only be called once after \\'box\\' is emitted')\n var headers = self._headers\n self._headers = null\n\n self._buffer(headers.contentLen, function (buf) {\n var box = Box.decodeWithoutHeaders(headers, buf)\n cb(box)\n self._pending--\n self._kick()\n })\n}\n\nDecoder.prototype.ignore = function () {\n var self = this\n if (!self._headers) throw new Error('this function can only be called once after \\'box\\' is emitted')\n var headers = self._headers\n self._headers = null\n\n this._missing = headers.contentLen\n this._cb = function () {\n self._pending--\n self._kick()\n }\n}\n\nDecoder.prototype._kick = function () {\n if (this._pending) return\n if (!this._buf && !this._str) this._readBox()\n if (this._writeBuffer) {\n var next = this._writeCb\n var buffer = this._writeBuffer\n this._writeBuffer = null\n this._writeCb = null\n this._write(buffer, null, next)\n }\n}\n\nfunction MediaData (parent) {\n this._parent = parent\n this.destroyed = false\n stream.PassThrough.call(this)\n}\n\ninherits(MediaData, stream.PassThrough)\n\nMediaData.prototype.destroy = function (err) {\n if (this.destroyed) return\n this.destroyed = true\n this._parent.destroy(err)\n if (err) this.emit('error', err)\n this.emit('close')\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/decode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/encode.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/mp4-stream/encode.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var stream = __webpack_require__(/*! readable-stream */ \"./node_modules/mp4-stream/node_modules/readable-stream/readable-browser.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Box = __webpack_require__(/*! mp4-box-encoding */ \"./node_modules/mp4-box-encoding/index.js\")\nvar bufferAlloc = __webpack_require__(/*! buffer-alloc */ \"./node_modules/buffer-alloc/index.js\")\n\nmodule.exports = Encoder\n\nfunction noop () {}\n\nfunction Encoder () {\n if (!(this instanceof Encoder)) return new Encoder()\n stream.Readable.call(this)\n\n this.destroyed = false\n\n this._reading = false\n this._stream = null\n this._drain = null\n this._want = false\n this._onreadable = onreadable\n this._onend = onend\n\n var self = this\n\n function onreadable () {\n if (!self._want) return\n self._want = false\n self._read()\n }\n\n function onend () {\n self._stream = null\n }\n}\n\ninherits(Encoder, stream.Readable)\n\nEncoder.prototype.mediaData =\nEncoder.prototype.mdat = function (size, cb) {\n var stream = new MediaData(this)\n this.box({type: 'mdat', contentLength: size, encodeBufferLen: 8, stream: stream}, cb)\n return stream\n}\n\nEncoder.prototype.box = function (box, cb) {\n if (!cb) cb = noop\n if (this.destroyed) return cb(new Error('Encoder is destroyed'))\n\n var buf\n if (box.encodeBufferLen) {\n buf = bufferAlloc(box.encodeBufferLen)\n }\n if (box.stream) {\n box.buffer = null\n buf = Box.encode(box, buf)\n this.push(buf)\n this._stream = box.stream\n this._stream.on('readable', this._onreadable)\n this._stream.on('end', this._onend)\n this._stream.on('end', cb)\n this._forward()\n } else {\n buf = Box.encode(box, buf)\n var drained = this.push(buf)\n if (drained) return process.nextTick(cb)\n this._drain = cb\n }\n}\n\nEncoder.prototype.destroy = function (err) {\n if (this.destroyed) return\n this.destroyed = true\n if (this._stream && this._stream.destroy) this._stream.destroy()\n this._stream = null\n if (this._drain) {\n var cb = this._drain\n this._drain = null\n cb(err)\n }\n if (err) this.emit('error', err)\n this.emit('close')\n}\n\nEncoder.prototype.finalize = function () {\n this.push(null)\n}\n\nEncoder.prototype._forward = function () {\n if (!this._stream) return\n\n while (!this.destroyed) {\n var buf = this._stream.read()\n\n if (!buf) {\n this._want = !!this._stream\n return\n }\n\n if (!this.push(buf)) return\n }\n}\n\nEncoder.prototype._read = function () {\n if (this._reading || this.destroyed) return\n this._reading = true\n\n if (this._stream) this._forward()\n if (this._drain) {\n var drain = this._drain\n this._drain = null\n drain()\n }\n\n this._reading = false\n}\n\nfunction MediaData (parent) {\n this._parent = parent\n this.destroyed = false\n stream.PassThrough.call(this)\n}\n\ninherits(MediaData, stream.PassThrough)\n\nMediaData.prototype.destroy = function (err) {\n if (this.destroyed) return\n this.destroyed = true\n this._parent.destroy(err)\n if (err) this.emit('error', err)\n this.emit('close')\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/encode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/mp4-stream/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports.decode = __webpack_require__(/*! ./decode */ \"./node_modules/mp4-stream/decode.js\")\nexports.encode = __webpack_require__(/*! ./encode */ \"./node_modules/mp4-stream/encode.js\")\n\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\*****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!**************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\**************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 33);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!**************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\**************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!*************************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\*************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 34);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!**********************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\**********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!*****************************************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\*****************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/mp4-stream/node_modules/readable-stream/readable-browser.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/mp4-stream/node_modules/readable-stream/readable-browser.js ***!
|
||
\**********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/mp4-stream/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/mp4-stream/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ms/index.js":
|
||
/*!**********************************!*\
|
||
!*** ./node_modules/ms/index.js ***!
|
||
\**********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multiaddr/src/codec.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/multiaddr/src/codec.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst convert = __webpack_require__(/*! ./convert */ \"./node_modules/multiaddr/src/convert.js\")\nconst protocols = __webpack_require__(/*! ./protocols-table */ \"./node_modules/multiaddr/src/protocols-table.js\")\nconst varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\n// export codec\nmodule.exports = {\n stringToStringTuples: stringToStringTuples,\n stringTuplesToString: stringTuplesToString,\n\n tuplesToStringTuples: tuplesToStringTuples,\n stringTuplesToTuples: stringTuplesToTuples,\n\n bufferToTuples: bufferToTuples,\n tuplesToBuffer: tuplesToBuffer,\n\n bufferToString: bufferToString,\n stringToBuffer: stringToBuffer,\n\n fromString: fromString,\n fromBuffer: fromBuffer,\n validateBuffer: validateBuffer,\n isValidBuffer: isValidBuffer,\n cleanPath: cleanPath,\n\n ParseError: ParseError,\n protoFromTuple: protoFromTuple,\n\n sizeForAddr: sizeForAddr\n}\n\n// string -> [[str name, str addr]... ]\nfunction stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}\n\n// [[str name, str addr]... ] -> string\nfunction stringTuplesToString (tuples) {\n const parts = []\n tuples.map(tup => {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return cleanPath(parts.join('/'))\n}\n\n// [[str name, str addr]... ] -> [[int code, Buffer]... ]\nfunction stringTuplesToTuples (tuples) {\n return tuples.map(tup => {\n if (!Array.isArray(tup)) {\n tup = [tup]\n }\n const proto = protoFromTuple(tup)\n if (tup.length > 1) {\n return [proto.code, convert.toBuffer(proto.code, tup[1])]\n }\n return [proto.code]\n })\n}\n\n// [[int code, Buffer]... ] -> [[str name, str addr]... ]\nfunction tuplesToStringTuples (tuples) {\n return tuples.map(tup => {\n const proto = protoFromTuple(tup)\n if (tup.length > 1) {\n return [proto.code, convert.toString(proto.code, tup[1])]\n }\n return [proto.code]\n })\n}\n\n// [[int code, Buffer ]... ] -> Buffer\nfunction tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}\n\nfunction sizeForAddr (p, addr) {\n if (p.size > 0) {\n return p.size / 8\n } else if (p.size === 0) {\n return 0\n } else {\n const size = varint.decode(addr)\n return size + varint.decode.bytes\n }\n}\n\n// Buffer -> [[int code, Buffer ]... ]\nfunction bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}\n\n// Buffer -> String\nfunction bufferToString (buf) {\n const a = bufferToTuples(buf)\n const b = tuplesToStringTuples(a)\n return stringTuplesToString(b)\n}\n\n// String -> Buffer\nfunction stringToBuffer (str) {\n str = cleanPath(str)\n const a = stringToStringTuples(str)\n const b = stringTuplesToTuples(a)\n\n return tuplesToBuffer(b)\n}\n\n// String -> Buffer\nfunction fromString (str) {\n return stringToBuffer(str)\n}\n\n// Buffer -> Buffer\nfunction fromBuffer (buf) {\n const err = validateBuffer(buf)\n if (err) throw err\n return Buffer.from(buf) // copy\n}\n\nfunction validateBuffer (buf) {\n try {\n bufferToTuples(buf) // try to parse. will throw if breaks\n } catch (err) {\n return err\n }\n}\n\nfunction isValidBuffer (buf) {\n return validateBuffer(buf) === undefined\n}\n\nfunction cleanPath (str) {\n return '/' + str.trim().split('/').filter(a => a).join('/')\n}\n\nfunction ParseError (str) {\n return new Error('Error parsing address: ' + str)\n}\n\nfunction protoFromTuple (tup) {\n const proto = protocols(tup[0])\n return proto\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multiaddr/src/codec.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multiaddr/src/convert.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/multiaddr/src/convert.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst ip = __webpack_require__(/*! ip */ \"./node_modules/ip/lib/ip.js\")\nconst isIp = __webpack_require__(/*! is-ip */ \"./node_modules/is-ip/index.js\")\nconst protocols = __webpack_require__(/*! ./protocols-table */ \"./node_modules/multiaddr/src/protocols-table.js\")\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\nconst base32 = __webpack_require__(/*! hi-base32 */ \"./node_modules/hi-base32/src/base32.js\")\nconst varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\nmodule.exports = Convert\n\n// converts (serializes) addresses\nfunction Convert (proto, a) {\n if (a instanceof Buffer) {\n return Convert.toString(proto, a)\n } else {\n return Convert.toBuffer(proto, a)\n }\n}\n\nConvert.toString = function convertToString (proto, buf) {\n proto = protocols(proto)\n switch (proto.code) {\n case 4: // ipv4\n case 41: // ipv6\n return buf2ip(buf)\n\n case 6: // tcp\n case 273: // udp\n case 33: // dccp\n case 132: // sctp\n return buf2port(buf)\n\n case 53: // dns\n case 54: // dns4\n case 55: // dns6\n case 56: // dnsaddr\n case 400: // unix\n return buf2str(buf)\n\n case 421: // ipfs\n return buf2mh(buf)\n case 444: // onion\n return buf2onion(buf)\n case 445: // onion3\n return buf2onion(buf)\n default:\n return buf.toString('hex') // no clue. convert to hex\n }\n}\n\nConvert.toBuffer = function convertToBuffer (proto, str) {\n proto = protocols(proto)\n switch (proto.code) {\n case 4: // ipv4\n return ip2buf(str)\n case 41: // ipv6\n return ip2buf(str)\n\n case 6: // tcp\n case 273: // udp\n case 33: // dccp\n case 132: // sctp\n return port2buf(parseInt(str, 10))\n\n case 53: // dns\n case 54: // dns4\n case 55: // dns6\n case 56: // dnsaddr\n case 400: // unix\n return str2buf(str)\n\n case 421: // ipfs\n return mh2buf(str)\n case 444: // onion\n return onion2buf(str)\n case 445: // onion3\n return onion32buf(str)\n default:\n return Buffer.from(str, 'hex') // no clue. convert from hex\n }\n}\n\nfunction ip2buf (ipString) {\n if (!isIp(ipString)) {\n throw new Error('invalid ip address')\n }\n return ip.toBuffer(ipString)\n}\n\nfunction buf2ip (ipBuff) {\n const ipString = ip.toString(ipBuff)\n if (!isIp(ipString)) {\n throw new Error('invalid ip address')\n }\n return ipString\n}\n\nfunction port2buf (port) {\n const buf = Buffer.alloc(2)\n buf.writeUInt16BE(port, 0)\n return buf\n}\n\nfunction buf2port (buf) {\n return buf.readUInt16BE(0)\n}\n\nfunction str2buf (str) {\n const buf = Buffer.from(str)\n const size = Buffer.from(varint.encode(buf.length))\n return Buffer.concat([size, buf])\n}\n\nfunction buf2str (buf) {\n const size = varint.decode(buf)\n buf = buf.slice(varint.decode.bytes)\n\n if (buf.length !== size) {\n throw new Error('inconsistent lengths')\n }\n\n return buf.toString()\n}\n\nfunction mh2buf (hash) {\n // the address is a varint prefixed multihash string representation\n const mh = Buffer.from(bs58.decode(hash))\n const size = Buffer.from(varint.encode(mh.length))\n return Buffer.concat([size, mh])\n}\n\nfunction buf2mh (buf) {\n const size = varint.decode(buf)\n const address = buf.slice(varint.decode.bytes)\n\n if (address.length !== size) {\n throw new Error('inconsistent lengths')\n }\n\n return bs58.encode(address)\n}\n\nfunction onion2buf (str) {\n const addr = str.split(':')\n if (addr.length !== 2) {\n throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number')\n }\n if (addr[0].length !== 16) {\n throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion address.')\n }\n const buf = Buffer.from(base32.decode.asBytes(addr[0].toUpperCase()))\n\n // onion port number\n const port = parseInt(addr[1], 10)\n if (port < 1 || port > 65536) {\n throw new Error('Port number is not in range(1, 65536)')\n }\n const portBuf = port2buf(port)\n return Buffer.concat([buf, portBuf])\n}\n\nfunction onion32buf (str) {\n const addr = str.split(':')\n if (addr.length !== 2) {\n throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number')\n }\n if (addr[0].length !== 56) {\n throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion3 address.')\n }\n const buf = Buffer.from(base32.decode.asBytes(addr[0].toUpperCase()))\n\n // onion port number\n const port = parseInt(addr[1], 10)\n if (port < 1 || port > 65536) {\n throw new Error('Port number is not in range(1, 65536)')\n }\n const portBuf = port2buf(port)\n return Buffer.concat([buf, portBuf])\n}\n\nfunction buf2onion (buf) {\n const addrBytes = buf.slice(0, buf.length - 2)\n const portBytes = buf.slice(buf.length - 2)\n const addr = base32.encode(addrBytes).toString('ascii').toLowerCase()\n const port = buf2port(portBytes)\n return addr + ':' + port\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multiaddr/src/convert.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multiaddr/src/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/multiaddr/src/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst codec = __webpack_require__(/*! ./codec */ \"./node_modules/multiaddr/src/codec.js\")\nconst protocols = __webpack_require__(/*! ./protocols-table */ \"./node_modules/multiaddr/src/protocols-table.js\")\nconst varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\nconst withIs = __webpack_require__(/*! class-is */ \"./node_modules/class-is/index.js\")\n\n/**\n * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from\n * a Buffer, String or another Multiaddr instance\n * public key.\n * @class Multiaddr\n * @param {(String|Buffer|Multiaddr)} addr - If String or Buffer, needs to adhere\n * to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format)\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n */\nconst Multiaddr = withIs.proto(function (addr) {\n if (!(this instanceof Multiaddr)) {\n return new Multiaddr(addr)\n }\n\n // default\n if (addr == null) {\n addr = ''\n }\n\n if (addr instanceof Buffer) {\n /**\n * @type {Buffer} - The raw bytes representing this multiaddress\n */\n this.buffer = codec.fromBuffer(addr)\n } else if (typeof addr === 'string' || addr instanceof String) {\n if (addr.length > 0 && addr.charAt(0) !== '/') {\n throw new Error(`multiaddr \"${addr}\" must start with a \"/\"`)\n }\n this.buffer = codec.fromString(addr)\n } else if (addr.buffer && addr.protos && addr.protoCodes) { // Multiaddr\n this.buffer = codec.fromBuffer(addr.buffer) // validate + copy buffer\n } else {\n throw new Error('addr must be a string, Buffer, or another Multiaddr')\n }\n}, { className: 'Multiaddr', symbolName: '@multiformats/js-multiaddr/multiaddr' })\n\n/**\n * Returns Multiaddr as a String\n *\n * @returns {String}\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').toString()\n * // '/ip4/127.0.0.1/tcp/4001'\n */\nMultiaddr.prototype.toString = function toString () {\n return codec.bufferToString(this.buffer)\n}\n\n/**\n * Returns Multiaddr as a JSON encoded object\n *\n * @returns {String}\n * @example\n * JSON.stringify(Multiaddr('/ip4/127.0.0.1/tcp/4001'))\n * // '/ip4/127.0.0.1/tcp/4001'\n */\nMultiaddr.prototype.toJSON = Multiaddr.prototype.toString\n\n/**\n * Returns Multiaddr as a convinient options object to be used with net.createConnection\n *\n * @returns {{family: String, host: String, transport: String, port: String}}\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()\n * // { family: 'ipv4', host: '127.0.0.1', transport: 'tcp', port: '4001' }\n */\nMultiaddr.prototype.toOptions = function toOptions () {\n const opts = {}\n const parsed = this.toString().split('/')\n opts.family = parsed[1] === 'ip4' ? 'ipv4' : 'ipv6'\n opts.host = parsed[2]\n opts.transport = parsed[3]\n opts.port = parsed[4]\n return opts\n}\n\n/**\n * Returns Multiaddr as a human-readable string\n *\n * @returns {String}\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').inspect()\n * // '<Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>'\n */\nMultiaddr.prototype.inspect = function inspect () {\n return '<Multiaddr ' +\n this.buffer.toString('hex') + ' - ' +\n codec.bufferToString(this.buffer) + '>'\n}\n\n/**\n * Returns the protocols the Multiaddr is defined with, as an array of objects, in\n * left-to-right order. Each object contains the protocol code, protocol name,\n * and the size of its address space in bits.\n * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv)\n *\n * @returns {Array.<Object>} protocols - All the protocols the address is composed of\n * @returns {Number} protocols[].code\n * @returns {Number} protocols[].size\n * @returns {String} protocols[].name\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').protos()\n * // [ { code: 4, size: 32, name: 'ip4' },\n * // { code: 6, size: 16, name: 'tcp' } ]\n */\nMultiaddr.prototype.protos = function protos () {\n return this.protoCodes().map(code => Object.assign({}, protocols(code)))\n}\n\n/**\n * Returns the codes of the protocols in left-to-right order.\n * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv)\n *\n * @returns {Array.<Number>} protocol codes\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes()\n * // [ 4, 6 ]\n */\nMultiaddr.prototype.protoCodes = function protoCodes () {\n const codes = []\n const buf = this.buffer\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n const size = codec.sizeForAddr(p, buf.slice(i + n))\n\n i += (size + n)\n codes.push(code)\n }\n\n return codes\n}\n\n/**\n * Returns the names of the protocols in left-to-right order.\n * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv)\n *\n * @return {Array.<String>} protocol names\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames()\n * // [ 'ip4', 'tcp' ]\n */\nMultiaddr.prototype.protoNames = function protoNames () {\n return this.protos().map(proto => proto.name)\n}\n\n/**\n * Returns a tuple of parts\n *\n * @return {Array.<Array>} tuples\n * @return {Number} tuples[].0 code of protocol\n * @return {Buffer} tuples[].1 contents of address\n * @example\n * Multiaddr(\"/ip4/127.0.0.1/tcp/4001\").tuples()\n * // [ [ 4, <Buffer 7f 00 00 01> ], [ 6, <Buffer 0f a1> ] ]\n */\nMultiaddr.prototype.tuples = function tuples () {\n return codec.bufferToTuples(this.buffer)\n}\n\n/**\n * Returns a tuple of string/number parts\n *\n * @return {Array.<Array>} tuples\n * @return {Number} tuples[].0 code of protocol\n * @return {(String|Number)} tuples[].1 contents of address\n * @example\n * Multiaddr(\"/ip4/127.0.0.1/tcp/4001\").stringTuples()\n * // [ [ 4, '127.0.0.1' ], [ 6, 4001 ] ]\n */\nMultiaddr.prototype.stringTuples = function stringTuples () {\n const t = codec.bufferToTuples(this.buffer)\n return codec.tuplesToStringTuples(t)\n}\n\n/**\n * Encapsulates a Multiaddr in another Multiaddr\n *\n * @param {Multiaddr} addr - Multiaddr to add into this Multiaddr\n * @return {Multiaddr}\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080>\n *\n * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n *\n * const mh3 = mh1.encapsulate(mh2)\n * // <Multiaddr 0408080808060438047f000001060fa1 - /ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001>\n *\n * mh3.toString()\n * // '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001'\n */\nMultiaddr.prototype.encapsulate = function encapsulate (addr) {\n addr = Multiaddr(addr)\n return Multiaddr(this.toString() + addr.toString())\n}\n\n/**\n * Decapsulates a Multiaddr from another Multiaddr\n *\n * @param {Multiaddr} addr - Multiaddr to remove from this Multiaddr\n * @return {Multiaddr}\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080>\n *\n * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n *\n * const mh3 = mh1.encapsulate(mh2)\n * // <Multiaddr 0408080808060438047f000001060fa1 - /ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001>\n *\n * mh3.decapsulate(mh2).toString()\n * // '/ip4/8.8.8.8/tcp/1080'\n */\nMultiaddr.prototype.decapsulate = function decapsulate (addr) {\n addr = addr.toString()\n const s = this.toString()\n const i = s.lastIndexOf(addr)\n if (i < 0) {\n throw new Error('Address ' + this + ' does not contain subaddress: ' + addr)\n }\n return Multiaddr(s.slice(0, i))\n}\n\n/**\n * Extract the peerId if the multiaddr contains one\n *\n * @return {String|null} peerId - The id of the peer or null if invalid or missing from the ma\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string>\n *\n * // should return QmValidBase58string or null if the id is missing or invalid\n * const peerId = mh1.getPeerId()\n */\nMultiaddr.prototype.getPeerId = function getPeerId () {\n let b58str = null\n try {\n b58str = this.stringTuples().filter((tuple) => {\n if (tuple[0] === protocols.names.ipfs.code) {\n return true\n }\n })[0][1]\n\n bs58.decode(b58str)\n } catch (e) {\n b58str = null\n }\n\n return b58str\n}\n\n/**\n * Extract the path if the multiaddr contains one\n *\n * @return {String|null} path - The path of the multiaddr, or null if no path protocol is present\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock>\n *\n * // should return utf8 string or null if the id is missing or invalid\n * const path = mh1.getPath()\n */\nMultiaddr.prototype.getPath = function getPath () {\n let path = null\n try {\n path = this.stringTuples().filter((tuple) => {\n const proto = protocols(tuple[0])\n if (proto.path) {\n return true\n }\n })[0][1]\n } catch (e) {\n path = null\n }\n\n return path\n}\n\n/**\n * Checks if two Multiaddrs are the same\n *\n * @param {Multiaddr} addr\n * @return {Bool}\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080>\n *\n * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n *\n * mh1.equals(mh1)\n * // true\n *\n * mh1.equals(mh2)\n * // false\n */\nMultiaddr.prototype.equals = function equals (addr) {\n return this.buffer.equals(addr.buffer)\n}\n\n/**\n * Gets a Multiaddrs node-friendly address object. Note that protocol information\n * is left out: in Node (and most network systems) the protocol is unknowable\n * given only the address.\n *\n * Has to be a ThinWaist Address, otherwise throws error\n *\n * @returns {{family: String, address: String, port: String}}\n * @throws {Error} Throws error if Multiaddr is not a Thin Waist address\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()\n * // {family: 'IPv4', address: '127.0.0.1', port: '4001'}\n */\nMultiaddr.prototype.nodeAddress = function nodeAddress () {\n const codes = this.protoCodes()\n const names = this.protoNames()\n const parts = this.toString().split('/').slice(1)\n\n if (parts.length < 4) {\n throw new Error('multiaddr must have a valid format: \"/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}\".')\n } else if (codes[0] !== 4 && codes[0] !== 41 && codes[0] !== 54 && codes[0] !== 55) {\n throw new Error(`no protocol with name: \"'${names[0]}'\". Must have a valid family name: \"{ip4, ip6, dns4, dns6}\".`)\n } else if (parts[2] !== 'tcp' && parts[2] !== 'udp') {\n throw new Error(`no protocol with name: \"'${names[1]}'\". Must have a valid transport protocol: \"{tcp, udp}\".`)\n }\n\n return {\n family: (codes[0] === 41 || codes[0] === 55) ? 6 : 4,\n address: parts[1], // ip addr\n port: parts[3] // tcp or udp port\n }\n}\n\n/**\n * Creates a Multiaddr from a node-friendly address object\n *\n * @param {String} addr\n * @param {String} transport\n * @returns {Multiaddr} multiaddr\n * @throws {Error} Throws error if addr is not truthy\n * @throws {Error} Throws error if transport is not truthy\n * @example\n * Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n */\nMultiaddr.fromNodeAddress = function fromNodeAddress (addr, transport) {\n if (!addr) throw new Error('requires node address object')\n if (!transport) throw new Error('requires transport protocol')\n const ip = (addr.family === 'IPv6') ? 'ip6' : 'ip4'\n return Multiaddr('/' + [ip, addr.address, transport, addr.port].join('/'))\n}\n\n// TODO find a better example, not sure about it's good enough\n/**\n * Returns if a Multiaddr is a Thin Waist address or not.\n *\n * Thin Waist is if a Multiaddr adheres to the standard combination of:\n *\n * `{IPv4, IPv6}/{TCP, UDP}`\n *\n * @param {Multiaddr} [addr] - Defaults to using `this` instance\n * @returns {Boolean} isThinWaistAddress\n * @example\n * const mh1 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n * const mh2 = Multiaddr('/ip4/192.168.2.1/tcp/5001')\n * // <Multiaddr 04c0a80201061389 - /ip4/192.168.2.1/tcp/5001>\n * const mh3 = mh1.encapsulate(mh2)\n * // <Multiaddr 047f000001060fa104c0a80201061389 - /ip4/127.0.0.1/tcp/4001/ip4/192.168.2.1/tcp/5001>\n * mh1.isThinWaistAddress()\n * // true\n * mh2.isThinWaistAddress()\n * // true\n * mh3.isThinWaistAddress()\n * // false\n */\nMultiaddr.prototype.isThinWaistAddress = function isThinWaistAddress (addr) {\n const protos = (addr || this).protos()\n\n if (protos.length !== 2) {\n return false\n }\n\n if (protos[0].code !== 4 && protos[0].code !== 41) {\n return false\n }\n if (protos[1].code !== 6 && protos[1].code !== 273) {\n return false\n }\n return true\n}\n\n/**\n * Object containing table, names and codes of all supported protocols.\n * To get the protocol values from a Multiaddr, you can use\n * [`.protos()`](#multiaddrprotos),\n * [`.protoCodes()`](#multiaddrprotocodes) or\n * [`.protoNames()`](#multiaddrprotonames)\n *\n * @instance\n * @returns {{table: Array, names: Object, codes: Object}}\n *\n */\nMultiaddr.protocols = protocols\n\n/**\n * Returns if something is a Multiaddr that is a name\n *\n * @param {Multiaddr} addr\n * @return {Bool} isName\n */\nMultiaddr.isName = function isName (addr) {\n if (!Multiaddr.isMultiaddr(addr)) {\n return false\n }\n\n // if a part of the multiaddr is resolvable, then return true\n return addr.protos().some((proto) => proto.resolvable)\n}\n\n/**\n * Returns an array of multiaddrs, by resolving the multiaddr that is a name\n *\n * @param {Multiaddr} addr\n *\n * @param {Function} callback\n * @return {Bool} isName\n */\nMultiaddr.resolve = function resolve (addr, callback) {\n if (!Multiaddr.isMultiaddr(addr) || !Multiaddr.isName(addr)) {\n return callback(new Error('not a valid name'))\n }\n\n /*\n * Needs more consideration from spec design:\n * - what to return\n * - how to achieve it in the browser?\n */\n return callback(new Error('not implemented yet'))\n}\n\nexports = module.exports = Multiaddr\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multiaddr/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multiaddr/src/protocols-table.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/multiaddr/src/protocols-table.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction Protocols (proto) {\n if (typeof (proto) === 'number') {\n if (Protocols.codes[proto]) {\n return Protocols.codes[proto]\n }\n\n throw new Error('no protocol with code: ' + proto)\n } else if (typeof (proto) === 'string' || proto instanceof String) {\n if (Protocols.names[proto]) {\n return Protocols.names[proto]\n }\n\n throw new Error('no protocol with name: ' + proto)\n }\n\n throw new Error('invalid protocol id type: ' + proto)\n}\n\nconst V = -1\nProtocols.lengthPrefixedVarSize = V\nProtocols.V = V\n\nProtocols.table = [\n [4, 32, 'ip4'],\n [6, 16, 'tcp'],\n [33, 16, 'dccp'],\n [41, 128, 'ip6'],\n [42, V, 'ip6zone'],\n [53, V, 'dns', 'resolvable'],\n [54, V, 'dns4', 'resolvable'],\n [55, V, 'dns6', 'resolvable'],\n [56, V, 'dnsaddr', 'resolvable'],\n [132, 16, 'sctp'],\n [273, 16, 'udp'],\n [275, 0, 'p2p-webrtc-star'],\n [276, 0, 'p2p-webrtc-direct'],\n [277, 0, 'p2p-stardust'],\n [290, 0, 'p2p-circuit'],\n [301, 0, 'udt'],\n [302, 0, 'utp'],\n [400, V, 'unix', false, 'path'],\n // `p2p` is the preferred name for 421\n [421, V, 'p2p'],\n // `ipfs` has been added after `p2p` so that it is used by default.\n // The reason for this is to provide better backwards support for\n // code bases that do not yet support the `p2p` proto name. Eventually\n // `p2p` should become the default.\n [421, V, 'ipfs'],\n [443, 0, 'https'],\n [444, 96, 'onion'],\n [445, 296, 'onion3'],\n [446, V, 'garlic64'],\n [460, 0, 'quic'],\n [477, 0, 'ws'],\n [478, 0, 'wss'],\n [479, 0, 'p2p-websocket-star'],\n [480, 0, 'http']\n]\n\nProtocols.names = {}\nProtocols.codes = {}\n\n// populate tables\nProtocols.table.map(row => {\n const proto = p.apply(null, row)\n Protocols.codes[proto.code] = proto\n Protocols.names[proto.name] = proto\n})\n\nProtocols.object = p\n\nfunction p (code, size, name, resolvable, path) {\n return {\n code: code,\n size: size,\n name: name,\n resolvable: Boolean(resolvable),\n path: Boolean(path)\n }\n}\n\nmodule.exports = Protocols\n\n\n//# sourceURL=webpack:///./node_modules/multiaddr/src/protocols-table.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/node_modules/base-x/index.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/multibase/node_modules/base-x/index.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// base-x encoding\n// Forked from https://github.com/cryptocoinjs/bs58\n// Originally written by Mike Hearn for BitcoinJ\n// Copyright (c) 2011 Google Inc\n// Ported to JavaScript by Stefan Thomas\n// Merged Buffer refactorings from base58-native by Stephen Pair\n// Copyright (c) 2013 BitPay Inc\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nmodule.exports = function base (ALPHABET) {\n var ALPHABET_MAP = {}\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n\n // pre-compute lookup table\n for (var z = 0; z < ALPHABET.length; z++) {\n var x = ALPHABET.charAt(z)\n\n if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n ALPHABET_MAP[x] = z\n }\n\n function encode (source) {\n if (source.length === 0) return ''\n\n var digits = [0]\n for (var i = 0; i < source.length; ++i) {\n for (var j = 0, carry = source[i]; j < digits.length; ++j) {\n carry += digits[j] << 8\n digits[j] = carry % BASE\n carry = (carry / BASE) | 0\n }\n\n while (carry > 0) {\n digits.push(carry % BASE)\n carry = (carry / BASE) | 0\n }\n }\n\n var string = ''\n\n // deal with leading zeros\n for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER\n // convert digits to a string\n for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]\n\n return string\n }\n\n function decodeUnsafe (string) {\n if (typeof string !== 'string') throw new TypeError('Expected String')\n if (string.length === 0) return Buffer.allocUnsafe(0)\n\n var bytes = [0]\n for (var i = 0; i < string.length; i++) {\n var value = ALPHABET_MAP[string[i]]\n if (value === undefined) return\n\n for (var j = 0, carry = value; j < bytes.length; ++j) {\n carry += bytes[j] * BASE\n bytes[j] = carry & 0xff\n carry >>= 8\n }\n\n while (carry > 0) {\n bytes.push(carry & 0xff)\n carry >>= 8\n }\n }\n\n // deal with leading zeros\n for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {\n bytes.push(0)\n }\n\n return Buffer.from(bytes.reverse())\n }\n\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) return buffer\n\n throw new Error('Non-base' + BASE + ' character')\n }\n\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/multibase/node_modules/base-x/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/src/base.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/multibase/src/base.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nclass Base {\n constructor (name, code, implementation, alphabet) {\n this.name = name\n this.code = code\n this.alphabet = alphabet\n if (implementation && alphabet) {\n this.engine = implementation(alphabet)\n }\n }\n\n encode (stringOrBuffer) {\n return this.engine.encode(stringOrBuffer)\n }\n\n decode (stringOrBuffer) {\n return this.engine.decode(stringOrBuffer)\n }\n\n isImplemented () {\n return this.engine\n }\n}\n\nmodule.exports = Base\n\n\n//# sourceURL=webpack:///./node_modules/multibase/src/base.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/src/base16.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/multibase/src/base16.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nmodule.exports = function base16 (alphabet) {\n return {\n encode (input) {\n if (typeof input === 'string') {\n return Buffer.from(input).toString('hex')\n }\n return input.toString('hex')\n },\n decode (input) {\n for (let char of input) {\n if (alphabet.indexOf(char) < 0) {\n throw new Error('invalid base16 character')\n }\n }\n return Buffer.from(input, 'hex')\n }\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multibase/src/base16.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/src/base32.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/multibase/src/base32.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nfunction decode (input, alphabet) {\n input = input.replace(new RegExp('=', 'g'), '')\n let length = input.length\n\n let bits = 0\n let value = 0\n\n let index = 0\n let output = new Uint8Array((length * 5 / 8) | 0)\n\n for (let i = 0; i < length; i++) {\n value = (value << 5) | alphabet.indexOf(input[i])\n bits += 5\n\n if (bits >= 8) {\n output[index++] = (value >>> (bits - 8)) & 255\n bits -= 8\n }\n }\n\n return output.buffer\n}\n\nfunction encode (buffer, alphabet) {\n let length = buffer.byteLength\n let view = new Uint8Array(buffer)\n let padding = alphabet.indexOf('=') === alphabet.length - 1\n\n if (padding) {\n alphabet = alphabet.substring(0, alphabet.length - 2)\n }\n\n let bits = 0\n let value = 0\n let output = ''\n\n for (let i = 0; i < length; i++) {\n value = (value << 8) | view[i]\n bits += 8\n\n while (bits >= 5) {\n output += alphabet[(value >>> (bits - 5)) & 31]\n bits -= 5\n }\n }\n\n if (bits > 0) {\n output += alphabet[(value << (5 - bits)) & 31]\n }\n\n if (padding) {\n while ((output.length % 8) !== 0) {\n output += '='\n }\n }\n\n return output\n}\n\nmodule.exports = function base32 (alphabet) {\n return {\n encode (input) {\n if (typeof input === 'string') {\n return encode(Buffer.from(input), alphabet)\n }\n\n return encode(input, alphabet)\n },\n decode (input) {\n for (let char of input) {\n if (alphabet.indexOf(char) < 0) {\n throw new Error('invalid base32 character')\n }\n }\n\n return decode(input, alphabet)\n }\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multibase/src/base32.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/src/base64.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/multibase/src/base64.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nmodule.exports = function base64 (alphabet) {\n // The alphabet is only used to know:\n // 1. If padding is enabled (must contain '=')\n // 2. If the output must be url-safe (must contain '-' and '_')\n // 3. If the input of the output function is valid\n // The alphabets from RFC 4648 are always used.\n const padding = alphabet.indexOf('=') > -1\n const url = alphabet.indexOf('-') > -1 && alphabet.indexOf('_') > -1\n\n return {\n encode (input) {\n let output = ''\n\n if (typeof input === 'string') {\n output = Buffer.from(input).toString('base64')\n } else {\n output = input.toString('base64')\n }\n\n if (url) {\n output = output.replace(/\\+/g, '-').replace(/\\//g, '_')\n }\n\n const pad = output.indexOf('=')\n if (pad > 0 && !padding) {\n output = output.substring(0, pad)\n }\n\n return output\n },\n decode (input) {\n for (let char of input) {\n if (alphabet.indexOf(char) < 0) {\n throw new Error('invalid base64 character')\n }\n }\n\n return Buffer.from(input, 'base64')\n }\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multibase/src/base64.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/src/constants.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/multibase/src/constants.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst Base = __webpack_require__(/*! ./base.js */ \"./node_modules/multibase/src/base.js\")\nconst baseX = __webpack_require__(/*! base-x */ \"./node_modules/multibase/node_modules/base-x/index.js\")\nconst base16 = __webpack_require__(/*! ./base16 */ \"./node_modules/multibase/src/base16.js\")\nconst base32 = __webpack_require__(/*! ./base32 */ \"./node_modules/multibase/src/base32.js\")\nconst base64 = __webpack_require__(/*! ./base64 */ \"./node_modules/multibase/src/base64.js\")\n\n// name, code, implementation, alphabet\nconst constants = [\n ['base1', '1', '', '1'],\n ['base2', '0', baseX, '01'],\n ['base8', '7', baseX, '01234567'],\n ['base10', '9', baseX, '0123456789'],\n ['base16', 'f', base16, '0123456789abcdef'],\n ['base32', 'b', base32, 'abcdefghijklmnopqrstuvwxyz234567'],\n ['base32pad', 'c', base32, 'abcdefghijklmnopqrstuvwxyz234567='],\n ['base32hex', 'v', base32, '0123456789abcdefghijklmnopqrstuv'],\n ['base32hexpad', 't', base32, '0123456789abcdefghijklmnopqrstuv='],\n ['base32z', 'h', base32, 'ybndrfg8ejkmcpqxot1uwisza345h769'],\n ['base58flickr', 'Z', baseX, '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'],\n ['base58btc', 'z', baseX, '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'],\n ['base64', 'm', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'],\n ['base64pad', 'M', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='],\n ['base64url', 'u', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'],\n ['base64urlpad', 'U', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=']\n]\n\nconst names = constants.reduce((prev, tupple) => {\n prev[tupple[0]] = new Base(tupple[0], tupple[1], tupple[2], tupple[3])\n return prev\n}, {})\n\nconst codes = constants.reduce((prev, tupple) => {\n prev[tupple[1]] = names[tupple[0]]\n return prev\n}, {})\n\nmodule.exports = {\n names: names,\n codes: codes\n}\n\n\n//# sourceURL=webpack:///./node_modules/multibase/src/constants.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multibase/src/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/multibase/src/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Implementation of the [multibase](https://github.com/multiformats/multibase) specification.\n * @module Multibase\n */\n\n\nconst constants = __webpack_require__(/*! ./constants */ \"./node_modules/multibase/src/constants.js\")\n\nexports = module.exports = multibase\nexports.encode = encode\nexports.decode = decode\nexports.isEncoded = isEncoded\nexports.names = Object.freeze(Object.keys(constants.names))\nexports.codes = Object.freeze(Object.keys(constants.codes))\n\nconst errNotSupported = new Error('Unsupported encoding')\n\n/**\n * Create a new buffer with the multibase varint+code.\n *\n * @param {string|number} nameOrCode - The multibase name or code number.\n * @param {Buffer} buf - The data to be prefixed with multibase.\n * @memberof Multibase\n * @returns {Buffer}\n */\nfunction multibase (nameOrCode, buf) {\n if (!buf) {\n throw new Error('requires an encoded buffer')\n }\n const base = getBase(nameOrCode)\n const codeBuf = Buffer.from(base.code)\n\n const name = base.name\n validEncode(name, buf)\n return Buffer.concat([codeBuf, buf])\n}\n\n/**\n * Encode data with the specified base and add the multibase prefix.\n *\n * @param {string|number} nameOrCode - The multibase name or code number.\n * @param {Buffer} buf - The data to be encoded.\n * @returns {Buffer}\n * @memberof Multibase\n */\nfunction encode (nameOrCode, buf) {\n const base = getBase(nameOrCode)\n const name = base.name\n\n return multibase(name, Buffer.from(base.encode(buf)))\n}\n\n/**\n * Takes a buffer or string encoded with multibase header, decodes it and\n * returns the decoded buffer\n *\n * @param {Buffer|string} bufOrString\n * @returns {Buffer}\n * @memberof Multibase\n *\n */\nfunction decode (bufOrString) {\n if (Buffer.isBuffer(bufOrString)) {\n bufOrString = bufOrString.toString()\n }\n\n const code = bufOrString.substring(0, 1)\n bufOrString = bufOrString.substring(1, bufOrString.length)\n\n if (typeof bufOrString === 'string') {\n bufOrString = Buffer.from(bufOrString)\n }\n\n const base = getBase(code)\n return Buffer.from(base.decode(bufOrString.toString()))\n}\n\n/**\n * Is the given data multibase encoded?\n *\n * @param {Buffer|string} bufOrString\n * @returns {boolean}\n * @memberof Multibase\n */\nfunction isEncoded (bufOrString) {\n if (Buffer.isBuffer(bufOrString)) {\n bufOrString = bufOrString.toString()\n }\n\n // Ensure bufOrString is a string\n if (Object.prototype.toString.call(bufOrString) !== '[object String]') {\n return false\n }\n\n const code = bufOrString.substring(0, 1)\n try {\n const base = getBase(code)\n return base.name\n } catch (err) {\n return false\n }\n}\n\n/**\n * @param {string} name\n * @param {Buffer} buf\n * @private\n * @returns {undefined}\n */\nfunction validEncode (name, buf) {\n const base = getBase(name)\n base.decode(buf.toString())\n}\n\nfunction getBase (nameOrCode) {\n let base\n\n if (constants.names[nameOrCode]) {\n base = constants.names[nameOrCode]\n } else if (constants.codes[nameOrCode]) {\n base = constants.codes[nameOrCode]\n } else {\n throw errNotSupported\n }\n\n if (!base.isImplemented()) {\n throw new Error('Base ' + nameOrCode + ' is not implemented yet')\n }\n\n return base\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multibase/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/base-table.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/multicodec/src/base-table.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// THIS FILE IS GENERATED, DO NO EDIT MANUALLY\n// For more information see the README.md\n/* eslint-disable dot-notation */\n\n\n// serialization\nexports['protobuf'] = Buffer.from('50', 'hex')\nexports['cbor'] = Buffer.from('51', 'hex')\nexports['rlp'] = Buffer.from('60', 'hex')\nexports['bencode'] = Buffer.from('63', 'hex')\n\n// multiformat\nexports['multicodec'] = Buffer.from('30', 'hex')\nexports['multihash'] = Buffer.from('31', 'hex')\nexports['multiaddr'] = Buffer.from('32', 'hex')\nexports['multibase'] = Buffer.from('33', 'hex')\n\n// multihash\nexports['identity'] = Buffer.from('00', 'hex')\nexports['sha1'] = Buffer.from('11', 'hex')\nexports['sha2-256'] = Buffer.from('12', 'hex')\nexports['sha2-512'] = Buffer.from('13', 'hex')\nexports['sha3-512'] = Buffer.from('14', 'hex')\nexports['sha3-384'] = Buffer.from('15', 'hex')\nexports['sha3-256'] = Buffer.from('16', 'hex')\nexports['sha3-224'] = Buffer.from('17', 'hex')\nexports['shake-128'] = Buffer.from('18', 'hex')\nexports['shake-256'] = Buffer.from('19', 'hex')\nexports['keccak-224'] = Buffer.from('1a', 'hex')\nexports['keccak-256'] = Buffer.from('1b', 'hex')\nexports['keccak-384'] = Buffer.from('1c', 'hex')\nexports['keccak-512'] = Buffer.from('1d', 'hex')\nexports['murmur3-128'] = Buffer.from('22', 'hex')\nexports['murmur3-32'] = Buffer.from('23', 'hex')\nexports['dbl-sha2-256'] = Buffer.from('56', 'hex')\nexports['md4'] = Buffer.from('d4', 'hex')\nexports['md5'] = Buffer.from('d5', 'hex')\nexports['bmt'] = Buffer.from('d6', 'hex')\nexports['x11'] = Buffer.from('1100', 'hex')\nexports['blake2b-8'] = Buffer.from('b201', 'hex')\nexports['blake2b-16'] = Buffer.from('b202', 'hex')\nexports['blake2b-24'] = Buffer.from('b203', 'hex')\nexports['blake2b-32'] = Buffer.from('b204', 'hex')\nexports['blake2b-40'] = Buffer.from('b205', 'hex')\nexports['blake2b-48'] = Buffer.from('b206', 'hex')\nexports['blake2b-56'] = Buffer.from('b207', 'hex')\nexports['blake2b-64'] = Buffer.from('b208', 'hex')\nexports['blake2b-72'] = Buffer.from('b209', 'hex')\nexports['blake2b-80'] = Buffer.from('b20a', 'hex')\nexports['blake2b-88'] = Buffer.from('b20b', 'hex')\nexports['blake2b-96'] = Buffer.from('b20c', 'hex')\nexports['blake2b-104'] = Buffer.from('b20d', 'hex')\nexports['blake2b-112'] = Buffer.from('b20e', 'hex')\nexports['blake2b-120'] = Buffer.from('b20f', 'hex')\nexports['blake2b-128'] = Buffer.from('b210', 'hex')\nexports['blake2b-136'] = Buffer.from('b211', 'hex')\nexports['blake2b-144'] = Buffer.from('b212', 'hex')\nexports['blake2b-152'] = Buffer.from('b213', 'hex')\nexports['blake2b-160'] = Buffer.from('b214', 'hex')\nexports['blake2b-168'] = Buffer.from('b215', 'hex')\nexports['blake2b-176'] = Buffer.from('b216', 'hex')\nexports['blake2b-184'] = Buffer.from('b217', 'hex')\nexports['blake2b-192'] = Buffer.from('b218', 'hex')\nexports['blake2b-200'] = Buffer.from('b219', 'hex')\nexports['blake2b-208'] = Buffer.from('b21a', 'hex')\nexports['blake2b-216'] = Buffer.from('b21b', 'hex')\nexports['blake2b-224'] = Buffer.from('b21c', 'hex')\nexports['blake2b-232'] = Buffer.from('b21d', 'hex')\nexports['blake2b-240'] = Buffer.from('b21e', 'hex')\nexports['blake2b-248'] = Buffer.from('b21f', 'hex')\nexports['blake2b-256'] = Buffer.from('b220', 'hex')\nexports['blake2b-264'] = Buffer.from('b221', 'hex')\nexports['blake2b-272'] = Buffer.from('b222', 'hex')\nexports['blake2b-280'] = Buffer.from('b223', 'hex')\nexports['blake2b-288'] = Buffer.from('b224', 'hex')\nexports['blake2b-296'] = Buffer.from('b225', 'hex')\nexports['blake2b-304'] = Buffer.from('b226', 'hex')\nexports['blake2b-312'] = Buffer.from('b227', 'hex')\nexports['blake2b-320'] = Buffer.from('b228', 'hex')\nexports['blake2b-328'] = Buffer.from('b229', 'hex')\nexports['blake2b-336'] = Buffer.from('b22a', 'hex')\nexports['blake2b-344'] = Buffer.from('b22b', 'hex')\nexports['blake2b-352'] = Buffer.from('b22c', 'hex')\nexports['blake2b-360'] = Buffer.from('b22d', 'hex')\nexports['blake2b-368'] = Buffer.from('b22e', 'hex')\nexports['blake2b-376'] = Buffer.from('b22f', 'hex')\nexports['blake2b-384'] = Buffer.from('b230', 'hex')\nexports['blake2b-392'] = Buffer.from('b231', 'hex')\nexports['blake2b-400'] = Buffer.from('b232', 'hex')\nexports['blake2b-408'] = Buffer.from('b233', 'hex')\nexports['blake2b-416'] = Buffer.from('b234', 'hex')\nexports['blake2b-424'] = Buffer.from('b235', 'hex')\nexports['blake2b-432'] = Buffer.from('b236', 'hex')\nexports['blake2b-440'] = Buffer.from('b237', 'hex')\nexports['blake2b-448'] = Buffer.from('b238', 'hex')\nexports['blake2b-456'] = Buffer.from('b239', 'hex')\nexports['blake2b-464'] = Buffer.from('b23a', 'hex')\nexports['blake2b-472'] = Buffer.from('b23b', 'hex')\nexports['blake2b-480'] = Buffer.from('b23c', 'hex')\nexports['blake2b-488'] = Buffer.from('b23d', 'hex')\nexports['blake2b-496'] = Buffer.from('b23e', 'hex')\nexports['blake2b-504'] = Buffer.from('b23f', 'hex')\nexports['blake2b-512'] = Buffer.from('b240', 'hex')\nexports['blake2s-8'] = Buffer.from('b241', 'hex')\nexports['blake2s-16'] = Buffer.from('b242', 'hex')\nexports['blake2s-24'] = Buffer.from('b243', 'hex')\nexports['blake2s-32'] = Buffer.from('b244', 'hex')\nexports['blake2s-40'] = Buffer.from('b245', 'hex')\nexports['blake2s-48'] = Buffer.from('b246', 'hex')\nexports['blake2s-56'] = Buffer.from('b247', 'hex')\nexports['blake2s-64'] = Buffer.from('b248', 'hex')\nexports['blake2s-72'] = Buffer.from('b249', 'hex')\nexports['blake2s-80'] = Buffer.from('b24a', 'hex')\nexports['blake2s-88'] = Buffer.from('b24b', 'hex')\nexports['blake2s-96'] = Buffer.from('b24c', 'hex')\nexports['blake2s-104'] = Buffer.from('b24d', 'hex')\nexports['blake2s-112'] = Buffer.from('b24e', 'hex')\nexports['blake2s-120'] = Buffer.from('b24f', 'hex')\nexports['blake2s-128'] = Buffer.from('b250', 'hex')\nexports['blake2s-136'] = Buffer.from('b251', 'hex')\nexports['blake2s-144'] = Buffer.from('b252', 'hex')\nexports['blake2s-152'] = Buffer.from('b253', 'hex')\nexports['blake2s-160'] = Buffer.from('b254', 'hex')\nexports['blake2s-168'] = Buffer.from('b255', 'hex')\nexports['blake2s-176'] = Buffer.from('b256', 'hex')\nexports['blake2s-184'] = Buffer.from('b257', 'hex')\nexports['blake2s-192'] = Buffer.from('b258', 'hex')\nexports['blake2s-200'] = Buffer.from('b259', 'hex')\nexports['blake2s-208'] = Buffer.from('b25a', 'hex')\nexports['blake2s-216'] = Buffer.from('b25b', 'hex')\nexports['blake2s-224'] = Buffer.from('b25c', 'hex')\nexports['blake2s-232'] = Buffer.from('b25d', 'hex')\nexports['blake2s-240'] = Buffer.from('b25e', 'hex')\nexports['blake2s-248'] = Buffer.from('b25f', 'hex')\nexports['blake2s-256'] = Buffer.from('b260', 'hex')\nexports['skein256-8'] = Buffer.from('b301', 'hex')\nexports['skein256-16'] = Buffer.from('b302', 'hex')\nexports['skein256-24'] = Buffer.from('b303', 'hex')\nexports['skein256-32'] = Buffer.from('b304', 'hex')\nexports['skein256-40'] = Buffer.from('b305', 'hex')\nexports['skein256-48'] = Buffer.from('b306', 'hex')\nexports['skein256-56'] = Buffer.from('b307', 'hex')\nexports['skein256-64'] = Buffer.from('b308', 'hex')\nexports['skein256-72'] = Buffer.from('b309', 'hex')\nexports['skein256-80'] = Buffer.from('b30a', 'hex')\nexports['skein256-88'] = Buffer.from('b30b', 'hex')\nexports['skein256-96'] = Buffer.from('b30c', 'hex')\nexports['skein256-104'] = Buffer.from('b30d', 'hex')\nexports['skein256-112'] = Buffer.from('b30e', 'hex')\nexports['skein256-120'] = Buffer.from('b30f', 'hex')\nexports['skein256-128'] = Buffer.from('b310', 'hex')\nexports['skein256-136'] = Buffer.from('b311', 'hex')\nexports['skein256-144'] = Buffer.from('b312', 'hex')\nexports['skein256-152'] = Buffer.from('b313', 'hex')\nexports['skein256-160'] = Buffer.from('b314', 'hex')\nexports['skein256-168'] = Buffer.from('b315', 'hex')\nexports['skein256-176'] = Buffer.from('b316', 'hex')\nexports['skein256-184'] = Buffer.from('b317', 'hex')\nexports['skein256-192'] = Buffer.from('b318', 'hex')\nexports['skein256-200'] = Buffer.from('b319', 'hex')\nexports['skein256-208'] = Buffer.from('b31a', 'hex')\nexports['skein256-216'] = Buffer.from('b31b', 'hex')\nexports['skein256-224'] = Buffer.from('b31c', 'hex')\nexports['skein256-232'] = Buffer.from('b31d', 'hex')\nexports['skein256-240'] = Buffer.from('b31e', 'hex')\nexports['skein256-248'] = Buffer.from('b31f', 'hex')\nexports['skein256-256'] = Buffer.from('b320', 'hex')\nexports['skein512-8'] = Buffer.from('b321', 'hex')\nexports['skein512-16'] = Buffer.from('b322', 'hex')\nexports['skein512-24'] = Buffer.from('b323', 'hex')\nexports['skein512-32'] = Buffer.from('b324', 'hex')\nexports['skein512-40'] = Buffer.from('b325', 'hex')\nexports['skein512-48'] = Buffer.from('b326', 'hex')\nexports['skein512-56'] = Buffer.from('b327', 'hex')\nexports['skein512-64'] = Buffer.from('b328', 'hex')\nexports['skein512-72'] = Buffer.from('b329', 'hex')\nexports['skein512-80'] = Buffer.from('b32a', 'hex')\nexports['skein512-88'] = Buffer.from('b32b', 'hex')\nexports['skein512-96'] = Buffer.from('b32c', 'hex')\nexports['skein512-104'] = Buffer.from('b32d', 'hex')\nexports['skein512-112'] = Buffer.from('b32e', 'hex')\nexports['skein512-120'] = Buffer.from('b32f', 'hex')\nexports['skein512-128'] = Buffer.from('b330', 'hex')\nexports['skein512-136'] = Buffer.from('b331', 'hex')\nexports['skein512-144'] = Buffer.from('b332', 'hex')\nexports['skein512-152'] = Buffer.from('b333', 'hex')\nexports['skein512-160'] = Buffer.from('b334', 'hex')\nexports['skein512-168'] = Buffer.from('b335', 'hex')\nexports['skein512-176'] = Buffer.from('b336', 'hex')\nexports['skein512-184'] = Buffer.from('b337', 'hex')\nexports['skein512-192'] = Buffer.from('b338', 'hex')\nexports['skein512-200'] = Buffer.from('b339', 'hex')\nexports['skein512-208'] = Buffer.from('b33a', 'hex')\nexports['skein512-216'] = Buffer.from('b33b', 'hex')\nexports['skein512-224'] = Buffer.from('b33c', 'hex')\nexports['skein512-232'] = Buffer.from('b33d', 'hex')\nexports['skein512-240'] = Buffer.from('b33e', 'hex')\nexports['skein512-248'] = Buffer.from('b33f', 'hex')\nexports['skein512-256'] = Buffer.from('b340', 'hex')\nexports['skein512-264'] = Buffer.from('b341', 'hex')\nexports['skein512-272'] = Buffer.from('b342', 'hex')\nexports['skein512-280'] = Buffer.from('b343', 'hex')\nexports['skein512-288'] = Buffer.from('b344', 'hex')\nexports['skein512-296'] = Buffer.from('b345', 'hex')\nexports['skein512-304'] = Buffer.from('b346', 'hex')\nexports['skein512-312'] = Buffer.from('b347', 'hex')\nexports['skein512-320'] = Buffer.from('b348', 'hex')\nexports['skein512-328'] = Buffer.from('b349', 'hex')\nexports['skein512-336'] = Buffer.from('b34a', 'hex')\nexports['skein512-344'] = Buffer.from('b34b', 'hex')\nexports['skein512-352'] = Buffer.from('b34c', 'hex')\nexports['skein512-360'] = Buffer.from('b34d', 'hex')\nexports['skein512-368'] = Buffer.from('b34e', 'hex')\nexports['skein512-376'] = Buffer.from('b34f', 'hex')\nexports['skein512-384'] = Buffer.from('b350', 'hex')\nexports['skein512-392'] = Buffer.from('b351', 'hex')\nexports['skein512-400'] = Buffer.from('b352', 'hex')\nexports['skein512-408'] = Buffer.from('b353', 'hex')\nexports['skein512-416'] = Buffer.from('b354', 'hex')\nexports['skein512-424'] = Buffer.from('b355', 'hex')\nexports['skein512-432'] = Buffer.from('b356', 'hex')\nexports['skein512-440'] = Buffer.from('b357', 'hex')\nexports['skein512-448'] = Buffer.from('b358', 'hex')\nexports['skein512-456'] = Buffer.from('b359', 'hex')\nexports['skein512-464'] = Buffer.from('b35a', 'hex')\nexports['skein512-472'] = Buffer.from('b35b', 'hex')\nexports['skein512-480'] = Buffer.from('b35c', 'hex')\nexports['skein512-488'] = Buffer.from('b35d', 'hex')\nexports['skein512-496'] = Buffer.from('b35e', 'hex')\nexports['skein512-504'] = Buffer.from('b35f', 'hex')\nexports['skein512-512'] = Buffer.from('b360', 'hex')\nexports['skein1024-8'] = Buffer.from('b361', 'hex')\nexports['skein1024-16'] = Buffer.from('b362', 'hex')\nexports['skein1024-24'] = Buffer.from('b363', 'hex')\nexports['skein1024-32'] = Buffer.from('b364', 'hex')\nexports['skein1024-40'] = Buffer.from('b365', 'hex')\nexports['skein1024-48'] = Buffer.from('b366', 'hex')\nexports['skein1024-56'] = Buffer.from('b367', 'hex')\nexports['skein1024-64'] = Buffer.from('b368', 'hex')\nexports['skein1024-72'] = Buffer.from('b369', 'hex')\nexports['skein1024-80'] = Buffer.from('b36a', 'hex')\nexports['skein1024-88'] = Buffer.from('b36b', 'hex')\nexports['skein1024-96'] = Buffer.from('b36c', 'hex')\nexports['skein1024-104'] = Buffer.from('b36d', 'hex')\nexports['skein1024-112'] = Buffer.from('b36e', 'hex')\nexports['skein1024-120'] = Buffer.from('b36f', 'hex')\nexports['skein1024-128'] = Buffer.from('b370', 'hex')\nexports['skein1024-136'] = Buffer.from('b371', 'hex')\nexports['skein1024-144'] = Buffer.from('b372', 'hex')\nexports['skein1024-152'] = Buffer.from('b373', 'hex')\nexports['skein1024-160'] = Buffer.from('b374', 'hex')\nexports['skein1024-168'] = Buffer.from('b375', 'hex')\nexports['skein1024-176'] = Buffer.from('b376', 'hex')\nexports['skein1024-184'] = Buffer.from('b377', 'hex')\nexports['skein1024-192'] = Buffer.from('b378', 'hex')\nexports['skein1024-200'] = Buffer.from('b379', 'hex')\nexports['skein1024-208'] = Buffer.from('b37a', 'hex')\nexports['skein1024-216'] = Buffer.from('b37b', 'hex')\nexports['skein1024-224'] = Buffer.from('b37c', 'hex')\nexports['skein1024-232'] = Buffer.from('b37d', 'hex')\nexports['skein1024-240'] = Buffer.from('b37e', 'hex')\nexports['skein1024-248'] = Buffer.from('b37f', 'hex')\nexports['skein1024-256'] = Buffer.from('b380', 'hex')\nexports['skein1024-264'] = Buffer.from('b381', 'hex')\nexports['skein1024-272'] = Buffer.from('b382', 'hex')\nexports['skein1024-280'] = Buffer.from('b383', 'hex')\nexports['skein1024-288'] = Buffer.from('b384', 'hex')\nexports['skein1024-296'] = Buffer.from('b385', 'hex')\nexports['skein1024-304'] = Buffer.from('b386', 'hex')\nexports['skein1024-312'] = Buffer.from('b387', 'hex')\nexports['skein1024-320'] = Buffer.from('b388', 'hex')\nexports['skein1024-328'] = Buffer.from('b389', 'hex')\nexports['skein1024-336'] = Buffer.from('b38a', 'hex')\nexports['skein1024-344'] = Buffer.from('b38b', 'hex')\nexports['skein1024-352'] = Buffer.from('b38c', 'hex')\nexports['skein1024-360'] = Buffer.from('b38d', 'hex')\nexports['skein1024-368'] = Buffer.from('b38e', 'hex')\nexports['skein1024-376'] = Buffer.from('b38f', 'hex')\nexports['skein1024-384'] = Buffer.from('b390', 'hex')\nexports['skein1024-392'] = Buffer.from('b391', 'hex')\nexports['skein1024-400'] = Buffer.from('b392', 'hex')\nexports['skein1024-408'] = Buffer.from('b393', 'hex')\nexports['skein1024-416'] = Buffer.from('b394', 'hex')\nexports['skein1024-424'] = Buffer.from('b395', 'hex')\nexports['skein1024-432'] = Buffer.from('b396', 'hex')\nexports['skein1024-440'] = Buffer.from('b397', 'hex')\nexports['skein1024-448'] = Buffer.from('b398', 'hex')\nexports['skein1024-456'] = Buffer.from('b399', 'hex')\nexports['skein1024-464'] = Buffer.from('b39a', 'hex')\nexports['skein1024-472'] = Buffer.from('b39b', 'hex')\nexports['skein1024-480'] = Buffer.from('b39c', 'hex')\nexports['skein1024-488'] = Buffer.from('b39d', 'hex')\nexports['skein1024-496'] = Buffer.from('b39e', 'hex')\nexports['skein1024-504'] = Buffer.from('b39f', 'hex')\nexports['skein1024-512'] = Buffer.from('b3a0', 'hex')\nexports['skein1024-520'] = Buffer.from('b3a1', 'hex')\nexports['skein1024-528'] = Buffer.from('b3a2', 'hex')\nexports['skein1024-536'] = Buffer.from('b3a3', 'hex')\nexports['skein1024-544'] = Buffer.from('b3a4', 'hex')\nexports['skein1024-552'] = Buffer.from('b3a5', 'hex')\nexports['skein1024-560'] = Buffer.from('b3a6', 'hex')\nexports['skein1024-568'] = Buffer.from('b3a7', 'hex')\nexports['skein1024-576'] = Buffer.from('b3a8', 'hex')\nexports['skein1024-584'] = Buffer.from('b3a9', 'hex')\nexports['skein1024-592'] = Buffer.from('b3aa', 'hex')\nexports['skein1024-600'] = Buffer.from('b3ab', 'hex')\nexports['skein1024-608'] = Buffer.from('b3ac', 'hex')\nexports['skein1024-616'] = Buffer.from('b3ad', 'hex')\nexports['skein1024-624'] = Buffer.from('b3ae', 'hex')\nexports['skein1024-632'] = Buffer.from('b3af', 'hex')\nexports['skein1024-640'] = Buffer.from('b3b0', 'hex')\nexports['skein1024-648'] = Buffer.from('b3b1', 'hex')\nexports['skein1024-656'] = Buffer.from('b3b2', 'hex')\nexports['skein1024-664'] = Buffer.from('b3b3', 'hex')\nexports['skein1024-672'] = Buffer.from('b3b4', 'hex')\nexports['skein1024-680'] = Buffer.from('b3b5', 'hex')\nexports['skein1024-688'] = Buffer.from('b3b6', 'hex')\nexports['skein1024-696'] = Buffer.from('b3b7', 'hex')\nexports['skein1024-704'] = Buffer.from('b3b8', 'hex')\nexports['skein1024-712'] = Buffer.from('b3b9', 'hex')\nexports['skein1024-720'] = Buffer.from('b3ba', 'hex')\nexports['skein1024-728'] = Buffer.from('b3bb', 'hex')\nexports['skein1024-736'] = Buffer.from('b3bc', 'hex')\nexports['skein1024-744'] = Buffer.from('b3bd', 'hex')\nexports['skein1024-752'] = Buffer.from('b3be', 'hex')\nexports['skein1024-760'] = Buffer.from('b3bf', 'hex')\nexports['skein1024-768'] = Buffer.from('b3c0', 'hex')\nexports['skein1024-776'] = Buffer.from('b3c1', 'hex')\nexports['skein1024-784'] = Buffer.from('b3c2', 'hex')\nexports['skein1024-792'] = Buffer.from('b3c3', 'hex')\nexports['skein1024-800'] = Buffer.from('b3c4', 'hex')\nexports['skein1024-808'] = Buffer.from('b3c5', 'hex')\nexports['skein1024-816'] = Buffer.from('b3c6', 'hex')\nexports['skein1024-824'] = Buffer.from('b3c7', 'hex')\nexports['skein1024-832'] = Buffer.from('b3c8', 'hex')\nexports['skein1024-840'] = Buffer.from('b3c9', 'hex')\nexports['skein1024-848'] = Buffer.from('b3ca', 'hex')\nexports['skein1024-856'] = Buffer.from('b3cb', 'hex')\nexports['skein1024-864'] = Buffer.from('b3cc', 'hex')\nexports['skein1024-872'] = Buffer.from('b3cd', 'hex')\nexports['skein1024-880'] = Buffer.from('b3ce', 'hex')\nexports['skein1024-888'] = Buffer.from('b3cf', 'hex')\nexports['skein1024-896'] = Buffer.from('b3d0', 'hex')\nexports['skein1024-904'] = Buffer.from('b3d1', 'hex')\nexports['skein1024-912'] = Buffer.from('b3d2', 'hex')\nexports['skein1024-920'] = Buffer.from('b3d3', 'hex')\nexports['skein1024-928'] = Buffer.from('b3d4', 'hex')\nexports['skein1024-936'] = Buffer.from('b3d5', 'hex')\nexports['skein1024-944'] = Buffer.from('b3d6', 'hex')\nexports['skein1024-952'] = Buffer.from('b3d7', 'hex')\nexports['skein1024-960'] = Buffer.from('b3d8', 'hex')\nexports['skein1024-968'] = Buffer.from('b3d9', 'hex')\nexports['skein1024-976'] = Buffer.from('b3da', 'hex')\nexports['skein1024-984'] = Buffer.from('b3db', 'hex')\nexports['skein1024-992'] = Buffer.from('b3dc', 'hex')\nexports['skein1024-1000'] = Buffer.from('b3dd', 'hex')\nexports['skein1024-1008'] = Buffer.from('b3de', 'hex')\nexports['skein1024-1016'] = Buffer.from('b3df', 'hex')\nexports['skein1024-1024'] = Buffer.from('b3e0', 'hex')\n\n// multiaddr\nexports['ip4'] = Buffer.from('04', 'hex')\nexports['tcp'] = Buffer.from('06', 'hex')\nexports['dccp'] = Buffer.from('21', 'hex')\nexports['ip6'] = Buffer.from('29', 'hex')\nexports['ip6zone'] = Buffer.from('2a', 'hex')\nexports['dns'] = Buffer.from('35', 'hex')\nexports['dns4'] = Buffer.from('36', 'hex')\nexports['dns6'] = Buffer.from('37', 'hex')\nexports['dnsaddr'] = Buffer.from('38', 'hex')\nexports['sctp'] = Buffer.from('84', 'hex')\nexports['udp'] = Buffer.from('0111', 'hex')\nexports['p2p-webrtc-star'] = Buffer.from('0113', 'hex')\nexports['p2p-webrtc-direct'] = Buffer.from('0114', 'hex')\nexports['p2p-stardust'] = Buffer.from('0115', 'hex')\nexports['p2p-circuit'] = Buffer.from('0122', 'hex')\nexports['udt'] = Buffer.from('012d', 'hex')\nexports['utp'] = Buffer.from('012e', 'hex')\nexports['unix'] = Buffer.from('0190', 'hex')\nexports['p2p'] = Buffer.from('01a5', 'hex')\nexports['ipfs'] = Buffer.from('01a5', 'hex')\nexports['https'] = Buffer.from('01bb', 'hex')\nexports['onion'] = Buffer.from('01bc', 'hex')\nexports['onion3'] = Buffer.from('01bd', 'hex')\nexports['garlic64'] = Buffer.from('01be', 'hex')\nexports['garlic32'] = Buffer.from('01bf', 'hex')\nexports['quic'] = Buffer.from('01cc', 'hex')\nexports['ws'] = Buffer.from('01dd', 'hex')\nexports['wss'] = Buffer.from('01de', 'hex')\nexports['p2p-websocket-star'] = Buffer.from('01df', 'hex')\nexports['http'] = Buffer.from('01e0', 'hex')\n\n// ipld\nexports['raw'] = Buffer.from('55', 'hex')\nexports['dag-pb'] = Buffer.from('70', 'hex')\nexports['dag-cbor'] = Buffer.from('71', 'hex')\nexports['libp2p-key'] = Buffer.from('72', 'hex')\nexports['git-raw'] = Buffer.from('78', 'hex')\nexports['torrent-info'] = Buffer.from('7b', 'hex')\nexports['torrent-file'] = Buffer.from('7c', 'hex')\nexports['leofcoin-block'] = Buffer.from('81', 'hex')\nexports['leofcoin-tx'] = Buffer.from('82', 'hex')\nexports['leofcoin-pr'] = Buffer.from('83', 'hex')\nexports['eth-block'] = Buffer.from('90', 'hex')\nexports['eth-block-list'] = Buffer.from('91', 'hex')\nexports['eth-tx-trie'] = Buffer.from('92', 'hex')\nexports['eth-tx'] = Buffer.from('93', 'hex')\nexports['eth-tx-receipt-trie'] = Buffer.from('94', 'hex')\nexports['eth-tx-receipt'] = Buffer.from('95', 'hex')\nexports['eth-state-trie'] = Buffer.from('96', 'hex')\nexports['eth-account-snapshot'] = Buffer.from('97', 'hex')\nexports['eth-storage-trie'] = Buffer.from('98', 'hex')\nexports['bitcoin-block'] = Buffer.from('b0', 'hex')\nexports['bitcoin-tx'] = Buffer.from('b1', 'hex')\nexports['zcash-block'] = Buffer.from('c0', 'hex')\nexports['zcash-tx'] = Buffer.from('c1', 'hex')\nexports['stellar-block'] = Buffer.from('d0', 'hex')\nexports['stellar-tx'] = Buffer.from('d1', 'hex')\nexports['decred-block'] = Buffer.from('e0', 'hex')\nexports['decred-tx'] = Buffer.from('e1', 'hex')\nexports['dash-block'] = Buffer.from('f0', 'hex')\nexports['dash-tx'] = Buffer.from('f1', 'hex')\nexports['swarm-manifest'] = Buffer.from('fa', 'hex')\nexports['swarm-feed'] = Buffer.from('fb', 'hex')\nexports['dag-json'] = Buffer.from('0129', 'hex')\n\n// namespace\nexports['path'] = Buffer.from('2f', 'hex')\nexports['ipld-ns'] = Buffer.from('e2', 'hex')\nexports['ipfs-ns'] = Buffer.from('e3', 'hex')\nexports['swarm-ns'] = Buffer.from('e4', 'hex')\n\n// key\nexports['ed25519-pub'] = Buffer.from('ed', 'hex')\n\n// holochain\nexports['holochain-adr-v0'] = Buffer.from('807124', 'hex')\nexports['holochain-adr-v1'] = Buffer.from('817124', 'hex')\nexports['holochain-key-v0'] = Buffer.from('947124', 'hex')\nexports['holochain-key-v1'] = Buffer.from('957124', 'hex')\nexports['holochain-sig-v0'] = Buffer.from('a27124', 'hex')\nexports['holochain-sig-v1'] = Buffer.from('a37124', 'hex')\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/base-table.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/constants.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/multicodec/src/constants.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// THIS FILE IS GENERATED, DO NO EDIT MANUALLY\n// For more information see the README.md\n/* eslint-disable dot-notation */\n\nmodule.exports = Object.freeze({\n\n // serialization\n PROTOBUF: 0x50,\n CBOR: 0x51,\n RLP: 0x60,\n BENCODE: 0x63,\n\n // multiformat\n MULTICODEC: 0x30,\n MULTIHASH: 0x31,\n MULTIADDR: 0x32,\n MULTIBASE: 0x33,\n\n // multihash\n IDENTITY: 0x00,\n SHA1: 0x11,\n SHA2_256: 0x12,\n SHA2_512: 0x13,\n SHA3_512: 0x14,\n SHA3_384: 0x15,\n SHA3_256: 0x16,\n SHA3_224: 0x17,\n SHAKE_128: 0x18,\n SHAKE_256: 0x19,\n KECCAK_224: 0x1a,\n KECCAK_256: 0x1b,\n KECCAK_384: 0x1c,\n KECCAK_512: 0x1d,\n MURMUR3_128: 0x22,\n MURMUR3_32: 0x23,\n DBL_SHA2_256: 0x56,\n MD4: 0xd4,\n MD5: 0xd5,\n BMT: 0xd6,\n X11: 0x1100,\n BLAKE2B_8: 0xb201,\n BLAKE2B_16: 0xb202,\n BLAKE2B_24: 0xb203,\n BLAKE2B_32: 0xb204,\n BLAKE2B_40: 0xb205,\n BLAKE2B_48: 0xb206,\n BLAKE2B_56: 0xb207,\n BLAKE2B_64: 0xb208,\n BLAKE2B_72: 0xb209,\n BLAKE2B_80: 0xb20a,\n BLAKE2B_88: 0xb20b,\n BLAKE2B_96: 0xb20c,\n BLAKE2B_104: 0xb20d,\n BLAKE2B_112: 0xb20e,\n BLAKE2B_120: 0xb20f,\n BLAKE2B_128: 0xb210,\n BLAKE2B_136: 0xb211,\n BLAKE2B_144: 0xb212,\n BLAKE2B_152: 0xb213,\n BLAKE2B_160: 0xb214,\n BLAKE2B_168: 0xb215,\n BLAKE2B_176: 0xb216,\n BLAKE2B_184: 0xb217,\n BLAKE2B_192: 0xb218,\n BLAKE2B_200: 0xb219,\n BLAKE2B_208: 0xb21a,\n BLAKE2B_216: 0xb21b,\n BLAKE2B_224: 0xb21c,\n BLAKE2B_232: 0xb21d,\n BLAKE2B_240: 0xb21e,\n BLAKE2B_248: 0xb21f,\n BLAKE2B_256: 0xb220,\n BLAKE2B_264: 0xb221,\n BLAKE2B_272: 0xb222,\n BLAKE2B_280: 0xb223,\n BLAKE2B_288: 0xb224,\n BLAKE2B_296: 0xb225,\n BLAKE2B_304: 0xb226,\n BLAKE2B_312: 0xb227,\n BLAKE2B_320: 0xb228,\n BLAKE2B_328: 0xb229,\n BLAKE2B_336: 0xb22a,\n BLAKE2B_344: 0xb22b,\n BLAKE2B_352: 0xb22c,\n BLAKE2B_360: 0xb22d,\n BLAKE2B_368: 0xb22e,\n BLAKE2B_376: 0xb22f,\n BLAKE2B_384: 0xb230,\n BLAKE2B_392: 0xb231,\n BLAKE2B_400: 0xb232,\n BLAKE2B_408: 0xb233,\n BLAKE2B_416: 0xb234,\n BLAKE2B_424: 0xb235,\n BLAKE2B_432: 0xb236,\n BLAKE2B_440: 0xb237,\n BLAKE2B_448: 0xb238,\n BLAKE2B_456: 0xb239,\n BLAKE2B_464: 0xb23a,\n BLAKE2B_472: 0xb23b,\n BLAKE2B_480: 0xb23c,\n BLAKE2B_488: 0xb23d,\n BLAKE2B_496: 0xb23e,\n BLAKE2B_504: 0xb23f,\n BLAKE2B_512: 0xb240,\n BLAKE2S_8: 0xb241,\n BLAKE2S_16: 0xb242,\n BLAKE2S_24: 0xb243,\n BLAKE2S_32: 0xb244,\n BLAKE2S_40: 0xb245,\n BLAKE2S_48: 0xb246,\n BLAKE2S_56: 0xb247,\n BLAKE2S_64: 0xb248,\n BLAKE2S_72: 0xb249,\n BLAKE2S_80: 0xb24a,\n BLAKE2S_88: 0xb24b,\n BLAKE2S_96: 0xb24c,\n BLAKE2S_104: 0xb24d,\n BLAKE2S_112: 0xb24e,\n BLAKE2S_120: 0xb24f,\n BLAKE2S_128: 0xb250,\n BLAKE2S_136: 0xb251,\n BLAKE2S_144: 0xb252,\n BLAKE2S_152: 0xb253,\n BLAKE2S_160: 0xb254,\n BLAKE2S_168: 0xb255,\n BLAKE2S_176: 0xb256,\n BLAKE2S_184: 0xb257,\n BLAKE2S_192: 0xb258,\n BLAKE2S_200: 0xb259,\n BLAKE2S_208: 0xb25a,\n BLAKE2S_216: 0xb25b,\n BLAKE2S_224: 0xb25c,\n BLAKE2S_232: 0xb25d,\n BLAKE2S_240: 0xb25e,\n BLAKE2S_248: 0xb25f,\n BLAKE2S_256: 0xb260,\n SKEIN256_8: 0xb301,\n SKEIN256_16: 0xb302,\n SKEIN256_24: 0xb303,\n SKEIN256_32: 0xb304,\n SKEIN256_40: 0xb305,\n SKEIN256_48: 0xb306,\n SKEIN256_56: 0xb307,\n SKEIN256_64: 0xb308,\n SKEIN256_72: 0xb309,\n SKEIN256_80: 0xb30a,\n SKEIN256_88: 0xb30b,\n SKEIN256_96: 0xb30c,\n SKEIN256_104: 0xb30d,\n SKEIN256_112: 0xb30e,\n SKEIN256_120: 0xb30f,\n SKEIN256_128: 0xb310,\n SKEIN256_136: 0xb311,\n SKEIN256_144: 0xb312,\n SKEIN256_152: 0xb313,\n SKEIN256_160: 0xb314,\n SKEIN256_168: 0xb315,\n SKEIN256_176: 0xb316,\n SKEIN256_184: 0xb317,\n SKEIN256_192: 0xb318,\n SKEIN256_200: 0xb319,\n SKEIN256_208: 0xb31a,\n SKEIN256_216: 0xb31b,\n SKEIN256_224: 0xb31c,\n SKEIN256_232: 0xb31d,\n SKEIN256_240: 0xb31e,\n SKEIN256_248: 0xb31f,\n SKEIN256_256: 0xb320,\n SKEIN512_8: 0xb321,\n SKEIN512_16: 0xb322,\n SKEIN512_24: 0xb323,\n SKEIN512_32: 0xb324,\n SKEIN512_40: 0xb325,\n SKEIN512_48: 0xb326,\n SKEIN512_56: 0xb327,\n SKEIN512_64: 0xb328,\n SKEIN512_72: 0xb329,\n SKEIN512_80: 0xb32a,\n SKEIN512_88: 0xb32b,\n SKEIN512_96: 0xb32c,\n SKEIN512_104: 0xb32d,\n SKEIN512_112: 0xb32e,\n SKEIN512_120: 0xb32f,\n SKEIN512_128: 0xb330,\n SKEIN512_136: 0xb331,\n SKEIN512_144: 0xb332,\n SKEIN512_152: 0xb333,\n SKEIN512_160: 0xb334,\n SKEIN512_168: 0xb335,\n SKEIN512_176: 0xb336,\n SKEIN512_184: 0xb337,\n SKEIN512_192: 0xb338,\n SKEIN512_200: 0xb339,\n SKEIN512_208: 0xb33a,\n SKEIN512_216: 0xb33b,\n SKEIN512_224: 0xb33c,\n SKEIN512_232: 0xb33d,\n SKEIN512_240: 0xb33e,\n SKEIN512_248: 0xb33f,\n SKEIN512_256: 0xb340,\n SKEIN512_264: 0xb341,\n SKEIN512_272: 0xb342,\n SKEIN512_280: 0xb343,\n SKEIN512_288: 0xb344,\n SKEIN512_296: 0xb345,\n SKEIN512_304: 0xb346,\n SKEIN512_312: 0xb347,\n SKEIN512_320: 0xb348,\n SKEIN512_328: 0xb349,\n SKEIN512_336: 0xb34a,\n SKEIN512_344: 0xb34b,\n SKEIN512_352: 0xb34c,\n SKEIN512_360: 0xb34d,\n SKEIN512_368: 0xb34e,\n SKEIN512_376: 0xb34f,\n SKEIN512_384: 0xb350,\n SKEIN512_392: 0xb351,\n SKEIN512_400: 0xb352,\n SKEIN512_408: 0xb353,\n SKEIN512_416: 0xb354,\n SKEIN512_424: 0xb355,\n SKEIN512_432: 0xb356,\n SKEIN512_440: 0xb357,\n SKEIN512_448: 0xb358,\n SKEIN512_456: 0xb359,\n SKEIN512_464: 0xb35a,\n SKEIN512_472: 0xb35b,\n SKEIN512_480: 0xb35c,\n SKEIN512_488: 0xb35d,\n SKEIN512_496: 0xb35e,\n SKEIN512_504: 0xb35f,\n SKEIN512_512: 0xb360,\n SKEIN1024_8: 0xb361,\n SKEIN1024_16: 0xb362,\n SKEIN1024_24: 0xb363,\n SKEIN1024_32: 0xb364,\n SKEIN1024_40: 0xb365,\n SKEIN1024_48: 0xb366,\n SKEIN1024_56: 0xb367,\n SKEIN1024_64: 0xb368,\n SKEIN1024_72: 0xb369,\n SKEIN1024_80: 0xb36a,\n SKEIN1024_88: 0xb36b,\n SKEIN1024_96: 0xb36c,\n SKEIN1024_104: 0xb36d,\n SKEIN1024_112: 0xb36e,\n SKEIN1024_120: 0xb36f,\n SKEIN1024_128: 0xb370,\n SKEIN1024_136: 0xb371,\n SKEIN1024_144: 0xb372,\n SKEIN1024_152: 0xb373,\n SKEIN1024_160: 0xb374,\n SKEIN1024_168: 0xb375,\n SKEIN1024_176: 0xb376,\n SKEIN1024_184: 0xb377,\n SKEIN1024_192: 0xb378,\n SKEIN1024_200: 0xb379,\n SKEIN1024_208: 0xb37a,\n SKEIN1024_216: 0xb37b,\n SKEIN1024_224: 0xb37c,\n SKEIN1024_232: 0xb37d,\n SKEIN1024_240: 0xb37e,\n SKEIN1024_248: 0xb37f,\n SKEIN1024_256: 0xb380,\n SKEIN1024_264: 0xb381,\n SKEIN1024_272: 0xb382,\n SKEIN1024_280: 0xb383,\n SKEIN1024_288: 0xb384,\n SKEIN1024_296: 0xb385,\n SKEIN1024_304: 0xb386,\n SKEIN1024_312: 0xb387,\n SKEIN1024_320: 0xb388,\n SKEIN1024_328: 0xb389,\n SKEIN1024_336: 0xb38a,\n SKEIN1024_344: 0xb38b,\n SKEIN1024_352: 0xb38c,\n SKEIN1024_360: 0xb38d,\n SKEIN1024_368: 0xb38e,\n SKEIN1024_376: 0xb38f,\n SKEIN1024_384: 0xb390,\n SKEIN1024_392: 0xb391,\n SKEIN1024_400: 0xb392,\n SKEIN1024_408: 0xb393,\n SKEIN1024_416: 0xb394,\n SKEIN1024_424: 0xb395,\n SKEIN1024_432: 0xb396,\n SKEIN1024_440: 0xb397,\n SKEIN1024_448: 0xb398,\n SKEIN1024_456: 0xb399,\n SKEIN1024_464: 0xb39a,\n SKEIN1024_472: 0xb39b,\n SKEIN1024_480: 0xb39c,\n SKEIN1024_488: 0xb39d,\n SKEIN1024_496: 0xb39e,\n SKEIN1024_504: 0xb39f,\n SKEIN1024_512: 0xb3a0,\n SKEIN1024_520: 0xb3a1,\n SKEIN1024_528: 0xb3a2,\n SKEIN1024_536: 0xb3a3,\n SKEIN1024_544: 0xb3a4,\n SKEIN1024_552: 0xb3a5,\n SKEIN1024_560: 0xb3a6,\n SKEIN1024_568: 0xb3a7,\n SKEIN1024_576: 0xb3a8,\n SKEIN1024_584: 0xb3a9,\n SKEIN1024_592: 0xb3aa,\n SKEIN1024_600: 0xb3ab,\n SKEIN1024_608: 0xb3ac,\n SKEIN1024_616: 0xb3ad,\n SKEIN1024_624: 0xb3ae,\n SKEIN1024_632: 0xb3af,\n SKEIN1024_640: 0xb3b0,\n SKEIN1024_648: 0xb3b1,\n SKEIN1024_656: 0xb3b2,\n SKEIN1024_664: 0xb3b3,\n SKEIN1024_672: 0xb3b4,\n SKEIN1024_680: 0xb3b5,\n SKEIN1024_688: 0xb3b6,\n SKEIN1024_696: 0xb3b7,\n SKEIN1024_704: 0xb3b8,\n SKEIN1024_712: 0xb3b9,\n SKEIN1024_720: 0xb3ba,\n SKEIN1024_728: 0xb3bb,\n SKEIN1024_736: 0xb3bc,\n SKEIN1024_744: 0xb3bd,\n SKEIN1024_752: 0xb3be,\n SKEIN1024_760: 0xb3bf,\n SKEIN1024_768: 0xb3c0,\n SKEIN1024_776: 0xb3c1,\n SKEIN1024_784: 0xb3c2,\n SKEIN1024_792: 0xb3c3,\n SKEIN1024_800: 0xb3c4,\n SKEIN1024_808: 0xb3c5,\n SKEIN1024_816: 0xb3c6,\n SKEIN1024_824: 0xb3c7,\n SKEIN1024_832: 0xb3c8,\n SKEIN1024_840: 0xb3c9,\n SKEIN1024_848: 0xb3ca,\n SKEIN1024_856: 0xb3cb,\n SKEIN1024_864: 0xb3cc,\n SKEIN1024_872: 0xb3cd,\n SKEIN1024_880: 0xb3ce,\n SKEIN1024_888: 0xb3cf,\n SKEIN1024_896: 0xb3d0,\n SKEIN1024_904: 0xb3d1,\n SKEIN1024_912: 0xb3d2,\n SKEIN1024_920: 0xb3d3,\n SKEIN1024_928: 0xb3d4,\n SKEIN1024_936: 0xb3d5,\n SKEIN1024_944: 0xb3d6,\n SKEIN1024_952: 0xb3d7,\n SKEIN1024_960: 0xb3d8,\n SKEIN1024_968: 0xb3d9,\n SKEIN1024_976: 0xb3da,\n SKEIN1024_984: 0xb3db,\n SKEIN1024_992: 0xb3dc,\n SKEIN1024_1000: 0xb3dd,\n SKEIN1024_1008: 0xb3de,\n SKEIN1024_1016: 0xb3df,\n SKEIN1024_1024: 0xb3e0,\n\n // multiaddr\n IP4: 0x04,\n TCP: 0x06,\n DCCP: 0x21,\n IP6: 0x29,\n IP6ZONE: 0x2a,\n DNS: 0x35,\n DNS4: 0x36,\n DNS6: 0x37,\n DNSADDR: 0x38,\n SCTP: 0x84,\n UDP: 0x0111,\n P2P_WEBRTC_STAR: 0x0113,\n P2P_WEBRTC_DIRECT: 0x0114,\n P2P_STARDUST: 0x0115,\n P2P_CIRCUIT: 0x0122,\n UDT: 0x012d,\n UTP: 0x012e,\n UNIX: 0x0190,\n P2P: 0x01a5,\n IPFS: 0x01a5,\n HTTPS: 0x01bb,\n ONION: 0x01bc,\n ONION3: 0x01bd,\n GARLIC64: 0x01be,\n GARLIC32: 0x01bf,\n QUIC: 0x01cc,\n WS: 0x01dd,\n WSS: 0x01de,\n P2P_WEBSOCKET_STAR: 0x01df,\n HTTP: 0x01e0,\n\n // ipld\n RAW: 0x55,\n DAG_PB: 0x70,\n DAG_CBOR: 0x71,\n LIBP2P_KEY: 0x72,\n GIT_RAW: 0x78,\n TORRENT_INFO: 0x7b,\n TORRENT_FILE: 0x7c,\n LEOFCOIN_BLOCK: 0x81,\n LEOFCOIN_TX: 0x82,\n LEOFCOIN_PR: 0x83,\n ETH_BLOCK: 0x90,\n ETH_BLOCK_LIST: 0x91,\n ETH_TX_TRIE: 0x92,\n ETH_TX: 0x93,\n ETH_TX_RECEIPT_TRIE: 0x94,\n ETH_TX_RECEIPT: 0x95,\n ETH_STATE_TRIE: 0x96,\n ETH_ACCOUNT_SNAPSHOT: 0x97,\n ETH_STORAGE_TRIE: 0x98,\n BITCOIN_BLOCK: 0xb0,\n BITCOIN_TX: 0xb1,\n ZCASH_BLOCK: 0xc0,\n ZCASH_TX: 0xc1,\n STELLAR_BLOCK: 0xd0,\n STELLAR_TX: 0xd1,\n DECRED_BLOCK: 0xe0,\n DECRED_TX: 0xe1,\n DASH_BLOCK: 0xf0,\n DASH_TX: 0xf1,\n SWARM_MANIFEST: 0xfa,\n SWARM_FEED: 0xfb,\n DAG_JSON: 0x0129,\n\n // namespace\n PATH: 0x2f,\n IPLD_NS: 0xe2,\n IPFS_NS: 0xe3,\n SWARM_NS: 0xe4,\n\n // key\n ED25519_PUB: 0xed,\n\n // holochain\n HOLOCHAIN_ADR_V0: 0x807124,\n HOLOCHAIN_ADR_V1: 0x817124,\n HOLOCHAIN_KEY_V0: 0x947124,\n HOLOCHAIN_KEY_V1: 0x957124,\n HOLOCHAIN_SIG_V0: 0xa27124,\n HOLOCHAIN_SIG_V1: 0xa37124\n})\n\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/constants.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/multicodec/src/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Implementation of the multicodec specification.\n *\n * @module multicodec\n * @example\n * const multicodec = require('multicodec')\n *\n * const prefixedProtobuf = multicodec.addPrefix('protobuf', protobufBuffer)\n * // prefixedProtobuf 0x50...\n *\n */\n\n\nconst varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\nconst codecNameToCodeVarint = __webpack_require__(/*! ./varint-table */ \"./node_modules/multicodec/src/varint-table.js\")\nconst codeToCodecName = __webpack_require__(/*! ./name-table */ \"./node_modules/multicodec/src/name-table.js\")\nconst util = __webpack_require__(/*! ./util */ \"./node_modules/multicodec/src/util.js\")\n\nexports = module.exports\n\n/**\n * Prefix a buffer with a multicodec-packed.\n *\n * @param {string|number} multicodecStrOrCode\n * @param {Buffer} data\n * @returns {Buffer}\n */\nexports.addPrefix = (multicodecStrOrCode, data) => {\n let prefix\n\n if (Buffer.isBuffer(multicodecStrOrCode)) {\n prefix = util.varintBufferEncode(multicodecStrOrCode)\n } else {\n if (codecNameToCodeVarint[multicodecStrOrCode]) {\n prefix = codecNameToCodeVarint[multicodecStrOrCode]\n } else {\n throw new Error('multicodec not recognized')\n }\n }\n return Buffer.concat([prefix, data])\n}\n\n/**\n * Decapsulate the multicodec-packed prefix from the data.\n *\n * @param {Buffer} data\n * @returns {Buffer}\n */\nexports.rmPrefix = (data) => {\n varint.decode(data)\n return data.slice(varint.decode.bytes)\n}\n\n/**\n * Get the codec of the prefixed data.\n * @param {Buffer} prefixedData\n * @returns {string}\n */\nexports.getCodec = (prefixedData) => {\n const code = util.varintBufferDecode(prefixedData)\n const codecName = codeToCodecName[code.toString('hex')]\n if (codecName === undefined) {\n throw new Error('Code `0x' + code.toString('hex') + '` not found')\n }\n return codecName\n}\n\n/**\n * Get the name of the codec.\n * @param {number} codec\n * @returns {string}\n */\nexports.getName = (codec) => {\n return codeToCodecName[codec.toString(16)]\n}\n\n/**\n * Get the code of the codec\n * @param {string} name\n * @returns {number}\n */\nexports.getNumber = (name) => {\n const code = codecNameToCodeVarint[name]\n if (code === undefined) {\n throw new Error('Codec `' + name + '` not found')\n }\n return util.varintBufferDecode(code)[0]\n}\n\n/**\n * Get the code of the prefixed data.\n * @param {Buffer} prefixedData\n * @returns {number}\n */\nexports.getCode = (prefixedData) => {\n return varint.decode(prefixedData)\n}\n\n/**\n * Get the code as varint of a codec name.\n * @param {string} codecName\n * @returns {Buffer}\n */\nexports.getCodeVarint = (codecName) => {\n const code = codecNameToCodeVarint[codecName]\n if (code === undefined) {\n throw new Error('Codec `' + codecName + '` not found')\n }\n return code\n}\n\n/**\n * Get the varint of a code.\n * @param {Number} code\n * @returns {Array.<number>}\n */\nexports.getVarint = (code) => {\n return varint.encode(code)\n}\n\n// Make the constants top-level constants\nconst constants = __webpack_require__(/*! ./constants */ \"./node_modules/multicodec/src/constants.js\")\nObject.assign(exports, constants)\n\n// Human friendly names for printing, e.g. in error messages\nexports.print = __webpack_require__(/*! ./print */ \"./node_modules/multicodec/src/print.js\")\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/name-table.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/multicodec/src/name-table.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nconst baseTable = __webpack_require__(/*! ./base-table */ \"./node_modules/multicodec/src/base-table.js\")\n\n// this creates a map for code as hexString -> codecName\n\nconst nameTable = {}\nmodule.exports = nameTable\n\nfor (let encodingName in baseTable) {\n let code = baseTable[encodingName]\n nameTable[code.toString('hex')] = encodingName\n}\n\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/name-table.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/print.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/multicodec/src/print.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// THIS FILE IS GENERATED, DO NO EDIT MANUALLY\n// For more information see the README.md\n/* eslint-disable dot-notation */\n\nmodule.exports = Object.freeze({\n\n // serialization\n 0x50: 'protobuf',\n 0x51: 'cbor',\n 0x60: 'rlp',\n 0x63: 'bencode',\n\n // multiformat\n 0x30: 'multicodec',\n 0x31: 'multihash',\n 0x32: 'multiaddr',\n 0x33: 'multibase',\n\n // multihash\n 0x00: 'identity',\n 0x11: 'sha1',\n 0x12: 'sha2-256',\n 0x13: 'sha2-512',\n 0x14: 'sha3-512',\n 0x15: 'sha3-384',\n 0x16: 'sha3-256',\n 0x17: 'sha3-224',\n 0x18: 'shake-128',\n 0x19: 'shake-256',\n 0x1a: 'keccak-224',\n 0x1b: 'keccak-256',\n 0x1c: 'keccak-384',\n 0x1d: 'keccak-512',\n 0x22: 'murmur3-128',\n 0x23: 'murmur3-32',\n 0x56: 'dbl-sha2-256',\n 0xd4: 'md4',\n 0xd5: 'md5',\n 0xd6: 'bmt',\n 0x1100: 'x11',\n 0xb201: 'blake2b-8',\n 0xb202: 'blake2b-16',\n 0xb203: 'blake2b-24',\n 0xb204: 'blake2b-32',\n 0xb205: 'blake2b-40',\n 0xb206: 'blake2b-48',\n 0xb207: 'blake2b-56',\n 0xb208: 'blake2b-64',\n 0xb209: 'blake2b-72',\n 0xb20a: 'blake2b-80',\n 0xb20b: 'blake2b-88',\n 0xb20c: 'blake2b-96',\n 0xb20d: 'blake2b-104',\n 0xb20e: 'blake2b-112',\n 0xb20f: 'blake2b-120',\n 0xb210: 'blake2b-128',\n 0xb211: 'blake2b-136',\n 0xb212: 'blake2b-144',\n 0xb213: 'blake2b-152',\n 0xb214: 'blake2b-160',\n 0xb215: 'blake2b-168',\n 0xb216: 'blake2b-176',\n 0xb217: 'blake2b-184',\n 0xb218: 'blake2b-192',\n 0xb219: 'blake2b-200',\n 0xb21a: 'blake2b-208',\n 0xb21b: 'blake2b-216',\n 0xb21c: 'blake2b-224',\n 0xb21d: 'blake2b-232',\n 0xb21e: 'blake2b-240',\n 0xb21f: 'blake2b-248',\n 0xb220: 'blake2b-256',\n 0xb221: 'blake2b-264',\n 0xb222: 'blake2b-272',\n 0xb223: 'blake2b-280',\n 0xb224: 'blake2b-288',\n 0xb225: 'blake2b-296',\n 0xb226: 'blake2b-304',\n 0xb227: 'blake2b-312',\n 0xb228: 'blake2b-320',\n 0xb229: 'blake2b-328',\n 0xb22a: 'blake2b-336',\n 0xb22b: 'blake2b-344',\n 0xb22c: 'blake2b-352',\n 0xb22d: 'blake2b-360',\n 0xb22e: 'blake2b-368',\n 0xb22f: 'blake2b-376',\n 0xb230: 'blake2b-384',\n 0xb231: 'blake2b-392',\n 0xb232: 'blake2b-400',\n 0xb233: 'blake2b-408',\n 0xb234: 'blake2b-416',\n 0xb235: 'blake2b-424',\n 0xb236: 'blake2b-432',\n 0xb237: 'blake2b-440',\n 0xb238: 'blake2b-448',\n 0xb239: 'blake2b-456',\n 0xb23a: 'blake2b-464',\n 0xb23b: 'blake2b-472',\n 0xb23c: 'blake2b-480',\n 0xb23d: 'blake2b-488',\n 0xb23e: 'blake2b-496',\n 0xb23f: 'blake2b-504',\n 0xb240: 'blake2b-512',\n 0xb241: 'blake2s-8',\n 0xb242: 'blake2s-16',\n 0xb243: 'blake2s-24',\n 0xb244: 'blake2s-32',\n 0xb245: 'blake2s-40',\n 0xb246: 'blake2s-48',\n 0xb247: 'blake2s-56',\n 0xb248: 'blake2s-64',\n 0xb249: 'blake2s-72',\n 0xb24a: 'blake2s-80',\n 0xb24b: 'blake2s-88',\n 0xb24c: 'blake2s-96',\n 0xb24d: 'blake2s-104',\n 0xb24e: 'blake2s-112',\n 0xb24f: 'blake2s-120',\n 0xb250: 'blake2s-128',\n 0xb251: 'blake2s-136',\n 0xb252: 'blake2s-144',\n 0xb253: 'blake2s-152',\n 0xb254: 'blake2s-160',\n 0xb255: 'blake2s-168',\n 0xb256: 'blake2s-176',\n 0xb257: 'blake2s-184',\n 0xb258: 'blake2s-192',\n 0xb259: 'blake2s-200',\n 0xb25a: 'blake2s-208',\n 0xb25b: 'blake2s-216',\n 0xb25c: 'blake2s-224',\n 0xb25d: 'blake2s-232',\n 0xb25e: 'blake2s-240',\n 0xb25f: 'blake2s-248',\n 0xb260: 'blake2s-256',\n 0xb301: 'skein256-8',\n 0xb302: 'skein256-16',\n 0xb303: 'skein256-24',\n 0xb304: 'skein256-32',\n 0xb305: 'skein256-40',\n 0xb306: 'skein256-48',\n 0xb307: 'skein256-56',\n 0xb308: 'skein256-64',\n 0xb309: 'skein256-72',\n 0xb30a: 'skein256-80',\n 0xb30b: 'skein256-88',\n 0xb30c: 'skein256-96',\n 0xb30d: 'skein256-104',\n 0xb30e: 'skein256-112',\n 0xb30f: 'skein256-120',\n 0xb310: 'skein256-128',\n 0xb311: 'skein256-136',\n 0xb312: 'skein256-144',\n 0xb313: 'skein256-152',\n 0xb314: 'skein256-160',\n 0xb315: 'skein256-168',\n 0xb316: 'skein256-176',\n 0xb317: 'skein256-184',\n 0xb318: 'skein256-192',\n 0xb319: 'skein256-200',\n 0xb31a: 'skein256-208',\n 0xb31b: 'skein256-216',\n 0xb31c: 'skein256-224',\n 0xb31d: 'skein256-232',\n 0xb31e: 'skein256-240',\n 0xb31f: 'skein256-248',\n 0xb320: 'skein256-256',\n 0xb321: 'skein512-8',\n 0xb322: 'skein512-16',\n 0xb323: 'skein512-24',\n 0xb324: 'skein512-32',\n 0xb325: 'skein512-40',\n 0xb326: 'skein512-48',\n 0xb327: 'skein512-56',\n 0xb328: 'skein512-64',\n 0xb329: 'skein512-72',\n 0xb32a: 'skein512-80',\n 0xb32b: 'skein512-88',\n 0xb32c: 'skein512-96',\n 0xb32d: 'skein512-104',\n 0xb32e: 'skein512-112',\n 0xb32f: 'skein512-120',\n 0xb330: 'skein512-128',\n 0xb331: 'skein512-136',\n 0xb332: 'skein512-144',\n 0xb333: 'skein512-152',\n 0xb334: 'skein512-160',\n 0xb335: 'skein512-168',\n 0xb336: 'skein512-176',\n 0xb337: 'skein512-184',\n 0xb338: 'skein512-192',\n 0xb339: 'skein512-200',\n 0xb33a: 'skein512-208',\n 0xb33b: 'skein512-216',\n 0xb33c: 'skein512-224',\n 0xb33d: 'skein512-232',\n 0xb33e: 'skein512-240',\n 0xb33f: 'skein512-248',\n 0xb340: 'skein512-256',\n 0xb341: 'skein512-264',\n 0xb342: 'skein512-272',\n 0xb343: 'skein512-280',\n 0xb344: 'skein512-288',\n 0xb345: 'skein512-296',\n 0xb346: 'skein512-304',\n 0xb347: 'skein512-312',\n 0xb348: 'skein512-320',\n 0xb349: 'skein512-328',\n 0xb34a: 'skein512-336',\n 0xb34b: 'skein512-344',\n 0xb34c: 'skein512-352',\n 0xb34d: 'skein512-360',\n 0xb34e: 'skein512-368',\n 0xb34f: 'skein512-376',\n 0xb350: 'skein512-384',\n 0xb351: 'skein512-392',\n 0xb352: 'skein512-400',\n 0xb353: 'skein512-408',\n 0xb354: 'skein512-416',\n 0xb355: 'skein512-424',\n 0xb356: 'skein512-432',\n 0xb357: 'skein512-440',\n 0xb358: 'skein512-448',\n 0xb359: 'skein512-456',\n 0xb35a: 'skein512-464',\n 0xb35b: 'skein512-472',\n 0xb35c: 'skein512-480',\n 0xb35d: 'skein512-488',\n 0xb35e: 'skein512-496',\n 0xb35f: 'skein512-504',\n 0xb360: 'skein512-512',\n 0xb361: 'skein1024-8',\n 0xb362: 'skein1024-16',\n 0xb363: 'skein1024-24',\n 0xb364: 'skein1024-32',\n 0xb365: 'skein1024-40',\n 0xb366: 'skein1024-48',\n 0xb367: 'skein1024-56',\n 0xb368: 'skein1024-64',\n 0xb369: 'skein1024-72',\n 0xb36a: 'skein1024-80',\n 0xb36b: 'skein1024-88',\n 0xb36c: 'skein1024-96',\n 0xb36d: 'skein1024-104',\n 0xb36e: 'skein1024-112',\n 0xb36f: 'skein1024-120',\n 0xb370: 'skein1024-128',\n 0xb371: 'skein1024-136',\n 0xb372: 'skein1024-144',\n 0xb373: 'skein1024-152',\n 0xb374: 'skein1024-160',\n 0xb375: 'skein1024-168',\n 0xb376: 'skein1024-176',\n 0xb377: 'skein1024-184',\n 0xb378: 'skein1024-192',\n 0xb379: 'skein1024-200',\n 0xb37a: 'skein1024-208',\n 0xb37b: 'skein1024-216',\n 0xb37c: 'skein1024-224',\n 0xb37d: 'skein1024-232',\n 0xb37e: 'skein1024-240',\n 0xb37f: 'skein1024-248',\n 0xb380: 'skein1024-256',\n 0xb381: 'skein1024-264',\n 0xb382: 'skein1024-272',\n 0xb383: 'skein1024-280',\n 0xb384: 'skein1024-288',\n 0xb385: 'skein1024-296',\n 0xb386: 'skein1024-304',\n 0xb387: 'skein1024-312',\n 0xb388: 'skein1024-320',\n 0xb389: 'skein1024-328',\n 0xb38a: 'skein1024-336',\n 0xb38b: 'skein1024-344',\n 0xb38c: 'skein1024-352',\n 0xb38d: 'skein1024-360',\n 0xb38e: 'skein1024-368',\n 0xb38f: 'skein1024-376',\n 0xb390: 'skein1024-384',\n 0xb391: 'skein1024-392',\n 0xb392: 'skein1024-400',\n 0xb393: 'skein1024-408',\n 0xb394: 'skein1024-416',\n 0xb395: 'skein1024-424',\n 0xb396: 'skein1024-432',\n 0xb397: 'skein1024-440',\n 0xb398: 'skein1024-448',\n 0xb399: 'skein1024-456',\n 0xb39a: 'skein1024-464',\n 0xb39b: 'skein1024-472',\n 0xb39c: 'skein1024-480',\n 0xb39d: 'skein1024-488',\n 0xb39e: 'skein1024-496',\n 0xb39f: 'skein1024-504',\n 0xb3a0: 'skein1024-512',\n 0xb3a1: 'skein1024-520',\n 0xb3a2: 'skein1024-528',\n 0xb3a3: 'skein1024-536',\n 0xb3a4: 'skein1024-544',\n 0xb3a5: 'skein1024-552',\n 0xb3a6: 'skein1024-560',\n 0xb3a7: 'skein1024-568',\n 0xb3a8: 'skein1024-576',\n 0xb3a9: 'skein1024-584',\n 0xb3aa: 'skein1024-592',\n 0xb3ab: 'skein1024-600',\n 0xb3ac: 'skein1024-608',\n 0xb3ad: 'skein1024-616',\n 0xb3ae: 'skein1024-624',\n 0xb3af: 'skein1024-632',\n 0xb3b0: 'skein1024-640',\n 0xb3b1: 'skein1024-648',\n 0xb3b2: 'skein1024-656',\n 0xb3b3: 'skein1024-664',\n 0xb3b4: 'skein1024-672',\n 0xb3b5: 'skein1024-680',\n 0xb3b6: 'skein1024-688',\n 0xb3b7: 'skein1024-696',\n 0xb3b8: 'skein1024-704',\n 0xb3b9: 'skein1024-712',\n 0xb3ba: 'skein1024-720',\n 0xb3bb: 'skein1024-728',\n 0xb3bc: 'skein1024-736',\n 0xb3bd: 'skein1024-744',\n 0xb3be: 'skein1024-752',\n 0xb3bf: 'skein1024-760',\n 0xb3c0: 'skein1024-768',\n 0xb3c1: 'skein1024-776',\n 0xb3c2: 'skein1024-784',\n 0xb3c3: 'skein1024-792',\n 0xb3c4: 'skein1024-800',\n 0xb3c5: 'skein1024-808',\n 0xb3c6: 'skein1024-816',\n 0xb3c7: 'skein1024-824',\n 0xb3c8: 'skein1024-832',\n 0xb3c9: 'skein1024-840',\n 0xb3ca: 'skein1024-848',\n 0xb3cb: 'skein1024-856',\n 0xb3cc: 'skein1024-864',\n 0xb3cd: 'skein1024-872',\n 0xb3ce: 'skein1024-880',\n 0xb3cf: 'skein1024-888',\n 0xb3d0: 'skein1024-896',\n 0xb3d1: 'skein1024-904',\n 0xb3d2: 'skein1024-912',\n 0xb3d3: 'skein1024-920',\n 0xb3d4: 'skein1024-928',\n 0xb3d5: 'skein1024-936',\n 0xb3d6: 'skein1024-944',\n 0xb3d7: 'skein1024-952',\n 0xb3d8: 'skein1024-960',\n 0xb3d9: 'skein1024-968',\n 0xb3da: 'skein1024-976',\n 0xb3db: 'skein1024-984',\n 0xb3dc: 'skein1024-992',\n 0xb3dd: 'skein1024-1000',\n 0xb3de: 'skein1024-1008',\n 0xb3df: 'skein1024-1016',\n 0xb3e0: 'skein1024-1024',\n\n // multiaddr\n 0x04: 'ip4',\n 0x06: 'tcp',\n 0x21: 'dccp',\n 0x29: 'ip6',\n 0x2a: 'ip6zone',\n 0x35: 'dns',\n 0x36: 'dns4',\n 0x37: 'dns6',\n 0x38: 'dnsaddr',\n 0x84: 'sctp',\n 0x0111: 'udp',\n 0x0113: 'p2p-webrtc-star',\n 0x0114: 'p2p-webrtc-direct',\n 0x0115: 'p2p-stardust',\n 0x0122: 'p2p-circuit',\n 0x012d: 'udt',\n 0x012e: 'utp',\n 0x0190: 'unix',\n 0x01a5: 'p2p',\n 0x01bb: 'https',\n 0x01bc: 'onion',\n 0x01bd: 'onion3',\n 0x01be: 'garlic64',\n 0x01bf: 'garlic32',\n 0x01cc: 'quic',\n 0x01dd: 'ws',\n 0x01de: 'wss',\n 0x01df: 'p2p-websocket-star',\n 0x01e0: 'http',\n\n // ipld\n 0x55: 'raw',\n 0x70: 'dag-pb',\n 0x71: 'dag-cbor',\n 0x72: 'libp2p-key',\n 0x78: 'git-raw',\n 0x7b: 'torrent-info',\n 0x7c: 'torrent-file',\n 0x81: 'leofcoin-block',\n 0x82: 'leofcoin-tx',\n 0x83: 'leofcoin-pr',\n 0x90: 'eth-block',\n 0x91: 'eth-block-list',\n 0x92: 'eth-tx-trie',\n 0x93: 'eth-tx',\n 0x94: 'eth-tx-receipt-trie',\n 0x95: 'eth-tx-receipt',\n 0x96: 'eth-state-trie',\n 0x97: 'eth-account-snapshot',\n 0x98: 'eth-storage-trie',\n 0xb0: 'bitcoin-block',\n 0xb1: 'bitcoin-tx',\n 0xc0: 'zcash-block',\n 0xc1: 'zcash-tx',\n 0xd0: 'stellar-block',\n 0xd1: 'stellar-tx',\n 0xe0: 'decred-block',\n 0xe1: 'decred-tx',\n 0xf0: 'dash-block',\n 0xf1: 'dash-tx',\n 0xfa: 'swarm-manifest',\n 0xfb: 'swarm-feed',\n 0x0129: 'dag-json',\n\n // namespace\n 0x2f: 'path',\n 0xe2: 'ipld-ns',\n 0xe3: 'ipfs-ns',\n 0xe4: 'swarm-ns',\n\n // key\n 0xed: 'ed25519-pub',\n\n // holochain\n 0x807124: 'holochain-adr-v0',\n 0x817124: 'holochain-adr-v1',\n 0x947124: 'holochain-key-v0',\n 0x957124: 'holochain-key-v1',\n 0xa27124: 'holochain-sig-v0',\n 0xa37124: 'holochain-sig-v1'\n})\n\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/print.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/util.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/multicodec/src/util.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nconst varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\nmodule.exports = {\n numberToBuffer,\n bufferToNumber,\n varintBufferEncode,\n varintBufferDecode\n}\n\nfunction bufferToNumber (buf) {\n return parseInt(buf.toString('hex'), 16)\n}\n\nfunction numberToBuffer (num) {\n let hexString = num.toString(16)\n if (hexString.length % 2 === 1) {\n hexString = '0' + hexString\n }\n return Buffer.from(hexString, 'hex')\n}\n\nfunction varintBufferEncode (input) {\n return Buffer.from(varint.encode(bufferToNumber(input)))\n}\n\nfunction varintBufferDecode (input) {\n return numberToBuffer(varint.decode(input))\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multicodec/src/varint-table.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/multicodec/src/varint-table.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nconst baseTable = __webpack_require__(/*! ./base-table */ \"./node_modules/multicodec/src/base-table.js\")\nconst varintBufferEncode = __webpack_require__(/*! ./util */ \"./node_modules/multicodec/src/util.js\").varintBufferEncode\n\n// this creates a map for codecName -> codeVarintBuffer\n\nconst varintTable = {}\nmodule.exports = varintTable\n\nfor (let encodingName in baseTable) {\n let code = baseTable[encodingName]\n varintTable[encodingName] = varintBufferEncode(code)\n}\n\n\n//# sourceURL=webpack:///./node_modules/multicodec/src/varint-table.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashes/src/constants.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/multihashes/src/constants.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* eslint quote-props: off */\n/* eslint key-spacing: off */\n\n\nexports.names = Object.freeze({\n 'id': 0x0,\n 'sha1': 0x11,\n 'sha2-256': 0x12,\n 'sha2-512': 0x13,\n 'dbl-sha2-256': 0x56,\n 'sha3-224': 0x17,\n 'sha3-256': 0x16,\n 'sha3-384': 0x15,\n 'sha3-512': 0x14,\n 'shake-128': 0x18,\n 'shake-256': 0x19,\n 'keccak-224': 0x1A,\n 'keccak-256': 0x1B,\n 'keccak-384': 0x1C,\n 'keccak-512': 0x1D,\n 'murmur3-128': 0x22,\n 'murmur3-32': 0x23,\n 'blake2b-8': 0xb201,\n 'blake2b-16': 0xb202,\n 'blake2b-24': 0xb203,\n 'blake2b-32': 0xb204,\n 'blake2b-40': 0xb205,\n 'blake2b-48': 0xb206,\n 'blake2b-56': 0xb207,\n 'blake2b-64': 0xb208,\n 'blake2b-72': 0xb209,\n 'blake2b-80': 0xb20a,\n 'blake2b-88': 0xb20b,\n 'blake2b-96': 0xb20c,\n 'blake2b-104': 0xb20d,\n 'blake2b-112': 0xb20e,\n 'blake2b-120': 0xb20f,\n 'blake2b-128': 0xb210,\n 'blake2b-136': 0xb211,\n 'blake2b-144': 0xb212,\n 'blake2b-152': 0xb213,\n 'blake2b-160': 0xb214,\n 'blake2b-168': 0xb215,\n 'blake2b-176': 0xb216,\n 'blake2b-184': 0xb217,\n 'blake2b-192': 0xb218,\n 'blake2b-200': 0xb219,\n 'blake2b-208': 0xb21a,\n 'blake2b-216': 0xb21b,\n 'blake2b-224': 0xb21c,\n 'blake2b-232': 0xb21d,\n 'blake2b-240': 0xb21e,\n 'blake2b-248': 0xb21f,\n 'blake2b-256': 0xb220,\n 'blake2b-264': 0xb221,\n 'blake2b-272': 0xb222,\n 'blake2b-280': 0xb223,\n 'blake2b-288': 0xb224,\n 'blake2b-296': 0xb225,\n 'blake2b-304': 0xb226,\n 'blake2b-312': 0xb227,\n 'blake2b-320': 0xb228,\n 'blake2b-328': 0xb229,\n 'blake2b-336': 0xb22a,\n 'blake2b-344': 0xb22b,\n 'blake2b-352': 0xb22c,\n 'blake2b-360': 0xb22d,\n 'blake2b-368': 0xb22e,\n 'blake2b-376': 0xb22f,\n 'blake2b-384': 0xb230,\n 'blake2b-392': 0xb231,\n 'blake2b-400': 0xb232,\n 'blake2b-408': 0xb233,\n 'blake2b-416': 0xb234,\n 'blake2b-424': 0xb235,\n 'blake2b-432': 0xb236,\n 'blake2b-440': 0xb237,\n 'blake2b-448': 0xb238,\n 'blake2b-456': 0xb239,\n 'blake2b-464': 0xb23a,\n 'blake2b-472': 0xb23b,\n 'blake2b-480': 0xb23c,\n 'blake2b-488': 0xb23d,\n 'blake2b-496': 0xb23e,\n 'blake2b-504': 0xb23f,\n 'blake2b-512': 0xb240,\n 'blake2s-8': 0xb241,\n 'blake2s-16': 0xb242,\n 'blake2s-24': 0xb243,\n 'blake2s-32': 0xb244,\n 'blake2s-40': 0xb245,\n 'blake2s-48': 0xb246,\n 'blake2s-56': 0xb247,\n 'blake2s-64': 0xb248,\n 'blake2s-72': 0xb249,\n 'blake2s-80': 0xb24a,\n 'blake2s-88': 0xb24b,\n 'blake2s-96': 0xb24c,\n 'blake2s-104': 0xb24d,\n 'blake2s-112': 0xb24e,\n 'blake2s-120': 0xb24f,\n 'blake2s-128': 0xb250,\n 'blake2s-136': 0xb251,\n 'blake2s-144': 0xb252,\n 'blake2s-152': 0xb253,\n 'blake2s-160': 0xb254,\n 'blake2s-168': 0xb255,\n 'blake2s-176': 0xb256,\n 'blake2s-184': 0xb257,\n 'blake2s-192': 0xb258,\n 'blake2s-200': 0xb259,\n 'blake2s-208': 0xb25a,\n 'blake2s-216': 0xb25b,\n 'blake2s-224': 0xb25c,\n 'blake2s-232': 0xb25d,\n 'blake2s-240': 0xb25e,\n 'blake2s-248': 0xb25f,\n 'blake2s-256': 0xb260,\n 'Skein256-8': 0xb301,\n 'Skein256-16': 0xb302,\n 'Skein256-24': 0xb303,\n 'Skein256-32': 0xb304,\n 'Skein256-40': 0xb305,\n 'Skein256-48': 0xb306,\n 'Skein256-56': 0xb307,\n 'Skein256-64': 0xb308,\n 'Skein256-72': 0xb309,\n 'Skein256-80': 0xb30a,\n 'Skein256-88': 0xb30b,\n 'Skein256-96': 0xb30c,\n 'Skein256-104': 0xb30d,\n 'Skein256-112': 0xb30e,\n 'Skein256-120': 0xb30f,\n 'Skein256-128': 0xb310,\n 'Skein256-136': 0xb311,\n 'Skein256-144': 0xb312,\n 'Skein256-152': 0xb313,\n 'Skein256-160': 0xb314,\n 'Skein256-168': 0xb315,\n 'Skein256-176': 0xb316,\n 'Skein256-184': 0xb317,\n 'Skein256-192': 0xb318,\n 'Skein256-200': 0xb319,\n 'Skein256-208': 0xb31a,\n 'Skein256-216': 0xb31b,\n 'Skein256-224': 0xb31c,\n 'Skein256-232': 0xb31d,\n 'Skein256-240': 0xb31e,\n 'Skein256-248': 0xb31f,\n 'Skein256-256': 0xb320,\n 'Skein512-8': 0xb321,\n 'Skein512-16': 0xb322,\n 'Skein512-24': 0xb323,\n 'Skein512-32': 0xb324,\n 'Skein512-40': 0xb325,\n 'Skein512-48': 0xb326,\n 'Skein512-56': 0xb327,\n 'Skein512-64': 0xb328,\n 'Skein512-72': 0xb329,\n 'Skein512-80': 0xb32a,\n 'Skein512-88': 0xb32b,\n 'Skein512-96': 0xb32c,\n 'Skein512-104': 0xb32d,\n 'Skein512-112': 0xb32e,\n 'Skein512-120': 0xb32f,\n 'Skein512-128': 0xb330,\n 'Skein512-136': 0xb331,\n 'Skein512-144': 0xb332,\n 'Skein512-152': 0xb333,\n 'Skein512-160': 0xb334,\n 'Skein512-168': 0xb335,\n 'Skein512-176': 0xb336,\n 'Skein512-184': 0xb337,\n 'Skein512-192': 0xb338,\n 'Skein512-200': 0xb339,\n 'Skein512-208': 0xb33a,\n 'Skein512-216': 0xb33b,\n 'Skein512-224': 0xb33c,\n 'Skein512-232': 0xb33d,\n 'Skein512-240': 0xb33e,\n 'Skein512-248': 0xb33f,\n 'Skein512-256': 0xb340,\n 'Skein512-264': 0xb341,\n 'Skein512-272': 0xb342,\n 'Skein512-280': 0xb343,\n 'Skein512-288': 0xb344,\n 'Skein512-296': 0xb345,\n 'Skein512-304': 0xb346,\n 'Skein512-312': 0xb347,\n 'Skein512-320': 0xb348,\n 'Skein512-328': 0xb349,\n 'Skein512-336': 0xb34a,\n 'Skein512-344': 0xb34b,\n 'Skein512-352': 0xb34c,\n 'Skein512-360': 0xb34d,\n 'Skein512-368': 0xb34e,\n 'Skein512-376': 0xb34f,\n 'Skein512-384': 0xb350,\n 'Skein512-392': 0xb351,\n 'Skein512-400': 0xb352,\n 'Skein512-408': 0xb353,\n 'Skein512-416': 0xb354,\n 'Skein512-424': 0xb355,\n 'Skein512-432': 0xb356,\n 'Skein512-440': 0xb357,\n 'Skein512-448': 0xb358,\n 'Skein512-456': 0xb359,\n 'Skein512-464': 0xb35a,\n 'Skein512-472': 0xb35b,\n 'Skein512-480': 0xb35c,\n 'Skein512-488': 0xb35d,\n 'Skein512-496': 0xb35e,\n 'Skein512-504': 0xb35f,\n 'Skein512-512': 0xb360,\n 'Skein1024-8': 0xb361,\n 'Skein1024-16': 0xb362,\n 'Skein1024-24': 0xb363,\n 'Skein1024-32': 0xb364,\n 'Skein1024-40': 0xb365,\n 'Skein1024-48': 0xb366,\n 'Skein1024-56': 0xb367,\n 'Skein1024-64': 0xb368,\n 'Skein1024-72': 0xb369,\n 'Skein1024-80': 0xb36a,\n 'Skein1024-88': 0xb36b,\n 'Skein1024-96': 0xb36c,\n 'Skein1024-104': 0xb36d,\n 'Skein1024-112': 0xb36e,\n 'Skein1024-120': 0xb36f,\n 'Skein1024-128': 0xb370,\n 'Skein1024-136': 0xb371,\n 'Skein1024-144': 0xb372,\n 'Skein1024-152': 0xb373,\n 'Skein1024-160': 0xb374,\n 'Skein1024-168': 0xb375,\n 'Skein1024-176': 0xb376,\n 'Skein1024-184': 0xb377,\n 'Skein1024-192': 0xb378,\n 'Skein1024-200': 0xb379,\n 'Skein1024-208': 0xb37a,\n 'Skein1024-216': 0xb37b,\n 'Skein1024-224': 0xb37c,\n 'Skein1024-232': 0xb37d,\n 'Skein1024-240': 0xb37e,\n 'Skein1024-248': 0xb37f,\n 'Skein1024-256': 0xb380,\n 'Skein1024-264': 0xb381,\n 'Skein1024-272': 0xb382,\n 'Skein1024-280': 0xb383,\n 'Skein1024-288': 0xb384,\n 'Skein1024-296': 0xb385,\n 'Skein1024-304': 0xb386,\n 'Skein1024-312': 0xb387,\n 'Skein1024-320': 0xb388,\n 'Skein1024-328': 0xb389,\n 'Skein1024-336': 0xb38a,\n 'Skein1024-344': 0xb38b,\n 'Skein1024-352': 0xb38c,\n 'Skein1024-360': 0xb38d,\n 'Skein1024-368': 0xb38e,\n 'Skein1024-376': 0xb38f,\n 'Skein1024-384': 0xb390,\n 'Skein1024-392': 0xb391,\n 'Skein1024-400': 0xb392,\n 'Skein1024-408': 0xb393,\n 'Skein1024-416': 0xb394,\n 'Skein1024-424': 0xb395,\n 'Skein1024-432': 0xb396,\n 'Skein1024-440': 0xb397,\n 'Skein1024-448': 0xb398,\n 'Skein1024-456': 0xb399,\n 'Skein1024-464': 0xb39a,\n 'Skein1024-472': 0xb39b,\n 'Skein1024-480': 0xb39c,\n 'Skein1024-488': 0xb39d,\n 'Skein1024-496': 0xb39e,\n 'Skein1024-504': 0xb39f,\n 'Skein1024-512': 0xb3a0,\n 'Skein1024-520': 0xb3a1,\n 'Skein1024-528': 0xb3a2,\n 'Skein1024-536': 0xb3a3,\n 'Skein1024-544': 0xb3a4,\n 'Skein1024-552': 0xb3a5,\n 'Skein1024-560': 0xb3a6,\n 'Skein1024-568': 0xb3a7,\n 'Skein1024-576': 0xb3a8,\n 'Skein1024-584': 0xb3a9,\n 'Skein1024-592': 0xb3aa,\n 'Skein1024-600': 0xb3ab,\n 'Skein1024-608': 0xb3ac,\n 'Skein1024-616': 0xb3ad,\n 'Skein1024-624': 0xb3ae,\n 'Skein1024-632': 0xb3af,\n 'Skein1024-640': 0xb3b0,\n 'Skein1024-648': 0xb3b1,\n 'Skein1024-656': 0xb3b2,\n 'Skein1024-664': 0xb3b3,\n 'Skein1024-672': 0xb3b4,\n 'Skein1024-680': 0xb3b5,\n 'Skein1024-688': 0xb3b6,\n 'Skein1024-696': 0xb3b7,\n 'Skein1024-704': 0xb3b8,\n 'Skein1024-712': 0xb3b9,\n 'Skein1024-720': 0xb3ba,\n 'Skein1024-728': 0xb3bb,\n 'Skein1024-736': 0xb3bc,\n 'Skein1024-744': 0xb3bd,\n 'Skein1024-752': 0xb3be,\n 'Skein1024-760': 0xb3bf,\n 'Skein1024-768': 0xb3c0,\n 'Skein1024-776': 0xb3c1,\n 'Skein1024-784': 0xb3c2,\n 'Skein1024-792': 0xb3c3,\n 'Skein1024-800': 0xb3c4,\n 'Skein1024-808': 0xb3c5,\n 'Skein1024-816': 0xb3c6,\n 'Skein1024-824': 0xb3c7,\n 'Skein1024-832': 0xb3c8,\n 'Skein1024-840': 0xb3c9,\n 'Skein1024-848': 0xb3ca,\n 'Skein1024-856': 0xb3cb,\n 'Skein1024-864': 0xb3cc,\n 'Skein1024-872': 0xb3cd,\n 'Skein1024-880': 0xb3ce,\n 'Skein1024-888': 0xb3cf,\n 'Skein1024-896': 0xb3d0,\n 'Skein1024-904': 0xb3d1,\n 'Skein1024-912': 0xb3d2,\n 'Skein1024-920': 0xb3d3,\n 'Skein1024-928': 0xb3d4,\n 'Skein1024-936': 0xb3d5,\n 'Skein1024-944': 0xb3d6,\n 'Skein1024-952': 0xb3d7,\n 'Skein1024-960': 0xb3d8,\n 'Skein1024-968': 0xb3d9,\n 'Skein1024-976': 0xb3da,\n 'Skein1024-984': 0xb3db,\n 'Skein1024-992': 0xb3dc,\n 'Skein1024-1000': 0xb3dd,\n 'Skein1024-1008': 0xb3de,\n 'Skein1024-1016': 0xb3df,\n 'Skein1024-1024': 0xb3e0\n})\n\nexports.codes = Object.freeze({\n 0x11: 'sha1',\n 0x12: 'sha2-256',\n 0x13: 'sha2-512',\n 0x56: 'dbl-sha2-256',\n 0x17: 'sha3-224',\n 0x16: 'sha3-256',\n 0x15: 'sha3-384',\n 0x14: 'sha3-512',\n 0x18: 'shake-128',\n 0x19: 'shake-256',\n 0x1A: 'keccak-224',\n 0x1B: 'keccak-256',\n 0x1C: 'keccak-384',\n 0x1D: 'keccak-512',\n 0x22: 'murmur3-128',\n 0x23: 'murmur3-32',\n\n // blake2\n 0xb201: 'blake2b-8',\n 0xb202: 'blake2b-16',\n 0xb203: 'blake2b-24',\n 0xb204: 'blake2b-32',\n 0xb205: 'blake2b-40',\n 0xb206: 'blake2b-48',\n 0xb207: 'blake2b-56',\n 0xb208: 'blake2b-64',\n 0xb209: 'blake2b-72',\n 0xb20a: 'blake2b-80',\n 0xb20b: 'blake2b-88',\n 0xb20c: 'blake2b-96',\n 0xb20d: 'blake2b-104',\n 0xb20e: 'blake2b-112',\n 0xb20f: 'blake2b-120',\n 0xb210: 'blake2b-128',\n 0xb211: 'blake2b-136',\n 0xb212: 'blake2b-144',\n 0xb213: 'blake2b-152',\n 0xb214: 'blake2b-160',\n 0xb215: 'blake2b-168',\n 0xb216: 'blake2b-176',\n 0xb217: 'blake2b-184',\n 0xb218: 'blake2b-192',\n 0xb219: 'blake2b-200',\n 0xb21a: 'blake2b-208',\n 0xb21b: 'blake2b-216',\n 0xb21c: 'blake2b-224',\n 0xb21d: 'blake2b-232',\n 0xb21e: 'blake2b-240',\n 0xb21f: 'blake2b-248',\n 0xb220: 'blake2b-256',\n 0xb221: 'blake2b-264',\n 0xb222: 'blake2b-272',\n 0xb223: 'blake2b-280',\n 0xb224: 'blake2b-288',\n 0xb225: 'blake2b-296',\n 0xb226: 'blake2b-304',\n 0xb227: 'blake2b-312',\n 0xb228: 'blake2b-320',\n 0xb229: 'blake2b-328',\n 0xb22a: 'blake2b-336',\n 0xb22b: 'blake2b-344',\n 0xb22c: 'blake2b-352',\n 0xb22d: 'blake2b-360',\n 0xb22e: 'blake2b-368',\n 0xb22f: 'blake2b-376',\n 0xb230: 'blake2b-384',\n 0xb231: 'blake2b-392',\n 0xb232: 'blake2b-400',\n 0xb233: 'blake2b-408',\n 0xb234: 'blake2b-416',\n 0xb235: 'blake2b-424',\n 0xb236: 'blake2b-432',\n 0xb237: 'blake2b-440',\n 0xb238: 'blake2b-448',\n 0xb239: 'blake2b-456',\n 0xb23a: 'blake2b-464',\n 0xb23b: 'blake2b-472',\n 0xb23c: 'blake2b-480',\n 0xb23d: 'blake2b-488',\n 0xb23e: 'blake2b-496',\n 0xb23f: 'blake2b-504',\n 0xb240: 'blake2b-512',\n 0xb241: 'blake2s-8',\n 0xb242: 'blake2s-16',\n 0xb243: 'blake2s-24',\n 0xb244: 'blake2s-32',\n 0xb245: 'blake2s-40',\n 0xb246: 'blake2s-48',\n 0xb247: 'blake2s-56',\n 0xb248: 'blake2s-64',\n 0xb249: 'blake2s-72',\n 0xb24a: 'blake2s-80',\n 0xb24b: 'blake2s-88',\n 0xb24c: 'blake2s-96',\n 0xb24d: 'blake2s-104',\n 0xb24e: 'blake2s-112',\n 0xb24f: 'blake2s-120',\n 0xb250: 'blake2s-128',\n 0xb251: 'blake2s-136',\n 0xb252: 'blake2s-144',\n 0xb253: 'blake2s-152',\n 0xb254: 'blake2s-160',\n 0xb255: 'blake2s-168',\n 0xb256: 'blake2s-176',\n 0xb257: 'blake2s-184',\n 0xb258: 'blake2s-192',\n 0xb259: 'blake2s-200',\n 0xb25a: 'blake2s-208',\n 0xb25b: 'blake2s-216',\n 0xb25c: 'blake2s-224',\n 0xb25d: 'blake2s-232',\n 0xb25e: 'blake2s-240',\n 0xb25f: 'blake2s-248',\n 0xb260: 'blake2s-256',\n\n // skein\n 0xb301: 'Skein256-8',\n 0xb302: 'Skein256-16',\n 0xb303: 'Skein256-24',\n 0xb304: 'Skein256-32',\n 0xb305: 'Skein256-40',\n 0xb306: 'Skein256-48',\n 0xb307: 'Skein256-56',\n 0xb308: 'Skein256-64',\n 0xb309: 'Skein256-72',\n 0xb30a: 'Skein256-80',\n 0xb30b: 'Skein256-88',\n 0xb30c: 'Skein256-96',\n 0xb30d: 'Skein256-104',\n 0xb30e: 'Skein256-112',\n 0xb30f: 'Skein256-120',\n 0xb310: 'Skein256-128',\n 0xb311: 'Skein256-136',\n 0xb312: 'Skein256-144',\n 0xb313: 'Skein256-152',\n 0xb314: 'Skein256-160',\n 0xb315: 'Skein256-168',\n 0xb316: 'Skein256-176',\n 0xb317: 'Skein256-184',\n 0xb318: 'Skein256-192',\n 0xb319: 'Skein256-200',\n 0xb31a: 'Skein256-208',\n 0xb31b: 'Skein256-216',\n 0xb31c: 'Skein256-224',\n 0xb31d: 'Skein256-232',\n 0xb31e: 'Skein256-240',\n 0xb31f: 'Skein256-248',\n 0xb320: 'Skein256-256',\n 0xb321: 'Skein512-8',\n 0xb322: 'Skein512-16',\n 0xb323: 'Skein512-24',\n 0xb324: 'Skein512-32',\n 0xb325: 'Skein512-40',\n 0xb326: 'Skein512-48',\n 0xb327: 'Skein512-56',\n 0xb328: 'Skein512-64',\n 0xb329: 'Skein512-72',\n 0xb32a: 'Skein512-80',\n 0xb32b: 'Skein512-88',\n 0xb32c: 'Skein512-96',\n 0xb32d: 'Skein512-104',\n 0xb32e: 'Skein512-112',\n 0xb32f: 'Skein512-120',\n 0xb330: 'Skein512-128',\n 0xb331: 'Skein512-136',\n 0xb332: 'Skein512-144',\n 0xb333: 'Skein512-152',\n 0xb334: 'Skein512-160',\n 0xb335: 'Skein512-168',\n 0xb336: 'Skein512-176',\n 0xb337: 'Skein512-184',\n 0xb338: 'Skein512-192',\n 0xb339: 'Skein512-200',\n 0xb33a: 'Skein512-208',\n 0xb33b: 'Skein512-216',\n 0xb33c: 'Skein512-224',\n 0xb33d: 'Skein512-232',\n 0xb33e: 'Skein512-240',\n 0xb33f: 'Skein512-248',\n 0xb340: 'Skein512-256',\n 0xb341: 'Skein512-264',\n 0xb342: 'Skein512-272',\n 0xb343: 'Skein512-280',\n 0xb344: 'Skein512-288',\n 0xb345: 'Skein512-296',\n 0xb346: 'Skein512-304',\n 0xb347: 'Skein512-312',\n 0xb348: 'Skein512-320',\n 0xb349: 'Skein512-328',\n 0xb34a: 'Skein512-336',\n 0xb34b: 'Skein512-344',\n 0xb34c: 'Skein512-352',\n 0xb34d: 'Skein512-360',\n 0xb34e: 'Skein512-368',\n 0xb34f: 'Skein512-376',\n 0xb350: 'Skein512-384',\n 0xb351: 'Skein512-392',\n 0xb352: 'Skein512-400',\n 0xb353: 'Skein512-408',\n 0xb354: 'Skein512-416',\n 0xb355: 'Skein512-424',\n 0xb356: 'Skein512-432',\n 0xb357: 'Skein512-440',\n 0xb358: 'Skein512-448',\n 0xb359: 'Skein512-456',\n 0xb35a: 'Skein512-464',\n 0xb35b: 'Skein512-472',\n 0xb35c: 'Skein512-480',\n 0xb35d: 'Skein512-488',\n 0xb35e: 'Skein512-496',\n 0xb35f: 'Skein512-504',\n 0xb360: 'Skein512-512',\n 0xb361: 'Skein1024-8',\n 0xb362: 'Skein1024-16',\n 0xb363: 'Skein1024-24',\n 0xb364: 'Skein1024-32',\n 0xb365: 'Skein1024-40',\n 0xb366: 'Skein1024-48',\n 0xb367: 'Skein1024-56',\n 0xb368: 'Skein1024-64',\n 0xb369: 'Skein1024-72',\n 0xb36a: 'Skein1024-80',\n 0xb36b: 'Skein1024-88',\n 0xb36c: 'Skein1024-96',\n 0xb36d: 'Skein1024-104',\n 0xb36e: 'Skein1024-112',\n 0xb36f: 'Skein1024-120',\n 0xb370: 'Skein1024-128',\n 0xb371: 'Skein1024-136',\n 0xb372: 'Skein1024-144',\n 0xb373: 'Skein1024-152',\n 0xb374: 'Skein1024-160',\n 0xb375: 'Skein1024-168',\n 0xb376: 'Skein1024-176',\n 0xb377: 'Skein1024-184',\n 0xb378: 'Skein1024-192',\n 0xb379: 'Skein1024-200',\n 0xb37a: 'Skein1024-208',\n 0xb37b: 'Skein1024-216',\n 0xb37c: 'Skein1024-224',\n 0xb37d: 'Skein1024-232',\n 0xb37e: 'Skein1024-240',\n 0xb37f: 'Skein1024-248',\n 0xb380: 'Skein1024-256',\n 0xb381: 'Skein1024-264',\n 0xb382: 'Skein1024-272',\n 0xb383: 'Skein1024-280',\n 0xb384: 'Skein1024-288',\n 0xb385: 'Skein1024-296',\n 0xb386: 'Skein1024-304',\n 0xb387: 'Skein1024-312',\n 0xb388: 'Skein1024-320',\n 0xb389: 'Skein1024-328',\n 0xb38a: 'Skein1024-336',\n 0xb38b: 'Skein1024-344',\n 0xb38c: 'Skein1024-352',\n 0xb38d: 'Skein1024-360',\n 0xb38e: 'Skein1024-368',\n 0xb38f: 'Skein1024-376',\n 0xb390: 'Skein1024-384',\n 0xb391: 'Skein1024-392',\n 0xb392: 'Skein1024-400',\n 0xb393: 'Skein1024-408',\n 0xb394: 'Skein1024-416',\n 0xb395: 'Skein1024-424',\n 0xb396: 'Skein1024-432',\n 0xb397: 'Skein1024-440',\n 0xb398: 'Skein1024-448',\n 0xb399: 'Skein1024-456',\n 0xb39a: 'Skein1024-464',\n 0xb39b: 'Skein1024-472',\n 0xb39c: 'Skein1024-480',\n 0xb39d: 'Skein1024-488',\n 0xb39e: 'Skein1024-496',\n 0xb39f: 'Skein1024-504',\n 0xb3a0: 'Skein1024-512',\n 0xb3a1: 'Skein1024-520',\n 0xb3a2: 'Skein1024-528',\n 0xb3a3: 'Skein1024-536',\n 0xb3a4: 'Skein1024-544',\n 0xb3a5: 'Skein1024-552',\n 0xb3a6: 'Skein1024-560',\n 0xb3a7: 'Skein1024-568',\n 0xb3a8: 'Skein1024-576',\n 0xb3a9: 'Skein1024-584',\n 0xb3aa: 'Skein1024-592',\n 0xb3ab: 'Skein1024-600',\n 0xb3ac: 'Skein1024-608',\n 0xb3ad: 'Skein1024-616',\n 0xb3ae: 'Skein1024-624',\n 0xb3af: 'Skein1024-632',\n 0xb3b0: 'Skein1024-640',\n 0xb3b1: 'Skein1024-648',\n 0xb3b2: 'Skein1024-656',\n 0xb3b3: 'Skein1024-664',\n 0xb3b4: 'Skein1024-672',\n 0xb3b5: 'Skein1024-680',\n 0xb3b6: 'Skein1024-688',\n 0xb3b7: 'Skein1024-696',\n 0xb3b8: 'Skein1024-704',\n 0xb3b9: 'Skein1024-712',\n 0xb3ba: 'Skein1024-720',\n 0xb3bb: 'Skein1024-728',\n 0xb3bc: 'Skein1024-736',\n 0xb3bd: 'Skein1024-744',\n 0xb3be: 'Skein1024-752',\n 0xb3bf: 'Skein1024-760',\n 0xb3c0: 'Skein1024-768',\n 0xb3c1: 'Skein1024-776',\n 0xb3c2: 'Skein1024-784',\n 0xb3c3: 'Skein1024-792',\n 0xb3c4: 'Skein1024-800',\n 0xb3c5: 'Skein1024-808',\n 0xb3c6: 'Skein1024-816',\n 0xb3c7: 'Skein1024-824',\n 0xb3c8: 'Skein1024-832',\n 0xb3c9: 'Skein1024-840',\n 0xb3ca: 'Skein1024-848',\n 0xb3cb: 'Skein1024-856',\n 0xb3cc: 'Skein1024-864',\n 0xb3cd: 'Skein1024-872',\n 0xb3ce: 'Skein1024-880',\n 0xb3cf: 'Skein1024-888',\n 0xb3d0: 'Skein1024-896',\n 0xb3d1: 'Skein1024-904',\n 0xb3d2: 'Skein1024-912',\n 0xb3d3: 'Skein1024-920',\n 0xb3d4: 'Skein1024-928',\n 0xb3d5: 'Skein1024-936',\n 0xb3d6: 'Skein1024-944',\n 0xb3d7: 'Skein1024-952',\n 0xb3d8: 'Skein1024-960',\n 0xb3d9: 'Skein1024-968',\n 0xb3da: 'Skein1024-976',\n 0xb3db: 'Skein1024-984',\n 0xb3dc: 'Skein1024-992',\n 0xb3dd: 'Skein1024-1000',\n 0xb3de: 'Skein1024-1008',\n 0xb3df: 'Skein1024-1016',\n 0xb3e0: 'Skein1024-1024'\n})\n\nexports.defaultLengths = Object.freeze({\n 0x11: 20,\n 0x12: 32,\n 0x13: 64,\n 0x56: 32,\n 0x17: 28,\n 0x16: 32,\n 0x15: 48,\n 0x14: 64,\n 0x18: 32,\n 0x19: 64,\n 0x1A: 28,\n 0x1B: 32,\n 0x1C: 48,\n 0x1D: 64,\n 0x22: 32,\n\n 0xb201: 0x01,\n 0xb202: 0x02,\n 0xb203: 0x03,\n 0xb204: 0x04,\n 0xb205: 0x05,\n 0xb206: 0x06,\n 0xb207: 0x07,\n 0xb208: 0x08,\n 0xb209: 0x09,\n 0xb20a: 0x0a,\n 0xb20b: 0x0b,\n 0xb20c: 0x0c,\n 0xb20d: 0x0d,\n 0xb20e: 0x0e,\n 0xb20f: 0x0f,\n 0xb210: 0x10,\n 0xb211: 0x11,\n 0xb212: 0x12,\n 0xb213: 0x13,\n 0xb214: 0x14,\n 0xb215: 0x15,\n 0xb216: 0x16,\n 0xb217: 0x17,\n 0xb218: 0x18,\n 0xb219: 0x19,\n 0xb21a: 0x1a,\n 0xb21b: 0x1b,\n 0xb21c: 0x1c,\n 0xb21d: 0x1d,\n 0xb21e: 0x1e,\n 0xb21f: 0x1f,\n 0xb220: 0x20,\n 0xb221: 0x21,\n 0xb222: 0x22,\n 0xb223: 0x23,\n 0xb224: 0x24,\n 0xb225: 0x25,\n 0xb226: 0x26,\n 0xb227: 0x27,\n 0xb228: 0x28,\n 0xb229: 0x29,\n 0xb22a: 0x2a,\n 0xb22b: 0x2b,\n 0xb22c: 0x2c,\n 0xb22d: 0x2d,\n 0xb22e: 0x2e,\n 0xb22f: 0x2f,\n 0xb230: 0x30,\n 0xb231: 0x31,\n 0xb232: 0x32,\n 0xb233: 0x33,\n 0xb234: 0x34,\n 0xb235: 0x35,\n 0xb236: 0x36,\n 0xb237: 0x37,\n 0xb238: 0x38,\n 0xb239: 0x39,\n 0xb23a: 0x3a,\n 0xb23b: 0x3b,\n 0xb23c: 0x3c,\n 0xb23d: 0x3d,\n 0xb23e: 0x3e,\n 0xb23f: 0x3f,\n 0xb240: 0x40,\n 0xb241: 0x01,\n 0xb242: 0x02,\n 0xb243: 0x03,\n 0xb244: 0x04,\n 0xb245: 0x05,\n 0xb246: 0x06,\n 0xb247: 0x07,\n 0xb248: 0x08,\n 0xb249: 0x09,\n 0xb24a: 0x0a,\n 0xb24b: 0x0b,\n 0xb24c: 0x0c,\n 0xb24d: 0x0d,\n 0xb24e: 0x0e,\n 0xb24f: 0x0f,\n 0xb250: 0x10,\n 0xb251: 0x11,\n 0xb252: 0x12,\n 0xb253: 0x13,\n 0xb254: 0x14,\n 0xb255: 0x15,\n 0xb256: 0x16,\n 0xb257: 0x17,\n 0xb258: 0x18,\n 0xb259: 0x19,\n 0xb25a: 0x1a,\n 0xb25b: 0x1b,\n 0xb25c: 0x1c,\n 0xb25d: 0x1d,\n 0xb25e: 0x1e,\n 0xb25f: 0x1f,\n 0xb260: 0x20,\n 0xb301: 0x01,\n 0xb302: 0x02,\n 0xb303: 0x03,\n 0xb304: 0x04,\n 0xb305: 0x05,\n 0xb306: 0x06,\n 0xb307: 0x07,\n 0xb308: 0x08,\n 0xb309: 0x09,\n 0xb30a: 0x0a,\n 0xb30b: 0x0b,\n 0xb30c: 0x0c,\n 0xb30d: 0x0d,\n 0xb30e: 0x0e,\n 0xb30f: 0x0f,\n 0xb310: 0x10,\n 0xb311: 0x11,\n 0xb312: 0x12,\n 0xb313: 0x13,\n 0xb314: 0x14,\n 0xb315: 0x15,\n 0xb316: 0x16,\n 0xb317: 0x17,\n 0xb318: 0x18,\n 0xb319: 0x19,\n 0xb31a: 0x1a,\n 0xb31b: 0x1b,\n 0xb31c: 0x1c,\n 0xb31d: 0x1d,\n 0xb31e: 0x1e,\n 0xb31f: 0x1f,\n 0xb320: 0x20,\n 0xb321: 0x01,\n 0xb322: 0x02,\n 0xb323: 0x03,\n 0xb324: 0x04,\n 0xb325: 0x05,\n 0xb326: 0x06,\n 0xb327: 0x07,\n 0xb328: 0x08,\n 0xb329: 0x09,\n 0xb32a: 0x0a,\n 0xb32b: 0x0b,\n 0xb32c: 0x0c,\n 0xb32d: 0x0d,\n 0xb32e: 0x0e,\n 0xb32f: 0x0f,\n 0xb330: 0x10,\n 0xb331: 0x11,\n 0xb332: 0x12,\n 0xb333: 0x13,\n 0xb334: 0x14,\n 0xb335: 0x15,\n 0xb336: 0x16,\n 0xb337: 0x17,\n 0xb338: 0x18,\n 0xb339: 0x19,\n 0xb33a: 0x1a,\n 0xb33b: 0x1b,\n 0xb33c: 0x1c,\n 0xb33d: 0x1d,\n 0xb33e: 0x1e,\n 0xb33f: 0x1f,\n 0xb340: 0x20,\n 0xb341: 0x21,\n 0xb342: 0x22,\n 0xb343: 0x23,\n 0xb344: 0x24,\n 0xb345: 0x25,\n 0xb346: 0x26,\n 0xb347: 0x27,\n 0xb348: 0x28,\n 0xb349: 0x29,\n 0xb34a: 0x2a,\n 0xb34b: 0x2b,\n 0xb34c: 0x2c,\n 0xb34d: 0x2d,\n 0xb34e: 0x2e,\n 0xb34f: 0x2f,\n 0xb350: 0x30,\n 0xb351: 0x31,\n 0xb352: 0x32,\n 0xb353: 0x33,\n 0xb354: 0x34,\n 0xb355: 0x35,\n 0xb356: 0x36,\n 0xb357: 0x37,\n 0xb358: 0x38,\n 0xb359: 0x39,\n 0xb35a: 0x3a,\n 0xb35b: 0x3b,\n 0xb35c: 0x3c,\n 0xb35d: 0x3d,\n 0xb35e: 0x3e,\n 0xb35f: 0x3f,\n 0xb360: 0x40,\n 0xb361: 0x01,\n 0xb362: 0x02,\n 0xb363: 0x03,\n 0xb364: 0x04,\n 0xb365: 0x05,\n 0xb366: 0x06,\n 0xb367: 0x07,\n 0xb368: 0x08,\n 0xb369: 0x09,\n 0xb36a: 0x0a,\n 0xb36b: 0x0b,\n 0xb36c: 0x0c,\n 0xb36d: 0x0d,\n 0xb36e: 0x0e,\n 0xb36f: 0x0f,\n 0xb370: 0x10,\n 0xb371: 0x11,\n 0xb372: 0x12,\n 0xb373: 0x13,\n 0xb374: 0x14,\n 0xb375: 0x15,\n 0xb376: 0x16,\n 0xb377: 0x17,\n 0xb378: 0x18,\n 0xb379: 0x19,\n 0xb37a: 0x1a,\n 0xb37b: 0x1b,\n 0xb37c: 0x1c,\n 0xb37d: 0x1d,\n 0xb37e: 0x1e,\n 0xb37f: 0x1f,\n 0xb380: 0x20,\n 0xb381: 0x21,\n 0xb382: 0x22,\n 0xb383: 0x23,\n 0xb384: 0x24,\n 0xb385: 0x25,\n 0xb386: 0x26,\n 0xb387: 0x27,\n 0xb388: 0x28,\n 0xb389: 0x29,\n 0xb38a: 0x2a,\n 0xb38b: 0x2b,\n 0xb38c: 0x2c,\n 0xb38d: 0x2d,\n 0xb38e: 0x2e,\n 0xb38f: 0x2f,\n 0xb390: 0x30,\n 0xb391: 0x31,\n 0xb392: 0x32,\n 0xb393: 0x33,\n 0xb394: 0x34,\n 0xb395: 0x35,\n 0xb396: 0x36,\n 0xb397: 0x37,\n 0xb398: 0x38,\n 0xb399: 0x39,\n 0xb39a: 0x3a,\n 0xb39b: 0x3b,\n 0xb39c: 0x3c,\n 0xb39d: 0x3d,\n 0xb39e: 0x3e,\n 0xb39f: 0x3f,\n 0xb3a0: 0x40,\n 0xb3a1: 0x41,\n 0xb3a2: 0x42,\n 0xb3a3: 0x43,\n 0xb3a4: 0x44,\n 0xb3a5: 0x45,\n 0xb3a6: 0x46,\n 0xb3a7: 0x47,\n 0xb3a8: 0x48,\n 0xb3a9: 0x49,\n 0xb3aa: 0x4a,\n 0xb3ab: 0x4b,\n 0xb3ac: 0x4c,\n 0xb3ad: 0x4d,\n 0xb3ae: 0x4e,\n 0xb3af: 0x4f,\n 0xb3b0: 0x50,\n 0xb3b1: 0x51,\n 0xb3b2: 0x52,\n 0xb3b3: 0x53,\n 0xb3b4: 0x54,\n 0xb3b5: 0x55,\n 0xb3b6: 0x56,\n 0xb3b7: 0x57,\n 0xb3b8: 0x58,\n 0xb3b9: 0x59,\n 0xb3ba: 0x5a,\n 0xb3bb: 0x5b,\n 0xb3bc: 0x5c,\n 0xb3bd: 0x5d,\n 0xb3be: 0x5e,\n 0xb3bf: 0x5f,\n 0xb3c0: 0x60,\n 0xb3c1: 0x61,\n 0xb3c2: 0x62,\n 0xb3c3: 0x63,\n 0xb3c4: 0x64,\n 0xb3c5: 0x65,\n 0xb3c6: 0x66,\n 0xb3c7: 0x67,\n 0xb3c8: 0x68,\n 0xb3c9: 0x69,\n 0xb3ca: 0x6a,\n 0xb3cb: 0x6b,\n 0xb3cc: 0x6c,\n 0xb3cd: 0x6d,\n 0xb3ce: 0x6e,\n 0xb3cf: 0x6f,\n 0xb3d0: 0x70,\n 0xb3d1: 0x71,\n 0xb3d2: 0x72,\n 0xb3d3: 0x73,\n 0xb3d4: 0x74,\n 0xb3d5: 0x75,\n 0xb3d6: 0x76,\n 0xb3d7: 0x77,\n 0xb3d8: 0x78,\n 0xb3d9: 0x79,\n 0xb3da: 0x7a,\n 0xb3db: 0x7b,\n 0xb3dc: 0x7c,\n 0xb3dd: 0x7d,\n 0xb3de: 0x7e,\n 0xb3df: 0x7f,\n 0xb3e0: 0x80\n})\n\n\n//# sourceURL=webpack:///./node_modules/multihashes/src/constants.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashes/src/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/multihashes/src/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Multihash implementation in JavaScript.\n *\n * @module multihash\n */\n\n\nconst bs58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\n\nconst cs = __webpack_require__(/*! ./constants */ \"./node_modules/multihashes/src/constants.js\")\n\nexports.names = cs.names\nexports.codes = cs.codes\nexports.defaultLengths = cs.defaultLengths\n\nconst varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\n/**\n * Convert the given multihash to a hex encoded string.\n *\n * @param {Buffer} hash\n * @returns {string}\n */\nexports.toHexString = function toHexString (hash) {\n if (!Buffer.isBuffer(hash)) {\n throw new Error('must be passed a buffer')\n }\n\n return hash.toString('hex')\n}\n\n/**\n * Convert the given hex encoded string to a multihash.\n *\n * @param {string} hash\n * @returns {Buffer}\n */\nexports.fromHexString = function fromHexString (hash) {\n return Buffer.from(hash, 'hex')\n}\n\n/**\n * Convert the given multihash to a base58 encoded string.\n *\n * @param {Buffer} hash\n * @returns {string}\n */\nexports.toB58String = function toB58String (hash) {\n if (!Buffer.isBuffer(hash)) {\n throw new Error('must be passed a buffer')\n }\n\n return bs58.encode(hash)\n}\n\n/**\n * Convert the given base58 encoded string to a multihash.\n *\n * @param {string|Buffer} hash\n * @returns {Buffer}\n */\nexports.fromB58String = function fromB58String (hash) {\n let encoded = hash\n if (Buffer.isBuffer(hash)) {\n encoded = hash.toString()\n }\n\n return Buffer.from(bs58.decode(encoded))\n}\n\n/**\n * Decode a hash from the given multihash.\n *\n * @param {Buffer} buf\n * @returns {{code: number, name: string, length: number, digest: Buffer}} result\n */\nexports.decode = function decode (buf) {\n if (!(Buffer.isBuffer(buf))) {\n throw new Error('multihash must be a Buffer')\n }\n\n if (buf.length < 3) {\n throw new Error('multihash too short. must be > 3 bytes.')\n }\n\n let code = varint.decode(buf)\n if (!exports.isValidCode(code)) {\n throw new Error(`multihash unknown function code: 0x${code.toString(16)}`)\n }\n buf = buf.slice(varint.decode.bytes)\n\n let len = varint.decode(buf)\n if (len < 1) {\n throw new Error(`multihash invalid length: 0x${len.toString(16)}`)\n }\n buf = buf.slice(varint.decode.bytes)\n\n if (buf.length !== len) {\n throw new Error(`multihash length inconsistent: 0x${buf.toString('hex')}`)\n }\n\n return {\n code: code,\n name: cs.codes[code],\n length: len,\n digest: buf\n }\n}\n\n/**\n * Encode a hash digest along with the specified function code.\n *\n * > **Note:** the length is derived from the length of the digest itself.\n *\n * @param {Buffer} digest\n * @param {string|number} code\n * @param {number} [length]\n * @returns {Buffer}\n */\nexports.encode = function encode (digest, code, length) {\n if (!digest || !code) {\n throw new Error('multihash encode requires at least two args: digest, code')\n }\n\n // ensure it's a hashfunction code.\n const hashfn = exports.coerceCode(code)\n\n if (!(Buffer.isBuffer(digest))) {\n throw new Error('digest should be a Buffer')\n }\n\n if (length == null) {\n length = digest.length\n }\n\n if (length && digest.length !== length) {\n throw new Error('digest length should be equal to specified length.')\n }\n\n return Buffer.concat([\n Buffer.from(varint.encode(hashfn)),\n Buffer.from(varint.encode(length)),\n digest\n ])\n}\n\n/**\n * Converts a hash function name into the matching code.\n * If passed a number it will return the number if it's a valid code.\n * @param {string|number} name\n * @returns {number}\n */\nexports.coerceCode = function coerceCode (name) {\n let code = name\n\n if (typeof name === 'string') {\n if (!cs.names[name]) {\n throw new Error(`Unrecognized hash function named: ${name}`)\n }\n code = cs.names[name]\n }\n\n if (typeof code !== 'number') {\n throw new Error(`Hash function code should be a number. Got: ${code}`)\n }\n\n if (!cs.codes[code] && !exports.isAppCode(code)) {\n throw new Error(`Unrecognized function code: ${code}`)\n }\n\n return code\n}\n\n/**\n * Checks wether a code is part of the app range\n *\n * @param {number} code\n * @returns {boolean}\n */\nexports.isAppCode = function appCode (code) {\n return code > 0 && code < 0x10\n}\n\n/**\n * Checks whether a multihash code is valid.\n *\n * @param {number} code\n * @returns {boolean}\n */\nexports.isValidCode = function validCode (code) {\n if (exports.isAppCode(code)) {\n return true\n }\n\n if (cs.codes[code]) {\n return true\n }\n\n return false\n}\n\n/**\n * Check if the given buffer is a valid multihash. Throws an error if it is not valid.\n *\n * @param {Buffer} multihash\n * @returns {undefined}\n * @throws {Error}\n */\nfunction validate (multihash) {\n exports.decode(multihash) // throws if bad.\n}\nexports.validate = validate\n\n/**\n * Returns a prefix from a valid multihash. Throws an error if it is not valid.\n *\n * @param {Buffer} multihash\n * @returns {undefined}\n * @throws {Error}\n */\nexports.prefix = function prefix (multihash) {\n validate(multihash)\n\n return multihash.slice(0, 2)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/multihashes/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashing-async/src/blake.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/multihashing-async/src/blake.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Buffer } = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\nconst blake = __webpack_require__(/*! blakejs */ \"./node_modules/blakejs/index.js\")\n\nconst minB = 0xb201\nconst minS = 0xb241\n\nconst blake2b = {\n init: blake.blake2bInit,\n update: blake.blake2bUpdate,\n digest: blake.blake2bFinal\n}\n\nconst blake2s = {\n init: blake.blake2sInit,\n update: blake.blake2sUpdate,\n digest: blake.blake2sFinal\n}\n\n// Note that although this function doesn't do any asynchronous work, we mark\n// the function as async because it must return a Promise to match the API\n// for other functions that do perform asynchronous work (see sha.browser.js)\nconst makeB2Hash = (size, hf) => async (data) => {\n const ctx = hf.init(size, null)\n hf.update(ctx, data)\n return Buffer.from(hf.digest(ctx))\n}\n\nmodule.exports = (table) => {\n for (let i = 0; i < 64; i++) {\n table[minB + i] = makeB2Hash(i + 1, blake2b)\n }\n for (let i = 0; i < 32; i++) {\n table[minS + i] = makeB2Hash(i + 1, blake2s)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/multihashing-async/src/blake.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashing-async/src/crypto.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/multihashing-async/src/crypto.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Buffer } = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\nconst sha3 = __webpack_require__(/*! js-sha3 */ \"./node_modules/js-sha3/src/sha3.js\")\nconst mur = __webpack_require__(/*! murmurhash3js-revisited */ \"./node_modules/murmurhash3js-revisited/index.js\")\nconst sha = __webpack_require__(/*! ./sha */ \"./node_modules/multihashing-async/src/sha.browser.js\")\nconst { fromNumberTo32BitBuf } = __webpack_require__(/*! ./utils */ \"./node_modules/multihashing-async/src/utils.js\")\n\n// Note that although this function doesn't do any asynchronous work, we mark\n// the function as async because it must return a Promise to match the API\n// for other functions that do perform asynchronous work (see sha.browser.js)\nconst hash = (algorithm) => async (data) => {\n switch (algorithm) {\n case 'sha3-224':\n return Buffer.from(sha3.sha3_224.arrayBuffer(data))\n case 'sha3-256':\n return Buffer.from(sha3.sha3_256.arrayBuffer(data))\n case 'sha3-384':\n return Buffer.from(sha3.sha3_384.arrayBuffer(data))\n case 'sha3-512':\n return Buffer.from(sha3.sha3_512.arrayBuffer(data))\n case 'shake-128':\n return Buffer.from(sha3.shake128.create(128).update(data).arrayBuffer())\n case 'shake-256':\n return Buffer.from(sha3.shake256.create(256).update(data).arrayBuffer())\n case 'keccak-224':\n return Buffer.from(sha3.keccak224.arrayBuffer(data))\n case 'keccak-256':\n return Buffer.from(sha3.keccak256.arrayBuffer(data))\n case 'keccak-384':\n return Buffer.from(sha3.keccak384.arrayBuffer(data))\n case 'keccak-512':\n return Buffer.from(sha3.keccak512.arrayBuffer(data))\n case 'murmur3-128':\n return Buffer.from(mur.x64.hash128(data), 'hex')\n case 'murmur3-32':\n return fromNumberTo32BitBuf(mur.x86.hash32(data))\n\n default:\n throw new TypeError(`${algorithm} is not a supported algorithm`)\n }\n}\n\nmodule.exports = {\n sha1: sha('sha1'),\n sha2256: sha('sha2-256'),\n sha2512: sha('sha2-512'),\n dblSha2256: sha('dbl-sha2-256'),\n sha3224: hash('sha3-224'),\n sha3256: hash('sha3-256'),\n sha3384: hash('sha3-384'),\n sha3512: hash('sha3-512'),\n shake128: hash('shake-128'),\n shake256: hash('shake-256'),\n keccak224: hash('keccak-224'),\n keccak256: hash('keccak-256'),\n keccak384: hash('keccak-384'),\n keccak512: hash('keccak-512'),\n murmur3128: hash('murmur3-128'),\n murmur332: hash('murmur3-32'),\n addBlake: __webpack_require__(/*! ./blake */ \"./node_modules/multihashing-async/src/blake.js\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/multihashing-async/src/crypto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashing-async/src/index.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/multihashing-async/src/index.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Buffer } = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\nconst errcode = __webpack_require__(/*! err-code */ \"./node_modules/err-code/index.js\")\nconst multihash = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst crypto = __webpack_require__(/*! ./crypto */ \"./node_modules/multihashing-async/src/crypto.js\")\n\n/**\n * Hash the given `buf` using the algorithm specified by `alg`.\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} alg - The algorithm to use eg 'sha1'\n * @param {number} [length] - Optionally trim the result to this length.\n * @returns {Promise<Buffer>}\n */\nasync function Multihashing (buf, alg, length) {\n const digest = await Multihashing.digest(buf, alg, length)\n return multihash.encode(digest, alg, length)\n}\n\n/**\n * The `buffer` module for easy use in the browser.\n *\n * @type {Buffer}\n */\nMultihashing.Buffer = Buffer // for browser things\n\n/**\n * Expose multihash itself, to avoid silly double requires.\n */\nMultihashing.multihash = multihash\n\n/**\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} alg - The algorithm to use eg 'sha1'\n * @param {number} [length] - Optionally trim the result to this length.\n * @returns {Promise<Buffer>}\n */\nMultihashing.digest = async (buf, alg, length) => {\n const hash = Multihashing.createHash(alg)\n const digest = await hash(buf)\n return length ? digest.slice(0, length) : digest\n}\n\n/**\n * Creates a function that hashes with the given algorithm\n *\n * @param {string|number} alg - The algorithm to use eg 'sha1'\n *\n * @returns {function} - The hash function corresponding to `alg`\n */\nMultihashing.createHash = function (alg) {\n if (!alg) {\n throw errcode('hash algorithm must be specified', 'ERR_HASH_ALGORITHM_NOT_SPECIFIED')\n }\n\n alg = multihash.coerceCode(alg)\n if (!Multihashing.functions[alg]) {\n throw errcode(`multihash function '${alg}' not yet supported`, 'ERR_HASH_ALGORITHM_NOT_SUPPORTED')\n }\n\n return Multihashing.functions[alg]\n}\n\n/**\n * Mapping of multihash codes to their hashing functions.\n * @type {Object}\n */\nMultihashing.functions = {\n // sha1\n 0x11: crypto.sha1,\n // sha2-256\n 0x12: crypto.sha2256,\n // sha2-512\n 0x13: crypto.sha2512,\n // sha3-512\n 0x14: crypto.sha3512,\n // sha3-384\n 0x15: crypto.sha3384,\n // sha3-256\n 0x16: crypto.sha3256,\n // sha3-224\n 0x17: crypto.sha3224,\n // shake-128\n 0x18: crypto.shake128,\n // shake-256\n 0x19: crypto.shake256,\n // keccak-224\n 0x1A: crypto.keccak224,\n // keccak-256\n 0x1B: crypto.keccak256,\n // keccak-384\n 0x1C: crypto.keccak384,\n // keccak-512\n 0x1D: crypto.keccak512,\n // murmur3-128\n 0x22: crypto.murmur3128,\n // murmur3-32\n 0x23: crypto.murmur332,\n // dbl-sha2-256\n 0x56: crypto.dblSha2256\n}\n\n// add blake functions\ncrypto.addBlake(Multihashing.functions)\n\nMultihashing.validate = async (buf, hash) => {\n const newHash = await Multihashing(buf, multihash.decode(hash).name)\n\n return Buffer.compare(hash, newHash) === 0\n}\n\nmodule.exports = Multihashing\n\n\n//# sourceURL=webpack:///./node_modules/multihashing-async/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashing-async/src/sha.browser.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/multihashing-async/src/sha.browser.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Buffer } = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\n\nconst crypto = self.crypto || self.msCrypto\n\nmodule.exports = (algorithm) => {\n if (typeof self === 'undefined' || (!self.crypto && !self.msCrypto)) {\n throw new Error(\n 'Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context'\n )\n }\n\n return async (data) => {\n switch (algorithm) {\n case 'sha1':\n return Buffer.from(await crypto.subtle.digest({ name: 'SHA-1' }, data))\n case 'sha2-256':\n return Buffer.from(await crypto.subtle.digest({ name: 'SHA-256' }, data))\n case 'sha2-512':\n return Buffer.from(await crypto.subtle.digest({ name: 'SHA-512' }, data))\n case 'dbl-sha2-256': {\n const d = await crypto.subtle.digest({ name: 'SHA-256' }, data)\n return Buffer.from(await crypto.subtle.digest({ name: 'SHA-256' }, d))\n }\n default:\n throw new Error(`${algorithm} is not a supported algorithm`)\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/multihashing-async/src/sha.browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multihashing-async/src/utils.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/multihashing-async/src/utils.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Buffer } = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\n\nconst fromNumberTo32BitBuf = (number) => {\n const bytes = new Array(4)\n\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 0xff\n number = number >> 8\n }\n\n return Buffer.from(bytes)\n}\n\nmodule.exports = {\n fromNumberTo32BitBuf\n}\n\n\n//# sourceURL=webpack:///./node_modules/multihashing-async/src/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/multistream/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/multistream/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\nfunction toStreams2Obj (s) {\n return toStreams2(s, { objectMode: true, highWaterMark: 16 })\n}\n\nfunction toStreams2Buf (s) {\n return toStreams2(s)\n}\n\nfunction toStreams2 (s, opts) {\n if (!s || typeof s === 'function' || s._readableState) return s\n\n var wrap = new stream.Readable(opts).wrap(s)\n if (s.destroy) {\n wrap.destroy = s.destroy.bind(s)\n }\n return wrap\n}\n\nclass MultiStream extends stream.Readable {\n constructor (streams, opts) {\n super(opts)\n\n this.destroyed = false\n\n this._drained = false\n this._forwarding = false\n this._current = null\n this._toStreams2 = (opts && opts.objectMode) ? toStreams2Obj : toStreams2Buf\n\n if (typeof streams === 'function') {\n this._queue = streams\n } else {\n this._queue = streams.map(this._toStreams2)\n this._queue.forEach(stream => {\n if (typeof stream !== 'function') this._attachErrorListener(stream)\n })\n }\n\n this._next()\n }\n\n _read () {\n this._drained = true\n this._forward()\n }\n\n _forward () {\n if (this._forwarding || !this._drained || !this._current) return\n this._forwarding = true\n\n var chunk\n while ((chunk = this._current.read()) !== null && this._drained) {\n this._drained = this.push(chunk)\n }\n\n this._forwarding = false\n }\n\n destroy (err) {\n if (this.destroyed) return\n this.destroyed = true\n\n if (this._current && this._current.destroy) this._current.destroy()\n if (typeof this._queue !== 'function') {\n this._queue.forEach(stream => {\n if (stream.destroy) stream.destroy()\n })\n }\n\n if (err) this.emit('error', err)\n this.emit('close')\n }\n\n _next () {\n this._current = null\n\n if (typeof this._queue === 'function') {\n this._queue((err, stream) => {\n if (err) return this.destroy(err)\n stream = this._toStreams2(stream)\n this._attachErrorListener(stream)\n this._gotNextStream(stream)\n })\n } else {\n var stream = this._queue.shift()\n if (typeof stream === 'function') {\n stream = this._toStreams2(stream())\n this._attachErrorListener(stream)\n }\n this._gotNextStream(stream)\n }\n }\n\n _gotNextStream (stream) {\n if (!stream) {\n this.push(null)\n this.destroy()\n return\n }\n\n this._current = stream\n this._forward()\n\n const onReadable = () => {\n this._forward()\n }\n\n const onClose = () => {\n if (!stream._readableState.ended) {\n this.destroy()\n }\n }\n\n const onEnd = () => {\n this._current = null\n stream.removeListener('readable', onReadable)\n stream.removeListener('end', onEnd)\n stream.removeListener('close', onClose)\n this._next()\n }\n\n stream.on('readable', onReadable)\n stream.once('end', onEnd)\n stream.once('close', onClose)\n }\n\n _attachErrorListener (stream) {\n if (!stream) return\n\n const onError = (err) => {\n stream.removeListener('error', onError)\n this.destroy(err)\n }\n\n stream.once('error', onError)\n }\n}\n\nMultiStream.obj = streams => (\n new MultiStream(streams, { objectMode: true, highWaterMark: 16 })\n)\n\nmodule.exports = MultiStream\n\n\n//# sourceURL=webpack:///./node_modules/multistream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/murmurhash3js-revisited/index.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/murmurhash3js-revisited/index.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! ./lib/murmurHash3js */ \"./node_modules/murmurhash3js-revisited/lib/murmurHash3js.js\");\n\n\n//# sourceURL=webpack:///./node_modules/murmurhash3js-revisited/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/murmurhash3js-revisited/lib/murmurHash3js.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/murmurhash3js-revisited/lib/murmurHash3js.js ***!
|
||
\*******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* jshint -W086: true */\n// +----------------------------------------------------------------------+\n// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js\n// | A javascript implementation of MurmurHash3's x86 hashing algorithms. |\n// |----------------------------------------------------------------------|\n// | Copyright (c) 2012-2015 Karan Lyons |\n// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js |\n// | Freely distributable under the MIT license. |\n// +----------------------------------------------------------------------+\n\n;(function (root, undefined) {\n 'use strict';\n\n // Create a local object that'll be exported or referenced globally.\n var library = {\n 'version': '3.0.0',\n 'x86': {},\n 'x64': {},\n 'inputValidation': true\n };\n\n // PRIVATE FUNCTIONS\n // -----------------\n\n function _validBytes(bytes) {\n // check the input is an array or a typed array\n if (!Array.isArray(bytes) && !ArrayBuffer.isView(bytes)) {\n return false;\n }\n\n // check all bytes are actually bytes\n for (var i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) {\n return false;\n }\n }\n return true;\n }\n\n function _x86Multiply(m, n) {\n //\n // Given two 32bit ints, returns the two multiplied together as a\n // 32bit int.\n //\n\n return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16);\n }\n\n function _x86Rotl(m, n) {\n //\n // Given a 32bit int and an int representing a number of bit positions,\n // returns the 32bit int rotated left by that number of positions.\n //\n\n return (m << n) | (m >>> (32 - n));\n }\n\n function _x86Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x86 mix of that block.\n //\n\n h ^= h >>> 16;\n h = _x86Multiply(h, 0x85ebca6b);\n h ^= h >>> 13;\n h = _x86Multiply(h, 0xc2b2ae35);\n h ^= h >>> 16;\n\n return h;\n }\n\n function _x64Add(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // added together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Multiply(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // multiplied together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]);\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Rotl(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) rotated left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 32) {\n return [m[1], m[0]];\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n } else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n }\n\n function _x64LeftShift(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) shifted left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 0) {\n return m;\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n } else {\n return [m[1] << (n - 32), 0];\n }\n }\n\n function _x64Xor(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // xored together as a 64bit int (as an array of two 32bit ints).\n //\n\n return [m[0] ^ n[0], m[1] ^ n[1]];\n }\n\n function _x64Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x64 mix of that block.\n // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n // only place where we need to right shift 64bit ints.)\n //\n\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n\n return h;\n }\n\n // PUBLIC FUNCTIONS\n // ----------------\n\n library.x86.hash32 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 32 bit hash\n // using the x86 flavor of MurmurHash3, as an unsigned int.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n seed = seed || 0;\n\n var remainder = bytes.length % 4;\n var blocks = bytes.length - remainder;\n\n var h1 = seed;\n\n var k1 = 0;\n\n var c1 = 0xcc9e2d51;\n var c2 = 0x1b873593;\n\n for (var i = 0; i < blocks; i = i + 4) {\n k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n\n h1 ^= k1;\n h1 = _x86Rotl(h1, 13);\n h1 = _x86Multiply(h1, 5) + 0xe6546b64;\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3:\n k1 ^= bytes[i + 2] << 16;\n\n case 2:\n k1 ^= bytes[i + 1] << 8;\n\n case 1:\n k1 ^= bytes[i];\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= bytes.length;\n h1 = _x86Fmix(h1);\n\n return h1 >>> 0;\n };\n\n library.x86.hash128 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x86 flavor of MurmurHash3, as an unsigned hex.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n\n seed = seed || 0;\n var remainder = bytes.length % 16;\n var blocks = bytes.length - remainder;\n\n var h1 = seed;\n var h2 = seed;\n var h3 = seed;\n var h4 = seed;\n\n var k1 = 0;\n var k2 = 0;\n var k3 = 0;\n var k4 = 0;\n\n var c1 = 0x239b961b;\n var c2 = 0xab0e9789;\n var c3 = 0x38b34ae5;\n var c4 = 0xa1e38b93;\n\n for (var i = 0; i < blocks; i = i + 16) {\n k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24);\n k2 = (bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24);\n k3 = (bytes[i + 8]) | (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24);\n k4 = (bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n\n h1 = _x86Rotl(h1, 19);\n h1 += h2;\n h1 = _x86Multiply(h1, 5) + 0x561ccd1b;\n\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n h2 = _x86Rotl(h2, 17);\n h2 += h3;\n h2 = _x86Multiply(h2, 5) + 0x0bcaa747;\n\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n h3 = _x86Rotl(h3, 15);\n h3 += h4;\n h3 = _x86Multiply(h3, 5) + 0x96cd1c35;\n\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n h4 = _x86Rotl(h4, 13);\n h4 += h1;\n h4 = _x86Multiply(h4, 5) + 0x32ac3b17;\n }\n\n k1 = 0;\n k2 = 0;\n k3 = 0;\n k4 = 0;\n\n switch (remainder) {\n case 15:\n k4 ^= bytes[i + 14] << 16;\n\n case 14:\n k4 ^= bytes[i + 13] << 8;\n\n case 13:\n k4 ^= bytes[i + 12];\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n case 12:\n k3 ^= bytes[i + 11] << 24;\n\n case 11:\n k3 ^= bytes[i + 10] << 16;\n\n case 10:\n k3 ^= bytes[i + 9] << 8;\n\n case 9:\n k3 ^= bytes[i + 8];\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n case 8:\n k2 ^= bytes[i + 7] << 24;\n\n case 7:\n k2 ^= bytes[i + 6] << 16;\n\n case 6:\n k2 ^= bytes[i + 5] << 8;\n\n case 5:\n k2 ^= bytes[i + 4];\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n case 4:\n k1 ^= bytes[i + 3] << 24;\n\n case 3:\n k1 ^= bytes[i + 2] << 16;\n\n case 2:\n k1 ^= bytes[i + 1] << 8;\n\n case 1:\n k1 ^= bytes[i];\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= bytes.length;\n h2 ^= bytes.length;\n h3 ^= bytes.length;\n h4 ^= bytes.length;\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n h1 = _x86Fmix(h1);\n h2 = _x86Fmix(h2);\n h3 = _x86Fmix(h3);\n h4 = _x86Fmix(h4);\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n return (\"00000000\" + (h1 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h3 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h4 >>> 0).toString(16)).slice(-8);\n };\n\n library.x64.hash128 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n seed = seed || 0;\n\n var remainder = bytes.length % 16;\n var blocks = bytes.length - remainder;\n\n var h1 = [0, seed];\n var h2 = [0, seed];\n\n var k1 = [0, 0];\n var k2 = [0, 0];\n\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n\n for (var i = 0; i < blocks; i = i + 16) {\n k1 = [(bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24), (bytes[i]) |\n (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24)];\n k2 = [(bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24), (bytes[i + 8]) |\n (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24)];\n\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n\n h1 = _x64Rotl(h1, 27);\n h1 = _x64Add(h1, h2);\n h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n h2 = _x64Rotl(h2, 31);\n h2 = _x64Add(h2, h1);\n h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n\n k1 = [0, 0];\n k2 = [0, 0];\n\n switch (remainder) {\n case 15:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 14]], 48));\n\n case 14:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 13]], 40));\n\n case 13:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 12]], 32));\n\n case 12:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 11]], 24));\n\n case 11:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 10]], 16));\n\n case 10:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 9]], 8));\n\n case 9:\n k2 = _x64Xor(k2, [0, bytes[i + 8]]);\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n case 8:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 7]], 56));\n\n case 7:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 6]], 48));\n\n case 6:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 5]], 40));\n\n case 5:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 4]], 32));\n\n case 4:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 3]], 24));\n\n case 3:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 2]], 16));\n\n case 2:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 1]], 8));\n\n case 1:\n k1 = _x64Xor(k1, [0, bytes[i]]);\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n }\n\n h1 = _x64Xor(h1, [0, bytes.length]);\n h2 = _x64Xor(h2, [0, bytes.length]);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n h1 = _x64Fmix(h1);\n h2 = _x64Fmix(h2);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n return (\"00000000\" + (h1[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h1[1] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[1] >>> 0).toString(16)).slice(-8);\n };\n\n // INITIALIZATION\n // --------------\n\n // Export murmurHash3 for CommonJS, either as an AMD module or just as part\n // of the global object.\n if (true) {\n\n if ( true && module.exports) {\n exports = module.exports = library;\n }\n\n exports.murmurHash3 = library;\n\n } else {}\n})(this);\n\n\n//# sourceURL=webpack:///./node_modules/murmurhash3js-revisited/lib/murmurHash3js.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/murmurhash3js/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/murmurhash3js/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! ./lib/murmurHash3js */ \"./node_modules/murmurhash3js/lib/murmurHash3js.js\");\n\n\n//# sourceURL=webpack:///./node_modules/murmurhash3js/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/murmurhash3js/lib/murmurHash3js.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/murmurhash3js/lib/murmurHash3js.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* jshint -W086: true */\n// +----------------------------------------------------------------------+\n// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js\n// | A javascript implementation of MurmurHash3's x86 hashing algorithms. |\n// |----------------------------------------------------------------------|\n// | Copyright (c) 2012-2015 Karan Lyons |\n// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js |\n// | Freely distributable under the MIT license. |\n// +----------------------------------------------------------------------+\n\n;(function (root, undefined) {\n 'use strict';\n\n // Create a local object that'll be exported or referenced globally.\n var library = {\n 'version': '3.0.1',\n 'x86': {},\n 'x64': {}\n };\n\n // PRIVATE FUNCTIONS\n // -----------------\n\n function _x86Multiply(m, n) {\n //\n // Given two 32bit ints, returns the two multiplied together as a\n // 32bit int.\n //\n\n return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16);\n }\n\n function _x86Rotl(m, n) {\n //\n // Given a 32bit int and an int representing a number of bit positions,\n // returns the 32bit int rotated left by that number of positions.\n //\n\n return (m << n) | (m >>> (32 - n));\n }\n\n function _x86Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x86 mix of that block.\n //\n\n h ^= h >>> 16;\n h = _x86Multiply(h, 0x85ebca6b);\n h ^= h >>> 13;\n h = _x86Multiply(h, 0xc2b2ae35);\n h ^= h >>> 16;\n\n return h;\n }\n\n function _x64Add(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // added together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Multiply(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // multiplied together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]);\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Rotl(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) rotated left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 32) {\n return [m[1], m[0]];\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n } else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n }\n\n function _x64LeftShift(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) shifted left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 0) {\n return m;\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n } else {\n return [m[1] << (n - 32), 0];\n }\n }\n\n function _x64Xor(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // xored together as a 64bit int (as an array of two 32bit ints).\n //\n\n return [m[0] ^ n[0], m[1] ^ n[1]];\n }\n\n function _x64Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x64 mix of that block.\n // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n // only place where we need to right shift 64bit ints.)\n //\n\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n\n return h;\n }\n\n // PUBLIC FUNCTIONS\n // ----------------\n\n library.x86.hash32 = function (key, seed) {\n //\n // Given a string and an optional seed as an int, returns a 32 bit hash\n // using the x86 flavor of MurmurHash3, as an unsigned int.\n //\n\n key = key || '';\n seed = seed || 0;\n\n var remainder = key.length % 4;\n var bytes = key.length - remainder;\n\n var h1 = seed;\n\n var k1 = 0;\n\n var c1 = 0xcc9e2d51;\n var c2 = 0x1b873593;\n\n for (var i = 0; i < bytes; i = i + 4) {\n k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n\n h1 ^= k1;\n h1 = _x86Rotl(h1, 13);\n h1 = _x86Multiply(h1, 5) + 0xe6546b64;\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3:\n k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n k1 ^= (key.charCodeAt(i) & 0xff);\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= key.length;\n h1 = _x86Fmix(h1);\n\n return h1 >>> 0;\n };\n\n library.x86.hash128 = function (key, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x86 flavor of MurmurHash3, as an unsigned hex.\n //\n\n key = key || '';\n seed = seed || 0;\n\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n\n var h1 = seed;\n var h2 = seed;\n var h3 = seed;\n var h4 = seed;\n\n var k1 = 0;\n var k2 = 0;\n var k3 = 0;\n var k4 = 0;\n\n var c1 = 0x239b961b;\n var c2 = 0xab0e9789;\n var c3 = 0x38b34ae5;\n var c4 = 0xa1e38b93;\n\n for (var i = 0; i < bytes; i = i + 16) {\n k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);\n k2 = ((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24);\n k3 = ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24);\n k4 = ((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n\n h1 = _x86Rotl(h1, 19);\n h1 += h2;\n h1 = _x86Multiply(h1, 5) + 0x561ccd1b;\n\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n h2 = _x86Rotl(h2, 17);\n h2 += h3;\n h2 = _x86Multiply(h2, 5) + 0x0bcaa747;\n\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n h3 = _x86Rotl(h3, 15);\n h3 += h4;\n h3 = _x86Multiply(h3, 5) + 0x96cd1c35;\n\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n h4 = _x86Rotl(h4, 13);\n h4 += h1;\n h4 = _x86Multiply(h4, 5) + 0x32ac3b17;\n }\n\n k1 = 0;\n k2 = 0;\n k3 = 0;\n k4 = 0;\n\n switch (remainder) {\n case 15:\n k4 ^= key.charCodeAt(i + 14) << 16;\n\n case 14:\n k4 ^= key.charCodeAt(i + 13) << 8;\n\n case 13:\n k4 ^= key.charCodeAt(i + 12);\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n case 12:\n k3 ^= key.charCodeAt(i + 11) << 24;\n\n case 11:\n k3 ^= key.charCodeAt(i + 10) << 16;\n\n case 10:\n k3 ^= key.charCodeAt(i + 9) << 8;\n\n case 9:\n k3 ^= key.charCodeAt(i + 8);\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n case 8:\n k2 ^= key.charCodeAt(i + 7) << 24;\n\n case 7:\n k2 ^= key.charCodeAt(i + 6) << 16;\n\n case 6:\n k2 ^= key.charCodeAt(i + 5) << 8;\n\n case 5:\n k2 ^= key.charCodeAt(i + 4);\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n case 4:\n k1 ^= key.charCodeAt(i + 3) << 24;\n\n case 3:\n k1 ^= key.charCodeAt(i + 2) << 16;\n\n case 2:\n k1 ^= key.charCodeAt(i + 1) << 8;\n\n case 1:\n k1 ^= key.charCodeAt(i);\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= key.length;\n h2 ^= key.length;\n h3 ^= key.length;\n h4 ^= key.length;\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n h1 = _x86Fmix(h1);\n h2 = _x86Fmix(h2);\n h3 = _x86Fmix(h3);\n h4 = _x86Fmix(h4);\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n return (\"00000000\" + (h1 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h3 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h4 >>> 0).toString(16)).slice(-8);\n };\n\n library.x64.hash128 = function (key, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n //\n\n key = key || '';\n seed = seed || 0;\n\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n\n var h1 = [0, seed];\n var h2 = [0, seed];\n\n var k1 = [0, 0];\n var k2 = [0, 0];\n\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n\n for (var i = 0; i < bytes; i = i + 16) {\n k1 = [((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24), ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) &\n 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24)];\n k2 = [((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24), ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i +\n 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24)];\n\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n\n h1 = _x64Rotl(h1, 27);\n h1 = _x64Add(h1, h2);\n h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n h2 = _x64Rotl(h2, 31);\n h2 = _x64Add(h2, h1);\n h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n\n k1 = [0, 0];\n k2 = [0, 0];\n\n switch (remainder) {\n case 15:\n k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n\n case 14:\n k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n\n case 13:\n k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n\n case 12:\n k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n\n case 11:\n k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n\n case 10:\n k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n\n case 9:\n k2 = _x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n case 8:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n\n case 7:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n\n case 6:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n\n case 5:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n\n case 4:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n\n case 3:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n\n case 2:\n k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n\n case 1:\n k1 = _x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n }\n\n h1 = _x64Xor(h1, [0, key.length]);\n h2 = _x64Xor(h2, [0, key.length]);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n h1 = _x64Fmix(h1);\n h2 = _x64Fmix(h2);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n return (\"00000000\" + (h1[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h1[1] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[1] >>> 0).toString(16)).slice(-8);\n };\n\n // INITIALIZATION\n // --------------\n\n // Export murmurHash3 for CommonJS, either as an AMD module or just as part\n // of the global object.\n if (true) {\n\n if ( true && module.exports) {\n exports = module.exports = library;\n }\n\n exports.murmurHash3 = library;\n\n } else {}\n})(this);\n\n\n//# sourceURL=webpack:///./node_modules/murmurhash3js/lib/murmurHash3js.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ndjson/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ndjson/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var through = __webpack_require__(/*! through2 */ \"./node_modules/ndjson/node_modules/through2/through2.js\")\nvar split = __webpack_require__(/*! split2 */ \"./node_modules/split2/index.js\")\nvar EOL = __webpack_require__(/*! os */ \"./node_modules/os-browserify/browser.js\").EOL\nvar stringify = __webpack_require__(/*! json-stringify-safe */ \"./node_modules/json-stringify-safe/stringify.js\")\n\nmodule.exports = parse\nmodule.exports.serialize = module.exports.stringify = serialize\nmodule.exports.parse = parse\n\nfunction parse (opts) {\n opts = opts || {}\n opts.strict = opts.strict !== false\n\n function parseRow (row) {\n try {\n if (row) return JSON.parse(row)\n } catch (e) {\n if (opts.strict) {\n this.emit('error', new Error('Could not parse row ' + row.slice(0, 50) + '...'))\n }\n }\n }\n\n return split(parseRow, opts)\n}\n\nfunction serialize (opts) {\n return through.obj(opts, function(obj, enc, cb) {\n cb(null, stringify(obj) + EOL)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/ndjson/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ndjson/node_modules/through2/through2.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/ndjson/node_modules/through2/through2.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var Transform = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Transform\n , inherits = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\").inherits\n\nfunction DestroyableTransform(opts) {\n Transform.call(this, opts)\n this._destroyed = false\n}\n\ninherits(DestroyableTransform, Transform)\n\nDestroyableTransform.prototype.destroy = function(err) {\n if (this._destroyed) return\n this._destroyed = true\n \n var self = this\n process.nextTick(function() {\n if (err)\n self.emit('error', err)\n self.emit('close')\n })\n}\n\n// a noop _transform function\nfunction noop (chunk, enc, callback) {\n callback(null, chunk)\n}\n\n\n// create a new export function, used by both the main export and\n// the .ctor export, contains common logic for dealing with arguments\nfunction through2 (construct) {\n return function (options, transform, flush) {\n if (typeof options == 'function') {\n flush = transform\n transform = options\n options = {}\n }\n\n if (typeof transform != 'function')\n transform = noop\n\n if (typeof flush != 'function')\n flush = null\n\n return construct(options, transform, flush)\n }\n}\n\n\n// main export, just make me a transform stream!\nmodule.exports = through2(function (options, transform, flush) {\n var t2 = new DestroyableTransform(options)\n\n t2._transform = transform\n\n if (flush)\n t2._flush = flush\n\n return t2\n})\n\n\n// make me a reusable prototype that I can `new`, or implicitly `new`\n// with a constructor call\nmodule.exports.ctor = through2(function (options, transform, flush) {\n function Through2 (override) {\n if (!(this instanceof Through2))\n return new Through2(override)\n\n this.options = Object.assign({}, options, override)\n\n DestroyableTransform.call(this, this.options)\n }\n\n inherits(Through2, DestroyableTransform)\n\n Through2.prototype._transform = transform\n\n if (flush)\n Through2.prototype._flush = flush\n\n return Through2\n})\n\n\nmodule.exports.obj = through2(function (options, transform, flush) {\n var t2 = new DestroyableTransform(Object.assign({ objectMode: true, highWaterMark: 16 }, options))\n\n t2._transform = transform\n\n if (flush)\n t2._flush = flush\n\n return t2\n})\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/ndjson/node_modules/through2/through2.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/next-event/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/next-event/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = nextEvent\n\nfunction nextEvent (emitter, name) {\n var next = null\n emitter.on(name, function (data) {\n if (!next) return\n var fn = next\n next = null\n fn(data)\n })\n\n return function (once) {\n next = once\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/next-event/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/aes.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/aes.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Advanced Encryption Standard (AES) implementation.\n *\n * This implementation is based on the public domain library 'jscrypto' which\n * was written by:\n *\n * Emily Stark (estark@stanford.edu)\n * Mike Hamburg (mhamburg@stanford.edu)\n * Dan Boneh (dabo@cs.stanford.edu)\n *\n * Parts of this code are based on the OpenSSL implementation of AES:\n * http://www.openssl.org\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./cipher */ \"./node_modules/node-forge/lib/cipher.js\");\n__webpack_require__(/*! ./cipherModes */ \"./node_modules/node-forge/lib/cipherModes.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\n/* AES API */\nmodule.exports = forge.aes = forge.aes || {};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('AES-<mode>', key);\n * cipher.start({iv: iv});\n *\n * Creates an AES cipher object to encrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as a string of bytes, an array of bytes,\n * a byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.startEncrypting = function(key, iv, output, mode) {\n var cipher = _createCipher({\n key: key,\n output: output,\n decrypt: false,\n mode: mode\n });\n cipher.start(iv);\n return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('AES-<mode>', key);\n *\n * Creates an AES cipher object to encrypt data using the given symmetric key.\n *\n * The key may be given as a string of bytes, an array of bytes, a\n * byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.createEncryptionCipher = function(key, mode) {\n return _createCipher({\n key: key,\n output: null,\n decrypt: false,\n mode: mode\n });\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('AES-<mode>', key);\n * decipher.start({iv: iv});\n *\n * Creates an AES cipher object to decrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as a string of bytes, an array of bytes,\n * a byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.startDecrypting = function(key, iv, output, mode) {\n var cipher = _createCipher({\n key: key,\n output: output,\n decrypt: true,\n mode: mode\n });\n cipher.start(iv);\n return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('AES-<mode>', key);\n *\n * Creates an AES cipher object to decrypt data using the given symmetric key.\n *\n * The key may be given as a string of bytes, an array of bytes, a\n * byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.createDecryptionCipher = function(key, mode) {\n return _createCipher({\n key: key,\n output: null,\n decrypt: true,\n mode: mode\n });\n};\n\n/**\n * Creates a new AES cipher algorithm object.\n *\n * @param name the name of the algorithm.\n * @param mode the mode factory function.\n *\n * @return the AES algorithm object.\n */\nforge.aes.Algorithm = function(name, mode) {\n if(!init) {\n initialize();\n }\n var self = this;\n self.name = name;\n self.mode = new mode({\n blockSize: 16,\n cipher: {\n encrypt: function(inBlock, outBlock) {\n return _updateBlock(self._w, inBlock, outBlock, false);\n },\n decrypt: function(inBlock, outBlock) {\n return _updateBlock(self._w, inBlock, outBlock, true);\n }\n }\n });\n self._init = false;\n};\n\n/**\n * Initializes this AES algorithm by expanding its key.\n *\n * @param options the options to use.\n * key the key to use with this algorithm.\n * decrypt true if the algorithm should be initialized for decryption,\n * false for encryption.\n */\nforge.aes.Algorithm.prototype.initialize = function(options) {\n if(this._init) {\n return;\n }\n\n var key = options.key;\n var tmp;\n\n /* Note: The key may be a string of bytes, an array of bytes, a byte\n buffer, or an array of 32-bit integers. If the key is in bytes, then\n it must be 16, 24, or 32 bytes in length. If it is in 32-bit\n integers, it must be 4, 6, or 8 integers long. */\n\n if(typeof key === 'string' &&\n (key.length === 16 || key.length === 24 || key.length === 32)) {\n // convert key string into byte buffer\n key = forge.util.createBuffer(key);\n } else if(forge.util.isArray(key) &&\n (key.length === 16 || key.length === 24 || key.length === 32)) {\n // convert key integer array into byte buffer\n tmp = key;\n key = forge.util.createBuffer();\n for(var i = 0; i < tmp.length; ++i) {\n key.putByte(tmp[i]);\n }\n }\n\n // convert key byte buffer into 32-bit integer array\n if(!forge.util.isArray(key)) {\n tmp = key;\n key = [];\n\n // key lengths of 16, 24, 32 bytes allowed\n var len = tmp.length();\n if(len === 16 || len === 24 || len === 32) {\n len = len >>> 2;\n for(var i = 0; i < len; ++i) {\n key.push(tmp.getInt32());\n }\n }\n }\n\n // key must be an array of 32-bit integers by now\n if(!forge.util.isArray(key) ||\n !(key.length === 4 || key.length === 6 || key.length === 8)) {\n throw new Error('Invalid key parameter.');\n }\n\n // encryption operation is always used for these modes\n var mode = this.mode.name;\n var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1);\n\n // do key expansion\n this._w = _expandKey(key, options.decrypt && !encryptOp);\n this._init = true;\n};\n\n/**\n * Expands a key. Typically only used for testing.\n *\n * @param key the symmetric key to expand, as an array of 32-bit words.\n * @param decrypt true to expand for decryption, false for encryption.\n *\n * @return the expanded key.\n */\nforge.aes._expandKey = function(key, decrypt) {\n if(!init) {\n initialize();\n }\n return _expandKey(key, decrypt);\n};\n\n/**\n * Updates a single block. Typically only used for testing.\n *\n * @param w the expanded key to use.\n * @param input an array of block-size 32-bit words.\n * @param output an array of block-size 32-bit words.\n * @param decrypt true to decrypt, false to encrypt.\n */\nforge.aes._updateBlock = _updateBlock;\n\n/** Register AES algorithms **/\n\nregisterAlgorithm('AES-ECB', forge.cipher.modes.ecb);\nregisterAlgorithm('AES-CBC', forge.cipher.modes.cbc);\nregisterAlgorithm('AES-CFB', forge.cipher.modes.cfb);\nregisterAlgorithm('AES-OFB', forge.cipher.modes.ofb);\nregisterAlgorithm('AES-CTR', forge.cipher.modes.ctr);\nregisterAlgorithm('AES-GCM', forge.cipher.modes.gcm);\n\nfunction registerAlgorithm(name, mode) {\n var factory = function() {\n return new forge.aes.Algorithm(name, mode);\n };\n forge.cipher.registerAlgorithm(name, factory);\n}\n\n/** AES implementation **/\n\nvar init = false; // not yet initialized\nvar Nb = 4; // number of words comprising the state (AES = 4)\nvar sbox; // non-linear substitution table used in key expansion\nvar isbox; // inversion of sbox\nvar rcon; // round constant word array\nvar mix; // mix-columns table\nvar imix; // inverse mix-columns table\n\n/**\n * Performs initialization, ie: precomputes tables to optimize for speed.\n *\n * One way to understand how AES works is to imagine that 'addition' and\n * 'multiplication' are interfaces that require certain mathematical\n * properties to hold true (ie: they are associative) but they might have\n * different implementations and produce different kinds of results ...\n * provided that their mathematical properties remain true. AES defines\n * its own methods of addition and multiplication but keeps some important\n * properties the same, ie: associativity and distributivity. The\n * explanation below tries to shed some light on how AES defines addition\n * and multiplication of bytes and 32-bit words in order to perform its\n * encryption and decryption algorithms.\n *\n * The basics:\n *\n * The AES algorithm views bytes as binary representations of polynomials\n * that have either 1 or 0 as the coefficients. It defines the addition\n * or subtraction of two bytes as the XOR operation. It also defines the\n * multiplication of two bytes as a finite field referred to as GF(2^8)\n * (Note: 'GF' means \"Galois Field\" which is a field that contains a finite\n * number of elements so GF(2^8) has 256 elements).\n *\n * This means that any two bytes can be represented as binary polynomials;\n * when they multiplied together and modularly reduced by an irreducible\n * polynomial of the 8th degree, the results are the field GF(2^8). The\n * specific irreducible polynomial that AES uses in hexadecimal is 0x11b.\n * This multiplication is associative with 0x01 as the identity:\n *\n * (b * 0x01 = GF(b, 0x01) = b).\n *\n * The operation GF(b, 0x02) can be performed at the byte level by left\n * shifting b once and then XOR'ing it (to perform the modular reduction)\n * with 0x11b if b is >= 128. Repeated application of the multiplication\n * of 0x02 can be used to implement the multiplication of any two bytes.\n *\n * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can\n * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these\n * factors can each be multiplied by 0x57 and then added together. To do\n * the multiplication, values for 0x57 multiplied by each of these 3 factors\n * can be precomputed and stored in a table. To add them, the values from\n * the table are XOR'd together.\n *\n * AES also defines addition and multiplication of words, that is 4-byte\n * numbers represented as polynomials of 3 degrees where the coefficients\n * are the values of the bytes.\n *\n * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0.\n *\n * Addition is performed by XOR'ing like powers of x. Multiplication\n * is performed in two steps, the first is an algebriac expansion as\n * you would do normally (where addition is XOR). But the result is\n * a polynomial larger than 3 degrees and thus it cannot fit in a word. So\n * next the result is modularly reduced by an AES-specific polynomial of\n * degree 4 which will always produce a polynomial of less than 4 degrees\n * such that it will fit in a word. In AES, this polynomial is x^4 + 1.\n *\n * The modular product of two polynomials 'a' and 'b' is thus:\n *\n * d(x) = d3x^3 + d2x^2 + d1x + d0\n * with\n * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3)\n * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3)\n * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3)\n * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3)\n *\n * As a matrix:\n *\n * [d0] = [a0 a3 a2 a1][b0]\n * [d1] [a1 a0 a3 a2][b1]\n * [d2] [a2 a1 a0 a3][b2]\n * [d3] [a3 a2 a1 a0][b3]\n *\n * Special polynomials defined by AES (0x02 == {02}):\n * a(x) = {03}x^3 + {01}x^2 + {01}x + {02}\n * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}.\n *\n * These polynomials are used in the MixColumns() and InverseMixColumns()\n * operations, respectively, to cause each element in the state to affect\n * the output (referred to as diffusing).\n *\n * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the\n * polynomial x3.\n *\n * The ShiftRows() method modifies the last 3 rows in the state (where\n * the state is 4 words with 4 bytes per word) by shifting bytes cyclically.\n * The 1st byte in the second row is moved to the end of the row. The 1st\n * and 2nd bytes in the third row are moved to the end of the row. The 1st,\n * 2nd, and 3rd bytes are moved in the fourth row.\n *\n * More details on how AES arithmetic works:\n *\n * In the polynomial representation of binary numbers, XOR performs addition\n * and subtraction and multiplication in GF(2^8) denoted as GF(a, b)\n * corresponds with the multiplication of polynomials modulo an irreducible\n * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply\n * polynomial 'a' with polynomial 'b' and then do a modular reduction by\n * an AES-specific irreducible polynomial of degree 8.\n *\n * A polynomial is irreducible if its only divisors are one and itself. For\n * the AES algorithm, this irreducible polynomial is:\n *\n * m(x) = x^8 + x^4 + x^3 + x + 1,\n *\n * or {01}{1b} in hexadecimal notation, where each coefficient is a bit:\n * 100011011 = 283 = 0x11b.\n *\n * For example, GF(0x57, 0x83) = 0xc1 because\n *\n * 0x57 = 87 = 01010111 = x^6 + x^4 + x^2 + x + 1\n * 0x85 = 131 = 10000101 = x^7 + x + 1\n *\n * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1)\n * = x^13 + x^11 + x^9 + x^8 + x^7 +\n * x^7 + x^5 + x^3 + x^2 + x +\n * x^6 + x^4 + x^2 + x + 1\n * = x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y\n * y modulo (x^8 + x^4 + x^3 + x + 1)\n * = x^7 + x^6 + 1.\n *\n * The modular reduction by m(x) guarantees the result will be a binary\n * polynomial of less than degree 8, so that it can fit in a byte.\n *\n * The operation to multiply a binary polynomial b with x (the polynomial\n * x in binary representation is 00000010) is:\n *\n * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1\n *\n * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the\n * most significant bit is 0 in b) then the result is already reduced. If\n * it is 1, then we can reduce it by subtracting m(x) via an XOR.\n *\n * It follows that multiplication by x (00000010 or 0x02) can be implemented\n * by performing a left shift followed by a conditional bitwise XOR with\n * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by\n * higher powers of x can be implemented by repeated application of xtime().\n *\n * By adding intermediate results, multiplication by any constant can be\n * implemented. For instance:\n *\n * GF(0x57, 0x13) = 0xfe because:\n *\n * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1)\n *\n * Note: We XOR with 0x11b instead of 0x1b because in javascript our\n * datatype for b can be larger than 1 byte, so a left shift will not\n * automatically eliminate bits that overflow a byte ... by XOR'ing the\n * overflow bit with 1 (the extra one from 0x11b) we zero it out.\n *\n * GF(0x57, 0x02) = xtime(0x57) = 0xae\n * GF(0x57, 0x04) = xtime(0xae) = 0x47\n * GF(0x57, 0x08) = xtime(0x47) = 0x8e\n * GF(0x57, 0x10) = xtime(0x8e) = 0x07\n *\n * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10))\n *\n * And by the distributive property (since XOR is addition and GF() is\n * multiplication):\n *\n * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10)\n * = 0x57 ^ 0xae ^ 0x07\n * = 0xfe.\n */\nfunction initialize() {\n init = true;\n\n /* Populate the Rcon table. These are the values given by\n [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02)\n in the field of GF(2^8), where i starts at 1.\n\n rcon[0] = [0x00, 0x00, 0x00, 0x00]\n rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1\n rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2\n ...\n rcon[9] = [0x1B, 0x00, 0x00, 0x00] 2^(9-1) = 2^8 = 0x1B\n rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36\n\n We only store the first byte because it is the only one used.\n */\n rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36];\n\n // compute xtime table which maps i onto GF(i, 0x02)\n var xtime = new Array(256);\n for(var i = 0; i < 128; ++i) {\n xtime[i] = i << 1;\n xtime[i + 128] = (i + 128) << 1 ^ 0x11B;\n }\n\n // compute all other tables\n sbox = new Array(256);\n isbox = new Array(256);\n mix = new Array(4);\n imix = new Array(4);\n for(var i = 0; i < 4; ++i) {\n mix[i] = new Array(256);\n imix[i] = new Array(256);\n }\n var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime;\n for(var i = 0; i < 256; ++i) {\n /* We need to generate the SubBytes() sbox and isbox tables so that\n we can perform byte substitutions. This requires us to traverse\n all of the elements in GF, find their multiplicative inverses,\n and apply to each the following affine transformation:\n\n bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^\n b(i + 7) mod 8 ^ ci\n for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the\n ith bit of a byte c with the value {63} or {01100011}.\n\n It is possible to traverse every possible value in a Galois field\n using what is referred to as a 'generator'. There are many\n generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully\n traverse GF we iterate 255 times, multiplying by our generator\n each time.\n\n On each iteration we can determine the multiplicative inverse for\n the current element.\n\n Suppose there is an element in GF 'e'. For a given generator 'g',\n e = g^x. The multiplicative inverse of e is g^(255 - x). It turns\n out that if use the inverse of a generator as another generator\n it will produce all of the corresponding multiplicative inverses\n at the same time. For this reason, we choose 5 as our inverse\n generator because it only requires 2 multiplies and 1 add and its\n inverse, 82, requires relatively few operations as well.\n\n In order to apply the affine transformation, the multiplicative\n inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a\n bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and\n 'x'. Then 's' is left shifted and the high bit of 's' is made the\n low bit. The resulting value is stored in 's'. Then 'x' is XOR'd\n with 's' and stored in 'x'. On each subsequent iteration the same\n operation is performed. When 4 iterations are complete, 'x' is\n XOR'd with 'c' (0x63) and the transformed value is stored in 'x'.\n For example:\n\n s = 01000001\n x = 01000001\n\n iteration 1: s = 10000010, x ^= s\n iteration 2: s = 00000101, x ^= s\n iteration 3: s = 00001010, x ^= s\n iteration 4: s = 00010100, x ^= s\n x ^= 0x63\n\n This can be done with a loop where s = (s << 1) | (s >> 7). However,\n it can also be done by using a single 16-bit (in this case 32-bit)\n number 'sx'. Since XOR is an associative operation, we can set 'sx'\n to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times.\n The most significant bits will flow into the high 8 bit positions\n and be correctly XOR'd with one another. All that remains will be\n to cycle the high 8 bits by XOR'ing them all with the lower 8 bits\n afterwards.\n\n At the same time we're populating sbox and isbox we can precompute\n the multiplication we'll need to do to do MixColumns() later.\n */\n\n // apply affine transformation\n sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4);\n sx = (sx >> 8) ^ (sx & 255) ^ 0x63;\n\n // update tables\n sbox[e] = sx;\n isbox[sx] = e;\n\n /* Mixing columns is done using matrix multiplication. The columns\n that are to be mixed are each a single word in the current state.\n The state has Nb columns (4 columns). Therefore each column is a\n 4 byte word. So to mix the columns in a single column 'c' where\n its rows are r0, r1, r2, and r3, we use the following matrix\n multiplication:\n\n [2 3 1 1]*[r0,c]=[r'0,c]\n [1 2 3 1] [r1,c] [r'1,c]\n [1 1 2 3] [r2,c] [r'2,c]\n [3 1 1 2] [r3,c] [r'3,c]\n\n r0, r1, r2, and r3 are each 1 byte of one of the words in the\n state (a column). To do matrix multiplication for each mixed\n column c' we multiply the corresponding row from the left matrix\n with the corresponding column from the right matrix. In total, we\n get 4 equations:\n\n r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c\n r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c\n r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c\n r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c\n\n As usual, the multiplication is as previously defined and the\n addition is XOR. In order to optimize mixing columns we can store\n the multiplication results in tables. If you think of the whole\n column as a word (it might help to visualize by mentally rotating\n the equations above by counterclockwise 90 degrees) then you can\n see that it would be useful to map the multiplications performed on\n each byte (r0, r1, r2, r3) onto a word as well. For instance, we\n could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the\n highest 8 bits and 3*r0 in the lowest 8 bits (with the other two\n respectively in the middle). This means that a table can be\n constructed that uses r0 as an index to the word. We can do the\n same with r1, r2, and r3, creating a total of 4 tables.\n\n To construct a full c', we can just look up each byte of c in\n their respective tables and XOR the results together.\n\n Also, to build each table we only have to calculate the word\n for 2,1,1,3 for every byte ... which we can do on each iteration\n of this loop since we will iterate over every byte. After we have\n calculated 2,1,1,3 we can get the results for the other tables\n by cycling the byte at the end to the beginning. For instance\n we can take the result of table 2,1,1,3 and produce table 3,2,1,1\n by moving the right most byte to the left most position just like\n how you can imagine the 3 moved out of 2,1,1,3 and to the front\n to produce 3,2,1,1.\n\n There is another optimization in that the same multiples of\n the current element we need in order to advance our generator\n to the next iteration can be reused in performing the 2,1,1,3\n calculation. We also calculate the inverse mix column tables,\n with e,9,d,b being the inverse of 2,1,1,3.\n\n When we're done, and we need to actually mix columns, the first\n byte of each state word should be put through mix[0] (2,1,1,3),\n the second through mix[1] (3,2,1,1) and so forth. Then they should\n be XOR'd together to produce the fully mixed column.\n */\n\n // calculate mix and imix table values\n sx2 = xtime[sx];\n e2 = xtime[e];\n e4 = xtime[e2];\n e8 = xtime[e4];\n me =\n (sx2 << 24) ^ // 2\n (sx << 16) ^ // 1\n (sx << 8) ^ // 1\n (sx ^ sx2); // 3\n ime =\n (e2 ^ e4 ^ e8) << 24 ^ // E (14)\n (e ^ e8) << 16 ^ // 9\n (e ^ e4 ^ e8) << 8 ^ // D (13)\n (e ^ e2 ^ e8); // B (11)\n // produce each of the mix tables by rotating the 2,1,1,3 value\n for(var n = 0; n < 4; ++n) {\n mix[n][e] = me;\n imix[n][sx] = ime;\n // cycle the right most byte to the left most position\n // ie: 2,1,1,3 becomes 3,2,1,1\n me = me << 24 | me >>> 8;\n ime = ime << 24 | ime >>> 8;\n }\n\n // get next element and inverse\n if(e === 0) {\n // 1 is the inverse of 1\n e = ei = 1;\n } else {\n // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator)\n // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator)\n e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]];\n ei ^= xtime[xtime[ei]];\n }\n }\n}\n\n/**\n * Generates a key schedule using the AES key expansion algorithm.\n *\n * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion\n * routine to generate a key schedule. The Key Expansion generates a total\n * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words,\n * and each of the Nr rounds requires Nb words of key data. The resulting\n * key schedule consists of a linear array of 4-byte words, denoted [wi ],\n * with i in the range 0 ≤ i < Nb(Nr + 1).\n *\n * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk)\n * AES-128 (Nb=4, Nk=4, Nr=10)\n * AES-192 (Nb=4, Nk=6, Nr=12)\n * AES-256 (Nb=4, Nk=8, Nr=14)\n * Note: Nr=Nk+6.\n *\n * Nb is the number of columns (32-bit words) comprising the State (or\n * number of bytes in a block). For AES, Nb=4.\n *\n * @param key the key to schedule (as an array of 32-bit words).\n * @param decrypt true to modify the key schedule to decrypt, false not to.\n *\n * @return the generated key schedule.\n */\nfunction _expandKey(key, decrypt) {\n // copy the key's words to initialize the key schedule\n var w = key.slice(0);\n\n /* RotWord() will rotate a word, moving the first byte to the last\n byte's position (shifting the other bytes left).\n\n We will be getting the value of Rcon at i / Nk. 'i' will iterate\n from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in\n a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from\n 4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will\n increase by 1. We use a counter iNk to keep track of this.\n */\n\n // go through the rounds expanding the key\n var temp, iNk = 1;\n var Nk = w.length;\n var Nr1 = Nk + 6 + 1;\n var end = Nb * Nr1;\n for(var i = Nk; i < end; ++i) {\n temp = w[i - 1];\n if(i % Nk === 0) {\n // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk]\n temp =\n sbox[temp >>> 16 & 255] << 24 ^\n sbox[temp >>> 8 & 255] << 16 ^\n sbox[temp & 255] << 8 ^\n sbox[temp >>> 24] ^ (rcon[iNk] << 24);\n iNk++;\n } else if(Nk > 6 && (i % Nk === 4)) {\n // temp = SubWord(temp)\n temp =\n sbox[temp >>> 24] << 24 ^\n sbox[temp >>> 16 & 255] << 16 ^\n sbox[temp >>> 8 & 255] << 8 ^\n sbox[temp & 255];\n }\n w[i] = w[i - Nk] ^ temp;\n }\n\n /* When we are updating a cipher block we always use the code path for\n encryption whether we are decrypting or not (to shorten code and\n simplify the generation of look up tables). However, because there\n are differences in the decryption algorithm, other than just swapping\n in different look up tables, we must transform our key schedule to\n account for these changes:\n\n 1. The decryption algorithm gets its key rounds in reverse order.\n 2. The decryption algorithm adds the round key before mixing columns\n instead of afterwards.\n\n We don't need to modify our key schedule to handle the first case,\n we can just traverse the key schedule in reverse order when decrypting.\n\n The second case requires a little work.\n\n The tables we built for performing rounds will take an input and then\n perform SubBytes() and MixColumns() or, for the decrypt version,\n InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires\n us to AddRoundKey() before InvMixColumns(). This means we'll need to\n apply some transformations to the round key to inverse-mix its columns\n so they'll be correct for moving AddRoundKey() to after the state has\n had its columns inverse-mixed.\n\n To inverse-mix the columns of the state when we're decrypting we use a\n lookup table that will apply InvSubBytes() and InvMixColumns() at the\n same time. However, the round key's bytes are not inverse-substituted\n in the decryption algorithm. To get around this problem, we can first\n substitute the bytes in the round key so that when we apply the\n transformation via the InvSubBytes()+InvMixColumns() table, it will\n undo our substitution leaving us with the original value that we\n want -- and then inverse-mix that value.\n\n This change will correctly alter our key schedule so that we can XOR\n each round key with our already transformed decryption state. This\n allows us to use the same code path as the encryption algorithm.\n\n We make one more change to the decryption key. Since the decryption\n algorithm runs in reverse from the encryption algorithm, we reverse\n the order of the round keys to avoid having to iterate over the key\n schedule backwards when running the encryption algorithm later in\n decryption mode. In addition to reversing the order of the round keys,\n we also swap each round key's 2nd and 4th rows. See the comments\n section where rounds are performed for more details about why this is\n done. These changes are done inline with the other substitution\n described above.\n */\n if(decrypt) {\n var tmp;\n var m0 = imix[0];\n var m1 = imix[1];\n var m2 = imix[2];\n var m3 = imix[3];\n var wnew = w.slice(0);\n end = w.length;\n for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) {\n // do not sub the first or last round key (round keys are Nb\n // words) as no column mixing is performed before they are added,\n // but do change the key order\n if(i === 0 || i === (end - Nb)) {\n wnew[i] = w[wi];\n wnew[i + 1] = w[wi + 3];\n wnew[i + 2] = w[wi + 2];\n wnew[i + 3] = w[wi + 1];\n } else {\n // substitute each round key byte because the inverse-mix\n // table will inverse-substitute it (effectively cancel the\n // substitution because round key bytes aren't sub'd in\n // decryption mode) and swap indexes 3 and 1\n for(var n = 0; n < Nb; ++n) {\n tmp = w[wi + n];\n wnew[i + (3&-n)] =\n m0[sbox[tmp >>> 24]] ^\n m1[sbox[tmp >>> 16 & 255]] ^\n m2[sbox[tmp >>> 8 & 255]] ^\n m3[sbox[tmp & 255]];\n }\n }\n }\n w = wnew;\n }\n\n return w;\n}\n\n/**\n * Updates a single block (16 bytes) using AES. The update will either\n * encrypt or decrypt the block.\n *\n * @param w the key schedule.\n * @param input the input block (an array of 32-bit words).\n * @param output the updated output block.\n * @param decrypt true to decrypt the block, false to encrypt it.\n */\nfunction _updateBlock(w, input, output, decrypt) {\n /*\n Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)])\n begin\n byte state[4,Nb]\n state = in\n AddRoundKey(state, w[0, Nb-1])\n for round = 1 step 1 to Nr–1\n SubBytes(state)\n ShiftRows(state)\n MixColumns(state)\n AddRoundKey(state, w[round*Nb, (round+1)*Nb-1])\n end for\n SubBytes(state)\n ShiftRows(state)\n AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n out = state\n end\n\n InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)])\n begin\n byte state[4,Nb]\n state = in\n AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n for round = Nr-1 step -1 downto 1\n InvShiftRows(state)\n InvSubBytes(state)\n AddRoundKey(state, w[round*Nb, (round+1)*Nb-1])\n InvMixColumns(state)\n end for\n InvShiftRows(state)\n InvSubBytes(state)\n AddRoundKey(state, w[0, Nb-1])\n out = state\n end\n */\n\n // Encrypt: AddRoundKey(state, w[0, Nb-1])\n // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n var Nr = w.length / 4 - 1;\n var m0, m1, m2, m3, sub;\n if(decrypt) {\n m0 = imix[0];\n m1 = imix[1];\n m2 = imix[2];\n m3 = imix[3];\n sub = isbox;\n } else {\n m0 = mix[0];\n m1 = mix[1];\n m2 = mix[2];\n m3 = mix[3];\n sub = sbox;\n }\n var a, b, c, d, a2, b2, c2;\n a = input[0] ^ w[0];\n b = input[decrypt ? 3 : 1] ^ w[1];\n c = input[2] ^ w[2];\n d = input[decrypt ? 1 : 3] ^ w[3];\n var i = 3;\n\n /* In order to share code we follow the encryption algorithm when both\n encrypting and decrypting. To account for the changes required in the\n decryption algorithm, we use different lookup tables when decrypting\n and use a modified key schedule to account for the difference in the\n order of transformations applied when performing rounds. We also get\n key rounds in reverse order (relative to encryption). */\n for(var round = 1; round < Nr; ++round) {\n /* As described above, we'll be using table lookups to perform the\n column mixing. Each column is stored as a word in the state (the\n array 'input' has one column as a word at each index). In order to\n mix a column, we perform these transformations on each row in c,\n which is 1 byte in each word. The new column for c0 is c'0:\n\n m0 m1 m2 m3\n r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0\n r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0\n r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0\n r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0\n\n So using mix tables where c0 is a word with r0 being its upper\n 8 bits and r3 being its lower 8 bits:\n\n m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0]\n ...\n m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3]\n\n Therefore to mix the columns in each word in the state we\n do the following (& 255 omitted for brevity):\n c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n\n However, before mixing, the algorithm requires us to perform\n ShiftRows(). The ShiftRows() transformation cyclically shifts the\n last 3 rows of the state over different offsets. The first row\n (r = 0) is not shifted.\n\n s'_r,c = s_r,(c + shift(r, Nb) mod Nb\n for 0 < r < 4 and 0 <= c < Nb and\n shift(1, 4) = 1\n shift(2, 4) = 2\n shift(3, 4) = 3.\n\n This causes the first byte in r = 1 to be moved to the end of\n the row, the first 2 bytes in r = 2 to be moved to the end of\n the row, the first 3 bytes in r = 3 to be moved to the end of\n the row:\n\n r1: [c0 c1 c2 c3] => [c1 c2 c3 c0]\n r2: [c0 c1 c2 c3] [c2 c3 c0 c1]\n r3: [c0 c1 c2 c3] [c3 c0 c1 c2]\n\n We can make these substitutions inline with our column mixing to\n generate an updated set of equations to produce each word in the\n state (note the columns have changed positions):\n\n c0 c1 c2 c3 => c0 c1 c2 c3\n c0 c1 c2 c3 c1 c2 c3 c0 (cycled 1 byte)\n c0 c1 c2 c3 c2 c3 c0 c1 (cycled 2 bytes)\n c0 c1 c2 c3 c3 c0 c1 c2 (cycled 3 bytes)\n\n Therefore:\n\n c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3\n c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3\n c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3\n c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3\n\n c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0\n c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0\n c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0\n c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0\n\n ... and so forth for c'2 and c'3. The important distinction is\n that the columns are cycling, with c0 being used with the m0\n map when calculating c0, but c1 being used with the m0 map when\n calculating c1 ... and so forth.\n\n When performing the inverse we transform the mirror image and\n skip the bottom row, instead of the top one, and move upwards:\n\n c3 c2 c1 c0 => c0 c3 c2 c1 (cycled 3 bytes) *same as encryption\n c3 c2 c1 c0 c1 c0 c3 c2 (cycled 2 bytes)\n c3 c2 c1 c0 c2 c1 c0 c3 (cycled 1 byte) *same as encryption\n c3 c2 c1 c0 c3 c2 c1 c0\n\n If you compare the resulting matrices for ShiftRows()+MixColumns()\n and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are\n different (in encrypt mode vs. decrypt mode). So in order to use\n the same code to handle both encryption and decryption, we will\n need to do some mapping.\n\n If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r<N> be\n a row number in the state, then the resulting matrix in encryption\n mode for applying the above transformations would be:\n\n r1: a b c d\n r2: b c d a\n r3: c d a b\n r4: d a b c\n\n If we did the same in decryption mode we would get:\n\n r1: a d c b\n r2: b a d c\n r3: c b a d\n r4: d c b a\n\n If instead we swap d and b (set b=c3 and d=c1), then we get:\n\n r1: a b c d\n r2: d a b c\n r3: c d a b\n r4: b c d a\n\n Now the 1st and 3rd rows are the same as the encryption matrix. All\n we need to do then to make the mapping exactly the same is to swap\n the 2nd and 4th rows when in decryption mode. To do this without\n having to do it on each iteration, we swapped the 2nd and 4th rows\n in the decryption key schedule. We also have to do the swap above\n when we first pull in the input and when we set the final output. */\n a2 =\n m0[a >>> 24] ^\n m1[b >>> 16 & 255] ^\n m2[c >>> 8 & 255] ^\n m3[d & 255] ^ w[++i];\n b2 =\n m0[b >>> 24] ^\n m1[c >>> 16 & 255] ^\n m2[d >>> 8 & 255] ^\n m3[a & 255] ^ w[++i];\n c2 =\n m0[c >>> 24] ^\n m1[d >>> 16 & 255] ^\n m2[a >>> 8 & 255] ^\n m3[b & 255] ^ w[++i];\n d =\n m0[d >>> 24] ^\n m1[a >>> 16 & 255] ^\n m2[b >>> 8 & 255] ^\n m3[c & 255] ^ w[++i];\n a = a2;\n b = b2;\n c = c2;\n }\n\n /*\n Encrypt:\n SubBytes(state)\n ShiftRows(state)\n AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n\n Decrypt:\n InvShiftRows(state)\n InvSubBytes(state)\n AddRoundKey(state, w[0, Nb-1])\n */\n // Note: rows are shifted inline\n output[0] =\n (sub[a >>> 24] << 24) ^\n (sub[b >>> 16 & 255] << 16) ^\n (sub[c >>> 8 & 255] << 8) ^\n (sub[d & 255]) ^ w[++i];\n output[decrypt ? 3 : 1] =\n (sub[b >>> 24] << 24) ^\n (sub[c >>> 16 & 255] << 16) ^\n (sub[d >>> 8 & 255] << 8) ^\n (sub[a & 255]) ^ w[++i];\n output[2] =\n (sub[c >>> 24] << 24) ^\n (sub[d >>> 16 & 255] << 16) ^\n (sub[a >>> 8 & 255] << 8) ^\n (sub[b & 255]) ^ w[++i];\n output[decrypt ? 1 : 3] =\n (sub[d >>> 24] << 24) ^\n (sub[a >>> 16 & 255] << 16) ^\n (sub[b >>> 8 & 255] << 8) ^\n (sub[c & 255]) ^ w[++i];\n}\n\n/**\n * Deprecated. Instead, use:\n *\n * forge.cipher.createCipher('AES-<mode>', key);\n * forge.cipher.createDecipher('AES-<mode>', key);\n *\n * Creates a deprecated AES cipher object. This object's mode will default to\n * CBC (cipher-block-chaining).\n *\n * The key and iv may be given as a string of bytes, an array of bytes, a\n * byte buffer, or an array of 32-bit words.\n *\n * @param options the options to use.\n * key the symmetric key to use.\n * output the buffer to write to.\n * decrypt true for decryption, false for encryption.\n * mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nfunction _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/aes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/asn1.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/asn1.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Javascript implementation of Abstract Syntax Notation Number One.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2015 Digital Bazaar, Inc.\n *\n * An API for storing data using the Abstract Syntax Notation Number One\n * format using DER (Distinguished Encoding Rules) encoding. This encoding is\n * commonly used to store data for PKI, i.e. X.509 Certificates, and this\n * implementation exists for that purpose.\n *\n * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract\n * syntax of information without restricting the way the information is encoded\n * for transmission. It provides a standard that allows for open systems\n * communication. ASN.1 defines the syntax of information data and a number of\n * simple data types as well as a notation for describing them and specifying\n * values for them.\n *\n * The RSA algorithm creates public and private keys that are often stored in\n * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This\n * class provides the most basic functionality required to store and load DSA\n * keys that are encoded according to ASN.1.\n *\n * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules)\n * and DER (Distinguished Encoding Rules). DER is just a subset of BER that\n * has stricter requirements for how data must be encoded.\n *\n * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type)\n * and a byte array for the value of this ASN1 structure which may be data or a\n * list of ASN.1 structures.\n *\n * Each ASN.1 structure using BER is (Tag-Length-Value):\n *\n * | byte 0 | bytes X | bytes Y |\n * |--------|---------|----------\n * | tag | length | value |\n *\n * ASN.1 allows for tags to be of \"High-tag-number form\" which allows a tag to\n * be two or more octets, but that is not supported by this class. A tag is\n * only 1 byte. Bits 1-5 give the tag number (ie the data type within a\n * particular 'class'), 6 indicates whether or not the ASN.1 value is\n * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If\n * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set,\n * then the class is APPLICATION. If only bit 8 is set, then the class is\n * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE.\n * The tag numbers for the data types for the class UNIVERSAL are listed below:\n *\n * UNIVERSAL 0 Reserved for use by the encoding rules\n * UNIVERSAL 1 Boolean type\n * UNIVERSAL 2 Integer type\n * UNIVERSAL 3 Bitstring type\n * UNIVERSAL 4 Octetstring type\n * UNIVERSAL 5 Null type\n * UNIVERSAL 6 Object identifier type\n * UNIVERSAL 7 Object descriptor type\n * UNIVERSAL 8 External type and Instance-of type\n * UNIVERSAL 9 Real type\n * UNIVERSAL 10 Enumerated type\n * UNIVERSAL 11 Embedded-pdv type\n * UNIVERSAL 12 UTF8String type\n * UNIVERSAL 13 Relative object identifier type\n * UNIVERSAL 14-15 Reserved for future editions\n * UNIVERSAL 16 Sequence and Sequence-of types\n * UNIVERSAL 17 Set and Set-of types\n * UNIVERSAL 18-22, 25-30 Character string types\n * UNIVERSAL 23-24 Time types\n *\n * The length of an ASN.1 structure is specified after the tag identifier.\n * There is a definite form and an indefinite form. The indefinite form may\n * be used if the encoding is constructed and not all immediately available.\n * The indefinite form is encoded using a length byte with only the 8th bit\n * set. The end of the constructed object is marked using end-of-contents\n * octets (two zero bytes).\n *\n * The definite form looks like this:\n *\n * The length may take up 1 or more bytes, it depends on the length of the\n * value of the ASN.1 structure. DER encoding requires that if the ASN.1\n * structure has a value that has a length greater than 127, more than 1 byte\n * will be used to store its length, otherwise just one byte will be used.\n * This is strict.\n *\n * In the case that the length of the ASN.1 value is less than 127, 1 octet\n * (byte) is used to store the \"short form\" length. The 8th bit has a value of\n * 0 indicating the length is \"short form\" and not \"long form\" and bits 7-1\n * give the length of the data. (The 8th bit is the left-most, most significant\n * bit: also known as big endian or network format).\n *\n * In the case that the length of the ASN.1 value is greater than 127, 2 to\n * 127 octets (bytes) are used to store the \"long form\" length. The first\n * byte's 8th bit is set to 1 to indicate the length is \"long form.\" Bits 7-1\n * give the number of additional octets. All following octets are in base 256\n * with the most significant digit first (typical big-endian binary unsigned\n * integer storage). So, for instance, if the length of a value was 257, the\n * first byte would be set to:\n *\n * 10000010 = 130 = 0x82.\n *\n * This indicates there are 2 octets (base 256) for the length. The second and\n * third bytes (the octets just mentioned) would store the length in base 256:\n *\n * octet 2: 00000001 = 1 * 256^1 = 256\n * octet 3: 00000001 = 1 * 256^0 = 1\n * total = 257\n *\n * The algorithm for converting a js integer value of 257 to base-256 is:\n *\n * var value = 257;\n * var bytes = [];\n * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first\n * bytes[1] = value & 0xFF; // least significant byte last\n *\n * On the ASN.1 UNIVERSAL Object Identifier (OID) type:\n *\n * An OID can be written like: \"value1.value2.value3...valueN\"\n *\n * The DER encoding rules:\n *\n * The first byte has the value 40 * value1 + value2.\n * The following bytes, if any, encode the remaining values. Each value is\n * encoded in base 128, most significant digit first (big endian), with as\n * few digits as possible, and the most significant bit of each byte set\n * to 1 except the last in each value's encoding. For example: Given the\n * OID \"1.2.840.113549\", its DER encoding is (remember each byte except the\n * last one in each encoding is OR'd with 0x80):\n *\n * byte 1: 40 * 1 + 2 = 42 = 0x2A.\n * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648\n * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D\n *\n * The final value is: 0x2A864886F70D.\n * The full OID (including ASN.1 tag and length of 6 bytes) is:\n * 0x06062A864886F70D\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n__webpack_require__(/*! ./oids */ \"./node_modules/node-forge/lib/oids.js\");\n\n/* ASN.1 API */\nvar asn1 = module.exports = forge.asn1 = forge.asn1 || {};\n\n/**\n * ASN.1 classes.\n */\nasn1.Class = {\n UNIVERSAL: 0x00,\n APPLICATION: 0x40,\n CONTEXT_SPECIFIC: 0x80,\n PRIVATE: 0xC0\n};\n\n/**\n * ASN.1 types. Not all types are supported by this implementation, only\n * those necessary to implement a simple PKI are implemented.\n */\nasn1.Type = {\n NONE: 0,\n BOOLEAN: 1,\n INTEGER: 2,\n BITSTRING: 3,\n OCTETSTRING: 4,\n NULL: 5,\n OID: 6,\n ODESC: 7,\n EXTERNAL: 8,\n REAL: 9,\n ENUMERATED: 10,\n EMBEDDED: 11,\n UTF8: 12,\n ROID: 13,\n SEQUENCE: 16,\n SET: 17,\n PRINTABLESTRING: 19,\n IA5STRING: 22,\n UTCTIME: 23,\n GENERALIZEDTIME: 24,\n BMPSTRING: 30\n};\n\n/**\n * Creates a new asn1 object.\n *\n * @param tagClass the tag class for the object.\n * @param type the data type (tag number) for the object.\n * @param constructed true if the asn1 object is in constructed form.\n * @param value the value for the object, if it is not constructed.\n * @param [options] the options to use:\n * [bitStringContents] the plain BIT STRING content including padding\n * byte.\n *\n * @return the asn1 object.\n */\nasn1.create = function(tagClass, type, constructed, value, options) {\n /* An asn1 object has a tagClass, a type, a constructed flag, and a\n value. The value's type depends on the constructed flag. If\n constructed, it will contain a list of other asn1 objects. If not,\n it will contain the ASN.1 value as an array of bytes formatted\n according to the ASN.1 data type. */\n\n // remove undefined values\n if(forge.util.isArray(value)) {\n var tmp = [];\n for(var i = 0; i < value.length; ++i) {\n if(value[i] !== undefined) {\n tmp.push(value[i]);\n }\n }\n value = tmp;\n }\n\n var obj = {\n tagClass: tagClass,\n type: type,\n constructed: constructed,\n composed: constructed || forge.util.isArray(value),\n value: value\n };\n if(options && 'bitStringContents' in options) {\n // TODO: copy byte buffer if it's a buffer not a string\n obj.bitStringContents = options.bitStringContents;\n // TODO: add readonly flag to avoid this overhead\n // save copy to detect changes\n obj.original = asn1.copy(obj);\n }\n return obj;\n};\n\n/**\n * Copies an asn1 object.\n *\n * @param obj the asn1 object.\n * @param [options] copy options:\n * [excludeBitStringContents] true to not copy bitStringContents\n *\n * @return the a copy of the asn1 object.\n */\nasn1.copy = function(obj, options) {\n var copy;\n\n if(forge.util.isArray(obj)) {\n copy = [];\n for(var i = 0; i < obj.length; ++i) {\n copy.push(asn1.copy(obj[i], options));\n }\n return copy;\n }\n\n if(typeof obj === 'string') {\n // TODO: copy byte buffer if it's a buffer not a string\n return obj;\n }\n\n copy = {\n tagClass: obj.tagClass,\n type: obj.type,\n constructed: obj.constructed,\n composed: obj.composed,\n value: asn1.copy(obj.value, options)\n };\n if(options && !options.excludeBitStringContents) {\n // TODO: copy byte buffer if it's a buffer not a string\n copy.bitStringContents = obj.bitStringContents;\n }\n return copy;\n};\n\n/**\n * Compares asn1 objects for equality.\n *\n * Note this function does not run in constant time.\n *\n * @param obj1 the first asn1 object.\n * @param obj2 the second asn1 object.\n * @param [options] compare options:\n * [includeBitStringContents] true to compare bitStringContents\n *\n * @return true if the asn1 objects are equal.\n */\nasn1.equals = function(obj1, obj2, options) {\n if(forge.util.isArray(obj1)) {\n if(!forge.util.isArray(obj2)) {\n return false;\n }\n if(obj1.length !== obj2.length) {\n return false;\n }\n for(var i = 0; i < obj1.length; ++i) {\n if(!asn1.equals(obj1[i], obj2[i])) {\n return false;\n }\n }\n return true;\n }\n\n if(typeof obj1 !== typeof obj2) {\n return false;\n }\n\n if(typeof obj1 === 'string') {\n return obj1 === obj2;\n }\n\n var equal = obj1.tagClass === obj2.tagClass &&\n obj1.type === obj2.type &&\n obj1.constructed === obj2.constructed &&\n obj1.composed === obj2.composed &&\n asn1.equals(obj1.value, obj2.value);\n if(options && options.includeBitStringContents) {\n equal = equal && (obj1.bitStringContents === obj2.bitStringContents);\n }\n\n return equal;\n};\n\n/**\n * Gets the length of a BER-encoded ASN.1 value.\n *\n * In case the length is not specified, undefined is returned.\n *\n * @param b the BER-encoded ASN.1 byte buffer, starting with the first\n * length byte.\n *\n * @return the length of the BER-encoded ASN.1 value or undefined.\n */\nasn1.getBerValueLength = function(b) {\n // TODO: move this function and related DER/BER functions to a der.js\n // file; better abstract ASN.1 away from der/ber.\n var b2 = b.getByte();\n if(b2 === 0x80) {\n return undefined;\n }\n\n // see if the length is \"short form\" or \"long form\" (bit 8 set)\n var length;\n var longForm = b2 & 0x80;\n if(!longForm) {\n // length is just the first byte\n length = b2;\n } else {\n // the number of bytes the length is specified in bits 7 through 1\n // and each length byte is in big-endian base-256\n length = b.getInt((b2 & 0x7F) << 3);\n }\n return length;\n};\n\n/**\n * Check if the byte buffer has enough bytes. Throws an Error if not.\n *\n * @param bytes the byte buffer to parse from.\n * @param remaining the bytes remaining in the current parsing state.\n * @param n the number of bytes the buffer must have.\n */\nfunction _checkBufferLength(bytes, remaining, n) {\n if(n > remaining) {\n var error = new Error('Too few bytes to parse DER.');\n error.available = bytes.length();\n error.remaining = remaining;\n error.requested = n;\n throw error;\n }\n}\n\n/**\n * Gets the length of a BER-encoded ASN.1 value.\n *\n * In case the length is not specified, undefined is returned.\n *\n * @param bytes the byte buffer to parse from.\n * @param remaining the bytes remaining in the current parsing state.\n *\n * @return the length of the BER-encoded ASN.1 value or undefined.\n */\nvar _getValueLength = function(bytes, remaining) {\n // TODO: move this function and related DER/BER functions to a der.js\n // file; better abstract ASN.1 away from der/ber.\n // fromDer already checked that this byte exists\n var b2 = bytes.getByte();\n remaining--;\n if(b2 === 0x80) {\n return undefined;\n }\n\n // see if the length is \"short form\" or \"long form\" (bit 8 set)\n var length;\n var longForm = b2 & 0x80;\n if(!longForm) {\n // length is just the first byte\n length = b2;\n } else {\n // the number of bytes the length is specified in bits 7 through 1\n // and each length byte is in big-endian base-256\n var longFormBytes = b2 & 0x7F;\n _checkBufferLength(bytes, remaining, longFormBytes);\n length = bytes.getInt(longFormBytes << 3);\n }\n // FIXME: this will only happen for 32 bit getInt with high bit set\n if(length < 0) {\n throw new Error('Negative length: ' + length);\n }\n return length;\n};\n\n/**\n * Parses an asn1 object from a byte buffer in DER format.\n *\n * @param bytes the byte buffer to parse from.\n * @param [strict] true to be strict when checking value lengths, false to\n * allow truncated values (default: true).\n * @param [options] object with options or boolean strict flag\n * [strict] true to be strict when checking value lengths, false to\n * allow truncated values (default: true).\n * [decodeBitStrings] true to attempt to decode the content of\n * BIT STRINGs (not OCTET STRINGs) using strict mode. Note that\n * without schema support to understand the data context this can\n * erroneously decode values that happen to be valid ASN.1. This\n * flag will be deprecated or removed as soon as schema support is\n * available. (default: true)\n *\n * @return the parsed asn1 object.\n */\nasn1.fromDer = function(bytes, options) {\n if(options === undefined) {\n options = {\n strict: true,\n decodeBitStrings: true\n };\n }\n if(typeof options === 'boolean') {\n options = {\n strict: options,\n decodeBitStrings: true\n };\n }\n if(!('strict' in options)) {\n options.strict = true;\n }\n if(!('decodeBitStrings' in options)) {\n options.decodeBitStrings = true;\n }\n\n // wrap in buffer if needed\n if(typeof bytes === 'string') {\n bytes = forge.util.createBuffer(bytes);\n }\n\n return _fromDer(bytes, bytes.length(), 0, options);\n};\n\n/**\n * Internal function to parse an asn1 object from a byte buffer in DER format.\n *\n * @param bytes the byte buffer to parse from.\n * @param remaining the number of bytes remaining for this chunk.\n * @param depth the current parsing depth.\n * @param options object with same options as fromDer().\n *\n * @return the parsed asn1 object.\n */\nfunction _fromDer(bytes, remaining, depth, options) {\n // temporary storage for consumption calculations\n var start;\n\n // minimum length for ASN.1 DER structure is 2\n _checkBufferLength(bytes, remaining, 2);\n\n // get the first byte\n var b1 = bytes.getByte();\n // consumed one byte\n remaining--;\n\n // get the tag class\n var tagClass = (b1 & 0xC0);\n\n // get the type (bits 1-5)\n var type = b1 & 0x1F;\n\n // get the variable value length and adjust remaining bytes\n start = bytes.length();\n var length = _getValueLength(bytes, remaining);\n remaining -= start - bytes.length();\n\n // ensure there are enough bytes to get the value\n if(length !== undefined && length > remaining) {\n if(options.strict) {\n var error = new Error('Too few bytes to read ASN.1 value.');\n error.available = bytes.length();\n error.remaining = remaining;\n error.requested = length;\n throw error;\n }\n // Note: be lenient with truncated values and use remaining state bytes\n length = remaining;\n }\n\n // value storage\n var value;\n // possible BIT STRING contents storage\n var bitStringContents;\n\n // constructed flag is bit 6 (32 = 0x20) of the first byte\n var constructed = ((b1 & 0x20) === 0x20);\n if(constructed) {\n // parse child asn1 objects from the value\n value = [];\n if(length === undefined) {\n // asn1 object of indefinite length, read until end tag\n for(;;) {\n _checkBufferLength(bytes, remaining, 2);\n if(bytes.bytes(2) === String.fromCharCode(0, 0)) {\n bytes.getBytes(2);\n remaining -= 2;\n break;\n }\n start = bytes.length();\n value.push(_fromDer(bytes, remaining, depth + 1, options));\n remaining -= start - bytes.length();\n }\n } else {\n // parsing asn1 object of definite length\n while(length > 0) {\n start = bytes.length();\n value.push(_fromDer(bytes, length, depth + 1, options));\n remaining -= start - bytes.length();\n length -= start - bytes.length();\n }\n }\n }\n\n // if a BIT STRING, save the contents including padding\n if(value === undefined && tagClass === asn1.Class.UNIVERSAL &&\n type === asn1.Type.BITSTRING) {\n bitStringContents = bytes.bytes(length);\n }\n\n // determine if a non-constructed value should be decoded as a composed\n // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs)\n // can be used this way.\n if(value === undefined && options.decodeBitStrings &&\n tagClass === asn1.Class.UNIVERSAL &&\n // FIXME: OCTET STRINGs not yet supported here\n // .. other parts of forge expect to decode OCTET STRINGs manually\n (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) &&\n length > 1) {\n // save read position\n var savedRead = bytes.read;\n var savedRemaining = remaining;\n var unused = 0;\n if(type === asn1.Type.BITSTRING) {\n /* The first octet gives the number of bits by which the length of the\n bit string is less than the next multiple of eight (this is called\n the \"number of unused bits\").\n\n The second and following octets give the value of the bit string\n converted to an octet string. */\n _checkBufferLength(bytes, remaining, 1);\n unused = bytes.getByte();\n remaining--;\n }\n // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs\n if(unused === 0) {\n try {\n // attempt to parse child asn1 object from the value\n // (stored in array to signal composed value)\n start = bytes.length();\n var subOptions = {\n // enforce strict mode to avoid parsing ASN.1 from plain data\n verbose: options.verbose,\n strict: true,\n decodeBitStrings: true\n };\n var composed = _fromDer(bytes, remaining, depth + 1, subOptions);\n var used = start - bytes.length();\n remaining -= used;\n if(type == asn1.Type.BITSTRING) {\n used++;\n }\n\n // if the data all decoded and the class indicates UNIVERSAL or\n // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object\n var tc = composed.tagClass;\n if(used === length &&\n (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) {\n value = [composed];\n }\n } catch(ex) {\n }\n }\n if(value === undefined) {\n // restore read position\n bytes.read = savedRead;\n remaining = savedRemaining;\n }\n }\n\n if(value === undefined) {\n // asn1 not constructed or composed, get raw value\n // TODO: do DER to OID conversion and vice-versa in .toDer?\n\n if(length === undefined) {\n if(options.strict) {\n throw new Error('Non-constructed ASN.1 object of indefinite length.');\n }\n // be lenient and use remaining state bytes\n length = remaining;\n }\n\n if(type === asn1.Type.BMPSTRING) {\n value = '';\n for(; length > 0; length -= 2) {\n _checkBufferLength(bytes, remaining, 2);\n value += String.fromCharCode(bytes.getInt16());\n remaining -= 2;\n }\n } else {\n value = bytes.getBytes(length);\n }\n }\n\n // add BIT STRING contents if available\n var asn1Options = bitStringContents === undefined ? null : {\n bitStringContents: bitStringContents\n };\n\n // create and return asn1 object\n return asn1.create(tagClass, type, constructed, value, asn1Options);\n}\n\n/**\n * Converts the given asn1 object to a buffer of bytes in DER format.\n *\n * @param asn1 the asn1 object to convert to bytes.\n *\n * @return the buffer of bytes.\n */\nasn1.toDer = function(obj) {\n var bytes = forge.util.createBuffer();\n\n // build the first byte\n var b1 = obj.tagClass | obj.type;\n\n // for storing the ASN.1 value\n var value = forge.util.createBuffer();\n\n // use BIT STRING contents if available and data not changed\n var useBitStringContents = false;\n if('bitStringContents' in obj) {\n useBitStringContents = true;\n if(obj.original) {\n useBitStringContents = asn1.equals(obj, obj.original);\n }\n }\n\n if(useBitStringContents) {\n value.putBytes(obj.bitStringContents);\n } else if(obj.composed) {\n // if composed, use each child asn1 object's DER bytes as value\n // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed\n // from other asn1 objects\n if(obj.constructed) {\n b1 |= 0x20;\n } else {\n // type is a bit string, add unused bits of 0x00\n value.putByte(0x00);\n }\n\n // add all of the child DER bytes together\n for(var i = 0; i < obj.value.length; ++i) {\n if(obj.value[i] !== undefined) {\n value.putBuffer(asn1.toDer(obj.value[i]));\n }\n }\n } else {\n // use asn1.value directly\n if(obj.type === asn1.Type.BMPSTRING) {\n for(var i = 0; i < obj.value.length; ++i) {\n value.putInt16(obj.value.charCodeAt(i));\n }\n } else {\n // ensure integer is minimally-encoded\n // TODO: should all leading bytes be stripped vs just one?\n // .. ex '00 00 01' => '01'?\n if(obj.type === asn1.Type.INTEGER &&\n obj.value.length > 1 &&\n // leading 0x00 for positive integer\n ((obj.value.charCodeAt(0) === 0 &&\n (obj.value.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (obj.value.charCodeAt(0) === 0xFF &&\n (obj.value.charCodeAt(1) & 0x80) === 0x80))) {\n value.putBytes(obj.value.substr(1));\n } else {\n value.putBytes(obj.value);\n }\n }\n }\n\n // add tag byte\n bytes.putByte(b1);\n\n // use \"short form\" encoding\n if(value.length() <= 127) {\n // one byte describes the length\n // bit 8 = 0 and bits 7-1 = length\n bytes.putByte(value.length() & 0x7F);\n } else {\n // use \"long form\" encoding\n // 2 to 127 bytes describe the length\n // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes\n // other bytes: length in base 256, big-endian\n var len = value.length();\n var lenBytes = '';\n do {\n lenBytes += String.fromCharCode(len & 0xFF);\n len = len >>> 8;\n } while(len > 0);\n\n // set first byte to # bytes used to store the length and turn on\n // bit 8 to indicate long-form length is used\n bytes.putByte(lenBytes.length | 0x80);\n\n // concatenate length bytes in reverse since they were generated\n // little endian and we need big endian\n for(var i = lenBytes.length - 1; i >= 0; --i) {\n bytes.putByte(lenBytes.charCodeAt(i));\n }\n }\n\n // concatenate value bytes\n bytes.putBuffer(value);\n return bytes;\n};\n\n/**\n * Converts an OID dot-separated string to a byte buffer. The byte buffer\n * contains only the DER-encoded value, not any tag or length bytes.\n *\n * @param oid the OID dot-separated string.\n *\n * @return the byte buffer.\n */\nasn1.oidToDer = function(oid) {\n // split OID into individual values\n var values = oid.split('.');\n var bytes = forge.util.createBuffer();\n\n // first byte is 40 * value1 + value2\n bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10));\n // other bytes are each value in base 128 with 8th bit set except for\n // the last byte for each value\n var last, valueBytes, value, b;\n for(var i = 2; i < values.length; ++i) {\n // produce value bytes in reverse because we don't know how many\n // bytes it will take to store the value\n last = true;\n valueBytes = [];\n value = parseInt(values[i], 10);\n do {\n b = value & 0x7F;\n value = value >>> 7;\n // if value is not last, then turn on 8th bit\n if(!last) {\n b |= 0x80;\n }\n valueBytes.push(b);\n last = false;\n } while(value > 0);\n\n // add value bytes in reverse (needs to be in big endian)\n for(var n = valueBytes.length - 1; n >= 0; --n) {\n bytes.putByte(valueBytes[n]);\n }\n }\n\n return bytes;\n};\n\n/**\n * Converts a DER-encoded byte buffer to an OID dot-separated string. The\n * byte buffer should contain only the DER-encoded value, not any tag or\n * length bytes.\n *\n * @param bytes the byte buffer.\n *\n * @return the OID dot-separated string.\n */\nasn1.derToOid = function(bytes) {\n var oid;\n\n // wrap in buffer if needed\n if(typeof bytes === 'string') {\n bytes = forge.util.createBuffer(bytes);\n }\n\n // first byte is 40 * value1 + value2\n var b = bytes.getByte();\n oid = Math.floor(b / 40) + '.' + (b % 40);\n\n // other bytes are each value in base 128 with 8th bit set except for\n // the last byte for each value\n var value = 0;\n while(bytes.length() > 0) {\n b = bytes.getByte();\n value = value << 7;\n // not the last byte for the value\n if(b & 0x80) {\n value += b & 0x7F;\n } else {\n // last byte\n oid += '.' + (value + b);\n value = 0;\n }\n }\n\n return oid;\n};\n\n/**\n * Converts a UTCTime value to a date.\n *\n * Note: GeneralizedTime has 4 digits for the year and is used for X.509\n * dates past 2049. Parsing that structure hasn't been implemented yet.\n *\n * @param utc the UTCTime value to convert.\n *\n * @return the date.\n */\nasn1.utcTimeToDate = function(utc) {\n /* The following formats can be used:\n\n YYMMDDhhmmZ\n YYMMDDhhmm+hh'mm'\n YYMMDDhhmm-hh'mm'\n YYMMDDhhmmssZ\n YYMMDDhhmmss+hh'mm'\n YYMMDDhhmmss-hh'mm'\n\n Where:\n\n YY is the least significant two digits of the year\n MM is the month (01 to 12)\n DD is the day (01 to 31)\n hh is the hour (00 to 23)\n mm are the minutes (00 to 59)\n ss are the seconds (00 to 59)\n Z indicates that local time is GMT, + indicates that local time is\n later than GMT, and - indicates that local time is earlier than GMT\n hh' is the absolute value of the offset from GMT in hours\n mm' is the absolute value of the offset from GMT in minutes */\n var date = new Date();\n\n // if YY >= 50 use 19xx, if YY < 50 use 20xx\n var year = parseInt(utc.substr(0, 2), 10);\n year = (year >= 50) ? 1900 + year : 2000 + year;\n var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month\n var DD = parseInt(utc.substr(4, 2), 10);\n var hh = parseInt(utc.substr(6, 2), 10);\n var mm = parseInt(utc.substr(8, 2), 10);\n var ss = 0;\n\n // not just YYMMDDhhmmZ\n if(utc.length > 11) {\n // get character after minutes\n var c = utc.charAt(10);\n var end = 10;\n\n // see if seconds are present\n if(c !== '+' && c !== '-') {\n // get seconds\n ss = parseInt(utc.substr(10, 2), 10);\n end += 2;\n }\n }\n\n // update date\n date.setUTCFullYear(year, MM, DD);\n date.setUTCHours(hh, mm, ss, 0);\n\n if(end) {\n // get +/- after end of time\n c = utc.charAt(end);\n if(c === '+' || c === '-') {\n // get hours+minutes offset\n var hhoffset = parseInt(utc.substr(end + 1, 2), 10);\n var mmoffset = parseInt(utc.substr(end + 4, 2), 10);\n\n // calculate offset in milliseconds\n var offset = hhoffset * 60 + mmoffset;\n offset *= 60000;\n\n // apply offset\n if(c === '+') {\n date.setTime(+date - offset);\n } else {\n date.setTime(+date + offset);\n }\n }\n }\n\n return date;\n};\n\n/**\n * Converts a GeneralizedTime value to a date.\n *\n * @param gentime the GeneralizedTime value to convert.\n *\n * @return the date.\n */\nasn1.generalizedTimeToDate = function(gentime) {\n /* The following formats can be used:\n\n YYYYMMDDHHMMSS\n YYYYMMDDHHMMSS.fff\n YYYYMMDDHHMMSSZ\n YYYYMMDDHHMMSS.fffZ\n YYYYMMDDHHMMSS+hh'mm'\n YYYYMMDDHHMMSS.fff+hh'mm'\n YYYYMMDDHHMMSS-hh'mm'\n YYYYMMDDHHMMSS.fff-hh'mm'\n\n Where:\n\n YYYY is the year\n MM is the month (01 to 12)\n DD is the day (01 to 31)\n hh is the hour (00 to 23)\n mm are the minutes (00 to 59)\n ss are the seconds (00 to 59)\n .fff is the second fraction, accurate to three decimal places\n Z indicates that local time is GMT, + indicates that local time is\n later than GMT, and - indicates that local time is earlier than GMT\n hh' is the absolute value of the offset from GMT in hours\n mm' is the absolute value of the offset from GMT in minutes */\n var date = new Date();\n\n var YYYY = parseInt(gentime.substr(0, 4), 10);\n var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month\n var DD = parseInt(gentime.substr(6, 2), 10);\n var hh = parseInt(gentime.substr(8, 2), 10);\n var mm = parseInt(gentime.substr(10, 2), 10);\n var ss = parseInt(gentime.substr(12, 2), 10);\n var fff = 0;\n var offset = 0;\n var isUTC = false;\n\n if(gentime.charAt(gentime.length - 1) === 'Z') {\n isUTC = true;\n }\n\n var end = gentime.length - 5, c = gentime.charAt(end);\n if(c === '+' || c === '-') {\n // get hours+minutes offset\n var hhoffset = parseInt(gentime.substr(end + 1, 2), 10);\n var mmoffset = parseInt(gentime.substr(end + 4, 2), 10);\n\n // calculate offset in milliseconds\n offset = hhoffset * 60 + mmoffset;\n offset *= 60000;\n\n // apply offset\n if(c === '+') {\n offset *= -1;\n }\n\n isUTC = true;\n }\n\n // check for second fraction\n if(gentime.charAt(14) === '.') {\n fff = parseFloat(gentime.substr(14), 10) * 1000;\n }\n\n if(isUTC) {\n date.setUTCFullYear(YYYY, MM, DD);\n date.setUTCHours(hh, mm, ss, fff);\n\n // apply offset\n date.setTime(+date + offset);\n } else {\n date.setFullYear(YYYY, MM, DD);\n date.setHours(hh, mm, ss, fff);\n }\n\n return date;\n};\n\n/**\n * Converts a date to a UTCTime value.\n *\n * Note: GeneralizedTime has 4 digits for the year and is used for X.509\n * dates past 2049. Converting to a GeneralizedTime hasn't been\n * implemented yet.\n *\n * @param date the date to convert.\n *\n * @return the UTCTime value.\n */\nasn1.dateToUtcTime = function(date) {\n // TODO: validate; currently assumes proper format\n if(typeof date === 'string') {\n return date;\n }\n\n var rval = '';\n\n // create format YYMMDDhhmmssZ\n var format = [];\n format.push(('' + date.getUTCFullYear()).substr(2));\n format.push('' + (date.getUTCMonth() + 1));\n format.push('' + date.getUTCDate());\n format.push('' + date.getUTCHours());\n format.push('' + date.getUTCMinutes());\n format.push('' + date.getUTCSeconds());\n\n // ensure 2 digits are used for each format entry\n for(var i = 0; i < format.length; ++i) {\n if(format[i].length < 2) {\n rval += '0';\n }\n rval += format[i];\n }\n rval += 'Z';\n\n return rval;\n};\n\n/**\n * Converts a date to a GeneralizedTime value.\n *\n * @param date the date to convert.\n *\n * @return the GeneralizedTime value as a string.\n */\nasn1.dateToGeneralizedTime = function(date) {\n // TODO: validate; currently assumes proper format\n if(typeof date === 'string') {\n return date;\n }\n\n var rval = '';\n\n // create format YYYYMMDDHHMMSSZ\n var format = [];\n format.push('' + date.getUTCFullYear());\n format.push('' + (date.getUTCMonth() + 1));\n format.push('' + date.getUTCDate());\n format.push('' + date.getUTCHours());\n format.push('' + date.getUTCMinutes());\n format.push('' + date.getUTCSeconds());\n\n // ensure 2 digits are used for each format entry\n for(var i = 0; i < format.length; ++i) {\n if(format[i].length < 2) {\n rval += '0';\n }\n rval += format[i];\n }\n rval += 'Z';\n\n return rval;\n};\n\n/**\n * Converts a javascript integer to a DER-encoded byte buffer to be used\n * as the value for an INTEGER type.\n *\n * @param x the integer.\n *\n * @return the byte buffer.\n */\nasn1.integerToDer = function(x) {\n var rval = forge.util.createBuffer();\n if(x >= -0x80 && x < 0x80) {\n return rval.putSignedInt(x, 8);\n }\n if(x >= -0x8000 && x < 0x8000) {\n return rval.putSignedInt(x, 16);\n }\n if(x >= -0x800000 && x < 0x800000) {\n return rval.putSignedInt(x, 24);\n }\n if(x >= -0x80000000 && x < 0x80000000) {\n return rval.putSignedInt(x, 32);\n }\n var error = new Error('Integer too large; max is 32-bits.');\n error.integer = x;\n throw error;\n};\n\n/**\n * Converts a DER-encoded byte buffer to a javascript integer. This is\n * typically used to decode the value of an INTEGER type.\n *\n * @param bytes the byte buffer.\n *\n * @return the integer.\n */\nasn1.derToInteger = function(bytes) {\n // wrap in buffer if needed\n if(typeof bytes === 'string') {\n bytes = forge.util.createBuffer(bytes);\n }\n\n var n = bytes.length() * 8;\n if(n > 32) {\n throw new Error('Integer too large; max is 32-bits.');\n }\n return bytes.getSignedInt(n);\n};\n\n/**\n * Validates that the given ASN.1 object is at least a super set of the\n * given ASN.1 structure. Only tag classes and types are checked. An\n * optional map may also be provided to capture ASN.1 values while the\n * structure is checked.\n *\n * To capture an ASN.1 value, set an object in the validator's 'capture'\n * parameter to the key to use in the capture map. To capture the full\n * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including\n * the leading unused bits counter byte, specify 'captureBitStringContents'.\n * To capture BIT STRING bytes, without the leading unused bits counter byte,\n * specify 'captureBitStringValue'.\n *\n * Objects in the validator may set a field 'optional' to true to indicate\n * that it isn't necessary to pass validation.\n *\n * @param obj the ASN.1 object to validate.\n * @param v the ASN.1 structure validator.\n * @param capture an optional map to capture values in.\n * @param errors an optional array for storing validation errors.\n *\n * @return true on success, false on failure.\n */\nasn1.validate = function(obj, v, capture, errors) {\n var rval = false;\n\n // ensure tag class and type are the same if specified\n if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') &&\n (obj.type === v.type || typeof(v.type) === 'undefined')) {\n // ensure constructed flag is the same if specified\n if(obj.constructed === v.constructed ||\n typeof(v.constructed) === 'undefined') {\n rval = true;\n\n // handle sub values\n if(v.value && forge.util.isArray(v.value)) {\n var j = 0;\n for(var i = 0; rval && i < v.value.length; ++i) {\n rval = v.value[i].optional || false;\n if(obj.value[j]) {\n rval = asn1.validate(obj.value[j], v.value[i], capture, errors);\n if(rval) {\n ++j;\n } else if(v.value[i].optional) {\n rval = true;\n }\n }\n if(!rval && errors) {\n errors.push(\n '[' + v.name + '] ' +\n 'Tag class \"' + v.tagClass + '\", type \"' +\n v.type + '\" expected value length \"' +\n v.value.length + '\", got \"' +\n obj.value.length + '\"');\n }\n }\n }\n\n if(rval && capture) {\n if(v.capture) {\n capture[v.capture] = obj.value;\n }\n if(v.captureAsn1) {\n capture[v.captureAsn1] = obj;\n }\n if(v.captureBitStringContents && 'bitStringContents' in obj) {\n capture[v.captureBitStringContents] = obj.bitStringContents;\n }\n if(v.captureBitStringValue && 'bitStringContents' in obj) {\n var value;\n if(obj.bitStringContents.length < 2) {\n capture[v.captureBitStringValue] = '';\n } else {\n // FIXME: support unused bits with data shifting\n var unused = obj.bitStringContents.charCodeAt(0);\n if(unused !== 0) {\n throw new Error(\n 'captureBitStringValue only supported for zero unused bits');\n }\n capture[v.captureBitStringValue] = obj.bitStringContents.slice(1);\n }\n }\n }\n } else if(errors) {\n errors.push(\n '[' + v.name + '] ' +\n 'Expected constructed \"' + v.constructed + '\", got \"' +\n obj.constructed + '\"');\n }\n } else if(errors) {\n if(obj.tagClass !== v.tagClass) {\n errors.push(\n '[' + v.name + '] ' +\n 'Expected tag class \"' + v.tagClass + '\", got \"' +\n obj.tagClass + '\"');\n }\n if(obj.type !== v.type) {\n errors.push(\n '[' + v.name + '] ' +\n 'Expected type \"' + v.type + '\", got \"' + obj.type + '\"');\n }\n }\n return rval;\n};\n\n// regex for testing for non-latin characters\nvar _nonLatinRegex = /[^\\\\u0000-\\\\u00ff]/;\n\n/**\n * Pretty prints an ASN.1 object to a string.\n *\n * @param obj the object to write out.\n * @param level the level in the tree.\n * @param indentation the indentation to use.\n *\n * @return the string.\n */\nasn1.prettyPrint = function(obj, level, indentation) {\n var rval = '';\n\n // set default level and indentation\n level = level || 0;\n indentation = indentation || 2;\n\n // start new line for deep levels\n if(level > 0) {\n rval += '\\n';\n }\n\n // create indent\n var indent = '';\n for(var i = 0; i < level * indentation; ++i) {\n indent += ' ';\n }\n\n // print class:type\n rval += indent + 'Tag: ';\n switch(obj.tagClass) {\n case asn1.Class.UNIVERSAL:\n rval += 'Universal:';\n break;\n case asn1.Class.APPLICATION:\n rval += 'Application:';\n break;\n case asn1.Class.CONTEXT_SPECIFIC:\n rval += 'Context-Specific:';\n break;\n case asn1.Class.PRIVATE:\n rval += 'Private:';\n break;\n }\n\n if(obj.tagClass === asn1.Class.UNIVERSAL) {\n rval += obj.type;\n\n // known types\n switch(obj.type) {\n case asn1.Type.NONE:\n rval += ' (None)';\n break;\n case asn1.Type.BOOLEAN:\n rval += ' (Boolean)';\n break;\n case asn1.Type.INTEGER:\n rval += ' (Integer)';\n break;\n case asn1.Type.BITSTRING:\n rval += ' (Bit string)';\n break;\n case asn1.Type.OCTETSTRING:\n rval += ' (Octet string)';\n break;\n case asn1.Type.NULL:\n rval += ' (Null)';\n break;\n case asn1.Type.OID:\n rval += ' (Object Identifier)';\n break;\n case asn1.Type.ODESC:\n rval += ' (Object Descriptor)';\n break;\n case asn1.Type.EXTERNAL:\n rval += ' (External or Instance of)';\n break;\n case asn1.Type.REAL:\n rval += ' (Real)';\n break;\n case asn1.Type.ENUMERATED:\n rval += ' (Enumerated)';\n break;\n case asn1.Type.EMBEDDED:\n rval += ' (Embedded PDV)';\n break;\n case asn1.Type.UTF8:\n rval += ' (UTF8)';\n break;\n case asn1.Type.ROID:\n rval += ' (Relative Object Identifier)';\n break;\n case asn1.Type.SEQUENCE:\n rval += ' (Sequence)';\n break;\n case asn1.Type.SET:\n rval += ' (Set)';\n break;\n case asn1.Type.PRINTABLESTRING:\n rval += ' (Printable String)';\n break;\n case asn1.Type.IA5String:\n rval += ' (IA5String (ASCII))';\n break;\n case asn1.Type.UTCTIME:\n rval += ' (UTC time)';\n break;\n case asn1.Type.GENERALIZEDTIME:\n rval += ' (Generalized time)';\n break;\n case asn1.Type.BMPSTRING:\n rval += ' (BMP String)';\n break;\n }\n } else {\n rval += obj.type;\n }\n\n rval += '\\n';\n rval += indent + 'Constructed: ' + obj.constructed + '\\n';\n\n if(obj.composed) {\n var subvalues = 0;\n var sub = '';\n for(var i = 0; i < obj.value.length; ++i) {\n if(obj.value[i] !== undefined) {\n subvalues += 1;\n sub += asn1.prettyPrint(obj.value[i], level + 1, indentation);\n if((i + 1) < obj.value.length) {\n sub += ',';\n }\n }\n }\n rval += indent + 'Sub values: ' + subvalues + sub;\n } else {\n rval += indent + 'Value: ';\n if(obj.type === asn1.Type.OID) {\n var oid = asn1.derToOid(obj.value);\n rval += oid;\n if(forge.pki && forge.pki.oids) {\n if(oid in forge.pki.oids) {\n rval += ' (' + forge.pki.oids[oid] + ') ';\n }\n }\n }\n if(obj.type === asn1.Type.INTEGER) {\n try {\n rval += asn1.derToInteger(obj.value);\n } catch(ex) {\n rval += '0x' + forge.util.bytesToHex(obj.value);\n }\n } else if(obj.type === asn1.Type.BITSTRING) {\n // TODO: shift bits as needed to display without padding\n if(obj.value.length > 1) {\n // remove unused bits field\n rval += '0x' + forge.util.bytesToHex(obj.value.slice(1));\n } else {\n rval += '(none)';\n }\n // show unused bit count\n if(obj.value.length > 0) {\n var unused = obj.value.charCodeAt(0);\n if(unused == 1) {\n rval += ' (1 unused bit shown)';\n } else if(unused > 1) {\n rval += ' (' + unused + ' unused bits shown)';\n }\n }\n } else if(obj.type === asn1.Type.OCTETSTRING) {\n if(!_nonLatinRegex.test(obj.value)) {\n rval += '(' + obj.value + ') ';\n }\n rval += '0x' + forge.util.bytesToHex(obj.value);\n } else if(obj.type === asn1.Type.UTF8) {\n rval += forge.util.decodeUtf8(obj.value);\n } else if(obj.type === asn1.Type.PRINTABLESTRING ||\n obj.type === asn1.Type.IA5String) {\n rval += obj.value;\n } else if(_nonLatinRegex.test(obj.value)) {\n rval += '0x' + forge.util.bytesToHex(obj.value);\n } else if(obj.value.length === 0) {\n rval += '[null]';\n } else {\n rval += obj.value;\n }\n }\n\n return rval;\n};\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/asn1.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/baseN.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/baseN.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Base-N/Base-X encoding/decoding functions.\n *\n * Original implementation from base-x:\n * https://github.com/cryptocoinjs/base-x\n *\n * Which is MIT licensed:\n *\n * The MIT License (MIT)\n *\n * Copyright base-x contributors (c) 2016\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nvar api = {};\nmodule.exports = api;\n\n// baseN alphabet indexes\nvar _reverseAlphabets = {};\n\n/**\n * BaseN-encodes a Uint8Array using the given alphabet.\n *\n * @param input the Uint8Array to encode.\n * @param maxline the maximum number of encoded characters per line to use,\n * defaults to none.\n *\n * @return the baseN-encoded output string.\n */\napi.encode = function(input, alphabet, maxline) {\n if(typeof alphabet !== 'string') {\n throw new TypeError('\"alphabet\" must be a string.');\n }\n if(maxline !== undefined && typeof maxline !== 'number') {\n throw new TypeError('\"maxline\" must be a number.');\n }\n\n var output = '';\n\n if(!(input instanceof Uint8Array)) {\n // assume forge byte buffer\n output = _encodeWithByteBuffer(input, alphabet);\n } else {\n var i = 0;\n var base = alphabet.length;\n var first = alphabet.charAt(0);\n var digits = [0];\n for(i = 0; i < input.length; ++i) {\n for(var j = 0, carry = input[i]; j < digits.length; ++j) {\n carry += digits[j] << 8;\n digits[j] = carry % base;\n carry = (carry / base) | 0;\n }\n\n while(carry > 0) {\n digits.push(carry % base);\n carry = (carry / base) | 0;\n }\n }\n\n // deal with leading zeros\n for(i = 0; input[i] === 0 && i < input.length - 1; ++i) {\n output += first;\n }\n // convert digits to a string\n for(i = digits.length - 1; i >= 0; --i) {\n output += alphabet[digits[i]];\n }\n }\n\n if(maxline) {\n var regex = new RegExp('.{1,' + maxline + '}', 'g');\n output = output.match(regex).join('\\r\\n');\n }\n\n return output;\n};\n\n/**\n * Decodes a baseN-encoded (using the given alphabet) string to a\n * Uint8Array.\n *\n * @param input the baseN-encoded input string.\n *\n * @return the Uint8Array.\n */\napi.decode = function(input, alphabet) {\n if(typeof input !== 'string') {\n throw new TypeError('\"input\" must be a string.');\n }\n if(typeof alphabet !== 'string') {\n throw new TypeError('\"alphabet\" must be a string.');\n }\n\n var table = _reverseAlphabets[alphabet];\n if(!table) {\n // compute reverse alphabet\n table = _reverseAlphabets[alphabet] = [];\n for(var i = 0; i < alphabet.length; ++i) {\n table[alphabet.charCodeAt(i)] = i;\n }\n }\n\n // remove whitespace characters\n input = input.replace(/\\s/g, '');\n\n var base = alphabet.length;\n var first = alphabet.charAt(0);\n var bytes = [0];\n for(var i = 0; i < input.length; i++) {\n var value = table[input.charCodeAt(i)];\n if(value === undefined) {\n return;\n }\n\n for(var j = 0, carry = value; j < bytes.length; ++j) {\n carry += bytes[j] * base;\n bytes[j] = carry & 0xff;\n carry >>= 8;\n }\n\n while(carry > 0) {\n bytes.push(carry & 0xff);\n carry >>= 8;\n }\n }\n\n // deal with leading zeros\n for(var k = 0; input[k] === first && k < input.length - 1; ++k) {\n bytes.push(0);\n }\n\n if(typeof Buffer !== 'undefined') {\n return Buffer.from(bytes.reverse());\n }\n\n return new Uint8Array(bytes.reverse());\n};\n\nfunction _encodeWithByteBuffer(input, alphabet) {\n var i = 0;\n var base = alphabet.length;\n var first = alphabet.charAt(0);\n var digits = [0];\n for(i = 0; i < input.length(); ++i) {\n for(var j = 0, carry = input.at(i); j < digits.length; ++j) {\n carry += digits[j] << 8;\n digits[j] = carry % base;\n carry = (carry / base) | 0;\n }\n\n while(carry > 0) {\n digits.push(carry % base);\n carry = (carry / base) | 0;\n }\n }\n\n var output = '';\n\n // deal with leading zeros\n for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) {\n output += first;\n }\n // convert digits to a string\n for(i = digits.length - 1; i >= 0; --i) {\n output += alphabet[digits[i]];\n }\n\n return output;\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/baseN.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/cipher.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/cipher.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Cipher base API.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nmodule.exports = forge.cipher = forge.cipher || {};\n\n// registered algorithms\nforge.cipher.algorithms = forge.cipher.algorithms || {};\n\n/**\n * Creates a cipher object that can be used to encrypt data using the given\n * algorithm and key. The algorithm may be provided as a string value for a\n * previously registered algorithm or it may be given as a cipher algorithm\n * API object.\n *\n * @param algorithm the algorithm to use, either a string or an algorithm API\n * object.\n * @param key the key to use, as a binary-encoded string of bytes or a\n * byte buffer.\n *\n * @return the cipher.\n */\nforge.cipher.createCipher = function(algorithm, key) {\n var api = algorithm;\n if(typeof api === 'string') {\n api = forge.cipher.getAlgorithm(api);\n if(api) {\n api = api();\n }\n }\n if(!api) {\n throw new Error('Unsupported algorithm: ' + algorithm);\n }\n\n // assume block cipher\n return new forge.cipher.BlockCipher({\n algorithm: api,\n key: key,\n decrypt: false\n });\n};\n\n/**\n * Creates a decipher object that can be used to decrypt data using the given\n * algorithm and key. The algorithm may be provided as a string value for a\n * previously registered algorithm or it may be given as a cipher algorithm\n * API object.\n *\n * @param algorithm the algorithm to use, either a string or an algorithm API\n * object.\n * @param key the key to use, as a binary-encoded string of bytes or a\n * byte buffer.\n *\n * @return the cipher.\n */\nforge.cipher.createDecipher = function(algorithm, key) {\n var api = algorithm;\n if(typeof api === 'string') {\n api = forge.cipher.getAlgorithm(api);\n if(api) {\n api = api();\n }\n }\n if(!api) {\n throw new Error('Unsupported algorithm: ' + algorithm);\n }\n\n // assume block cipher\n return new forge.cipher.BlockCipher({\n algorithm: api,\n key: key,\n decrypt: true\n });\n};\n\n/**\n * Registers an algorithm by name. If the name was already registered, the\n * algorithm API object will be overwritten.\n *\n * @param name the name of the algorithm.\n * @param algorithm the algorithm API object.\n */\nforge.cipher.registerAlgorithm = function(name, algorithm) {\n name = name.toUpperCase();\n forge.cipher.algorithms[name] = algorithm;\n};\n\n/**\n * Gets a registered algorithm by name.\n *\n * @param name the name of the algorithm.\n *\n * @return the algorithm, if found, null if not.\n */\nforge.cipher.getAlgorithm = function(name) {\n name = name.toUpperCase();\n if(name in forge.cipher.algorithms) {\n return forge.cipher.algorithms[name];\n }\n return null;\n};\n\nvar BlockCipher = forge.cipher.BlockCipher = function(options) {\n this.algorithm = options.algorithm;\n this.mode = this.algorithm.mode;\n this.blockSize = this.mode.blockSize;\n this._finish = false;\n this._input = null;\n this.output = null;\n this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt;\n this._decrypt = options.decrypt;\n this.algorithm.initialize(options);\n};\n\n/**\n * Starts or restarts the encryption or decryption process, whichever\n * was previously configured.\n *\n * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array\n * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in\n * bytes, then it must be Nb (16) bytes in length. If the IV is given in as\n * 32-bit integers, then it must be 4 integers long.\n *\n * Note: an IV is not required or used in ECB mode.\n *\n * For GCM-mode, the IV must be given as a binary-encoded string of bytes or\n * a byte buffer. The number of bytes should be 12 (96 bits) as recommended\n * by NIST SP-800-38D but another length may be given.\n *\n * @param options the options to use:\n * iv the initialization vector to use as a binary-encoded string of\n * bytes, null to reuse the last ciphered block from a previous\n * update() (this \"residue\" method is for legacy support only).\n * additionalData additional authentication data as a binary-encoded\n * string of bytes, for 'GCM' mode, (default: none).\n * tagLength desired length of authentication tag, in bits, for\n * 'GCM' mode (0-128, default: 128).\n * tag the authentication tag to check if decrypting, as a\n * binary-encoded string of bytes.\n * output the output the buffer to write to, null to create one.\n */\nBlockCipher.prototype.start = function(options) {\n options = options || {};\n var opts = {};\n for(var key in options) {\n opts[key] = options[key];\n }\n opts.decrypt = this._decrypt;\n this._finish = false;\n this._input = forge.util.createBuffer();\n this.output = options.output || forge.util.createBuffer();\n this.mode.start(opts);\n};\n\n/**\n * Updates the next block according to the cipher mode.\n *\n * @param input the buffer to read from.\n */\nBlockCipher.prototype.update = function(input) {\n if(input) {\n // input given, so empty it into the input buffer\n this._input.putBuffer(input);\n }\n\n // do cipher operation until it needs more input and not finished\n while(!this._op.call(this.mode, this._input, this.output, this._finish) &&\n !this._finish) {}\n\n // free consumed memory from input buffer\n this._input.compact();\n};\n\n/**\n * Finishes encrypting or decrypting.\n *\n * @param pad a padding function to use in CBC mode, null for default,\n * signature(blockSize, buffer, decrypt).\n *\n * @return true if successful, false on error.\n */\nBlockCipher.prototype.finish = function(pad) {\n // backwards-compatibility w/deprecated padding API\n // Note: will overwrite padding functions even after another start() call\n if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) {\n this.mode.pad = function(input) {\n return pad(this.blockSize, input, false);\n };\n this.mode.unpad = function(output) {\n return pad(this.blockSize, output, true);\n };\n }\n\n // build options for padding and afterFinish functions\n var options = {};\n options.decrypt = this._decrypt;\n\n // get # of bytes that won't fill a block\n options.overflow = this._input.length() % this.blockSize;\n\n if(!this._decrypt && this.mode.pad) {\n if(!this.mode.pad(this._input, options)) {\n return false;\n }\n }\n\n // do final update\n this._finish = true;\n this.update();\n\n if(this._decrypt && this.mode.unpad) {\n if(!this.mode.unpad(this.output, options)) {\n return false;\n }\n }\n\n if(this.mode.afterFinish) {\n if(!this.mode.afterFinish(this.output, options)) {\n return false;\n }\n }\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/cipher.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/cipherModes.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/node-forge/lib/cipherModes.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Supported cipher modes.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nforge.cipher = forge.cipher || {};\n\n// supported cipher modes\nvar modes = module.exports = forge.cipher.modes = forge.cipher.modes || {};\n\n/** Electronic codebook (ECB) (Don't use this; it's not secure) **/\n\nmodes.ecb = function(options) {\n options = options || {};\n this.name = 'ECB';\n this.cipher = options.cipher;\n this.blockSize = options.blockSize || 16;\n this._ints = this.blockSize / 4;\n this._inBlock = new Array(this._ints);\n this._outBlock = new Array(this._ints);\n};\n\nmodes.ecb.prototype.start = function(options) {};\n\nmodes.ecb.prototype.encrypt = function(input, output, finish) {\n // not enough input to encrypt\n if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n return true;\n }\n\n // get next block\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = input.getInt32();\n }\n\n // encrypt block\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // write output\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(this._outBlock[i]);\n }\n};\n\nmodes.ecb.prototype.decrypt = function(input, output, finish) {\n // not enough input to decrypt\n if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n return true;\n }\n\n // get next block\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = input.getInt32();\n }\n\n // decrypt block\n this.cipher.decrypt(this._inBlock, this._outBlock);\n\n // write output\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(this._outBlock[i]);\n }\n};\n\nmodes.ecb.prototype.pad = function(input, options) {\n // add PKCS#7 padding to block (each pad byte is the\n // value of the number of pad bytes)\n var padding = (input.length() === this.blockSize ?\n this.blockSize : (this.blockSize - input.length()));\n input.fillWithByte(padding, padding);\n return true;\n};\n\nmodes.ecb.prototype.unpad = function(output, options) {\n // check for error: input data not a multiple of blockSize\n if(options.overflow > 0) {\n return false;\n }\n\n // ensure padding byte count is valid\n var len = output.length();\n var count = output.at(len - 1);\n if(count > (this.blockSize << 2)) {\n return false;\n }\n\n // trim off padding bytes\n output.truncate(count);\n return true;\n};\n\n/** Cipher-block Chaining (CBC) **/\n\nmodes.cbc = function(options) {\n options = options || {};\n this.name = 'CBC';\n this.cipher = options.cipher;\n this.blockSize = options.blockSize || 16;\n this._ints = this.blockSize / 4;\n this._inBlock = new Array(this._ints);\n this._outBlock = new Array(this._ints);\n};\n\nmodes.cbc.prototype.start = function(options) {\n // Note: legacy support for using IV residue (has security flaws)\n // if IV is null, reuse block from previous processing\n if(options.iv === null) {\n // must have a previous block\n if(!this._prev) {\n throw new Error('Invalid IV parameter.');\n }\n this._iv = this._prev.slice(0);\n } else if(!('iv' in options)) {\n throw new Error('Invalid IV parameter.');\n } else {\n // save IV as \"previous\" block\n this._iv = transformIV(options.iv);\n this._prev = this._iv.slice(0);\n }\n};\n\nmodes.cbc.prototype.encrypt = function(input, output, finish) {\n // not enough input to encrypt\n if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n return true;\n }\n\n // get next block\n // CBC XOR's IV (or previous block) with plaintext\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = this._prev[i] ^ input.getInt32();\n }\n\n // encrypt block\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // write output, save previous block\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(this._outBlock[i]);\n }\n this._prev = this._outBlock;\n};\n\nmodes.cbc.prototype.decrypt = function(input, output, finish) {\n // not enough input to decrypt\n if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n return true;\n }\n\n // get next block\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = input.getInt32();\n }\n\n // decrypt block\n this.cipher.decrypt(this._inBlock, this._outBlock);\n\n // write output, save previous ciphered block\n // CBC XOR's IV (or previous block) with ciphertext\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(this._prev[i] ^ this._outBlock[i]);\n }\n this._prev = this._inBlock.slice(0);\n};\n\nmodes.cbc.prototype.pad = function(input, options) {\n // add PKCS#7 padding to block (each pad byte is the\n // value of the number of pad bytes)\n var padding = (input.length() === this.blockSize ?\n this.blockSize : (this.blockSize - input.length()));\n input.fillWithByte(padding, padding);\n return true;\n};\n\nmodes.cbc.prototype.unpad = function(output, options) {\n // check for error: input data not a multiple of blockSize\n if(options.overflow > 0) {\n return false;\n }\n\n // ensure padding byte count is valid\n var len = output.length();\n var count = output.at(len - 1);\n if(count > (this.blockSize << 2)) {\n return false;\n }\n\n // trim off padding bytes\n output.truncate(count);\n return true;\n};\n\n/** Cipher feedback (CFB) **/\n\nmodes.cfb = function(options) {\n options = options || {};\n this.name = 'CFB';\n this.cipher = options.cipher;\n this.blockSize = options.blockSize || 16;\n this._ints = this.blockSize / 4;\n this._inBlock = null;\n this._outBlock = new Array(this._ints);\n this._partialBlock = new Array(this._ints);\n this._partialOutput = forge.util.createBuffer();\n this._partialBytes = 0;\n};\n\nmodes.cfb.prototype.start = function(options) {\n if(!('iv' in options)) {\n throw new Error('Invalid IV parameter.');\n }\n // use IV as first input\n this._iv = transformIV(options.iv);\n this._inBlock = this._iv.slice(0);\n this._partialBytes = 0;\n};\n\nmodes.cfb.prototype.encrypt = function(input, output, finish) {\n // not enough input to encrypt\n var inputLength = input.length();\n if(inputLength === 0) {\n return true;\n }\n\n // encrypt block\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // handle full block\n if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n // XOR input with output, write input as output\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = input.getInt32() ^ this._outBlock[i];\n output.putInt32(this._inBlock[i]);\n }\n return;\n }\n\n // handle partial block\n var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n if(partialBytes > 0) {\n partialBytes = this.blockSize - partialBytes;\n }\n\n // XOR input with output, write input as partial output\n this._partialOutput.clear();\n for(var i = 0; i < this._ints; ++i) {\n this._partialBlock[i] = input.getInt32() ^ this._outBlock[i];\n this._partialOutput.putInt32(this._partialBlock[i]);\n }\n\n if(partialBytes > 0) {\n // block still incomplete, restore input buffer\n input.read -= this.blockSize;\n } else {\n // block complete, update input block\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = this._partialBlock[i];\n }\n }\n\n // skip any previous partial bytes\n if(this._partialBytes > 0) {\n this._partialOutput.getBytes(this._partialBytes);\n }\n\n if(partialBytes > 0 && !finish) {\n output.putBytes(this._partialOutput.getBytes(\n partialBytes - this._partialBytes));\n this._partialBytes = partialBytes;\n return true;\n }\n\n output.putBytes(this._partialOutput.getBytes(\n inputLength - this._partialBytes));\n this._partialBytes = 0;\n};\n\nmodes.cfb.prototype.decrypt = function(input, output, finish) {\n // not enough input to decrypt\n var inputLength = input.length();\n if(inputLength === 0) {\n return true;\n }\n\n // encrypt block (CFB always uses encryption mode)\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // handle full block\n if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n // XOR input with output, write input as output\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = input.getInt32();\n output.putInt32(this._inBlock[i] ^ this._outBlock[i]);\n }\n return;\n }\n\n // handle partial block\n var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n if(partialBytes > 0) {\n partialBytes = this.blockSize - partialBytes;\n }\n\n // XOR input with output, write input as partial output\n this._partialOutput.clear();\n for(var i = 0; i < this._ints; ++i) {\n this._partialBlock[i] = input.getInt32();\n this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]);\n }\n\n if(partialBytes > 0) {\n // block still incomplete, restore input buffer\n input.read -= this.blockSize;\n } else {\n // block complete, update input block\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = this._partialBlock[i];\n }\n }\n\n // skip any previous partial bytes\n if(this._partialBytes > 0) {\n this._partialOutput.getBytes(this._partialBytes);\n }\n\n if(partialBytes > 0 && !finish) {\n output.putBytes(this._partialOutput.getBytes(\n partialBytes - this._partialBytes));\n this._partialBytes = partialBytes;\n return true;\n }\n\n output.putBytes(this._partialOutput.getBytes(\n inputLength - this._partialBytes));\n this._partialBytes = 0;\n};\n\n/** Output feedback (OFB) **/\n\nmodes.ofb = function(options) {\n options = options || {};\n this.name = 'OFB';\n this.cipher = options.cipher;\n this.blockSize = options.blockSize || 16;\n this._ints = this.blockSize / 4;\n this._inBlock = null;\n this._outBlock = new Array(this._ints);\n this._partialOutput = forge.util.createBuffer();\n this._partialBytes = 0;\n};\n\nmodes.ofb.prototype.start = function(options) {\n if(!('iv' in options)) {\n throw new Error('Invalid IV parameter.');\n }\n // use IV as first input\n this._iv = transformIV(options.iv);\n this._inBlock = this._iv.slice(0);\n this._partialBytes = 0;\n};\n\nmodes.ofb.prototype.encrypt = function(input, output, finish) {\n // not enough input to encrypt\n var inputLength = input.length();\n if(input.length() === 0) {\n return true;\n }\n\n // encrypt block (OFB always uses encryption mode)\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // handle full block\n if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n // XOR input with output and update next input\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(input.getInt32() ^ this._outBlock[i]);\n this._inBlock[i] = this._outBlock[i];\n }\n return;\n }\n\n // handle partial block\n var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n if(partialBytes > 0) {\n partialBytes = this.blockSize - partialBytes;\n }\n\n // XOR input with output\n this._partialOutput.clear();\n for(var i = 0; i < this._ints; ++i) {\n this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);\n }\n\n if(partialBytes > 0) {\n // block still incomplete, restore input buffer\n input.read -= this.blockSize;\n } else {\n // block complete, update input block\n for(var i = 0; i < this._ints; ++i) {\n this._inBlock[i] = this._outBlock[i];\n }\n }\n\n // skip any previous partial bytes\n if(this._partialBytes > 0) {\n this._partialOutput.getBytes(this._partialBytes);\n }\n\n if(partialBytes > 0 && !finish) {\n output.putBytes(this._partialOutput.getBytes(\n partialBytes - this._partialBytes));\n this._partialBytes = partialBytes;\n return true;\n }\n\n output.putBytes(this._partialOutput.getBytes(\n inputLength - this._partialBytes));\n this._partialBytes = 0;\n};\n\nmodes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt;\n\n/** Counter (CTR) **/\n\nmodes.ctr = function(options) {\n options = options || {};\n this.name = 'CTR';\n this.cipher = options.cipher;\n this.blockSize = options.blockSize || 16;\n this._ints = this.blockSize / 4;\n this._inBlock = null;\n this._outBlock = new Array(this._ints);\n this._partialOutput = forge.util.createBuffer();\n this._partialBytes = 0;\n};\n\nmodes.ctr.prototype.start = function(options) {\n if(!('iv' in options)) {\n throw new Error('Invalid IV parameter.');\n }\n // use IV as first input\n this._iv = transformIV(options.iv);\n this._inBlock = this._iv.slice(0);\n this._partialBytes = 0;\n};\n\nmodes.ctr.prototype.encrypt = function(input, output, finish) {\n // not enough input to encrypt\n var inputLength = input.length();\n if(inputLength === 0) {\n return true;\n }\n\n // encrypt block (CTR always uses encryption mode)\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // handle full block\n if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n // XOR input with output\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(input.getInt32() ^ this._outBlock[i]);\n }\n } else {\n // handle partial block\n var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n if(partialBytes > 0) {\n partialBytes = this.blockSize - partialBytes;\n }\n\n // XOR input with output\n this._partialOutput.clear();\n for(var i = 0; i < this._ints; ++i) {\n this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);\n }\n\n if(partialBytes > 0) {\n // block still incomplete, restore input buffer\n input.read -= this.blockSize;\n }\n\n // skip any previous partial bytes\n if(this._partialBytes > 0) {\n this._partialOutput.getBytes(this._partialBytes);\n }\n\n if(partialBytes > 0 && !finish) {\n output.putBytes(this._partialOutput.getBytes(\n partialBytes - this._partialBytes));\n this._partialBytes = partialBytes;\n return true;\n }\n\n output.putBytes(this._partialOutput.getBytes(\n inputLength - this._partialBytes));\n this._partialBytes = 0;\n }\n\n // block complete, increment counter (input block)\n inc32(this._inBlock);\n};\n\nmodes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt;\n\n/** Galois/Counter Mode (GCM) **/\n\nmodes.gcm = function(options) {\n options = options || {};\n this.name = 'GCM';\n this.cipher = options.cipher;\n this.blockSize = options.blockSize || 16;\n this._ints = this.blockSize / 4;\n this._inBlock = new Array(this._ints);\n this._outBlock = new Array(this._ints);\n this._partialOutput = forge.util.createBuffer();\n this._partialBytes = 0;\n\n // R is actually this value concatenated with 120 more zero bits, but\n // we only XOR against R so the other zeros have no effect -- we just\n // apply this value to the first integer in a block\n this._R = 0xE1000000;\n};\n\nmodes.gcm.prototype.start = function(options) {\n if(!('iv' in options)) {\n throw new Error('Invalid IV parameter.');\n }\n // ensure IV is a byte buffer\n var iv = forge.util.createBuffer(options.iv);\n\n // no ciphered data processed yet\n this._cipherLength = 0;\n\n // default additional data is none\n var additionalData;\n if('additionalData' in options) {\n additionalData = forge.util.createBuffer(options.additionalData);\n } else {\n additionalData = forge.util.createBuffer();\n }\n\n // default tag length is 128 bits\n if('tagLength' in options) {\n this._tagLength = options.tagLength;\n } else {\n this._tagLength = 128;\n }\n\n // if tag is given, ensure tag matches tag length\n this._tag = null;\n if(options.decrypt) {\n // save tag to check later\n this._tag = forge.util.createBuffer(options.tag).getBytes();\n if(this._tag.length !== (this._tagLength / 8)) {\n throw new Error('Authentication tag does not match tag length.');\n }\n }\n\n // create tmp storage for hash calculation\n this._hashBlock = new Array(this._ints);\n\n // no tag generated yet\n this.tag = null;\n\n // generate hash subkey\n // (apply block cipher to \"zero\" block)\n this._hashSubkey = new Array(this._ints);\n this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey);\n\n // generate table M\n // use 4-bit tables (32 component decomposition of a 16 byte value)\n // 8-bit tables take more space and are known to have security\n // vulnerabilities (in native implementations)\n this.componentBits = 4;\n this._m = this.generateHashTable(this._hashSubkey, this.componentBits);\n\n // Note: support IV length different from 96 bits? (only supporting\n // 96 bits is recommended by NIST SP-800-38D)\n // generate J_0\n var ivLength = iv.length();\n if(ivLength === 12) {\n // 96-bit IV\n this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1];\n } else {\n // IV is NOT 96-bits\n this._j0 = [0, 0, 0, 0];\n while(iv.length() > 0) {\n this._j0 = this.ghash(\n this._hashSubkey, this._j0,\n [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]);\n }\n this._j0 = this.ghash(\n this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8)));\n }\n\n // generate ICB (initial counter block)\n this._inBlock = this._j0.slice(0);\n inc32(this._inBlock);\n this._partialBytes = 0;\n\n // consume authentication data\n additionalData = forge.util.createBuffer(additionalData);\n // save additional data length as a BE 64-bit number\n this._aDataLength = from64To32(additionalData.length() * 8);\n // pad additional data to 128 bit (16 byte) block size\n var overflow = additionalData.length() % this.blockSize;\n if(overflow) {\n additionalData.fillWithByte(0, this.blockSize - overflow);\n }\n this._s = [0, 0, 0, 0];\n while(additionalData.length() > 0) {\n this._s = this.ghash(this._hashSubkey, this._s, [\n additionalData.getInt32(),\n additionalData.getInt32(),\n additionalData.getInt32(),\n additionalData.getInt32()\n ]);\n }\n};\n\nmodes.gcm.prototype.encrypt = function(input, output, finish) {\n // not enough input to encrypt\n var inputLength = input.length();\n if(inputLength === 0) {\n return true;\n }\n\n // encrypt block\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // handle full block\n if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n // XOR input with output\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(this._outBlock[i] ^= input.getInt32());\n }\n this._cipherLength += this.blockSize;\n } else {\n // handle partial block\n var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n if(partialBytes > 0) {\n partialBytes = this.blockSize - partialBytes;\n }\n\n // XOR input with output\n this._partialOutput.clear();\n for(var i = 0; i < this._ints; ++i) {\n this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);\n }\n\n if(partialBytes === 0 || finish) {\n // handle overflow prior to hashing\n if(finish) {\n // get block overflow\n var overflow = inputLength % this.blockSize;\n this._cipherLength += overflow;\n // truncate for hash function\n this._partialOutput.truncate(this.blockSize - overflow);\n } else {\n this._cipherLength += this.blockSize;\n }\n\n // get output block for hashing\n for(var i = 0; i < this._ints; ++i) {\n this._outBlock[i] = this._partialOutput.getInt32();\n }\n this._partialOutput.read -= this.blockSize;\n }\n\n // skip any previous partial bytes\n if(this._partialBytes > 0) {\n this._partialOutput.getBytes(this._partialBytes);\n }\n\n if(partialBytes > 0 && !finish) {\n // block still incomplete, restore input buffer, get partial output,\n // and return early\n input.read -= this.blockSize;\n output.putBytes(this._partialOutput.getBytes(\n partialBytes - this._partialBytes));\n this._partialBytes = partialBytes;\n return true;\n }\n\n output.putBytes(this._partialOutput.getBytes(\n inputLength - this._partialBytes));\n this._partialBytes = 0;\n }\n\n // update hash block S\n this._s = this.ghash(this._hashSubkey, this._s, this._outBlock);\n\n // increment counter (input block)\n inc32(this._inBlock);\n};\n\nmodes.gcm.prototype.decrypt = function(input, output, finish) {\n // not enough input to decrypt\n var inputLength = input.length();\n if(inputLength < this.blockSize && !(finish && inputLength > 0)) {\n return true;\n }\n\n // encrypt block (GCM always uses encryption mode)\n this.cipher.encrypt(this._inBlock, this._outBlock);\n\n // increment counter (input block)\n inc32(this._inBlock);\n\n // update hash block S\n this._hashBlock[0] = input.getInt32();\n this._hashBlock[1] = input.getInt32();\n this._hashBlock[2] = input.getInt32();\n this._hashBlock[3] = input.getInt32();\n this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock);\n\n // XOR hash input with output\n for(var i = 0; i < this._ints; ++i) {\n output.putInt32(this._outBlock[i] ^ this._hashBlock[i]);\n }\n\n // increment cipher data length\n if(inputLength < this.blockSize) {\n this._cipherLength += inputLength % this.blockSize;\n } else {\n this._cipherLength += this.blockSize;\n }\n};\n\nmodes.gcm.prototype.afterFinish = function(output, options) {\n var rval = true;\n\n // handle overflow\n if(options.decrypt && options.overflow) {\n output.truncate(this.blockSize - options.overflow);\n }\n\n // handle authentication tag\n this.tag = forge.util.createBuffer();\n\n // concatenate additional data length with cipher length\n var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8));\n\n // include lengths in hash\n this._s = this.ghash(this._hashSubkey, this._s, lengths);\n\n // do GCTR(J_0, S)\n var tag = [];\n this.cipher.encrypt(this._j0, tag);\n for(var i = 0; i < this._ints; ++i) {\n this.tag.putInt32(this._s[i] ^ tag[i]);\n }\n\n // trim tag to length\n this.tag.truncate(this.tag.length() % (this._tagLength / 8));\n\n // check authentication tag\n if(options.decrypt && this.tag.bytes() !== this._tag) {\n rval = false;\n }\n\n return rval;\n};\n\n/**\n * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois\n * field multiplication. The field, GF(2^128), is defined by the polynomial:\n *\n * x^128 + x^7 + x^2 + x + 1\n *\n * Which is represented in little-endian binary form as: 11100001 (0xe1). When\n * the value of a coefficient is 1, a bit is set. The value R, is the\n * concatenation of this value and 120 zero bits, yielding a 128-bit value\n * which matches the block size.\n *\n * This function will multiply two elements (vectors of bytes), X and Y, in\n * the field GF(2^128). The result is initialized to zero. For each bit of\n * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd)\n * by the current value of Y. For each bit, the value of Y will be raised by\n * a power of x (multiplied by the polynomial x). This can be achieved by\n * shifting Y once to the right. If the current value of Y, prior to being\n * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial.\n * Otherwise, we must divide by R after shifting to find the remainder.\n *\n * @param x the first block to multiply by the second.\n * @param y the second block to multiply by the first.\n *\n * @return the block result of the multiplication.\n */\nmodes.gcm.prototype.multiply = function(x, y) {\n var z_i = [0, 0, 0, 0];\n var v_i = y.slice(0);\n\n // calculate Z_128 (block has 128 bits)\n for(var i = 0; i < 128; ++i) {\n // if x_i is 0, Z_{i+1} = Z_i (unchanged)\n // else Z_{i+1} = Z_i ^ V_i\n // get x_i by finding 32-bit int position, then left shift 1 by remainder\n var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32));\n if(x_i) {\n z_i[0] ^= v_i[0];\n z_i[1] ^= v_i[1];\n z_i[2] ^= v_i[2];\n z_i[3] ^= v_i[3];\n }\n\n // if LSB(V_i) is 1, V_i = V_i >> 1\n // else V_i = (V_i >> 1) ^ R\n this.pow(v_i, v_i);\n }\n\n return z_i;\n};\n\nmodes.gcm.prototype.pow = function(x, out) {\n // if LSB(x) is 1, x = x >>> 1\n // else x = (x >>> 1) ^ R\n var lsb = x[3] & 1;\n\n // always do x >>> 1:\n // starting with the rightmost integer, shift each integer to the right\n // one bit, pulling in the bit from the integer to the left as its top\n // most bit (do this for the last 3 integers)\n for(var i = 3; i > 0; --i) {\n out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31);\n }\n // shift the first integer normally\n out[0] = x[0] >>> 1;\n\n // if lsb was not set, then polynomial had a degree of 127 and doesn't\n // need to divided; otherwise, XOR with R to find the remainder; we only\n // need to XOR the first integer since R technically ends w/120 zero bits\n if(lsb) {\n out[0] ^= this._R;\n }\n};\n\nmodes.gcm.prototype.tableMultiply = function(x) {\n // assumes 4-bit tables are used\n var z = [0, 0, 0, 0];\n for(var i = 0; i < 32; ++i) {\n var idx = (i / 8) | 0;\n var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF;\n var ah = this._m[i][x_i];\n z[0] ^= ah[0];\n z[1] ^= ah[1];\n z[2] ^= ah[2];\n z[3] ^= ah[3];\n }\n return z;\n};\n\n/**\n * A continuing version of the GHASH algorithm that operates on a single\n * block. The hash block, last hash value (Ym) and the new block to hash\n * are given.\n *\n * @param h the hash block.\n * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash.\n * @param x the block to hash.\n *\n * @return the hashed value (Ym).\n */\nmodes.gcm.prototype.ghash = function(h, y, x) {\n y[0] ^= x[0];\n y[1] ^= x[1];\n y[2] ^= x[2];\n y[3] ^= x[3];\n return this.tableMultiply(y);\n //return this.multiply(y, h);\n};\n\n/**\n * Precomputes a table for multiplying against the hash subkey. This\n * mechanism provides a substantial speed increase over multiplication\n * performed without a table. The table-based multiplication this table is\n * for solves X * H by multiplying each component of X by H and then\n * composing the results together using XOR.\n *\n * This function can be used to generate tables with different bit sizes\n * for the components, however, this implementation assumes there are\n * 32 components of X (which is a 16 byte vector), therefore each component\n * takes 4-bits (so the table is constructed with bits=4).\n *\n * @param h the hash subkey.\n * @param bits the bit size for a component.\n */\nmodes.gcm.prototype.generateHashTable = function(h, bits) {\n // TODO: There are further optimizations that would use only the\n // first table M_0 (or some variant) along with a remainder table;\n // this can be explored in the future\n var multiplier = 8 / bits;\n var perInt = 4 * multiplier;\n var size = 16 * multiplier;\n var m = new Array(size);\n for(var i = 0; i < size; ++i) {\n var tmp = [0, 0, 0, 0];\n var idx = (i / perInt) | 0;\n var shft = ((perInt - 1 - (i % perInt)) * bits);\n tmp[idx] = (1 << (bits - 1)) << shft;\n m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits);\n }\n return m;\n};\n\n/**\n * Generates a table for multiplying against the hash subkey for one\n * particular component (out of all possible component values).\n *\n * @param mid the pre-multiplied value for the middle key of the table.\n * @param bits the bit size for a component.\n */\nmodes.gcm.prototype.generateSubHashTable = function(mid, bits) {\n // compute the table quickly by minimizing the number of\n // POW operations -- they only need to be performed for powers of 2,\n // all other entries can be composed from those powers using XOR\n var size = 1 << bits;\n var half = size >>> 1;\n var m = new Array(size);\n m[half] = mid.slice(0);\n var i = half >>> 1;\n while(i > 0) {\n // raise m0[2 * i] and store in m0[i]\n this.pow(m[2 * i], m[i] = []);\n i >>= 1;\n }\n i = 2;\n while(i < half) {\n for(var j = 1; j < i; ++j) {\n var m_i = m[i];\n var m_j = m[j];\n m[i + j] = [\n m_i[0] ^ m_j[0],\n m_i[1] ^ m_j[1],\n m_i[2] ^ m_j[2],\n m_i[3] ^ m_j[3]\n ];\n }\n i *= 2;\n }\n m[0] = [0, 0, 0, 0];\n /* Note: We could avoid storing these by doing composition during multiply\n calculate top half using composition by speed is preferred. */\n for(i = half + 1; i < size; ++i) {\n var c = m[i ^ half];\n m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]];\n }\n return m;\n};\n\n/** Utility functions */\n\nfunction transformIV(iv) {\n if(typeof iv === 'string') {\n // convert iv string into byte buffer\n iv = forge.util.createBuffer(iv);\n }\n\n if(forge.util.isArray(iv) && iv.length > 4) {\n // convert iv byte array into byte buffer\n var tmp = iv;\n iv = forge.util.createBuffer();\n for(var i = 0; i < tmp.length; ++i) {\n iv.putByte(tmp[i]);\n }\n }\n if(!forge.util.isArray(iv)) {\n // convert iv byte buffer into 32-bit integer array\n iv = [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()];\n }\n\n return iv;\n}\n\nfunction inc32(block) {\n // increment last 32 bits of block only\n block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF;\n}\n\nfunction from64To32(num) {\n // convert 64-bit number to two BE Int32s\n return [(num / 0x100000000) | 0, num & 0xFFFFFFFF];\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/cipherModes.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/des.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/des.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * DES (Data Encryption Standard) implementation.\n *\n * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode.\n * It is based on the BSD-licensed implementation by Paul Tero:\n *\n * Paul Tero, July 2001\n * http://www.tero.co.uk/des/\n *\n * Optimised for performance with large blocks by Michael Hayworth, November 2001\n * http://www.netdealing.com\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * @author Stefan Siegl\n * @author Dave Longley\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n * Copyright (c) 2012-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./cipher */ \"./node_modules/node-forge/lib/cipher.js\");\n__webpack_require__(/*! ./cipherModes */ \"./node_modules/node-forge/lib/cipherModes.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\n/* DES API */\nmodule.exports = forge.des = forge.des || {};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('DES-<mode>', key);\n * cipher.start({iv: iv});\n *\n * Creates an DES cipher object to encrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as binary-encoded strings of bytes or\n * byte buffers.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC' if IV is\n * given, 'ECB' if null).\n *\n * @return the cipher.\n */\nforge.des.startEncrypting = function(key, iv, output, mode) {\n var cipher = _createCipher({\n key: key,\n output: output,\n decrypt: false,\n mode: mode || (iv === null ? 'ECB' : 'CBC')\n });\n cipher.start(iv);\n return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('DES-<mode>', key);\n *\n * Creates an DES cipher object to encrypt data using the given symmetric key.\n *\n * The key may be given as a binary-encoded string of bytes or a byte buffer.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.des.createEncryptionCipher = function(key, mode) {\n return _createCipher({\n key: key,\n output: null,\n decrypt: false,\n mode: mode\n });\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('DES-<mode>', key);\n * decipher.start({iv: iv});\n *\n * Creates an DES cipher object to decrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as binary-encoded strings of bytes or\n * byte buffers.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC' if IV is\n * given, 'ECB' if null).\n *\n * @return the cipher.\n */\nforge.des.startDecrypting = function(key, iv, output, mode) {\n var cipher = _createCipher({\n key: key,\n output: output,\n decrypt: true,\n mode: mode || (iv === null ? 'ECB' : 'CBC')\n });\n cipher.start(iv);\n return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('DES-<mode>', key);\n *\n * Creates an DES cipher object to decrypt data using the given symmetric key.\n *\n * The key may be given as a binary-encoded string of bytes or a byte buffer.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.des.createDecryptionCipher = function(key, mode) {\n return _createCipher({\n key: key,\n output: null,\n decrypt: true,\n mode: mode\n });\n};\n\n/**\n * Creates a new DES cipher algorithm object.\n *\n * @param name the name of the algorithm.\n * @param mode the mode factory function.\n *\n * @return the DES algorithm object.\n */\nforge.des.Algorithm = function(name, mode) {\n var self = this;\n self.name = name;\n self.mode = new mode({\n blockSize: 8,\n cipher: {\n encrypt: function(inBlock, outBlock) {\n return _updateBlock(self._keys, inBlock, outBlock, false);\n },\n decrypt: function(inBlock, outBlock) {\n return _updateBlock(self._keys, inBlock, outBlock, true);\n }\n }\n });\n self._init = false;\n};\n\n/**\n * Initializes this DES algorithm by expanding its key.\n *\n * @param options the options to use.\n * key the key to use with this algorithm.\n * decrypt true if the algorithm should be initialized for decryption,\n * false for encryption.\n */\nforge.des.Algorithm.prototype.initialize = function(options) {\n if(this._init) {\n return;\n }\n\n var key = forge.util.createBuffer(options.key);\n if(this.name.indexOf('3DES') === 0) {\n if(key.length() !== 24) {\n throw new Error('Invalid Triple-DES key size: ' + key.length() * 8);\n }\n }\n\n // do key expansion to 16 or 48 subkeys (single or triple DES)\n this._keys = _createKeys(key);\n this._init = true;\n};\n\n/** Register DES algorithms **/\n\nregisterAlgorithm('DES-ECB', forge.cipher.modes.ecb);\nregisterAlgorithm('DES-CBC', forge.cipher.modes.cbc);\nregisterAlgorithm('DES-CFB', forge.cipher.modes.cfb);\nregisterAlgorithm('DES-OFB', forge.cipher.modes.ofb);\nregisterAlgorithm('DES-CTR', forge.cipher.modes.ctr);\n\nregisterAlgorithm('3DES-ECB', forge.cipher.modes.ecb);\nregisterAlgorithm('3DES-CBC', forge.cipher.modes.cbc);\nregisterAlgorithm('3DES-CFB', forge.cipher.modes.cfb);\nregisterAlgorithm('3DES-OFB', forge.cipher.modes.ofb);\nregisterAlgorithm('3DES-CTR', forge.cipher.modes.ctr);\n\nfunction registerAlgorithm(name, mode) {\n var factory = function() {\n return new forge.des.Algorithm(name, mode);\n };\n forge.cipher.registerAlgorithm(name, factory);\n}\n\n/** DES implementation **/\n\nvar spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004];\nvar spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000];\nvar spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200];\nvar spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080];\nvar spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100];\nvar spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010];\nvar spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002];\nvar spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000];\n\n/**\n * Create necessary sub keys.\n *\n * @param key the 64-bit or 192-bit key.\n *\n * @return the expanded keys.\n */\nfunction _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}\n\n/**\n * Updates a single block (1 byte) using DES. The update will either\n * encrypt or decrypt the block.\n *\n * @param keys the expanded keys.\n * @param input the input block (an array of 32-bit words).\n * @param output the updated output block.\n * @param decrypt true to decrypt the block, false to encrypt it.\n */\nfunction _updateBlock(keys, input, output, decrypt) {\n // set up loops for single or triple DES\n var iterations = keys.length === 32 ? 3 : 9;\n var looping;\n if(iterations === 3) {\n looping = decrypt ? [30, -2, -2] : [0, 32, 2];\n } else {\n looping = (decrypt ?\n [94, 62, -2, 32, 64, 2, 30, -2, -2] :\n [0, 32, 2, 62, 30, -2, 64, 96, 2]);\n }\n\n var tmp;\n\n var left = input[0];\n var right = input[1];\n\n // first each 64 bit chunk of the message must be permuted according to IP\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= tmp;\n left ^= (tmp << 16);\n\n tmp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= tmp;\n right ^= (tmp << 2);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // rotate left 1 bit\n left = ((left << 1) | (left >>> 31));\n right = ((right << 1) | (right >>> 31));\n\n for(var j = 0; j < iterations; j += 3) {\n var endloop = looping[j + 1];\n var loopinc = looping[j + 2];\n\n // now go through and perform the encryption or decryption\n for(var i = looping[j]; i != endloop; i += loopinc) {\n var right1 = right ^ keys[i];\n var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];\n\n // passing these bytes through the S selection functions\n tmp = left;\n left = right;\n right = tmp ^ (\n spfunction2[(right1 >>> 24) & 0x3f] |\n spfunction4[(right1 >>> 16) & 0x3f] |\n spfunction6[(right1 >>> 8) & 0x3f] |\n spfunction8[right1 & 0x3f] |\n spfunction1[(right2 >>> 24) & 0x3f] |\n spfunction3[(right2 >>> 16) & 0x3f] |\n spfunction5[(right2 >>> 8) & 0x3f] |\n spfunction7[right2 & 0x3f]);\n }\n // unreverse left and right\n tmp = left;\n left = right;\n right = tmp;\n }\n\n // rotate right 1 bit\n left = ((left >>> 1) | (left << 31));\n right = ((right >>> 1) | (right << 31));\n\n // now perform IP-1, which is IP in the opposite direction\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((right >>> 2) ^ left) & 0x33333333;\n left ^= tmp;\n right ^= (tmp << 2);\n\n tmp = ((left >>> 16) ^ right) & 0x0000ffff;\n right ^= tmp;\n left ^= (tmp << 16);\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n output[0] = left;\n output[1] = right;\n}\n\n/**\n * Deprecated. Instead, use:\n *\n * forge.cipher.createCipher('DES-<mode>', key);\n * forge.cipher.createDecipher('DES-<mode>', key);\n *\n * Creates a deprecated DES cipher object. This object's mode will default to\n * CBC (cipher-block-chaining).\n *\n * The key may be given as a binary-encoded string of bytes or a byte buffer.\n *\n * @param options the options to use.\n * key the symmetric key to use (64 or 192 bits).\n * output the buffer to write to.\n * decrypt true for decryption, false for encryption.\n * mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nfunction _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'DES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/des.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/forge.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/forge.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Node.js module for Forge.\n *\n * @author Dave Longley\n *\n * Copyright 2011-2016 Digital Bazaar, Inc.\n */\nmodule.exports = {\n // default options\n options: {\n usePureJavaScript: false\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/forge.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/hmac.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/hmac.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Hash-based Message Authentication Code implementation. Requires a message\n * digest object that can be obtained, for example, from forge.md.sha1 or\n * forge.md.md5.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./md */ \"./node_modules/node-forge/lib/md.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\n/* HMAC API */\nvar hmac = module.exports = forge.hmac = forge.hmac || {};\n\n/**\n * Creates an HMAC object that uses the given message digest object.\n *\n * @return an HMAC object.\n */\nhmac.create = function() {\n // the hmac key to use\n var _key = null;\n\n // the message digest to use\n var _md = null;\n\n // the inner padding\n var _ipadding = null;\n\n // the outer padding\n var _opadding = null;\n\n // hmac context\n var ctx = {};\n\n /**\n * Starts or restarts the HMAC with the given key and message digest.\n *\n * @param md the message digest to use, null to reuse the previous one,\n * a string to use builtin 'sha1', 'md5', 'sha256'.\n * @param key the key to use as a string, array of bytes, byte buffer,\n * or null to reuse the previous key.\n */\n ctx.start = function(md, key) {\n if(md !== null) {\n if(typeof md === 'string') {\n // create builtin message digest\n md = md.toLowerCase();\n if(md in forge.md.algorithms) {\n _md = forge.md.algorithms[md].create();\n } else {\n throw new Error('Unknown hash algorithm \"' + md + '\"');\n }\n } else {\n // store message digest\n _md = md;\n }\n }\n\n if(key === null) {\n // reuse previous key\n key = _key;\n } else {\n if(typeof key === 'string') {\n // convert string into byte buffer\n key = forge.util.createBuffer(key);\n } else if(forge.util.isArray(key)) {\n // convert byte array into byte buffer\n var tmp = key;\n key = forge.util.createBuffer();\n for(var i = 0; i < tmp.length; ++i) {\n key.putByte(tmp[i]);\n }\n }\n\n // if key is longer than blocksize, hash it\n var keylen = key.length();\n if(keylen > _md.blockLength) {\n _md.start();\n _md.update(key.bytes());\n key = _md.digest();\n }\n\n // mix key into inner and outer padding\n // ipadding = [0x36 * blocksize] ^ key\n // opadding = [0x5C * blocksize] ^ key\n _ipadding = forge.util.createBuffer();\n _opadding = forge.util.createBuffer();\n keylen = key.length();\n for(var i = 0; i < keylen; ++i) {\n var tmp = key.at(i);\n _ipadding.putByte(0x36 ^ tmp);\n _opadding.putByte(0x5C ^ tmp);\n }\n\n // if key is shorter than blocksize, add additional padding\n if(keylen < _md.blockLength) {\n var tmp = _md.blockLength - keylen;\n for(var i = 0; i < tmp; ++i) {\n _ipadding.putByte(0x36);\n _opadding.putByte(0x5C);\n }\n }\n _key = key;\n _ipadding = _ipadding.bytes();\n _opadding = _opadding.bytes();\n }\n\n // digest is done like so: hash(opadding | hash(ipadding | message))\n\n // prepare to do inner hash\n // hash(ipadding | message)\n _md.start();\n _md.update(_ipadding);\n };\n\n /**\n * Updates the HMAC with the given message bytes.\n *\n * @param bytes the bytes to update with.\n */\n ctx.update = function(bytes) {\n _md.update(bytes);\n };\n\n /**\n * Produces the Message Authentication Code (MAC).\n *\n * @return a byte buffer containing the digest value.\n */\n ctx.getMac = function() {\n // digest is done like so: hash(opadding | hash(ipadding | message))\n // here we do the outer hashing\n var inner = _md.digest().bytes();\n _md.start();\n _md.update(_opadding);\n _md.update(inner);\n return _md.digest();\n };\n // alias for getMac\n ctx.digest = ctx.getMac;\n\n return ctx;\n};\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/hmac.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/jsbn.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/jsbn.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright (c) 2005 Tom Wu\n// All Rights Reserved.\n// See \"LICENSE\" for details.\n\n// Basic JavaScript BN library - subset useful for RSA encryption.\n\n/*\nLicensing (LICENSE)\n-------------------\n\nThis software is covered under the following copyright:\n*/\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n/*\nAddress all questions regarding this license to:\n\n Tom Wu\n tjw@cs.Stanford.EDU\n*/\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n\nmodule.exports = forge.jsbn = forge.jsbn || {};\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// (public) Constructor\nfunction BigInteger(a,b,c) {\n this.data = [];\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n}\nforge.jsbn.BigInteger = BigInteger;\n\n// return new, unset BigInteger\nfunction nbi() { return new BigInteger(null); }\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this.data[i]&0x7fff;\n var h = this.data[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w.data[j++] = l&0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this.data[i]&0x3fff;\n var h = this.data[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w.data[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w.data[j++] = l&0xfffffff;\n }\n return c;\n}\n\n// node.js (no browser)\nif(typeof(navigator) === 'undefined')\n{\n BigInteger.prototype.am = am3;\n dbits = 28;\n} else if(j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n} else if(j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n} else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = ((1<<dbits)-1);\nBigInteger.prototype.DV = (1<<dbits);\n\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2,BI_FP);\nBigInteger.prototype.F1 = BI_FP-dbits;\nBigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n// Digit conversions\nvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\nvar BI_RC = new Array();\nvar rr,vv;\nrr = \"0\".charCodeAt(0);\nfor(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\nrr = \"a\".charCodeAt(0);\nfor(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\nrr = \"A\".charCodeAt(0);\nfor(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\nfunction int2char(n) { return BI_RM.charAt(n); }\nfunction intAt(s,i) {\n var c = BI_RC[s.charCodeAt(i)];\n return (c==null)?-1:c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this.data[0] = x;\n else if(x < -1) this.data[0] = x+this.DV;\n else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n// (protected) set from string and radix\nfunction bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this.data[this.t++] = x;\n else if(sh+k > this.DB) {\n this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n this.data[this.t++] = (x>>(this.DB-sh));\n } else\n this.data[this.t-1] |= x<<sh;\n sh += k;\n if(sh >= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n }\n this.clamp();\n if(mi) BigInteger.ZERO.subTo(this,this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n var c = this.s&this.DM;\n while(this.t > 0 && this.data[this.t-1] == c) --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}\n\n// (public) -this\nfunction bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n// (public) |this|\nfunction bnAbs() { return (this.s<0)?this.negate():this; }\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i];\n for(i = n-1; i >= 0; --i) r.data[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r.data[i+ds+1] = (this.data[i]>>cbs)|c;\n c = (this.data[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r.data[i] = 0;\n r.data[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r.data[0] = this.data[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r.data[i-ds-1] |= (this.data[i]&bm)<<cbs;\n r.data[i-ds] = this.data[i]>>bs;\n }\n if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]-a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while(i < a.t) {\n c -= a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r.data[i++] = this.DV+c;\n else if(c > 0) r.data[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r.data[i] = 0;\n for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r.data[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x.data[i],r,2*i,0,1);\n if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r.data[i+x.t] -= x.DV;\n r.data[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n}\n\n// Modular reduction using \"classic\" algorithm\nfunction Classic(m) { this.m = m; }\nfunction cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n}\nfunction cRevert(x) { return x; }\nfunction cReduce(x) { x.divRemTo(this.m,null,x); }\nfunction cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\nfunction cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\nClassic.prototype.convert = cConvert;\nClassic.prototype.revert = cRevert;\nClassic.prototype.reduce = cReduce;\nClassic.prototype.mulTo = cMulTo;\nClassic.prototype.sqrTo = cSqrTo;\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this.data[0];\n if((x&1) == 0) return 0;\n var y = x&3;\t\t// y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (protected) true iff this is even\nfunction bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }\n\n// (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\nfunction bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n}\n\n// (public) this^e % m, 0 <= e < 2^32\nfunction bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.isEven = bnpIsEven;\nBigInteger.prototype.exp = bnpExp;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.modPowInt = bnModPowInt;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n// jsbn2 lib\n\n//Copyright (c) 2005-2009 Tom Wu\n//All Rights Reserved.\n//See \"LICENSE\" for details (See jsbn.js for LICENSE).\n\n//Extended JavaScript BN functions, required for RSA private ops.\n\n//Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n\n//(public)\nfunction bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n//(public) return value as integer\nfunction bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}\n\n//(public) return value as byte\nfunction bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }\n\n//(public) return value as short (assumes DB>=16)\nfunction bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }\n\n//(protected) return x s.t. r^x < DV\nfunction bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n//(public) 0 if this == 0, 1 if this > 0\nfunction bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}\n\n//(protected) convert to radix string\nfunction bnpToRadix(b) {\nif(b == null) b = 10;\nif(this.signum() == 0 || b < 2 || b > 36) return \"0\";\nvar cs = this.chunkSize(b);\nvar a = Math.pow(b,cs);\nvar d = nbv(a), y = nbi(), z = nbi(), r = \"\";\nthis.divRemTo(d,y,z);\nwhile(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n}\nreturn z.intValue().toString(b) + r;\n}\n\n//(protected) convert from radix string\nfunction bnpFromRadix(s,b) {\nthis.fromInt(0);\nif(b == null) b = 10;\nvar cs = this.chunkSize(b);\nvar d = Math.pow(b,cs), mi = false, j = 0, w = 0;\nfor(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n}\nif(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n}\nif(mi) BigInteger.ZERO.subTo(this,this);\n}\n\n//(protected) alternate constructor\nfunction bnpFromNumber(a,b,c) {\nif(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1)) // force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n} else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;\n this.fromString(x,256);\n}\n}\n\n//(public) convert to bigendian byte array\nfunction bnToByteArray() {\nvar i = this.t, r = new Array();\nr[0] = this.s;\nvar p = this.DB-(i*this.DB)%8, d, k = 0;\nif(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this.data[i]&((1<<p)-1))<<(8-p);\n d |= this.data[--i]>>(p+=this.DB-8);\n } else {\n d = (this.data[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n}\nreturn r;\n}\n\nfunction bnEquals(a) { return(this.compareTo(a)==0); }\nfunction bnMin(a) { return(this.compareTo(a)<0)?this:a; }\nfunction bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n//(protected) r = this op a (bitwise)\nfunction bnpBitwiseTo(a,op,r) {\nvar i, f, m = Math.min(a.t,this.t);\nfor(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]);\nif(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f);\n r.t = this.t;\n} else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]);\n r.t = a.t;\n}\nr.s = op(this.s,a.s);\nr.clamp();\n}\n\n//(public) this & a\nfunction op_and(x,y) { return x&y; }\nfunction bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n//(public) this | a\nfunction op_or(x,y) { return x|y; }\nfunction bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n//(public) this ^ a\nfunction op_xor(x,y) { return x^y; }\nfunction bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n//(public) this & ~a\nfunction op_andnot(x,y) { return x&~y; }\nfunction bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n//(public) ~this\nfunction bnNot() {\nvar r = nbi();\nfor(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i];\nr.t = this.t;\nr.s = ~this.s;\nreturn r;\n}\n\n//(public) this << n\nfunction bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}\n\n//(public) this >> n\nfunction bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}\n\n//return index of lowest 1-bit in x, x < 2^31\nfunction lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}\n\n//(public) returns index of lowest 1-bit (or -1 if none)\nfunction bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}\n\n//return number of 1 bits in x\nfunction cbit(x) {\nvar r = 0;\nwhile(x != 0) { x &= x-1; ++r; }\nreturn r;\n}\n\n//(public) return number of set bits\nfunction bnBitCount() {\nvar r = 0, x = this.s&this.DM;\nfor(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\nreturn r;\n}\n\n//(public) true iff nth bit is set\nfunction bnTestBit(n) {\nvar j = Math.floor(n/this.DB);\nif(j >= this.t) return(this.s!=0);\nreturn((this.data[j]&(1<<(n%this.DB)))!=0);\n}\n\n//(protected) this op (1<<n)\nfunction bnpChangeBit(n,op) {\nvar r = BigInteger.ONE.shiftLeft(n);\nthis.bitwiseTo(r,op,r);\nreturn r;\n}\n\n//(public) this | (1<<n)\nfunction bnSetBit(n) { return this.changeBit(n,op_or); }\n\n//(public) this & ~(1<<n)\nfunction bnClearBit(n) { return this.changeBit(n,op_andnot); }\n\n//(public) this ^ (1<<n)\nfunction bnFlipBit(n) { return this.changeBit(n,op_xor); }\n\n//(protected) r = this + a\nfunction bnpAddTo(a,r) {\nvar i = 0, c = 0, m = Math.min(a.t,this.t);\nwhile(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n}\nif(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n} else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n}\nr.s = (c<0)?-1:0;\nif(c > 0) r.data[i++] = c;\nelse if(c < -1) r.data[i++] = this.DV+c;\nr.t = i;\nr.clamp();\n}\n\n//(public) this + a\nfunction bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n//(public) this - a\nfunction bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n//(public) this * a\nfunction bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n//(public) this / a\nfunction bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n//(public) this % a\nfunction bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n//(public) [this/a,this%a]\nfunction bnDivideAndRemainder(a) {\nvar q = nbi(), r = nbi();\nthis.divRemTo(a,q,r);\nreturn new Array(q,r);\n}\n\n//(protected) this *= n, this >= 0, 1 < n < DV\nfunction bnpDMultiply(n) {\nthis.data[this.t] = this.am(0,n-1,this,0,0,this.t);\n++this.t;\nthis.clamp();\n}\n\n//(protected) this += n << w words, this >= 0\nfunction bnpDAddOffset(n,w) {\nif(n == 0) return;\nwhile(this.t <= w) this.data[this.t++] = 0;\nthis.data[w] += n;\nwhile(this.data[w] >= this.DV) {\n this.data[w] -= this.DV;\n if(++w >= this.t) this.data[this.t++] = 0;\n ++this.data[w];\n}\n}\n\n//A \"null\" reducer\nfunction NullExp() {}\nfunction nNop(x) { return x; }\nfunction nMulTo(x,y,r) { x.multiplyTo(y,r); }\nfunction nSqrTo(x,r) { x.squareTo(r); }\n\nNullExp.prototype.convert = nNop;\nNullExp.prototype.revert = nNop;\nNullExp.prototype.mulTo = nMulTo;\nNullExp.prototype.sqrTo = nSqrTo;\n\n//(public) this^e\nfunction bnPow(e) { return this.exp(e,new NullExp()); }\n\n//(protected) r = lower n words of \"this * a\", a.t <= n\n//\"this\" should be the larger one if appropriate.\nfunction bnpMultiplyLowerTo(a,n,r) {\nvar i = Math.min(this.t+a.t,n);\nr.s = 0; // assumes a,this >= 0\nr.t = i;\nwhile(i > 0) r.data[--i] = 0;\nvar j;\nfor(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t);\nfor(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i);\nr.clamp();\n}\n\n//(protected) r = \"this * a\" without lower n words, n > 0\n//\"this\" should be the larger one if appropriate.\nfunction bnpMultiplyUpperTo(a,n,r) {\n--n;\nvar i = r.t = this.t+a.t-n;\nr.s = 0; // assumes a,this >= 0\nwhile(--i >= 0) r.data[i] = 0;\nfor(i = Math.max(n-this.t,0); i < a.t; ++i)\n r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n);\nr.clamp();\nr.drShiftTo(1,r);\n}\n\n//Barrett modular reduction\nfunction Barrett(m) {\n// setup Barrett\nthis.r2 = nbi();\nthis.q3 = nbi();\nBigInteger.ONE.dlShiftTo(2*m.t,this.r2);\nthis.mu = this.r2.divide(m);\nthis.m = m;\n}\n\nfunction barrettConvert(x) {\nif(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\nelse if(x.compareTo(this.m) < 0) return x;\nelse { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n}\n\nfunction barrettRevert(x) { return x; }\n\n//x = x mod m (HAC 14.42)\nfunction barrettReduce(x) {\nx.drShiftTo(this.m.t-1,this.r2);\nif(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\nthis.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\nthis.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\nwhile(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\nx.subTo(this.r2,x);\nwhile(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n//r = x^2 mod m; x != r\nfunction barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n//r = x*y mod m; x,y != r\nfunction barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nBarrett.prototype.convert = barrettConvert;\nBarrett.prototype.revert = barrettRevert;\nBarrett.prototype.reduce = barrettReduce;\nBarrett.prototype.mulTo = barrettMulTo;\nBarrett.prototype.sqrTo = barrettSqrTo;\n\n//(public) this^e % m (HAC 14.85)\nfunction bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}\n\n//(public) gcd(this,a) (HAC 14.54)\nfunction bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n } else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}\n\n//(protected) this % n, n < 2^26\nfunction bnpModInt(n) {\nif(n <= 0) return 0;\nvar d = this.DV%n, r = (this.s<0)?n-1:0;\nif(this.t > 0)\n if(d == 0) r = this.data[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n;\nreturn r;\n}\n\n//(public) 1/this % m (HAC 14.61)\nfunction bnModInverse(m) {\nvar ac = m.isEven();\nif((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\nvar u = m.clone(), v = this.clone();\nvar a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\nwhile(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n } else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n } else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n } else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n}\nif(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\nif(d.compareTo(m) >= 0) return d.subtract(m);\nif(d.signum() < 0) d.addTo(m,d); else return d;\nif(d.signum() < 0) return d.add(m); else return d;\n}\n\nvar lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];\nvar lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n//(public) test primality with certainty >= 1-.5^t\nfunction bnIsProbablePrime(t) {\nvar i, x = this.abs();\nif(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x.data[0] == lowprimes[i]) return true;\n return false;\n}\nif(x.isEven()) return false;\ni = 1;\nwhile(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n}\nreturn x.millerRabin(t);\n}\n\n//(protected) true if probably prime (HAC 4.24, Miller-Rabin)\nfunction bnpMillerRabin(t) {\nvar n1 = this.subtract(BigInteger.ONE);\nvar k = n1.getLowestSetBit();\nif(k <= 0) return false;\nvar r = n1.shiftRight(k);\nvar prng = bnGetPrng();\nvar a;\nfor(var i = 0; i < t; ++i) {\n // select witness 'a' at random from between 1 and n1\n do {\n a = new BigInteger(this.bitLength(), prng);\n }\n while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n}\nreturn true;\n}\n\n// get pseudo random number generator\nfunction bnGetPrng() {\n // create prng with api that matches BigInteger secure random\n return {\n // x is an array to fill with bytes\n nextBytes: function(x) {\n for(var i = 0; i < x.length; ++i) {\n x[i] = Math.floor(Math.random() * 0x0100);\n }\n }\n };\n}\n\n//protected\nBigInteger.prototype.chunkSize = bnpChunkSize;\nBigInteger.prototype.toRadix = bnpToRadix;\nBigInteger.prototype.fromRadix = bnpFromRadix;\nBigInteger.prototype.fromNumber = bnpFromNumber;\nBigInteger.prototype.bitwiseTo = bnpBitwiseTo;\nBigInteger.prototype.changeBit = bnpChangeBit;\nBigInteger.prototype.addTo = bnpAddTo;\nBigInteger.prototype.dMultiply = bnpDMultiply;\nBigInteger.prototype.dAddOffset = bnpDAddOffset;\nBigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\nBigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\nBigInteger.prototype.modInt = bnpModInt;\nBigInteger.prototype.millerRabin = bnpMillerRabin;\n\n//public\nBigInteger.prototype.clone = bnClone;\nBigInteger.prototype.intValue = bnIntValue;\nBigInteger.prototype.byteValue = bnByteValue;\nBigInteger.prototype.shortValue = bnShortValue;\nBigInteger.prototype.signum = bnSigNum;\nBigInteger.prototype.toByteArray = bnToByteArray;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.min = bnMin;\nBigInteger.prototype.max = bnMax;\nBigInteger.prototype.and = bnAnd;\nBigInteger.prototype.or = bnOr;\nBigInteger.prototype.xor = bnXor;\nBigInteger.prototype.andNot = bnAndNot;\nBigInteger.prototype.not = bnNot;\nBigInteger.prototype.shiftLeft = bnShiftLeft;\nBigInteger.prototype.shiftRight = bnShiftRight;\nBigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\nBigInteger.prototype.bitCount = bnBitCount;\nBigInteger.prototype.testBit = bnTestBit;\nBigInteger.prototype.setBit = bnSetBit;\nBigInteger.prototype.clearBit = bnClearBit;\nBigInteger.prototype.flipBit = bnFlipBit;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.remainder = bnRemainder;\nBigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\nBigInteger.prototype.modPow = bnModPow;\nBigInteger.prototype.modInverse = bnModInverse;\nBigInteger.prototype.pow = bnPow;\nBigInteger.prototype.gcd = bnGCD;\nBigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n//BigInteger interfaces not implemented in jsbn:\n\n//BigInteger(int signum, byte[] magnitude)\n//double doubleValue()\n//float floatValue()\n//int hashCode()\n//long longValue()\n//static BigInteger valueOf(long val)\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/jsbn.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/md.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/node-forge/lib/md.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Node.js module for Forge message digests.\n *\n * @author Dave Longley\n *\n * Copyright 2011-2017 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n\nmodule.exports = forge.md = forge.md || {};\nforge.md.algorithms = forge.md.algorithms || {};\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/md.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/oids.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/oids.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Object IDs for ASN.1.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n\nforge.pki = forge.pki || {};\nvar oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {};\n\n// set id to name mapping and name to id mapping\nfunction _IN(id, name) {\n oids[id] = name;\n oids[name] = id;\n}\n// set id to name mapping only\nfunction _I_(id, name) {\n oids[id] = name;\n}\n\n// algorithm OIDs\n_IN('1.2.840.113549.1.1.1', 'rsaEncryption');\n// Note: md2 & md4 not implemented\n//_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption');\n//_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption');\n_IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption');\n_IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption');\n_IN('1.2.840.113549.1.1.7', 'RSAES-OAEP');\n_IN('1.2.840.113549.1.1.8', 'mgf1');\n_IN('1.2.840.113549.1.1.9', 'pSpecified');\n_IN('1.2.840.113549.1.1.10', 'RSASSA-PSS');\n_IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption');\n_IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption');\n_IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption');\n\n_IN('1.2.840.10040.4.3', 'dsa-with-sha1');\n\n_IN('1.3.14.3.2.7', 'desCBC');\n\n_IN('1.3.14.3.2.26', 'sha1');\n_IN('2.16.840.1.101.3.4.2.1', 'sha256');\n_IN('2.16.840.1.101.3.4.2.2', 'sha384');\n_IN('2.16.840.1.101.3.4.2.3', 'sha512');\n_IN('1.2.840.113549.2.5', 'md5');\n\n// pkcs#7 content types\n_IN('1.2.840.113549.1.7.1', 'data');\n_IN('1.2.840.113549.1.7.2', 'signedData');\n_IN('1.2.840.113549.1.7.3', 'envelopedData');\n_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData');\n_IN('1.2.840.113549.1.7.5', 'digestedData');\n_IN('1.2.840.113549.1.7.6', 'encryptedData');\n\n// pkcs#9 oids\n_IN('1.2.840.113549.1.9.1', 'emailAddress');\n_IN('1.2.840.113549.1.9.2', 'unstructuredName');\n_IN('1.2.840.113549.1.9.3', 'contentType');\n_IN('1.2.840.113549.1.9.4', 'messageDigest');\n_IN('1.2.840.113549.1.9.5', 'signingTime');\n_IN('1.2.840.113549.1.9.6', 'counterSignature');\n_IN('1.2.840.113549.1.9.7', 'challengePassword');\n_IN('1.2.840.113549.1.9.8', 'unstructuredAddress');\n_IN('1.2.840.113549.1.9.14', 'extensionRequest');\n\n_IN('1.2.840.113549.1.9.20', 'friendlyName');\n_IN('1.2.840.113549.1.9.21', 'localKeyId');\n_IN('1.2.840.113549.1.9.22.1', 'x509Certificate');\n\n// pkcs#12 safe bags\n_IN('1.2.840.113549.1.12.10.1.1', 'keyBag');\n_IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag');\n_IN('1.2.840.113549.1.12.10.1.3', 'certBag');\n_IN('1.2.840.113549.1.12.10.1.4', 'crlBag');\n_IN('1.2.840.113549.1.12.10.1.5', 'secretBag');\n_IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag');\n\n// password-based-encryption for pkcs#12\n_IN('1.2.840.113549.1.5.13', 'pkcs5PBES2');\n_IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2');\n\n_IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4');\n_IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4');\n_IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC');\n_IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC');\n_IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC');\n_IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC');\n\n// hmac OIDs\n_IN('1.2.840.113549.2.7', 'hmacWithSHA1');\n_IN('1.2.840.113549.2.8', 'hmacWithSHA224');\n_IN('1.2.840.113549.2.9', 'hmacWithSHA256');\n_IN('1.2.840.113549.2.10', 'hmacWithSHA384');\n_IN('1.2.840.113549.2.11', 'hmacWithSHA512');\n\n// symmetric key algorithm oids\n_IN('1.2.840.113549.3.7', 'des-EDE3-CBC');\n_IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC');\n_IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC');\n_IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC');\n\n// certificate issuer/subject OIDs\n_IN('2.5.4.3', 'commonName');\n_IN('2.5.4.5', 'serialName');\n_IN('2.5.4.6', 'countryName');\n_IN('2.5.4.7', 'localityName');\n_IN('2.5.4.8', 'stateOrProvinceName');\n_IN('2.5.4.10', 'organizationName');\n_IN('2.5.4.11', 'organizationalUnitName');\n\n// X.509 extension OIDs\n_IN('2.16.840.1.113730.1.1', 'nsCertType');\n_I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35\n_I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15\n_I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32\n_I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15\n_I_('2.5.29.5', 'policyMapping'); // deprecated use .33\n_I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30\n_I_('2.5.29.7', 'subjectAltName'); // deprecated use .17\n_I_('2.5.29.8', 'issuerAltName'); // deprecated use .18\n_I_('2.5.29.9', 'subjectDirectoryAttributes');\n_I_('2.5.29.10', 'basicConstraints'); // deprecated use .19\n_I_('2.5.29.11', 'nameConstraints'); // deprecated use .30\n_I_('2.5.29.12', 'policyConstraints'); // deprecated use .36\n_I_('2.5.29.13', 'basicConstraints'); // deprecated use .19\n_IN('2.5.29.14', 'subjectKeyIdentifier');\n_IN('2.5.29.15', 'keyUsage');\n_I_('2.5.29.16', 'privateKeyUsagePeriod');\n_IN('2.5.29.17', 'subjectAltName');\n_IN('2.5.29.18', 'issuerAltName');\n_IN('2.5.29.19', 'basicConstraints');\n_I_('2.5.29.20', 'cRLNumber');\n_I_('2.5.29.21', 'cRLReason');\n_I_('2.5.29.22', 'expirationDate');\n_I_('2.5.29.23', 'instructionCode');\n_I_('2.5.29.24', 'invalidityDate');\n_I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31\n_I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28\n_I_('2.5.29.27', 'deltaCRLIndicator');\n_I_('2.5.29.28', 'issuingDistributionPoint');\n_I_('2.5.29.29', 'certificateIssuer');\n_I_('2.5.29.30', 'nameConstraints');\n_IN('2.5.29.31', 'cRLDistributionPoints');\n_IN('2.5.29.32', 'certificatePolicies');\n_I_('2.5.29.33', 'policyMappings');\n_I_('2.5.29.34', 'policyConstraints'); // deprecated use .36\n_IN('2.5.29.35', 'authorityKeyIdentifier');\n_I_('2.5.29.36', 'policyConstraints');\n_IN('2.5.29.37', 'extKeyUsage');\n_I_('2.5.29.46', 'freshestCRL');\n_I_('2.5.29.54', 'inhibitAnyPolicy');\n\n// extKeyUsage purposes\n_IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList');\n_IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess');\n_IN('1.3.6.1.5.5.7.3.1', 'serverAuth');\n_IN('1.3.6.1.5.5.7.3.2', 'clientAuth');\n_IN('1.3.6.1.5.5.7.3.3', 'codeSigning');\n_IN('1.3.6.1.5.5.7.3.4', 'emailProtection');\n_IN('1.3.6.1.5.5.7.3.8', 'timeStamping');\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/oids.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/pbe.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/pbe.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Password-based encryption functions.\n *\n * @author Dave Longley\n * @author Stefan Siegl <stesie@brokenpipe.de>\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n *\n * An EncryptedPrivateKeyInfo:\n *\n * EncryptedPrivateKeyInfo ::= SEQUENCE {\n * encryptionAlgorithm EncryptionAlgorithmIdentifier,\n * encryptedData EncryptedData }\n *\n * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier\n *\n * EncryptedData ::= OCTET STRING\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./aes */ \"./node_modules/node-forge/lib/aes.js\");\n__webpack_require__(/*! ./asn1 */ \"./node_modules/node-forge/lib/asn1.js\");\n__webpack_require__(/*! ./des */ \"./node_modules/node-forge/lib/des.js\");\n__webpack_require__(/*! ./md */ \"./node_modules/node-forge/lib/md.js\");\n__webpack_require__(/*! ./oids */ \"./node_modules/node-forge/lib/oids.js\");\n__webpack_require__(/*! ./pbkdf2 */ \"./node_modules/node-forge/lib/pbkdf2.js\");\n__webpack_require__(/*! ./pem */ \"./node_modules/node-forge/lib/pem.js\");\n__webpack_require__(/*! ./random */ \"./node_modules/node-forge/lib/random.js\");\n__webpack_require__(/*! ./rc2 */ \"./node_modules/node-forge/lib/rc2.js\");\n__webpack_require__(/*! ./rsa */ \"./node_modules/node-forge/lib/rsa.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nif(typeof BigInteger === 'undefined') {\n var BigInteger = forge.jsbn.BigInteger;\n}\n\n// shortcut for asn.1 API\nvar asn1 = forge.asn1;\n\n/* Password-based encryption implementation. */\nvar pki = forge.pki = forge.pki || {};\nmodule.exports = pki.pbe = forge.pbe = forge.pbe || {};\nvar oids = pki.oids;\n\n// validator for an EncryptedPrivateKeyInfo structure\n// Note: Currently only works w/algorithm params\nvar encryptedPrivateKeyValidator = {\n name: 'EncryptedPrivateKeyInfo',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'AlgorithmIdentifier.algorithm',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OID,\n constructed: false,\n capture: 'encryptionOid'\n }, {\n name: 'AlgorithmIdentifier.parameters',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n captureAsn1: 'encryptionParams'\n }]\n }, {\n // encryptedData\n name: 'EncryptedPrivateKeyInfo.encryptedData',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OCTETSTRING,\n constructed: false,\n capture: 'encryptedData'\n }]\n};\n\n// validator for a PBES2Algorithms structure\n// Note: Currently only works w/PBKDF2 + AES encryption schemes\nvar PBES2AlgorithmsValidator = {\n name: 'PBES2Algorithms',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'PBES2Algorithms.keyDerivationFunc',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'PBES2Algorithms.keyDerivationFunc.oid',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OID,\n constructed: false,\n capture: 'kdfOid'\n }, {\n name: 'PBES2Algorithms.params',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'PBES2Algorithms.params.salt',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OCTETSTRING,\n constructed: false,\n capture: 'kdfSalt'\n }, {\n name: 'PBES2Algorithms.params.iterationCount',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'kdfIterationCount'\n }, {\n name: 'PBES2Algorithms.params.keyLength',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n optional: true,\n capture: 'keyLength'\n }, {\n // prf\n name: 'PBES2Algorithms.params.prf',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n optional: true,\n value: [{\n name: 'PBES2Algorithms.params.prf.algorithm',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OID,\n constructed: false,\n capture: 'prfOid'\n }]\n }]\n }]\n }, {\n name: 'PBES2Algorithms.encryptionScheme',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'PBES2Algorithms.encryptionScheme.oid',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OID,\n constructed: false,\n capture: 'encOid'\n }, {\n name: 'PBES2Algorithms.encryptionScheme.iv',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OCTETSTRING,\n constructed: false,\n capture: 'encIv'\n }]\n }]\n};\n\nvar pkcs12PbeParamsValidator = {\n name: 'pkcs-12PbeParams',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'pkcs-12PbeParams.salt',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OCTETSTRING,\n constructed: false,\n capture: 'salt'\n }, {\n name: 'pkcs-12PbeParams.iterations',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'iterations'\n }]\n};\n\n/**\n * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo.\n *\n * PBES2Algorithms ALGORITHM-IDENTIFIER ::=\n * { {PBES2-params IDENTIFIED BY id-PBES2}, ...}\n *\n * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13}\n *\n * PBES2-params ::= SEQUENCE {\n * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}},\n * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}}\n * }\n *\n * PBES2-KDFs ALGORITHM-IDENTIFIER ::=\n * { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... }\n *\n * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }\n *\n * PBKDF2-params ::= SEQUENCE {\n * salt CHOICE {\n * specified OCTET STRING,\n * otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}\n * },\n * iterationCount INTEGER (1..MAX),\n * keyLength INTEGER (1..MAX) OPTIONAL,\n * prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1\n * }\n *\n * @param obj the ASN.1 PrivateKeyInfo object.\n * @param password the password to encrypt with.\n * @param options:\n * algorithm the encryption algorithm to use\n * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'.\n * count the iteration count to use.\n * saltSize the salt size to use.\n * prfAlgorithm the PRF message digest algorithm to use\n * ('sha1', 'sha224', 'sha256', 'sha384', 'sha512')\n *\n * @return the ASN.1 EncryptedPrivateKeyInfo.\n */\npki.encryptPrivateKeyInfo = function(obj, password, options) {\n // set default options\n options = options || {};\n options.saltSize = options.saltSize || 8;\n options.count = options.count || 2048;\n options.algorithm = options.algorithm || 'aes128';\n options.prfAlgorithm = options.prfAlgorithm || 'sha1';\n\n // generate PBE params\n var salt = forge.random.getBytesSync(options.saltSize);\n var count = options.count;\n var countBytes = asn1.integerToDer(count);\n var dkLen;\n var encryptionAlgorithm;\n var encryptedData;\n if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') {\n // do PBES2\n var ivLen, encOid, cipherFn;\n switch(options.algorithm) {\n case 'aes128':\n dkLen = 16;\n ivLen = 16;\n encOid = oids['aes128-CBC'];\n cipherFn = forge.aes.createEncryptionCipher;\n break;\n case 'aes192':\n dkLen = 24;\n ivLen = 16;\n encOid = oids['aes192-CBC'];\n cipherFn = forge.aes.createEncryptionCipher;\n break;\n case 'aes256':\n dkLen = 32;\n ivLen = 16;\n encOid = oids['aes256-CBC'];\n cipherFn = forge.aes.createEncryptionCipher;\n break;\n case 'des':\n dkLen = 8;\n ivLen = 8;\n encOid = oids['desCBC'];\n cipherFn = forge.des.createEncryptionCipher;\n break;\n default:\n var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.');\n error.algorithm = options.algorithm;\n throw error;\n }\n\n // get PRF message digest\n var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase();\n var md = prfAlgorithmToMessageDigest(prfAlgorithm);\n\n // encrypt private key using pbe SHA-1 and AES/DES\n var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md);\n var iv = forge.random.getBytesSync(ivLen);\n var cipher = cipherFn(dk);\n cipher.start(iv);\n cipher.update(asn1.toDer(obj));\n cipher.finish();\n encryptedData = cipher.output.getBytes();\n\n // get PBKDF2-params\n var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm);\n\n encryptionAlgorithm = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(oids['pkcs5PBES2']).getBytes()),\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // keyDerivationFunc\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()),\n // PBKDF2-params\n params\n ]),\n // encryptionScheme\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(encOid).getBytes()),\n // iv\n asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv)\n ])\n ])\n ]);\n } else if(options.algorithm === '3des') {\n // Do PKCS12 PBE\n dkLen = 24;\n\n var saltBytes = new forge.util.ByteBuffer(salt);\n var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen);\n var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen);\n var cipher = forge.des.createEncryptionCipher(dk);\n cipher.start(iv);\n cipher.update(asn1.toDer(obj));\n cipher.finish();\n encryptedData = cipher.output.getBytes();\n\n encryptionAlgorithm = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()),\n // pkcs-12PbeParams\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // salt\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt),\n // iteration count\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n countBytes.getBytes())\n ])\n ]);\n } else {\n var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.');\n error.algorithm = options.algorithm;\n throw error;\n }\n\n // EncryptedPrivateKeyInfo\n var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // encryptionAlgorithm\n encryptionAlgorithm,\n // encryptedData\n asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData)\n ]);\n return rval;\n};\n\n/**\n * Decrypts a ASN.1 PrivateKeyInfo object.\n *\n * @param obj the ASN.1 EncryptedPrivateKeyInfo object.\n * @param password the password to decrypt with.\n *\n * @return the ASN.1 PrivateKeyInfo on success, null on failure.\n */\npki.decryptPrivateKeyInfo = function(obj, password) {\n var rval = null;\n\n // get PBE params\n var capture = {};\n var errors = [];\n if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) {\n var error = new Error('Cannot read encrypted private key. ' +\n 'ASN.1 object is not a supported EncryptedPrivateKeyInfo.');\n error.errors = errors;\n throw error;\n }\n\n // get cipher\n var oid = asn1.derToOid(capture.encryptionOid);\n var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password);\n\n // get encrypted data\n var encrypted = forge.util.createBuffer(capture.encryptedData);\n\n cipher.update(encrypted);\n if(cipher.finish()) {\n rval = asn1.fromDer(cipher.output);\n }\n\n return rval;\n};\n\n/**\n * Converts a EncryptedPrivateKeyInfo to PEM format.\n *\n * @param epki the EncryptedPrivateKeyInfo.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted encrypted private key.\n */\npki.encryptedPrivateKeyToPem = function(epki, maxline) {\n // convert to DER, then PEM-encode\n var msg = {\n type: 'ENCRYPTED PRIVATE KEY',\n body: asn1.toDer(epki).getBytes()\n };\n return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption\n * is not performed.\n *\n * @param pem the EncryptedPrivateKeyInfo in PEM-format.\n *\n * @return the ASN.1 EncryptedPrivateKeyInfo.\n */\npki.encryptedPrivateKeyFromPem = function(pem) {\n var msg = forge.pem.decode(pem)[0];\n\n if(msg.type !== 'ENCRYPTED PRIVATE KEY') {\n var error = new Error('Could not convert encrypted private key from PEM; ' +\n 'PEM header type is \"ENCRYPTED PRIVATE KEY\".');\n error.headerType = msg.type;\n throw error;\n }\n if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n throw new Error('Could not convert encrypted private key from PEM; ' +\n 'PEM is encrypted.');\n }\n\n // convert DER to ASN.1 object\n return asn1.fromDer(msg.body);\n};\n\n/**\n * Encrypts an RSA private key. By default, the key will be wrapped in\n * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo.\n * This is the standard, preferred way to encrypt a private key.\n *\n * To produce a non-standard PEM-encrypted private key that uses encapsulated\n * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL\n * private key encryption), set the 'legacy' option to true. Note: Using this\n * option will cause the iteration count to be forced to 1.\n *\n * Note: The 'des' algorithm is supported, but it is not considered to be\n * secure because it only uses a single 56-bit key. If possible, it is highly\n * recommended that a different algorithm be used.\n *\n * @param rsaKey the RSA key to encrypt.\n * @param password the password to use.\n * @param options:\n * algorithm: the encryption algorithm to use\n * ('aes128', 'aes192', 'aes256', '3des', 'des').\n * count: the iteration count to use.\n * saltSize: the salt size to use.\n * legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated\n * headers (DEK-Info) private key.\n *\n * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo.\n */\npki.encryptRsaPrivateKey = function(rsaKey, password, options) {\n // standard PKCS#8\n options = options || {};\n if(!options.legacy) {\n // encrypt PrivateKeyInfo\n var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey));\n rval = pki.encryptPrivateKeyInfo(rval, password, options);\n return pki.encryptedPrivateKeyToPem(rval);\n }\n\n // legacy non-PKCS#8\n var algorithm;\n var iv;\n var dkLen;\n var cipherFn;\n switch(options.algorithm) {\n case 'aes128':\n algorithm = 'AES-128-CBC';\n dkLen = 16;\n iv = forge.random.getBytesSync(16);\n cipherFn = forge.aes.createEncryptionCipher;\n break;\n case 'aes192':\n algorithm = 'AES-192-CBC';\n dkLen = 24;\n iv = forge.random.getBytesSync(16);\n cipherFn = forge.aes.createEncryptionCipher;\n break;\n case 'aes256':\n algorithm = 'AES-256-CBC';\n dkLen = 32;\n iv = forge.random.getBytesSync(16);\n cipherFn = forge.aes.createEncryptionCipher;\n break;\n case '3des':\n algorithm = 'DES-EDE3-CBC';\n dkLen = 24;\n iv = forge.random.getBytesSync(8);\n cipherFn = forge.des.createEncryptionCipher;\n break;\n case 'des':\n algorithm = 'DES-CBC';\n dkLen = 8;\n iv = forge.random.getBytesSync(8);\n cipherFn = forge.des.createEncryptionCipher;\n break;\n default:\n var error = new Error('Could not encrypt RSA private key; unsupported ' +\n 'encryption algorithm \"' + options.algorithm + '\".');\n error.algorithm = options.algorithm;\n throw error;\n }\n\n // encrypt private key using OpenSSL legacy key derivation\n var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen);\n var cipher = cipherFn(dk);\n cipher.start(iv);\n cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey)));\n cipher.finish();\n\n var msg = {\n type: 'RSA PRIVATE KEY',\n procType: {\n version: '4',\n type: 'ENCRYPTED'\n },\n dekInfo: {\n algorithm: algorithm,\n parameters: forge.util.bytesToHex(iv).toUpperCase()\n },\n body: cipher.output.getBytes()\n };\n return forge.pem.encode(msg);\n};\n\n/**\n * Decrypts an RSA private key.\n *\n * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt.\n * @param password the password to use.\n *\n * @return the RSA key on success, null on failure.\n */\npki.decryptRsaPrivateKey = function(pem, password) {\n var rval = null;\n\n var msg = forge.pem.decode(pem)[0];\n\n if(msg.type !== 'ENCRYPTED PRIVATE KEY' &&\n msg.type !== 'PRIVATE KEY' &&\n msg.type !== 'RSA PRIVATE KEY') {\n var error = new Error('Could not convert private key from PEM; PEM header type ' +\n 'is not \"ENCRYPTED PRIVATE KEY\", \"PRIVATE KEY\", or \"RSA PRIVATE KEY\".');\n error.headerType = error;\n throw error;\n }\n\n if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n var dkLen;\n var cipherFn;\n switch(msg.dekInfo.algorithm) {\n case 'DES-CBC':\n dkLen = 8;\n cipherFn = forge.des.createDecryptionCipher;\n break;\n case 'DES-EDE3-CBC':\n dkLen = 24;\n cipherFn = forge.des.createDecryptionCipher;\n break;\n case 'AES-128-CBC':\n dkLen = 16;\n cipherFn = forge.aes.createDecryptionCipher;\n break;\n case 'AES-192-CBC':\n dkLen = 24;\n cipherFn = forge.aes.createDecryptionCipher;\n break;\n case 'AES-256-CBC':\n dkLen = 32;\n cipherFn = forge.aes.createDecryptionCipher;\n break;\n case 'RC2-40-CBC':\n dkLen = 5;\n cipherFn = function(key) {\n return forge.rc2.createDecryptionCipher(key, 40);\n };\n break;\n case 'RC2-64-CBC':\n dkLen = 8;\n cipherFn = function(key) {\n return forge.rc2.createDecryptionCipher(key, 64);\n };\n break;\n case 'RC2-128-CBC':\n dkLen = 16;\n cipherFn = function(key) {\n return forge.rc2.createDecryptionCipher(key, 128);\n };\n break;\n default:\n var error = new Error('Could not decrypt private key; unsupported ' +\n 'encryption algorithm \"' + msg.dekInfo.algorithm + '\".');\n error.algorithm = msg.dekInfo.algorithm;\n throw error;\n }\n\n // use OpenSSL legacy key derivation\n var iv = forge.util.hexToBytes(msg.dekInfo.parameters);\n var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen);\n var cipher = cipherFn(dk);\n cipher.start(iv);\n cipher.update(forge.util.createBuffer(msg.body));\n if(cipher.finish()) {\n rval = cipher.output.getBytes();\n } else {\n return rval;\n }\n } else {\n rval = msg.body;\n }\n\n if(msg.type === 'ENCRYPTED PRIVATE KEY') {\n rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password);\n } else {\n // decryption already performed above\n rval = asn1.fromDer(rval);\n }\n\n if(rval !== null) {\n rval = pki.privateKeyFromAsn1(rval);\n }\n\n return rval;\n};\n\n/**\n * Derives a PKCS#12 key.\n *\n * @param password the password to derive the key material from, null or\n * undefined for none.\n * @param salt the salt, as a ByteBuffer, to use.\n * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC).\n * @param iter the iteration count.\n * @param n the number of bytes to derive from the password.\n * @param md the message digest to use, defaults to SHA-1.\n *\n * @return a ByteBuffer with the bytes derived from the password.\n */\npki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) {\n var j, l;\n\n if(typeof md === 'undefined' || md === null) {\n if(!('sha1' in forge.md)) {\n throw new Error('\"sha1\" hash algorithm unavailable.');\n }\n md = forge.md.sha1.create();\n }\n\n var u = md.digestLength;\n var v = md.blockLength;\n var result = new forge.util.ByteBuffer();\n\n /* Convert password to Unicode byte buffer + trailing 0-byte. */\n var passBuf = new forge.util.ByteBuffer();\n if(password !== null && password !== undefined) {\n for(l = 0; l < password.length; l++) {\n passBuf.putInt16(password.charCodeAt(l));\n }\n passBuf.putInt16(0);\n }\n\n /* Length of salt and password in BYTES. */\n var p = passBuf.length();\n var s = salt.length();\n\n /* 1. Construct a string, D (the \"diversifier\"), by concatenating\n v copies of ID. */\n var D = new forge.util.ByteBuffer();\n D.fillWithByte(id, v);\n\n /* 2. Concatenate copies of the salt together to create a string S of length\n v * ceil(s / v) bytes (the final copy of the salt may be trunacted\n to create S).\n Note that if the salt is the empty string, then so is S. */\n var Slen = v * Math.ceil(s / v);\n var S = new forge.util.ByteBuffer();\n for(l = 0; l < Slen; l++) {\n S.putByte(salt.at(l % s));\n }\n\n /* 3. Concatenate copies of the password together to create a string P of\n length v * ceil(p / v) bytes (the final copy of the password may be\n truncated to create P).\n Note that if the password is the empty string, then so is P. */\n var Plen = v * Math.ceil(p / v);\n var P = new forge.util.ByteBuffer();\n for(l = 0; l < Plen; l++) {\n P.putByte(passBuf.at(l % p));\n }\n\n /* 4. Set I=S||P to be the concatenation of S and P. */\n var I = S;\n I.putBuffer(P);\n\n /* 5. Set c=ceil(n / u). */\n var c = Math.ceil(n / u);\n\n /* 6. For i=1, 2, ..., c, do the following: */\n for(var i = 1; i <= c; i++) {\n /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */\n var buf = new forge.util.ByteBuffer();\n buf.putBytes(D.bytes());\n buf.putBytes(I.bytes());\n for(var round = 0; round < iter; round++) {\n md.start();\n md.update(buf.getBytes());\n buf = md.digest();\n }\n\n /* b) Concatenate copies of Ai to create a string B of length v bytes (the\n final copy of Ai may be truncated to create B). */\n var B = new forge.util.ByteBuffer();\n for(l = 0; l < v; l++) {\n B.putByte(buf.at(l % u));\n }\n\n /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks,\n where k=ceil(s / v) + ceil(p / v), modify I by setting\n Ij=(Ij+B+1) mod 2v for each j. */\n var k = Math.ceil(s / v) + Math.ceil(p / v);\n var Inew = new forge.util.ByteBuffer();\n for(j = 0; j < k; j++) {\n var chunk = new forge.util.ByteBuffer(I.getBytes(v));\n var x = 0x1ff;\n for(l = B.length() - 1; l >= 0; l--) {\n x = x >> 8;\n x += B.at(l) + chunk.at(l);\n chunk.setAt(l, x & 0xff);\n }\n Inew.putBuffer(chunk);\n }\n I = Inew;\n\n /* Add Ai to A. */\n result.putBuffer(buf);\n }\n\n result.truncate(result.length() - n);\n return result;\n};\n\n/**\n * Get new Forge cipher object instance.\n *\n * @param oid the OID (in string notation).\n * @param params the ASN.1 params object.\n * @param password the password to decrypt with.\n *\n * @return new cipher object instance.\n */\npki.pbe.getCipher = function(oid, params, password) {\n switch(oid) {\n case pki.oids['pkcs5PBES2']:\n return pki.pbe.getCipherForPBES2(oid, params, password);\n\n case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']:\n case pki.oids['pbewithSHAAnd40BitRC2-CBC']:\n return pki.pbe.getCipherForPKCS12PBE(oid, params, password);\n\n default:\n var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.');\n error.oid = oid;\n error.supportedOids = [\n 'pkcs5PBES2',\n 'pbeWithSHAAnd3-KeyTripleDES-CBC',\n 'pbewithSHAAnd40BitRC2-CBC'\n ];\n throw error;\n }\n};\n\n/**\n * Get new Forge cipher object instance according to PBES2 params block.\n *\n * The returned cipher instance is already started using the IV\n * from PBES2 parameter block.\n *\n * @param oid the PKCS#5 PBKDF2 OID (in string notation).\n * @param params the ASN.1 PBES2-params object.\n * @param password the password to decrypt with.\n *\n * @return new cipher object instance.\n */\npki.pbe.getCipherForPBES2 = function(oid, params, password) {\n // get PBE params\n var capture = {};\n var errors = [];\n if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) {\n var error = new Error('Cannot read password-based-encryption algorithm ' +\n 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.');\n error.errors = errors;\n throw error;\n }\n\n // check oids\n oid = asn1.derToOid(capture.kdfOid);\n if(oid !== pki.oids['pkcs5PBKDF2']) {\n var error = new Error('Cannot read encrypted private key. ' +\n 'Unsupported key derivation function OID.');\n error.oid = oid;\n error.supportedOids = ['pkcs5PBKDF2'];\n throw error;\n }\n oid = asn1.derToOid(capture.encOid);\n if(oid !== pki.oids['aes128-CBC'] &&\n oid !== pki.oids['aes192-CBC'] &&\n oid !== pki.oids['aes256-CBC'] &&\n oid !== pki.oids['des-EDE3-CBC'] &&\n oid !== pki.oids['desCBC']) {\n var error = new Error('Cannot read encrypted private key. ' +\n 'Unsupported encryption scheme OID.');\n error.oid = oid;\n error.supportedOids = [\n 'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC'];\n throw error;\n }\n\n // set PBE params\n var salt = capture.kdfSalt;\n var count = forge.util.createBuffer(capture.kdfIterationCount);\n count = count.getInt(count.length() << 3);\n var dkLen;\n var cipherFn;\n switch(pki.oids[oid]) {\n case 'aes128-CBC':\n dkLen = 16;\n cipherFn = forge.aes.createDecryptionCipher;\n break;\n case 'aes192-CBC':\n dkLen = 24;\n cipherFn = forge.aes.createDecryptionCipher;\n break;\n case 'aes256-CBC':\n dkLen = 32;\n cipherFn = forge.aes.createDecryptionCipher;\n break;\n case 'des-EDE3-CBC':\n dkLen = 24;\n cipherFn = forge.des.createDecryptionCipher;\n break;\n case 'desCBC':\n dkLen = 8;\n cipherFn = forge.des.createDecryptionCipher;\n break;\n }\n\n // get PRF message digest\n var md = prfOidToMessageDigest(capture.prfOid);\n\n // decrypt private key using pbe with chosen PRF and AES/DES\n var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md);\n var iv = capture.encIv;\n var cipher = cipherFn(dk);\n cipher.start(iv);\n\n return cipher;\n};\n\n/**\n * Get new Forge cipher object instance for PKCS#12 PBE.\n *\n * The returned cipher instance is already started using the key & IV\n * derived from the provided password and PKCS#12 PBE salt.\n *\n * @param oid The PKCS#12 PBE OID (in string notation).\n * @param params The ASN.1 PKCS#12 PBE-params object.\n * @param password The password to decrypt with.\n *\n * @return the new cipher object instance.\n */\npki.pbe.getCipherForPKCS12PBE = function(oid, params, password) {\n // get PBE params\n var capture = {};\n var errors = [];\n if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) {\n var error = new Error('Cannot read password-based-encryption algorithm ' +\n 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.');\n error.errors = errors;\n throw error;\n }\n\n var salt = forge.util.createBuffer(capture.salt);\n var count = forge.util.createBuffer(capture.iterations);\n count = count.getInt(count.length() << 3);\n\n var dkLen, dIvLen, cipherFn;\n switch(oid) {\n case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']:\n dkLen = 24;\n dIvLen = 8;\n cipherFn = forge.des.startDecrypting;\n break;\n\n case pki.oids['pbewithSHAAnd40BitRC2-CBC']:\n dkLen = 5;\n dIvLen = 8;\n cipherFn = function(key, iv) {\n var cipher = forge.rc2.createDecryptionCipher(key, 40);\n cipher.start(iv, null);\n return cipher;\n };\n break;\n\n default:\n var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.');\n error.oid = oid;\n throw error;\n }\n\n // get PRF message digest\n var md = prfOidToMessageDigest(capture.prfOid);\n var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md);\n md.start();\n var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md);\n\n return cipherFn(key, iv);\n};\n\n/**\n * OpenSSL's legacy key derivation function.\n *\n * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html\n *\n * @param password the password to derive the key from.\n * @param salt the salt to use, null for none.\n * @param dkLen the number of bytes needed for the derived key.\n * @param [options] the options to use:\n * [md] an optional message digest object to use.\n */\npki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) {\n if(typeof md === 'undefined' || md === null) {\n if(!('md5' in forge.md)) {\n throw new Error('\"md5\" hash algorithm unavailable.');\n }\n md = forge.md.md5.create();\n }\n if(salt === null) {\n salt = '';\n }\n var digests = [hash(md, password + salt)];\n for(var length = 16, i = 1; length < dkLen; ++i, length += 16) {\n digests.push(hash(md, digests[i - 1] + password + salt));\n }\n return digests.join('').substr(0, dkLen);\n};\n\nfunction hash(md, bytes) {\n return md.start().update(bytes).digest().getBytes();\n}\n\nfunction prfOidToMessageDigest(prfOid) {\n // get PRF algorithm, default to SHA-1\n var prfAlgorithm;\n if(!prfOid) {\n prfAlgorithm = 'hmacWithSHA1';\n } else {\n prfAlgorithm = pki.oids[asn1.derToOid(prfOid)];\n if(!prfAlgorithm) {\n var error = new Error('Unsupported PRF OID.');\n error.oid = prfOid;\n error.supported = [\n 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384',\n 'hmacWithSHA512'];\n throw error;\n }\n }\n return prfAlgorithmToMessageDigest(prfAlgorithm);\n}\n\nfunction prfAlgorithmToMessageDigest(prfAlgorithm) {\n var factory = forge.md;\n switch(prfAlgorithm) {\n case 'hmacWithSHA224':\n factory = forge.md.sha512;\n case 'hmacWithSHA1':\n case 'hmacWithSHA256':\n case 'hmacWithSHA384':\n case 'hmacWithSHA512':\n prfAlgorithm = prfAlgorithm.substr(8).toLowerCase();\n break;\n default:\n var error = new Error('Unsupported PRF algorithm.');\n error.algorithm = prfAlgorithm;\n error.supported = [\n 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384',\n 'hmacWithSHA512'];\n throw error;\n }\n if(!factory || !(prfAlgorithm in factory)) {\n throw new Error('Unknown hash algorithm: ' + prfAlgorithm);\n }\n return factory[prfAlgorithm].create();\n}\n\nfunction createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) {\n var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // salt\n asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt),\n // iteration count\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n countBytes.getBytes())\n ]);\n // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm\n if(prfAlgorithm !== 'hmacWithSHA1') {\n params.value.push(\n // key length\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n forge.util.hexToBytes(dkLen.toString(16))),\n // AlgorithmIdentifier\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]));\n }\n return params;\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/pbe.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/pbkdf2.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/pbkdf2.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Password-Based Key-Derivation Function #2 implementation.\n *\n * See RFC 2898 for details.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./hmac */ \"./node_modules/node-forge/lib/hmac.js\");\n__webpack_require__(/*! ./md */ \"./node_modules/node-forge/lib/md.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nvar pkcs5 = forge.pkcs5 = forge.pkcs5 || {};\n\nvar crypto;\nif(forge.util.isNodejs && !forge.options.usePureJavaScript) {\n crypto = __webpack_require__(/*! crypto */ 3);\n}\n\n/**\n * Derives a key from a password.\n *\n * @param p the password as a binary-encoded string of bytes.\n * @param s the salt as a binary-encoded string of bytes.\n * @param c the iteration count, a positive integer.\n * @param dkLen the intended length, in bytes, of the derived key,\n * (max: 2^32 - 1) * hash length of the PRF.\n * @param [md] the message digest (or algorithm identifier as a string) to use\n * in the PRF, defaults to SHA-1.\n * @param [callback(err, key)] presence triggers asynchronous version, called\n * once the operation completes.\n *\n * @return the derived key, as a binary-encoded string of bytes, for the\n * synchronous version (if no callback is specified).\n */\nmodule.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(\n p, s, c, dkLen, md, callback) {\n if(typeof md === 'function') {\n callback = md;\n md = null;\n }\n\n // use native implementation if possible and not disabled, note that\n // some node versions only support SHA-1, others allow digest to be changed\n if(forge.util.isNodejs && !forge.options.usePureJavaScript &&\n crypto.pbkdf2 && (md === null || typeof md !== 'object') &&\n (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) {\n if(typeof md !== 'string') {\n // default prf to SHA-1\n md = 'sha1';\n }\n p = new Buffer(p, 'binary');\n s = new Buffer(s, 'binary');\n if(!callback) {\n if(crypto.pbkdf2Sync.length === 4) {\n return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary');\n }\n return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary');\n }\n if(crypto.pbkdf2Sync.length === 4) {\n return crypto.pbkdf2(p, s, c, dkLen, function(err, key) {\n if(err) {\n return callback(err);\n }\n callback(null, key.toString('binary'));\n });\n }\n return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) {\n if(err) {\n return callback(err);\n }\n callback(null, key.toString('binary'));\n });\n }\n\n if(typeof md === 'undefined' || md === null) {\n // default prf to SHA-1\n md = 'sha1';\n }\n if(typeof md === 'string') {\n if(!(md in forge.md.algorithms)) {\n throw new Error('Unknown hash algorithm: ' + md);\n }\n md = forge.md[md].create();\n }\n\n var hLen = md.digestLength;\n\n /* 1. If dkLen > (2^32 - 1) * hLen, output \"derived key too long\" and\n stop. */\n if(dkLen > (0xFFFFFFFF * hLen)) {\n var err = new Error('Derived key is too long.');\n if(callback) {\n return callback(err);\n }\n throw err;\n }\n\n /* 2. Let len be the number of hLen-octet blocks in the derived key,\n rounding up, and let r be the number of octets in the last\n block:\n\n len = CEIL(dkLen / hLen),\n r = dkLen - (len - 1) * hLen. */\n var len = Math.ceil(dkLen / hLen);\n var r = dkLen - (len - 1) * hLen;\n\n /* 3. For each block of the derived key apply the function F defined\n below to the password P, the salt S, the iteration count c, and\n the block index to compute the block:\n\n T_1 = F(P, S, c, 1),\n T_2 = F(P, S, c, 2),\n ...\n T_len = F(P, S, c, len),\n\n where the function F is defined as the exclusive-or sum of the\n first c iterates of the underlying pseudorandom function PRF\n applied to the password P and the concatenation of the salt S\n and the block index i:\n\n F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c\n\n where\n\n u_1 = PRF(P, S || INT(i)),\n u_2 = PRF(P, u_1),\n ...\n u_c = PRF(P, u_{c-1}).\n\n Here, INT(i) is a four-octet encoding of the integer i, most\n significant octet first. */\n var prf = forge.hmac.create();\n prf.start(md, p);\n var dk = '';\n var xor, u_c, u_c1;\n\n // sync version\n if(!callback) {\n for(var i = 1; i <= len; ++i) {\n // PRF(P, S || INT(i)) (first iteration)\n prf.start(null, null);\n prf.update(s);\n prf.update(forge.util.int32ToBytes(i));\n xor = u_c1 = prf.digest().getBytes();\n\n // PRF(P, u_{c-1}) (other iterations)\n for(var j = 2; j <= c; ++j) {\n prf.start(null, null);\n prf.update(u_c1);\n u_c = prf.digest().getBytes();\n // F(p, s, c, i)\n xor = forge.util.xorBytes(xor, u_c, hLen);\n u_c1 = u_c;\n }\n\n /* 4. Concatenate the blocks and extract the first dkLen octets to\n produce a derived key DK:\n\n DK = T_1 || T_2 || ... || T_len<0..r-1> */\n dk += (i < len) ? xor : xor.substr(0, r);\n }\n /* 5. Output the derived key DK. */\n return dk;\n }\n\n // async version\n var i = 1, j;\n function outer() {\n if(i > len) {\n // done\n return callback(null, dk);\n }\n\n // PRF(P, S || INT(i)) (first iteration)\n prf.start(null, null);\n prf.update(s);\n prf.update(forge.util.int32ToBytes(i));\n xor = u_c1 = prf.digest().getBytes();\n\n // PRF(P, u_{c-1}) (other iterations)\n j = 2;\n inner();\n }\n\n function inner() {\n if(j <= c) {\n prf.start(null, null);\n prf.update(u_c1);\n u_c = prf.digest().getBytes();\n // F(p, s, c, i)\n xor = forge.util.xorBytes(xor, u_c, hLen);\n u_c1 = u_c;\n ++j;\n return forge.util.setImmediate(inner);\n }\n\n /* 4. Concatenate the blocks and extract the first dkLen octets to\n produce a derived key DK:\n\n DK = T_1 || T_2 || ... || T_len<0..r-1> */\n dk += (i < len) ? xor : xor.substr(0, r);\n\n ++i;\n outer();\n }\n\n outer();\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/pbkdf2.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/pem.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/pem.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms.\n *\n * See: RFC 1421.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2013-2014 Digital Bazaar, Inc.\n *\n * A Forge PEM object has the following fields:\n *\n * type: identifies the type of message (eg: \"RSA PRIVATE KEY\").\n *\n * procType: identifies the type of processing performed on the message,\n * it has two subfields: version and type, eg: 4,ENCRYPTED.\n *\n * contentDomain: identifies the type of content in the message, typically\n * only uses the value: \"RFC822\".\n *\n * dekInfo: identifies the message encryption algorithm and mode and includes\n * any parameters for the algorithm, it has two subfields: algorithm and\n * parameters, eg: DES-CBC,F8143EDE5960C597.\n *\n * headers: contains all other PEM encapsulated headers -- where order is\n * significant (for pairing data like recipient ID + key info).\n *\n * body: the binary-encoded body.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\n// shortcut for pem API\nvar pem = module.exports = forge.pem = forge.pem || {};\n\n/**\n * Encodes (serializes) the given PEM object.\n *\n * @param msg the PEM message object to encode.\n * @param options the options to use:\n * maxline the maximum characters per line for the body, (default: 64).\n *\n * @return the PEM-formatted string.\n */\npem.encode = function(msg, options) {\n options = options || {};\n var rval = '-----BEGIN ' + msg.type + '-----\\r\\n';\n\n // encode special headers\n var header;\n if(msg.procType) {\n header = {\n name: 'Proc-Type',\n values: [String(msg.procType.version), msg.procType.type]\n };\n rval += foldHeader(header);\n }\n if(msg.contentDomain) {\n header = {name: 'Content-Domain', values: [msg.contentDomain]};\n rval += foldHeader(header);\n }\n if(msg.dekInfo) {\n header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]};\n if(msg.dekInfo.parameters) {\n header.values.push(msg.dekInfo.parameters);\n }\n rval += foldHeader(header);\n }\n\n if(msg.headers) {\n // encode all other headers\n for(var i = 0; i < msg.headers.length; ++i) {\n rval += foldHeader(msg.headers[i]);\n }\n }\n\n // terminate header\n if(msg.procType) {\n rval += '\\r\\n';\n }\n\n // add body\n rval += forge.util.encode64(msg.body, options.maxline || 64) + '\\r\\n';\n\n rval += '-----END ' + msg.type + '-----\\r\\n';\n return rval;\n};\n\n/**\n * Decodes (deserializes) all PEM messages found in the given string.\n *\n * @param str the PEM-formatted string to decode.\n *\n * @return the PEM message objects in an array.\n */\npem.decode = function(str) {\n var rval = [];\n\n // split string into PEM messages (be lenient w/EOF on BEGIN line)\n var rMessage = /\\s*-----BEGIN ([A-Z0-9- ]+)-----\\r?\\n?([\\x21-\\x7e\\s]+?(?:\\r?\\n\\r?\\n))?([:A-Za-z0-9+\\/=\\s]+?)-----END \\1-----/g;\n var rHeader = /([\\x21-\\x7e]+):\\s*([\\x21-\\x7e\\s^:]+)/;\n var rCRLF = /\\r?\\n/;\n var match;\n while(true) {\n match = rMessage.exec(str);\n if(!match) {\n break;\n }\n\n var msg = {\n type: match[1],\n procType: null,\n contentDomain: null,\n dekInfo: null,\n headers: [],\n body: forge.util.decode64(match[3])\n };\n rval.push(msg);\n\n // no headers\n if(!match[2]) {\n continue;\n }\n\n // parse headers\n var lines = match[2].split(rCRLF);\n var li = 0;\n while(match && li < lines.length) {\n // get line, trim any rhs whitespace\n var line = lines[li].replace(/\\s+$/, '');\n\n // RFC2822 unfold any following folded lines\n for(var nl = li + 1; nl < lines.length; ++nl) {\n var next = lines[nl];\n if(!/\\s/.test(next[0])) {\n break;\n }\n line += next;\n li = nl;\n }\n\n // parse header\n match = line.match(rHeader);\n if(match) {\n var header = {name: match[1], values: []};\n var values = match[2].split(',');\n for(var vi = 0; vi < values.length; ++vi) {\n header.values.push(ltrim(values[vi]));\n }\n\n // Proc-Type must be the first header\n if(!msg.procType) {\n if(header.name !== 'Proc-Type') {\n throw new Error('Invalid PEM formatted message. The first ' +\n 'encapsulated header must be \"Proc-Type\".');\n } else if(header.values.length !== 2) {\n throw new Error('Invalid PEM formatted message. The \"Proc-Type\" ' +\n 'header must have two subfields.');\n }\n msg.procType = {version: values[0], type: values[1]};\n } else if(!msg.contentDomain && header.name === 'Content-Domain') {\n // special-case Content-Domain\n msg.contentDomain = values[0] || '';\n } else if(!msg.dekInfo && header.name === 'DEK-Info') {\n // special-case DEK-Info\n if(header.values.length === 0) {\n throw new Error('Invalid PEM formatted message. The \"DEK-Info\" ' +\n 'header must have at least one subfield.');\n }\n msg.dekInfo = {algorithm: values[0], parameters: values[1] || null};\n } else {\n msg.headers.push(header);\n }\n }\n\n ++li;\n }\n\n if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) {\n throw new Error('Invalid PEM formatted message. The \"DEK-Info\" ' +\n 'header must be present if \"Proc-Type\" is \"ENCRYPTED\".');\n }\n }\n\n if(rval.length === 0) {\n throw new Error('Invalid PEM formatted message.');\n }\n\n return rval;\n};\n\nfunction foldHeader(header) {\n var rval = header.name + ': ';\n\n // ensure values with CRLF are folded\n var values = [];\n var insertSpace = function(match, $1) {\n return ' ' + $1;\n };\n for(var i = 0; i < header.values.length; ++i) {\n values.push(header.values[i].replace(/^(\\S+\\r\\n)/, insertSpace));\n }\n rval += values.join(',') + '\\r\\n';\n\n // do folding\n var length = 0;\n var candidate = -1;\n for(var i = 0; i < rval.length; ++i, ++length) {\n if(length > 65 && candidate !== -1) {\n var insert = rval[candidate];\n if(insert === ',') {\n ++candidate;\n rval = rval.substr(0, candidate) + '\\r\\n ' + rval.substr(candidate);\n } else {\n rval = rval.substr(0, candidate) +\n '\\r\\n' + insert + rval.substr(candidate + 1);\n }\n length = (i - candidate - 1);\n candidate = -1;\n ++i;\n } else if(rval[i] === ' ' || rval[i] === '\\t' || rval[i] === ',') {\n candidate = i;\n }\n }\n\n return rval;\n}\n\nfunction ltrim(str) {\n return str.replace(/^\\s+/, '');\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/pem.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/pkcs1.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/pkcs1.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Partial implementation of PKCS#1 v2.2: RSA-OEAP\n *\n * Modified but based on the following MIT and BSD licensed code:\n *\n * https://github.com/kjur/jsjws/blob/master/rsa.js:\n *\n * The 'jsjws'(JSON Web Signature JavaScript Library) License\n *\n * Copyright (c) 2012 Kenji Urushima\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain:\n *\n * RSAES-OAEP.js\n * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $\n * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002)\n * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003.\n * Contact: ellis@nukinetics.com\n * Distributed under the BSD License.\n *\n * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125\n *\n * @author Evan Jones (http://evanjones.ca/)\n * @author Dave Longley\n *\n * Copyright (c) 2013-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n__webpack_require__(/*! ./random */ \"./node_modules/node-forge/lib/random.js\");\n__webpack_require__(/*! ./sha1 */ \"./node_modules/node-forge/lib/sha1.js\");\n\n// shortcut for PKCS#1 API\nvar pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {};\n\n/**\n * Encode the given RSAES-OAEP message (M) using key, with optional label (L)\n * and seed.\n *\n * This method does not perform RSA encryption, it only encodes the message\n * using RSAES-OAEP.\n *\n * @param key the RSA key to use.\n * @param message the message to encode.\n * @param options the options to use:\n * label an optional label to use.\n * seed the seed to use.\n * md the message digest object to use, undefined for SHA-1.\n * mgf1 optional mgf1 parameters:\n * md the message digest object to use for MGF1.\n *\n * @return the encoded message bytes.\n */\npkcs1.encode_rsa_oaep = function(key, message, options) {\n // parse arguments\n var label;\n var seed;\n var md;\n var mgf1Md;\n // legacy args (label, seed, md)\n if(typeof options === 'string') {\n label = options;\n seed = arguments[3] || undefined;\n md = arguments[4] || undefined;\n } else if(options) {\n label = options.label || undefined;\n seed = options.seed || undefined;\n md = options.md || undefined;\n if(options.mgf1 && options.mgf1.md) {\n mgf1Md = options.mgf1.md;\n }\n }\n\n // default OAEP to SHA-1 message digest\n if(!md) {\n md = forge.md.sha1.create();\n } else {\n md.start();\n }\n\n // default MGF-1 to same as OAEP\n if(!mgf1Md) {\n mgf1Md = md;\n }\n\n // compute length in bytes and check output\n var keyLength = Math.ceil(key.n.bitLength() / 8);\n var maxLength = keyLength - 2 * md.digestLength - 2;\n if(message.length > maxLength) {\n var error = new Error('RSAES-OAEP input message length is too long.');\n error.length = message.length;\n error.maxLength = maxLength;\n throw error;\n }\n\n if(!label) {\n label = '';\n }\n md.update(label, 'raw');\n var lHash = md.digest();\n\n var PS = '';\n var PS_length = maxLength - message.length;\n for (var i = 0; i < PS_length; i++) {\n PS += '\\x00';\n }\n\n var DB = lHash.getBytes() + PS + '\\x01' + message;\n\n if(!seed) {\n seed = forge.random.getBytes(md.digestLength);\n } else if(seed.length !== md.digestLength) {\n var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' +\n 'match the digest length.');\n error.seedLength = seed.length;\n error.digestLength = md.digestLength;\n throw error;\n }\n\n var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md);\n var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length);\n\n var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md);\n var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length);\n\n // return encoded message\n return '\\x00' + maskedSeed + maskedDB;\n};\n\n/**\n * Decode the given RSAES-OAEP encoded message (EM) using key, with optional\n * label (L).\n *\n * This method does not perform RSA decryption, it only decodes the message\n * using RSAES-OAEP.\n *\n * @param key the RSA key to use.\n * @param em the encoded message to decode.\n * @param options the options to use:\n * label an optional label to use.\n * md the message digest object to use for OAEP, undefined for SHA-1.\n * mgf1 optional mgf1 parameters:\n * md the message digest object to use for MGF1.\n *\n * @return the decoded message bytes.\n */\npkcs1.decode_rsa_oaep = function(key, em, options) {\n // parse args\n var label;\n var md;\n var mgf1Md;\n // legacy args\n if(typeof options === 'string') {\n label = options;\n md = arguments[3] || undefined;\n } else if(options) {\n label = options.label || undefined;\n md = options.md || undefined;\n if(options.mgf1 && options.mgf1.md) {\n mgf1Md = options.mgf1.md;\n }\n }\n\n // compute length in bytes\n var keyLength = Math.ceil(key.n.bitLength() / 8);\n\n if(em.length !== keyLength) {\n var error = new Error('RSAES-OAEP encoded message length is invalid.');\n error.length = em.length;\n error.expectedLength = keyLength;\n throw error;\n }\n\n // default OAEP to SHA-1 message digest\n if(md === undefined) {\n md = forge.md.sha1.create();\n } else {\n md.start();\n }\n\n // default MGF-1 to same as OAEP\n if(!mgf1Md) {\n mgf1Md = md;\n }\n\n if(keyLength < 2 * md.digestLength + 2) {\n throw new Error('RSAES-OAEP key is too short for the hash function.');\n }\n\n if(!label) {\n label = '';\n }\n md.update(label, 'raw');\n var lHash = md.digest().getBytes();\n\n // split the message into its parts\n var y = em.charAt(0);\n var maskedSeed = em.substring(1, md.digestLength + 1);\n var maskedDB = em.substring(1 + md.digestLength);\n\n var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md);\n var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length);\n\n var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md);\n var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length);\n\n var lHashPrime = db.substring(0, md.digestLength);\n\n // constant time check that all values match what is expected\n var error = (y !== '\\x00');\n\n // constant time check lHash vs lHashPrime\n for(var i = 0; i < md.digestLength; ++i) {\n error |= (lHash.charAt(i) !== lHashPrime.charAt(i));\n }\n\n // \"constant time\" find the 0x1 byte separating the padding (zeros) from the\n // message\n // TODO: It must be possible to do this in a better/smarter way?\n var in_ps = 1;\n var index = md.digestLength;\n for(var j = md.digestLength; j < db.length; j++) {\n var code = db.charCodeAt(j);\n\n var is_0 = (code & 0x1) ^ 0x1;\n\n // non-zero if not 0 or 1 in the ps section\n var error_mask = in_ps ? 0xfffe : 0x0000;\n error |= (code & error_mask);\n\n // latch in_ps to zero after we find 0x1\n in_ps = in_ps & is_0;\n index += in_ps;\n }\n\n if(error || db.charCodeAt(index) !== 0x1) {\n throw new Error('Invalid RSAES-OAEP padding.');\n }\n\n return db.substring(index + 1);\n};\n\nfunction rsa_mgf1(seed, maskLength, hash) {\n // default to SHA-1 message digest\n if(!hash) {\n hash = forge.md.sha1.create();\n }\n var t = '';\n var count = Math.ceil(maskLength / hash.digestLength);\n for(var i = 0; i < count; ++i) {\n var c = String.fromCharCode(\n (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF);\n hash.start();\n hash.update(seed + c);\n t += hash.digest().getBytes();\n }\n return t.substring(0, maskLength);\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/pkcs1.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/prime.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/prime.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Prime number generation API.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n__webpack_require__(/*! ./jsbn */ \"./node_modules/node-forge/lib/jsbn.js\");\n__webpack_require__(/*! ./random */ \"./node_modules/node-forge/lib/random.js\");\n\n(function() {\n\n// forge.prime already defined\nif(forge.prime) {\n module.exports = forge.prime;\n return;\n}\n\n/* PRIME API */\nvar prime = module.exports = forge.prime = forge.prime || {};\n\nvar BigInteger = forge.jsbn.BigInteger;\n\n// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29\nvar GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2];\nvar THIRTY = new BigInteger(null);\nTHIRTY.fromInt(30);\nvar op_or = function(x, y) {return x|y;};\n\n/**\n * Generates a random probable prime with the given number of bits.\n *\n * Alternative algorithms can be specified by name as a string or as an\n * object with custom options like so:\n *\n * {\n * name: 'PRIMEINC',\n * options: {\n * maxBlockTime: <the maximum amount of time to block the main\n * thread before allowing I/O other JS to run>,\n * millerRabinTests: <the number of miller-rabin tests to run>,\n * workerScript: <the worker script URL>,\n * workers: <the number of web workers (if supported) to use,\n * -1 to use estimated cores minus one>.\n * workLoad: the size of the work load, ie: number of possible prime\n * numbers for each web worker to check per work assignment,\n * (default: 100).\n * }\n * }\n *\n * @param bits the number of bits for the prime number.\n * @param options the options to use.\n * [algorithm] the algorithm to use (default: 'PRIMEINC').\n * [prng] a custom crypto-secure pseudo-random number generator to use,\n * that must define \"getBytesSync\".\n *\n * @return callback(err, num) called once the operation completes.\n */\nprime.generateProbablePrime = function(bits, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n // default to PRIMEINC algorithm\n var algorithm = options.algorithm || 'PRIMEINC';\n if(typeof algorithm === 'string') {\n algorithm = {name: algorithm};\n }\n algorithm.options = algorithm.options || {};\n\n // create prng with api that matches BigInteger secure random\n var prng = options.prng || forge.random;\n var rng = {\n // x is an array to fill with bytes\n nextBytes: function(x) {\n var b = prng.getBytesSync(x.length);\n for(var i = 0; i < x.length; ++i) {\n x[i] = b.charCodeAt(i);\n }\n }\n };\n\n if(algorithm.name === 'PRIMEINC') {\n return primeincFindPrime(bits, rng, algorithm.options, callback);\n }\n\n throw new Error('Invalid prime generation algorithm: ' + algorithm.name);\n};\n\nfunction primeincFindPrime(bits, rng, options, callback) {\n if('workers' in options) {\n return primeincFindPrimeWithWorkers(bits, rng, options, callback);\n }\n return primeincFindPrimeWithoutWorkers(bits, rng, options, callback);\n}\n\nfunction primeincFindPrimeWithoutWorkers(bits, rng, options, callback) {\n // initialize random number\n var num = generateRandom(bits, rng);\n\n /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The\n number we are given is always aligned at 30k + 1. Each time the number is\n determined not to be prime we add to get to the next 'i', eg: if the number\n was at 30k + 1 we add 6. */\n var deltaIdx = 0;\n\n // get required number of MR tests\n var mrTests = getMillerRabinTests(num.bitLength());\n if('millerRabinTests' in options) {\n mrTests = options.millerRabinTests;\n }\n\n // find prime nearest to 'num' for maxBlockTime ms\n // 10 ms gives 5ms of leeway for other calculations before dropping\n // below 60fps (1000/60 == 16.67), but in reality, the number will\n // likely be higher due to an 'atomic' big int modPow\n var maxBlockTime = 10;\n if('maxBlockTime' in options) {\n maxBlockTime = options.maxBlockTime;\n }\n\n _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);\n}\n\nfunction _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) {\n var start = +new Date();\n do {\n // overflow, regenerate random number\n if(num.bitLength() > bits) {\n num = generateRandom(bits, rng);\n }\n // do primality test\n if(num.isProbablePrime(mrTests)) {\n return callback(null, num);\n }\n // get next potential prime\n num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);\n } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime));\n\n // keep trying later\n forge.util.setImmediate(function() {\n _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);\n });\n}\n\n// NOTE: This algorithm is indeterminate in nature because workers\n// run in parallel looking at different segments of numbers. Even if this\n// algorithm is run twice with the same input from a predictable RNG, it\n// may produce different outputs.\nfunction primeincFindPrimeWithWorkers(bits, rng, options, callback) {\n // web workers unavailable\n if(typeof Worker === 'undefined') {\n return primeincFindPrimeWithoutWorkers(bits, rng, options, callback);\n }\n\n // initialize random number\n var num = generateRandom(bits, rng);\n\n // use web workers to generate keys\n var numWorkers = options.workers;\n var workLoad = options.workLoad || 100;\n var range = workLoad * 30 / 8;\n var workerScript = options.workerScript || 'forge/prime.worker.js';\n if(numWorkers === -1) {\n return forge.util.estimateCores(function(err, cores) {\n if(err) {\n // default to 2\n cores = 2;\n }\n numWorkers = cores - 1;\n generate();\n });\n }\n generate();\n\n function generate() {\n // require at least 1 worker\n numWorkers = Math.max(1, numWorkers);\n\n // TODO: consider optimizing by starting workers outside getPrime() ...\n // note that in order to clean up they will have to be made internally\n // asynchronous which may actually be slower\n\n // start workers immediately\n var workers = [];\n for(var i = 0; i < numWorkers; ++i) {\n // FIXME: fix path or use blob URLs\n workers[i] = new Worker(workerScript);\n }\n var running = numWorkers;\n\n // listen for requests from workers and assign ranges to find prime\n for(var i = 0; i < numWorkers; ++i) {\n workers[i].addEventListener('message', workerMessage);\n }\n\n /* Note: The distribution of random numbers is unknown. Therefore, each\n web worker is continuously allocated a range of numbers to check for a\n random number until one is found.\n\n Every 30 numbers will be checked just 8 times, because prime numbers\n have the form:\n\n 30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this)\n\n Therefore, if we want a web worker to run N checks before asking for\n a new range of numbers, each range must contain N*30/8 numbers.\n\n For 100 checks (workLoad), this is a range of 375. */\n\n var found = false;\n function workerMessage(e) {\n // ignore message, prime already found\n if(found) {\n return;\n }\n\n --running;\n var data = e.data;\n if(data.found) {\n // terminate all workers\n for(var i = 0; i < workers.length; ++i) {\n workers[i].terminate();\n }\n found = true;\n return callback(null, new BigInteger(data.prime, 16));\n }\n\n // overflow, regenerate random number\n if(num.bitLength() > bits) {\n num = generateRandom(bits, rng);\n }\n\n // assign new range to check\n var hex = num.toString(16);\n\n // start prime search\n e.target.postMessage({\n hex: hex,\n workLoad: workLoad\n });\n\n num.dAddOffset(range, 0);\n }\n }\n}\n\n/**\n * Generates a random number using the given number of bits and RNG.\n *\n * @param bits the number of bits for the number.\n * @param rng the random number generator to use.\n *\n * @return the random number.\n */\nfunction generateRandom(bits, rng) {\n var num = new BigInteger(bits, rng);\n // force MSB set\n var bits1 = bits - 1;\n if(!num.testBit(bits1)) {\n num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num);\n }\n // align number on 30k+1 boundary\n num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0);\n return num;\n}\n\n/**\n * Returns the required number of Miller-Rabin tests to generate a\n * prime with an error probability of (1/2)^80.\n *\n * See Handbook of Applied Cryptography Chapter 4, Table 4.4.\n *\n * @param bits the bit size.\n *\n * @return the required number of iterations.\n */\nfunction getMillerRabinTests(bits) {\n if(bits <= 100) return 27;\n if(bits <= 150) return 18;\n if(bits <= 200) return 15;\n if(bits <= 250) return 12;\n if(bits <= 300) return 9;\n if(bits <= 350) return 8;\n if(bits <= 400) return 7;\n if(bits <= 500) return 6;\n if(bits <= 600) return 5;\n if(bits <= 800) return 4;\n if(bits <= 1250) return 3;\n return 2;\n}\n\n})();\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/prime.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/prng.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/prng.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * A javascript implementation of a cryptographically-secure\n * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed\n * here though the use of SHA-256 is not enforced; when generating an\n * a PRNG context, the hashing algorithm and block cipher used for\n * the generator are specified via a plugin.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nvar _crypto = null;\nif(forge.util.isNodejs && !forge.options.usePureJavaScript &&\n !process.versions['node-webkit']) {\n _crypto = __webpack_require__(/*! crypto */ 3);\n}\n\n/* PRNG API */\nvar prng = module.exports = forge.prng = forge.prng || {};\n\n/**\n * Creates a new PRNG context.\n *\n * A PRNG plugin must be passed in that will provide:\n *\n * 1. A function that initializes the key and seed of a PRNG context. It\n * will be given a 16 byte key and a 16 byte seed. Any key expansion\n * or transformation of the seed from a byte string into an array of\n * integers (or similar) should be performed.\n * 2. The cryptographic function used by the generator. It takes a key and\n * a seed.\n * 3. A seed increment function. It takes the seed and returns seed + 1.\n * 4. An api to create a message digest.\n *\n * For an example, see random.js.\n *\n * @param plugin the PRNG plugin to use.\n */\nprng.create = function(plugin) {\n var ctx = {\n plugin: plugin,\n key: null,\n seed: null,\n time: null,\n // number of reseeds so far\n reseeds: 0,\n // amount of data generated so far\n generated: 0,\n // no initial key bytes\n keyBytes: ''\n };\n\n // create 32 entropy pools (each is a message digest)\n var md = plugin.md;\n var pools = new Array(32);\n for(var i = 0; i < 32; ++i) {\n pools[i] = md.create();\n }\n ctx.pools = pools;\n\n // entropy pools are written to cyclically, starting at index 0\n ctx.pool = 0;\n\n /**\n * Generates random bytes. The bytes may be generated synchronously or\n * asynchronously. Web workers must use the asynchronous interface or\n * else the behavior is undefined.\n *\n * @param count the number of random bytes to generate.\n * @param [callback(err, bytes)] called once the operation completes.\n *\n * @return count random bytes as a string.\n */\n ctx.generate = function(count, callback) {\n // do synchronously\n if(!callback) {\n return ctx.generateSync(count);\n }\n\n // simple generator using counter-based CBC\n var cipher = ctx.plugin.cipher;\n var increment = ctx.plugin.increment;\n var formatKey = ctx.plugin.formatKey;\n var formatSeed = ctx.plugin.formatSeed;\n var b = forge.util.createBuffer();\n\n // paranoid deviation from Fortuna:\n // reset key for every request to protect previously\n // generated random bytes should the key be discovered;\n // there is no 100ms based reseeding because of this\n // forced reseed for every `generate` call\n ctx.key = null;\n\n generate();\n\n function generate(err) {\n if(err) {\n return callback(err);\n }\n\n // sufficient bytes generated\n if(b.length() >= count) {\n return callback(null, b.getBytes(count));\n }\n\n // if amount of data generated is greater than 1 MiB, trigger reseed\n if(ctx.generated > 0xfffff) {\n ctx.key = null;\n }\n\n if(ctx.key === null) {\n // prevent stack overflow\n return forge.util.nextTick(function() {\n _reseed(generate);\n });\n }\n\n // generate the random bytes\n var bytes = cipher(ctx.key, ctx.seed);\n ctx.generated += bytes.length;\n b.putBytes(bytes);\n\n // generate bytes for a new key and seed\n ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed)));\n ctx.seed = formatSeed(cipher(ctx.key, ctx.seed));\n\n forge.util.setImmediate(generate);\n }\n };\n\n /**\n * Generates random bytes synchronously.\n *\n * @param count the number of random bytes to generate.\n *\n * @return count random bytes as a string.\n */\n ctx.generateSync = function(count) {\n // simple generator using counter-based CBC\n var cipher = ctx.plugin.cipher;\n var increment = ctx.plugin.increment;\n var formatKey = ctx.plugin.formatKey;\n var formatSeed = ctx.plugin.formatSeed;\n\n // paranoid deviation from Fortuna:\n // reset key for every request to protect previously\n // generated random bytes should the key be discovered;\n // there is no 100ms based reseeding because of this\n // forced reseed for every `generateSync` call\n ctx.key = null;\n\n var b = forge.util.createBuffer();\n while(b.length() < count) {\n // if amount of data generated is greater than 1 MiB, trigger reseed\n if(ctx.generated > 0xfffff) {\n ctx.key = null;\n }\n\n if(ctx.key === null) {\n _reseedSync();\n }\n\n // generate the random bytes\n var bytes = cipher(ctx.key, ctx.seed);\n ctx.generated += bytes.length;\n b.putBytes(bytes);\n\n // generate bytes for a new key and seed\n ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed)));\n ctx.seed = formatSeed(cipher(ctx.key, ctx.seed));\n }\n\n return b.getBytes(count);\n };\n\n /**\n * Private function that asynchronously reseeds a generator.\n *\n * @param callback(err) called once the operation completes.\n */\n function _reseed(callback) {\n if(ctx.pools[0].messageLength >= 32) {\n _seed();\n return callback();\n }\n // not enough seed data...\n var needed = (32 - ctx.pools[0].messageLength) << 5;\n ctx.seedFile(needed, function(err, bytes) {\n if(err) {\n return callback(err);\n }\n ctx.collect(bytes);\n _seed();\n callback();\n });\n }\n\n /**\n * Private function that synchronously reseeds a generator.\n */\n function _reseedSync() {\n if(ctx.pools[0].messageLength >= 32) {\n return _seed();\n }\n // not enough seed data...\n var needed = (32 - ctx.pools[0].messageLength) << 5;\n ctx.collect(ctx.seedFileSync(needed));\n _seed();\n }\n\n /**\n * Private function that seeds a generator once enough bytes are available.\n */\n function _seed() {\n // update reseed count\n ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1;\n\n // goal is to update `key` via:\n // key = hash(key + s)\n // where 's' is all collected entropy from selected pools, then...\n\n // create a plugin-based message digest\n var md = ctx.plugin.md.create();\n\n // consume current key bytes\n md.update(ctx.keyBytes);\n\n // digest the entropy of pools whose index k meet the\n // condition 'n mod 2^k == 0' where n is the number of reseeds\n var _2powK = 1;\n for(var k = 0; k < 32; ++k) {\n if(ctx.reseeds % _2powK === 0) {\n md.update(ctx.pools[k].digest().getBytes());\n ctx.pools[k].start();\n }\n _2powK = _2powK << 1;\n }\n\n // get digest for key bytes\n ctx.keyBytes = md.digest().getBytes();\n\n // paranoid deviation from Fortuna:\n // update `seed` via `seed = hash(key)`\n // instead of initializing to zero once and only\n // ever incrementing it\n md.start();\n md.update(ctx.keyBytes);\n var seedBytes = md.digest().getBytes();\n\n // update state\n ctx.key = ctx.plugin.formatKey(ctx.keyBytes);\n ctx.seed = ctx.plugin.formatSeed(seedBytes);\n ctx.generated = 0;\n }\n\n /**\n * The built-in default seedFile. This seedFile is used when entropy\n * is needed immediately.\n *\n * @param needed the number of bytes that are needed.\n *\n * @return the random bytes.\n */\n function defaultSeedFile(needed) {\n // use window.crypto.getRandomValues strong source of entropy if available\n var getRandomValues = null;\n if(typeof window !== 'undefined') {\n var _crypto = window.crypto || window.msCrypto;\n if(_crypto && _crypto.getRandomValues) {\n getRandomValues = function(arr) {\n return _crypto.getRandomValues(arr);\n };\n }\n }\n\n var b = forge.util.createBuffer();\n if(getRandomValues) {\n while(b.length() < needed) {\n // max byte length is 65536 before QuotaExceededError is thrown\n // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues\n var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4);\n var entropy = new Uint32Array(Math.floor(count));\n try {\n getRandomValues(entropy);\n for(var i = 0; i < entropy.length; ++i) {\n b.putInt32(entropy[i]);\n }\n } catch(e) {\n /* only ignore QuotaExceededError */\n if(!(typeof QuotaExceededError !== 'undefined' &&\n e instanceof QuotaExceededError)) {\n throw e;\n }\n }\n }\n }\n\n // be sad and add some weak random data\n if(b.length() < needed) {\n /* Draws from Park-Miller \"minimal standard\" 31 bit PRNG,\n implemented with David G. Carta's optimization: with 32 bit math\n and without division (Public Domain). */\n var hi, lo, next;\n var seed = Math.floor(Math.random() * 0x010000);\n while(b.length() < needed) {\n lo = 16807 * (seed & 0xFFFF);\n hi = 16807 * (seed >> 16);\n lo += (hi & 0x7FFF) << 16;\n lo += hi >> 15;\n lo = (lo & 0x7FFFFFFF) + (lo >> 31);\n seed = lo & 0xFFFFFFFF;\n\n // consume lower 3 bytes of seed\n for(var i = 0; i < 3; ++i) {\n // throw in more pseudo random\n next = seed >>> (i << 3);\n next ^= Math.floor(Math.random() * 0x0100);\n b.putByte(String.fromCharCode(next & 0xFF));\n }\n }\n }\n\n return b.getBytes(needed);\n }\n // initialize seed file APIs\n if(_crypto) {\n // use nodejs async API\n ctx.seedFile = function(needed, callback) {\n _crypto.randomBytes(needed, function(err, bytes) {\n if(err) {\n return callback(err);\n }\n callback(null, bytes.toString());\n });\n };\n // use nodejs sync API\n ctx.seedFileSync = function(needed) {\n return _crypto.randomBytes(needed).toString();\n };\n } else {\n ctx.seedFile = function(needed, callback) {\n try {\n callback(null, defaultSeedFile(needed));\n } catch(e) {\n callback(e);\n }\n };\n ctx.seedFileSync = defaultSeedFile;\n }\n\n /**\n * Adds entropy to a prng ctx's accumulator.\n *\n * @param bytes the bytes of entropy as a string.\n */\n ctx.collect = function(bytes) {\n // iterate over pools distributing entropy cyclically\n var count = bytes.length;\n for(var i = 0; i < count; ++i) {\n ctx.pools[ctx.pool].update(bytes.substr(i, 1));\n ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1;\n }\n };\n\n /**\n * Collects an integer of n bits.\n *\n * @param i the integer entropy.\n * @param n the number of bits in the integer.\n */\n ctx.collectInt = function(i, n) {\n var bytes = '';\n for(var x = 0; x < n; x += 8) {\n bytes += String.fromCharCode((i >> x) & 0xFF);\n }\n ctx.collect(bytes);\n };\n\n /**\n * Registers a Web Worker to receive immediate entropy from the main thread.\n * This method is required until Web Workers can access the native crypto\n * API. This method should be called twice for each created worker, once in\n * the main thread, and once in the worker itself.\n *\n * @param worker the worker to register.\n */\n ctx.registerWorker = function(worker) {\n // worker receives random bytes\n if(worker === self) {\n ctx.seedFile = function(needed, callback) {\n function listener(e) {\n var data = e.data;\n if(data.forge && data.forge.prng) {\n self.removeEventListener('message', listener);\n callback(data.forge.prng.err, data.forge.prng.bytes);\n }\n }\n self.addEventListener('message', listener);\n self.postMessage({forge: {prng: {needed: needed}}});\n };\n } else {\n // main thread sends random bytes upon request\n var listener = function(e) {\n var data = e.data;\n if(data.forge && data.forge.prng) {\n ctx.seedFile(data.forge.prng.needed, function(err, bytes) {\n worker.postMessage({forge: {prng: {err: err, bytes: bytes}}});\n });\n }\n };\n // TODO: do we need to remove the event listener when the worker dies?\n worker.addEventListener('message', listener);\n }\n };\n\n return ctx;\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/prng.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/random.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/random.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * An API for getting cryptographically-secure random bytes. The bytes are\n * generated using the Fortuna algorithm devised by Bruce Schneier and\n * Niels Ferguson.\n *\n * Getting strong random bytes is not yet easy to do in javascript. The only\n * truish random entropy that can be collected is from the mouse, keyboard, or\n * from timing with respect to page loads, etc. This generator makes a poor\n * attempt at providing random bytes when those sources haven't yet provided\n * enough entropy to initially seed or to reseed the PRNG.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2009-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./aes */ \"./node_modules/node-forge/lib/aes.js\");\n__webpack_require__(/*! ./sha256 */ \"./node_modules/node-forge/lib/sha256.js\");\n__webpack_require__(/*! ./prng */ \"./node_modules/node-forge/lib/prng.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\n(function() {\n\n// forge.random already defined\nif(forge.random && forge.random.getBytes) {\n module.exports = forge.random;\n return;\n}\n\n(function(jQuery) {\n\n// the default prng plugin, uses AES-128\nvar prng_aes = {};\nvar _prng_aes_output = new Array(4);\nvar _prng_aes_buffer = forge.util.createBuffer();\nprng_aes.formatKey = function(key) {\n // convert the key into 32-bit integers\n var tmp = forge.util.createBuffer(key);\n key = new Array(4);\n key[0] = tmp.getInt32();\n key[1] = tmp.getInt32();\n key[2] = tmp.getInt32();\n key[3] = tmp.getInt32();\n\n // return the expanded key\n return forge.aes._expandKey(key, false);\n};\nprng_aes.formatSeed = function(seed) {\n // convert seed into 32-bit integers\n var tmp = forge.util.createBuffer(seed);\n seed = new Array(4);\n seed[0] = tmp.getInt32();\n seed[1] = tmp.getInt32();\n seed[2] = tmp.getInt32();\n seed[3] = tmp.getInt32();\n return seed;\n};\nprng_aes.cipher = function(key, seed) {\n forge.aes._updateBlock(key, seed, _prng_aes_output, false);\n _prng_aes_buffer.putInt32(_prng_aes_output[0]);\n _prng_aes_buffer.putInt32(_prng_aes_output[1]);\n _prng_aes_buffer.putInt32(_prng_aes_output[2]);\n _prng_aes_buffer.putInt32(_prng_aes_output[3]);\n return _prng_aes_buffer.getBytes();\n};\nprng_aes.increment = function(seed) {\n // FIXME: do we care about carry or signed issues?\n ++seed[3];\n return seed;\n};\nprng_aes.md = forge.md.sha256;\n\n/**\n * Creates a new PRNG.\n */\nfunction spawnPrng() {\n var ctx = forge.prng.create(prng_aes);\n\n /**\n * Gets random bytes. If a native secure crypto API is unavailable, this\n * method tries to make the bytes more unpredictable by drawing from data that\n * can be collected from the user of the browser, eg: mouse movement.\n *\n * If a callback is given, this method will be called asynchronously.\n *\n * @param count the number of random bytes to get.\n * @param [callback(err, bytes)] called once the operation completes.\n *\n * @return the random bytes in a string.\n */\n ctx.getBytes = function(count, callback) {\n return ctx.generate(count, callback);\n };\n\n /**\n * Gets random bytes asynchronously. If a native secure crypto API is\n * unavailable, this method tries to make the bytes more unpredictable by\n * drawing from data that can be collected from the user of the browser,\n * eg: mouse movement.\n *\n * @param count the number of random bytes to get.\n *\n * @return the random bytes in a string.\n */\n ctx.getBytesSync = function(count) {\n return ctx.generate(count);\n };\n\n return ctx;\n}\n\n// create default prng context\nvar _ctx = spawnPrng();\n\n// add other sources of entropy only if window.crypto.getRandomValues is not\n// available -- otherwise this source will be automatically used by the prng\nvar getRandomValues = null;\nif(typeof window !== 'undefined') {\n var _crypto = window.crypto || window.msCrypto;\n if(_crypto && _crypto.getRandomValues) {\n getRandomValues = function(arr) {\n return _crypto.getRandomValues(arr);\n };\n }\n}\nif(forge.options.usePureJavaScript ||\n (!forge.util.isNodejs && !getRandomValues)) {\n // if this is a web worker, do not use weak entropy, instead register to\n // receive strong entropy asynchronously from the main thread\n if(typeof window === 'undefined' || window.document === undefined) {\n // FIXME:\n }\n\n // get load time entropy\n _ctx.collectInt(+new Date(), 32);\n\n // add some entropy from navigator object\n if(typeof(navigator) !== 'undefined') {\n var _navBytes = '';\n for(var key in navigator) {\n try {\n if(typeof(navigator[key]) == 'string') {\n _navBytes += navigator[key];\n }\n } catch(e) {\n /* Some navigator keys might not be accessible, e.g. the geolocation\n attribute throws an exception if touched in Mozilla chrome://\n context.\n\n Silently ignore this and just don't use this as a source of\n entropy. */\n }\n }\n _ctx.collect(_navBytes);\n _navBytes = null;\n }\n\n // add mouse and keyboard collectors if jquery is available\n if(jQuery) {\n // set up mouse entropy capture\n jQuery().mousemove(function(e) {\n // add mouse coords\n _ctx.collectInt(e.clientX, 16);\n _ctx.collectInt(e.clientY, 16);\n });\n\n // set up keyboard entropy capture\n jQuery().keypress(function(e) {\n _ctx.collectInt(e.charCode, 8);\n });\n }\n}\n\n/* Random API */\nif(!forge.random) {\n forge.random = _ctx;\n} else {\n // extend forge.random with _ctx\n for(var key in _ctx) {\n forge.random[key] = _ctx[key];\n }\n}\n\n// expose spawn PRNG\nforge.random.createInstance = spawnPrng;\n\nmodule.exports = forge.random;\n\n})(typeof(jQuery) !== 'undefined' ? jQuery : null);\n\n})();\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/random.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/rc2.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/rc2.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * RC2 implementation.\n *\n * @author Stefan Siegl\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n *\n * Information on the RC2 cipher is available from RFC #2268,\n * http://www.ietf.org/rfc/rfc2268.txt\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nvar piTable = [\n 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d,\n 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2,\n 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32,\n 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82,\n 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc,\n 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26,\n 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03,\n 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7,\n 0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a,\n 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec,\n 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39,\n 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31,\n 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9,\n 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9,\n 0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e,\n 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad\n];\n\nvar s = [1, 2, 3, 5];\n\n/**\n * Rotate a word left by given number of bits.\n *\n * Bits that are shifted out on the left are put back in on the right\n * hand side.\n *\n * @param word The word to shift left.\n * @param bits The number of bits to shift by.\n * @return The rotated word.\n */\nvar rol = function(word, bits) {\n return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits));\n};\n\n/**\n * Rotate a word right by given number of bits.\n *\n * Bits that are shifted out on the right are put back in on the left\n * hand side.\n *\n * @param word The word to shift right.\n * @param bits The number of bits to shift by.\n * @return The rotated word.\n */\nvar ror = function(word, bits) {\n return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff);\n};\n\n/* RC2 API */\nmodule.exports = forge.rc2 = forge.rc2 || {};\n\n/**\n * Perform RC2 key expansion as per RFC #2268, section 2.\n *\n * @param key variable-length user key (between 1 and 128 bytes)\n * @param effKeyBits number of effective key bits (default: 128)\n * @return the expanded RC2 key (ByteBuffer of 128 bytes)\n */\nforge.rc2.expandKey = function(key, effKeyBits) {\n if(typeof key === 'string') {\n key = forge.util.createBuffer(key);\n }\n effKeyBits = effKeyBits || 128;\n\n /* introduce variables that match the names used in RFC #2268 */\n var L = key;\n var T = key.length();\n var T1 = effKeyBits;\n var T8 = Math.ceil(T1 / 8);\n var TM = 0xff >> (T1 & 0x07);\n var i;\n\n for(i = T; i < 128; i++) {\n L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]);\n }\n\n L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]);\n\n for(i = 127 - T8; i >= 0; i--) {\n L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]);\n }\n\n return L;\n};\n\n/**\n * Creates a RC2 cipher object.\n *\n * @param key the symmetric key to use (as base for key generation).\n * @param bits the number of effective key bits.\n * @param encrypt false for decryption, true for encryption.\n *\n * @return the cipher.\n */\nvar createCipher = function(key, bits, encrypt) {\n var _finish = false, _input = null, _output = null, _iv = null;\n var mixRound, mashRound;\n var i, j, K = [];\n\n /* Expand key and fill into K[] Array */\n key = forge.rc2.expandKey(key, bits);\n for(i = 0; i < 64; i++) {\n K.push(key.getInt16Le());\n }\n\n if(encrypt) {\n /**\n * Perform one mixing round \"in place\".\n *\n * @param R Array of four words to perform mixing on.\n */\n mixRound = function(R) {\n for(i = 0; i < 4; i++) {\n R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) +\n ((~R[(i + 3) % 4]) & R[(i + 1) % 4]);\n R[i] = rol(R[i], s[i]);\n j++;\n }\n };\n\n /**\n * Perform one mashing round \"in place\".\n *\n * @param R Array of four words to perform mashing on.\n */\n mashRound = function(R) {\n for(i = 0; i < 4; i++) {\n R[i] += K[R[(i + 3) % 4] & 63];\n }\n };\n } else {\n /**\n * Perform one r-mixing round \"in place\".\n *\n * @param R Array of four words to perform mixing on.\n */\n mixRound = function(R) {\n for(i = 3; i >= 0; i--) {\n R[i] = ror(R[i], s[i]);\n R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) +\n ((~R[(i + 3) % 4]) & R[(i + 1) % 4]);\n j--;\n }\n };\n\n /**\n * Perform one r-mashing round \"in place\".\n *\n * @param R Array of four words to perform mashing on.\n */\n mashRound = function(R) {\n for(i = 3; i >= 0; i--) {\n R[i] -= K[R[(i + 3) % 4] & 63];\n }\n };\n }\n\n /**\n * Run the specified cipher execution plan.\n *\n * This function takes four words from the input buffer, applies the IV on\n * it (if requested) and runs the provided execution plan.\n *\n * The plan must be put together in form of a array of arrays. Where the\n * outer one is simply a list of steps to perform and the inner one needs\n * to have two elements: the first one telling how many rounds to perform,\n * the second one telling what to do (i.e. the function to call).\n *\n * @param {Array} plan The plan to execute.\n */\n var runPlan = function(plan) {\n var R = [];\n\n /* Get data from input buffer and fill the four words into R */\n for(i = 0; i < 4; i++) {\n var val = _input.getInt16Le();\n\n if(_iv !== null) {\n if(encrypt) {\n /* We're encrypting, apply the IV first. */\n val ^= _iv.getInt16Le();\n } else {\n /* We're decryption, keep cipher text for next block. */\n _iv.putInt16Le(val);\n }\n }\n\n R.push(val & 0xffff);\n }\n\n /* Reset global \"j\" variable as per spec. */\n j = encrypt ? 0 : 63;\n\n /* Run execution plan. */\n for(var ptr = 0; ptr < plan.length; ptr++) {\n for(var ctr = 0; ctr < plan[ptr][0]; ctr++) {\n plan[ptr][1](R);\n }\n }\n\n /* Write back result to output buffer. */\n for(i = 0; i < 4; i++) {\n if(_iv !== null) {\n if(encrypt) {\n /* We're encrypting in CBC-mode, feed back encrypted bytes into\n IV buffer to carry it forward to next block. */\n _iv.putInt16Le(R[i]);\n } else {\n R[i] ^= _iv.getInt16Le();\n }\n }\n\n _output.putInt16Le(R[i]);\n }\n };\n\n /* Create cipher object */\n var cipher = null;\n cipher = {\n /**\n * Starts or restarts the encryption or decryption process, whichever\n * was previously configured.\n *\n * To use the cipher in CBC mode, iv may be given either as a string\n * of bytes, or as a byte buffer. For ECB mode, give null as iv.\n *\n * @param iv the initialization vector to use, null for ECB mode.\n * @param output the output the buffer to write to, null to create one.\n */\n start: function(iv, output) {\n if(iv) {\n /* CBC mode */\n if(typeof iv === 'string') {\n iv = forge.util.createBuffer(iv);\n }\n }\n\n _finish = false;\n _input = forge.util.createBuffer();\n _output = output || new forge.util.createBuffer();\n _iv = iv;\n\n cipher.output = _output;\n },\n\n /**\n * Updates the next block.\n *\n * @param input the buffer to read from.\n */\n update: function(input) {\n if(!_finish) {\n // not finishing, so fill the input buffer with more input\n _input.putBuffer(input);\n }\n\n while(_input.length() >= 8) {\n runPlan([\n [ 5, mixRound ],\n [ 1, mashRound ],\n [ 6, mixRound ],\n [ 1, mashRound ],\n [ 5, mixRound ]\n ]);\n }\n },\n\n /**\n * Finishes encrypting or decrypting.\n *\n * @param pad a padding function to use, null for PKCS#7 padding,\n * signature(blockSize, buffer, decrypt).\n *\n * @return true if successful, false on error.\n */\n finish: function(pad) {\n var rval = true;\n\n if(encrypt) {\n if(pad) {\n rval = pad(8, _input, !encrypt);\n } else {\n // add PKCS#7 padding to block (each pad byte is the\n // value of the number of pad bytes)\n var padding = (_input.length() === 8) ? 8 : (8 - _input.length());\n _input.fillWithByte(padding, padding);\n }\n }\n\n if(rval) {\n // do final update\n _finish = true;\n cipher.update();\n }\n\n if(!encrypt) {\n // check for error: input data not a multiple of block size\n rval = (_input.length() === 0);\n if(rval) {\n if(pad) {\n rval = pad(8, _output, !encrypt);\n } else {\n // ensure padding byte count is valid\n var len = _output.length();\n var count = _output.at(len - 1);\n\n if(count > len) {\n rval = false;\n } else {\n // trim off padding bytes\n _output.truncate(count);\n }\n }\n }\n }\n\n return rval;\n }\n };\n\n return cipher;\n};\n\n/**\n * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the\n * given symmetric key. The output will be stored in the 'output' member\n * of the returned cipher.\n *\n * The key and iv may be given as a string of bytes or a byte buffer.\n * The cipher is initialized to use 128 effective key bits.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n *\n * @return the cipher.\n */\nforge.rc2.startEncrypting = function(key, iv, output) {\n var cipher = forge.rc2.createEncryptionCipher(key, 128);\n cipher.start(iv, output);\n return cipher;\n};\n\n/**\n * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the\n * given symmetric key.\n *\n * The key may be given as a string of bytes or a byte buffer.\n *\n * To start encrypting call start() on the cipher with an iv and optional\n * output buffer.\n *\n * @param key the symmetric key to use.\n *\n * @return the cipher.\n */\nforge.rc2.createEncryptionCipher = function(key, bits) {\n return createCipher(key, bits, true);\n};\n\n/**\n * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the\n * given symmetric key. The output will be stored in the 'output' member\n * of the returned cipher.\n *\n * The key and iv may be given as a string of bytes or a byte buffer.\n * The cipher is initialized to use 128 effective key bits.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n *\n * @return the cipher.\n */\nforge.rc2.startDecrypting = function(key, iv, output) {\n var cipher = forge.rc2.createDecryptionCipher(key, 128);\n cipher.start(iv, output);\n return cipher;\n};\n\n/**\n * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the\n * given symmetric key.\n *\n * The key may be given as a string of bytes or a byte buffer.\n *\n * To start decrypting call start() on the cipher with an iv and optional\n * output buffer.\n *\n * @param key the symmetric key to use.\n *\n * @return the cipher.\n */\nforge.rc2.createDecryptionCipher = function(key, bits) {\n return createCipher(key, bits, false);\n};\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/rc2.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/rsa.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/rsa.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Javascript implementation of basic RSA algorithms.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n *\n * The only algorithm currently supported for PKI is RSA.\n *\n * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo\n * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier\n * and a subjectPublicKey of type bit string.\n *\n * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters\n * for the algorithm, if any. In the case of RSA, there aren't any.\n *\n * SubjectPublicKeyInfo ::= SEQUENCE {\n * algorithm AlgorithmIdentifier,\n * subjectPublicKey BIT STRING\n * }\n *\n * AlgorithmIdentifer ::= SEQUENCE {\n * algorithm OBJECT IDENTIFIER,\n * parameters ANY DEFINED BY algorithm OPTIONAL\n * }\n *\n * For an RSA public key, the subjectPublicKey is:\n *\n * RSAPublicKey ::= SEQUENCE {\n * modulus INTEGER, -- n\n * publicExponent INTEGER -- e\n * }\n *\n * PrivateKeyInfo ::= SEQUENCE {\n * version Version,\n * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,\n * privateKey PrivateKey,\n * attributes [0] IMPLICIT Attributes OPTIONAL\n * }\n *\n * Version ::= INTEGER\n * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier\n * PrivateKey ::= OCTET STRING\n * Attributes ::= SET OF Attribute\n *\n * An RSA private key as the following structure:\n *\n * RSAPrivateKey ::= SEQUENCE {\n * version Version,\n * modulus INTEGER, -- n\n * publicExponent INTEGER, -- e\n * privateExponent INTEGER, -- d\n * prime1 INTEGER, -- p\n * prime2 INTEGER, -- q\n * exponent1 INTEGER, -- d mod (p-1)\n * exponent2 INTEGER, -- d mod (q-1)\n * coefficient INTEGER -- (inverse of q) mod p\n * }\n *\n * Version ::= INTEGER\n *\n * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./asn1 */ \"./node_modules/node-forge/lib/asn1.js\");\n__webpack_require__(/*! ./jsbn */ \"./node_modules/node-forge/lib/jsbn.js\");\n__webpack_require__(/*! ./oids */ \"./node_modules/node-forge/lib/oids.js\");\n__webpack_require__(/*! ./pkcs1 */ \"./node_modules/node-forge/lib/pkcs1.js\");\n__webpack_require__(/*! ./prime */ \"./node_modules/node-forge/lib/prime.js\");\n__webpack_require__(/*! ./random */ \"./node_modules/node-forge/lib/random.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nif(typeof BigInteger === 'undefined') {\n var BigInteger = forge.jsbn.BigInteger;\n}\n\n// shortcut for asn.1 API\nvar asn1 = forge.asn1;\n\n/*\n * RSA encryption and decryption, see RFC 2313.\n */\nforge.pki = forge.pki || {};\nmodule.exports = forge.pki.rsa = forge.rsa = forge.rsa || {};\nvar pki = forge.pki;\n\n// for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29\nvar GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2];\n\n// validator for a PrivateKeyInfo structure\nvar privateKeyValidator = {\n // PrivateKeyInfo\n name: 'PrivateKeyInfo',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n // Version (INTEGER)\n name: 'PrivateKeyInfo.version',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyVersion'\n }, {\n // privateKeyAlgorithm\n name: 'PrivateKeyInfo.privateKeyAlgorithm',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'AlgorithmIdentifier.algorithm',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OID,\n constructed: false,\n capture: 'privateKeyOid'\n }]\n }, {\n // PrivateKey\n name: 'PrivateKeyInfo',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OCTETSTRING,\n constructed: false,\n capture: 'privateKey'\n }]\n};\n\n// validator for an RSA private key\nvar rsaPrivateKeyValidator = {\n // RSAPrivateKey\n name: 'RSAPrivateKey',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n // Version (INTEGER)\n name: 'RSAPrivateKey.version',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyVersion'\n }, {\n // modulus (n)\n name: 'RSAPrivateKey.modulus',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyModulus'\n }, {\n // publicExponent (e)\n name: 'RSAPrivateKey.publicExponent',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyPublicExponent'\n }, {\n // privateExponent (d)\n name: 'RSAPrivateKey.privateExponent',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyPrivateExponent'\n }, {\n // prime1 (p)\n name: 'RSAPrivateKey.prime1',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyPrime1'\n }, {\n // prime2 (q)\n name: 'RSAPrivateKey.prime2',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyPrime2'\n }, {\n // exponent1 (d mod (p-1))\n name: 'RSAPrivateKey.exponent1',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyExponent1'\n }, {\n // exponent2 (d mod (q-1))\n name: 'RSAPrivateKey.exponent2',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyExponent2'\n }, {\n // coefficient ((inverse of q) mod p)\n name: 'RSAPrivateKey.coefficient',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'privateKeyCoefficient'\n }]\n};\n\n// validator for an RSA public key\nvar rsaPublicKeyValidator = {\n // RSAPublicKey\n name: 'RSAPublicKey',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n // modulus (n)\n name: 'RSAPublicKey.modulus',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'publicKeyModulus'\n }, {\n // publicExponent (e)\n name: 'RSAPublicKey.exponent',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.INTEGER,\n constructed: false,\n capture: 'publicKeyExponent'\n }]\n};\n\n// validator for an SubjectPublicKeyInfo structure\n// Note: Currently only works with an RSA public key\nvar publicKeyValidator = forge.pki.rsa.publicKeyValidator = {\n name: 'SubjectPublicKeyInfo',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n captureAsn1: 'subjectPublicKeyInfo',\n value: [{\n name: 'SubjectPublicKeyInfo.AlgorithmIdentifier',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n value: [{\n name: 'AlgorithmIdentifier.algorithm',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.OID,\n constructed: false,\n capture: 'publicKeyOid'\n }]\n }, {\n // subjectPublicKey\n name: 'SubjectPublicKeyInfo.subjectPublicKey',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.BITSTRING,\n constructed: false,\n value: [{\n // RSAPublicKey\n name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',\n tagClass: asn1.Class.UNIVERSAL,\n type: asn1.Type.SEQUENCE,\n constructed: true,\n optional: true,\n captureAsn1: 'rsaPublicKey'\n }]\n }]\n};\n\n/**\n * Wrap digest in DigestInfo object.\n *\n * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447.\n *\n * DigestInfo ::= SEQUENCE {\n * digestAlgorithm DigestAlgorithmIdentifier,\n * digest Digest\n * }\n *\n * DigestAlgorithmIdentifier ::= AlgorithmIdentifier\n * Digest ::= OCTET STRING\n *\n * @param md the message digest object with the hash to sign.\n *\n * @return the encoded message (ready for RSA encrytion)\n */\nvar emsaPkcs1v15encode = function(md) {\n // get the oid for the algorithm\n var oid;\n if(md.algorithm in pki.oids) {\n oid = pki.oids[md.algorithm];\n } else {\n var error = new Error('Unknown message digest algorithm.');\n error.algorithm = md.algorithm;\n throw error;\n }\n var oidBytes = asn1.oidToDer(oid).getBytes();\n\n // create the digest info\n var digestInfo = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n var digestAlgorithm = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n digestAlgorithm.value.push(asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes));\n digestAlgorithm.value.push(asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ''));\n var digest = asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING,\n false, md.digest().getBytes());\n digestInfo.value.push(digestAlgorithm);\n digestInfo.value.push(digest);\n\n // encode digest info\n return asn1.toDer(digestInfo).getBytes();\n};\n\n/**\n * Performs x^c mod n (RSA encryption or decryption operation).\n *\n * @param x the number to raise and mod.\n * @param key the key to use.\n * @param pub true if the key is public, false if private.\n *\n * @return the result of x^c mod n.\n */\nvar _modPow = function(x, key, pub) {\n if(pub) {\n return x.modPow(key.e, key.n);\n }\n\n if(!key.p || !key.q) {\n // allow calculation without CRT params (slow)\n return x.modPow(key.d, key.n);\n }\n\n // pre-compute dP, dQ, and qInv if necessary\n if(!key.dP) {\n key.dP = key.d.mod(key.p.subtract(BigInteger.ONE));\n }\n if(!key.dQ) {\n key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE));\n }\n if(!key.qInv) {\n key.qInv = key.q.modInverse(key.p);\n }\n\n /* Chinese remainder theorem (CRT) states:\n\n Suppose n1, n2, ..., nk are positive integers which are pairwise\n coprime (n1 and n2 have no common factors other than 1). For any\n integers x1, x2, ..., xk there exists an integer x solving the\n system of simultaneous congruences (where ~= means modularly\n congruent so a ~= b mod n means a mod n = b mod n):\n\n x ~= x1 mod n1\n x ~= x2 mod n2\n ...\n x ~= xk mod nk\n\n This system of congruences has a single simultaneous solution x\n between 0 and n - 1. Furthermore, each xk solution and x itself\n is congruent modulo the product n = n1*n2*...*nk.\n So x1 mod n = x2 mod n = xk mod n = x mod n.\n\n The single simultaneous solution x can be solved with the following\n equation:\n\n x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni.\n\n Where x is less than n, xi = x mod ni.\n\n For RSA we are only concerned with k = 2. The modulus n = pq, where\n p and q are coprime. The RSA decryption algorithm is:\n\n y = x^d mod n\n\n Given the above:\n\n x1 = x^d mod p\n r1 = n/p = q\n s1 = q^-1 mod p\n x2 = x^d mod q\n r2 = n/q = p\n s2 = p^-1 mod q\n\n So y = (x1r1s1 + x2r2s2) mod n\n = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n\n\n According to Fermat's Little Theorem, if the modulus P is prime,\n for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P.\n Since A is not divisible by P it follows that if:\n N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore:\n\n A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort\n to calculate). In order to calculate x^d mod p more quickly the\n exponent d mod (p - 1) is stored in the RSA private key (the same\n is done for x^d mod q). These values are referred to as dP and dQ\n respectively. Therefore we now have:\n\n y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n\n\n Since we'll be reducing x^dP by modulo p (same for q) we can also\n reduce x by p (and q respectively) before hand. Therefore, let\n\n xp = ((x mod p)^dP mod p), and\n xq = ((x mod q)^dQ mod q), yielding:\n\n y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n\n\n This can be further reduced to a simple algorithm that only\n requires 1 inverse (the q inverse is used) to be used and stored.\n The algorithm is called Garner's algorithm. If qInv is the\n inverse of q, we simply calculate:\n\n y = (qInv*(xp - xq) mod p) * q + xq\n\n However, there are two further complications. First, we need to\n ensure that xp > xq to prevent signed BigIntegers from being used\n so we add p until this is true (since we will be mod'ing with\n p anyway). Then, there is a known timing attack on algorithms\n using the CRT. To mitigate this risk, \"cryptographic blinding\"\n should be used. This requires simply generating a random number r\n between 0 and n-1 and its inverse and multiplying x by r^e before\n calculating y and then multiplying y by r^-1 afterwards. Note that\n r must be coprime with n (gcd(r, n) === 1) in order to have an\n inverse.\n */\n\n // cryptographic blinding\n var r;\n do {\n r = new BigInteger(\n forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)),\n 16);\n } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE));\n x = x.multiply(r.modPow(key.e, key.n)).mod(key.n);\n\n // calculate xp and xq\n var xp = x.mod(key.p).modPow(key.dP, key.p);\n var xq = x.mod(key.q).modPow(key.dQ, key.q);\n\n // xp must be larger than xq to avoid signed bit usage\n while(xp.compareTo(xq) < 0) {\n xp = xp.add(key.p);\n }\n\n // do last step\n var y = xp.subtract(xq)\n .multiply(key.qInv).mod(key.p)\n .multiply(key.q).add(xq);\n\n // remove effect of random for cryptographic blinding\n y = y.multiply(r.modInverse(key.n)).mod(key.n);\n\n return y;\n};\n\n/**\n * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or\n * 'encrypt' on a public key object instead.\n *\n * Performs RSA encryption.\n *\n * The parameter bt controls whether to put padding bytes before the\n * message passed in. Set bt to either true or false to disable padding\n * completely (in order to handle e.g. EMSA-PSS encoding seperately before),\n * signaling whether the encryption operation is a public key operation\n * (i.e. encrypting data) or not, i.e. private key operation (data signing).\n *\n * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01\n * (for signing) or 0x02 (for encryption). The key operation mode (private\n * or public) is derived from this flag in that case).\n *\n * @param m the message to encrypt as a byte string.\n * @param key the RSA key to use.\n * @param bt for PKCS#1 v1.5 padding, the block type to use\n * (0x01 for private key, 0x02 for public),\n * to disable padding: true = public key, false = private key.\n *\n * @return the encrypted bytes as a string.\n */\npki.rsa.encrypt = function(m, key, bt) {\n var pub = bt;\n var eb;\n\n // get the length of the modulus in bytes\n var k = Math.ceil(key.n.bitLength() / 8);\n\n if(bt !== false && bt !== true) {\n // legacy, default to PKCS#1 v1.5 padding\n pub = (bt === 0x02);\n eb = _encodePkcs1_v1_5(m, key, bt);\n } else {\n eb = forge.util.createBuffer();\n eb.putBytes(m);\n }\n\n // load encryption block as big integer 'x'\n // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n var x = new BigInteger(eb.toHex(), 16);\n\n // do RSA encryption\n var y = _modPow(x, key, pub);\n\n // convert y into the encrypted data byte string, if y is shorter in\n // bytes than k, then prepend zero bytes to fill up ed\n // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n var yhex = y.toString(16);\n var ed = forge.util.createBuffer();\n var zeros = k - Math.ceil(yhex.length / 2);\n while(zeros > 0) {\n ed.putByte(0x00);\n --zeros;\n }\n ed.putBytes(forge.util.hexToBytes(yhex));\n return ed.getBytes();\n};\n\n/**\n * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or\n * 'verify' on a public key object instead.\n *\n * Performs RSA decryption.\n *\n * The parameter ml controls whether to apply PKCS#1 v1.5 padding\n * or not. Set ml = false to disable padding removal completely\n * (in order to handle e.g. EMSA-PSS later on) and simply pass back\n * the RSA encryption block.\n *\n * @param ed the encrypted data to decrypt in as a byte string.\n * @param key the RSA key to use.\n * @param pub true for a public key operation, false for private.\n * @param ml the message length, if known, false to disable padding.\n *\n * @return the decrypted message as a byte string.\n */\npki.rsa.decrypt = function(ed, key, pub, ml) {\n // get the length of the modulus in bytes\n var k = Math.ceil(key.n.bitLength() / 8);\n\n // error if the length of the encrypted data ED is not k\n if(ed.length !== k) {\n var error = new Error('Encrypted message length is invalid.');\n error.length = ed.length;\n error.expected = k;\n throw error;\n }\n\n // convert encrypted data into a big integer\n // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16);\n\n // y must be less than the modulus or it wasn't the result of\n // a previous mod operation (encryption) using that modulus\n if(y.compareTo(key.n) >= 0) {\n throw new Error('Encrypted message is invalid.');\n }\n\n // do RSA decryption\n var x = _modPow(y, key, pub);\n\n // create the encryption block, if x is shorter in bytes than k, then\n // prepend zero bytes to fill up eb\n // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n var xhex = x.toString(16);\n var eb = forge.util.createBuffer();\n var zeros = k - Math.ceil(xhex.length / 2);\n while(zeros > 0) {\n eb.putByte(0x00);\n --zeros;\n }\n eb.putBytes(forge.util.hexToBytes(xhex));\n\n if(ml !== false) {\n // legacy, default to PKCS#1 v1.5 padding\n return _decodePkcs1_v1_5(eb.getBytes(), key, pub);\n }\n\n // return message\n return eb.getBytes();\n};\n\n/**\n * Creates an RSA key-pair generation state object. It is used to allow\n * key-generation to be performed in steps. It also allows for a UI to\n * display progress updates.\n *\n * @param bits the size for the private key in bits, defaults to 2048.\n * @param e the public exponent to use, defaults to 65537 (0x10001).\n * @param [options] the options to use.\n * prng a custom crypto-secure pseudo-random number generator to use,\n * that must define \"getBytesSync\".\n * algorithm the algorithm to use (default: 'PRIMEINC').\n *\n * @return the state object to use to generate the key-pair.\n */\npki.rsa.createKeyPairGenerationState = function(bits, e, options) {\n // TODO: migrate step-based prime generation code to forge.prime\n\n // set default bits\n if(typeof(bits) === 'string') {\n bits = parseInt(bits, 10);\n }\n bits = bits || 2048;\n\n // create prng with api that matches BigInteger secure random\n options = options || {};\n var prng = options.prng || forge.random;\n var rng = {\n // x is an array to fill with bytes\n nextBytes: function(x) {\n var b = prng.getBytesSync(x.length);\n for(var i = 0; i < x.length; ++i) {\n x[i] = b.charCodeAt(i);\n }\n }\n };\n\n var algorithm = options.algorithm || 'PRIMEINC';\n\n // create PRIMEINC algorithm state\n var rval;\n if(algorithm === 'PRIMEINC') {\n rval = {\n algorithm: algorithm,\n state: 0,\n bits: bits,\n rng: rng,\n eInt: e || 65537,\n e: new BigInteger(null),\n p: null,\n q: null,\n qBits: bits >> 1,\n pBits: bits - (bits >> 1),\n pqState: 0,\n num: null,\n keys: null\n };\n rval.e.fromInt(rval.eInt);\n } else {\n throw new Error('Invalid key generation algorithm: ' + algorithm);\n }\n\n return rval;\n};\n\n/**\n * Attempts to runs the key-generation algorithm for at most n seconds\n * (approximately) using the given state. When key-generation has completed,\n * the keys will be stored in state.keys.\n *\n * To use this function to update a UI while generating a key or to prevent\n * causing browser lockups/warnings, set \"n\" to a value other than 0. A\n * simple pattern for generating a key and showing a progress indicator is:\n *\n * var state = pki.rsa.createKeyPairGenerationState(2048);\n * var step = function() {\n * // step key-generation, run algorithm for 100 ms, repeat\n * if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) {\n * setTimeout(step, 1);\n * } else {\n * // key-generation complete\n * // TODO: turn off progress indicator here\n * // TODO: use the generated key-pair in \"state.keys\"\n * }\n * };\n * // TODO: turn on progress indicator here\n * setTimeout(step, 0);\n *\n * @param state the state to use.\n * @param n the maximum number of milliseconds to run the algorithm for, 0\n * to run the algorithm to completion.\n *\n * @return true if the key-generation completed, false if not.\n */\npki.rsa.stepKeyPairGenerationState = function(state, n) {\n // set default algorithm if not set\n if(!('algorithm' in state)) {\n state.algorithm = 'PRIMEINC';\n }\n\n // TODO: migrate step-based prime generation code to forge.prime\n // TODO: abstract as PRIMEINC algorithm\n\n // do key generation (based on Tom Wu's rsa.js, see jsbn.js license)\n // with some minor optimizations and designed to run in steps\n\n // local state vars\n var THIRTY = new BigInteger(null);\n THIRTY.fromInt(30);\n var deltaIdx = 0;\n var op_or = function(x, y) { return x|y; };\n\n // keep stepping until time limit is reached or done\n var t1 = +new Date();\n var t2;\n var total = 0;\n while(state.keys === null && (n <= 0 || total < n)) {\n // generate p or q\n if(state.state === 0) {\n /* Note: All primes are of the form:\n\n 30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i\n\n When we generate a random number, we always align it at 30k + 1. Each\n time the number is determined not to be prime we add to get to the\n next 'i', eg: if the number was at 30k + 1 we add 6. */\n var bits = (state.p === null) ? state.pBits : state.qBits;\n var bits1 = bits - 1;\n\n // get a random number\n if(state.pqState === 0) {\n state.num = new BigInteger(bits, state.rng);\n // force MSB set\n if(!state.num.testBit(bits1)) {\n state.num.bitwiseTo(\n BigInteger.ONE.shiftLeft(bits1), op_or, state.num);\n }\n // align number on 30k+1 boundary\n state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0);\n deltaIdx = 0;\n\n ++state.pqState;\n } else if(state.pqState === 1) {\n // try to make the number a prime\n if(state.num.bitLength() > bits) {\n // overflow, try again\n state.pqState = 0;\n // do primality test\n } else if(state.num.isProbablePrime(\n _getMillerRabinTests(state.num.bitLength()))) {\n ++state.pqState;\n } else {\n // get next potential prime\n state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);\n }\n } else if(state.pqState === 2) {\n // ensure number is coprime with e\n state.pqState =\n (state.num.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) === 0) ? 3 : 0;\n } else if(state.pqState === 3) {\n // store p or q\n state.pqState = 0;\n if(state.p === null) {\n state.p = state.num;\n } else {\n state.q = state.num;\n }\n\n // advance state if both p and q are ready\n if(state.p !== null && state.q !== null) {\n ++state.state;\n }\n state.num = null;\n }\n } else if(state.state === 1) {\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n state.num = state.p;\n state.p = state.q;\n state.q = state.num;\n }\n ++state.state;\n } else if(state.state === 2) {\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n ++state.state;\n } else if(state.state === 3) {\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) {\n // phi and e are coprime, advance\n ++state.state;\n } else {\n // phi and e aren't coprime, so generate a new p and q\n state.p = null;\n state.q = null;\n state.state = 0;\n }\n } else if(state.state === 4) {\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n\n // ensure n is right number of bits\n if(state.n.bitLength() === state.bits) {\n // success, advance\n ++state.state;\n } else {\n // failed, get new q\n state.q = null;\n state.state = 0;\n }\n } else if(state.state === 5) {\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n }\n\n // update timing\n t2 = +new Date();\n total += t2 - t1;\n t1 = t2;\n }\n\n return state.keys !== null;\n};\n\n/**\n * Generates an RSA public-private key pair in a single call.\n *\n * To generate a key-pair in steps (to allow for progress updates and to\n * prevent blocking or warnings in slow browsers) then use the key-pair\n * generation state functions.\n *\n * To generate a key-pair asynchronously (either through web-workers, if\n * available, or by breaking up the work on the main thread), pass a\n * callback function.\n *\n * @param [bits] the size for the private key in bits, defaults to 2048.\n * @param [e] the public exponent to use, defaults to 65537.\n * @param [options] options for key-pair generation, if given then 'bits'\n * and 'e' must *not* be given:\n * bits the size for the private key in bits, (default: 2048).\n * e the public exponent to use, (default: 65537 (0x10001)).\n * workerScript the worker script URL.\n * workers the number of web workers (if supported) to use,\n * (default: 2).\n * workLoad the size of the work load, ie: number of possible prime\n * numbers for each web worker to check per work assignment,\n * (default: 100).\n * prng a custom crypto-secure pseudo-random number generator to use,\n * that must define \"getBytesSync\".\n * algorithm the algorithm to use (default: 'PRIMEINC').\n * @param [callback(err, keypair)] called once the operation completes.\n *\n * @return an object with privateKey and publicKey properties.\n */\npki.rsa.generateKeyPair = function(bits, e, options, callback) {\n // (bits), (options), (callback)\n if(arguments.length === 1) {\n if(typeof bits === 'object') {\n options = bits;\n bits = undefined;\n } else if(typeof bits === 'function') {\n callback = bits;\n bits = undefined;\n }\n } else if(arguments.length === 2) {\n // (bits, e), (bits, options), (bits, callback), (options, callback)\n if(typeof bits === 'number') {\n if(typeof e === 'function') {\n callback = e;\n e = undefined;\n } else if(typeof e !== 'number') {\n options = e;\n e = undefined;\n }\n } else {\n options = bits;\n callback = e;\n bits = undefined;\n e = undefined;\n }\n } else if(arguments.length === 3) {\n // (bits, e, options), (bits, e, callback), (bits, options, callback)\n if(typeof e === 'number') {\n if(typeof options === 'function') {\n callback = options;\n options = undefined;\n }\n } else {\n callback = options;\n options = e;\n e = undefined;\n }\n }\n options = options || {};\n if(bits === undefined) {\n bits = options.bits || 2048;\n }\n if(e === undefined) {\n e = options.e || 0x10001;\n }\n\n // if native code is permitted and a callback is given, use native\n // key generation code if available and if parameters are acceptable\n if(!forge.options.usePureJavaScript && callback &&\n bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) {\n if(_detectSubtleCrypto('generateKey') && _detectSubtleCrypto('exportKey')) {\n // use standard native generateKey\n return window.crypto.subtle.generateKey({\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: bits,\n publicExponent: _intToUint8Array(e),\n hash: {name: 'SHA-256'}\n }, true /* key can be exported*/, ['sign', 'verify'])\n .then(function(pair) {\n return window.crypto.subtle.exportKey('pkcs8', pair.privateKey);\n // avoiding catch(function(err) {...}) to support IE <= 8\n }).then(undefined, function(err) {\n callback(err);\n }).then(function(pkcs8) {\n if(pkcs8) {\n var privateKey = pki.privateKeyFromAsn1(\n asn1.fromDer(forge.util.createBuffer(pkcs8)));\n callback(null, {\n privateKey: privateKey,\n publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e)\n });\n }\n });\n }\n if(_detectSubtleMsCrypto('generateKey') &&\n _detectSubtleMsCrypto('exportKey')) {\n var genOp = window.msCrypto.subtle.generateKey({\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: bits,\n publicExponent: _intToUint8Array(e),\n hash: {name: 'SHA-256'}\n }, true /* key can be exported*/, ['sign', 'verify']);\n genOp.oncomplete = function(e) {\n var pair = e.target.result;\n var exportOp = window.msCrypto.subtle.exportKey(\n 'pkcs8', pair.privateKey);\n exportOp.oncomplete = function(e) {\n var pkcs8 = e.target.result;\n var privateKey = pki.privateKeyFromAsn1(\n asn1.fromDer(forge.util.createBuffer(pkcs8)));\n callback(null, {\n privateKey: privateKey,\n publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e)\n });\n };\n exportOp.onerror = function(err) {\n callback(err);\n };\n };\n genOp.onerror = function(err) {\n callback(err);\n };\n return;\n }\n }\n\n // use JavaScript implementation\n var state = pki.rsa.createKeyPairGenerationState(bits, e, options);\n if(!callback) {\n pki.rsa.stepKeyPairGenerationState(state, 0);\n return state.keys;\n }\n _generateKeyPair(state, options, callback);\n};\n\n/**\n * Sets an RSA public key from BigIntegers modulus and exponent.\n *\n * @param n the modulus.\n * @param e the exponent.\n *\n * @return the public key.\n */\npki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) {\n var key = {\n n: n,\n e: e\n };\n\n /**\n * Encrypts the given data with this public key. Newer applications\n * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for\n * legacy applications.\n *\n * @param data the byte string to encrypt.\n * @param scheme the encryption scheme to use:\n * 'RSAES-PKCS1-V1_5' (default),\n * 'RSA-OAEP',\n * 'RAW', 'NONE', or null to perform raw RSA encryption,\n * an object with an 'encode' property set to a function\n * with the signature 'function(data, key)' that returns\n * a binary-encoded string representing the encoded data.\n * @param schemeOptions any scheme-specific options.\n *\n * @return the encrypted byte string.\n */\n key.encrypt = function(data, scheme, schemeOptions) {\n if(typeof scheme === 'string') {\n scheme = scheme.toUpperCase();\n } else if(scheme === undefined) {\n scheme = 'RSAES-PKCS1-V1_5';\n }\n\n if(scheme === 'RSAES-PKCS1-V1_5') {\n scheme = {\n encode: function(m, key, pub) {\n return _encodePkcs1_v1_5(m, key, 0x02).getBytes();\n }\n };\n } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') {\n scheme = {\n encode: function(m, key) {\n return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions);\n }\n };\n } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) {\n scheme = { encode: function(e) { return e; } };\n } else if(typeof scheme === 'string') {\n throw new Error('Unsupported encryption scheme: \"' + scheme + '\".');\n }\n\n // do scheme-based encoding then rsa encryption\n var e = scheme.encode(data, key, true);\n return pki.rsa.encrypt(e, key, true);\n };\n\n /**\n * Verifies the given signature against the given digest.\n *\n * PKCS#1 supports multiple (currently two) signature schemes:\n * RSASSA-PKCS1-V1_5 and RSASSA-PSS.\n *\n * By default this implementation uses the \"old scheme\", i.e.\n * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the\n * signature is an OCTET STRING that holds a DigestInfo.\n *\n * DigestInfo ::= SEQUENCE {\n * digestAlgorithm DigestAlgorithmIdentifier,\n * digest Digest\n * }\n * DigestAlgorithmIdentifier ::= AlgorithmIdentifier\n * Digest ::= OCTET STRING\n *\n * To perform PSS signature verification, provide an instance\n * of Forge PSS object as the scheme parameter.\n *\n * @param digest the message digest hash to compare against the signature,\n * as a binary-encoded string.\n * @param signature the signature to verify, as a binary-encoded string.\n * @param scheme signature verification scheme to use:\n * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5,\n * a Forge PSS object for RSASSA-PSS,\n * 'NONE' or null for none, DigestInfo will not be expected, but\n * PKCS#1 v1.5 padding will still be used.\n *\n * @return true if the signature was verified, false if not.\n */\n key.verify = function(digest, signature, scheme) {\n if(typeof scheme === 'string') {\n scheme = scheme.toUpperCase();\n } else if(scheme === undefined) {\n scheme = 'RSASSA-PKCS1-V1_5';\n }\n\n if(scheme === 'RSASSA-PKCS1-V1_5') {\n scheme = {\n verify: function(digest, d) {\n // remove padding\n d = _decodePkcs1_v1_5(d, key, true);\n // d is ASN.1 BER-encoded DigestInfo\n var obj = asn1.fromDer(d);\n // compare the given digest to the decrypted one\n return digest === obj.value[1].value;\n }\n };\n } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) {\n scheme = {\n verify: function(digest, d) {\n // remove padding\n d = _decodePkcs1_v1_5(d, key, true);\n return digest === d;\n }\n };\n }\n\n // do rsa decryption w/o any decoding, then verify -- which does decoding\n var d = pki.rsa.decrypt(signature, key, true, false);\n return scheme.verify(digest, d, key.n.bitLength());\n };\n\n return key;\n};\n\n/**\n * Sets an RSA private key from BigIntegers modulus, exponent, primes,\n * prime exponents, and modular multiplicative inverse.\n *\n * @param n the modulus.\n * @param e the public exponent.\n * @param d the private exponent ((inverse of e) mod n).\n * @param p the first prime.\n * @param q the second prime.\n * @param dP exponent1 (d mod (p-1)).\n * @param dQ exponent2 (d mod (q-1)).\n * @param qInv ((inverse of q) mod p)\n *\n * @return the private key.\n */\npki.setRsaPrivateKey = pki.rsa.setPrivateKey = function(\n n, e, d, p, q, dP, dQ, qInv) {\n var key = {\n n: n,\n e: e,\n d: d,\n p: p,\n q: q,\n dP: dP,\n dQ: dQ,\n qInv: qInv\n };\n\n /**\n * Decrypts the given data with this private key. The decryption scheme\n * must match the one used to encrypt the data.\n *\n * @param data the byte string to decrypt.\n * @param scheme the decryption scheme to use:\n * 'RSAES-PKCS1-V1_5' (default),\n * 'RSA-OAEP',\n * 'RAW', 'NONE', or null to perform raw RSA decryption.\n * @param schemeOptions any scheme-specific options.\n *\n * @return the decrypted byte string.\n */\n key.decrypt = function(data, scheme, schemeOptions) {\n if(typeof scheme === 'string') {\n scheme = scheme.toUpperCase();\n } else if(scheme === undefined) {\n scheme = 'RSAES-PKCS1-V1_5';\n }\n\n // do rsa decryption w/o any decoding\n var d = pki.rsa.decrypt(data, key, false, false);\n\n if(scheme === 'RSAES-PKCS1-V1_5') {\n scheme = { decode: _decodePkcs1_v1_5 };\n } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') {\n scheme = {\n decode: function(d, key) {\n return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions);\n }\n };\n } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) {\n scheme = { decode: function(d) { return d; } };\n } else {\n throw new Error('Unsupported encryption scheme: \"' + scheme + '\".');\n }\n\n // decode according to scheme\n return scheme.decode(d, key, false);\n };\n\n /**\n * Signs the given digest, producing a signature.\n *\n * PKCS#1 supports multiple (currently two) signature schemes:\n * RSASSA-PKCS1-V1_5 and RSASSA-PSS.\n *\n * By default this implementation uses the \"old scheme\", i.e.\n * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide\n * an instance of Forge PSS object as the scheme parameter.\n *\n * @param md the message digest object with the hash to sign.\n * @param scheme the signature scheme to use:\n * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5,\n * a Forge PSS object for RSASSA-PSS,\n * 'NONE' or null for none, DigestInfo will not be used but\n * PKCS#1 v1.5 padding will still be used.\n *\n * @return the signature as a byte string.\n */\n key.sign = function(md, scheme) {\n /* Note: The internal implementation of RSA operations is being\n transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy\n code like the use of an encoding block identifier 'bt' will eventually\n be removed. */\n\n // private key operation\n var bt = false;\n\n if(typeof scheme === 'string') {\n scheme = scheme.toUpperCase();\n }\n\n if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') {\n scheme = { encode: emsaPkcs1v15encode };\n bt = 0x01;\n } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) {\n scheme = { encode: function() { return md; } };\n bt = 0x01;\n }\n\n // encode and then encrypt\n var d = scheme.encode(md, key.n.bitLength());\n return pki.rsa.encrypt(d, key, bt);\n };\n\n return key;\n};\n\n/**\n * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object.\n *\n * @param rsaKey the ASN.1 RSAPrivateKey.\n *\n * @return the ASN.1 PrivateKeyInfo.\n */\npki.wrapRsaPrivateKey = function(rsaKey) {\n // PrivateKeyInfo\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // version (0)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(0).getBytes()),\n // privateKeyAlgorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n asn1.create(\n asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(pki.oids.rsaEncryption).getBytes()),\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]),\n // PrivateKey\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n asn1.toDer(rsaKey).getBytes())\n ]);\n};\n\n/**\n * Converts a private key from an ASN.1 object.\n *\n * @param obj the ASN.1 representation of a PrivateKeyInfo containing an\n * RSAPrivateKey or an RSAPrivateKey.\n *\n * @return the private key.\n */\npki.privateKeyFromAsn1 = function(obj) {\n // get PrivateKeyInfo\n var capture = {};\n var errors = [];\n if(asn1.validate(obj, privateKeyValidator, capture, errors)) {\n obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey));\n }\n\n // get RSAPrivateKey\n capture = {};\n errors = [];\n if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) {\n var error = new Error('Cannot read private key. ' +\n 'ASN.1 object does not contain an RSAPrivateKey.');\n error.errors = errors;\n throw error;\n }\n\n // Note: Version is currently ignored.\n // capture.privateKeyVersion\n // FIXME: inefficient, get a BigInteger that uses byte strings\n var n, e, d, p, q, dP, dQ, qInv;\n n = forge.util.createBuffer(capture.privateKeyModulus).toHex();\n e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex();\n d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex();\n p = forge.util.createBuffer(capture.privateKeyPrime1).toHex();\n q = forge.util.createBuffer(capture.privateKeyPrime2).toHex();\n dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex();\n dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex();\n qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex();\n\n // set private key\n return pki.setRsaPrivateKey(\n new BigInteger(n, 16),\n new BigInteger(e, 16),\n new BigInteger(d, 16),\n new BigInteger(p, 16),\n new BigInteger(q, 16),\n new BigInteger(dP, 16),\n new BigInteger(dQ, 16),\n new BigInteger(qInv, 16));\n};\n\n/**\n * Converts a private key to an ASN.1 RSAPrivateKey.\n *\n * @param key the private key.\n *\n * @return the ASN.1 representation of an RSAPrivateKey.\n */\npki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) {\n // RSAPrivateKey\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // version (0 = only 2 primes, 1 multiple primes)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n asn1.integerToDer(0).getBytes()),\n // modulus (n)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.n)),\n // publicExponent (e)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.e)),\n // privateExponent (d)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.d)),\n // privateKeyPrime1 (p)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.p)),\n // privateKeyPrime2 (q)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.q)),\n // privateKeyExponent1 (dP)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.dP)),\n // privateKeyExponent2 (dQ)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.dQ)),\n // coefficient (qInv)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.qInv))\n ]);\n};\n\n/**\n * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey.\n *\n * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey.\n *\n * @return the public key.\n */\npki.publicKeyFromAsn1 = function(obj) {\n // get SubjectPublicKeyInfo\n var capture = {};\n var errors = [];\n if(asn1.validate(obj, publicKeyValidator, capture, errors)) {\n // get oid\n var oid = asn1.derToOid(capture.publicKeyOid);\n if(oid !== pki.oids.rsaEncryption) {\n var error = new Error('Cannot read public key. Unknown OID.');\n error.oid = oid;\n throw error;\n }\n obj = capture.rsaPublicKey;\n }\n\n // get RSA params\n errors = [];\n if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) {\n var error = new Error('Cannot read public key. ' +\n 'ASN.1 object does not contain an RSAPublicKey.');\n error.errors = errors;\n throw error;\n }\n\n // FIXME: inefficient, get a BigInteger that uses byte strings\n var n = forge.util.createBuffer(capture.publicKeyModulus).toHex();\n var e = forge.util.createBuffer(capture.publicKeyExponent).toHex();\n\n // set public key\n return pki.setRsaPublicKey(\n new BigInteger(n, 16),\n new BigInteger(e, 16));\n};\n\n/**\n * Converts a public key to an ASN.1 SubjectPublicKeyInfo.\n *\n * @param key the public key.\n *\n * @return the asn1 representation of a SubjectPublicKeyInfo.\n */\npki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) {\n // SubjectPublicKeyInfo\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // AlgorithmIdentifier\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // algorithm\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n asn1.oidToDer(pki.oids.rsaEncryption).getBytes()),\n // parameters (null)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n ]),\n // subjectPublicKey\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [\n pki.publicKeyToRSAPublicKey(key)\n ])\n ]);\n};\n\n/**\n * Converts a public key to an ASN.1 RSAPublicKey.\n *\n * @param key the public key.\n *\n * @return the asn1 representation of a RSAPublicKey.\n */\npki.publicKeyToRSAPublicKey = function(key) {\n // RSAPublicKey\n return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n // modulus (n)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.n)),\n // publicExponent (e)\n asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n _bnToBytes(key.e))\n ]);\n};\n\n/**\n * Encodes a message using PKCS#1 v1.5 padding.\n *\n * @param m the message to encode.\n * @param key the RSA key to use.\n * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02\n * (for encryption).\n *\n * @return the padded byte buffer.\n */\nfunction _encodePkcs1_v1_5(m, key, bt) {\n var eb = forge.util.createBuffer();\n\n // get the length of the modulus in bytes\n var k = Math.ceil(key.n.bitLength() / 8);\n\n /* use PKCS#1 v1.5 padding */\n if(m.length > (k - 11)) {\n var error = new Error('Message is too long for PKCS#1 v1.5 padding.');\n error.length = m.length;\n error.max = k - 11;\n throw error;\n }\n\n /* A block type BT, a padding string PS, and the data D shall be\n formatted into an octet string EB, the encryption block:\n\n EB = 00 || BT || PS || 00 || D\n\n The block type BT shall be a single octet indicating the structure of\n the encryption block. For this version of the document it shall have\n value 00, 01, or 02. For a private-key operation, the block type\n shall be 00 or 01. For a public-key operation, it shall be 02.\n\n The padding string PS shall consist of k-3-||D|| octets. For block\n type 00, the octets shall have value 00; for block type 01, they\n shall have value FF; and for block type 02, they shall be\n pseudorandomly generated and nonzero. This makes the length of the\n encryption block EB equal to k. */\n\n // build the encryption block\n eb.putByte(0x00);\n eb.putByte(bt);\n\n // create the padding\n var padNum = k - 3 - m.length;\n var padByte;\n // private key op\n if(bt === 0x00 || bt === 0x01) {\n padByte = (bt === 0x00) ? 0x00 : 0xFF;\n for(var i = 0; i < padNum; ++i) {\n eb.putByte(padByte);\n }\n } else {\n // public key op\n // pad with random non-zero values\n while(padNum > 0) {\n var numZeros = 0;\n var padBytes = forge.random.getBytes(padNum);\n for(var i = 0; i < padNum; ++i) {\n padByte = padBytes.charCodeAt(i);\n if(padByte === 0) {\n ++numZeros;\n } else {\n eb.putByte(padByte);\n }\n }\n padNum = numZeros;\n }\n }\n\n // zero followed by message\n eb.putByte(0x00);\n eb.putBytes(m);\n\n return eb;\n}\n\n/**\n * Decodes a message using PKCS#1 v1.5 padding.\n *\n * @param em the message to decode.\n * @param key the RSA key to use.\n * @param pub true if the key is a public key, false if it is private.\n * @param ml the message length, if specified.\n *\n * @return the decoded bytes.\n */\nfunction _decodePkcs1_v1_5(em, key, pub, ml) {\n // get the length of the modulus in bytes\n var k = Math.ceil(key.n.bitLength() / 8);\n\n /* It is an error if any of the following conditions occurs:\n\n 1. The encryption block EB cannot be parsed unambiguously.\n 2. The padding string PS consists of fewer than eight octets\n or is inconsisent with the block type BT.\n 3. The decryption process is a public-key operation and the block\n type BT is not 00 or 01, or the decryption process is a\n private-key operation and the block type is not 02.\n */\n\n // parse the encryption block\n var eb = forge.util.createBuffer(em);\n var first = eb.getByte();\n var bt = eb.getByte();\n if(first !== 0x00 ||\n (pub && bt !== 0x00 && bt !== 0x01) ||\n (!pub && bt != 0x02) ||\n (pub && bt === 0x00 && typeof(ml) === 'undefined')) {\n throw new Error('Encryption block is invalid.');\n }\n\n var padNum = 0;\n if(bt === 0x00) {\n // check all padding bytes for 0x00\n padNum = k - 3 - ml;\n for(var i = 0; i < padNum; ++i) {\n if(eb.getByte() !== 0x00) {\n throw new Error('Encryption block is invalid.');\n }\n }\n } else if(bt === 0x01) {\n // find the first byte that isn't 0xFF, should be after all padding\n padNum = 0;\n while(eb.length() > 1) {\n if(eb.getByte() !== 0xFF) {\n --eb.read;\n break;\n }\n ++padNum;\n }\n } else if(bt === 0x02) {\n // look for 0x00 byte\n padNum = 0;\n while(eb.length() > 1) {\n if(eb.getByte() === 0x00) {\n --eb.read;\n break;\n }\n ++padNum;\n }\n }\n\n // zero must be 0x00 and padNum must be (k - 3 - message length)\n var zero = eb.getByte();\n if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) {\n throw new Error('Encryption block is invalid.');\n }\n\n return eb.getBytes();\n}\n\n/**\n * Runs the key-generation algorithm asynchronously, either in the background\n * via Web Workers, or using the main thread and setImmediate.\n *\n * @param state the key-pair generation state.\n * @param [options] options for key-pair generation:\n * workerScript the worker script URL.\n * workers the number of web workers (if supported) to use,\n * (default: 2, -1 to use estimated cores minus one).\n * workLoad the size of the work load, ie: number of possible prime\n * numbers for each web worker to check per work assignment,\n * (default: 100).\n * @param callback(err, keypair) called once the operation completes.\n */\nfunction _generateKeyPair(state, options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n var opts = {\n algorithm: {\n name: options.algorithm || 'PRIMEINC',\n options: {\n workers: options.workers || 2,\n workLoad: options.workLoad || 100,\n workerScript: options.workerScript\n }\n }\n };\n if('prng' in options) {\n opts.prng = options.prng;\n }\n\n generate();\n\n function generate() {\n // find p and then q (done in series to simplify)\n getPrime(state.pBits, function(err, num) {\n if(err) {\n return callback(err);\n }\n state.p = num;\n if(state.q !== null) {\n return finish(err, state.q);\n }\n getPrime(state.qBits, finish);\n });\n }\n\n function getPrime(bits, callback) {\n forge.prime.generateProbablePrime(bits, opts, callback);\n }\n\n function finish(err, num) {\n if(err) {\n return callback(err);\n }\n\n // set q\n state.q = num;\n\n // ensure p is larger than q (swap them if not)\n if(state.p.compareTo(state.q) < 0) {\n var tmp = state.p;\n state.p = state.q;\n state.q = tmp;\n }\n\n // ensure p is coprime with e\n if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.p = null;\n generate();\n return;\n }\n\n // ensure q is coprime with e\n if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n .compareTo(BigInteger.ONE) !== 0) {\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // compute phi: (p - 1)(q - 1) (Euler's totient function)\n state.p1 = state.p.subtract(BigInteger.ONE);\n state.q1 = state.q.subtract(BigInteger.ONE);\n state.phi = state.p1.multiply(state.q1);\n\n // ensure e and phi are coprime\n if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n // phi and e aren't coprime, so generate a new p and q\n state.p = state.q = null;\n generate();\n return;\n }\n\n // create n, ensure n is has the right number of bits\n state.n = state.p.multiply(state.q);\n if(state.n.bitLength() !== state.bits) {\n // failed, get new q\n state.q = null;\n getPrime(state.qBits, finish);\n return;\n }\n\n // set keys\n var d = state.e.modInverse(state.phi);\n state.keys = {\n privateKey: pki.rsa.setPrivateKey(\n state.n, state.e, d, state.p, state.q,\n d.mod(state.p1), d.mod(state.q1),\n state.q.modInverse(state.p)),\n publicKey: pki.rsa.setPublicKey(state.n, state.e)\n };\n\n callback(null, state.keys);\n }\n}\n\n/**\n * Converts a positive BigInteger into 2's-complement big-endian bytes.\n *\n * @param b the big integer to convert.\n *\n * @return the bytes.\n */\nfunction _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}\n\n/**\n * Returns the required number of Miller-Rabin tests to generate a\n * prime with an error probability of (1/2)^80.\n *\n * See Handbook of Applied Cryptography Chapter 4, Table 4.4.\n *\n * @param bits the bit size.\n *\n * @return the required number of iterations.\n */\nfunction _getMillerRabinTests(bits) {\n if(bits <= 100) return 27;\n if(bits <= 150) return 18;\n if(bits <= 200) return 15;\n if(bits <= 250) return 12;\n if(bits <= 300) return 9;\n if(bits <= 350) return 8;\n if(bits <= 400) return 7;\n if(bits <= 500) return 6;\n if(bits <= 600) return 5;\n if(bits <= 800) return 4;\n if(bits <= 1250) return 3;\n return 2;\n}\n\n/**\n * Performs feature detection on the SubtleCrypto interface.\n *\n * @param fn the feature (function) to detect.\n *\n * @return true if detected, false if not.\n */\nfunction _detectSubtleCrypto(fn) {\n return (typeof window !== 'undefined' &&\n typeof window.crypto === 'object' &&\n typeof window.crypto.subtle === 'object' &&\n typeof window.crypto.subtle[fn] === 'function');\n}\n\n/**\n * Performs feature detection on the deprecated Microsoft Internet Explorer\n * outdated SubtleCrypto interface. This function should only be used after\n * checking for the modern, standard SubtleCrypto interface.\n *\n * @param fn the feature (function) to detect.\n *\n * @return true if detected, false if not.\n */\nfunction _detectSubtleMsCrypto(fn) {\n return (typeof window !== 'undefined' &&\n typeof window.msCrypto === 'object' &&\n typeof window.msCrypto.subtle === 'object' &&\n typeof window.msCrypto.subtle[fn] === 'function');\n}\n\nfunction _intToUint8Array(x) {\n var bytes = forge.util.hexToBytes(x.toString(16));\n var buffer = new Uint8Array(bytes.length);\n for(var i = 0; i < bytes.length; ++i) {\n buffer[i] = bytes.charCodeAt(i);\n }\n return buffer;\n}\n\nfunction _privateKeyFromJwk(jwk) {\n if(jwk.kty !== 'RSA') {\n throw new Error(\n 'Unsupported key algorithm \"' + jwk.kty + '\"; algorithm must be \"RSA\".');\n }\n return pki.setRsaPrivateKey(\n _base64ToBigInt(jwk.n),\n _base64ToBigInt(jwk.e),\n _base64ToBigInt(jwk.d),\n _base64ToBigInt(jwk.p),\n _base64ToBigInt(jwk.q),\n _base64ToBigInt(jwk.dp),\n _base64ToBigInt(jwk.dq),\n _base64ToBigInt(jwk.qi));\n}\n\nfunction _publicKeyFromJwk(jwk) {\n if(jwk.kty !== 'RSA') {\n throw new Error('Key algorithm must be \"RSA\".');\n }\n return pki.setRsaPublicKey(\n _base64ToBigInt(jwk.n),\n _base64ToBigInt(jwk.e));\n}\n\nfunction _base64ToBigInt(b64) {\n return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16);\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/rsa.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/sha1.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/sha1.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2015 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./md */ \"./node_modules/node-forge/lib/md.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nvar sha1 = module.exports = forge.sha1 = forge.sha1 || {};\nforge.md.sha1 = forge.md.algorithms.sha1 = sha1;\n\n/**\n * Creates a SHA-1 message digest object.\n *\n * @return a message digest object.\n */\nsha1.create = function() {\n // do initialization as necessary\n if(!_initialized) {\n _init();\n }\n\n // SHA-1 state contains five 32-bit integers\n var _state = null;\n\n // input buffer\n var _input = forge.util.createBuffer();\n\n // used for word storage\n var _w = new Array(80);\n\n // message digest object\n var md = {\n algorithm: 'sha1',\n blockLength: 64,\n digestLength: 20,\n // 56-bit length of message so far (does not including padding)\n messageLength: 0,\n // true message length\n fullMessageLength: null,\n // size of message length in bytes\n messageLengthSize: 8\n };\n\n /**\n * Starts the digest.\n *\n * @return this digest object.\n */\n md.start = function() {\n // up to 56-bit message length for convenience\n md.messageLength = 0;\n\n // full message length (set md.messageLength64 for backwards-compatibility)\n md.fullMessageLength = md.messageLength64 = [];\n var int32s = md.messageLengthSize / 4;\n for(var i = 0; i < int32s; ++i) {\n md.fullMessageLength.push(0);\n }\n _input = forge.util.createBuffer();\n _state = {\n h0: 0x67452301,\n h1: 0xEFCDAB89,\n h2: 0x98BADCFE,\n h3: 0x10325476,\n h4: 0xC3D2E1F0\n };\n return md;\n };\n // start digest automatically for first time\n md.start();\n\n /**\n * Updates the digest with the given message input. The given input can\n * treated as raw input (no encoding will be applied) or an encoding of\n * 'utf8' maybe given to encode the input using UTF-8.\n *\n * @param msg the message input to update with.\n * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n *\n * @return this digest object.\n */\n md.update = function(msg, encoding) {\n if(encoding === 'utf8') {\n msg = forge.util.encodeUtf8(msg);\n }\n\n // update message length\n var len = msg.length;\n md.messageLength += len;\n len = [(len / 0x100000000) >>> 0, len >>> 0];\n for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n md.fullMessageLength[i] += len[1];\n len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n len[0] = ((len[1] / 0x100000000) >>> 0);\n }\n\n // add bytes to input buffer\n _input.putBytes(msg);\n\n // process bytes\n _update(_state, _w, _input);\n\n // compact input buffer every 2K or if empty\n if(_input.read > 2048 || _input.length() === 0) {\n _input.compact();\n }\n\n return md;\n };\n\n /**\n * Produces the digest.\n *\n * @return a byte buffer containing the digest value.\n */\n md.digest = function() {\n /* Note: Here we copy the remaining bytes in the input buffer and\n add the appropriate SHA-1 padding. Then we do the final update\n on a copy of the state so that if the user wants to get\n intermediate digests they can do so. */\n\n /* Determine the number of bytes that must be added to the message\n to ensure its length is congruent to 448 mod 512. In other words,\n the data to be digested must be a multiple of 512 bits (or 128 bytes).\n This data includes the message, some padding, and the length of the\n message. Since the length of the message will be encoded as 8 bytes (64\n bits), that means that the last segment of the data must have 56 bytes\n (448 bits) of message and padding. Therefore, the length of the message\n plus the padding must be congruent to 448 mod 512 because\n 512 - 128 = 448.\n\n In order to fill up the message length it must be filled with\n padding that begins with 1 bit followed by all 0 bits. Padding\n must *always* be present, so if the message length is already\n congruent to 448 mod 512, then 512 padding bits must be added. */\n\n var finalBlock = forge.util.createBuffer();\n finalBlock.putBytes(_input.bytes());\n\n // compute remaining size to be digested (include message length size)\n var remaining = (\n md.fullMessageLength[md.fullMessageLength.length - 1] +\n md.messageLengthSize);\n\n // add padding for overflow blockSize - overflow\n // _padding starts with 1 byte with first bit is set (byte value 128), then\n // there may be up to (blockSize - 1) other pad bytes\n var overflow = remaining & (md.blockLength - 1);\n finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n // serialize message length in bits in big-endian order; since length\n // is stored in bytes we multiply by 8 and add carry from next int\n var next, carry;\n var bits = md.fullMessageLength[0] * 8;\n for(var i = 0; i < md.fullMessageLength.length - 1; ++i) {\n next = md.fullMessageLength[i + 1] * 8;\n carry = (next / 0x100000000) >>> 0;\n bits += carry;\n finalBlock.putInt32(bits >>> 0);\n bits = next >>> 0;\n }\n finalBlock.putInt32(bits);\n\n var s2 = {\n h0: _state.h0,\n h1: _state.h1,\n h2: _state.h2,\n h3: _state.h3,\n h4: _state.h4\n };\n _update(s2, _w, finalBlock);\n var rval = forge.util.createBuffer();\n rval.putInt32(s2.h0);\n rval.putInt32(s2.h1);\n rval.putInt32(s2.h2);\n rval.putInt32(s2.h3);\n rval.putInt32(s2.h4);\n return rval;\n };\n\n return md;\n};\n\n// sha-1 padding bytes not initialized yet\nvar _padding = null;\nvar _initialized = false;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n // create padding\n _padding = String.fromCharCode(128);\n _padding += forge.util.fillString(String.fromCharCode(0x00), 64);\n\n // now initialized\n _initialized = true;\n}\n\n/**\n * Updates a SHA-1 state with the given byte buffer.\n *\n * @param s the SHA-1 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n // consume 512 bit (64 byte) chunks\n var t, a, b, c, d, e, f, i;\n var len = bytes.length();\n while(len >= 64) {\n // the w array will be populated with sixteen 32-bit big-endian words\n // and then extended into 80 32-bit words according to SHA-1 algorithm\n // and for 32-79 using Max Locktyukhin's optimization\n\n // initialize hash value for this chunk\n a = s.h0;\n b = s.h1;\n c = s.h2;\n d = s.h3;\n e = s.h4;\n\n // round 1\n for(i = 0; i < 16; ++i) {\n t = bytes.getInt32();\n w[i] = t;\n f = d ^ (b & (c ^ d));\n t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t;\n e = d;\n d = c;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n c = ((b << 30) | (b >>> 2)) >>> 0;\n b = a;\n a = t;\n }\n for(; i < 20; ++i) {\n t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);\n t = (t << 1) | (t >>> 31);\n w[i] = t;\n f = d ^ (b & (c ^ d));\n t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t;\n e = d;\n d = c;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n c = ((b << 30) | (b >>> 2)) >>> 0;\n b = a;\n a = t;\n }\n // round 2\n for(; i < 32; ++i) {\n t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);\n t = (t << 1) | (t >>> 31);\n w[i] = t;\n f = b ^ c ^ d;\n t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t;\n e = d;\n d = c;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n c = ((b << 30) | (b >>> 2)) >>> 0;\n b = a;\n a = t;\n }\n for(; i < 40; ++i) {\n t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]);\n t = (t << 2) | (t >>> 30);\n w[i] = t;\n f = b ^ c ^ d;\n t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t;\n e = d;\n d = c;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n c = ((b << 30) | (b >>> 2)) >>> 0;\n b = a;\n a = t;\n }\n // round 3\n for(; i < 60; ++i) {\n t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]);\n t = (t << 2) | (t >>> 30);\n w[i] = t;\n f = (b & c) | (d & (b ^ c));\n t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t;\n e = d;\n d = c;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n c = ((b << 30) | (b >>> 2)) >>> 0;\n b = a;\n a = t;\n }\n // round 4\n for(; i < 80; ++i) {\n t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]);\n t = (t << 2) | (t >>> 30);\n w[i] = t;\n f = b ^ c ^ d;\n t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t;\n e = d;\n d = c;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n c = ((b << 30) | (b >>> 2)) >>> 0;\n b = a;\n a = t;\n }\n\n // update hash state\n s.h0 = (s.h0 + a) | 0;\n s.h1 = (s.h1 + b) | 0;\n s.h2 = (s.h2 + c) | 0;\n s.h3 = (s.h3 + d) | 0;\n s.h4 = (s.h4 + e) | 0;\n\n len -= 64;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/sha1.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/sha256.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/sha256.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation.\n *\n * See FIPS 180-2 for details.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2015 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./md */ \"./node_modules/node-forge/lib/md.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nvar sha256 = module.exports = forge.sha256 = forge.sha256 || {};\nforge.md.sha256 = forge.md.algorithms.sha256 = sha256;\n\n/**\n * Creates a SHA-256 message digest object.\n *\n * @return a message digest object.\n */\nsha256.create = function() {\n // do initialization as necessary\n if(!_initialized) {\n _init();\n }\n\n // SHA-256 state contains eight 32-bit integers\n var _state = null;\n\n // input buffer\n var _input = forge.util.createBuffer();\n\n // used for word storage\n var _w = new Array(64);\n\n // message digest object\n var md = {\n algorithm: 'sha256',\n blockLength: 64,\n digestLength: 32,\n // 56-bit length of message so far (does not including padding)\n messageLength: 0,\n // true message length\n fullMessageLength: null,\n // size of message length in bytes\n messageLengthSize: 8\n };\n\n /**\n * Starts the digest.\n *\n * @return this digest object.\n */\n md.start = function() {\n // up to 56-bit message length for convenience\n md.messageLength = 0;\n\n // full message length (set md.messageLength64 for backwards-compatibility)\n md.fullMessageLength = md.messageLength64 = [];\n var int32s = md.messageLengthSize / 4;\n for(var i = 0; i < int32s; ++i) {\n md.fullMessageLength.push(0);\n }\n _input = forge.util.createBuffer();\n _state = {\n h0: 0x6A09E667,\n h1: 0xBB67AE85,\n h2: 0x3C6EF372,\n h3: 0xA54FF53A,\n h4: 0x510E527F,\n h5: 0x9B05688C,\n h6: 0x1F83D9AB,\n h7: 0x5BE0CD19\n };\n return md;\n };\n // start digest automatically for first time\n md.start();\n\n /**\n * Updates the digest with the given message input. The given input can\n * treated as raw input (no encoding will be applied) or an encoding of\n * 'utf8' maybe given to encode the input using UTF-8.\n *\n * @param msg the message input to update with.\n * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n *\n * @return this digest object.\n */\n md.update = function(msg, encoding) {\n if(encoding === 'utf8') {\n msg = forge.util.encodeUtf8(msg);\n }\n\n // update message length\n var len = msg.length;\n md.messageLength += len;\n len = [(len / 0x100000000) >>> 0, len >>> 0];\n for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n md.fullMessageLength[i] += len[1];\n len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n len[0] = ((len[1] / 0x100000000) >>> 0);\n }\n\n // add bytes to input buffer\n _input.putBytes(msg);\n\n // process bytes\n _update(_state, _w, _input);\n\n // compact input buffer every 2K or if empty\n if(_input.read > 2048 || _input.length() === 0) {\n _input.compact();\n }\n\n return md;\n };\n\n /**\n * Produces the digest.\n *\n * @return a byte buffer containing the digest value.\n */\n md.digest = function() {\n /* Note: Here we copy the remaining bytes in the input buffer and\n add the appropriate SHA-256 padding. Then we do the final update\n on a copy of the state so that if the user wants to get\n intermediate digests they can do so. */\n\n /* Determine the number of bytes that must be added to the message\n to ensure its length is congruent to 448 mod 512. In other words,\n the data to be digested must be a multiple of 512 bits (or 128 bytes).\n This data includes the message, some padding, and the length of the\n message. Since the length of the message will be encoded as 8 bytes (64\n bits), that means that the last segment of the data must have 56 bytes\n (448 bits) of message and padding. Therefore, the length of the message\n plus the padding must be congruent to 448 mod 512 because\n 512 - 128 = 448.\n\n In order to fill up the message length it must be filled with\n padding that begins with 1 bit followed by all 0 bits. Padding\n must *always* be present, so if the message length is already\n congruent to 448 mod 512, then 512 padding bits must be added. */\n\n var finalBlock = forge.util.createBuffer();\n finalBlock.putBytes(_input.bytes());\n\n // compute remaining size to be digested (include message length size)\n var remaining = (\n md.fullMessageLength[md.fullMessageLength.length - 1] +\n md.messageLengthSize);\n\n // add padding for overflow blockSize - overflow\n // _padding starts with 1 byte with first bit is set (byte value 128), then\n // there may be up to (blockSize - 1) other pad bytes\n var overflow = remaining & (md.blockLength - 1);\n finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n // serialize message length in bits in big-endian order; since length\n // is stored in bytes we multiply by 8 and add carry from next int\n var next, carry;\n var bits = md.fullMessageLength[0] * 8;\n for(var i = 0; i < md.fullMessageLength.length - 1; ++i) {\n next = md.fullMessageLength[i + 1] * 8;\n carry = (next / 0x100000000) >>> 0;\n bits += carry;\n finalBlock.putInt32(bits >>> 0);\n bits = next >>> 0;\n }\n finalBlock.putInt32(bits);\n\n var s2 = {\n h0: _state.h0,\n h1: _state.h1,\n h2: _state.h2,\n h3: _state.h3,\n h4: _state.h4,\n h5: _state.h5,\n h6: _state.h6,\n h7: _state.h7\n };\n _update(s2, _w, finalBlock);\n var rval = forge.util.createBuffer();\n rval.putInt32(s2.h0);\n rval.putInt32(s2.h1);\n rval.putInt32(s2.h2);\n rval.putInt32(s2.h3);\n rval.putInt32(s2.h4);\n rval.putInt32(s2.h5);\n rval.putInt32(s2.h6);\n rval.putInt32(s2.h7);\n return rval;\n };\n\n return md;\n};\n\n// sha-256 padding bytes not initialized yet\nvar _padding = null;\nvar _initialized = false;\n\n// table of constants\nvar _k = null;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n // create padding\n _padding = String.fromCharCode(128);\n _padding += forge.util.fillString(String.fromCharCode(0x00), 64);\n\n // create K table for SHA-256\n _k = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2];\n\n // now initialized\n _initialized = true;\n}\n\n/**\n * Updates a SHA-256 state with the given byte buffer.\n *\n * @param s the SHA-256 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n // consume 512 bit (64 byte) chunks\n var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h;\n var len = bytes.length();\n while(len >= 64) {\n // the w array will be populated with sixteen 32-bit big-endian words\n // and then extended into 64 32-bit words according to SHA-256\n for(i = 0; i < 16; ++i) {\n w[i] = bytes.getInt32();\n }\n for(; i < 64; ++i) {\n // XOR word 2 words ago rot right 17, rot right 19, shft right 10\n t1 = w[i - 2];\n t1 =\n ((t1 >>> 17) | (t1 << 15)) ^\n ((t1 >>> 19) | (t1 << 13)) ^\n (t1 >>> 10);\n // XOR word 15 words ago rot right 7, rot right 18, shft right 3\n t2 = w[i - 15];\n t2 =\n ((t2 >>> 7) | (t2 << 25)) ^\n ((t2 >>> 18) | (t2 << 14)) ^\n (t2 >>> 3);\n // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32\n w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0;\n }\n\n // initialize hash value for this chunk\n a = s.h0;\n b = s.h1;\n c = s.h2;\n d = s.h3;\n e = s.h4;\n f = s.h5;\n g = s.h6;\n h = s.h7;\n\n // round function\n for(i = 0; i < 64; ++i) {\n // Sum1(e)\n s1 =\n ((e >>> 6) | (e << 26)) ^\n ((e >>> 11) | (e << 21)) ^\n ((e >>> 25) | (e << 7));\n // Ch(e, f, g) (optimized the same way as SHA-1)\n ch = g ^ (e & (f ^ g));\n // Sum0(a)\n s0 =\n ((a >>> 2) | (a << 30)) ^\n ((a >>> 13) | (a << 19)) ^\n ((a >>> 22) | (a << 10));\n // Maj(a, b, c) (optimized the same way as SHA-1)\n maj = (a & b) | (c & (a ^ b));\n\n // main algorithm\n t1 = h + s1 + ch + _k[i] + w[i];\n t2 = s0 + maj;\n h = g;\n g = f;\n f = e;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n // can't truncate with `| 0`\n e = (d + t1) >>> 0;\n d = c;\n c = b;\n b = a;\n // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n // can't truncate with `| 0`\n a = (t1 + t2) >>> 0;\n }\n\n // update hash state\n s.h0 = (s.h0 + a) | 0;\n s.h1 = (s.h1 + b) | 0;\n s.h2 = (s.h2 + c) | 0;\n s.h3 = (s.h3 + d) | 0;\n s.h4 = (s.h4 + e) | 0;\n s.h5 = (s.h5 + f) | 0;\n s.h6 = (s.h6 + g) | 0;\n s.h7 = (s.h7 + h) | 0;\n len -= 64;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/sha256.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/sha512.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/sha512.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * Secure Hash Algorithm with a 1024-bit block size implementation.\n *\n * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For\n * SHA-256 (block size 512 bits), see sha256.js.\n *\n * See FIPS 180-4 for details.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2014-2015 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\n__webpack_require__(/*! ./md */ \"./node_modules/node-forge/lib/md.js\");\n__webpack_require__(/*! ./util */ \"./node_modules/node-forge/lib/util.js\");\n\nvar sha512 = module.exports = forge.sha512 = forge.sha512 || {};\n\n// SHA-512\nforge.md.sha512 = forge.md.algorithms.sha512 = sha512;\n\n// SHA-384\nvar sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {};\nsha384.create = function() {\n return sha512.create('SHA-384');\n};\nforge.md.sha384 = forge.md.algorithms.sha384 = sha384;\n\n// SHA-512/256\nforge.sha512.sha256 = forge.sha512.sha256 || {\n create: function() {\n return sha512.create('SHA-512/256');\n }\n};\nforge.md['sha512/256'] = forge.md.algorithms['sha512/256'] =\n forge.sha512.sha256;\n\n// SHA-512/224\nforge.sha512.sha224 = forge.sha512.sha224 || {\n create: function() {\n return sha512.create('SHA-512/224');\n }\n};\nforge.md['sha512/224'] = forge.md.algorithms['sha512/224'] =\n forge.sha512.sha224;\n\n/**\n * Creates a SHA-2 message digest object.\n *\n * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224,\n * SHA-512/256).\n *\n * @return a message digest object.\n */\nsha512.create = function(algorithm) {\n // do initialization as necessary\n if(!_initialized) {\n _init();\n }\n\n if(typeof algorithm === 'undefined') {\n algorithm = 'SHA-512';\n }\n\n if(!(algorithm in _states)) {\n throw new Error('Invalid SHA-512 algorithm: ' + algorithm);\n }\n\n // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints)\n var _state = _states[algorithm];\n var _h = null;\n\n // input buffer\n var _input = forge.util.createBuffer();\n\n // used for 64-bit word storage\n var _w = new Array(80);\n for(var wi = 0; wi < 80; ++wi) {\n _w[wi] = new Array(2);\n }\n\n // determine digest length by algorithm name (default)\n var digestLength = 64;\n switch (algorithm) {\n case 'SHA-384':\n digestLength = 48;\n break;\n case 'SHA-512/256':\n digestLength = 32;\n break;\n case 'SHA-512/224':\n digestLength = 28;\n break;\n }\n\n // message digest object\n var md = {\n // SHA-512 => sha512\n algorithm: algorithm.replace('-', '').toLowerCase(),\n blockLength: 128,\n digestLength: digestLength,\n // 56-bit length of message so far (does not including padding)\n messageLength: 0,\n // true message length\n fullMessageLength: null,\n // size of message length in bytes\n messageLengthSize: 16\n };\n\n /**\n * Starts the digest.\n *\n * @return this digest object.\n */\n md.start = function() {\n // up to 56-bit message length for convenience\n md.messageLength = 0;\n\n // full message length (set md.messageLength128 for backwards-compatibility)\n md.fullMessageLength = md.messageLength128 = [];\n var int32s = md.messageLengthSize / 4;\n for(var i = 0; i < int32s; ++i) {\n md.fullMessageLength.push(0);\n }\n _input = forge.util.createBuffer();\n _h = new Array(_state.length);\n for(var i = 0; i < _state.length; ++i) {\n _h[i] = _state[i].slice(0);\n }\n return md;\n };\n // start digest automatically for first time\n md.start();\n\n /**\n * Updates the digest with the given message input. The given input can\n * treated as raw input (no encoding will be applied) or an encoding of\n * 'utf8' maybe given to encode the input using UTF-8.\n *\n * @param msg the message input to update with.\n * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n *\n * @return this digest object.\n */\n md.update = function(msg, encoding) {\n if(encoding === 'utf8') {\n msg = forge.util.encodeUtf8(msg);\n }\n\n // update message length\n var len = msg.length;\n md.messageLength += len;\n len = [(len / 0x100000000) >>> 0, len >>> 0];\n for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n md.fullMessageLength[i] += len[1];\n len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n len[0] = ((len[1] / 0x100000000) >>> 0);\n }\n\n // add bytes to input buffer\n _input.putBytes(msg);\n\n // process bytes\n _update(_h, _w, _input);\n\n // compact input buffer every 2K or if empty\n if(_input.read > 2048 || _input.length() === 0) {\n _input.compact();\n }\n\n return md;\n };\n\n /**\n * Produces the digest.\n *\n * @return a byte buffer containing the digest value.\n */\n md.digest = function() {\n /* Note: Here we copy the remaining bytes in the input buffer and\n add the appropriate SHA-512 padding. Then we do the final update\n on a copy of the state so that if the user wants to get\n intermediate digests they can do so. */\n\n /* Determine the number of bytes that must be added to the message\n to ensure its length is congruent to 896 mod 1024. In other words,\n the data to be digested must be a multiple of 1024 bits (or 128 bytes).\n This data includes the message, some padding, and the length of the\n message. Since the length of the message will be encoded as 16 bytes (128\n bits), that means that the last segment of the data must have 112 bytes\n (896 bits) of message and padding. Therefore, the length of the message\n plus the padding must be congruent to 896 mod 1024 because\n 1024 - 128 = 896.\n\n In order to fill up the message length it must be filled with\n padding that begins with 1 bit followed by all 0 bits. Padding\n must *always* be present, so if the message length is already\n congruent to 896 mod 1024, then 1024 padding bits must be added. */\n\n var finalBlock = forge.util.createBuffer();\n finalBlock.putBytes(_input.bytes());\n\n // compute remaining size to be digested (include message length size)\n var remaining = (\n md.fullMessageLength[md.fullMessageLength.length - 1] +\n md.messageLengthSize);\n\n // add padding for overflow blockSize - overflow\n // _padding starts with 1 byte with first bit is set (byte value 128), then\n // there may be up to (blockSize - 1) other pad bytes\n var overflow = remaining & (md.blockLength - 1);\n finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n // serialize message length in bits in big-endian order; since length\n // is stored in bytes we multiply by 8 and add carry from next int\n var next, carry;\n var bits = md.fullMessageLength[0] * 8;\n for(var i = 0; i < md.fullMessageLength.length - 1; ++i) {\n next = md.fullMessageLength[i + 1] * 8;\n carry = (next / 0x100000000) >>> 0;\n bits += carry;\n finalBlock.putInt32(bits >>> 0);\n bits = next >>> 0;\n }\n finalBlock.putInt32(bits);\n\n var h = new Array(_h.length);\n for(var i = 0; i < _h.length; ++i) {\n h[i] = _h[i].slice(0);\n }\n _update(h, _w, finalBlock);\n var rval = forge.util.createBuffer();\n var hlen;\n if(algorithm === 'SHA-512') {\n hlen = h.length;\n } else if(algorithm === 'SHA-384') {\n hlen = h.length - 2;\n } else {\n hlen = h.length - 4;\n }\n for(var i = 0; i < hlen; ++i) {\n rval.putInt32(h[i][0]);\n if(i !== hlen - 1 || algorithm !== 'SHA-512/224') {\n rval.putInt32(h[i][1]);\n }\n }\n return rval;\n };\n\n return md;\n};\n\n// sha-512 padding bytes not initialized yet\nvar _padding = null;\nvar _initialized = false;\n\n// table of constants\nvar _k = null;\n\n// initial hash states\nvar _states = null;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n // create padding\n _padding = String.fromCharCode(128);\n _padding += forge.util.fillString(String.fromCharCode(0x00), 128);\n\n // create K table for SHA-512\n _k = [\n [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd],\n [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc],\n [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019],\n [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118],\n [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe],\n [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2],\n [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1],\n [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694],\n [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3],\n [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65],\n [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483],\n [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5],\n [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210],\n [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4],\n [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725],\n [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70],\n [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926],\n [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df],\n [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8],\n [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b],\n [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001],\n [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30],\n [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910],\n [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8],\n [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53],\n [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8],\n [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb],\n [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3],\n [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60],\n [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec],\n [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9],\n [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b],\n [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207],\n [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178],\n [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6],\n [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b],\n [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493],\n [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c],\n [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a],\n [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817]\n ];\n\n // initial hash states\n _states = {};\n _states['SHA-512'] = [\n [0x6a09e667, 0xf3bcc908],\n [0xbb67ae85, 0x84caa73b],\n [0x3c6ef372, 0xfe94f82b],\n [0xa54ff53a, 0x5f1d36f1],\n [0x510e527f, 0xade682d1],\n [0x9b05688c, 0x2b3e6c1f],\n [0x1f83d9ab, 0xfb41bd6b],\n [0x5be0cd19, 0x137e2179]\n ];\n _states['SHA-384'] = [\n [0xcbbb9d5d, 0xc1059ed8],\n [0x629a292a, 0x367cd507],\n [0x9159015a, 0x3070dd17],\n [0x152fecd8, 0xf70e5939],\n [0x67332667, 0xffc00b31],\n [0x8eb44a87, 0x68581511],\n [0xdb0c2e0d, 0x64f98fa7],\n [0x47b5481d, 0xbefa4fa4]\n ];\n _states['SHA-512/256'] = [\n [0x22312194, 0xFC2BF72C],\n [0x9F555FA3, 0xC84C64C2],\n [0x2393B86B, 0x6F53B151],\n [0x96387719, 0x5940EABD],\n [0x96283EE2, 0xA88EFFE3],\n [0xBE5E1E25, 0x53863992],\n [0x2B0199FC, 0x2C85B8AA],\n [0x0EB72DDC, 0x81C52CA2]\n ];\n _states['SHA-512/224'] = [\n [0x8C3D37C8, 0x19544DA2],\n [0x73E19966, 0x89DCD4D6],\n [0x1DFAB7AE, 0x32FF9C82],\n [0x679DD514, 0x582F9FCF],\n [0x0F6D2B69, 0x7BD44DA8],\n [0x77E36F73, 0x04C48942],\n [0x3F9D85A8, 0x6A1D36C8],\n [0x1112E6AD, 0x91D692A1]\n ];\n\n // now initialized\n _initialized = true;\n}\n\n/**\n * Updates a SHA-512 state with the given byte buffer.\n *\n * @param s the SHA-512 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n // consume 512 bit (128 byte) chunks\n var t1_hi, t1_lo;\n var t2_hi, t2_lo;\n var s0_hi, s0_lo;\n var s1_hi, s1_lo;\n var ch_hi, ch_lo;\n var maj_hi, maj_lo;\n var a_hi, a_lo;\n var b_hi, b_lo;\n var c_hi, c_lo;\n var d_hi, d_lo;\n var e_hi, e_lo;\n var f_hi, f_lo;\n var g_hi, g_lo;\n var h_hi, h_lo;\n var i, hi, lo, w2, w7, w15, w16;\n var len = bytes.length();\n while(len >= 128) {\n // the w array will be populated with sixteen 64-bit big-endian words\n // and then extended into 64 64-bit words according to SHA-512\n for(i = 0; i < 16; ++i) {\n w[i][0] = bytes.getInt32() >>> 0;\n w[i][1] = bytes.getInt32() >>> 0;\n }\n for(; i < 80; ++i) {\n // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x)\n w2 = w[i - 2];\n hi = w2[0];\n lo = w2[1];\n\n // high bits\n t1_hi = (\n ((hi >>> 19) | (lo << 13)) ^ // ROTR 19\n ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29)\n (hi >>> 6)) >>> 0; // SHR 6\n // low bits\n t1_lo = (\n ((hi << 13) | (lo >>> 19)) ^ // ROTR 19\n ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29)\n ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6\n\n // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x)\n w15 = w[i - 15];\n hi = w15[0];\n lo = w15[1];\n\n // high bits\n t2_hi = (\n ((hi >>> 1) | (lo << 31)) ^ // ROTR 1\n ((hi >>> 8) | (lo << 24)) ^ // ROTR 8\n (hi >>> 7)) >>> 0; // SHR 7\n // low bits\n t2_lo = (\n ((hi << 31) | (lo >>> 1)) ^ // ROTR 1\n ((hi << 24) | (lo >>> 8)) ^ // ROTR 8\n ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7\n\n // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow)\n w7 = w[i - 7];\n w16 = w[i - 16];\n lo = (t1_lo + w7[1] + t2_lo + w16[1]);\n w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] +\n ((lo / 0x100000000) >>> 0)) >>> 0;\n w[i][1] = lo >>> 0;\n }\n\n // initialize hash value for this chunk\n a_hi = s[0][0];\n a_lo = s[0][1];\n b_hi = s[1][0];\n b_lo = s[1][1];\n c_hi = s[2][0];\n c_lo = s[2][1];\n d_hi = s[3][0];\n d_lo = s[3][1];\n e_hi = s[4][0];\n e_lo = s[4][1];\n f_hi = s[5][0];\n f_lo = s[5][1];\n g_hi = s[6][0];\n g_lo = s[6][1];\n h_hi = s[7][0];\n h_lo = s[7][1];\n\n // round function\n for(i = 0; i < 80; ++i) {\n // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e)\n s1_hi = (\n ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14\n ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18\n ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9)\n s1_lo = (\n ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14\n ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18\n ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9)\n\n // Ch(e, f, g) (optimized the same way as SHA-1)\n ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0;\n ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0;\n\n // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a)\n s0_hi = (\n ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28\n ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2)\n ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7)\n s0_lo = (\n ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28\n ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2)\n ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7)\n\n // Maj(a, b, c) (optimized the same way as SHA-1)\n maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0;\n maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0;\n\n // main algorithm\n // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow)\n lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]);\n t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] +\n ((lo / 0x100000000) >>> 0)) >>> 0;\n t1_lo = lo >>> 0;\n\n // t2 = s0 + maj modulo 2^64 (carry lo overflow)\n lo = s0_lo + maj_lo;\n t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n t2_lo = lo >>> 0;\n\n h_hi = g_hi;\n h_lo = g_lo;\n\n g_hi = f_hi;\n g_lo = f_lo;\n\n f_hi = e_hi;\n f_lo = e_lo;\n\n // e = (d + t1) modulo 2^64 (carry lo overflow)\n lo = d_lo + t1_lo;\n e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n e_lo = lo >>> 0;\n\n d_hi = c_hi;\n d_lo = c_lo;\n\n c_hi = b_hi;\n c_lo = b_lo;\n\n b_hi = a_hi;\n b_lo = a_lo;\n\n // a = (t1 + t2) modulo 2^64 (carry lo overflow)\n lo = t1_lo + t2_lo;\n a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n a_lo = lo >>> 0;\n }\n\n // update hash state (additional modulo 2^64)\n lo = s[0][1] + a_lo;\n s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[0][1] = lo >>> 0;\n\n lo = s[1][1] + b_lo;\n s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[1][1] = lo >>> 0;\n\n lo = s[2][1] + c_lo;\n s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[2][1] = lo >>> 0;\n\n lo = s[3][1] + d_lo;\n s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[3][1] = lo >>> 0;\n\n lo = s[4][1] + e_lo;\n s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[4][1] = lo >>> 0;\n\n lo = s[5][1] + f_lo;\n s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[5][1] = lo >>> 0;\n\n lo = s[6][1] + g_lo;\n s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[6][1] = lo >>> 0;\n\n lo = s[7][1] + h_lo;\n s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n s[7][1] = lo >>> 0;\n\n len -= 128;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/sha512.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-forge/lib/util.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/node-forge/lib/util.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {/**\n * Utility functions for web applications.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2018 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(/*! ./forge */ \"./node_modules/node-forge/lib/forge.js\");\nvar baseN = __webpack_require__(/*! ./baseN */ \"./node_modules/node-forge/lib/baseN.js\");\n\n/* Utilities API */\nvar util = module.exports = forge.util = forge.util || {};\n\n// define setImmediate and nextTick\n(function() {\n // use native nextTick (unless we're in webpack)\n // webpack (or better node-libs-browser polyfill) sets process.browser.\n // this way we can detect webpack properly\n if(typeof process !== 'undefined' && process.nextTick && !process.browser) {\n util.nextTick = process.nextTick;\n if(typeof setImmediate === 'function') {\n util.setImmediate = setImmediate;\n } else {\n // polyfill setImmediate with nextTick, older versions of node\n // (those w/o setImmediate) won't totally starve IO\n util.setImmediate = util.nextTick;\n }\n return;\n }\n\n // polyfill nextTick with native setImmediate\n if(typeof setImmediate === 'function') {\n util.setImmediate = function() { return setImmediate.apply(undefined, arguments); };\n util.nextTick = function(callback) {\n return setImmediate(callback);\n };\n return;\n }\n\n /* Note: A polyfill upgrade pattern is used here to allow combining\n polyfills. For example, MutationObserver is fast, but blocks UI updates,\n so it needs to allow UI updates periodically, so it falls back on\n postMessage or setTimeout. */\n\n // polyfill with setTimeout\n util.setImmediate = function(callback) {\n setTimeout(callback, 0);\n };\n\n // upgrade polyfill to use postMessage\n if(typeof window !== 'undefined' &&\n typeof window.postMessage === 'function') {\n var msg = 'forge.setImmediate';\n var callbacks = [];\n util.setImmediate = function(callback) {\n callbacks.push(callback);\n // only send message when one hasn't been sent in\n // the current turn of the event loop\n if(callbacks.length === 1) {\n window.postMessage(msg, '*');\n }\n };\n function handler(event) {\n if(event.source === window && event.data === msg) {\n event.stopPropagation();\n var copy = callbacks.slice();\n callbacks.length = 0;\n copy.forEach(function(callback) {\n callback();\n });\n }\n }\n window.addEventListener('message', handler, true);\n }\n\n // upgrade polyfill to use MutationObserver\n if(typeof MutationObserver !== 'undefined') {\n // polyfill with MutationObserver\n var now = Date.now();\n var attr = true;\n var div = document.createElement('div');\n var callbacks = [];\n new MutationObserver(function() {\n var copy = callbacks.slice();\n callbacks.length = 0;\n copy.forEach(function(callback) {\n callback();\n });\n }).observe(div, {attributes: true});\n var oldSetImmediate = util.setImmediate;\n util.setImmediate = function(callback) {\n if(Date.now() - now > 15) {\n now = Date.now();\n oldSetImmediate(callback);\n } else {\n callbacks.push(callback);\n // only trigger observer when it hasn't been triggered in\n // the current turn of the event loop\n if(callbacks.length === 1) {\n div.setAttribute('a', attr = !attr);\n }\n }\n };\n }\n\n util.nextTick = util.setImmediate;\n})();\n\n// check if running under Node.js\nutil.isNodejs =\n typeof process !== 'undefined' && process.versions && process.versions.node;\n\n// define isArray\nutil.isArray = Array.isArray || function(x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n};\n\n// define isArrayBuffer\nutil.isArrayBuffer = function(x) {\n return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer;\n};\n\n// define isArrayBufferView\nutil.isArrayBufferView = function(x) {\n return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined;\n};\n\n/**\n * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for\n * algorithms where bit manipulation, JavaScript limitations, and/or algorithm\n * design only allow for byte operations of a limited size.\n *\n * @param n number of bits.\n *\n * Throw Error if n invalid.\n */\nfunction _checkBitsParam(n) {\n if(!(n === 8 || n === 16 || n === 24 || n === 32)) {\n throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n);\n }\n}\n\n// TODO: set ByteBuffer to best available backing\nutil.ByteBuffer = ByteStringBuffer;\n\n/** Buffer w/BinaryString backing */\n\n/**\n * Constructor for a binary string backed byte buffer.\n *\n * @param [b] the bytes to wrap (either encoded as string, one byte per\n * character, or as an ArrayBuffer or Typed Array).\n */\nfunction ByteStringBuffer(b) {\n // TODO: update to match DataBuffer API\n\n // the data in this buffer\n this.data = '';\n // the pointer for reading from this buffer\n this.read = 0;\n\n if(typeof b === 'string') {\n this.data = b;\n } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) {\n if(typeof Buffer !== 'undefined' && b instanceof Buffer) {\n this.data = b.toString('binary');\n } else {\n // convert native buffer to forge buffer\n // FIXME: support native buffers internally instead\n var arr = new Uint8Array(b);\n try {\n this.data = String.fromCharCode.apply(null, arr);\n } catch(e) {\n for(var i = 0; i < arr.length; ++i) {\n this.putByte(arr[i]);\n }\n }\n }\n } else if(b instanceof ByteStringBuffer ||\n (typeof b === 'object' && typeof b.data === 'string' &&\n typeof b.read === 'number')) {\n // copy existing buffer\n this.data = b.data;\n this.read = b.read;\n }\n\n // used for v8 optimization\n this._constructedStringLength = 0;\n}\nutil.ByteStringBuffer = ByteStringBuffer;\n\n/* Note: This is an optimization for V8-based browsers. When V8 concatenates\n a string, the strings are only joined logically using a \"cons string\" or\n \"constructed/concatenated string\". These containers keep references to one\n another and can result in very large memory usage. For example, if a 2MB\n string is constructed by concatenating 4 bytes together at a time, the\n memory usage will be ~44MB; so ~22x increase. The strings are only joined\n together when an operation requiring their joining takes place, such as\n substr(). This function is called when adding data to this buffer to ensure\n these types of strings are periodically joined to reduce the memory\n footprint. */\nvar _MAX_CONSTRUCTED_STRING_LENGTH = 4096;\nutil.ByteStringBuffer.prototype._optimizeConstructedString = function(x) {\n this._constructedStringLength += x;\n if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) {\n // this substr() should cause the constructed string to join\n this.data.substr(0, 1);\n this._constructedStringLength = 0;\n }\n};\n\n/**\n * Gets the number of bytes in this buffer.\n *\n * @return the number of bytes in this buffer.\n */\nutil.ByteStringBuffer.prototype.length = function() {\n return this.data.length - this.read;\n};\n\n/**\n * Gets whether or not this buffer is empty.\n *\n * @return true if this buffer is empty, false if not.\n */\nutil.ByteStringBuffer.prototype.isEmpty = function() {\n return this.length() <= 0;\n};\n\n/**\n * Puts a byte in this buffer.\n *\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putByte = function(b) {\n return this.putBytes(String.fromCharCode(b));\n};\n\n/**\n * Puts a byte in this buffer N times.\n *\n * @param b the byte to put.\n * @param n the number of bytes of value b to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.fillWithByte = function(b, n) {\n b = String.fromCharCode(b);\n var d = this.data;\n while(n > 0) {\n if(n & 1) {\n d += b;\n }\n n >>>= 1;\n if(n > 0) {\n b += b;\n }\n }\n this.data = d;\n this._optimizeConstructedString(n);\n return this;\n};\n\n/**\n * Puts bytes in this buffer.\n *\n * @param bytes the bytes (as a UTF-8 encoded string) to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putBytes = function(bytes) {\n this.data += bytes;\n this._optimizeConstructedString(bytes.length);\n return this;\n};\n\n/**\n * Puts a UTF-16 encoded string into this buffer.\n *\n * @param str the string to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putString = function(str) {\n return this.putBytes(util.encodeUtf8(str));\n};\n\n/**\n * Puts a 16-bit integer in this buffer in big-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt16 = function(i) {\n return this.putBytes(\n String.fromCharCode(i >> 8 & 0xFF) +\n String.fromCharCode(i & 0xFF));\n};\n\n/**\n * Puts a 24-bit integer in this buffer in big-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt24 = function(i) {\n return this.putBytes(\n String.fromCharCode(i >> 16 & 0xFF) +\n String.fromCharCode(i >> 8 & 0xFF) +\n String.fromCharCode(i & 0xFF));\n};\n\n/**\n * Puts a 32-bit integer in this buffer in big-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt32 = function(i) {\n return this.putBytes(\n String.fromCharCode(i >> 24 & 0xFF) +\n String.fromCharCode(i >> 16 & 0xFF) +\n String.fromCharCode(i >> 8 & 0xFF) +\n String.fromCharCode(i & 0xFF));\n};\n\n/**\n * Puts a 16-bit integer in this buffer in little-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt16Le = function(i) {\n return this.putBytes(\n String.fromCharCode(i & 0xFF) +\n String.fromCharCode(i >> 8 & 0xFF));\n};\n\n/**\n * Puts a 24-bit integer in this buffer in little-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt24Le = function(i) {\n return this.putBytes(\n String.fromCharCode(i & 0xFF) +\n String.fromCharCode(i >> 8 & 0xFF) +\n String.fromCharCode(i >> 16 & 0xFF));\n};\n\n/**\n * Puts a 32-bit integer in this buffer in little-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt32Le = function(i) {\n return this.putBytes(\n String.fromCharCode(i & 0xFF) +\n String.fromCharCode(i >> 8 & 0xFF) +\n String.fromCharCode(i >> 16 & 0xFF) +\n String.fromCharCode(i >> 24 & 0xFF));\n};\n\n/**\n * Puts an n-bit integer in this buffer in big-endian order.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt = function(i, n) {\n _checkBitsParam(n);\n var bytes = '';\n do {\n n -= 8;\n bytes += String.fromCharCode((i >> n) & 0xFF);\n } while(n > 0);\n return this.putBytes(bytes);\n};\n\n/**\n * Puts a signed n-bit integer in this buffer in big-endian order. Two's\n * complement representation is used.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putSignedInt = function(i, n) {\n // putInt checks n\n if(i < 0) {\n i += 2 << (n - 1);\n }\n return this.putInt(i, n);\n};\n\n/**\n * Puts the given buffer into this buffer.\n *\n * @param buffer the buffer to put into this one.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putBuffer = function(buffer) {\n return this.putBytes(buffer.getBytes());\n};\n\n/**\n * Gets a byte from this buffer and advances the read pointer by 1.\n *\n * @return the byte.\n */\nutil.ByteStringBuffer.prototype.getByte = function() {\n return this.data.charCodeAt(this.read++);\n};\n\n/**\n * Gets a uint16 from this buffer in big-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.ByteStringBuffer.prototype.getInt16 = function() {\n var rval = (\n this.data.charCodeAt(this.read) << 8 ^\n this.data.charCodeAt(this.read + 1));\n this.read += 2;\n return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in big-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.ByteStringBuffer.prototype.getInt24 = function() {\n var rval = (\n this.data.charCodeAt(this.read) << 16 ^\n this.data.charCodeAt(this.read + 1) << 8 ^\n this.data.charCodeAt(this.read + 2));\n this.read += 3;\n return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in big-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.ByteStringBuffer.prototype.getInt32 = function() {\n var rval = (\n this.data.charCodeAt(this.read) << 24 ^\n this.data.charCodeAt(this.read + 1) << 16 ^\n this.data.charCodeAt(this.read + 2) << 8 ^\n this.data.charCodeAt(this.read + 3));\n this.read += 4;\n return rval;\n};\n\n/**\n * Gets a uint16 from this buffer in little-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.ByteStringBuffer.prototype.getInt16Le = function() {\n var rval = (\n this.data.charCodeAt(this.read) ^\n this.data.charCodeAt(this.read + 1) << 8);\n this.read += 2;\n return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in little-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.ByteStringBuffer.prototype.getInt24Le = function() {\n var rval = (\n this.data.charCodeAt(this.read) ^\n this.data.charCodeAt(this.read + 1) << 8 ^\n this.data.charCodeAt(this.read + 2) << 16);\n this.read += 3;\n return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in little-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.ByteStringBuffer.prototype.getInt32Le = function() {\n var rval = (\n this.data.charCodeAt(this.read) ^\n this.data.charCodeAt(this.read + 1) << 8 ^\n this.data.charCodeAt(this.read + 2) << 16 ^\n this.data.charCodeAt(this.read + 3) << 24);\n this.read += 4;\n return rval;\n};\n\n/**\n * Gets an n-bit integer from this buffer in big-endian order and advances the\n * read pointer by ceil(n/8).\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.ByteStringBuffer.prototype.getInt = function(n) {\n _checkBitsParam(n);\n var rval = 0;\n do {\n // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits.\n rval = (rval << 8) + this.data.charCodeAt(this.read++);\n n -= 8;\n } while(n > 0);\n return rval;\n};\n\n/**\n * Gets a signed n-bit integer from this buffer in big-endian order, using\n * two's complement, and advances the read pointer by n/8.\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.ByteStringBuffer.prototype.getSignedInt = function(n) {\n // getInt checks n\n var x = this.getInt(n);\n var max = 2 << (n - 2);\n if(x >= max) {\n x -= max << 1;\n }\n return x;\n};\n\n/**\n * Reads bytes out into a UTF-8 string and clears them from the buffer.\n *\n * @param count the number of bytes to read, undefined or null for all.\n *\n * @return a UTF-8 string of bytes.\n */\nutil.ByteStringBuffer.prototype.getBytes = function(count) {\n var rval;\n if(count) {\n // read count bytes\n count = Math.min(this.length(), count);\n rval = this.data.slice(this.read, this.read + count);\n this.read += count;\n } else if(count === 0) {\n rval = '';\n } else {\n // read all bytes, optimize to only copy when needed\n rval = (this.read === 0) ? this.data : this.data.slice(this.read);\n this.clear();\n }\n return rval;\n};\n\n/**\n * Gets a UTF-8 encoded string of the bytes from this buffer without modifying\n * the read pointer.\n *\n * @param count the number of bytes to get, omit to get all.\n *\n * @return a string full of UTF-8 encoded characters.\n */\nutil.ByteStringBuffer.prototype.bytes = function(count) {\n return (typeof(count) === 'undefined' ?\n this.data.slice(this.read) :\n this.data.slice(this.read, this.read + count));\n};\n\n/**\n * Gets a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n *\n * @return the byte.\n */\nutil.ByteStringBuffer.prototype.at = function(i) {\n return this.data.charCodeAt(this.read + i);\n};\n\n/**\n * Puts a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.setAt = function(i, b) {\n this.data = this.data.substr(0, this.read + i) +\n String.fromCharCode(b) +\n this.data.substr(this.read + i + 1);\n return this;\n};\n\n/**\n * Gets the last byte without modifying the read pointer.\n *\n * @return the last byte.\n */\nutil.ByteStringBuffer.prototype.last = function() {\n return this.data.charCodeAt(this.data.length - 1);\n};\n\n/**\n * Creates a copy of this buffer.\n *\n * @return the copy.\n */\nutil.ByteStringBuffer.prototype.copy = function() {\n var c = util.createBuffer(this.data);\n c.read = this.read;\n return c;\n};\n\n/**\n * Compacts this buffer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.compact = function() {\n if(this.read > 0) {\n this.data = this.data.slice(this.read);\n this.read = 0;\n }\n return this;\n};\n\n/**\n * Clears this buffer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.clear = function() {\n this.data = '';\n this.read = 0;\n return this;\n};\n\n/**\n * Shortens this buffer by triming bytes off of the end of this buffer.\n *\n * @param count the number of bytes to trim off.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.truncate = function(count) {\n var len = Math.max(0, this.length() - count);\n this.data = this.data.substr(this.read, len);\n this.read = 0;\n return this;\n};\n\n/**\n * Converts this buffer to a hexadecimal string.\n *\n * @return a hexadecimal string.\n */\nutil.ByteStringBuffer.prototype.toHex = function() {\n var rval = '';\n for(var i = this.read; i < this.data.length; ++i) {\n var b = this.data.charCodeAt(i);\n if(b < 16) {\n rval += '0';\n }\n rval += b.toString(16);\n }\n return rval;\n};\n\n/**\n * Converts this buffer to a UTF-16 string (standard JavaScript string).\n *\n * @return a UTF-16 string.\n */\nutil.ByteStringBuffer.prototype.toString = function() {\n return util.decodeUtf8(this.bytes());\n};\n\n/** End Buffer w/BinaryString backing */\n\n/** Buffer w/UInt8Array backing */\n\n/**\n * FIXME: Experimental. Do not use yet.\n *\n * Constructor for an ArrayBuffer-backed byte buffer.\n *\n * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a\n * TypedArray.\n *\n * If a string is given, its encoding should be provided as an option,\n * otherwise it will default to 'binary'. A 'binary' string is encoded such\n * that each character is one byte in length and size.\n *\n * If an ArrayBuffer, DataView, or TypedArray is given, it will be used\n * *directly* without any copying. Note that, if a write to the buffer requires\n * more space, the buffer will allocate a new backing ArrayBuffer to\n * accommodate. The starting read and write offsets for the buffer may be\n * given as options.\n *\n * @param [b] the initial bytes for this buffer.\n * @param options the options to use:\n * [readOffset] the starting read offset to use (default: 0).\n * [writeOffset] the starting write offset to use (default: the\n * length of the first parameter).\n * [growSize] the minimum amount, in bytes, to grow the buffer by to\n * accommodate writes (default: 1024).\n * [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the\n * first parameter, if it is a string (default: 'binary').\n */\nfunction DataBuffer(b, options) {\n // default options\n options = options || {};\n\n // pointers for read from/write to buffer\n this.read = options.readOffset || 0;\n this.growSize = options.growSize || 1024;\n\n var isArrayBuffer = util.isArrayBuffer(b);\n var isArrayBufferView = util.isArrayBufferView(b);\n if(isArrayBuffer || isArrayBufferView) {\n // use ArrayBuffer directly\n if(isArrayBuffer) {\n this.data = new DataView(b);\n } else {\n // TODO: adjust read/write offset based on the type of view\n // or specify that this must be done in the options ... that the\n // offsets are byte-based\n this.data = new DataView(b.buffer, b.byteOffset, b.byteLength);\n }\n this.write = ('writeOffset' in options ?\n options.writeOffset : this.data.byteLength);\n return;\n }\n\n // initialize to empty array buffer and add any given bytes using putBytes\n this.data = new DataView(new ArrayBuffer(0));\n this.write = 0;\n\n if(b !== null && b !== undefined) {\n this.putBytes(b);\n }\n\n if('writeOffset' in options) {\n this.write = options.writeOffset;\n }\n}\nutil.DataBuffer = DataBuffer;\n\n/**\n * Gets the number of bytes in this buffer.\n *\n * @return the number of bytes in this buffer.\n */\nutil.DataBuffer.prototype.length = function() {\n return this.write - this.read;\n};\n\n/**\n * Gets whether or not this buffer is empty.\n *\n * @return true if this buffer is empty, false if not.\n */\nutil.DataBuffer.prototype.isEmpty = function() {\n return this.length() <= 0;\n};\n\n/**\n * Ensures this buffer has enough empty space to accommodate the given number\n * of bytes. An optional parameter may be given that indicates a minimum\n * amount to grow the buffer if necessary. If the parameter is not given,\n * the buffer will be grown by some previously-specified default amount\n * or heuristic.\n *\n * @param amount the number of bytes to accommodate.\n * @param [growSize] the minimum amount, in bytes, to grow the buffer by if\n * necessary.\n */\nutil.DataBuffer.prototype.accommodate = function(amount, growSize) {\n if(this.length() >= amount) {\n return this;\n }\n growSize = Math.max(growSize || this.growSize, amount);\n\n // grow buffer\n var src = new Uint8Array(\n this.data.buffer, this.data.byteOffset, this.data.byteLength);\n var dst = new Uint8Array(this.length() + growSize);\n dst.set(src);\n this.data = new DataView(dst.buffer);\n\n return this;\n};\n\n/**\n * Puts a byte in this buffer.\n *\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putByte = function(b) {\n this.accommodate(1);\n this.data.setUint8(this.write++, b);\n return this;\n};\n\n/**\n * Puts a byte in this buffer N times.\n *\n * @param b the byte to put.\n * @param n the number of bytes of value b to put.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.fillWithByte = function(b, n) {\n this.accommodate(n);\n for(var i = 0; i < n; ++i) {\n this.data.setUint8(b);\n }\n return this;\n};\n\n/**\n * Puts bytes in this buffer. The bytes may be given as a string, an\n * ArrayBuffer, a DataView, or a TypedArray.\n *\n * @param bytes the bytes to put.\n * @param [encoding] the encoding for the first parameter ('binary', 'utf8',\n * 'utf16', 'hex'), if it is a string (default: 'binary').\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putBytes = function(bytes, encoding) {\n if(util.isArrayBufferView(bytes)) {\n var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n var len = src.byteLength - src.byteOffset;\n this.accommodate(len);\n var dst = new Uint8Array(this.data.buffer, this.write);\n dst.set(src);\n this.write += len;\n return this;\n }\n\n if(util.isArrayBuffer(bytes)) {\n var src = new Uint8Array(bytes);\n this.accommodate(src.byteLength);\n var dst = new Uint8Array(this.data.buffer);\n dst.set(src, this.write);\n this.write += src.byteLength;\n return this;\n }\n\n // bytes is a util.DataBuffer or equivalent\n if(bytes instanceof util.DataBuffer ||\n (typeof bytes === 'object' &&\n typeof bytes.read === 'number' && typeof bytes.write === 'number' &&\n util.isArrayBufferView(bytes.data))) {\n var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length());\n this.accommodate(src.byteLength);\n var dst = new Uint8Array(bytes.data.byteLength, this.write);\n dst.set(src);\n this.write += src.byteLength;\n return this;\n }\n\n if(bytes instanceof util.ByteStringBuffer) {\n // copy binary string and process as the same as a string parameter below\n bytes = bytes.data;\n encoding = 'binary';\n }\n\n // string conversion\n encoding = encoding || 'binary';\n if(typeof bytes === 'string') {\n var view;\n\n // decode from string\n if(encoding === 'hex') {\n this.accommodate(Math.ceil(bytes.length / 2));\n view = new Uint8Array(this.data.buffer, this.write);\n this.write += util.binary.hex.decode(bytes, view, this.write);\n return this;\n }\n if(encoding === 'base64') {\n this.accommodate(Math.ceil(bytes.length / 4) * 3);\n view = new Uint8Array(this.data.buffer, this.write);\n this.write += util.binary.base64.decode(bytes, view, this.write);\n return this;\n }\n\n // encode text as UTF-8 bytes\n if(encoding === 'utf8') {\n // encode as UTF-8 then decode string as raw binary\n bytes = util.encodeUtf8(bytes);\n encoding = 'binary';\n }\n\n // decode string as raw binary\n if(encoding === 'binary' || encoding === 'raw') {\n // one byte per character\n this.accommodate(bytes.length);\n view = new Uint8Array(this.data.buffer, this.write);\n this.write += util.binary.raw.decode(view);\n return this;\n }\n\n // encode text as UTF-16 bytes\n if(encoding === 'utf16') {\n // two bytes per character\n this.accommodate(bytes.length * 2);\n view = new Uint16Array(this.data.buffer, this.write);\n this.write += util.text.utf16.encode(view);\n return this;\n }\n\n throw new Error('Invalid encoding: ' + encoding);\n }\n\n throw Error('Invalid parameter: ' + bytes);\n};\n\n/**\n * Puts the given buffer into this buffer.\n *\n * @param buffer the buffer to put into this one.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putBuffer = function(buffer) {\n this.putBytes(buffer);\n buffer.clear();\n return this;\n};\n\n/**\n * Puts a string into this buffer.\n *\n * @param str the string to put.\n * @param [encoding] the encoding for the string (default: 'utf16').\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putString = function(str) {\n return this.putBytes(str, 'utf16');\n};\n\n/**\n * Puts a 16-bit integer in this buffer in big-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt16 = function(i) {\n this.accommodate(2);\n this.data.setInt16(this.write, i);\n this.write += 2;\n return this;\n};\n\n/**\n * Puts a 24-bit integer in this buffer in big-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt24 = function(i) {\n this.accommodate(3);\n this.data.setInt16(this.write, i >> 8 & 0xFFFF);\n this.data.setInt8(this.write, i >> 16 & 0xFF);\n this.write += 3;\n return this;\n};\n\n/**\n * Puts a 32-bit integer in this buffer in big-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt32 = function(i) {\n this.accommodate(4);\n this.data.setInt32(this.write, i);\n this.write += 4;\n return this;\n};\n\n/**\n * Puts a 16-bit integer in this buffer in little-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt16Le = function(i) {\n this.accommodate(2);\n this.data.setInt16(this.write, i, true);\n this.write += 2;\n return this;\n};\n\n/**\n * Puts a 24-bit integer in this buffer in little-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt24Le = function(i) {\n this.accommodate(3);\n this.data.setInt8(this.write, i >> 16 & 0xFF);\n this.data.setInt16(this.write, i >> 8 & 0xFFFF, true);\n this.write += 3;\n return this;\n};\n\n/**\n * Puts a 32-bit integer in this buffer in little-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt32Le = function(i) {\n this.accommodate(4);\n this.data.setInt32(this.write, i, true);\n this.write += 4;\n return this;\n};\n\n/**\n * Puts an n-bit integer in this buffer in big-endian order.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt = function(i, n) {\n _checkBitsParam(n);\n this.accommodate(n / 8);\n do {\n n -= 8;\n this.data.setInt8(this.write++, (i >> n) & 0xFF);\n } while(n > 0);\n return this;\n};\n\n/**\n * Puts a signed n-bit integer in this buffer in big-endian order. Two's\n * complement representation is used.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putSignedInt = function(i, n) {\n _checkBitsParam(n);\n this.accommodate(n / 8);\n if(i < 0) {\n i += 2 << (n - 1);\n }\n return this.putInt(i, n);\n};\n\n/**\n * Gets a byte from this buffer and advances the read pointer by 1.\n *\n * @return the byte.\n */\nutil.DataBuffer.prototype.getByte = function() {\n return this.data.getInt8(this.read++);\n};\n\n/**\n * Gets a uint16 from this buffer in big-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.DataBuffer.prototype.getInt16 = function() {\n var rval = this.data.getInt16(this.read);\n this.read += 2;\n return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in big-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.DataBuffer.prototype.getInt24 = function() {\n var rval = (\n this.data.getInt16(this.read) << 8 ^\n this.data.getInt8(this.read + 2));\n this.read += 3;\n return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in big-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.DataBuffer.prototype.getInt32 = function() {\n var rval = this.data.getInt32(this.read);\n this.read += 4;\n return rval;\n};\n\n/**\n * Gets a uint16 from this buffer in little-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.DataBuffer.prototype.getInt16Le = function() {\n var rval = this.data.getInt16(this.read, true);\n this.read += 2;\n return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in little-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.DataBuffer.prototype.getInt24Le = function() {\n var rval = (\n this.data.getInt8(this.read) ^\n this.data.getInt16(this.read + 1, true) << 8);\n this.read += 3;\n return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in little-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.DataBuffer.prototype.getInt32Le = function() {\n var rval = this.data.getInt32(this.read, true);\n this.read += 4;\n return rval;\n};\n\n/**\n * Gets an n-bit integer from this buffer in big-endian order and advances the\n * read pointer by n/8.\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.DataBuffer.prototype.getInt = function(n) {\n _checkBitsParam(n);\n var rval = 0;\n do {\n // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits.\n rval = (rval << 8) + this.data.getInt8(this.read++);\n n -= 8;\n } while(n > 0);\n return rval;\n};\n\n/**\n * Gets a signed n-bit integer from this buffer in big-endian order, using\n * two's complement, and advances the read pointer by n/8.\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.DataBuffer.prototype.getSignedInt = function(n) {\n // getInt checks n\n var x = this.getInt(n);\n var max = 2 << (n - 2);\n if(x >= max) {\n x -= max << 1;\n }\n return x;\n};\n\n/**\n * Reads bytes out into a UTF-8 string and clears them from the buffer.\n *\n * @param count the number of bytes to read, undefined or null for all.\n *\n * @return a UTF-8 string of bytes.\n */\nutil.DataBuffer.prototype.getBytes = function(count) {\n // TODO: deprecate this method, it is poorly named and\n // this.toString('binary') replaces it\n // add a toTypedArray()/toArrayBuffer() function\n var rval;\n if(count) {\n // read count bytes\n count = Math.min(this.length(), count);\n rval = this.data.slice(this.read, this.read + count);\n this.read += count;\n } else if(count === 0) {\n rval = '';\n } else {\n // read all bytes, optimize to only copy when needed\n rval = (this.read === 0) ? this.data : this.data.slice(this.read);\n this.clear();\n }\n return rval;\n};\n\n/**\n * Gets a UTF-8 encoded string of the bytes from this buffer without modifying\n * the read pointer.\n *\n * @param count the number of bytes to get, omit to get all.\n *\n * @return a string full of UTF-8 encoded characters.\n */\nutil.DataBuffer.prototype.bytes = function(count) {\n // TODO: deprecate this method, it is poorly named, add \"getString()\"\n return (typeof(count) === 'undefined' ?\n this.data.slice(this.read) :\n this.data.slice(this.read, this.read + count));\n};\n\n/**\n * Gets a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n *\n * @return the byte.\n */\nutil.DataBuffer.prototype.at = function(i) {\n return this.data.getUint8(this.read + i);\n};\n\n/**\n * Puts a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.setAt = function(i, b) {\n this.data.setUint8(i, b);\n return this;\n};\n\n/**\n * Gets the last byte without modifying the read pointer.\n *\n * @return the last byte.\n */\nutil.DataBuffer.prototype.last = function() {\n return this.data.getUint8(this.write - 1);\n};\n\n/**\n * Creates a copy of this buffer.\n *\n * @return the copy.\n */\nutil.DataBuffer.prototype.copy = function() {\n return new util.DataBuffer(this);\n};\n\n/**\n * Compacts this buffer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.compact = function() {\n if(this.read > 0) {\n var src = new Uint8Array(this.data.buffer, this.read);\n var dst = new Uint8Array(src.byteLength);\n dst.set(src);\n this.data = new DataView(dst);\n this.write -= this.read;\n this.read = 0;\n }\n return this;\n};\n\n/**\n * Clears this buffer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.clear = function() {\n this.data = new DataView(new ArrayBuffer(0));\n this.read = this.write = 0;\n return this;\n};\n\n/**\n * Shortens this buffer by triming bytes off of the end of this buffer.\n *\n * @param count the number of bytes to trim off.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.truncate = function(count) {\n this.write = Math.max(0, this.length() - count);\n this.read = Math.min(this.read, this.write);\n return this;\n};\n\n/**\n * Converts this buffer to a hexadecimal string.\n *\n * @return a hexadecimal string.\n */\nutil.DataBuffer.prototype.toHex = function() {\n var rval = '';\n for(var i = this.read; i < this.data.byteLength; ++i) {\n var b = this.data.getUint8(i);\n if(b < 16) {\n rval += '0';\n }\n rval += b.toString(16);\n }\n return rval;\n};\n\n/**\n * Converts this buffer to a string, using the given encoding. If no\n * encoding is given, 'utf8' (UTF-8) is used.\n *\n * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex',\n * 'base64' (default: 'utf8').\n *\n * @return a string representation of the bytes in this buffer.\n */\nutil.DataBuffer.prototype.toString = function(encoding) {\n var view = new Uint8Array(this.data, this.read, this.length());\n encoding = encoding || 'utf8';\n\n // encode to string\n if(encoding === 'binary' || encoding === 'raw') {\n return util.binary.raw.encode(view);\n }\n if(encoding === 'hex') {\n return util.binary.hex.encode(view);\n }\n if(encoding === 'base64') {\n return util.binary.base64.encode(view);\n }\n\n // decode to text\n if(encoding === 'utf8') {\n return util.text.utf8.decode(view);\n }\n if(encoding === 'utf16') {\n return util.text.utf16.decode(view);\n }\n\n throw new Error('Invalid encoding: ' + encoding);\n};\n\n/** End Buffer w/UInt8Array backing */\n\n/**\n * Creates a buffer that stores bytes. A value may be given to put into the\n * buffer that is either a string of bytes or a UTF-16 string that will\n * be encoded using UTF-8 (to do the latter, specify 'utf8' as the encoding).\n *\n * @param [input] the bytes to wrap (as a string) or a UTF-16 string to encode\n * as UTF-8.\n * @param [encoding] (default: 'raw', other: 'utf8').\n */\nutil.createBuffer = function(input, encoding) {\n // TODO: deprecate, use new ByteBuffer() instead\n encoding = encoding || 'raw';\n if(input !== undefined && encoding === 'utf8') {\n input = util.encodeUtf8(input);\n }\n return new util.ByteBuffer(input);\n};\n\n/**\n * Fills a string with a particular value. If you want the string to be a byte\n * string, pass in String.fromCharCode(theByte).\n *\n * @param c the character to fill the string with, use String.fromCharCode\n * to fill the string with a byte value.\n * @param n the number of characters of value c to fill with.\n *\n * @return the filled string.\n */\nutil.fillString = function(c, n) {\n var s = '';\n while(n > 0) {\n if(n & 1) {\n s += c;\n }\n n >>>= 1;\n if(n > 0) {\n c += c;\n }\n }\n return s;\n};\n\n/**\n * Performs a per byte XOR between two byte strings and returns the result as a\n * string of bytes.\n *\n * @param s1 first string of bytes.\n * @param s2 second string of bytes.\n * @param n the number of bytes to XOR.\n *\n * @return the XOR'd result.\n */\nutil.xorBytes = function(s1, s2, n) {\n var s3 = '';\n var b = '';\n var t = '';\n var i = 0;\n var c = 0;\n for(; n > 0; --n, ++i) {\n b = s1.charCodeAt(i) ^ s2.charCodeAt(i);\n if(c >= 10) {\n s3 += t;\n t = '';\n c = 0;\n }\n t += String.fromCharCode(b);\n ++c;\n }\n s3 += t;\n return s3;\n};\n\n/**\n * Converts a hex string into a 'binary' encoded string of bytes.\n *\n * @param hex the hexadecimal string to convert.\n *\n * @return the binary-encoded string of bytes.\n */\nutil.hexToBytes = function(hex) {\n // TODO: deprecate: \"Deprecated. Use util.binary.hex.decode instead.\"\n var rval = '';\n var i = 0;\n if(hex.length & 1 == 1) {\n // odd number of characters, convert first character alone\n i = 1;\n rval += String.fromCharCode(parseInt(hex[0], 16));\n }\n // convert 2 characters (1 byte) at a time\n for(; i < hex.length; i += 2) {\n rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n }\n return rval;\n};\n\n/**\n * Converts a 'binary' encoded string of bytes to hex.\n *\n * @param bytes the byte string to convert.\n *\n * @return the string of hexadecimal characters.\n */\nutil.bytesToHex = function(bytes) {\n // TODO: deprecate: \"Deprecated. Use util.binary.hex.encode instead.\"\n return util.createBuffer(bytes).toHex();\n};\n\n/**\n * Converts an 32-bit integer to 4-big-endian byte string.\n *\n * @param i the integer.\n *\n * @return the byte string.\n */\nutil.int32ToBytes = function(i) {\n return (\n String.fromCharCode(i >> 24 & 0xFF) +\n String.fromCharCode(i >> 16 & 0xFF) +\n String.fromCharCode(i >> 8 & 0xFF) +\n String.fromCharCode(i & 0xFF));\n};\n\n// base64 characters, reverse mapping\nvar _base64 =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nvar _base64Idx = [\n/*43 -43 = 0*/\n/*'+', 1, 2, 3,'/' */\n 62, -1, -1, -1, 63,\n\n/*'0','1','2','3','4','5','6','7','8','9' */\n 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,\n\n/*15, 16, 17,'=', 19, 20, 21 */\n -1, -1, -1, 64, -1, -1, -1,\n\n/*65 - 43 = 22*/\n/*'A','B','C','D','E','F','G','H','I','J','K','L','M', */\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n\n/*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */\n 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,\n\n/*91 - 43 = 48 */\n/*48, 49, 50, 51, 52, 53 */\n -1, -1, -1, -1, -1, -1,\n\n/*97 - 43 = 54*/\n/*'a','b','c','d','e','f','g','h','i','j','k','l','m' */\n 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,\n\n/*'n','o','p','q','r','s','t','u','v','w','x','y','z' */\n 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51\n];\n\n// base58 characters (Bitcoin alphabet)\nvar _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\n\n/**\n * Base64 encodes a 'binary' encoded string of bytes.\n *\n * @param input the binary encoded string of bytes to base64-encode.\n * @param maxline the maximum number of encoded characters per line to use,\n * defaults to none.\n *\n * @return the base64-encoded output.\n */\nutil.encode64 = function(input, maxline) {\n // TODO: deprecate: \"Deprecated. Use util.binary.base64.encode instead.\"\n var line = '';\n var output = '';\n var chr1, chr2, chr3;\n var i = 0;\n while(i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n // encode 4 character group\n line += _base64.charAt(chr1 >> 2);\n line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4));\n if(isNaN(chr2)) {\n line += '==';\n } else {\n line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6));\n line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63);\n }\n\n if(maxline && line.length > maxline) {\n output += line.substr(0, maxline) + '\\r\\n';\n line = line.substr(maxline);\n }\n }\n output += line;\n return output;\n};\n\n/**\n * Base64 decodes a string into a 'binary' encoded string of bytes.\n *\n * @param input the base64-encoded input.\n *\n * @return the binary encoded string.\n */\nutil.decode64 = function(input) {\n // TODO: deprecate: \"Deprecated. Use util.binary.base64.decode instead.\"\n\n // remove all non-base64 characters\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n var output = '';\n var enc1, enc2, enc3, enc4;\n var i = 0;\n\n while(i < input.length) {\n enc1 = _base64Idx[input.charCodeAt(i++) - 43];\n enc2 = _base64Idx[input.charCodeAt(i++) - 43];\n enc3 = _base64Idx[input.charCodeAt(i++) - 43];\n enc4 = _base64Idx[input.charCodeAt(i++) - 43];\n\n output += String.fromCharCode((enc1 << 2) | (enc2 >> 4));\n if(enc3 !== 64) {\n // decoded at least 2 bytes\n output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2));\n if(enc4 !== 64) {\n // decoded 3 bytes\n output += String.fromCharCode(((enc3 & 3) << 6) | enc4);\n }\n }\n }\n\n return output;\n};\n\n/**\n * UTF-8 encodes the given UTF-16 encoded string (a standard JavaScript\n * string). Non-ASCII characters will be encoded as multiple bytes according\n * to UTF-8.\n *\n * @param str the string to encode.\n *\n * @return the UTF-8 encoded string.\n */\nutil.encodeUtf8 = function(str) {\n return unescape(encodeURIComponent(str));\n};\n\n/**\n * Decodes a UTF-8 encoded string into a UTF-16 string.\n *\n * @param str the string to decode.\n *\n * @return the UTF-16 encoded string (standard JavaScript string).\n */\nutil.decodeUtf8 = function(str) {\n return decodeURIComponent(escape(str));\n};\n\n// binary encoding/decoding tools\n// FIXME: Experimental. Do not use yet.\nutil.binary = {\n raw: {},\n hex: {},\n base64: {},\n base58: {},\n baseN : {\n encode: baseN.encode,\n decode: baseN.decode\n }\n};\n\n/**\n * Encodes a Uint8Array as a binary-encoded string. This encoding uses\n * a value between 0 and 255 for each character.\n *\n * @param bytes the Uint8Array to encode.\n *\n * @return the binary-encoded string.\n */\nutil.binary.raw.encode = function(bytes) {\n return String.fromCharCode.apply(null, bytes);\n};\n\n/**\n * Decodes a binary-encoded string to a Uint8Array. This encoding uses\n * a value between 0 and 255 for each character.\n *\n * @param str the binary-encoded string to decode.\n * @param [output] an optional Uint8Array to write the output to; if it\n * is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.binary.raw.decode = function(str, output, offset) {\n var out = output;\n if(!out) {\n out = new Uint8Array(str.length);\n }\n offset = offset || 0;\n var j = offset;\n for(var i = 0; i < str.length; ++i) {\n out[j++] = str.charCodeAt(i);\n }\n return output ? (j - offset) : out;\n};\n\n/**\n * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or\n * ByteBuffer as a string of hexadecimal characters.\n *\n * @param bytes the bytes to convert.\n *\n * @return the string of hexadecimal characters.\n */\nutil.binary.hex.encode = util.bytesToHex;\n\n/**\n * Decodes a hex-encoded string to a Uint8Array.\n *\n * @param hex the hexadecimal string to convert.\n * @param [output] an optional Uint8Array to write the output to; if it\n * is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.binary.hex.decode = function(hex, output, offset) {\n var out = output;\n if(!out) {\n out = new Uint8Array(Math.ceil(hex.length / 2));\n }\n offset = offset || 0;\n var i = 0, j = offset;\n if(hex.length & 1) {\n // odd number of characters, convert first character alone\n i = 1;\n out[j++] = parseInt(hex[0], 16);\n }\n // convert 2 characters (1 byte) at a time\n for(; i < hex.length; i += 2) {\n out[j++] = parseInt(hex.substr(i, 2), 16);\n }\n return output ? (j - offset) : out;\n};\n\n/**\n * Base64-encodes a Uint8Array.\n *\n * @param input the Uint8Array to encode.\n * @param maxline the maximum number of encoded characters per line to use,\n * defaults to none.\n *\n * @return the base64-encoded output string.\n */\nutil.binary.base64.encode = function(input, maxline) {\n var line = '';\n var output = '';\n var chr1, chr2, chr3;\n var i = 0;\n while(i < input.byteLength) {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n // encode 4 character group\n line += _base64.charAt(chr1 >> 2);\n line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4));\n if(isNaN(chr2)) {\n line += '==';\n } else {\n line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6));\n line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63);\n }\n\n if(maxline && line.length > maxline) {\n output += line.substr(0, maxline) + '\\r\\n';\n line = line.substr(maxline);\n }\n }\n output += line;\n return output;\n};\n\n/**\n * Decodes a base64-encoded string to a Uint8Array.\n *\n * @param input the base64-encoded input string.\n * @param [output] an optional Uint8Array to write the output to; if it\n * is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.binary.base64.decode = function(input, output, offset) {\n var out = output;\n if(!out) {\n out = new Uint8Array(Math.ceil(input.length / 4) * 3);\n }\n\n // remove all non-base64 characters\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n offset = offset || 0;\n var enc1, enc2, enc3, enc4;\n var i = 0, j = offset;\n\n while(i < input.length) {\n enc1 = _base64Idx[input.charCodeAt(i++) - 43];\n enc2 = _base64Idx[input.charCodeAt(i++) - 43];\n enc3 = _base64Idx[input.charCodeAt(i++) - 43];\n enc4 = _base64Idx[input.charCodeAt(i++) - 43];\n\n out[j++] = (enc1 << 2) | (enc2 >> 4);\n if(enc3 !== 64) {\n // decoded at least 2 bytes\n out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2);\n if(enc4 !== 64) {\n // decoded 3 bytes\n out[j++] = ((enc3 & 3) << 6) | enc4;\n }\n }\n }\n\n // make sure result is the exact decoded length\n return output ? (j - offset) : out.subarray(0, j);\n};\n\n// add support for base58 encoding/decoding with Bitcoin alphabet\nutil.binary.base58.encode = function(input, maxline) {\n return util.binary.baseN.encode(input, _base58, maxline);\n};\nutil.binary.base58.decode = function(input, maxline) {\n return util.binary.baseN.decode(input, _base58, maxline);\n};\n\n// text encoding/decoding tools\n// FIXME: Experimental. Do not use yet.\nutil.text = {\n utf8: {},\n utf16: {}\n};\n\n/**\n * Encodes the given string as UTF-8 in a Uint8Array.\n *\n * @param str the string to encode.\n * @param [output] an optional Uint8Array to write the output to; if it\n * is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.text.utf8.encode = function(str, output, offset) {\n str = util.encodeUtf8(str);\n var out = output;\n if(!out) {\n out = new Uint8Array(str.length);\n }\n offset = offset || 0;\n var j = offset;\n for(var i = 0; i < str.length; ++i) {\n out[j++] = str.charCodeAt(i);\n }\n return output ? (j - offset) : out;\n};\n\n/**\n * Decodes the UTF-8 contents from a Uint8Array.\n *\n * @param bytes the Uint8Array to decode.\n *\n * @return the resulting string.\n */\nutil.text.utf8.decode = function(bytes) {\n return util.decodeUtf8(String.fromCharCode.apply(null, bytes));\n};\n\n/**\n * Encodes the given string as UTF-16 in a Uint8Array.\n *\n * @param str the string to encode.\n * @param [output] an optional Uint8Array to write the output to; if it\n * is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.text.utf16.encode = function(str, output, offset) {\n var out = output;\n if(!out) {\n out = new Uint8Array(str.length * 2);\n }\n var view = new Uint16Array(out.buffer);\n offset = offset || 0;\n var j = offset;\n var k = offset;\n for(var i = 0; i < str.length; ++i) {\n view[k++] = str.charCodeAt(i);\n j += 2;\n }\n return output ? (j - offset) : out;\n};\n\n/**\n * Decodes the UTF-16 contents from a Uint8Array.\n *\n * @param bytes the Uint8Array to decode.\n *\n * @return the resulting string.\n */\nutil.text.utf16.decode = function(bytes) {\n return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer));\n};\n\n/**\n * Deflates the given data using a flash interface.\n *\n * @param api the flash interface.\n * @param bytes the data.\n * @param raw true to return only raw deflate data, false to include zlib\n * header and trailer.\n *\n * @return the deflated data as a string.\n */\nutil.deflate = function(api, bytes, raw) {\n bytes = util.decode64(api.deflate(util.encode64(bytes)).rval);\n\n // strip zlib header and trailer if necessary\n if(raw) {\n // zlib header is 2 bytes (CMF,FLG) where FLG indicates that\n // there is a 4-byte DICT (alder-32) block before the data if\n // its 5th bit is set\n var start = 2;\n var flg = bytes.charCodeAt(1);\n if(flg & 0x20) {\n start = 6;\n }\n // zlib trailer is 4 bytes of adler-32\n bytes = bytes.substring(start, bytes.length - 4);\n }\n\n return bytes;\n};\n\n/**\n * Inflates the given data using a flash interface.\n *\n * @param api the flash interface.\n * @param bytes the data.\n * @param raw true if the incoming data has no zlib header or trailer and is\n * raw DEFLATE data.\n *\n * @return the inflated data as a string, null on error.\n */\nutil.inflate = function(api, bytes, raw) {\n // TODO: add zlib header and trailer if necessary/possible\n var rval = api.inflate(util.encode64(bytes)).rval;\n return (rval === null) ? null : util.decode64(rval);\n};\n\n/**\n * Sets a storage object.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param obj the storage object, null to remove.\n */\nvar _setStorageObject = function(api, id, obj) {\n if(!api) {\n throw new Error('WebStorage not available.');\n }\n\n var rval;\n if(obj === null) {\n rval = api.removeItem(id);\n } else {\n // json-encode and base64-encode object\n obj = util.encode64(JSON.stringify(obj));\n rval = api.setItem(id, obj);\n }\n\n // handle potential flash error\n if(typeof(rval) !== 'undefined' && rval.rval !== true) {\n var error = new Error(rval.error.message);\n error.id = rval.error.id;\n error.name = rval.error.name;\n throw error;\n }\n};\n\n/**\n * Gets a storage object.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n *\n * @return the storage object entry or null if none exists.\n */\nvar _getStorageObject = function(api, id) {\n if(!api) {\n throw new Error('WebStorage not available.');\n }\n\n // get the existing entry\n var rval = api.getItem(id);\n\n /* Note: We check api.init because we can't do (api == localStorage)\n on IE because of \"Class doesn't support Automation\" exception. Only\n the flash api has an init method so this works too, but we need a\n better solution in the future. */\n\n // flash returns item wrapped in an object, handle special case\n if(api.init) {\n if(rval.rval === null) {\n if(rval.error) {\n var error = new Error(rval.error.message);\n error.id = rval.error.id;\n error.name = rval.error.name;\n throw error;\n }\n // no error, but also no item\n rval = null;\n } else {\n rval = rval.rval;\n }\n }\n\n // handle decoding\n if(rval !== null) {\n // base64-decode and json-decode data\n rval = JSON.parse(util.decode64(rval));\n }\n\n return rval;\n};\n\n/**\n * Stores an item in local storage.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param data the data for the item (any javascript object/primitive).\n */\nvar _setItem = function(api, id, key, data) {\n // get storage object\n var obj = _getStorageObject(api, id);\n if(obj === null) {\n // create a new storage object\n obj = {};\n }\n // update key\n obj[key] = data;\n\n // set storage object\n _setStorageObject(api, id, obj);\n};\n\n/**\n * Gets an item from local storage.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n *\n * @return the item.\n */\nvar _getItem = function(api, id, key) {\n // get storage object\n var rval = _getStorageObject(api, id);\n if(rval !== null) {\n // return data at key\n rval = (key in rval) ? rval[key] : null;\n }\n\n return rval;\n};\n\n/**\n * Removes an item from local storage.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n */\nvar _removeItem = function(api, id, key) {\n // get storage object\n var obj = _getStorageObject(api, id);\n if(obj !== null && key in obj) {\n // remove key\n delete obj[key];\n\n // see if entry has no keys remaining\n var empty = true;\n for(var prop in obj) {\n empty = false;\n break;\n }\n if(empty) {\n // remove entry entirely if no keys are left\n obj = null;\n }\n\n // set storage object\n _setStorageObject(api, id, obj);\n }\n};\n\n/**\n * Clears the local disk storage identified by the given ID.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n */\nvar _clearItems = function(api, id) {\n _setStorageObject(api, id, null);\n};\n\n/**\n * Calls a storage function.\n *\n * @param func the function to call.\n * @param args the arguments for the function.\n * @param location the location argument.\n *\n * @return the return value from the function.\n */\nvar _callStorageFunction = function(func, args, location) {\n var rval = null;\n\n // default storage types\n if(typeof(location) === 'undefined') {\n location = ['web', 'flash'];\n }\n\n // apply storage types in order of preference\n var type;\n var done = false;\n var exception = null;\n for(var idx in location) {\n type = location[idx];\n try {\n if(type === 'flash' || type === 'both') {\n if(args[0] === null) {\n throw new Error('Flash local storage not available.');\n }\n rval = func.apply(this, args);\n done = (type === 'flash');\n }\n if(type === 'web' || type === 'both') {\n args[0] = localStorage;\n rval = func.apply(this, args);\n done = true;\n }\n } catch(ex) {\n exception = ex;\n }\n if(done) {\n break;\n }\n }\n\n if(!done) {\n throw exception;\n }\n\n return rval;\n};\n\n/**\n * Stores an item on local disk.\n *\n * The available types of local storage include 'flash', 'web', and 'both'.\n *\n * The type 'flash' refers to flash local storage (SharedObject). In order\n * to use flash local storage, the 'api' parameter must be valid. The type\n * 'web' refers to WebStorage, if supported by the browser. The type 'both'\n * refers to storing using both 'flash' and 'web', not just one or the\n * other.\n *\n * The location array should list the storage types to use in order of\n * preference:\n *\n * ['flash']: flash only storage\n * ['web']: web only storage\n * ['both']: try to store in both\n * ['flash','web']: store in flash first, but if not available, 'web'\n * ['web','flash']: store in web first, but if not available, 'flash'\n *\n * The location array defaults to: ['web', 'flash']\n *\n * @param api the flash interface, null to use only WebStorage.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param data the data for the item (any javascript object/primitive).\n * @param location an array with the preferred types of storage to use.\n */\nutil.setItem = function(api, id, key, data, location) {\n _callStorageFunction(_setItem, arguments, location);\n};\n\n/**\n * Gets an item on local disk.\n *\n * Set setItem() for details on storage types.\n *\n * @param api the flash interface, null to use only WebStorage.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param location an array with the preferred types of storage to use.\n *\n * @return the item.\n */\nutil.getItem = function(api, id, key, location) {\n return _callStorageFunction(_getItem, arguments, location);\n};\n\n/**\n * Removes an item on local disk.\n *\n * Set setItem() for details on storage types.\n *\n * @param api the flash interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param location an array with the preferred types of storage to use.\n */\nutil.removeItem = function(api, id, key, location) {\n _callStorageFunction(_removeItem, arguments, location);\n};\n\n/**\n * Clears the local disk storage identified by the given ID.\n *\n * Set setItem() for details on storage types.\n *\n * @param api the flash interface if flash is available.\n * @param id the storage ID to use.\n * @param location an array with the preferred types of storage to use.\n */\nutil.clearItems = function(api, id, location) {\n _callStorageFunction(_clearItems, arguments, location);\n};\n\n/**\n * Parses the scheme, host, and port from an http(s) url.\n *\n * @param str the url string.\n *\n * @return the parsed url object or null if the url is invalid.\n */\nutil.parseUrl = function(str) {\n // FIXME: this regex looks a bit broken\n var regex = /^(https?):\\/\\/([^:&^\\/]*):?(\\d*)(.*)$/g;\n regex.lastIndex = 0;\n var m = regex.exec(str);\n var url = (m === null) ? null : {\n full: str,\n scheme: m[1],\n host: m[2],\n port: m[3],\n path: m[4]\n };\n if(url) {\n url.fullHost = url.host;\n if(url.port) {\n if(url.port !== 80 && url.scheme === 'http') {\n url.fullHost += ':' + url.port;\n } else if(url.port !== 443 && url.scheme === 'https') {\n url.fullHost += ':' + url.port;\n }\n } else if(url.scheme === 'http') {\n url.port = 80;\n } else if(url.scheme === 'https') {\n url.port = 443;\n }\n url.full = url.scheme + '://' + url.fullHost;\n }\n return url;\n};\n\n/* Storage for query variables */\nvar _queryVariables = null;\n\n/**\n * Returns the window location query variables. Query is parsed on the first\n * call and the same object is returned on subsequent calls. The mapping\n * is from keys to an array of values. Parameters without values will have\n * an object key set but no value added to the value array. Values are\n * unescaped.\n *\n * ...?k1=v1&k2=v2:\n * {\n * \"k1\": [\"v1\"],\n * \"k2\": [\"v2\"]\n * }\n *\n * ...?k1=v1&k1=v2:\n * {\n * \"k1\": [\"v1\", \"v2\"]\n * }\n *\n * ...?k1=v1&k2:\n * {\n * \"k1\": [\"v1\"],\n * \"k2\": []\n * }\n *\n * ...?k1=v1&k1:\n * {\n * \"k1\": [\"v1\"]\n * }\n *\n * ...?k1&k1:\n * {\n * \"k1\": []\n * }\n *\n * @param query the query string to parse (optional, default to cached\n * results from parsing window location search query).\n *\n * @return object mapping keys to variables.\n */\nutil.getQueryVariables = function(query) {\n var parse = function(q) {\n var rval = {};\n var kvpairs = q.split('&');\n for(var i = 0; i < kvpairs.length; i++) {\n var pos = kvpairs[i].indexOf('=');\n var key;\n var val;\n if(pos > 0) {\n key = kvpairs[i].substring(0, pos);\n val = kvpairs[i].substring(pos + 1);\n } else {\n key = kvpairs[i];\n val = null;\n }\n if(!(key in rval)) {\n rval[key] = [];\n }\n // disallow overriding object prototype keys\n if(!(key in Object.prototype) && val !== null) {\n rval[key].push(unescape(val));\n }\n }\n return rval;\n };\n\n var rval;\n if(typeof(query) === 'undefined') {\n // set cached variables if needed\n if(_queryVariables === null) {\n if(typeof(window) !== 'undefined' && window.location && window.location.search) {\n // parse window search query\n _queryVariables = parse(window.location.search.substring(1));\n } else {\n // no query variables available\n _queryVariables = {};\n }\n }\n rval = _queryVariables;\n } else {\n // parse given query\n rval = parse(query);\n }\n return rval;\n};\n\n/**\n * Parses a fragment into a path and query. This method will take a URI\n * fragment and break it up as if it were the main URI. For example:\n * /bar/baz?a=1&b=2\n * results in:\n * {\n * path: [\"bar\", \"baz\"],\n * query: {\"k1\": [\"v1\"], \"k2\": [\"v2\"]}\n * }\n *\n * @return object with a path array and query object.\n */\nutil.parseFragment = function(fragment) {\n // default to whole fragment\n var fp = fragment;\n var fq = '';\n // split into path and query if possible at the first '?'\n var pos = fragment.indexOf('?');\n if(pos > 0) {\n fp = fragment.substring(0, pos);\n fq = fragment.substring(pos + 1);\n }\n // split path based on '/' and ignore first element if empty\n var path = fp.split('/');\n if(path.length > 0 && path[0] === '') {\n path.shift();\n }\n // convert query into object\n var query = (fq === '') ? {} : util.getQueryVariables(fq);\n\n return {\n pathString: fp,\n queryString: fq,\n path: path,\n query: query\n };\n};\n\n/**\n * Makes a request out of a URI-like request string. This is intended to\n * be used where a fragment id (after a URI '#') is parsed as a URI with\n * path and query parts. The string should have a path beginning and\n * delimited by '/' and optional query parameters following a '?'. The\n * query should be a standard URL set of key value pairs delimited by\n * '&'. For backwards compatibility the initial '/' on the path is not\n * required. The request object has the following API, (fully described\n * in the method code):\n * {\n * path: <the path string part>.\n * query: <the query string part>,\n * getPath(i): get part or all of the split path array,\n * getQuery(k, i): get part or all of a query key array,\n * getQueryLast(k, _default): get last element of a query key array.\n * }\n *\n * @return object with request parameters.\n */\nutil.makeRequest = function(reqString) {\n var frag = util.parseFragment(reqString);\n var req = {\n // full path string\n path: frag.pathString,\n // full query string\n query: frag.queryString,\n /**\n * Get path or element in path.\n *\n * @param i optional path index.\n *\n * @return path or part of path if i provided.\n */\n getPath: function(i) {\n return (typeof(i) === 'undefined') ? frag.path : frag.path[i];\n },\n /**\n * Get query, values for a key, or value for a key index.\n *\n * @param k optional query key.\n * @param i optional query key index.\n *\n * @return query, values for a key, or value for a key index.\n */\n getQuery: function(k, i) {\n var rval;\n if(typeof(k) === 'undefined') {\n rval = frag.query;\n } else {\n rval = frag.query[k];\n if(rval && typeof(i) !== 'undefined') {\n rval = rval[i];\n }\n }\n return rval;\n },\n getQueryLast: function(k, _default) {\n var rval;\n var vals = req.getQuery(k);\n if(vals) {\n rval = vals[vals.length - 1];\n } else {\n rval = _default;\n }\n return rval;\n }\n };\n return req;\n};\n\n/**\n * Makes a URI out of a path, an object with query parameters, and a\n * fragment. Uses jQuery.param() internally for query string creation.\n * If the path is an array, it will be joined with '/'.\n *\n * @param path string path or array of strings.\n * @param query object with query parameters. (optional)\n * @param fragment fragment string. (optional)\n *\n * @return string object with request parameters.\n */\nutil.makeLink = function(path, query, fragment) {\n // join path parts if needed\n path = jQuery.isArray(path) ? path.join('/') : path;\n\n var qstr = jQuery.param(query || {});\n fragment = fragment || '';\n return path +\n ((qstr.length > 0) ? ('?' + qstr) : '') +\n ((fragment.length > 0) ? ('#' + fragment) : '');\n};\n\n/**\n * Follows a path of keys deep into an object hierarchy and set a value.\n * If a key does not exist or it's value is not an object, create an\n * object in it's place. This can be destructive to a object tree if\n * leaf nodes are given as non-final path keys.\n * Used to avoid exceptions from missing parts of the path.\n *\n * @param object the starting object.\n * @param keys an array of string keys.\n * @param value the value to set.\n */\nutil.setPath = function(object, keys, value) {\n // need to start at an object\n if(typeof(object) === 'object' && object !== null) {\n var i = 0;\n var len = keys.length;\n while(i < len) {\n var next = keys[i++];\n if(i == len) {\n // last\n object[next] = value;\n } else {\n // more\n var hasNext = (next in object);\n if(!hasNext ||\n (hasNext && typeof(object[next]) !== 'object') ||\n (hasNext && object[next] === null)) {\n object[next] = {};\n }\n object = object[next];\n }\n }\n }\n};\n\n/**\n * Follows a path of keys deep into an object hierarchy and return a value.\n * If a key does not exist, create an object in it's place.\n * Used to avoid exceptions from missing parts of the path.\n *\n * @param object the starting object.\n * @param keys an array of string keys.\n * @param _default value to return if path not found.\n *\n * @return the value at the path if found, else default if given, else\n * undefined.\n */\nutil.getPath = function(object, keys, _default) {\n var i = 0;\n var len = keys.length;\n var hasNext = true;\n while(hasNext && i < len &&\n typeof(object) === 'object' && object !== null) {\n var next = keys[i++];\n hasNext = next in object;\n if(hasNext) {\n object = object[next];\n }\n }\n return (hasNext ? object : _default);\n};\n\n/**\n * Follow a path of keys deep into an object hierarchy and delete the\n * last one. If a key does not exist, do nothing.\n * Used to avoid exceptions from missing parts of the path.\n *\n * @param object the starting object.\n * @param keys an array of string keys.\n */\nutil.deletePath = function(object, keys) {\n // need to start at an object\n if(typeof(object) === 'object' && object !== null) {\n var i = 0;\n var len = keys.length;\n while(i < len) {\n var next = keys[i++];\n if(i == len) {\n // last\n delete object[next];\n } else {\n // more\n if(!(next in object) ||\n (typeof(object[next]) !== 'object') ||\n (object[next] === null)) {\n break;\n }\n object = object[next];\n }\n }\n }\n};\n\n/**\n * Check if an object is empty.\n *\n * Taken from:\n * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937\n *\n * @param object the object to check.\n */\nutil.isEmpty = function(obj) {\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Format with simple printf-style interpolation.\n *\n * %%: literal '%'\n * %s,%o: convert next argument into a string.\n *\n * @param format the string to format.\n * @param ... arguments to interpolate into the format string.\n */\nutil.format = function(format) {\n var re = /%./g;\n // current match\n var match;\n // current part\n var part;\n // current arg index\n var argi = 0;\n // collected parts to recombine later\n var parts = [];\n // last index found\n var last = 0;\n // loop while matches remain\n while((match = re.exec(format))) {\n part = format.substring(last, re.lastIndex - 2);\n // don't add empty strings (ie, parts between %s%s)\n if(part.length > 0) {\n parts.push(part);\n }\n last = re.lastIndex;\n // switch on % code\n var code = match[0][1];\n switch(code) {\n case 's':\n case 'o':\n // check if enough arguments were given\n if(argi < arguments.length) {\n parts.push(arguments[argi++ + 1]);\n } else {\n parts.push('<?>');\n }\n break;\n // FIXME: do proper formating for numbers, etc\n //case 'f':\n //case 'd':\n case '%':\n parts.push('%');\n break;\n default:\n parts.push('<%' + code + '?>');\n }\n }\n // add trailing part of format string\n parts.push(format.substring(last));\n return parts.join('');\n};\n\n/**\n * Formats a number.\n *\n * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/\n */\nutil.formatNumber = function(number, decimals, dec_point, thousands_sep) {\n // http://kevin.vanzonneveld.net\n // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + bugfix by: Michael White (http://crestidg.com)\n // + bugfix by: Benjamin Lupton\n // + bugfix by: Allan Jensen (http://www.winternet.no)\n // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // * example 1: number_format(1234.5678, 2, '.', '');\n // * returns 1: 1234.57\n\n var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;\n var d = dec_point === undefined ? ',' : dec_point;\n var t = thousands_sep === undefined ?\n '.' : thousands_sep, s = n < 0 ? '-' : '';\n var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + '';\n var j = (i.length > 3) ? i.length % 3 : 0;\n return s + (j ? i.substr(0, j) + t : '') +\n i.substr(j).replace(/(\\d{3})(?=\\d)/g, '$1' + t) +\n (c ? d + Math.abs(n - i).toFixed(c).slice(2) : '');\n};\n\n/**\n * Formats a byte size.\n *\n * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/\n */\nutil.formatSize = function(size) {\n if(size >= 1073741824) {\n size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB';\n } else if(size >= 1048576) {\n size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB';\n } else if(size >= 1024) {\n size = util.formatNumber(size / 1024, 0) + ' KiB';\n } else {\n size = util.formatNumber(size, 0) + ' bytes';\n }\n return size;\n};\n\n/**\n * Converts an IPv4 or IPv6 string representation into bytes (in network order).\n *\n * @param ip the IPv4 or IPv6 address to convert.\n *\n * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't\n * be parsed.\n */\nutil.bytesFromIP = function(ip) {\n if(ip.indexOf('.') !== -1) {\n return util.bytesFromIPv4(ip);\n }\n if(ip.indexOf(':') !== -1) {\n return util.bytesFromIPv6(ip);\n }\n return null;\n};\n\n/**\n * Converts an IPv4 string representation into bytes (in network order).\n *\n * @param ip the IPv4 address to convert.\n *\n * @return the 4-byte address or null if the address can't be parsed.\n */\nutil.bytesFromIPv4 = function(ip) {\n ip = ip.split('.');\n if(ip.length !== 4) {\n return null;\n }\n var b = util.createBuffer();\n for(var i = 0; i < ip.length; ++i) {\n var num = parseInt(ip[i], 10);\n if(isNaN(num)) {\n return null;\n }\n b.putByte(num);\n }\n return b.getBytes();\n};\n\n/**\n * Converts an IPv6 string representation into bytes (in network order).\n *\n * @param ip the IPv6 address to convert.\n *\n * @return the 16-byte address or null if the address can't be parsed.\n */\nutil.bytesFromIPv6 = function(ip) {\n var blanks = 0;\n ip = ip.split(':').filter(function(e) {\n if(e.length === 0) ++blanks;\n return true;\n });\n var zeros = (8 - ip.length + blanks) * 2;\n var b = util.createBuffer();\n for(var i = 0; i < 8; ++i) {\n if(!ip[i] || ip[i].length === 0) {\n b.fillWithByte(0, zeros);\n zeros = 0;\n continue;\n }\n var bytes = util.hexToBytes(ip[i]);\n if(bytes.length < 2) {\n b.putByte(0);\n }\n b.putBytes(bytes);\n }\n return b.getBytes();\n};\n\n/**\n * Converts 4-bytes into an IPv4 string representation or 16-bytes into\n * an IPv6 string representation. The bytes must be in network order.\n *\n * @param bytes the bytes to convert.\n *\n * @return the IPv4 or IPv6 string representation if 4 or 16 bytes,\n * respectively, are given, otherwise null.\n */\nutil.bytesToIP = function(bytes) {\n if(bytes.length === 4) {\n return util.bytesToIPv4(bytes);\n }\n if(bytes.length === 16) {\n return util.bytesToIPv6(bytes);\n }\n return null;\n};\n\n/**\n * Converts 4-bytes into an IPv4 string representation. The bytes must be\n * in network order.\n *\n * @param bytes the bytes to convert.\n *\n * @return the IPv4 string representation or null for an invalid # of bytes.\n */\nutil.bytesToIPv4 = function(bytes) {\n if(bytes.length !== 4) {\n return null;\n }\n var ip = [];\n for(var i = 0; i < bytes.length; ++i) {\n ip.push(bytes.charCodeAt(i));\n }\n return ip.join('.');\n};\n\n/**\n * Converts 16-bytes into an IPv16 string representation. The bytes must be\n * in network order.\n *\n * @param bytes the bytes to convert.\n *\n * @return the IPv16 string representation or null for an invalid # of bytes.\n */\nutil.bytesToIPv6 = function(bytes) {\n if(bytes.length !== 16) {\n return null;\n }\n var ip = [];\n var zeroGroups = [];\n var zeroMaxGroup = 0;\n for(var i = 0; i < bytes.length; i += 2) {\n var hex = util.bytesToHex(bytes[i] + bytes[i + 1]);\n // canonicalize zero representation\n while(hex[0] === '0' && hex !== '0') {\n hex = hex.substr(1);\n }\n if(hex === '0') {\n var last = zeroGroups[zeroGroups.length - 1];\n var idx = ip.length;\n if(!last || idx !== last.end + 1) {\n zeroGroups.push({start: idx, end: idx});\n } else {\n last.end = idx;\n if((last.end - last.start) >\n (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) {\n zeroMaxGroup = zeroGroups.length - 1;\n }\n }\n }\n ip.push(hex);\n }\n if(zeroGroups.length > 0) {\n var group = zeroGroups[zeroMaxGroup];\n // only shorten group of length > 0\n if(group.end - group.start > 0) {\n ip.splice(group.start, group.end - group.start + 1, '');\n if(group.start === 0) {\n ip.unshift('');\n }\n if(group.end === 7) {\n ip.push('');\n }\n }\n }\n return ip.join(':');\n};\n\n/**\n * Estimates the number of processes that can be run concurrently. If\n * creating Web Workers, keep in mind that the main JavaScript process needs\n * its own core.\n *\n * @param options the options to use:\n * update true to force an update (not use the cached value).\n * @param callback(err, max) called once the operation completes.\n */\nutil.estimateCores = function(options, callback) {\n if(typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n if('cores' in util && !options.update) {\n return callback(null, util.cores);\n }\n if(typeof navigator !== 'undefined' &&\n 'hardwareConcurrency' in navigator &&\n navigator.hardwareConcurrency > 0) {\n util.cores = navigator.hardwareConcurrency;\n return callback(null, util.cores);\n }\n if(typeof Worker === 'undefined') {\n // workers not available\n util.cores = 1;\n return callback(null, util.cores);\n }\n if(typeof Blob === 'undefined') {\n // can't estimate, default to 2\n util.cores = 2;\n return callback(null, util.cores);\n }\n\n // create worker concurrency estimation code as blob\n var blobUrl = URL.createObjectURL(new Blob(['(',\n function() {\n self.addEventListener('message', function(e) {\n // run worker for 4 ms\n var st = Date.now();\n var et = st + 4;\n while(Date.now() < et);\n self.postMessage({st: st, et: et});\n });\n }.toString(),\n ')()'], {type: 'application/javascript'}));\n\n // take 5 samples using 16 workers\n sample([], 5, 16);\n\n function sample(max, samples, numWorkers) {\n if(samples === 0) {\n // get overlap average\n var avg = Math.floor(max.reduce(function(avg, x) {\n return avg + x;\n }, 0) / max.length);\n util.cores = Math.max(1, avg);\n URL.revokeObjectURL(blobUrl);\n return callback(null, util.cores);\n }\n map(numWorkers, function(err, results) {\n max.push(reduce(numWorkers, results));\n sample(max, samples - 1, numWorkers);\n });\n }\n\n function map(numWorkers, callback) {\n var workers = [];\n var results = [];\n for(var i = 0; i < numWorkers; ++i) {\n var worker = new Worker(blobUrl);\n worker.addEventListener('message', function(e) {\n results.push(e.data);\n if(results.length === numWorkers) {\n for(var i = 0; i < numWorkers; ++i) {\n workers[i].terminate();\n }\n callback(null, results);\n }\n });\n workers.push(worker);\n }\n for(var i = 0; i < numWorkers; ++i) {\n workers[i].postMessage(i);\n }\n }\n\n function reduce(numWorkers, results) {\n // find overlapping time windows\n var overlaps = [];\n for(var n = 0; n < numWorkers; ++n) {\n var r1 = results[n];\n var overlap = overlaps[n] = [];\n for(var i = 0; i < numWorkers; ++i) {\n if(n === i) {\n continue;\n }\n var r2 = results[i];\n if((r1.st > r2.st && r1.st < r2.et) ||\n (r2.st > r1.st && r2.st < r1.et)) {\n overlap.push(i);\n }\n }\n }\n // get maximum overlaps ... don't include overlapping worker itself\n // as the main JS process was also being scheduled during the work and\n // would have to be subtracted from the estimate anyway\n return overlaps.reduce(function(max, overlap) {\n return Math.max(max, overlap.length);\n }, 0);\n }\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/node-forge/lib/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/mock/empty.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/mock/empty.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/mock/empty.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/node_modules/buffer/index.js":
|
||
/*!*********************************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/node_modules/buffer/index.js ***!
|
||
\*********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\")\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/buffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/node_modules/events/events.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/node_modules/events/events.js ***!
|
||
\**********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction $getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return $getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = $getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n ReflectApply(this.listener, this.target, args);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/events/events.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js ***!
|
||
\**********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/node_modules/timers-browserify/main.js":
|
||
/*!*******************************************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/node_modules/timers-browserify/main.js ***!
|
||
\*******************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\n__webpack_require__(/*! setimmediate */ \"./node_modules/setimmediate/setImmediate.js\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/timers-browserify/main.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js":
|
||
/*!*************************************************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js ***!
|
||
\*************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-libs-browser/node_modules/util/util.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/node-libs-browser/node_modules/util/util.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ \"./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js\");\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(/*! inherits */ \"./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js\");\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb, null, ret) },\n function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/util/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/nodeify/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/nodeify/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var Promise = __webpack_require__(/*! promise */ \"./node_modules/promise/index.js\");\nvar isPromise = __webpack_require__(/*! is-promise */ \"./node_modules/is-promise/index.js\");\n\nvar nextTick;\nif (typeof setImmediate === 'function') nextTick = setImmediate\nelse if (typeof process === 'object' && process && process.nextTick) nextTick = process.nextTick\nelse nextTick = function (cb) { setTimeout(cb, 0) }\n\nmodule.exports = nodeify;\nfunction nodeify(promise, cb) {\n if (typeof cb !== 'function') return promise;\n return promise\n .then(function (res) {\n nextTick(function () {\n cb(null, res);\n });\n }, function (err) {\n nextTick(function () {\n cb(err);\n });\n });\n}\nfunction nodeifyThis(cb) {\n return nodeify(this, cb);\n}\n\nnodeify.extend = extend;\nnodeify.Promise = NodeifyPromise;\n\nfunction extend(prom) {\n if (prom && isPromise(prom)) {\n prom.nodeify = nodeifyThis;\n var then = prom.then;\n prom.then = function () {\n return extend(then.apply(this, arguments));\n };\n return prom;\n } else if (typeof prom === 'function') {\n prom.prototype.nodeify = nodeifyThis;\n } else {\n Promise.prototype.nodeify = nodeifyThis;\n }\n}\n\nfunction NodeifyPromise(fn) {\n if (!(this instanceof NodeifyPromise)) {\n return new NodeifyPromise(fn);\n }\n Promise.call(this, fn);\n extend(this);\n}\n\nNodeifyPromise.prototype = Object.create(Promise.prototype);\nNodeifyPromise.prototype.constructor = NodeifyPromise;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/nodeify/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/oauth-sign/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/oauth-sign/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\")\n\nfunction sha (key, body, algorithm) {\n return crypto.createHmac(algorithm, key).update(body).digest('base64')\n}\n\nfunction rsa (key, body) {\n return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64')\n}\n\nfunction rfc3986 (str) {\n return encodeURIComponent(str)\n .replace(/!/g,'%21')\n .replace(/\\*/g,'%2A')\n .replace(/\\(/g,'%28')\n .replace(/\\)/g,'%29')\n .replace(/'/g,'%27')\n}\n\n// Maps object to bi-dimensional array\n// Converts { foo: 'A', bar: [ 'b', 'B' ]} to\n// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]\nfunction map (obj) {\n var key, val, arr = []\n for (key in obj) {\n val = obj[key]\n if (Array.isArray(val))\n for (var i = 0; i < val.length; i++)\n arr.push([key, val[i]])\n else if (typeof val === 'object')\n for (var prop in val)\n arr.push([key + '[' + prop + ']', val[prop]])\n else\n arr.push([key, val])\n }\n return arr\n}\n\n// Compare function for sort\nfunction compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}\n\nfunction generateBase (httpMethod, base_uri, params) {\n // adapted from https://dev.twitter.com/docs/auth/oauth and \n // https://dev.twitter.com/docs/auth/creating-signature\n\n // Parameter normalization\n // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2\n var normalized = map(params)\n // 1. First, the name and value of each parameter are encoded\n .map(function (p) {\n return [ rfc3986(p[0]), rfc3986(p[1] || '') ]\n })\n // 2. The parameters are sorted by name, using ascending byte value\n // ordering. If two or more parameters share the same name, they\n // are sorted by their value.\n .sort(function (a, b) {\n return compare(a[0], b[0]) || compare(a[1], b[1])\n })\n // 3. The name of each parameter is concatenated to its corresponding\n // value using an \"=\" character (ASCII code 61) as a separator, even\n // if the value is empty.\n .map(function (p) { return p.join('=') })\n // 4. The sorted name/value pairs are concatenated together into a\n // single string by using an \"&\" character (ASCII code 38) as\n // separator.\n .join('&')\n\n var base = [\n rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),\n rfc3986(base_uri),\n rfc3986(normalized)\n ].join('&')\n\n return base\n}\n\nfunction hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return sha(key, base, 'sha1')\n}\n\nfunction hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return sha(key, base, 'sha256')\n}\n\nfunction rsasign (httpMethod, base_uri, params, private_key, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = private_key || ''\n\n return rsa(key, base)\n}\n\nfunction plaintext (consumer_secret, token_secret) {\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return key\n}\n\nfunction sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {\n var method\n var skipArgs = 1\n\n switch (signMethod) {\n case 'RSA-SHA1':\n method = rsasign\n break\n case 'HMAC-SHA1':\n method = hmacsign\n break\n case 'HMAC-SHA256':\n method = hmacsign256\n break\n case 'PLAINTEXT':\n method = plaintext\n skipArgs = 4\n break\n default:\n throw new Error('Signature method not supported: ' + signMethod)\n }\n\n return method.apply(null, [].slice.call(arguments, skipArgs))\n}\n\nexports.hmacsign = hmacsign\nexports.hmacsign256 = hmacsign256\nexports.rsasign = rsasign\nexports.plaintext = plaintext\nexports.sign = sign\nexports.rfc3986 = rfc3986\nexports.generateBase = generateBase\n\n//# sourceURL=webpack:///./node_modules/oauth-sign/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/object-assign/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/object-assign/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//# sourceURL=webpack:///./node_modules/object-assign/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/once/once.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/once/once.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var wrappy = __webpack_require__(/*! wrappy */ \"./node_modules/wrappy/wrappy.js\")\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n\n\n//# sourceURL=webpack:///./node_modules/once/once.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/os-browserify/browser.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/os-browserify/browser.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n\n\n//# sourceURL=webpack:///./node_modules/os-browserify/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/utils/common.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pako/lib/utils/common.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/utils/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/adler32.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/adler32.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/adler32.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/constants.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/constants.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/constants.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/crc32.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/crc32.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/crc32.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/deflate.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/deflate.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\nvar trees = __webpack_require__(/*! ./trees */ \"./node_modules/pako/lib/zlib/trees.js\");\nvar adler32 = __webpack_require__(/*! ./adler32 */ \"./node_modules/pako/lib/zlib/adler32.js\");\nvar crc32 = __webpack_require__(/*! ./crc32 */ \"./node_modules/pako/lib/zlib/crc32.js\");\nvar msg = __webpack_require__(/*! ./messages */ \"./node_modules/pako/lib/zlib/messages.js\");\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/deflate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/inffast.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/inffast.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/inffast.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/inflate.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/inflate.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\nvar adler32 = __webpack_require__(/*! ./adler32 */ \"./node_modules/pako/lib/zlib/adler32.js\");\nvar crc32 = __webpack_require__(/*! ./crc32 */ \"./node_modules/pako/lib/zlib/crc32.js\");\nvar inflate_fast = __webpack_require__(/*! ./inffast */ \"./node_modules/pako/lib/zlib/inffast.js\");\nvar inflate_table = __webpack_require__(/*! ./inftrees */ \"./node_modules/pako/lib/zlib/inftrees.js\");\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/inflate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/inftrees.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/inftrees.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/inftrees.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/messages.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/messages.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/messages.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/trees.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/trees.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nvar utils = __webpack_require__(/*! ../utils/common */ \"./node_modules/pako/lib/utils/common.js\");\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}\n\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nfunction tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/trees.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pako/lib/zlib/zstream.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pako/lib/zlib/zstream.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n\n\n//# sourceURL=webpack:///./node_modules/pako/lib/zlib/zstream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/parse-numeric-range/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/parse-numeric-range/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function parsePart(str) {\n // just a number\n if(/^-?\\d+$/.test(str)) {\n return parseInt(str, 10);\n }\n var m;\n // 1-5 or 1..5 (equivilant) or 1...5 (doesn't include 5)\n if((m = str.match(/^(-?\\d+)(-|\\.\\.\\.?|\\u2025|\\u2026|\\u22EF)(-?\\d+)$/))) {\n var lhs = m[1];\n var sep = m[2];\n var rhs = m[3];\n if(lhs && rhs) {\n lhs = parseInt(lhs);\n rhs = parseInt(rhs);\n var res = [];\n var incr = lhs < rhs ? 1 : -1;\n\n // Make it inclusive by moving the right 'stop-point' away by one.\n if(sep == '-' || sep == '..' || sep == '\\u2025') {\n rhs += incr;\n }\n\n for(var i=lhs; i != rhs; i += incr) res.push(i);\n return res;\n }\n }\n return [];\n}\n\nmodule.exports.parse = function(str) {\n var parts = str.split(',');\n\n var toFlatten = parts.map(function(el) {\n return parsePart(el);\n });\n\n // reduce can't handle single element arrays\n if(toFlatten.length === 0) return [];\n if(toFlatten.length === 1) {\n if(Array.isArray(toFlatten[0]))\n return toFlatten[0];\n return toFlatten;\n }\n\n return toFlatten.reduce(function(lhs, rhs) {\n if(!Array.isArray(lhs)) lhs = [lhs];\n if(!Array.isArray(rhs)) rhs = [rhs];\n return lhs.concat(rhs);\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/parse-numeric-range/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/parse-torrent/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/parse-torrent/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {/* global Blob */\n\nconst bencode = __webpack_require__(/*! bencode */ \"./node_modules/bencode/lib/index.js\")\nconst blobToBuffer = __webpack_require__(/*! blob-to-buffer */ \"./node_modules/blob-to-buffer/index.js\")\nconst fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\") // browser exclude\nconst get = __webpack_require__(/*! simple-get */ \"./node_modules/simple-get/index.js\")\nconst magnet = __webpack_require__(/*! magnet-uri */ \"./node_modules/magnet-uri/index.js\")\nconst path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\nconst sha1 = __webpack_require__(/*! simple-sha1 */ \"./node_modules/simple-sha1/browser.js\")\nconst uniq = __webpack_require__(/*! uniq */ \"./node_modules/uniq/uniq.js\")\n\nmodule.exports = parseTorrent\nmodule.exports.remote = parseTorrentRemote\n\nmodule.exports.toMagnetURI = magnet.encode\nmodule.exports.toTorrentFile = encodeTorrentFile\n\n/**\n * Parse a torrent identifier (magnet uri, .torrent file, info hash)\n * @param {string|Buffer|Object} torrentId\n * @return {Object}\n */\nfunction parseTorrent (torrentId) {\n if (typeof torrentId === 'string' && /^(stream-)?magnet:/.test(torrentId)) {\n // magnet uri (string)\n return magnet(torrentId)\n } else if (typeof torrentId === 'string' && (/^[a-f0-9]{40}$/i.test(torrentId) || /^[a-z2-7]{32}$/i.test(torrentId))) {\n // info hash (hex/base-32 string)\n return magnet(`magnet:?xt=urn:btih:${torrentId}`)\n } else if (Buffer.isBuffer(torrentId) && torrentId.length === 20) {\n // info hash (buffer)\n return magnet(`magnet:?xt=urn:btih:${torrentId.toString('hex')}`)\n } else if (Buffer.isBuffer(torrentId)) {\n // .torrent file (buffer)\n return decodeTorrentFile(torrentId) // might throw\n } else if (torrentId && torrentId.infoHash) {\n // parsed torrent (from `parse-torrent` or `magnet-uri`)\n torrentId.infoHash = torrentId.infoHash.toLowerCase()\n if (!torrentId.announce) torrentId.announce = []\n if (typeof torrentId.announce === 'string') {\n torrentId.announce = [torrentId.announce]\n }\n if (!torrentId.urlList) torrentId.urlList = []\n return torrentId\n } else {\n throw new Error('Invalid torrent identifier')\n }\n}\n\nfunction parseTorrentRemote (torrentId, cb) {\n let parsedTorrent\n if (typeof cb !== 'function') throw new Error('second argument must be a Function')\n\n try {\n parsedTorrent = parseTorrent(torrentId)\n } catch (err) {\n // If torrent fails to parse, it could be a Blob, http/https URL or\n // filesystem path, so don't consider it an error yet.\n }\n\n if (parsedTorrent && parsedTorrent.infoHash) {\n process.nextTick(() => {\n cb(null, parsedTorrent)\n })\n } else if (isBlob(torrentId)) {\n blobToBuffer(torrentId, (err, torrentBuf) => {\n if (err) return cb(new Error(`Error converting Blob: ${err.message}`))\n parseOrThrow(torrentBuf)\n })\n } else if (typeof get === 'function' && /^https?:/.test(torrentId)) {\n // http, or https url to torrent file\n get.concat({\n url: torrentId,\n timeout: 30 * 1000,\n headers: { 'user-agent': 'WebTorrent (https://webtorrent.io)' }\n }, (err, res, torrentBuf) => {\n if (err) return cb(new Error(`Error downloading torrent: ${err.message}`))\n parseOrThrow(torrentBuf)\n })\n } else if (typeof fs.readFile === 'function' && typeof torrentId === 'string') {\n // assume it's a filesystem path\n fs.readFile(torrentId, (err, torrentBuf) => {\n if (err) return cb(new Error('Invalid torrent identifier'))\n parseOrThrow(torrentBuf)\n })\n } else {\n process.nextTick(() => {\n cb(new Error('Invalid torrent identifier'))\n })\n }\n\n function parseOrThrow (torrentBuf) {\n try {\n parsedTorrent = parseTorrent(torrentBuf)\n } catch (err) {\n return cb(err)\n }\n if (parsedTorrent && parsedTorrent.infoHash) cb(null, parsedTorrent)\n else cb(new Error('Invalid torrent identifier'))\n }\n}\n\n/**\n * Parse a torrent. Throws an exception if the torrent is missing required fields.\n * @param {Buffer|Object} torrent\n * @return {Object} parsed torrent\n */\nfunction decodeTorrentFile (torrent) {\n if (Buffer.isBuffer(torrent)) {\n torrent = bencode.decode(torrent)\n }\n\n // sanity check\n ensure(torrent.info, 'info')\n ensure(torrent.info['name.utf-8'] || torrent.info.name, 'info.name')\n ensure(torrent.info['piece length'], 'info[\\'piece length\\']')\n ensure(torrent.info.pieces, 'info.pieces')\n\n if (torrent.info.files) {\n torrent.info.files.forEach(file => {\n ensure(typeof file.length === 'number', 'info.files[0].length')\n ensure(file['path.utf-8'] || file.path, 'info.files[0].path')\n })\n } else {\n ensure(typeof torrent.info.length === 'number', 'info.length')\n }\n\n const result = {\n info: torrent.info,\n infoBuffer: bencode.encode(torrent.info),\n name: (torrent.info['name.utf-8'] || torrent.info.name).toString(),\n announce: []\n }\n\n result.infoHash = sha1.sync(result.infoBuffer)\n result.infoHashBuffer = Buffer.from(result.infoHash, 'hex')\n\n if (torrent.info.private !== undefined) result.private = !!torrent.info.private\n\n if (torrent['creation date']) result.created = new Date(torrent['creation date'] * 1000)\n if (torrent['created by']) result.createdBy = torrent['created by'].toString()\n\n if (Buffer.isBuffer(torrent.comment)) result.comment = torrent.comment.toString()\n\n // announce and announce-list will be missing if metadata fetched via ut_metadata\n if (Array.isArray(torrent['announce-list']) && torrent['announce-list'].length > 0) {\n torrent['announce-list'].forEach(urls => {\n urls.forEach(url => {\n result.announce.push(url.toString())\n })\n })\n } else if (torrent.announce) {\n result.announce.push(torrent.announce.toString())\n }\n\n // handle url-list (BEP19 / web seeding)\n if (Buffer.isBuffer(torrent['url-list'])) {\n // some clients set url-list to empty string\n torrent['url-list'] = torrent['url-list'].length > 0\n ? [torrent['url-list']]\n : []\n }\n result.urlList = (torrent['url-list'] || []).map(url => url.toString())\n\n uniq(result.announce)\n uniq(result.urlList)\n\n const files = torrent.info.files || [torrent.info]\n result.files = files.map((file, i) => {\n const parts = [].concat(result.name, file['path.utf-8'] || file.path || []).map(p => p.toString())\n return {\n path: path.join.apply(null, [path.sep].concat(parts)).slice(1),\n name: parts[parts.length - 1],\n length: file.length,\n offset: files.slice(0, i).reduce(sumLength, 0)\n }\n })\n\n result.length = files.reduce(sumLength, 0)\n\n const lastFile = result.files[result.files.length - 1]\n\n result.pieceLength = torrent.info['piece length']\n result.lastPieceLength = ((lastFile.offset + lastFile.length) % result.pieceLength) || result.pieceLength\n result.pieces = splitPieces(torrent.info.pieces)\n\n return result\n}\n\n/**\n * Convert a parsed torrent object back into a .torrent file buffer.\n * @param {Object} parsed parsed torrent\n * @return {Buffer}\n */\nfunction encodeTorrentFile (parsed) {\n const torrent = {\n info: parsed.info\n }\n\n torrent['announce-list'] = (parsed.announce || []).map(url => {\n if (!torrent.announce) torrent.announce = url\n url = Buffer.from(url, 'utf8')\n return [url]\n })\n\n torrent['url-list'] = parsed.urlList || []\n\n if (parsed.private !== undefined) {\n torrent['private'] = Number(parsed.private)\n }\n\n if (parsed.created) {\n torrent['creation date'] = (parsed.created.getTime() / 1000) | 0\n }\n\n if (parsed.createdBy) {\n torrent['created by'] = parsed.createdBy\n }\n\n if (parsed.comment) {\n torrent.comment = parsed.comment\n }\n\n return bencode.encode(torrent)\n}\n\n/**\n * Check if `obj` is a W3C `Blob` or `File` object\n * @param {*} obj\n * @return {boolean}\n */\nfunction isBlob (obj) {\n return typeof Blob !== 'undefined' && obj instanceof Blob\n}\n\nfunction sumLength (sum, file) {\n return sum + file.length\n}\n\nfunction splitPieces (buf) {\n const pieces = []\n for (let i = 0; i < buf.length; i += 20) {\n pieces.push(buf.slice(i, i + 20).toString('hex'))\n }\n return pieces\n}\n\nfunction ensure (bool, fieldName) {\n if (!bool) throw new Error(`Torrent is missing required field: ${fieldName}`)\n}\n\n// Workaround Browserify v13 bug\n// https://github.com/substack/node-browserify/issues/1483\n;((() => { Buffer.alloc(0) }))()\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/parse-torrent/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/path-browserify/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/path-browserify/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/path-browserify/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/peer-id/src/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/peer-id/src/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\n * Id is an object representation of a peer Id. a peer Id is a multihash\n */\n\n\n\nconst mh = __webpack_require__(/*! multihashes */ \"./node_modules/multihashes/src/index.js\")\nconst cryptoKeys = __webpack_require__(/*! libp2p-crypto/src/keys */ \"./node_modules/libp2p-crypto/src/keys/index.js\")\nconst assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\")\nconst waterfall = __webpack_require__(/*! async/waterfall */ \"./node_modules/async/waterfall.js\")\nconst withIs = __webpack_require__(/*! class-is */ \"./node_modules/class-is/index.js\")\n\nclass PeerId {\n constructor (id, privKey, pubKey) {\n assert(Buffer.isBuffer(id), 'invalid id provided')\n\n if (privKey && pubKey) {\n assert(privKey.public.bytes.equals(pubKey.bytes), 'inconsistent arguments')\n }\n\n this._id = id\n this._idB58String = mh.toB58String(this.id)\n this._privKey = privKey\n this._pubKey = pubKey\n }\n\n get id () {\n return this._id\n }\n\n set id (val) {\n throw new Error('Id is immutable')\n }\n\n get privKey () {\n return this._privKey\n }\n\n set privKey (privKey) {\n this._privKey = privKey\n }\n\n get pubKey () {\n if (this._pubKey) {\n return this._pubKey\n }\n\n if (this._privKey) {\n return this._privKey.public\n }\n }\n\n set pubKey (pubKey) {\n this._pubKey = pubKey\n }\n\n // Return the protobuf version of the public key, matching go ipfs formatting\n marshalPubKey () {\n if (this.pubKey) {\n return cryptoKeys.marshalPublicKey(this.pubKey)\n }\n }\n\n // Return the protobuf version of the private key, matching go ipfs formatting\n marshalPrivKey () {\n if (this.privKey) {\n return cryptoKeys.marshalPrivateKey(this.privKey)\n }\n }\n\n toPrint () {\n let pid = this.toB58String()\n // All sha256 nodes start with Qm\n // We can skip the Qm to make the peer.ID more useful\n if (pid.startsWith('Qm')) {\n pid = pid.slice(2)\n }\n let maxRunes = 6\n if (pid.length < maxRunes) {\n maxRunes = pid.length\n }\n\n return '<peer.ID ' + pid.substr(0, maxRunes) + '>'\n }\n\n // return the jsonified version of the key, matching the formatting\n // of go-ipfs for its config file\n toJSON () {\n return {\n id: this.toB58String(),\n privKey: toB64Opt(this.marshalPrivKey()),\n pubKey: toB64Opt(this.marshalPubKey())\n }\n }\n\n // encode/decode functions\n toHexString () {\n return mh.toHexString(this.id)\n }\n\n toBytes () {\n return this.id\n }\n\n toB58String () {\n return this._idB58String\n }\n\n isEqual (id) {\n if (Buffer.isBuffer(id)) {\n return this.id.equals(id)\n } else if (id.id) {\n return this.id.equals(id.id)\n } else {\n throw new Error('not valid Id')\n }\n }\n\n /*\n * Check if this PeerId instance is valid (privKey -> pubKey -> Id)\n */\n isValid (callback) {\n // TODO Needs better checking\n if (this.privKey &&\n this.privKey.public &&\n this.privKey.public.bytes &&\n Buffer.isBuffer(this.pubKey.bytes) &&\n this.privKey.public.bytes.equals(this.pubKey.bytes)) {\n callback()\n } else {\n callback(new Error('Keys not match'))\n }\n }\n}\n\nconst PeerIdWithIs = withIs(PeerId, { className: 'PeerId', symbolName: '@libp2p/js-peer-id/PeerId' })\n\nexports = module.exports = PeerIdWithIs\n\n// generation\nexports.create = function (opts, callback) {\n if (typeof opts === 'function') {\n callback = opts\n opts = {}\n }\n opts = opts || {}\n opts.bits = opts.bits || 2048\n\n waterfall([\n (cb) => cryptoKeys.generateKeyPair('RSA', opts.bits, cb),\n (privKey, cb) => privKey.public.hash((err, digest) => {\n cb(err, digest, privKey)\n })\n ], (err, digest, privKey) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new PeerIdWithIs(digest, privKey))\n })\n}\n\nexports.createFromHexString = function (str) {\n return new PeerIdWithIs(mh.fromHexString(str))\n}\n\nexports.createFromBytes = function (buf) {\n return new PeerIdWithIs(buf)\n}\n\nexports.createFromB58String = function (str) {\n return new PeerIdWithIs(mh.fromB58String(str))\n}\n\n// Public Key input will be a buffer\nexports.createFromPubKey = function (key, callback) {\n if (typeof callback !== 'function') {\n throw new Error('callback is required')\n }\n\n let pubKey\n\n try {\n let buf = key\n if (typeof buf === 'string') {\n buf = Buffer.from(key, 'base64')\n }\n\n if (!Buffer.isBuffer(buf)) throw new Error('Supplied key is neither a base64 string nor a buffer')\n\n pubKey = cryptoKeys.unmarshalPublicKey(buf)\n } catch (err) {\n return callback(err)\n }\n\n pubKey.hash((err, digest) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new PeerIdWithIs(digest, null, pubKey))\n })\n}\n\n// Private key input will be a string\nexports.createFromPrivKey = function (key, callback) {\n if (typeof callback !== 'function') {\n throw new Error('callback is required')\n }\n\n let buf = key\n\n try {\n if (typeof buf === 'string') {\n buf = Buffer.from(key, 'base64')\n }\n\n if (!Buffer.isBuffer(buf)) throw new Error('Supplied key is neither a base64 string nor a buffer')\n } catch (err) {\n return callback(err)\n }\n\n waterfall([\n (cb) => cryptoKeys.unmarshalPrivateKey(buf, cb),\n (privKey, cb) => privKey.public.hash((err, digest) => {\n cb(err, digest, privKey)\n })\n ], (err, digest, privKey) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new PeerIdWithIs(digest, privKey, privKey.public))\n })\n}\n\nexports.createFromJSON = function (obj, callback) {\n if (typeof callback !== 'function') {\n throw new Error('callback is required')\n }\n\n let id\n let rawPrivKey\n let rawPubKey\n let pub\n\n try {\n id = mh.fromB58String(obj.id)\n rawPrivKey = obj.privKey && Buffer.from(obj.privKey, 'base64')\n rawPubKey = obj.pubKey && Buffer.from(obj.pubKey, 'base64')\n pub = rawPubKey && cryptoKeys.unmarshalPublicKey(rawPubKey)\n } catch (err) {\n return callback(err)\n }\n\n if (rawPrivKey) {\n waterfall([\n (cb) => cryptoKeys.unmarshalPrivateKey(rawPrivKey, cb),\n (priv, cb) => priv.public.hash((err, digest) => {\n cb(err, digest, priv)\n }),\n (privDigest, priv, cb) => {\n if (pub) {\n pub.hash((err, pubDigest) => {\n cb(err, privDigest, priv, pubDigest)\n })\n } else {\n cb(null, privDigest, priv)\n }\n }\n ], (err, privDigest, priv, pubDigest) => {\n if (err) {\n return callback(err)\n }\n\n if (pub && !privDigest.equals(pubDigest)) {\n return callback(new Error('Public and private key do not match'))\n }\n\n if (id && !privDigest.equals(id)) {\n return callback(new Error('Id and private key do not match'))\n }\n\n callback(null, new PeerIdWithIs(id, priv, pub))\n })\n } else {\n callback(null, new PeerIdWithIs(id, null, pub))\n }\n}\n\nexports.isPeerId = function (peerId) {\n return Boolean(typeof peerId === 'object' &&\n peerId._id &&\n peerId._idB58String)\n}\n\nfunction toB64Opt (val) {\n if (val) {\n return val.toString('base64')\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/peer-id/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/peer-info/src/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/peer-info/src/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst PeerId = __webpack_require__(/*! peer-id */ \"./node_modules/peer-id/src/index.js\")\nconst { ensureMultiaddr } = __webpack_require__(/*! ./utils */ \"./node_modules/peer-info/src/utils.js\")\nconst MultiaddrSet = __webpack_require__(/*! ./multiaddr-set */ \"./node_modules/peer-info/src/multiaddr-set.js\")\nconst assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\")\n\n// Peer represents a peer on the IPFS network\nclass PeerInfo {\n constructor (peerId) {\n assert(peerId, 'Missing peerId. Use Peer.create(cb) to create one')\n\n this.id = peerId\n this.multiaddrs = new MultiaddrSet()\n this.protocols = new Set()\n this._connectedMultiaddr = undefined\n }\n\n // only stores the current multiaddr being used\n connect (ma) {\n ma = ensureMultiaddr(ma)\n if (!this.multiaddrs.has(ma) && ma.toString() !== `/ipfs/${this.id.toB58String()}`) {\n throw new Error('can\\'t be connected to missing multiaddr from set')\n }\n this._connectedMultiaddr = ma\n }\n\n disconnect () {\n this._connectedMultiaddr = undefined\n }\n\n isConnected () {\n return this._connectedMultiaddr\n }\n}\n\nPeerInfo.create = (peerId, callback) => {\n if (typeof peerId === 'function') {\n callback = peerId\n peerId = null\n\n PeerId.create((err, id) => {\n if (err) {\n return callback(err)\n }\n\n callback(null, new PeerInfo(id))\n })\n return\n }\n\n // Already a PeerId instance\n if (typeof peerId.toJSON === 'function') {\n callback(null, new PeerInfo(peerId))\n } else {\n PeerId.createFromJSON(peerId, (err, id) => callback(err, new PeerInfo(id)))\n }\n}\n\nPeerInfo.isPeerInfo = (peerInfo) => {\n return Boolean(typeof peerInfo === 'object' &&\n peerInfo.id &&\n peerInfo.multiaddrs)\n}\n\nmodule.exports = PeerInfo\n\n\n//# sourceURL=webpack:///./node_modules/peer-info/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/peer-info/src/multiaddr-set.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/peer-info/src/multiaddr-set.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { ensureMultiaddr } = __webpack_require__(/*! ./utils */ \"./node_modules/peer-info/src/utils.js\")\nconst uniqBy = __webpack_require__(/*! unique-by */ \"./node_modules/unique-by/index.js\")\n\n// Because JavaScript doesn't let you overload the compare in Set()..\nclass MultiaddrSet {\n constructor (multiaddrs) {\n this._multiaddrs = multiaddrs || []\n this._observedMultiaddrs = []\n }\n\n add (ma) {\n ma = ensureMultiaddr(ma)\n\n if (!this.has(ma)) {\n this._multiaddrs.push(ma)\n }\n }\n\n // addSafe - prevent multiaddr explosion™\n // Multiaddr explosion is when you dial to a bunch of nodes and every node\n // gives you a different observed address and you start storing them all to\n // share with other peers. This seems like a good idea until you realize that\n // most of those addresses are unique to the subnet that peer is in and so,\n // they are completely worthless for all the other peers. This method is\n // exclusively used by identify.\n addSafe (ma) {\n ma = ensureMultiaddr(ma)\n\n const check = this._observedMultiaddrs.some((m, i) => {\n if (m.equals(ma)) {\n this.add(ma)\n this._observedMultiaddrs.splice(i, 1)\n return true\n }\n })\n if (!check) {\n this._observedMultiaddrs.push(ma)\n }\n }\n\n toArray () {\n return this._multiaddrs.slice()\n }\n\n get size () {\n return this._multiaddrs.length\n }\n\n forEach (fn) {\n return this._multiaddrs.forEach(fn)\n }\n\n filterBy (maFmt) {\n if (typeof maFmt !== 'object' ||\n typeof maFmt.matches !== 'function' ||\n typeof maFmt.partialMatch !== 'function' ||\n typeof maFmt.toString !== 'function') return []\n\n return this._multiaddrs.filter((ma) => maFmt.matches(ma))\n }\n\n has (ma) {\n ma = ensureMultiaddr(ma)\n return this._multiaddrs.some((m) => m.equals(ma))\n }\n\n delete (ma) {\n ma = ensureMultiaddr(ma)\n\n this._multiaddrs.some((m, i) => {\n if (m.equals(ma)) {\n this._multiaddrs.splice(i, 1)\n return true\n }\n })\n }\n\n // replaces selected existing multiaddrs with new ones\n replace (existing, fresh) {\n if (!Array.isArray(existing)) {\n existing = [existing]\n }\n if (!Array.isArray(fresh)) {\n fresh = [fresh]\n }\n existing.forEach((m) => this.delete(m))\n fresh.forEach((m) => this.add(m))\n }\n\n clear () {\n this._multiaddrs = []\n }\n\n // this only really helps make ip6 and ip4 multiaddrs distinct if they are\n // different\n // TODO this is not an ideal solution, probably this code should just be\n // in libp2p-tcp\n distinct () {\n return uniqBy(this._multiaddrs, (ma) => {\n return [ma.toOptions().port, ma.toOptions().transport].join()\n })\n }\n}\n\nmodule.exports = MultiaddrSet\n\n\n//# sourceURL=webpack:///./node_modules/peer-info/src/multiaddr-set.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/peer-info/src/utils.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/peer-info/src/utils.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst multiaddr = __webpack_require__(/*! multiaddr */ \"./node_modules/multiaddr/src/index.js\")\n\nfunction ensureMultiaddr (ma) {\n if (multiaddr.isMultiaddr(ma)) {\n return ma\n }\n\n return multiaddr(ma)\n}\n\nmodule.exports = {\n ensureMultiaddr: ensureMultiaddr\n}\n\n\n//# sourceURL=webpack:///./node_modules/peer-info/src/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/performance-now/lib/performance-now.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/performance-now/lib/performance-now.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2\n(function() {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n\n//# sourceMappingURL=performance-now.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/performance-now/lib/performance-now.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/piece-length/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/piece-length/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var closest = __webpack_require__(/*! closest-to */ \"./node_modules/closest-to/index.js\")\nvar kB = Math.pow(2, 10)\n\n// Create a range from 16kb–4mb\nvar p = 13, range = []\nwhile (p++ < 22) range.push(Math.pow(2, p))\n\nmodule.exports = function (bytes) {\n return closest(bytes / kB, range)\n}\n\n\n//# sourceURL=webpack:///./node_modules/piece-length/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/process-nextick-args/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/process-nextick-args/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/process-nextick-args/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/process/browser.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/process/browser.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/process/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/promise/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/promise/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var isPromise = __webpack_require__(/*! is-promise */ \"./node_modules/is-promise/index.js\")\r\n\r\nvar nextTick;\r\nif (typeof setImediate === 'function') nextTick = setImediate\r\nelse if (typeof process === 'object' && process && process.nextTick) nextTick = process.nextTick\r\nelse nextTick = function (cb) { setTimeout(cb, 0) }\r\n\r\nvar extensions = [];\r\n\r\nmodule.exports = Promise\r\nfunction Promise(fn) {\r\n if (!(this instanceof Promise)) {\r\n return typeof fn === 'function' ? new Promise(fn) : defer()\r\n }\r\n var isResolved = false\r\n var isFulfilled = false\r\n var value\r\n var waiting = []\r\n var running = false\r\n\r\n function next(skipTimeout) {\r\n if (waiting.length) {\r\n running = true\r\n waiting.shift()(skipTimeout || false)\r\n } else {\r\n running = false\r\n }\r\n }\r\n this.then = then;\r\n function then(cb, eb) {\r\n return new Promise(function (resolver) {\r\n function done(skipTimeout) {\r\n var callback = isFulfilled ? cb : eb\r\n if (typeof callback === 'function') {\r\n function timeoutDone() {\r\n var val;\r\n try {\r\n val = callback(value)\r\n } catch (ex) {\r\n resolver.reject(ex)\r\n return next()\r\n }\r\n resolver.fulfill(val);\r\n next(true);\r\n }\r\n if (skipTimeout) timeoutDone()\r\n else nextTick(timeoutDone)\r\n } else if (isFulfilled) {\r\n resolver.fulfill(value)\r\n next(skipTimeout)\r\n } else {\r\n resolver.reject(value)\r\n next(skipTimeout)\r\n }\r\n }\r\n waiting.push(done)\r\n if (isResolved && !running) next()\r\n });\r\n }\r\n \r\n (function () {\r\n function fulfill(val) {\r\n if (isResolved) return\r\n if (isPromise(val)) val.then(fulfill, reject)\r\n else {\r\n isResolved = isFulfilled = true\r\n value = val\r\n next()\r\n }\r\n }\r\n function reject(err) {\r\n if (isResolved) return\r\n isResolved = true\r\n isFulfilled = false\r\n value = err\r\n next()\r\n }\r\n var resolver = {fulfill: fulfill, reject: reject};\r\n for (var i = 0; i < extensions.length; i++) {\r\n extensions[i](this, resolver);\r\n }\r\n if (typeof fn === 'function') {\r\n try {\r\n fn(resolver)\r\n } catch (ex) {\r\n resolver.reject(ex);\r\n }\r\n }\r\n }());\r\n}\r\nfunction defer() {\r\n var resolver\r\n var promise = new Promise(function (res) { resolver = res })\r\n return {resolver: resolver, promise: promise}\r\n}\r\nPromise.use = function (extension) {\r\n extensions.push(extension);\r\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/promise/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/promisify-es6/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/promisify-es6/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/** PROMISIFY CALLBACK-STYLE FUNCTIONS TO ES6 PROMISES\r\n*\r\n* EXAMPLE:\r\n* const fn = promisify( (callback) => callback(null, \"Hello world!\") );\r\n* fn((err, str) => console.log(str));\r\n* fn().then((str) => console.log(str));\r\n* //Both functions, will log 'Hello world!'\r\n*\r\n* Note: The function you pass, may have any arguments you want, but the latest\r\n* have to be the callback, which you will call with: next(err, value)\r\n*\r\n* @param method: Function/Array/Map = The function(s) to promisify\r\n* @param options: Map =\r\n* \"context\" (default is function): The context which to apply the called function\r\n* \"replace\" (default is falsy): When passed an array/map, if to replace the original object\r\n*\r\n* @return: A promise if passed a function, otherwise the object with the promises\r\n*\r\n* @license: MIT\r\n* @version: 1.0.3\r\n* @author: Manuel Di Iorio\r\n**/\r\n\r\nvar createCallback = function (method, context) {\r\n return function () {\r\n var args = Array.prototype.slice.call(arguments);\r\n var lastIndex = args.length - 1;\r\n var lastArg = args && args.length > 0 ? args[lastIndex] : null;\r\n var cb = typeof lastArg === 'function' ? lastArg : null;\r\n\r\n if (cb) {\r\n return method.apply(context, args);\r\n }\r\n\r\n return new Promise(function (resolve, reject) {\r\n args.push(function (err, val) {\r\n if (err) return reject(err);\r\n resolve(val);\r\n });\r\n\r\n method.apply(context, args);\r\n });\r\n };\r\n};\r\n\r\nif (false) {} // Browserify this module\r\n\r\nmodule.exports = function (methods, options) {\r\n options = options || {};\r\n var type = Object.prototype.toString.call(methods);\r\n\r\n if (type === \"[object Object]\" || type === \"[object Array]\") {\r\n var obj = options.replace ? methods : {};\r\n\r\n for (var key in methods) {\r\n if (methods.hasOwnProperty(key)) obj[key] = createCallback(methods[key]);\r\n }return obj;\r\n }\r\n\r\n return createCallback(methods, options.context || methods);\r\n};\r\n\r\n// Browserify this module\r\nif (false) {}\r\n\n\n//# sourceURL=webpack:///./node_modules/promisify-es6/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protocol-buffers-schema/index.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/protocol-buffers-schema/index.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var parse = __webpack_require__(/*! ./parse */ \"./node_modules/protocol-buffers-schema/parse.js\")\nvar stringify = __webpack_require__(/*! ./stringify */ \"./node_modules/protocol-buffers-schema/stringify.js\")\n\nmodule.exports = parse\nmodule.exports.parse = parse\nmodule.exports.stringify = stringify\n\n\n//# sourceURL=webpack:///./node_modules/protocol-buffers-schema/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protocol-buffers-schema/parse.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/protocol-buffers-schema/parse.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var tokenize = __webpack_require__(/*! ./tokenize */ \"./node_modules/protocol-buffers-schema/tokenize.js\")\nvar MAX_RANGE = 0x1FFFFFFF\n\n// \"Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared \"packed\".\"\n// https://developers.google.com/protocol-buffers/docs/encoding#optional\nvar PACKABLE_TYPES = [\n // varint wire types\n 'int32', 'int64', 'uint32', 'uint64', 'sint32', 'sint64', 'bool',\n // + ENUMS\n // 64-bit wire types\n 'fixed64', 'sfixed64', 'double',\n // 32-bit wire types\n 'fixed32', 'sfixed32', 'float'\n]\n\nvar onfieldoptions = function (tokens) {\n var opts = {}\n\n while (tokens.length) {\n switch (tokens[0]) {\n case '[':\n case ',':\n tokens.shift()\n var name = tokens.shift()\n if (name === '(') { // handling [(A) = B]\n name = tokens.shift()\n tokens.shift() // remove the end of bracket\n }\n if (tokens[0] !== '=') throw new Error('Unexpected token in field options: ' + tokens[0])\n tokens.shift()\n if (tokens[0] === ']') throw new Error('Unexpected ] in field option')\n opts[name] = tokens.shift()\n break\n case ']':\n tokens.shift()\n return opts\n\n default:\n throw new Error('Unexpected token in field options: ' + tokens[0])\n }\n }\n\n throw new Error('No closing tag for field options')\n}\n\nvar onfield = function (tokens) {\n var field = {\n name: null,\n type: null,\n tag: -1,\n map: null,\n oneof: null,\n required: false,\n repeated: false,\n options: {}\n }\n\n while (tokens.length) {\n switch (tokens[0]) {\n case '=':\n tokens.shift()\n field.tag = Number(tokens.shift())\n break\n\n case 'map':\n field.type = 'map'\n field.map = {from: null, to: null}\n tokens.shift()\n if (tokens[0] !== '<') throw new Error('Unexpected token in map type: ' + tokens[0])\n tokens.shift()\n field.map.from = tokens.shift()\n if (tokens[0] !== ',') throw new Error('Unexpected token in map type: ' + tokens[0])\n tokens.shift()\n field.map.to = tokens.shift()\n if (tokens[0] !== '>') throw new Error('Unexpected token in map type: ' + tokens[0])\n tokens.shift()\n field.name = tokens.shift()\n break\n\n case 'repeated':\n case 'required':\n case 'optional':\n var t = tokens.shift()\n field.required = t === 'required'\n field.repeated = t === 'repeated'\n field.type = tokens.shift()\n field.name = tokens.shift()\n break\n\n case '[':\n field.options = onfieldoptions(tokens)\n break\n\n case ';':\n if (field.name === null) throw new Error('Missing field name')\n if (field.type === null) throw new Error('Missing type in message field: ' + field.name)\n if (field.tag === -1) throw new Error('Missing tag number in message field: ' + field.name)\n tokens.shift()\n return field\n\n default:\n throw new Error('Unexpected token in message field: ' + tokens[0])\n }\n }\n\n throw new Error('No ; found for message field')\n}\n\nvar onmessagebody = function (tokens) {\n var body = {\n enums: [],\n messages: [],\n fields: [],\n extends: [],\n extensions: null\n }\n\n while (tokens.length) {\n switch (tokens[0]) {\n case 'map':\n case 'repeated':\n case 'optional':\n case 'required':\n body.fields.push(onfield(tokens))\n break\n\n case 'enum':\n body.enums.push(onenum(tokens))\n break\n\n case 'message':\n body.messages.push(onmessage(tokens))\n break\n\n case 'extensions':\n body.extensions = onextensions(tokens)\n break\n\n case 'oneof':\n tokens.shift()\n var name = tokens.shift()\n if (tokens[0] !== '{') throw new Error('Unexpected token in oneof: ' + tokens[0])\n tokens.shift()\n while (tokens[0] !== '}') {\n tokens.unshift('optional')\n var field = onfield(tokens)\n field.oneof = name\n body.fields.push(field)\n }\n tokens.shift()\n break\n\n case 'extend':\n body.extends.push(onextend(tokens))\n break\n\n case ';':\n tokens.shift()\n break\n\n case 'reserved':\n case 'option':\n tokens.shift()\n while (tokens[0] !== ';') {\n tokens.shift()\n }\n break\n\n default:\n // proto3 does not require the use of optional/required, assumed as optional\n // \"singular: a well-formed message can have zero or one of this field (but not more than one).\"\n // https://developers.google.com/protocol-buffers/docs/proto3#specifying-field-rules\n tokens.unshift('optional')\n body.fields.push(onfield(tokens))\n }\n }\n\n return body\n}\n\nvar onextend = function (tokens) {\n var out = {\n name: tokens[1],\n message: onmessage(tokens)\n }\n return out\n}\n\nvar onextensions = function (tokens) {\n tokens.shift()\n var from = Number(tokens.shift())\n if (isNaN(from)) throw new Error('Invalid from in extensions definition')\n if (tokens.shift() !== 'to') throw new Error(\"Expected keyword 'to' in extensions definition\")\n var to = tokens.shift()\n if (to === 'max') to = MAX_RANGE\n to = Number(to)\n if (isNaN(to)) throw new Error('Invalid to in extensions definition')\n if (tokens.shift() !== ';') throw new Error('Missing ; in extensions definition')\n return {from: from, to: to}\n}\nvar onmessage = function (tokens) {\n tokens.shift()\n\n var lvl = 1\n var body = []\n var msg = {\n name: tokens.shift(),\n enums: [],\n extends: [],\n messages: [],\n fields: []\n }\n\n if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n tokens.shift()\n\n while (tokens.length) {\n if (tokens[0] === '{') lvl++\n else if (tokens[0] === '}') lvl--\n\n if (!lvl) {\n tokens.shift()\n body = onmessagebody(body)\n msg.enums = body.enums\n msg.messages = body.messages\n msg.fields = body.fields\n msg.extends = body.extends\n msg.extensions = body.extensions\n return msg\n }\n\n body.push(tokens.shift())\n }\n\n if (lvl) throw new Error('No closing tag for message')\n}\n\nvar onpackagename = function (tokens) {\n tokens.shift()\n var name = tokens.shift()\n if (tokens[0] !== ';') throw new Error('Expected ; but found ' + tokens[0])\n tokens.shift()\n return name\n}\n\nvar onsyntaxversion = function (tokens) {\n tokens.shift()\n\n if (tokens[0] !== '=') throw new Error('Expected = but found ' + tokens[0])\n tokens.shift()\n\n var version = tokens.shift()\n switch (version) {\n case '\"proto2\"':\n version = 2\n break\n\n case '\"proto3\"':\n version = 3\n break\n\n default:\n throw new Error('Expected protobuf syntax version but found ' + version)\n }\n\n if (tokens[0] !== ';') throw new Error('Expected ; but found ' + tokens[0])\n tokens.shift()\n\n return version\n}\n\nvar onenumvalue = function (tokens) {\n if (tokens.length < 4) throw new Error('Invalid enum value: ' + tokens.slice(0, 3).join(' '))\n if (tokens[1] !== '=') throw new Error('Expected = but found ' + tokens[1])\n if (tokens[3] !== ';' && tokens[3] !== '[') throw new Error('Expected ; or [ but found ' + tokens[1])\n\n var name = tokens.shift()\n tokens.shift()\n var val = {\n value: null,\n options: {}\n }\n val.value = Number(tokens.shift())\n if (tokens[0] === '[') {\n val.options = onfieldoptions(tokens)\n }\n tokens.shift() // expecting the semicolon here\n\n return {\n name: name,\n val: val\n }\n}\n\nvar onenum = function (tokens) {\n tokens.shift()\n var options = {}\n var e = {\n name: tokens.shift(),\n values: {},\n options: {}\n }\n\n if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n tokens.shift()\n\n while (tokens.length) {\n if (tokens[0] === '}') {\n tokens.shift()\n // there goes optional semicolon after the enclosing \"}\"\n if (tokens[0] === ';') tokens.shift()\n return e\n }\n if (tokens[0] === 'option') {\n options = onoption(tokens)\n e.options[options.name] = options.value\n continue\n }\n var val = onenumvalue(tokens)\n e.values[val.name] = val.val\n }\n\n throw new Error('No closing tag for enum')\n}\n\nvar onoption = function (tokens) {\n var name = null\n var value = null\n\n var parse = function (value) {\n if (value === 'true') return true\n if (value === 'false') return false\n return value.replace(/^\"+|\"+$/gm, '')\n }\n\n while (tokens.length) {\n if (tokens[0] === ';') {\n tokens.shift()\n return {name: name, value: value}\n }\n switch (tokens[0]) {\n case 'option':\n tokens.shift()\n\n var hasBracket = tokens[0] === '('\n if (hasBracket) tokens.shift()\n\n name = tokens.shift()\n\n if (hasBracket) {\n if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n tokens.shift()\n }\n\n if (tokens[0][0] === '.') {\n name += tokens.shift()\n }\n\n break\n\n case '=':\n tokens.shift()\n if (name === null) throw new Error('Expected key for option with value: ' + tokens[0])\n value = parse(tokens.shift())\n\n if (name === 'optimize_for' && !/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value)) {\n throw new Error('Unexpected value for option optimize_for: ' + value)\n } else if (value === '{') {\n // option foo = {bar: baz}\n value = onoptionMap(tokens)\n }\n break\n\n default:\n throw new Error('Unexpected token in option: ' + tokens[0])\n }\n }\n}\n\nvar onoptionMap = function (tokens) {\n var parse = function (value) {\n if (value === 'true') return true\n if (value === 'false') return false\n return value.replace(/^\"+|\"+$/gm, '')\n }\n\n var map = {}\n\n while (tokens.length) {\n if (tokens[0] === '}') {\n tokens.shift()\n return map\n }\n\n var hasBracket = tokens[0] === '('\n if (hasBracket) tokens.shift()\n\n var key = tokens.shift()\n if (hasBracket) {\n if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n tokens.shift()\n }\n\n var value = null\n\n switch (tokens[0]) {\n case ':':\n if (map[key] !== undefined) throw new Error('Duplicate option map key ' + key)\n\n tokens.shift()\n\n value = parse(tokens.shift())\n\n if (value === '{') {\n // option foo = {bar: baz}\n value = onoptionMap(tokens)\n }\n\n map[key] = value\n\n if (tokens[0] === ';') {\n tokens.shift()\n }\n break\n\n case '{':\n tokens.shift()\n value = onoptionMap(tokens)\n\n if (map[key] === undefined) map[key] = []\n if (!Array.isArray(map[key])) throw new Error('Duplicate option map key ' + key)\n\n map[key].push(value)\n break\n\n default:\n throw new Error('Unexpected token in option map: ' + tokens[0])\n }\n }\n\n throw new Error('No closing tag for option map')\n}\n\nvar onimport = function (tokens) {\n tokens.shift()\n var file = tokens.shift().replace(/^\"+|\"+$/gm, '')\n\n if (tokens[0] !== ';') throw new Error('Unexpected token: ' + tokens[0] + '. Expected \";\"')\n\n tokens.shift()\n return file\n}\n\nvar onservice = function (tokens) {\n tokens.shift()\n\n var service = {\n name: tokens.shift(),\n methods: [],\n options: {}\n }\n\n if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n tokens.shift()\n\n while (tokens.length) {\n if (tokens[0] === '}') {\n tokens.shift()\n // there goes optional semicolon after the enclosing \"}\"\n if (tokens[0] === ';') tokens.shift()\n return service\n }\n\n switch (tokens[0]) {\n case 'option':\n var opt = onoption(tokens)\n if (service.options[opt.name] !== undefined) throw new Error('Duplicate option ' + opt.name)\n service.options[opt.name] = opt.value\n break\n case 'rpc':\n service.methods.push(onrpc(tokens))\n break\n default:\n throw new Error('Unexpected token in service: ' + tokens[0])\n }\n }\n\n throw new Error('No closing tag for service')\n}\n\nvar onrpc = function (tokens) {\n tokens.shift()\n\n var rpc = {\n name: tokens.shift(),\n input_type: null,\n output_type: null,\n client_streaming: false,\n server_streaming: false,\n options: {}\n }\n\n if (tokens[0] !== '(') throw new Error('Expected ( but found ' + tokens[0])\n tokens.shift()\n\n if (tokens[0] === 'stream') {\n tokens.shift()\n rpc.client_streaming = true\n }\n\n rpc.input_type = tokens.shift()\n\n if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n tokens.shift()\n\n if (tokens[0] !== 'returns') throw new Error('Expected returns but found ' + tokens[0])\n tokens.shift()\n\n if (tokens[0] !== '(') throw new Error('Expected ( but found ' + tokens[0])\n tokens.shift()\n\n if (tokens[0] === 'stream') {\n tokens.shift()\n rpc.server_streaming = true\n }\n\n rpc.output_type = tokens.shift()\n\n if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n tokens.shift()\n\n if (tokens[0] === ';') {\n tokens.shift()\n return rpc\n }\n\n if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n tokens.shift()\n\n while (tokens.length) {\n if (tokens[0] === '}') {\n tokens.shift()\n // there goes optional semicolon after the enclosing \"}\"\n if (tokens[0] === ';') tokens.shift()\n return rpc\n }\n\n if (tokens[0] === 'option') {\n var opt = onoption(tokens)\n if (rpc.options[opt.name] !== undefined) throw new Error('Duplicate option ' + opt.name)\n rpc.options[opt.name] = opt.value\n } else {\n throw new Error('Unexpected token in rpc options: ' + tokens[0])\n }\n }\n\n throw new Error('No closing tag for rpc')\n}\n\nvar parse = function (buf) {\n var tokens = tokenize(buf.toString())\n // check for isolated strings in tokens by looking for opening quote\n for (var i = 0; i < tokens.length; i++) {\n if (/^(\"|')([^'\"]*)$/.test(tokens[i])) {\n var j\n if (tokens[i].length === 1) {\n j = i + 1\n } else {\n j = i\n }\n // look ahead for the closing quote and collapse all\n // in-between tokens into a single token\n for (j; j < tokens.length; j++) {\n if (/^([^'\"]*)(\"|')$/.test(tokens[j])) {\n tokens = tokens.slice(0, i).concat(tokens.slice(i, j + 1).join('')).concat(tokens.slice(j + 1))\n break\n }\n }\n }\n }\n var schema = {\n syntax: 3,\n package: null,\n imports: [],\n enums: [],\n messages: [],\n options: {},\n extends: []\n }\n\n var firstline = true\n\n while (tokens.length) {\n switch (tokens[0]) {\n case 'package':\n schema.package = onpackagename(tokens)\n break\n\n case 'syntax':\n if (!firstline) throw new Error('Protobuf syntax version should be first thing in file')\n schema.syntax = onsyntaxversion(tokens)\n break\n\n case 'message':\n schema.messages.push(onmessage(tokens))\n break\n\n case 'enum':\n schema.enums.push(onenum(tokens))\n break\n\n case 'option':\n var opt = onoption(tokens)\n if (schema.options[opt.name]) throw new Error('Duplicate option ' + opt.name)\n schema.options[opt.name] = opt.value\n break\n\n case 'import':\n schema.imports.push(onimport(tokens))\n break\n\n case 'extend':\n schema.extends.push(onextend(tokens))\n break\n\n case 'service':\n if (!schema.services) schema.services = []\n schema.services.push(onservice(tokens))\n break\n\n default:\n throw new Error('Unexpected token: ' + tokens[0])\n }\n firstline = false\n }\n\n // now iterate over messages and propagate extends\n schema.extends.forEach(function (ext) {\n schema.messages.forEach(function (msg) {\n if (msg.name === ext.name) {\n ext.message.fields.forEach(function (field) {\n if (!msg.extensions || field.tag < msg.extensions.from || field.tag > msg.extensions.to) {\n throw new Error(msg.name + ' does not declare ' + field.tag + ' as an extension number')\n }\n msg.fields.push(field)\n })\n }\n })\n })\n\n schema.messages.forEach(function (msg) {\n msg.fields.forEach(function (field) {\n var fieldSplit\n var messageName\n var nestedEnumName\n var message\n\n function enumNameIsFieldType (en) {\n return en.name === field.type\n }\n\n function enumNameIsNestedEnumName (en) {\n return en.name === nestedEnumName\n }\n\n if (field.options && field.options.packed === 'true') {\n if (PACKABLE_TYPES.indexOf(field.type) === -1) {\n // let's see if it's an enum\n if (field.type.indexOf('.') === -1) {\n if (msg.enums && msg.enums.some(enumNameIsFieldType)) {\n return\n }\n } else {\n fieldSplit = field.type.split('.')\n if (fieldSplit.length > 2) {\n throw new Error('what is this?')\n }\n\n messageName = fieldSplit[0]\n nestedEnumName = fieldSplit[1]\n\n schema.messages.some(function (msg) {\n if (msg.name === messageName) {\n message = msg\n return msg\n }\n })\n\n if (message && message.enums && message.enums.some(enumNameIsNestedEnumName)) {\n return\n }\n }\n\n throw new Error(\n 'Fields of type ' + field.type + ' cannot be declared [packed=true]. ' +\n 'Only repeated fields of primitive numeric types (types which use ' +\n 'the varint, 32-bit, or 64-bit wire types) can be declared \"packed\". ' +\n 'See https://developers.google.com/protocol-buffers/docs/encoding#optional'\n )\n }\n }\n })\n })\n\n return schema\n}\n\nmodule.exports = parse\n\n\n//# sourceURL=webpack:///./node_modules/protocol-buffers-schema/parse.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protocol-buffers-schema/stringify.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/protocol-buffers-schema/stringify.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var onfield = function (f, result) {\n var prefix = f.repeated ? 'repeated' : f.required ? 'required' : 'optional'\n if (f.type === 'map') prefix = 'map<' + f.map.from + ',' + f.map.to + '>'\n if (f.oneof) prefix = ''\n\n var opts = Object.keys(f.options || {}).map(function (key) {\n return key + ' = ' + f.options[key]\n }).join(',')\n\n if (opts) opts = ' [' + opts + ']'\n\n result.push((prefix ? prefix + ' ' : '') + (f.map === 'map' ? '' : f.type + ' ') + f.name + ' = ' + f.tag + opts + ';')\n return result\n}\n\nvar onmessage = function (m, result) {\n result.push('message ' + m.name + ' {')\n\n if (!m.enums) m.enums = []\n m.enums.forEach(function (e) {\n result.push(onenum(e, []))\n })\n\n if (!m.messages) m.messages = []\n m.messages.forEach(function (m) {\n result.push(onmessage(m, []))\n })\n\n var oneofs = {}\n\n if (!m.fields) m.fields = []\n m.fields.forEach(function (f) {\n if (f.oneof) {\n if (!oneofs[f.oneof]) oneofs[f.oneof] = []\n oneofs[f.oneof].push(onfield(f, []))\n } else {\n result.push(onfield(f, []))\n }\n })\n\n Object.keys(oneofs).forEach(function (n) {\n oneofs[n].unshift('oneof ' + n + ' {')\n oneofs[n].push('}')\n result.push(oneofs[n])\n })\n\n result.push('}', '')\n return result\n}\n\nvar onenum = function (e, result) {\n result.push('enum ' + e.name + ' {')\n if (!e.options) e.options = {}\n var options = onoption(e.options, [])\n if (options.length > 1) {\n result.push(options.slice(0, -1))\n }\n Object.keys(e.values).map(function (v) {\n var val = onenumvalue(e.values[v])\n result.push([v + ' = ' + val + ';'])\n })\n result.push('}', '')\n return result\n}\n\nvar onenumvalue = function (v, result) {\n var opts = Object.keys(v.options || {}).map(function (key) {\n return key + ' = ' + v.options[key]\n }).join(',')\n\n if (opts) opts = ' [' + opts + ']'\n var val = v.value + opts\n return val\n}\n\nvar onoption = function (o, result) {\n var keys = Object.keys(o)\n keys.forEach(function (option) {\n var v = o[option]\n if (~option.indexOf('.')) option = '(' + option + ')'\n\n var type = typeof v\n\n if (type === 'object') {\n v = onoptionMap(v, [])\n if (v.length) result.push('option ' + option + ' = {', v, '};')\n } else {\n if (type === 'string' && option !== 'optimize_for') v = '\"' + v + '\"'\n result.push('option ' + option + ' = ' + v + ';')\n }\n })\n if (keys.length > 0) {\n result.push('')\n }\n\n return result\n}\n\nvar onoptionMap = function (o, result) {\n var keys = Object.keys(o)\n keys.forEach(function (k) {\n var v = o[k]\n\n var type = typeof v\n\n if (type === 'object') {\n if (Array.isArray(v)) {\n v.forEach(function (v) {\n v = onoptionMap(v, [])\n if (v.length) result.push(k + ' {', v, '}')\n })\n } else {\n v = onoptionMap(v, [])\n if (v.length) result.push(k + ' {', v, '}')\n }\n } else {\n if (type === 'string') v = '\"' + v + '\"'\n result.push(k + ': ' + v)\n }\n })\n\n return result\n}\n\nvar onservices = function (s, result) {\n result.push('service ' + s.name + ' {')\n\n if (!s.options) s.options = {}\n onoption(s.options, result)\n if (!s.methods) s.methods = []\n s.methods.forEach(function (m) {\n result.push(onrpc(m, []))\n })\n\n result.push('}', '')\n return result\n}\n\nvar onrpc = function (rpc, result) {\n var def = 'rpc ' + rpc.name + '('\n if (rpc.client_streaming) def += 'stream '\n def += rpc.input_type + ') returns ('\n if (rpc.server_streaming) def += 'stream '\n def += rpc.output_type + ')'\n\n if (!rpc.options) rpc.options = {}\n\n var options = onoption(rpc.options, [])\n if (options.length > 1) {\n result.push(def + ' {', options.slice(0, -1), '}')\n } else {\n result.push(def + ';')\n }\n\n return result\n}\n\nvar indent = function (lvl) {\n return function (line) {\n if (Array.isArray(line)) return line.map(indent(lvl + ' ')).join('\\n')\n return lvl + line\n }\n}\n\nmodule.exports = function (schema) {\n var result = []\n\n result.push('syntax = \"proto' + schema.syntax + '\";', '')\n\n if (schema.package) result.push('package ' + schema.package + ';', '')\n\n if (!schema.options) schema.options = {}\n\n onoption(schema.options, result)\n\n if (!schema.enums) schema.enums = []\n schema.enums.forEach(function (e) {\n onenum(e, result)\n })\n\n if (!schema.messages) schema.messages = []\n schema.messages.forEach(function (m) {\n onmessage(m, result)\n })\n\n if (schema.services) {\n schema.services.forEach(function (s) {\n onservices(s, result)\n })\n }\n return result.map(indent('')).join('\\n')\n}\n\n\n//# sourceURL=webpack:///./node_modules/protocol-buffers-schema/stringify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protocol-buffers-schema/tokenize.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/protocol-buffers-schema/tokenize.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function (sch) {\n var noComments = function (line) {\n var i = line.indexOf('//')\n return i > -1 ? line.slice(0, i) : line\n }\n\n var noMultilineComments = function () {\n var inside = false\n return function (token) {\n if (token === '/*') {\n inside = true\n return false\n }\n if (token === '*/') {\n inside = false\n return false\n }\n return !inside\n }\n }\n\n var trim = function (line) {\n return line.trim()\n }\n\n return sch\n .replace(/([;,{}()=:[\\]<>]|\\/\\*|\\*\\/)/g, ' $1 ')\n .split(/\\n/)\n .map(trim)\n .filter(Boolean)\n .map(noComments)\n .map(trim)\n .filter(Boolean)\n .join('\\n')\n .split(/\\s+|\\n+/gm)\n .filter(noMultilineComments())\n}\n\n\n//# sourceURL=webpack:///./node_modules/protocol-buffers-schema/tokenize.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/compile/decode.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/protons/src/compile/decode.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* eslint max-depth: 1 */\n\n\nvar varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\nvar defined = __webpack_require__(/*! ./utils */ \"./node_modules/protons/src/compile/utils.js\").defined\n\nfunction compileDecode (m, resolve, enc) {\n var requiredFields = []\n var fields = {}\n var oneofFields = []\n var vals = []\n\n for (var i = 0; i < enc.length; i++) {\n var field = m.fields[i]\n\n fields[field.tag] = i\n\n var def = field.options && field.options.default\n var resolved = resolve(field.type, m.id, false)\n vals[i] = [def, resolved && resolved.values]\n\n m.fields[i].packed = field.repeated && field.options && field.options.packed && field.options.packed !== 'false'\n\n if (field.required) {\n requiredFields.push(field.name)\n }\n\n if (field.oneof) {\n oneofFields.push(field.name)\n }\n }\n\n function decodeField (e, field, obj, buf, offset, i) {\n var name = field.name\n\n if (field.oneof) {\n // clear already defined oneof fields\n var props = Object.keys(obj)\n for (var j = 0; j < props.length; j++) {\n if (oneofFields.indexOf(props[j]) > -1) {\n delete obj[props[j]]\n }\n }\n }\n\n if (e.message) {\n var len = varint.decode(buf, offset)\n offset += varint.decode.bytes\n\n var decoded = e.decode(buf, offset, offset + len)\n\n if (field.map) {\n obj[name] = obj[name] || {}\n obj[name][decoded.key] = decoded.value\n } else if (field.repeated) {\n obj[name] = obj[name] || []\n obj[name].push(decoded)\n } else {\n obj[name] = decoded\n }\n } else {\n if (field.repeated) {\n obj[name] = obj[name] || []\n obj[name].push(e.decode(buf, offset))\n } else {\n obj[name] = e.decode(buf, offset)\n }\n }\n\n offset += e.decode.bytes\n return offset\n }\n\n return function decode (buf, offset, end) {\n if (offset == null) {\n offset = 0\n }\n\n if (end == null) {\n end = buf.length\n }\n\n if (!(end <= buf.length && offset <= buf.length)) {\n throw new Error('Decoded message is not valid')\n }\n\n var oldOffset = offset\n var obj = {}\n var field\n\n while (true) {\n if (end <= offset) {\n // finished\n\n // check required methods\n var name = ''\n var j = 0\n for (j = 0; j < requiredFields.length; j++) {\n name = requiredFields[j]\n if (!defined(obj[name])) {\n throw new Error('Decoded message is not valid, missing required field: ' + name)\n }\n }\n\n // fill out missing defaults\n var val\n var def\n for (j = 0; j < enc.length; j++) {\n field = m.fields[j]\n def = vals[j][0]\n val = vals[j][1]\n name = field.name\n\n if (defined(obj[name])) {\n continue\n }\n\n var done = false\n if (field.oneof) {\n var props = Object.keys(obj)\n for (var k = 0; k < props.length; k++) {\n if (oneofFields.indexOf(props[k]) > -1) {\n done = true\n break\n }\n }\n }\n\n if (done) {\n continue\n }\n\n if (val) { // is enum\n if (field.repeated) {\n obj[name] = []\n } else {\n def = (def && val[def]) ? val[def].value : val[Object.keys(val)[0]].value\n obj[name] = parseInt(def || 0, 10)\n }\n } else {\n obj[name] = defaultValue(field, def)\n }\n }\n\n decode.bytes = offset - oldOffset\n return obj\n }\n\n var prefix = varint.decode(buf, offset)\n offset += varint.decode.bytes\n var tag = prefix >> 3\n\n var i = fields[tag]\n\n if (i == null) {\n offset = skip(prefix & 7, buf, offset)\n continue\n }\n\n var e = enc[i]\n field = m.fields[i]\n\n if (field.packed) {\n var packedEnd = varint.decode(buf, offset)\n offset += varint.decode.bytes\n packedEnd += offset\n\n while (offset < packedEnd) {\n offset = decodeField(e, field, obj, buf, offset, i)\n }\n } else {\n offset = decodeField(e, field, obj, buf, offset, i)\n }\n }\n }\n}\n\nvar skip = function (type, buffer, offset) {\n switch (type) {\n case 0:\n varint.decode(buffer, offset)\n return offset + varint.decode.bytes\n\n case 1:\n return offset + 8\n\n case 2:\n var len = varint.decode(buffer, offset)\n return offset + varint.decode.bytes + len\n\n case 3:\n case 4:\n throw new Error('Groups are not supported')\n\n case 5:\n return offset + 4\n default:\n throw new Error('Unknown wire type: ' + type)\n }\n}\n\nvar defaultValue = function (f, def) {\n if (f.map) return {}\n if (f.repeated) return []\n\n switch (f.type) {\n case 'string':\n return def != null ? def : ''\n\n case 'bool':\n return def === 'true'\n\n case 'float':\n case 'double':\n case 'sfixed32':\n case 'fixed32':\n case 'varint':\n case 'enum':\n case 'uint64':\n case 'uint32':\n case 'int64':\n case 'int32':\n case 'sint64':\n case 'sint32':\n return parseInt(def || 0, 10)\n\n default:\n return null\n }\n}\n\nmodule.exports = compileDecode\n\n\n//# sourceURL=webpack:///./node_modules/protons/src/compile/decode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/compile/encode.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/protons/src/compile/encode.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar defined = __webpack_require__(/*! ./utils */ \"./node_modules/protons/src/compile/utils.js\").defined\nvar varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\nfunction compileEncode (m, resolve, enc, oneofs, encodingLength) {\n var oneofsKeys = Object.keys(oneofs)\n var encLength = enc.length\n var ints = {}\n for (var i = 0; i < encLength; i++) {\n ints[i] = {\n p: varint.encode(m.fields[i].tag << 3 | 2),\n h: varint.encode(m.fields[i].tag << 3 | enc[i].type)\n }\n\n var field = m.fields[i]\n m.fields[i].packed = field.repeated && field.options && field.options.packed && field.options.packed !== 'false'\n }\n\n function encodeField (buf, offset, h, e, packed, innerVal) {\n var j = 0\n if (!packed) {\n for (j = 0; j < h.length; j++) {\n buf[offset++] = h[j]\n }\n }\n\n if (e.message) {\n varint.encode(e.encodingLength(innerVal), buf, offset)\n offset += varint.encode.bytes\n }\n\n e.encode(innerVal, buf, offset)\n return offset + e.encode.bytes\n }\n\n return function encode (obj, buf, offset) {\n if (offset == null) {\n offset = 0\n }\n if (buf == null) {\n buf = Buffer.allocUnsafe(encodingLength(obj))\n }\n\n var oldOffset = offset\n var objKeys = Object.keys(obj)\n var i = 0\n\n // oneof checks\n\n var match = false\n for (i = 0; i < oneofsKeys.length; i++) {\n var name = oneofsKeys[i]\n var prop = oneofs[i]\n if (objKeys.indexOf(prop) > -1) {\n if (match) {\n throw new Error('only one of the properties defined in oneof ' + name + ' can be set')\n }\n\n match = true\n }\n }\n\n for (i = 0; i < encLength; i++) {\n var e = enc[i]\n var field = m.fields[i] // was f\n var val = obj[field.name]\n var j = 0\n\n if (!defined(val)) {\n if (field.required) {\n throw new Error(field.name + ' is required')\n }\n continue\n }\n var p = ints[i].p\n var h = ints[i].h\n\n var packed = field.packed\n\n if (field.map) {\n var tmp = Object.keys(val)\n for (j = 0; j < tmp.length; j++) {\n tmp[j] = {\n key: tmp[j],\n value: val[tmp[j]]\n }\n }\n val = tmp\n }\n\n if (packed) {\n var packedLen = 0\n for (j = 0; j < val.length; j++) {\n if (!defined(val[j])) {\n continue\n }\n\n packedLen += e.encodingLength(val[j])\n }\n\n if (packedLen) {\n for (j = 0; j < h.length; j++) {\n buf[offset++] = p[j]\n }\n varint.encode(packedLen, buf, offset)\n offset += varint.encode.bytes\n }\n }\n\n if (field.repeated) {\n var innerVal\n for (j = 0; j < val.length; j++) {\n innerVal = val[j]\n if (!defined(innerVal)) {\n continue\n }\n offset = encodeField(buf, offset, h, e, packed, innerVal)\n }\n } else {\n offset = encodeField(buf, offset, h, e, packed, val)\n }\n }\n\n encode.bytes = offset - oldOffset\n return buf\n }\n}\n\nmodule.exports = compileEncode\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/protons/src/compile/encode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/compile/encoding-length.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/protons/src/compile/encoding-length.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar defined = __webpack_require__(/*! ./utils */ \"./node_modules/protons/src/compile/utils.js\").defined\nvar varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\nfunction compileEncodingLength (m, enc, oneofs) {\n var oneofsKeys = Object.keys(oneofs)\n var encLength = enc.length\n\n var hls = new Array(encLength)\n\n for (var i = 0; i < m.fields.length; i++) {\n hls[i] = varint.encodingLength(m.fields[i].tag << 3 | enc[i].type)\n\n var field = m.fields[i]\n m.fields[i].packed = field.repeated && field.options && field.options.packed && field.options.packed !== 'false'\n }\n\n return function encodingLength (obj) {\n var length = 0\n var i = 0\n var j = 0\n\n for (i = 0; i < oneofsKeys.length; i++) {\n var name = oneofsKeys[i]\n var props = oneofs[name]\n\n var match = false\n for (j = 0; j < props.length; j++) {\n if (defined(obj[props[j]])) {\n if (match) {\n throw new Error('only one of the properties defined in oneof ' + name + ' can be set')\n }\n match = true\n }\n }\n }\n\n for (i = 0; i < encLength; i++) {\n var e = enc[i]\n var field = m.fields[i]\n var val = obj[field.name]\n var hl = hls[i]\n var len\n\n if (!defined(val)) {\n if (field.required) {\n throw new Error(field.name + ' is required')\n }\n\n continue\n }\n\n if (field.map) {\n var tmp = Object.keys(val)\n for (j = 0; j < tmp.length; j++) {\n tmp[j] = {\n key: tmp[j],\n value: val[tmp[j]]\n }\n }\n\n val = tmp\n }\n\n if (field.packed) {\n var packedLen = 0\n for (j = 0; j < val.length; j++) {\n if (!defined(val[j])) {\n continue\n }\n len = e.encodingLength(val[j])\n packedLen += len\n\n if (e.message) {\n packedLen += varint.encodingLength(len)\n }\n }\n\n if (packedLen) {\n length += hl + packedLen + varint.encodingLength(packedLen)\n }\n } else if (field.repeated) {\n for (j = 0; j < val.length; j++) {\n if (!defined(val[j])) {\n continue\n }\n\n len = e.encodingLength(val[j])\n length += hl + len + (e.message ? varint.encodingLength(len) : 0)\n }\n } else {\n len = e.encodingLength(val)\n length += hl + len + (e.message ? varint.encodingLength(len) : 0)\n }\n }\n\n return length\n }\n}\n\nmodule.exports = compileEncodingLength\n\n\n//# sourceURL=webpack:///./node_modules/protons/src/compile/encoding-length.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/compile/encodings.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/protons/src/compile/encodings.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\nvar svarint = __webpack_require__(/*! signed-varint */ \"./node_modules/signed-varint/index.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar encoder = function (type, encode, decode, encodingLength) {\n encode.bytes = decode.bytes = 0\n\n return {\n type: type,\n encode: encode,\n decode: decode,\n encodingLength: encodingLength\n }\n}\n\nexports.make = encoder\n\nexports.bytes = (function (tag) {\n var bufferLength = function (val) {\n return Buffer.isBuffer(val) ? val.length : Buffer.byteLength(val)\n }\n\n var encodingLength = function (val) {\n var len = bufferLength(val)\n return varint.encodingLength(len) + len\n }\n\n var encode = function (val, buffer, offset) {\n var oldOffset = offset\n var len = bufferLength(val)\n\n varint.encode(len, buffer, offset)\n offset += varint.encode.bytes\n\n if (Buffer.isBuffer(val)) val.copy(buffer, offset)\n else buffer.write(val, offset, len)\n offset += len\n\n encode.bytes = offset - oldOffset\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var oldOffset = offset\n\n var len = varint.decode(buffer, offset)\n offset += varint.decode.bytes\n\n var val = buffer.slice(offset, offset + len)\n offset += val.length\n\n decode.bytes = offset - oldOffset\n return val\n }\n\n return encoder(2, encode, decode, encodingLength)\n})()\n\nexports.string = (function () {\n var encodingLength = function (val) {\n var len = Buffer.byteLength(val)\n return varint.encodingLength(len) + len\n }\n\n var encode = function (val, buffer, offset) {\n var oldOffset = offset\n var len = Buffer.byteLength(val)\n\n varint.encode(len, buffer, offset, 'utf-8')\n offset += varint.encode.bytes\n\n buffer.write(val, offset, len)\n offset += len\n\n encode.bytes = offset - oldOffset\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var oldOffset = offset\n\n var len = varint.decode(buffer, offset)\n offset += varint.decode.bytes\n\n var val = buffer.toString('utf-8', offset, offset + len)\n offset += len\n\n decode.bytes = offset - oldOffset\n return val\n }\n\n return encoder(2, encode, decode, encodingLength)\n})()\n\nexports.bool = (function () {\n var encodingLength = function (val) {\n return 1\n }\n\n var encode = function (val, buffer, offset) {\n buffer[offset] = val ? 1 : 0\n encode.bytes = 1\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var bool = buffer[offset] > 0\n decode.bytes = 1\n return bool\n }\n\n return encoder(0, encode, decode, encodingLength)\n})()\n\nexports.int32 = (function () {\n var decode = function (buffer, offset) {\n var val = varint.decode(buffer, offset)\n decode.bytes = varint.decode.bytes\n return val > 2147483647 ? val - 4294967296 : val\n }\n\n var encode = function (val, buffer, offset) {\n varint.encode(val < 0 ? val + 4294967296 : val, buffer, offset)\n encode.bytes = varint.encode.bytes\n return buffer\n }\n\n var encodingLength = function (val) {\n return varint.encodingLength(val < 0 ? val + 4294967296 : val)\n }\n\n return encoder(0, varint.encode, decode, encodingLength)\n})()\n\nexports.int64 = (function () {\n var decode = function (buffer, offset) {\n var val = varint.decode(buffer, offset)\n if (val >= Math.pow(2, 63)) {\n var limit = 9\n while (buffer[offset + limit - 1] === 0xff) limit--\n limit = limit || 9\n var subset = Buffer.allocUnsafe(limit)\n buffer.copy(subset, 0, offset, offset + limit)\n subset[limit - 1] = subset[limit - 1] & 0x7f\n val = -1 * varint.decode(subset, 0)\n decode.bytes = 10\n } else {\n decode.bytes = varint.decode.bytes\n }\n return val\n }\n\n var encode = function (val, buffer, offset) {\n if (val < 0) {\n var last = offset + 9\n varint.encode(val * -1, buffer, offset)\n offset += varint.encode.bytes - 1\n buffer[offset] = buffer[offset] | 0x80\n while (offset < last - 1) {\n offset++\n buffer[offset] = 0xff\n }\n buffer[last] = 0x01\n encode.bytes = 10\n } else {\n varint.encode(val, buffer, offset)\n encode.bytes = varint.encode.bytes\n }\n return buffer\n }\n\n var encodingLength = function (val) {\n return val < 0 ? 10 : varint.encodingLength(val)\n }\n\n return encoder(0, encode, decode, encodingLength)\n})()\n\nexports.sint32 =\nexports.sint64 = (function () {\n return encoder(0, svarint.encode, svarint.decode, svarint.encodingLength)\n})()\n\nexports.uint32 =\nexports.uint64 =\nexports.enum =\nexports.varint = (function () {\n return encoder(0, varint.encode, varint.decode, varint.encodingLength)\n})()\n\n// we cannot represent these in javascript so we just use buffers\nexports.fixed64 =\nexports.sfixed64 = (function () {\n var encodingLength = function (val) {\n return 8\n }\n\n var encode = function (val, buffer, offset) {\n val.copy(buffer, offset)\n encode.bytes = 8\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var val = buffer.slice(offset, offset + 8)\n decode.bytes = 8\n return val\n }\n\n return encoder(1, encode, decode, encodingLength)\n})()\n\nexports.double = (function () {\n var encodingLength = function (val) {\n return 8\n }\n\n var encode = function (val, buffer, offset) {\n buffer.writeDoubleLE(val, offset)\n encode.bytes = 8\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var val = buffer.readDoubleLE(offset)\n decode.bytes = 8\n return val\n }\n\n return encoder(1, encode, decode, encodingLength)\n})()\n\nexports.fixed32 = (function () {\n var encodingLength = function (val) {\n return 4\n }\n\n var encode = function (val, buffer, offset) {\n buffer.writeUInt32LE(val, offset)\n encode.bytes = 4\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var val = buffer.readUInt32LE(offset)\n decode.bytes = 4\n return val\n }\n\n return encoder(5, encode, decode, encodingLength)\n})()\n\nexports.sfixed32 = (function () {\n var encodingLength = function (val) {\n return 4\n }\n\n var encode = function (val, buffer, offset) {\n buffer.writeInt32LE(val, offset)\n encode.bytes = 4\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var val = buffer.readInt32LE(offset)\n decode.bytes = 4\n return val\n }\n\n return encoder(5, encode, decode, encodingLength)\n})()\n\nexports.float = (function () {\n var encodingLength = function (val) {\n return 4\n }\n\n var encode = function (val, buffer, offset) {\n buffer.writeFloatLE(val, offset)\n encode.bytes = 4\n return buffer\n }\n\n var decode = function (buffer, offset) {\n var val = buffer.readFloatLE(offset)\n decode.bytes = 4\n return val\n }\n\n return encoder(5, encode, decode, encodingLength)\n})()\n\n\n//# sourceURL=webpack:///./node_modules/protons/src/compile/encodings.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/compile/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/protons/src/compile/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar encodings = __webpack_require__(/*! ./encodings */ \"./node_modules/protons/src/compile/encodings.js\")\nvar compileDecode = __webpack_require__(/*! ./decode */ \"./node_modules/protons/src/compile/decode.js\")\nvar compileEncode = __webpack_require__(/*! ./encode */ \"./node_modules/protons/src/compile/encode.js\")\nvar compileEncodingLength = __webpack_require__(/*! ./encoding-length */ \"./node_modules/protons/src/compile/encoding-length.js\")\nvar varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\n\nvar flatten = function (values) {\n if (!values) return null\n var result = {}\n Object.keys(values).forEach(function (k) {\n result[k] = values[k].value\n })\n return result\n}\n\nmodule.exports = function (schema, extraEncodings) {\n var messages = {}\n var enums = {}\n var cache = {}\n\n var visit = function (schema, prefix) {\n if (schema.enums) {\n schema.enums.forEach(function (e) {\n e.id = prefix + (prefix ? '.' : '') + e.name\n enums[e.id] = e\n visit(e, e.id)\n })\n }\n if (schema.messages) {\n schema.messages.forEach(function (m) {\n m.id = prefix + (prefix ? '.' : '') + m.name\n messages[m.id] = m\n m.fields.forEach(function (f) {\n if (!f.map) return\n\n var name = 'Map_' + f.map.from + '_' + f.map.to\n var map = {\n name: name,\n enums: [],\n messages: [],\n fields: [{\n name: 'key',\n type: f.map.from,\n tag: 1,\n repeated: false,\n required: true\n }, {\n name: 'value',\n type: f.map.to,\n tag: 2,\n repeated: false,\n required: false\n }],\n extensions: null,\n id: prefix + (prefix ? '.' : '') + name\n }\n\n if (!messages[map.id]) {\n messages[map.id] = map\n schema.messages.push(map)\n }\n f.type = name\n f.repeated = true\n })\n visit(m, m.id)\n })\n }\n }\n\n visit(schema, '')\n\n var compileEnum = function (e) {\n var values = Object.keys(e.values || []).map(function (k) {\n return parseInt(e.values[k].value, 10)\n })\n\n var encode = function encode (val, buf, offset) {\n if (!values.length || values.indexOf(val) === -1) {\n throw new Error('Invalid enum value: ' + val)\n }\n varint.encode(val, buf, offset)\n encode.bytes = varint.encode.bytes\n return buf\n }\n\n var decode = function decode (buf, offset) {\n var val = varint.decode(buf, offset)\n if (!values.length || values.indexOf(val) === -1) {\n throw new Error('Invalid enum value: ' + val)\n }\n decode.bytes = varint.decode.bytes\n return val\n }\n\n return encodings.make(0, encode, decode, varint.encodingLength)\n }\n\n var compileMessage = function (m, exports) {\n m.messages.forEach(function (nested) {\n exports[nested.name] = resolve(nested.name, m.id)\n })\n\n m.enums.forEach(function (val) {\n exports[val.name] = flatten(val.values)\n })\n\n exports.type = 2\n exports.message = true\n exports.name = m.name\n\n var oneofs = {}\n\n m.fields.forEach(function (f) {\n if (!f.oneof) return\n if (!oneofs[f.oneof]) oneofs[f.oneof] = []\n oneofs[f.oneof].push(f.name)\n })\n\n var enc = m.fields.map(function (f) {\n return resolve(f.type, m.id)\n })\n\n var encodingLength = compileEncodingLength(m, enc, oneofs)\n var encode = compileEncode(m, resolve, enc, oneofs, encodingLength)\n var decode = compileDecode(m, resolve, enc)\n\n // end of compilation - return all the things\n\n encode.bytes = decode.bytes = 0\n\n exports.buffer = true\n exports.encode = encode\n exports.decode = decode\n exports.encodingLength = encodingLength\n\n return exports\n }\n\n var resolve = function (name, from, compile) {\n if (extraEncodings && extraEncodings[name]) return extraEncodings[name]\n if (encodings[name]) return encodings[name]\n\n var m = (from ? from + '.' + name : name).split('.')\n .map(function (part, i, list) {\n return list.slice(0, i).concat(name).join('.')\n })\n .reverse()\n .reduce(function (result, id) {\n return result || messages[id] || enums[id]\n }, null)\n\n if (compile === false) return m\n if (!m) throw new Error('Could not resolve ' + name)\n\n if (m.values) return compileEnum(m)\n var res = cache[m.id] || compileMessage(m, cache[m.id] = {})\n return res\n }\n\n return (schema.enums || []).concat((schema.messages || []).map(function (message) {\n return resolve(message.id)\n }))\n}\n\n\n//# sourceURL=webpack:///./node_modules/protons/src/compile/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/compile/utils.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/protons/src/compile/utils.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nexports.defined = function (val) {\n return val !== null && val !== undefined && (typeof val !== 'number' || !isNaN(val))\n}\n\n\n//# sourceURL=webpack:///./node_modules/protons/src/compile/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/protons/src/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/protons/src/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar schema = __webpack_require__(/*! protocol-buffers-schema */ \"./node_modules/protocol-buffers-schema/index.js\")\nvar compile = __webpack_require__(/*! ./compile */ \"./node_modules/protons/src/compile/index.js\")\n\nvar flatten = function (values) {\n if (!values) return null\n var result = {}\n Object.keys(values).forEach(function (k) {\n result[k] = values[k].value\n })\n return result\n}\n\nmodule.exports = function (proto, opts) {\n if (!opts) opts = {}\n if (!proto) throw new Error('Pass in a .proto string or a protobuf-schema parsed object')\n\n var sch = (typeof proto === 'object' && !Buffer.isBuffer(proto)) ? proto : schema.parse(proto)\n\n // to not make toString,toJSON enumarable we make a fire-and-forget prototype\n var Messages = function () {\n var self = this\n\n compile(sch, opts.encodings || {}).forEach(function (m) {\n self[m.name] = flatten(m.values) || m\n })\n }\n\n Messages.prototype.toString = function () {\n return schema.stringify(sch)\n }\n\n Messages.prototype.toJSON = function () {\n return sch\n }\n\n return new Messages()\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/protons/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/psl/data/rules.json":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/psl/data/rules.json ***!
|
||
\******************************************/
|
||
/*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754, 3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360, 5361, 5362, 5363, 5364, 5365, 5366, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 5456, 5457, 5458, 5459, 5460, 5461, 5462, 5463, 5464, 5465, 5466, 5467, 5468, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5479, 5480, 5481, 5482, 5483, 5484, 5485, 5486, 5487, 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, 5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, 5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, 5567, 5568, 5569, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, 5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, 5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609, 5610, 5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639, 5640, 5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649, 5650, 5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, 5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699, 5700, 5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759, 5760, 5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769, 5770, 5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779, 5780, 5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, 5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5856, 5857, 5858, 5859, 5860, 5861, 5862, 5863, 5864, 5865, 5866, 5867, 5868, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5876, 5877, 5878, 5879, 5880, 5881, 5882, 5883, 5884, 5885, 5886, 5887, 5888, 5889, 5890, 5891, 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, 5904, 5905, 5906, 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 5927, 5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6296, 6297, 6298, 6299, 6300, 6301, 6302, 6303, 6304, 6305, 6306, 6307, 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6344, 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6380, 6381, 6382, 6383, 6384, 6385, 6386, 6387, 6388, 6389, 6390, 6391, 6392, 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, 6401, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 6467, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, 6487, 6488, 6489, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 6497, 6498, 6499, 6500, 6501, 6502, 6503, 6504, 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, 6521, 6522, 6523, 6524, 6525, 6526, 6527, 6528, 6529, 6530, 6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540, 6541, 6542, 6543, 6544, 6545, 6546, 6547, 6548, 6549, 6550, 6551, 6552, 6553, 6554, 6555, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593, 6594, 6595, 6596, 6597, 6598, 6599, 6600, 6601, 6602, 6603, 6604, 6605, 6606, 6607, 6608, 6609, 6610, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 6622, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 6640, 6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 6707, 6708, 6709, 6710, 6711, 6712, 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, 6724, 6725, 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833, 6834, 6835, 6836, 6837, 6838, 6839, 6840, 6841, 6842, 6843, 6844, 6845, 6846, 6847, 6848, 6849, 6850, 6851, 6852, 6853, 6854, 6855, 6856, 6857, 6858, 6859, 6860, 6861, 6862, 6863, 6864, 6865, 6866, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6879, 6880, 6881, 6882, 6883, 6884, 6885, 6886, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 6979, 6980, 6981, 6982, 6983, 6984, 6985, 6986, 6987, 6988, 6989, 6990, 6991, 6992, 6993, 6994, 6995, 6996, 6997, 6998, 6999, 7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020, 7021, 7022, 7023, 7024, 7025, 7026, 7027, 7028, 7029, 7030, 7031, 7032, 7033, 7034, 7035, 7036, 7037, 7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, 7054, 7055, 7056, 7057, 7058, 7059, 7060, 7061, 7062, 7063, 7064, 7065, 7066, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7091, 7092, 7093, 7094, 7095, 7096, 7097, 7098, 7099, 7100, 7101, 7102, 7103, 7104, 7105, 7106, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130, 7131, 7132, 7133, 7134, 7135, 7136, 7137, 7138, 7139, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7153, 7154, 7155, 7156, 7157, 7158, 7159, 7160, 7161, 7162, 7163, 7164, 7165, 7166, 7167, 7168, 7169, 7170, 7171, 7172, 7173, 7174, 7175, 7176, 7177, 7178, 7179, 7180, 7181, 7182, 7183, 7184, 7185, 7186, 7187, 7188, 7189, 7190, 7191, 7192, 7193, 7194, 7195, 7196, 7197, 7198, 7199, 7200, 7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 7220, 7221, 7222, 7223, 7224, 7225, 7226, 7227, 7228, 7229, 7230, 7231, 7232, 7233, 7234, 7235, 7236, 7237, 7238, 7239, 7240, 7241, 7242, 7243, 7244, 7245, 7246, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255, 7256, 7257, 7258, 7259, 7260, 7261, 7262, 7263, 7264, 7265, 7266, 7267, 7268, 7269, 7270, 7271, 7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281, 7282, 7283, 7284, 7285, 7286, 7287, 7288, 7289, 7290, 7291, 7292, 7293, 7294, 7295, 7296, 7297, 7298, 7299, 7300, 7301, 7302, 7303, 7304, 7305, 7306, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 7323, 7324, 7325, 7326, 7327, 7328, 7329, 7330, 7331, 7332, 7333, 7334, 7335, 7336, 7337, 7338, 7339, 7340, 7341, 7342, 7343, 7344, 7345, 7346, 7347, 7348, 7349, 7350, 7351, 7352, 7353, 7354, 7355, 7356, 7357, 7358, 7359, 7360, 7361, 7362, 7363, 7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384, 7385, 7386, 7387, 7388, 7389, 7390, 7391, 7392, 7393, 7394, 7395, 7396, 7397, 7398, 7399, 7400, 7401, 7402, 7403, 7404, 7405, 7406, 7407, 7408, 7409, 7410, 7411, 7412, 7413, 7414, 7415, 7416, 7417, 7418, 7419, 7420, 7421, 7422, 7423, 7424, 7425, 7426, 7427, 7428, 7429, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 7437, 7438, 7439, 7440, 7441, 7442, 7443, 7444, 7445, 7446, 7447, 7448, 7449, 7450, 7451, 7452, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 7474, 7475, 7476, 7477, 7478, 7479, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 7496, 7497, 7498, 7499, 7500, 7501, 7502, 7503, 7504, 7505, 7506, 7507, 7508, 7509, 7510, 7511, 7512, 7513, 7514, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 7527, 7528, 7529, 7530, 7531, 7532, 7533, 7534, 7535, 7536, 7537, 7538, 7539, 7540, 7541, 7542, 7543, 7544, 7545, 7546, 7547, 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564, 7565, 7566, 7567, 7568, 7569, 7570, 7571, 7572, 7573, 7574, 7575, 7576, 7577, 7578, 7579, 7580, 7581, 7582, 7583, 7584, 7585, 7586, 7587, 7588, 7589, 7590, 7591, 7592, 7593, 7594, 7595, 7596, 7597, 7598, 7599, 7600, 7601, 7602, 7603, 7604, 7605, 7606, 7607, 7608, 7609, 7610, 7611, 7612, 7613, 7614, 7615, 7616, 7617, 7618, 7619, 7620, 7621, 7622, 7623, 7624, 7625, 7626, 7627, 7628, 7629, 7630, 7631, 7632, 7633, 7634, 7635, 7636, 7637, 7638, 7639, 7640, 7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7654, 7655, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674, 7675, 7676, 7677, 7678, 7679, 7680, 7681, 7682, 7683, 7684, 7685, 7686, 7687, 7688, 7689, 7690, 7691, 7692, 7693, 7694, 7695, 7696, 7697, 7698, 7699, 7700, 7701, 7702, 7703, 7704, 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723, 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742, 7743, 7744, 7745, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7772, 7773, 7774, 7775, 7776, 7777, 7778, 7779, 7780, 7781, 7782, 7783, 7784, 7785, 7786, 7787, 7788, 7789, 7790, 7791, 7792, 7793, 7794, 7795, 7796, 7797, 7798, 7799, 7800, 7801, 7802, 7803, 7804, 7805, 7806, 7807, 7808, 7809, 7810, 7811, 7812, 7813, 7814, 7815, 7816, 7817, 7818, 7819, 7820, 7821, 7822, 7823, 7824, 7825, 7826, 7827, 7828, 7829, 7830, 7831, 7832, 7833, 7834, 7835, 7836, 7837, 7838, 7839, 7840, 7841, 7842, 7843, 7844, 7845, 7846, 7847, 7848, 7849, 7850, 7851, 7852, 7853, 7854, 7855, 7856, 7857, 7858, 7859, 7860, 7861, 7862, 7863, 7864, 7865, 7866, 7867, 7868, 7869, 7870, 7871, 7872, 7873, 7874, 7875, 7876, 7877, 7878, 7879, 7880, 7881, 7882, 7883, 7884, 7885, 7886, 7887, 7888, 7889, 7890, 7891, 7892, 7893, 7894, 7895, 7896, 7897, 7898, 7899, 7900, 7901, 7902, 7903, 7904, 7905, 7906, 7907, 7908, 7909, 7910, 7911, 7912, 7913, 7914, 7915, 7916, 7917, 7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129, 8130, 8131, 8132, 8133, 8134, 8135, 8136, 8137, 8138, 8139, 8140, 8141, 8142, 8143, 8144, 8145, 8146, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8212, 8213, 8214, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8223, 8224, 8225, 8226, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 8271, 8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 8300, 8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 8315, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 8340, 8341, 8342, 8343, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8361, 8362, 8363, 8364, 8365, 8366, 8367, 8368, 8369, 8370, 8371, 8372, 8373, 8374, 8375, 8376, 8377, 8378, 8379, 8380, 8381, 8382, 8383, 8384, 8385, 8386, 8387, 8388, 8389, 8390, 8391, 8392, 8393, 8394, 8395, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 8410, 8411, 8412, 8413, 8414, 8415, 8416, 8417, 8418, 8419, 8420, 8421, 8422, 8423, 8424, 8425, 8426, 8427, 8428, 8429, 8430, 8431, 8432, 8433, 8434, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8489, 8490, 8491, 8492, 8493, 8494, 8495, 8496, 8497, 8498, 8499, 8500, 8501, 8502, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 8514, 8515, 8516, 8517, 8518, 8519, 8520, 8521, 8522, 8523, 8524, 8525, 8526, 8527, 8528, 8529, 8530, 8531, 8532, 8533, 8534, 8535, 8536, 8537, 8538, 8539, 8540, 8541, 8542, 8543, 8544, 8545, 8546, 8547, 8548, 8549, 8550, 8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, 8559, 8560, 8561, 8562, 8563, 8564, 8565, 8566, 8567, 8568, 8569, 8570, 8571, 8572, 8573, 8574, 8575, 8576, 8577, 8578, 8579, 8580, 8581, 8582, 8583, 8584, 8585, 8586, 8587, 8588, 8589, 8590, 8591, 8592, 8593, 8594, 8595, 8596, 8597, 8598, 8599, 8600, 8601, 8602, 8603, 8604, 8605, 8606, 8607, 8608, 8609, 8610, 8611, 8612, 8613, 8614, 8615, 8616, 8617, 8618, 8619, 8620, 8621, 8622, 8623, 8624, 8625, 8626, 8627, 8628, 8629, 8630, 8631, 8632, 8633, 8634, 8635, 8636, 8637, 8638, 8639, 8640, 8641, 8642, 8643, 8644, 8645, 8646, 8647, 8648, 8649, 8650, 8651, 8652, 8653, 8654, 8655, 8656, 8657, 8658, 8659, 8660, 8661, 8662, 8663, 8664, 8665, 8666, 8667, 8668, 8669, 8670, 8671, 8672, 8673, 8674, 8675, 8676, 8677, 8678, 8679, 8680, 8681, 8682, 8683, 8684, 8685, 8686, 8687, 8688, 8689, 8690, 8691, 8692, 8693, 8694, 8695, 8696, 8697, 8698, 8699, 8700, 8701, 8702, 8703, 8704, 8705, 8706, 8707, 8708, 8709, 8710, 8711, 8712, 8713, 8714, 8715, 8716, 8717, 8718, 8719, 8720, 8721, 8722, 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732, 8733, 8734, 8735, 8736, 8737, 8738, 8739, 8740, 8741, 8742, 8743, 8744, 8745, 8746, 8747, 8748, 8749, 8750, 8751, 8752, 8753, 8754, 8755, 8756, 8757, 8758, 8759, 8760, 8761, 8762, 8763, 8764, 8765, 8766, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = [\"ac\",\"com.ac\",\"edu.ac\",\"gov.ac\",\"net.ac\",\"mil.ac\",\"org.ac\",\"ad\",\"nom.ad\",\"ae\",\"co.ae\",\"net.ae\",\"org.ae\",\"sch.ae\",\"ac.ae\",\"gov.ae\",\"mil.ae\",\"aero\",\"accident-investigation.aero\",\"accident-prevention.aero\",\"aerobatic.aero\",\"aeroclub.aero\",\"aerodrome.aero\",\"agents.aero\",\"aircraft.aero\",\"airline.aero\",\"airport.aero\",\"air-surveillance.aero\",\"airtraffic.aero\",\"air-traffic-control.aero\",\"ambulance.aero\",\"amusement.aero\",\"association.aero\",\"author.aero\",\"ballooning.aero\",\"broker.aero\",\"caa.aero\",\"cargo.aero\",\"catering.aero\",\"certification.aero\",\"championship.aero\",\"charter.aero\",\"civilaviation.aero\",\"club.aero\",\"conference.aero\",\"consultant.aero\",\"consulting.aero\",\"control.aero\",\"council.aero\",\"crew.aero\",\"design.aero\",\"dgca.aero\",\"educator.aero\",\"emergency.aero\",\"engine.aero\",\"engineer.aero\",\"entertainment.aero\",\"equipment.aero\",\"exchange.aero\",\"express.aero\",\"federation.aero\",\"flight.aero\",\"freight.aero\",\"fuel.aero\",\"gliding.aero\",\"government.aero\",\"groundhandling.aero\",\"group.aero\",\"hanggliding.aero\",\"homebuilt.aero\",\"insurance.aero\",\"journal.aero\",\"journalist.aero\",\"leasing.aero\",\"logistics.aero\",\"magazine.aero\",\"maintenance.aero\",\"media.aero\",\"microlight.aero\",\"modelling.aero\",\"navigation.aero\",\"parachuting.aero\",\"paragliding.aero\",\"passenger-association.aero\",\"pilot.aero\",\"press.aero\",\"production.aero\",\"recreation.aero\",\"repbody.aero\",\"res.aero\",\"research.aero\",\"rotorcraft.aero\",\"safety.aero\",\"scientist.aero\",\"services.aero\",\"show.aero\",\"skydiving.aero\",\"software.aero\",\"student.aero\",\"trader.aero\",\"trading.aero\",\"trainer.aero\",\"union.aero\",\"workinggroup.aero\",\"works.aero\",\"af\",\"gov.af\",\"com.af\",\"org.af\",\"net.af\",\"edu.af\",\"ag\",\"com.ag\",\"org.ag\",\"net.ag\",\"co.ag\",\"nom.ag\",\"ai\",\"off.ai\",\"com.ai\",\"net.ai\",\"org.ai\",\"al\",\"com.al\",\"edu.al\",\"gov.al\",\"mil.al\",\"net.al\",\"org.al\",\"am\",\"co.am\",\"com.am\",\"commune.am\",\"net.am\",\"org.am\",\"ao\",\"ed.ao\",\"gv.ao\",\"og.ao\",\"co.ao\",\"pb.ao\",\"it.ao\",\"aq\",\"ar\",\"com.ar\",\"edu.ar\",\"gob.ar\",\"gov.ar\",\"int.ar\",\"mil.ar\",\"musica.ar\",\"net.ar\",\"org.ar\",\"tur.ar\",\"arpa\",\"e164.arpa\",\"in-addr.arpa\",\"ip6.arpa\",\"iris.arpa\",\"uri.arpa\",\"urn.arpa\",\"as\",\"gov.as\",\"asia\",\"at\",\"ac.at\",\"co.at\",\"gv.at\",\"or.at\",\"au\",\"com.au\",\"net.au\",\"org.au\",\"edu.au\",\"gov.au\",\"asn.au\",\"id.au\",\"info.au\",\"conf.au\",\"oz.au\",\"act.au\",\"nsw.au\",\"nt.au\",\"qld.au\",\"sa.au\",\"tas.au\",\"vic.au\",\"wa.au\",\"act.edu.au\",\"nsw.edu.au\",\"nt.edu.au\",\"qld.edu.au\",\"sa.edu.au\",\"tas.edu.au\",\"vic.edu.au\",\"wa.edu.au\",\"qld.gov.au\",\"sa.gov.au\",\"tas.gov.au\",\"vic.gov.au\",\"wa.gov.au\",\"aw\",\"com.aw\",\"ax\",\"az\",\"com.az\",\"net.az\",\"int.az\",\"gov.az\",\"org.az\",\"edu.az\",\"info.az\",\"pp.az\",\"mil.az\",\"name.az\",\"pro.az\",\"biz.az\",\"ba\",\"com.ba\",\"edu.ba\",\"gov.ba\",\"mil.ba\",\"net.ba\",\"org.ba\",\"bb\",\"biz.bb\",\"co.bb\",\"com.bb\",\"edu.bb\",\"gov.bb\",\"info.bb\",\"net.bb\",\"org.bb\",\"store.bb\",\"tv.bb\",\"*.bd\",\"be\",\"ac.be\",\"bf\",\"gov.bf\",\"bg\",\"a.bg\",\"b.bg\",\"c.bg\",\"d.bg\",\"e.bg\",\"f.bg\",\"g.bg\",\"h.bg\",\"i.bg\",\"j.bg\",\"k.bg\",\"l.bg\",\"m.bg\",\"n.bg\",\"o.bg\",\"p.bg\",\"q.bg\",\"r.bg\",\"s.bg\",\"t.bg\",\"u.bg\",\"v.bg\",\"w.bg\",\"x.bg\",\"y.bg\",\"z.bg\",\"0.bg\",\"1.bg\",\"2.bg\",\"3.bg\",\"4.bg\",\"5.bg\",\"6.bg\",\"7.bg\",\"8.bg\",\"9.bg\",\"bh\",\"com.bh\",\"edu.bh\",\"net.bh\",\"org.bh\",\"gov.bh\",\"bi\",\"co.bi\",\"com.bi\",\"edu.bi\",\"or.bi\",\"org.bi\",\"biz\",\"bj\",\"asso.bj\",\"barreau.bj\",\"gouv.bj\",\"bm\",\"com.bm\",\"edu.bm\",\"gov.bm\",\"net.bm\",\"org.bm\",\"bn\",\"com.bn\",\"edu.bn\",\"gov.bn\",\"net.bn\",\"org.bn\",\"bo\",\"com.bo\",\"edu.bo\",\"gob.bo\",\"int.bo\",\"org.bo\",\"net.bo\",\"mil.bo\",\"tv.bo\",\"web.bo\",\"academia.bo\",\"agro.bo\",\"arte.bo\",\"blog.bo\",\"bolivia.bo\",\"ciencia.bo\",\"cooperativa.bo\",\"democracia.bo\",\"deporte.bo\",\"ecologia.bo\",\"economia.bo\",\"empresa.bo\",\"indigena.bo\",\"industria.bo\",\"info.bo\",\"medicina.bo\",\"movimiento.bo\",\"musica.bo\",\"natural.bo\",\"nombre.bo\",\"noticias.bo\",\"patria.bo\",\"politica.bo\",\"profesional.bo\",\"plurinacional.bo\",\"pueblo.bo\",\"revista.bo\",\"salud.bo\",\"tecnologia.bo\",\"tksat.bo\",\"transporte.bo\",\"wiki.bo\",\"br\",\"9guacu.br\",\"abc.br\",\"adm.br\",\"adv.br\",\"agr.br\",\"aju.br\",\"am.br\",\"anani.br\",\"aparecida.br\",\"arq.br\",\"art.br\",\"ato.br\",\"b.br\",\"barueri.br\",\"belem.br\",\"bhz.br\",\"bio.br\",\"blog.br\",\"bmd.br\",\"boavista.br\",\"bsb.br\",\"campinagrande.br\",\"campinas.br\",\"caxias.br\",\"cim.br\",\"cng.br\",\"cnt.br\",\"com.br\",\"contagem.br\",\"coop.br\",\"cri.br\",\"cuiaba.br\",\"curitiba.br\",\"def.br\",\"ecn.br\",\"eco.br\",\"edu.br\",\"emp.br\",\"eng.br\",\"esp.br\",\"etc.br\",\"eti.br\",\"far.br\",\"feira.br\",\"flog.br\",\"floripa.br\",\"fm.br\",\"fnd.br\",\"fortal.br\",\"fot.br\",\"foz.br\",\"fst.br\",\"g12.br\",\"ggf.br\",\"goiania.br\",\"gov.br\",\"ac.gov.br\",\"al.gov.br\",\"am.gov.br\",\"ap.gov.br\",\"ba.gov.br\",\"ce.gov.br\",\"df.gov.br\",\"es.gov.br\",\"go.gov.br\",\"ma.gov.br\",\"mg.gov.br\",\"ms.gov.br\",\"mt.gov.br\",\"pa.gov.br\",\"pb.gov.br\",\"pe.gov.br\",\"pi.gov.br\",\"pr.gov.br\",\"rj.gov.br\",\"rn.gov.br\",\"ro.gov.br\",\"rr.gov.br\",\"rs.gov.br\",\"sc.gov.br\",\"se.gov.br\",\"sp.gov.br\",\"to.gov.br\",\"gru.br\",\"imb.br\",\"ind.br\",\"inf.br\",\"jab.br\",\"jampa.br\",\"jdf.br\",\"joinville.br\",\"jor.br\",\"jus.br\",\"leg.br\",\"lel.br\",\"londrina.br\",\"macapa.br\",\"maceio.br\",\"manaus.br\",\"maringa.br\",\"mat.br\",\"med.br\",\"mil.br\",\"morena.br\",\"mp.br\",\"mus.br\",\"natal.br\",\"net.br\",\"niteroi.br\",\"*.nom.br\",\"not.br\",\"ntr.br\",\"odo.br\",\"ong.br\",\"org.br\",\"osasco.br\",\"palmas.br\",\"poa.br\",\"ppg.br\",\"pro.br\",\"psc.br\",\"psi.br\",\"pvh.br\",\"qsl.br\",\"radio.br\",\"rec.br\",\"recife.br\",\"ribeirao.br\",\"rio.br\",\"riobranco.br\",\"riopreto.br\",\"salvador.br\",\"sampa.br\",\"santamaria.br\",\"santoandre.br\",\"saobernardo.br\",\"saogonca.br\",\"sjc.br\",\"slg.br\",\"slz.br\",\"sorocaba.br\",\"srv.br\",\"taxi.br\",\"tc.br\",\"teo.br\",\"the.br\",\"tmp.br\",\"trd.br\",\"tur.br\",\"tv.br\",\"udi.br\",\"vet.br\",\"vix.br\",\"vlog.br\",\"wiki.br\",\"zlg.br\",\"bs\",\"com.bs\",\"net.bs\",\"org.bs\",\"edu.bs\",\"gov.bs\",\"bt\",\"com.bt\",\"edu.bt\",\"gov.bt\",\"net.bt\",\"org.bt\",\"bv\",\"bw\",\"co.bw\",\"org.bw\",\"by\",\"gov.by\",\"mil.by\",\"com.by\",\"of.by\",\"bz\",\"com.bz\",\"net.bz\",\"org.bz\",\"edu.bz\",\"gov.bz\",\"ca\",\"ab.ca\",\"bc.ca\",\"mb.ca\",\"nb.ca\",\"nf.ca\",\"nl.ca\",\"ns.ca\",\"nt.ca\",\"nu.ca\",\"on.ca\",\"pe.ca\",\"qc.ca\",\"sk.ca\",\"yk.ca\",\"gc.ca\",\"cat\",\"cc\",\"cd\",\"gov.cd\",\"cf\",\"cg\",\"ch\",\"ci\",\"org.ci\",\"or.ci\",\"com.ci\",\"co.ci\",\"edu.ci\",\"ed.ci\",\"ac.ci\",\"net.ci\",\"go.ci\",\"asso.ci\",\"aéroport.ci\",\"int.ci\",\"presse.ci\",\"md.ci\",\"gouv.ci\",\"*.ck\",\"!www.ck\",\"cl\",\"gov.cl\",\"gob.cl\",\"co.cl\",\"mil.cl\",\"cm\",\"co.cm\",\"com.cm\",\"gov.cm\",\"net.cm\",\"cn\",\"ac.cn\",\"com.cn\",\"edu.cn\",\"gov.cn\",\"net.cn\",\"org.cn\",\"mil.cn\",\"公司.cn\",\"网络.cn\",\"網絡.cn\",\"ah.cn\",\"bj.cn\",\"cq.cn\",\"fj.cn\",\"gd.cn\",\"gs.cn\",\"gz.cn\",\"gx.cn\",\"ha.cn\",\"hb.cn\",\"he.cn\",\"hi.cn\",\"hl.cn\",\"hn.cn\",\"jl.cn\",\"js.cn\",\"jx.cn\",\"ln.cn\",\"nm.cn\",\"nx.cn\",\"qh.cn\",\"sc.cn\",\"sd.cn\",\"sh.cn\",\"sn.cn\",\"sx.cn\",\"tj.cn\",\"xj.cn\",\"xz.cn\",\"yn.cn\",\"zj.cn\",\"hk.cn\",\"mo.cn\",\"tw.cn\",\"co\",\"arts.co\",\"com.co\",\"edu.co\",\"firm.co\",\"gov.co\",\"info.co\",\"int.co\",\"mil.co\",\"net.co\",\"nom.co\",\"org.co\",\"rec.co\",\"web.co\",\"com\",\"coop\",\"cr\",\"ac.cr\",\"co.cr\",\"ed.cr\",\"fi.cr\",\"go.cr\",\"or.cr\",\"sa.cr\",\"cu\",\"com.cu\",\"edu.cu\",\"org.cu\",\"net.cu\",\"gov.cu\",\"inf.cu\",\"cv\",\"cw\",\"com.cw\",\"edu.cw\",\"net.cw\",\"org.cw\",\"cx\",\"gov.cx\",\"cy\",\"ac.cy\",\"biz.cy\",\"com.cy\",\"ekloges.cy\",\"gov.cy\",\"ltd.cy\",\"name.cy\",\"net.cy\",\"org.cy\",\"parliament.cy\",\"press.cy\",\"pro.cy\",\"tm.cy\",\"cz\",\"de\",\"dj\",\"dk\",\"dm\",\"com.dm\",\"net.dm\",\"org.dm\",\"edu.dm\",\"gov.dm\",\"do\",\"art.do\",\"com.do\",\"edu.do\",\"gob.do\",\"gov.do\",\"mil.do\",\"net.do\",\"org.do\",\"sld.do\",\"web.do\",\"dz\",\"com.dz\",\"org.dz\",\"net.dz\",\"gov.dz\",\"edu.dz\",\"asso.dz\",\"pol.dz\",\"art.dz\",\"ec\",\"com.ec\",\"info.ec\",\"net.ec\",\"fin.ec\",\"k12.ec\",\"med.ec\",\"pro.ec\",\"org.ec\",\"edu.ec\",\"gov.ec\",\"gob.ec\",\"mil.ec\",\"edu\",\"ee\",\"edu.ee\",\"gov.ee\",\"riik.ee\",\"lib.ee\",\"med.ee\",\"com.ee\",\"pri.ee\",\"aip.ee\",\"org.ee\",\"fie.ee\",\"eg\",\"com.eg\",\"edu.eg\",\"eun.eg\",\"gov.eg\",\"mil.eg\",\"name.eg\",\"net.eg\",\"org.eg\",\"sci.eg\",\"*.er\",\"es\",\"com.es\",\"nom.es\",\"org.es\",\"gob.es\",\"edu.es\",\"et\",\"com.et\",\"gov.et\",\"org.et\",\"edu.et\",\"biz.et\",\"name.et\",\"info.et\",\"net.et\",\"eu\",\"fi\",\"aland.fi\",\"*.fj\",\"*.fk\",\"fm\",\"fo\",\"fr\",\"asso.fr\",\"com.fr\",\"gouv.fr\",\"nom.fr\",\"prd.fr\",\"tm.fr\",\"aeroport.fr\",\"avocat.fr\",\"avoues.fr\",\"cci.fr\",\"chambagri.fr\",\"chirurgiens-dentistes.fr\",\"experts-comptables.fr\",\"geometre-expert.fr\",\"greta.fr\",\"huissier-justice.fr\",\"medecin.fr\",\"notaires.fr\",\"pharmacien.fr\",\"port.fr\",\"veterinaire.fr\",\"ga\",\"gb\",\"gd\",\"ge\",\"com.ge\",\"edu.ge\",\"gov.ge\",\"org.ge\",\"mil.ge\",\"net.ge\",\"pvt.ge\",\"gf\",\"gg\",\"co.gg\",\"net.gg\",\"org.gg\",\"gh\",\"com.gh\",\"edu.gh\",\"gov.gh\",\"org.gh\",\"mil.gh\",\"gi\",\"com.gi\",\"ltd.gi\",\"gov.gi\",\"mod.gi\",\"edu.gi\",\"org.gi\",\"gl\",\"co.gl\",\"com.gl\",\"edu.gl\",\"net.gl\",\"org.gl\",\"gm\",\"gn\",\"ac.gn\",\"com.gn\",\"edu.gn\",\"gov.gn\",\"org.gn\",\"net.gn\",\"gov\",\"gp\",\"com.gp\",\"net.gp\",\"mobi.gp\",\"edu.gp\",\"org.gp\",\"asso.gp\",\"gq\",\"gr\",\"com.gr\",\"edu.gr\",\"net.gr\",\"org.gr\",\"gov.gr\",\"gs\",\"gt\",\"com.gt\",\"edu.gt\",\"gob.gt\",\"ind.gt\",\"mil.gt\",\"net.gt\",\"org.gt\",\"gu\",\"com.gu\",\"edu.gu\",\"gov.gu\",\"guam.gu\",\"info.gu\",\"net.gu\",\"org.gu\",\"web.gu\",\"gw\",\"gy\",\"co.gy\",\"com.gy\",\"edu.gy\",\"gov.gy\",\"net.gy\",\"org.gy\",\"hk\",\"com.hk\",\"edu.hk\",\"gov.hk\",\"idv.hk\",\"net.hk\",\"org.hk\",\"公司.hk\",\"教育.hk\",\"敎育.hk\",\"政府.hk\",\"個人.hk\",\"个人.hk\",\"箇人.hk\",\"網络.hk\",\"网络.hk\",\"组織.hk\",\"網絡.hk\",\"网絡.hk\",\"组织.hk\",\"組織.hk\",\"組织.hk\",\"hm\",\"hn\",\"com.hn\",\"edu.hn\",\"org.hn\",\"net.hn\",\"mil.hn\",\"gob.hn\",\"hr\",\"iz.hr\",\"from.hr\",\"name.hr\",\"com.hr\",\"ht\",\"com.ht\",\"shop.ht\",\"firm.ht\",\"info.ht\",\"adult.ht\",\"net.ht\",\"pro.ht\",\"org.ht\",\"med.ht\",\"art.ht\",\"coop.ht\",\"pol.ht\",\"asso.ht\",\"edu.ht\",\"rel.ht\",\"gouv.ht\",\"perso.ht\",\"hu\",\"co.hu\",\"info.hu\",\"org.hu\",\"priv.hu\",\"sport.hu\",\"tm.hu\",\"2000.hu\",\"agrar.hu\",\"bolt.hu\",\"casino.hu\",\"city.hu\",\"erotica.hu\",\"erotika.hu\",\"film.hu\",\"forum.hu\",\"games.hu\",\"hotel.hu\",\"ingatlan.hu\",\"jogasz.hu\",\"konyvelo.hu\",\"lakas.hu\",\"media.hu\",\"news.hu\",\"reklam.hu\",\"sex.hu\",\"shop.hu\",\"suli.hu\",\"szex.hu\",\"tozsde.hu\",\"utazas.hu\",\"video.hu\",\"id\",\"ac.id\",\"biz.id\",\"co.id\",\"desa.id\",\"go.id\",\"mil.id\",\"my.id\",\"net.id\",\"or.id\",\"ponpes.id\",\"sch.id\",\"web.id\",\"ie\",\"gov.ie\",\"il\",\"ac.il\",\"co.il\",\"gov.il\",\"idf.il\",\"k12.il\",\"muni.il\",\"net.il\",\"org.il\",\"im\",\"ac.im\",\"co.im\",\"com.im\",\"ltd.co.im\",\"net.im\",\"org.im\",\"plc.co.im\",\"tt.im\",\"tv.im\",\"in\",\"co.in\",\"firm.in\",\"net.in\",\"org.in\",\"gen.in\",\"ind.in\",\"nic.in\",\"ac.in\",\"edu.in\",\"res.in\",\"gov.in\",\"mil.in\",\"info\",\"int\",\"eu.int\",\"io\",\"com.io\",\"iq\",\"gov.iq\",\"edu.iq\",\"mil.iq\",\"com.iq\",\"org.iq\",\"net.iq\",\"ir\",\"ac.ir\",\"co.ir\",\"gov.ir\",\"id.ir\",\"net.ir\",\"org.ir\",\"sch.ir\",\"ایران.ir\",\"ايران.ir\",\"is\",\"net.is\",\"com.is\",\"edu.is\",\"gov.is\",\"org.is\",\"int.is\",\"it\",\"gov.it\",\"edu.it\",\"abr.it\",\"abruzzo.it\",\"aosta-valley.it\",\"aostavalley.it\",\"bas.it\",\"basilicata.it\",\"cal.it\",\"calabria.it\",\"cam.it\",\"campania.it\",\"emilia-romagna.it\",\"emiliaromagna.it\",\"emr.it\",\"friuli-v-giulia.it\",\"friuli-ve-giulia.it\",\"friuli-vegiulia.it\",\"friuli-venezia-giulia.it\",\"friuli-veneziagiulia.it\",\"friuli-vgiulia.it\",\"friuliv-giulia.it\",\"friulive-giulia.it\",\"friulivegiulia.it\",\"friulivenezia-giulia.it\",\"friuliveneziagiulia.it\",\"friulivgiulia.it\",\"fvg.it\",\"laz.it\",\"lazio.it\",\"lig.it\",\"liguria.it\",\"lom.it\",\"lombardia.it\",\"lombardy.it\",\"lucania.it\",\"mar.it\",\"marche.it\",\"mol.it\",\"molise.it\",\"piedmont.it\",\"piemonte.it\",\"pmn.it\",\"pug.it\",\"puglia.it\",\"sar.it\",\"sardegna.it\",\"sardinia.it\",\"sic.it\",\"sicilia.it\",\"sicily.it\",\"taa.it\",\"tos.it\",\"toscana.it\",\"trentin-sud-tirol.it\",\"trentin-süd-tirol.it\",\"trentin-sudtirol.it\",\"trentin-südtirol.it\",\"trentin-sued-tirol.it\",\"trentin-suedtirol.it\",\"trentino-a-adige.it\",\"trentino-aadige.it\",\"trentino-alto-adige.it\",\"trentino-altoadige.it\",\"trentino-s-tirol.it\",\"trentino-stirol.it\",\"trentino-sud-tirol.it\",\"trentino-süd-tirol.it\",\"trentino-sudtirol.it\",\"trentino-südtirol.it\",\"trentino-sued-tirol.it\",\"trentino-suedtirol.it\",\"trentino.it\",\"trentinoa-adige.it\",\"trentinoaadige.it\",\"trentinoalto-adige.it\",\"trentinoaltoadige.it\",\"trentinos-tirol.it\",\"trentinostirol.it\",\"trentinosud-tirol.it\",\"trentinosüd-tirol.it\",\"trentinosudtirol.it\",\"trentinosüdtirol.it\",\"trentinosued-tirol.it\",\"trentinosuedtirol.it\",\"trentinsud-tirol.it\",\"trentinsüd-tirol.it\",\"trentinsudtirol.it\",\"trentinsüdtirol.it\",\"trentinsued-tirol.it\",\"trentinsuedtirol.it\",\"tuscany.it\",\"umb.it\",\"umbria.it\",\"val-d-aosta.it\",\"val-daosta.it\",\"vald-aosta.it\",\"valdaosta.it\",\"valle-aosta.it\",\"valle-d-aosta.it\",\"valle-daosta.it\",\"valleaosta.it\",\"valled-aosta.it\",\"valledaosta.it\",\"vallee-aoste.it\",\"vallée-aoste.it\",\"vallee-d-aoste.it\",\"vallée-d-aoste.it\",\"valleeaoste.it\",\"valléeaoste.it\",\"valleedaoste.it\",\"valléedaoste.it\",\"vao.it\",\"vda.it\",\"ven.it\",\"veneto.it\",\"ag.it\",\"agrigento.it\",\"al.it\",\"alessandria.it\",\"alto-adige.it\",\"altoadige.it\",\"an.it\",\"ancona.it\",\"andria-barletta-trani.it\",\"andria-trani-barletta.it\",\"andriabarlettatrani.it\",\"andriatranibarletta.it\",\"ao.it\",\"aosta.it\",\"aoste.it\",\"ap.it\",\"aq.it\",\"aquila.it\",\"ar.it\",\"arezzo.it\",\"ascoli-piceno.it\",\"ascolipiceno.it\",\"asti.it\",\"at.it\",\"av.it\",\"avellino.it\",\"ba.it\",\"balsan-sudtirol.it\",\"balsan-südtirol.it\",\"balsan-suedtirol.it\",\"balsan.it\",\"bari.it\",\"barletta-trani-andria.it\",\"barlettatraniandria.it\",\"belluno.it\",\"benevento.it\",\"bergamo.it\",\"bg.it\",\"bi.it\",\"biella.it\",\"bl.it\",\"bn.it\",\"bo.it\",\"bologna.it\",\"bolzano-altoadige.it\",\"bolzano.it\",\"bozen-sudtirol.it\",\"bozen-südtirol.it\",\"bozen-suedtirol.it\",\"bozen.it\",\"br.it\",\"brescia.it\",\"brindisi.it\",\"bs.it\",\"bt.it\",\"bulsan-sudtirol.it\",\"bulsan-südtirol.it\",\"bulsan-suedtirol.it\",\"bulsan.it\",\"bz.it\",\"ca.it\",\"cagliari.it\",\"caltanissetta.it\",\"campidano-medio.it\",\"campidanomedio.it\",\"campobasso.it\",\"carbonia-iglesias.it\",\"carboniaiglesias.it\",\"carrara-massa.it\",\"carraramassa.it\",\"caserta.it\",\"catania.it\",\"catanzaro.it\",\"cb.it\",\"ce.it\",\"cesena-forli.it\",\"cesena-forlì.it\",\"cesenaforli.it\",\"cesenaforlì.it\",\"ch.it\",\"chieti.it\",\"ci.it\",\"cl.it\",\"cn.it\",\"co.it\",\"como.it\",\"cosenza.it\",\"cr.it\",\"cremona.it\",\"crotone.it\",\"cs.it\",\"ct.it\",\"cuneo.it\",\"cz.it\",\"dell-ogliastra.it\",\"dellogliastra.it\",\"en.it\",\"enna.it\",\"fc.it\",\"fe.it\",\"fermo.it\",\"ferrara.it\",\"fg.it\",\"fi.it\",\"firenze.it\",\"florence.it\",\"fm.it\",\"foggia.it\",\"forli-cesena.it\",\"forlì-cesena.it\",\"forlicesena.it\",\"forlìcesena.it\",\"fr.it\",\"frosinone.it\",\"ge.it\",\"genoa.it\",\"genova.it\",\"go.it\",\"gorizia.it\",\"gr.it\",\"grosseto.it\",\"iglesias-carbonia.it\",\"iglesiascarbonia.it\",\"im.it\",\"imperia.it\",\"is.it\",\"isernia.it\",\"kr.it\",\"la-spezia.it\",\"laquila.it\",\"laspezia.it\",\"latina.it\",\"lc.it\",\"le.it\",\"lecce.it\",\"lecco.it\",\"li.it\",\"livorno.it\",\"lo.it\",\"lodi.it\",\"lt.it\",\"lu.it\",\"lucca.it\",\"macerata.it\",\"mantova.it\",\"massa-carrara.it\",\"massacarrara.it\",\"matera.it\",\"mb.it\",\"mc.it\",\"me.it\",\"medio-campidano.it\",\"mediocampidano.it\",\"messina.it\",\"mi.it\",\"milan.it\",\"milano.it\",\"mn.it\",\"mo.it\",\"modena.it\",\"monza-brianza.it\",\"monza-e-della-brianza.it\",\"monza.it\",\"monzabrianza.it\",\"monzaebrianza.it\",\"monzaedellabrianza.it\",\"ms.it\",\"mt.it\",\"na.it\",\"naples.it\",\"napoli.it\",\"no.it\",\"novara.it\",\"nu.it\",\"nuoro.it\",\"og.it\",\"ogliastra.it\",\"olbia-tempio.it\",\"olbiatempio.it\",\"or.it\",\"oristano.it\",\"ot.it\",\"pa.it\",\"padova.it\",\"padua.it\",\"palermo.it\",\"parma.it\",\"pavia.it\",\"pc.it\",\"pd.it\",\"pe.it\",\"perugia.it\",\"pesaro-urbino.it\",\"pesarourbino.it\",\"pescara.it\",\"pg.it\",\"pi.it\",\"piacenza.it\",\"pisa.it\",\"pistoia.it\",\"pn.it\",\"po.it\",\"pordenone.it\",\"potenza.it\",\"pr.it\",\"prato.it\",\"pt.it\",\"pu.it\",\"pv.it\",\"pz.it\",\"ra.it\",\"ragusa.it\",\"ravenna.it\",\"rc.it\",\"re.it\",\"reggio-calabria.it\",\"reggio-emilia.it\",\"reggiocalabria.it\",\"reggioemilia.it\",\"rg.it\",\"ri.it\",\"rieti.it\",\"rimini.it\",\"rm.it\",\"rn.it\",\"ro.it\",\"roma.it\",\"rome.it\",\"rovigo.it\",\"sa.it\",\"salerno.it\",\"sassari.it\",\"savona.it\",\"si.it\",\"siena.it\",\"siracusa.it\",\"so.it\",\"sondrio.it\",\"sp.it\",\"sr.it\",\"ss.it\",\"suedtirol.it\",\"südtirol.it\",\"sv.it\",\"ta.it\",\"taranto.it\",\"te.it\",\"tempio-olbia.it\",\"tempioolbia.it\",\"teramo.it\",\"terni.it\",\"tn.it\",\"to.it\",\"torino.it\",\"tp.it\",\"tr.it\",\"trani-andria-barletta.it\",\"trani-barletta-andria.it\",\"traniandriabarletta.it\",\"tranibarlettaandria.it\",\"trapani.it\",\"trento.it\",\"treviso.it\",\"trieste.it\",\"ts.it\",\"turin.it\",\"tv.it\",\"ud.it\",\"udine.it\",\"urbino-pesaro.it\",\"urbinopesaro.it\",\"va.it\",\"varese.it\",\"vb.it\",\"vc.it\",\"ve.it\",\"venezia.it\",\"venice.it\",\"verbania.it\",\"vercelli.it\",\"verona.it\",\"vi.it\",\"vibo-valentia.it\",\"vibovalentia.it\",\"vicenza.it\",\"viterbo.it\",\"vr.it\",\"vs.it\",\"vt.it\",\"vv.it\",\"je\",\"co.je\",\"net.je\",\"org.je\",\"*.jm\",\"jo\",\"com.jo\",\"org.jo\",\"net.jo\",\"edu.jo\",\"sch.jo\",\"gov.jo\",\"mil.jo\",\"name.jo\",\"jobs\",\"jp\",\"ac.jp\",\"ad.jp\",\"co.jp\",\"ed.jp\",\"go.jp\",\"gr.jp\",\"lg.jp\",\"ne.jp\",\"or.jp\",\"aichi.jp\",\"akita.jp\",\"aomori.jp\",\"chiba.jp\",\"ehime.jp\",\"fukui.jp\",\"fukuoka.jp\",\"fukushima.jp\",\"gifu.jp\",\"gunma.jp\",\"hiroshima.jp\",\"hokkaido.jp\",\"hyogo.jp\",\"ibaraki.jp\",\"ishikawa.jp\",\"iwate.jp\",\"kagawa.jp\",\"kagoshima.jp\",\"kanagawa.jp\",\"kochi.jp\",\"kumamoto.jp\",\"kyoto.jp\",\"mie.jp\",\"miyagi.jp\",\"miyazaki.jp\",\"nagano.jp\",\"nagasaki.jp\",\"nara.jp\",\"niigata.jp\",\"oita.jp\",\"okayama.jp\",\"okinawa.jp\",\"osaka.jp\",\"saga.jp\",\"saitama.jp\",\"shiga.jp\",\"shimane.jp\",\"shizuoka.jp\",\"tochigi.jp\",\"tokushima.jp\",\"tokyo.jp\",\"tottori.jp\",\"toyama.jp\",\"wakayama.jp\",\"yamagata.jp\",\"yamaguchi.jp\",\"yamanashi.jp\",\"栃木.jp\",\"愛知.jp\",\"愛媛.jp\",\"兵庫.jp\",\"熊本.jp\",\"茨城.jp\",\"北海道.jp\",\"千葉.jp\",\"和歌山.jp\",\"長崎.jp\",\"長野.jp\",\"新潟.jp\",\"青森.jp\",\"静岡.jp\",\"東京.jp\",\"石川.jp\",\"埼玉.jp\",\"三重.jp\",\"京都.jp\",\"佐賀.jp\",\"大分.jp\",\"大阪.jp\",\"奈良.jp\",\"宮城.jp\",\"宮崎.jp\",\"富山.jp\",\"山口.jp\",\"山形.jp\",\"山梨.jp\",\"岩手.jp\",\"岐阜.jp\",\"岡山.jp\",\"島根.jp\",\"広島.jp\",\"徳島.jp\",\"沖縄.jp\",\"滋賀.jp\",\"神奈川.jp\",\"福井.jp\",\"福岡.jp\",\"福島.jp\",\"秋田.jp\",\"群馬.jp\",\"香川.jp\",\"高知.jp\",\"鳥取.jp\",\"鹿児島.jp\",\"*.kawasaki.jp\",\"*.kitakyushu.jp\",\"*.kobe.jp\",\"*.nagoya.jp\",\"*.sapporo.jp\",\"*.sendai.jp\",\"*.yokohama.jp\",\"!city.kawasaki.jp\",\"!city.kitakyushu.jp\",\"!city.kobe.jp\",\"!city.nagoya.jp\",\"!city.sapporo.jp\",\"!city.sendai.jp\",\"!city.yokohama.jp\",\"aisai.aichi.jp\",\"ama.aichi.jp\",\"anjo.aichi.jp\",\"asuke.aichi.jp\",\"chiryu.aichi.jp\",\"chita.aichi.jp\",\"fuso.aichi.jp\",\"gamagori.aichi.jp\",\"handa.aichi.jp\",\"hazu.aichi.jp\",\"hekinan.aichi.jp\",\"higashiura.aichi.jp\",\"ichinomiya.aichi.jp\",\"inazawa.aichi.jp\",\"inuyama.aichi.jp\",\"isshiki.aichi.jp\",\"iwakura.aichi.jp\",\"kanie.aichi.jp\",\"kariya.aichi.jp\",\"kasugai.aichi.jp\",\"kira.aichi.jp\",\"kiyosu.aichi.jp\",\"komaki.aichi.jp\",\"konan.aichi.jp\",\"kota.aichi.jp\",\"mihama.aichi.jp\",\"miyoshi.aichi.jp\",\"nishio.aichi.jp\",\"nisshin.aichi.jp\",\"obu.aichi.jp\",\"oguchi.aichi.jp\",\"oharu.aichi.jp\",\"okazaki.aichi.jp\",\"owariasahi.aichi.jp\",\"seto.aichi.jp\",\"shikatsu.aichi.jp\",\"shinshiro.aichi.jp\",\"shitara.aichi.jp\",\"tahara.aichi.jp\",\"takahama.aichi.jp\",\"tobishima.aichi.jp\",\"toei.aichi.jp\",\"togo.aichi.jp\",\"tokai.aichi.jp\",\"tokoname.aichi.jp\",\"toyoake.aichi.jp\",\"toyohashi.aichi.jp\",\"toyokawa.aichi.jp\",\"toyone.aichi.jp\",\"toyota.aichi.jp\",\"tsushima.aichi.jp\",\"yatomi.aichi.jp\",\"akita.akita.jp\",\"daisen.akita.jp\",\"fujisato.akita.jp\",\"gojome.akita.jp\",\"hachirogata.akita.jp\",\"happou.akita.jp\",\"higashinaruse.akita.jp\",\"honjo.akita.jp\",\"honjyo.akita.jp\",\"ikawa.akita.jp\",\"kamikoani.akita.jp\",\"kamioka.akita.jp\",\"katagami.akita.jp\",\"kazuno.akita.jp\",\"kitaakita.akita.jp\",\"kosaka.akita.jp\",\"kyowa.akita.jp\",\"misato.akita.jp\",\"mitane.akita.jp\",\"moriyoshi.akita.jp\",\"nikaho.akita.jp\",\"noshiro.akita.jp\",\"odate.akita.jp\",\"oga.akita.jp\",\"ogata.akita.jp\",\"semboku.akita.jp\",\"yokote.akita.jp\",\"yurihonjo.akita.jp\",\"aomori.aomori.jp\",\"gonohe.aomori.jp\",\"hachinohe.aomori.jp\",\"hashikami.aomori.jp\",\"hiranai.aomori.jp\",\"hirosaki.aomori.jp\",\"itayanagi.aomori.jp\",\"kuroishi.aomori.jp\",\"misawa.aomori.jp\",\"mutsu.aomori.jp\",\"nakadomari.aomori.jp\",\"noheji.aomori.jp\",\"oirase.aomori.jp\",\"owani.aomori.jp\",\"rokunohe.aomori.jp\",\"sannohe.aomori.jp\",\"shichinohe.aomori.jp\",\"shingo.aomori.jp\",\"takko.aomori.jp\",\"towada.aomori.jp\",\"tsugaru.aomori.jp\",\"tsuruta.aomori.jp\",\"abiko.chiba.jp\",\"asahi.chiba.jp\",\"chonan.chiba.jp\",\"chosei.chiba.jp\",\"choshi.chiba.jp\",\"chuo.chiba.jp\",\"funabashi.chiba.jp\",\"futtsu.chiba.jp\",\"hanamigawa.chiba.jp\",\"ichihara.chiba.jp\",\"ichikawa.chiba.jp\",\"ichinomiya.chiba.jp\",\"inzai.chiba.jp\",\"isumi.chiba.jp\",\"kamagaya.chiba.jp\",\"kamogawa.chiba.jp\",\"kashiwa.chiba.jp\",\"katori.chiba.jp\",\"katsuura.chiba.jp\",\"kimitsu.chiba.jp\",\"kisarazu.chiba.jp\",\"kozaki.chiba.jp\",\"kujukuri.chiba.jp\",\"kyonan.chiba.jp\",\"matsudo.chiba.jp\",\"midori.chiba.jp\",\"mihama.chiba.jp\",\"minamiboso.chiba.jp\",\"mobara.chiba.jp\",\"mutsuzawa.chiba.jp\",\"nagara.chiba.jp\",\"nagareyama.chiba.jp\",\"narashino.chiba.jp\",\"narita.chiba.jp\",\"noda.chiba.jp\",\"oamishirasato.chiba.jp\",\"omigawa.chiba.jp\",\"onjuku.chiba.jp\",\"otaki.chiba.jp\",\"sakae.chiba.jp\",\"sakura.chiba.jp\",\"shimofusa.chiba.jp\",\"shirako.chiba.jp\",\"shiroi.chiba.jp\",\"shisui.chiba.jp\",\"sodegaura.chiba.jp\",\"sosa.chiba.jp\",\"tako.chiba.jp\",\"tateyama.chiba.jp\",\"togane.chiba.jp\",\"tohnosho.chiba.jp\",\"tomisato.chiba.jp\",\"urayasu.chiba.jp\",\"yachimata.chiba.jp\",\"yachiyo.chiba.jp\",\"yokaichiba.chiba.jp\",\"yokoshibahikari.chiba.jp\",\"yotsukaido.chiba.jp\",\"ainan.ehime.jp\",\"honai.ehime.jp\",\"ikata.ehime.jp\",\"imabari.ehime.jp\",\"iyo.ehime.jp\",\"kamijima.ehime.jp\",\"kihoku.ehime.jp\",\"kumakogen.ehime.jp\",\"masaki.ehime.jp\",\"matsuno.ehime.jp\",\"matsuyama.ehime.jp\",\"namikata.ehime.jp\",\"niihama.ehime.jp\",\"ozu.ehime.jp\",\"saijo.ehime.jp\",\"seiyo.ehime.jp\",\"shikokuchuo.ehime.jp\",\"tobe.ehime.jp\",\"toon.ehime.jp\",\"uchiko.ehime.jp\",\"uwajima.ehime.jp\",\"yawatahama.ehime.jp\",\"echizen.fukui.jp\",\"eiheiji.fukui.jp\",\"fukui.fukui.jp\",\"ikeda.fukui.jp\",\"katsuyama.fukui.jp\",\"mihama.fukui.jp\",\"minamiechizen.fukui.jp\",\"obama.fukui.jp\",\"ohi.fukui.jp\",\"ono.fukui.jp\",\"sabae.fukui.jp\",\"sakai.fukui.jp\",\"takahama.fukui.jp\",\"tsuruga.fukui.jp\",\"wakasa.fukui.jp\",\"ashiya.fukuoka.jp\",\"buzen.fukuoka.jp\",\"chikugo.fukuoka.jp\",\"chikuho.fukuoka.jp\",\"chikujo.fukuoka.jp\",\"chikushino.fukuoka.jp\",\"chikuzen.fukuoka.jp\",\"chuo.fukuoka.jp\",\"dazaifu.fukuoka.jp\",\"fukuchi.fukuoka.jp\",\"hakata.fukuoka.jp\",\"higashi.fukuoka.jp\",\"hirokawa.fukuoka.jp\",\"hisayama.fukuoka.jp\",\"iizuka.fukuoka.jp\",\"inatsuki.fukuoka.jp\",\"kaho.fukuoka.jp\",\"kasuga.fukuoka.jp\",\"kasuya.fukuoka.jp\",\"kawara.fukuoka.jp\",\"keisen.fukuoka.jp\",\"koga.fukuoka.jp\",\"kurate.fukuoka.jp\",\"kurogi.fukuoka.jp\",\"kurume.fukuoka.jp\",\"minami.fukuoka.jp\",\"miyako.fukuoka.jp\",\"miyama.fukuoka.jp\",\"miyawaka.fukuoka.jp\",\"mizumaki.fukuoka.jp\",\"munakata.fukuoka.jp\",\"nakagawa.fukuoka.jp\",\"nakama.fukuoka.jp\",\"nishi.fukuoka.jp\",\"nogata.fukuoka.jp\",\"ogori.fukuoka.jp\",\"okagaki.fukuoka.jp\",\"okawa.fukuoka.jp\",\"oki.fukuoka.jp\",\"omuta.fukuoka.jp\",\"onga.fukuoka.jp\",\"onojo.fukuoka.jp\",\"oto.fukuoka.jp\",\"saigawa.fukuoka.jp\",\"sasaguri.fukuoka.jp\",\"shingu.fukuoka.jp\",\"shinyoshitomi.fukuoka.jp\",\"shonai.fukuoka.jp\",\"soeda.fukuoka.jp\",\"sue.fukuoka.jp\",\"tachiarai.fukuoka.jp\",\"tagawa.fukuoka.jp\",\"takata.fukuoka.jp\",\"toho.fukuoka.jp\",\"toyotsu.fukuoka.jp\",\"tsuiki.fukuoka.jp\",\"ukiha.fukuoka.jp\",\"umi.fukuoka.jp\",\"usui.fukuoka.jp\",\"yamada.fukuoka.jp\",\"yame.fukuoka.jp\",\"yanagawa.fukuoka.jp\",\"yukuhashi.fukuoka.jp\",\"aizubange.fukushima.jp\",\"aizumisato.fukushima.jp\",\"aizuwakamatsu.fukushima.jp\",\"asakawa.fukushima.jp\",\"bandai.fukushima.jp\",\"date.fukushima.jp\",\"fukushima.fukushima.jp\",\"furudono.fukushima.jp\",\"futaba.fukushima.jp\",\"hanawa.fukushima.jp\",\"higashi.fukushima.jp\",\"hirata.fukushima.jp\",\"hirono.fukushima.jp\",\"iitate.fukushima.jp\",\"inawashiro.fukushima.jp\",\"ishikawa.fukushima.jp\",\"iwaki.fukushima.jp\",\"izumizaki.fukushima.jp\",\"kagamiishi.fukushima.jp\",\"kaneyama.fukushima.jp\",\"kawamata.fukushima.jp\",\"kitakata.fukushima.jp\",\"kitashiobara.fukushima.jp\",\"koori.fukushima.jp\",\"koriyama.fukushima.jp\",\"kunimi.fukushima.jp\",\"miharu.fukushima.jp\",\"mishima.fukushima.jp\",\"namie.fukushima.jp\",\"nango.fukushima.jp\",\"nishiaizu.fukushima.jp\",\"nishigo.fukushima.jp\",\"okuma.fukushima.jp\",\"omotego.fukushima.jp\",\"ono.fukushima.jp\",\"otama.fukushima.jp\",\"samegawa.fukushima.jp\",\"shimogo.fukushima.jp\",\"shirakawa.fukushima.jp\",\"showa.fukushima.jp\",\"soma.fukushima.jp\",\"sukagawa.fukushima.jp\",\"taishin.fukushima.jp\",\"tamakawa.fukushima.jp\",\"tanagura.fukushima.jp\",\"tenei.fukushima.jp\",\"yabuki.fukushima.jp\",\"yamato.fukushima.jp\",\"yamatsuri.fukushima.jp\",\"yanaizu.fukushima.jp\",\"yugawa.fukushima.jp\",\"anpachi.gifu.jp\",\"ena.gifu.jp\",\"gifu.gifu.jp\",\"ginan.gifu.jp\",\"godo.gifu.jp\",\"gujo.gifu.jp\",\"hashima.gifu.jp\",\"hichiso.gifu.jp\",\"hida.gifu.jp\",\"higashishirakawa.gifu.jp\",\"ibigawa.gifu.jp\",\"ikeda.gifu.jp\",\"kakamigahara.gifu.jp\",\"kani.gifu.jp\",\"kasahara.gifu.jp\",\"kasamatsu.gifu.jp\",\"kawaue.gifu.jp\",\"kitagata.gifu.jp\",\"mino.gifu.jp\",\"minokamo.gifu.jp\",\"mitake.gifu.jp\",\"mizunami.gifu.jp\",\"motosu.gifu.jp\",\"nakatsugawa.gifu.jp\",\"ogaki.gifu.jp\",\"sakahogi.gifu.jp\",\"seki.gifu.jp\",\"sekigahara.gifu.jp\",\"shirakawa.gifu.jp\",\"tajimi.gifu.jp\",\"takayama.gifu.jp\",\"tarui.gifu.jp\",\"toki.gifu.jp\",\"tomika.gifu.jp\",\"wanouchi.gifu.jp\",\"yamagata.gifu.jp\",\"yaotsu.gifu.jp\",\"yoro.gifu.jp\",\"annaka.gunma.jp\",\"chiyoda.gunma.jp\",\"fujioka.gunma.jp\",\"higashiagatsuma.gunma.jp\",\"isesaki.gunma.jp\",\"itakura.gunma.jp\",\"kanna.gunma.jp\",\"kanra.gunma.jp\",\"katashina.gunma.jp\",\"kawaba.gunma.jp\",\"kiryu.gunma.jp\",\"kusatsu.gunma.jp\",\"maebashi.gunma.jp\",\"meiwa.gunma.jp\",\"midori.gunma.jp\",\"minakami.gunma.jp\",\"naganohara.gunma.jp\",\"nakanojo.gunma.jp\",\"nanmoku.gunma.jp\",\"numata.gunma.jp\",\"oizumi.gunma.jp\",\"ora.gunma.jp\",\"ota.gunma.jp\",\"shibukawa.gunma.jp\",\"shimonita.gunma.jp\",\"shinto.gunma.jp\",\"showa.gunma.jp\",\"takasaki.gunma.jp\",\"takayama.gunma.jp\",\"tamamura.gunma.jp\",\"tatebayashi.gunma.jp\",\"tomioka.gunma.jp\",\"tsukiyono.gunma.jp\",\"tsumagoi.gunma.jp\",\"ueno.gunma.jp\",\"yoshioka.gunma.jp\",\"asaminami.hiroshima.jp\",\"daiwa.hiroshima.jp\",\"etajima.hiroshima.jp\",\"fuchu.hiroshima.jp\",\"fukuyama.hiroshima.jp\",\"hatsukaichi.hiroshima.jp\",\"higashihiroshima.hiroshima.jp\",\"hongo.hiroshima.jp\",\"jinsekikogen.hiroshima.jp\",\"kaita.hiroshima.jp\",\"kui.hiroshima.jp\",\"kumano.hiroshima.jp\",\"kure.hiroshima.jp\",\"mihara.hiroshima.jp\",\"miyoshi.hiroshima.jp\",\"naka.hiroshima.jp\",\"onomichi.hiroshima.jp\",\"osakikamijima.hiroshima.jp\",\"otake.hiroshima.jp\",\"saka.hiroshima.jp\",\"sera.hiroshima.jp\",\"seranishi.hiroshima.jp\",\"shinichi.hiroshima.jp\",\"shobara.hiroshima.jp\",\"takehara.hiroshima.jp\",\"abashiri.hokkaido.jp\",\"abira.hokkaido.jp\",\"aibetsu.hokkaido.jp\",\"akabira.hokkaido.jp\",\"akkeshi.hokkaido.jp\",\"asahikawa.hokkaido.jp\",\"ashibetsu.hokkaido.jp\",\"ashoro.hokkaido.jp\",\"assabu.hokkaido.jp\",\"atsuma.hokkaido.jp\",\"bibai.hokkaido.jp\",\"biei.hokkaido.jp\",\"bifuka.hokkaido.jp\",\"bihoro.hokkaido.jp\",\"biratori.hokkaido.jp\",\"chippubetsu.hokkaido.jp\",\"chitose.hokkaido.jp\",\"date.hokkaido.jp\",\"ebetsu.hokkaido.jp\",\"embetsu.hokkaido.jp\",\"eniwa.hokkaido.jp\",\"erimo.hokkaido.jp\",\"esan.hokkaido.jp\",\"esashi.hokkaido.jp\",\"fukagawa.hokkaido.jp\",\"fukushima.hokkaido.jp\",\"furano.hokkaido.jp\",\"furubira.hokkaido.jp\",\"haboro.hokkaido.jp\",\"hakodate.hokkaido.jp\",\"hamatonbetsu.hokkaido.jp\",\"hidaka.hokkaido.jp\",\"higashikagura.hokkaido.jp\",\"higashikawa.hokkaido.jp\",\"hiroo.hokkaido.jp\",\"hokuryu.hokkaido.jp\",\"hokuto.hokkaido.jp\",\"honbetsu.hokkaido.jp\",\"horokanai.hokkaido.jp\",\"horonobe.hokkaido.jp\",\"ikeda.hokkaido.jp\",\"imakane.hokkaido.jp\",\"ishikari.hokkaido.jp\",\"iwamizawa.hokkaido.jp\",\"iwanai.hokkaido.jp\",\"kamifurano.hokkaido.jp\",\"kamikawa.hokkaido.jp\",\"kamishihoro.hokkaido.jp\",\"kamisunagawa.hokkaido.jp\",\"kamoenai.hokkaido.jp\",\"kayabe.hokkaido.jp\",\"kembuchi.hokkaido.jp\",\"kikonai.hokkaido.jp\",\"kimobetsu.hokkaido.jp\",\"kitahiroshima.hokkaido.jp\",\"kitami.hokkaido.jp\",\"kiyosato.hokkaido.jp\",\"koshimizu.hokkaido.jp\",\"kunneppu.hokkaido.jp\",\"kuriyama.hokkaido.jp\",\"kuromatsunai.hokkaido.jp\",\"kushiro.hokkaido.jp\",\"kutchan.hokkaido.jp\",\"kyowa.hokkaido.jp\",\"mashike.hokkaido.jp\",\"matsumae.hokkaido.jp\",\"mikasa.hokkaido.jp\",\"minamifurano.hokkaido.jp\",\"mombetsu.hokkaido.jp\",\"moseushi.hokkaido.jp\",\"mukawa.hokkaido.jp\",\"muroran.hokkaido.jp\",\"naie.hokkaido.jp\",\"nakagawa.hokkaido.jp\",\"nakasatsunai.hokkaido.jp\",\"nakatombetsu.hokkaido.jp\",\"nanae.hokkaido.jp\",\"nanporo.hokkaido.jp\",\"nayoro.hokkaido.jp\",\"nemuro.hokkaido.jp\",\"niikappu.hokkaido.jp\",\"niki.hokkaido.jp\",\"nishiokoppe.hokkaido.jp\",\"noboribetsu.hokkaido.jp\",\"numata.hokkaido.jp\",\"obihiro.hokkaido.jp\",\"obira.hokkaido.jp\",\"oketo.hokkaido.jp\",\"okoppe.hokkaido.jp\",\"otaru.hokkaido.jp\",\"otobe.hokkaido.jp\",\"otofuke.hokkaido.jp\",\"otoineppu.hokkaido.jp\",\"oumu.hokkaido.jp\",\"ozora.hokkaido.jp\",\"pippu.hokkaido.jp\",\"rankoshi.hokkaido.jp\",\"rebun.hokkaido.jp\",\"rikubetsu.hokkaido.jp\",\"rishiri.hokkaido.jp\",\"rishirifuji.hokkaido.jp\",\"saroma.hokkaido.jp\",\"sarufutsu.hokkaido.jp\",\"shakotan.hokkaido.jp\",\"shari.hokkaido.jp\",\"shibecha.hokkaido.jp\",\"shibetsu.hokkaido.jp\",\"shikabe.hokkaido.jp\",\"shikaoi.hokkaido.jp\",\"shimamaki.hokkaido.jp\",\"shimizu.hokkaido.jp\",\"shimokawa.hokkaido.jp\",\"shinshinotsu.hokkaido.jp\",\"shintoku.hokkaido.jp\",\"shiranuka.hokkaido.jp\",\"shiraoi.hokkaido.jp\",\"shiriuchi.hokkaido.jp\",\"sobetsu.hokkaido.jp\",\"sunagawa.hokkaido.jp\",\"taiki.hokkaido.jp\",\"takasu.hokkaido.jp\",\"takikawa.hokkaido.jp\",\"takinoue.hokkaido.jp\",\"teshikaga.hokkaido.jp\",\"tobetsu.hokkaido.jp\",\"tohma.hokkaido.jp\",\"tomakomai.hokkaido.jp\",\"tomari.hokkaido.jp\",\"toya.hokkaido.jp\",\"toyako.hokkaido.jp\",\"toyotomi.hokkaido.jp\",\"toyoura.hokkaido.jp\",\"tsubetsu.hokkaido.jp\",\"tsukigata.hokkaido.jp\",\"urakawa.hokkaido.jp\",\"urausu.hokkaido.jp\",\"uryu.hokkaido.jp\",\"utashinai.hokkaido.jp\",\"wakkanai.hokkaido.jp\",\"wassamu.hokkaido.jp\",\"yakumo.hokkaido.jp\",\"yoichi.hokkaido.jp\",\"aioi.hyogo.jp\",\"akashi.hyogo.jp\",\"ako.hyogo.jp\",\"amagasaki.hyogo.jp\",\"aogaki.hyogo.jp\",\"asago.hyogo.jp\",\"ashiya.hyogo.jp\",\"awaji.hyogo.jp\",\"fukusaki.hyogo.jp\",\"goshiki.hyogo.jp\",\"harima.hyogo.jp\",\"himeji.hyogo.jp\",\"ichikawa.hyogo.jp\",\"inagawa.hyogo.jp\",\"itami.hyogo.jp\",\"kakogawa.hyogo.jp\",\"kamigori.hyogo.jp\",\"kamikawa.hyogo.jp\",\"kasai.hyogo.jp\",\"kasuga.hyogo.jp\",\"kawanishi.hyogo.jp\",\"miki.hyogo.jp\",\"minamiawaji.hyogo.jp\",\"nishinomiya.hyogo.jp\",\"nishiwaki.hyogo.jp\",\"ono.hyogo.jp\",\"sanda.hyogo.jp\",\"sannan.hyogo.jp\",\"sasayama.hyogo.jp\",\"sayo.hyogo.jp\",\"shingu.hyogo.jp\",\"shinonsen.hyogo.jp\",\"shiso.hyogo.jp\",\"sumoto.hyogo.jp\",\"taishi.hyogo.jp\",\"taka.hyogo.jp\",\"takarazuka.hyogo.jp\",\"takasago.hyogo.jp\",\"takino.hyogo.jp\",\"tamba.hyogo.jp\",\"tatsuno.hyogo.jp\",\"toyooka.hyogo.jp\",\"yabu.hyogo.jp\",\"yashiro.hyogo.jp\",\"yoka.hyogo.jp\",\"yokawa.hyogo.jp\",\"ami.ibaraki.jp\",\"asahi.ibaraki.jp\",\"bando.ibaraki.jp\",\"chikusei.ibaraki.jp\",\"daigo.ibaraki.jp\",\"fujishiro.ibaraki.jp\",\"hitachi.ibaraki.jp\",\"hitachinaka.ibaraki.jp\",\"hitachiomiya.ibaraki.jp\",\"hitachiota.ibaraki.jp\",\"ibaraki.ibaraki.jp\",\"ina.ibaraki.jp\",\"inashiki.ibaraki.jp\",\"itako.ibaraki.jp\",\"iwama.ibaraki.jp\",\"joso.ibaraki.jp\",\"kamisu.ibaraki.jp\",\"kasama.ibaraki.jp\",\"kashima.ibaraki.jp\",\"kasumigaura.ibaraki.jp\",\"koga.ibaraki.jp\",\"miho.ibaraki.jp\",\"mito.ibaraki.jp\",\"moriya.ibaraki.jp\",\"naka.ibaraki.jp\",\"namegata.ibaraki.jp\",\"oarai.ibaraki.jp\",\"ogawa.ibaraki.jp\",\"omitama.ibaraki.jp\",\"ryugasaki.ibaraki.jp\",\"sakai.ibaraki.jp\",\"sakuragawa.ibaraki.jp\",\"shimodate.ibaraki.jp\",\"shimotsuma.ibaraki.jp\",\"shirosato.ibaraki.jp\",\"sowa.ibaraki.jp\",\"suifu.ibaraki.jp\",\"takahagi.ibaraki.jp\",\"tamatsukuri.ibaraki.jp\",\"tokai.ibaraki.jp\",\"tomobe.ibaraki.jp\",\"tone.ibaraki.jp\",\"toride.ibaraki.jp\",\"tsuchiura.ibaraki.jp\",\"tsukuba.ibaraki.jp\",\"uchihara.ibaraki.jp\",\"ushiku.ibaraki.jp\",\"yachiyo.ibaraki.jp\",\"yamagata.ibaraki.jp\",\"yawara.ibaraki.jp\",\"yuki.ibaraki.jp\",\"anamizu.ishikawa.jp\",\"hakui.ishikawa.jp\",\"hakusan.ishikawa.jp\",\"kaga.ishikawa.jp\",\"kahoku.ishikawa.jp\",\"kanazawa.ishikawa.jp\",\"kawakita.ishikawa.jp\",\"komatsu.ishikawa.jp\",\"nakanoto.ishikawa.jp\",\"nanao.ishikawa.jp\",\"nomi.ishikawa.jp\",\"nonoichi.ishikawa.jp\",\"noto.ishikawa.jp\",\"shika.ishikawa.jp\",\"suzu.ishikawa.jp\",\"tsubata.ishikawa.jp\",\"tsurugi.ishikawa.jp\",\"uchinada.ishikawa.jp\",\"wajima.ishikawa.jp\",\"fudai.iwate.jp\",\"fujisawa.iwate.jp\",\"hanamaki.iwate.jp\",\"hiraizumi.iwate.jp\",\"hirono.iwate.jp\",\"ichinohe.iwate.jp\",\"ichinoseki.iwate.jp\",\"iwaizumi.iwate.jp\",\"iwate.iwate.jp\",\"joboji.iwate.jp\",\"kamaishi.iwate.jp\",\"kanegasaki.iwate.jp\",\"karumai.iwate.jp\",\"kawai.iwate.jp\",\"kitakami.iwate.jp\",\"kuji.iwate.jp\",\"kunohe.iwate.jp\",\"kuzumaki.iwate.jp\",\"miyako.iwate.jp\",\"mizusawa.iwate.jp\",\"morioka.iwate.jp\",\"ninohe.iwate.jp\",\"noda.iwate.jp\",\"ofunato.iwate.jp\",\"oshu.iwate.jp\",\"otsuchi.iwate.jp\",\"rikuzentakata.iwate.jp\",\"shiwa.iwate.jp\",\"shizukuishi.iwate.jp\",\"sumita.iwate.jp\",\"tanohata.iwate.jp\",\"tono.iwate.jp\",\"yahaba.iwate.jp\",\"yamada.iwate.jp\",\"ayagawa.kagawa.jp\",\"higashikagawa.kagawa.jp\",\"kanonji.kagawa.jp\",\"kotohira.kagawa.jp\",\"manno.kagawa.jp\",\"marugame.kagawa.jp\",\"mitoyo.kagawa.jp\",\"naoshima.kagawa.jp\",\"sanuki.kagawa.jp\",\"tadotsu.kagawa.jp\",\"takamatsu.kagawa.jp\",\"tonosho.kagawa.jp\",\"uchinomi.kagawa.jp\",\"utazu.kagawa.jp\",\"zentsuji.kagawa.jp\",\"akune.kagoshima.jp\",\"amami.kagoshima.jp\",\"hioki.kagoshima.jp\",\"isa.kagoshima.jp\",\"isen.kagoshima.jp\",\"izumi.kagoshima.jp\",\"kagoshima.kagoshima.jp\",\"kanoya.kagoshima.jp\",\"kawanabe.kagoshima.jp\",\"kinko.kagoshima.jp\",\"kouyama.kagoshima.jp\",\"makurazaki.kagoshima.jp\",\"matsumoto.kagoshima.jp\",\"minamitane.kagoshima.jp\",\"nakatane.kagoshima.jp\",\"nishinoomote.kagoshima.jp\",\"satsumasendai.kagoshima.jp\",\"soo.kagoshima.jp\",\"tarumizu.kagoshima.jp\",\"yusui.kagoshima.jp\",\"aikawa.kanagawa.jp\",\"atsugi.kanagawa.jp\",\"ayase.kanagawa.jp\",\"chigasaki.kanagawa.jp\",\"ebina.kanagawa.jp\",\"fujisawa.kanagawa.jp\",\"hadano.kanagawa.jp\",\"hakone.kanagawa.jp\",\"hiratsuka.kanagawa.jp\",\"isehara.kanagawa.jp\",\"kaisei.kanagawa.jp\",\"kamakura.kanagawa.jp\",\"kiyokawa.kanagawa.jp\",\"matsuda.kanagawa.jp\",\"minamiashigara.kanagawa.jp\",\"miura.kanagawa.jp\",\"nakai.kanagawa.jp\",\"ninomiya.kanagawa.jp\",\"odawara.kanagawa.jp\",\"oi.kanagawa.jp\",\"oiso.kanagawa.jp\",\"sagamihara.kanagawa.jp\",\"samukawa.kanagawa.jp\",\"tsukui.kanagawa.jp\",\"yamakita.kanagawa.jp\",\"yamato.kanagawa.jp\",\"yokosuka.kanagawa.jp\",\"yugawara.kanagawa.jp\",\"zama.kanagawa.jp\",\"zushi.kanagawa.jp\",\"aki.kochi.jp\",\"geisei.kochi.jp\",\"hidaka.kochi.jp\",\"higashitsuno.kochi.jp\",\"ino.kochi.jp\",\"kagami.kochi.jp\",\"kami.kochi.jp\",\"kitagawa.kochi.jp\",\"kochi.kochi.jp\",\"mihara.kochi.jp\",\"motoyama.kochi.jp\",\"muroto.kochi.jp\",\"nahari.kochi.jp\",\"nakamura.kochi.jp\",\"nankoku.kochi.jp\",\"nishitosa.kochi.jp\",\"niyodogawa.kochi.jp\",\"ochi.kochi.jp\",\"okawa.kochi.jp\",\"otoyo.kochi.jp\",\"otsuki.kochi.jp\",\"sakawa.kochi.jp\",\"sukumo.kochi.jp\",\"susaki.kochi.jp\",\"tosa.kochi.jp\",\"tosashimizu.kochi.jp\",\"toyo.kochi.jp\",\"tsuno.kochi.jp\",\"umaji.kochi.jp\",\"yasuda.kochi.jp\",\"yusuhara.kochi.jp\",\"amakusa.kumamoto.jp\",\"arao.kumamoto.jp\",\"aso.kumamoto.jp\",\"choyo.kumamoto.jp\",\"gyokuto.kumamoto.jp\",\"kamiamakusa.kumamoto.jp\",\"kikuchi.kumamoto.jp\",\"kumamoto.kumamoto.jp\",\"mashiki.kumamoto.jp\",\"mifune.kumamoto.jp\",\"minamata.kumamoto.jp\",\"minamioguni.kumamoto.jp\",\"nagasu.kumamoto.jp\",\"nishihara.kumamoto.jp\",\"oguni.kumamoto.jp\",\"ozu.kumamoto.jp\",\"sumoto.kumamoto.jp\",\"takamori.kumamoto.jp\",\"uki.kumamoto.jp\",\"uto.kumamoto.jp\",\"yamaga.kumamoto.jp\",\"yamato.kumamoto.jp\",\"yatsushiro.kumamoto.jp\",\"ayabe.kyoto.jp\",\"fukuchiyama.kyoto.jp\",\"higashiyama.kyoto.jp\",\"ide.kyoto.jp\",\"ine.kyoto.jp\",\"joyo.kyoto.jp\",\"kameoka.kyoto.jp\",\"kamo.kyoto.jp\",\"kita.kyoto.jp\",\"kizu.kyoto.jp\",\"kumiyama.kyoto.jp\",\"kyotamba.kyoto.jp\",\"kyotanabe.kyoto.jp\",\"kyotango.kyoto.jp\",\"maizuru.kyoto.jp\",\"minami.kyoto.jp\",\"minamiyamashiro.kyoto.jp\",\"miyazu.kyoto.jp\",\"muko.kyoto.jp\",\"nagaokakyo.kyoto.jp\",\"nakagyo.kyoto.jp\",\"nantan.kyoto.jp\",\"oyamazaki.kyoto.jp\",\"sakyo.kyoto.jp\",\"seika.kyoto.jp\",\"tanabe.kyoto.jp\",\"uji.kyoto.jp\",\"ujitawara.kyoto.jp\",\"wazuka.kyoto.jp\",\"yamashina.kyoto.jp\",\"yawata.kyoto.jp\",\"asahi.mie.jp\",\"inabe.mie.jp\",\"ise.mie.jp\",\"kameyama.mie.jp\",\"kawagoe.mie.jp\",\"kiho.mie.jp\",\"kisosaki.mie.jp\",\"kiwa.mie.jp\",\"komono.mie.jp\",\"kumano.mie.jp\",\"kuwana.mie.jp\",\"matsusaka.mie.jp\",\"meiwa.mie.jp\",\"mihama.mie.jp\",\"minamiise.mie.jp\",\"misugi.mie.jp\",\"miyama.mie.jp\",\"nabari.mie.jp\",\"shima.mie.jp\",\"suzuka.mie.jp\",\"tado.mie.jp\",\"taiki.mie.jp\",\"taki.mie.jp\",\"tamaki.mie.jp\",\"toba.mie.jp\",\"tsu.mie.jp\",\"udono.mie.jp\",\"ureshino.mie.jp\",\"watarai.mie.jp\",\"yokkaichi.mie.jp\",\"furukawa.miyagi.jp\",\"higashimatsushima.miyagi.jp\",\"ishinomaki.miyagi.jp\",\"iwanuma.miyagi.jp\",\"kakuda.miyagi.jp\",\"kami.miyagi.jp\",\"kawasaki.miyagi.jp\",\"marumori.miyagi.jp\",\"matsushima.miyagi.jp\",\"minamisanriku.miyagi.jp\",\"misato.miyagi.jp\",\"murata.miyagi.jp\",\"natori.miyagi.jp\",\"ogawara.miyagi.jp\",\"ohira.miyagi.jp\",\"onagawa.miyagi.jp\",\"osaki.miyagi.jp\",\"rifu.miyagi.jp\",\"semine.miyagi.jp\",\"shibata.miyagi.jp\",\"shichikashuku.miyagi.jp\",\"shikama.miyagi.jp\",\"shiogama.miyagi.jp\",\"shiroishi.miyagi.jp\",\"tagajo.miyagi.jp\",\"taiwa.miyagi.jp\",\"tome.miyagi.jp\",\"tomiya.miyagi.jp\",\"wakuya.miyagi.jp\",\"watari.miyagi.jp\",\"yamamoto.miyagi.jp\",\"zao.miyagi.jp\",\"aya.miyazaki.jp\",\"ebino.miyazaki.jp\",\"gokase.miyazaki.jp\",\"hyuga.miyazaki.jp\",\"kadogawa.miyazaki.jp\",\"kawaminami.miyazaki.jp\",\"kijo.miyazaki.jp\",\"kitagawa.miyazaki.jp\",\"kitakata.miyazaki.jp\",\"kitaura.miyazaki.jp\",\"kobayashi.miyazaki.jp\",\"kunitomi.miyazaki.jp\",\"kushima.miyazaki.jp\",\"mimata.miyazaki.jp\",\"miyakonojo.miyazaki.jp\",\"miyazaki.miyazaki.jp\",\"morotsuka.miyazaki.jp\",\"nichinan.miyazaki.jp\",\"nishimera.miyazaki.jp\",\"nobeoka.miyazaki.jp\",\"saito.miyazaki.jp\",\"shiiba.miyazaki.jp\",\"shintomi.miyazaki.jp\",\"takaharu.miyazaki.jp\",\"takanabe.miyazaki.jp\",\"takazaki.miyazaki.jp\",\"tsuno.miyazaki.jp\",\"achi.nagano.jp\",\"agematsu.nagano.jp\",\"anan.nagano.jp\",\"aoki.nagano.jp\",\"asahi.nagano.jp\",\"azumino.nagano.jp\",\"chikuhoku.nagano.jp\",\"chikuma.nagano.jp\",\"chino.nagano.jp\",\"fujimi.nagano.jp\",\"hakuba.nagano.jp\",\"hara.nagano.jp\",\"hiraya.nagano.jp\",\"iida.nagano.jp\",\"iijima.nagano.jp\",\"iiyama.nagano.jp\",\"iizuna.nagano.jp\",\"ikeda.nagano.jp\",\"ikusaka.nagano.jp\",\"ina.nagano.jp\",\"karuizawa.nagano.jp\",\"kawakami.nagano.jp\",\"kiso.nagano.jp\",\"kisofukushima.nagano.jp\",\"kitaaiki.nagano.jp\",\"komagane.nagano.jp\",\"komoro.nagano.jp\",\"matsukawa.nagano.jp\",\"matsumoto.nagano.jp\",\"miasa.nagano.jp\",\"minamiaiki.nagano.jp\",\"minamimaki.nagano.jp\",\"minamiminowa.nagano.jp\",\"minowa.nagano.jp\",\"miyada.nagano.jp\",\"miyota.nagano.jp\",\"mochizuki.nagano.jp\",\"nagano.nagano.jp\",\"nagawa.nagano.jp\",\"nagiso.nagano.jp\",\"nakagawa.nagano.jp\",\"nakano.nagano.jp\",\"nozawaonsen.nagano.jp\",\"obuse.nagano.jp\",\"ogawa.nagano.jp\",\"okaya.nagano.jp\",\"omachi.nagano.jp\",\"omi.nagano.jp\",\"ookuwa.nagano.jp\",\"ooshika.nagano.jp\",\"otaki.nagano.jp\",\"otari.nagano.jp\",\"sakae.nagano.jp\",\"sakaki.nagano.jp\",\"saku.nagano.jp\",\"sakuho.nagano.jp\",\"shimosuwa.nagano.jp\",\"shinanomachi.nagano.jp\",\"shiojiri.nagano.jp\",\"suwa.nagano.jp\",\"suzaka.nagano.jp\",\"takagi.nagano.jp\",\"takamori.nagano.jp\",\"takayama.nagano.jp\",\"tateshina.nagano.jp\",\"tatsuno.nagano.jp\",\"togakushi.nagano.jp\",\"togura.nagano.jp\",\"tomi.nagano.jp\",\"ueda.nagano.jp\",\"wada.nagano.jp\",\"yamagata.nagano.jp\",\"yamanouchi.nagano.jp\",\"yasaka.nagano.jp\",\"yasuoka.nagano.jp\",\"chijiwa.nagasaki.jp\",\"futsu.nagasaki.jp\",\"goto.nagasaki.jp\",\"hasami.nagasaki.jp\",\"hirado.nagasaki.jp\",\"iki.nagasaki.jp\",\"isahaya.nagasaki.jp\",\"kawatana.nagasaki.jp\",\"kuchinotsu.nagasaki.jp\",\"matsuura.nagasaki.jp\",\"nagasaki.nagasaki.jp\",\"obama.nagasaki.jp\",\"omura.nagasaki.jp\",\"oseto.nagasaki.jp\",\"saikai.nagasaki.jp\",\"sasebo.nagasaki.jp\",\"seihi.nagasaki.jp\",\"shimabara.nagasaki.jp\",\"shinkamigoto.nagasaki.jp\",\"togitsu.nagasaki.jp\",\"tsushima.nagasaki.jp\",\"unzen.nagasaki.jp\",\"ando.nara.jp\",\"gose.nara.jp\",\"heguri.nara.jp\",\"higashiyoshino.nara.jp\",\"ikaruga.nara.jp\",\"ikoma.nara.jp\",\"kamikitayama.nara.jp\",\"kanmaki.nara.jp\",\"kashiba.nara.jp\",\"kashihara.nara.jp\",\"katsuragi.nara.jp\",\"kawai.nara.jp\",\"kawakami.nara.jp\",\"kawanishi.nara.jp\",\"koryo.nara.jp\",\"kurotaki.nara.jp\",\"mitsue.nara.jp\",\"miyake.nara.jp\",\"nara.nara.jp\",\"nosegawa.nara.jp\",\"oji.nara.jp\",\"ouda.nara.jp\",\"oyodo.nara.jp\",\"sakurai.nara.jp\",\"sango.nara.jp\",\"shimoichi.nara.jp\",\"shimokitayama.nara.jp\",\"shinjo.nara.jp\",\"soni.nara.jp\",\"takatori.nara.jp\",\"tawaramoto.nara.jp\",\"tenkawa.nara.jp\",\"tenri.nara.jp\",\"uda.nara.jp\",\"yamatokoriyama.nara.jp\",\"yamatotakada.nara.jp\",\"yamazoe.nara.jp\",\"yoshino.nara.jp\",\"aga.niigata.jp\",\"agano.niigata.jp\",\"gosen.niigata.jp\",\"itoigawa.niigata.jp\",\"izumozaki.niigata.jp\",\"joetsu.niigata.jp\",\"kamo.niigata.jp\",\"kariwa.niigata.jp\",\"kashiwazaki.niigata.jp\",\"minamiuonuma.niigata.jp\",\"mitsuke.niigata.jp\",\"muika.niigata.jp\",\"murakami.niigata.jp\",\"myoko.niigata.jp\",\"nagaoka.niigata.jp\",\"niigata.niigata.jp\",\"ojiya.niigata.jp\",\"omi.niigata.jp\",\"sado.niigata.jp\",\"sanjo.niigata.jp\",\"seiro.niigata.jp\",\"seirou.niigata.jp\",\"sekikawa.niigata.jp\",\"shibata.niigata.jp\",\"tagami.niigata.jp\",\"tainai.niigata.jp\",\"tochio.niigata.jp\",\"tokamachi.niigata.jp\",\"tsubame.niigata.jp\",\"tsunan.niigata.jp\",\"uonuma.niigata.jp\",\"yahiko.niigata.jp\",\"yoita.niigata.jp\",\"yuzawa.niigata.jp\",\"beppu.oita.jp\",\"bungoono.oita.jp\",\"bungotakada.oita.jp\",\"hasama.oita.jp\",\"hiji.oita.jp\",\"himeshima.oita.jp\",\"hita.oita.jp\",\"kamitsue.oita.jp\",\"kokonoe.oita.jp\",\"kuju.oita.jp\",\"kunisaki.oita.jp\",\"kusu.oita.jp\",\"oita.oita.jp\",\"saiki.oita.jp\",\"taketa.oita.jp\",\"tsukumi.oita.jp\",\"usa.oita.jp\",\"usuki.oita.jp\",\"yufu.oita.jp\",\"akaiwa.okayama.jp\",\"asakuchi.okayama.jp\",\"bizen.okayama.jp\",\"hayashima.okayama.jp\",\"ibara.okayama.jp\",\"kagamino.okayama.jp\",\"kasaoka.okayama.jp\",\"kibichuo.okayama.jp\",\"kumenan.okayama.jp\",\"kurashiki.okayama.jp\",\"maniwa.okayama.jp\",\"misaki.okayama.jp\",\"nagi.okayama.jp\",\"niimi.okayama.jp\",\"nishiawakura.okayama.jp\",\"okayama.okayama.jp\",\"satosho.okayama.jp\",\"setouchi.okayama.jp\",\"shinjo.okayama.jp\",\"shoo.okayama.jp\",\"soja.okayama.jp\",\"takahashi.okayama.jp\",\"tamano.okayama.jp\",\"tsuyama.okayama.jp\",\"wake.okayama.jp\",\"yakage.okayama.jp\",\"aguni.okinawa.jp\",\"ginowan.okinawa.jp\",\"ginoza.okinawa.jp\",\"gushikami.okinawa.jp\",\"haebaru.okinawa.jp\",\"higashi.okinawa.jp\",\"hirara.okinawa.jp\",\"iheya.okinawa.jp\",\"ishigaki.okinawa.jp\",\"ishikawa.okinawa.jp\",\"itoman.okinawa.jp\",\"izena.okinawa.jp\",\"kadena.okinawa.jp\",\"kin.okinawa.jp\",\"kitadaito.okinawa.jp\",\"kitanakagusuku.okinawa.jp\",\"kumejima.okinawa.jp\",\"kunigami.okinawa.jp\",\"minamidaito.okinawa.jp\",\"motobu.okinawa.jp\",\"nago.okinawa.jp\",\"naha.okinawa.jp\",\"nakagusuku.okinawa.jp\",\"nakijin.okinawa.jp\",\"nanjo.okinawa.jp\",\"nishihara.okinawa.jp\",\"ogimi.okinawa.jp\",\"okinawa.okinawa.jp\",\"onna.okinawa.jp\",\"shimoji.okinawa.jp\",\"taketomi.okinawa.jp\",\"tarama.okinawa.jp\",\"tokashiki.okinawa.jp\",\"tomigusuku.okinawa.jp\",\"tonaki.okinawa.jp\",\"urasoe.okinawa.jp\",\"uruma.okinawa.jp\",\"yaese.okinawa.jp\",\"yomitan.okinawa.jp\",\"yonabaru.okinawa.jp\",\"yonaguni.okinawa.jp\",\"zamami.okinawa.jp\",\"abeno.osaka.jp\",\"chihayaakasaka.osaka.jp\",\"chuo.osaka.jp\",\"daito.osaka.jp\",\"fujiidera.osaka.jp\",\"habikino.osaka.jp\",\"hannan.osaka.jp\",\"higashiosaka.osaka.jp\",\"higashisumiyoshi.osaka.jp\",\"higashiyodogawa.osaka.jp\",\"hirakata.osaka.jp\",\"ibaraki.osaka.jp\",\"ikeda.osaka.jp\",\"izumi.osaka.jp\",\"izumiotsu.osaka.jp\",\"izumisano.osaka.jp\",\"kadoma.osaka.jp\",\"kaizuka.osaka.jp\",\"kanan.osaka.jp\",\"kashiwara.osaka.jp\",\"katano.osaka.jp\",\"kawachinagano.osaka.jp\",\"kishiwada.osaka.jp\",\"kita.osaka.jp\",\"kumatori.osaka.jp\",\"matsubara.osaka.jp\",\"minato.osaka.jp\",\"minoh.osaka.jp\",\"misaki.osaka.jp\",\"moriguchi.osaka.jp\",\"neyagawa.osaka.jp\",\"nishi.osaka.jp\",\"nose.osaka.jp\",\"osakasayama.osaka.jp\",\"sakai.osaka.jp\",\"sayama.osaka.jp\",\"sennan.osaka.jp\",\"settsu.osaka.jp\",\"shijonawate.osaka.jp\",\"shimamoto.osaka.jp\",\"suita.osaka.jp\",\"tadaoka.osaka.jp\",\"taishi.osaka.jp\",\"tajiri.osaka.jp\",\"takaishi.osaka.jp\",\"takatsuki.osaka.jp\",\"tondabayashi.osaka.jp\",\"toyonaka.osaka.jp\",\"toyono.osaka.jp\",\"yao.osaka.jp\",\"ariake.saga.jp\",\"arita.saga.jp\",\"fukudomi.saga.jp\",\"genkai.saga.jp\",\"hamatama.saga.jp\",\"hizen.saga.jp\",\"imari.saga.jp\",\"kamimine.saga.jp\",\"kanzaki.saga.jp\",\"karatsu.saga.jp\",\"kashima.saga.jp\",\"kitagata.saga.jp\",\"kitahata.saga.jp\",\"kiyama.saga.jp\",\"kouhoku.saga.jp\",\"kyuragi.saga.jp\",\"nishiarita.saga.jp\",\"ogi.saga.jp\",\"omachi.saga.jp\",\"ouchi.saga.jp\",\"saga.saga.jp\",\"shiroishi.saga.jp\",\"taku.saga.jp\",\"tara.saga.jp\",\"tosu.saga.jp\",\"yoshinogari.saga.jp\",\"arakawa.saitama.jp\",\"asaka.saitama.jp\",\"chichibu.saitama.jp\",\"fujimi.saitama.jp\",\"fujimino.saitama.jp\",\"fukaya.saitama.jp\",\"hanno.saitama.jp\",\"hanyu.saitama.jp\",\"hasuda.saitama.jp\",\"hatogaya.saitama.jp\",\"hatoyama.saitama.jp\",\"hidaka.saitama.jp\",\"higashichichibu.saitama.jp\",\"higashimatsuyama.saitama.jp\",\"honjo.saitama.jp\",\"ina.saitama.jp\",\"iruma.saitama.jp\",\"iwatsuki.saitama.jp\",\"kamiizumi.saitama.jp\",\"kamikawa.saitama.jp\",\"kamisato.saitama.jp\",\"kasukabe.saitama.jp\",\"kawagoe.saitama.jp\",\"kawaguchi.saitama.jp\",\"kawajima.saitama.jp\",\"kazo.saitama.jp\",\"kitamoto.saitama.jp\",\"koshigaya.saitama.jp\",\"kounosu.saitama.jp\",\"kuki.saitama.jp\",\"kumagaya.saitama.jp\",\"matsubushi.saitama.jp\",\"minano.saitama.jp\",\"misato.saitama.jp\",\"miyashiro.saitama.jp\",\"miyoshi.saitama.jp\",\"moroyama.saitama.jp\",\"nagatoro.saitama.jp\",\"namegawa.saitama.jp\",\"niiza.saitama.jp\",\"ogano.saitama.jp\",\"ogawa.saitama.jp\",\"ogose.saitama.jp\",\"okegawa.saitama.jp\",\"omiya.saitama.jp\",\"otaki.saitama.jp\",\"ranzan.saitama.jp\",\"ryokami.saitama.jp\",\"saitama.saitama.jp\",\"sakado.saitama.jp\",\"satte.saitama.jp\",\"sayama.saitama.jp\",\"shiki.saitama.jp\",\"shiraoka.saitama.jp\",\"soka.saitama.jp\",\"sugito.saitama.jp\",\"toda.saitama.jp\",\"tokigawa.saitama.jp\",\"tokorozawa.saitama.jp\",\"tsurugashima.saitama.jp\",\"urawa.saitama.jp\",\"warabi.saitama.jp\",\"yashio.saitama.jp\",\"yokoze.saitama.jp\",\"yono.saitama.jp\",\"yorii.saitama.jp\",\"yoshida.saitama.jp\",\"yoshikawa.saitama.jp\",\"yoshimi.saitama.jp\",\"aisho.shiga.jp\",\"gamo.shiga.jp\",\"higashiomi.shiga.jp\",\"hikone.shiga.jp\",\"koka.shiga.jp\",\"konan.shiga.jp\",\"kosei.shiga.jp\",\"koto.shiga.jp\",\"kusatsu.shiga.jp\",\"maibara.shiga.jp\",\"moriyama.shiga.jp\",\"nagahama.shiga.jp\",\"nishiazai.shiga.jp\",\"notogawa.shiga.jp\",\"omihachiman.shiga.jp\",\"otsu.shiga.jp\",\"ritto.shiga.jp\",\"ryuoh.shiga.jp\",\"takashima.shiga.jp\",\"takatsuki.shiga.jp\",\"torahime.shiga.jp\",\"toyosato.shiga.jp\",\"yasu.shiga.jp\",\"akagi.shimane.jp\",\"ama.shimane.jp\",\"gotsu.shimane.jp\",\"hamada.shimane.jp\",\"higashiizumo.shimane.jp\",\"hikawa.shimane.jp\",\"hikimi.shimane.jp\",\"izumo.shimane.jp\",\"kakinoki.shimane.jp\",\"masuda.shimane.jp\",\"matsue.shimane.jp\",\"misato.shimane.jp\",\"nishinoshima.shimane.jp\",\"ohda.shimane.jp\",\"okinoshima.shimane.jp\",\"okuizumo.shimane.jp\",\"shimane.shimane.jp\",\"tamayu.shimane.jp\",\"tsuwano.shimane.jp\",\"unnan.shimane.jp\",\"yakumo.shimane.jp\",\"yasugi.shimane.jp\",\"yatsuka.shimane.jp\",\"arai.shizuoka.jp\",\"atami.shizuoka.jp\",\"fuji.shizuoka.jp\",\"fujieda.shizuoka.jp\",\"fujikawa.shizuoka.jp\",\"fujinomiya.shizuoka.jp\",\"fukuroi.shizuoka.jp\",\"gotemba.shizuoka.jp\",\"haibara.shizuoka.jp\",\"hamamatsu.shizuoka.jp\",\"higashiizu.shizuoka.jp\",\"ito.shizuoka.jp\",\"iwata.shizuoka.jp\",\"izu.shizuoka.jp\",\"izunokuni.shizuoka.jp\",\"kakegawa.shizuoka.jp\",\"kannami.shizuoka.jp\",\"kawanehon.shizuoka.jp\",\"kawazu.shizuoka.jp\",\"kikugawa.shizuoka.jp\",\"kosai.shizuoka.jp\",\"makinohara.shizuoka.jp\",\"matsuzaki.shizuoka.jp\",\"minamiizu.shizuoka.jp\",\"mishima.shizuoka.jp\",\"morimachi.shizuoka.jp\",\"nishiizu.shizuoka.jp\",\"numazu.shizuoka.jp\",\"omaezaki.shizuoka.jp\",\"shimada.shizuoka.jp\",\"shimizu.shizuoka.jp\",\"shimoda.shizuoka.jp\",\"shizuoka.shizuoka.jp\",\"susono.shizuoka.jp\",\"yaizu.shizuoka.jp\",\"yoshida.shizuoka.jp\",\"ashikaga.tochigi.jp\",\"bato.tochigi.jp\",\"haga.tochigi.jp\",\"ichikai.tochigi.jp\",\"iwafune.tochigi.jp\",\"kaminokawa.tochigi.jp\",\"kanuma.tochigi.jp\",\"karasuyama.tochigi.jp\",\"kuroiso.tochigi.jp\",\"mashiko.tochigi.jp\",\"mibu.tochigi.jp\",\"moka.tochigi.jp\",\"motegi.tochigi.jp\",\"nasu.tochigi.jp\",\"nasushiobara.tochigi.jp\",\"nikko.tochigi.jp\",\"nishikata.tochigi.jp\",\"nogi.tochigi.jp\",\"ohira.tochigi.jp\",\"ohtawara.tochigi.jp\",\"oyama.tochigi.jp\",\"sakura.tochigi.jp\",\"sano.tochigi.jp\",\"shimotsuke.tochigi.jp\",\"shioya.tochigi.jp\",\"takanezawa.tochigi.jp\",\"tochigi.tochigi.jp\",\"tsuga.tochigi.jp\",\"ujiie.tochigi.jp\",\"utsunomiya.tochigi.jp\",\"yaita.tochigi.jp\",\"aizumi.tokushima.jp\",\"anan.tokushima.jp\",\"ichiba.tokushima.jp\",\"itano.tokushima.jp\",\"kainan.tokushima.jp\",\"komatsushima.tokushima.jp\",\"matsushige.tokushima.jp\",\"mima.tokushima.jp\",\"minami.tokushima.jp\",\"miyoshi.tokushima.jp\",\"mugi.tokushima.jp\",\"nakagawa.tokushima.jp\",\"naruto.tokushima.jp\",\"sanagochi.tokushima.jp\",\"shishikui.tokushima.jp\",\"tokushima.tokushima.jp\",\"wajiki.tokushima.jp\",\"adachi.tokyo.jp\",\"akiruno.tokyo.jp\",\"akishima.tokyo.jp\",\"aogashima.tokyo.jp\",\"arakawa.tokyo.jp\",\"bunkyo.tokyo.jp\",\"chiyoda.tokyo.jp\",\"chofu.tokyo.jp\",\"chuo.tokyo.jp\",\"edogawa.tokyo.jp\",\"fuchu.tokyo.jp\",\"fussa.tokyo.jp\",\"hachijo.tokyo.jp\",\"hachioji.tokyo.jp\",\"hamura.tokyo.jp\",\"higashikurume.tokyo.jp\",\"higashimurayama.tokyo.jp\",\"higashiyamato.tokyo.jp\",\"hino.tokyo.jp\",\"hinode.tokyo.jp\",\"hinohara.tokyo.jp\",\"inagi.tokyo.jp\",\"itabashi.tokyo.jp\",\"katsushika.tokyo.jp\",\"kita.tokyo.jp\",\"kiyose.tokyo.jp\",\"kodaira.tokyo.jp\",\"koganei.tokyo.jp\",\"kokubunji.tokyo.jp\",\"komae.tokyo.jp\",\"koto.tokyo.jp\",\"kouzushima.tokyo.jp\",\"kunitachi.tokyo.jp\",\"machida.tokyo.jp\",\"meguro.tokyo.jp\",\"minato.tokyo.jp\",\"mitaka.tokyo.jp\",\"mizuho.tokyo.jp\",\"musashimurayama.tokyo.jp\",\"musashino.tokyo.jp\",\"nakano.tokyo.jp\",\"nerima.tokyo.jp\",\"ogasawara.tokyo.jp\",\"okutama.tokyo.jp\",\"ome.tokyo.jp\",\"oshima.tokyo.jp\",\"ota.tokyo.jp\",\"setagaya.tokyo.jp\",\"shibuya.tokyo.jp\",\"shinagawa.tokyo.jp\",\"shinjuku.tokyo.jp\",\"suginami.tokyo.jp\",\"sumida.tokyo.jp\",\"tachikawa.tokyo.jp\",\"taito.tokyo.jp\",\"tama.tokyo.jp\",\"toshima.tokyo.jp\",\"chizu.tottori.jp\",\"hino.tottori.jp\",\"kawahara.tottori.jp\",\"koge.tottori.jp\",\"kotoura.tottori.jp\",\"misasa.tottori.jp\",\"nanbu.tottori.jp\",\"nichinan.tottori.jp\",\"sakaiminato.tottori.jp\",\"tottori.tottori.jp\",\"wakasa.tottori.jp\",\"yazu.tottori.jp\",\"yonago.tottori.jp\",\"asahi.toyama.jp\",\"fuchu.toyama.jp\",\"fukumitsu.toyama.jp\",\"funahashi.toyama.jp\",\"himi.toyama.jp\",\"imizu.toyama.jp\",\"inami.toyama.jp\",\"johana.toyama.jp\",\"kamiichi.toyama.jp\",\"kurobe.toyama.jp\",\"nakaniikawa.toyama.jp\",\"namerikawa.toyama.jp\",\"nanto.toyama.jp\",\"nyuzen.toyama.jp\",\"oyabe.toyama.jp\",\"taira.toyama.jp\",\"takaoka.toyama.jp\",\"tateyama.toyama.jp\",\"toga.toyama.jp\",\"tonami.toyama.jp\",\"toyama.toyama.jp\",\"unazuki.toyama.jp\",\"uozu.toyama.jp\",\"yamada.toyama.jp\",\"arida.wakayama.jp\",\"aridagawa.wakayama.jp\",\"gobo.wakayama.jp\",\"hashimoto.wakayama.jp\",\"hidaka.wakayama.jp\",\"hirogawa.wakayama.jp\",\"inami.wakayama.jp\",\"iwade.wakayama.jp\",\"kainan.wakayama.jp\",\"kamitonda.wakayama.jp\",\"katsuragi.wakayama.jp\",\"kimino.wakayama.jp\",\"kinokawa.wakayama.jp\",\"kitayama.wakayama.jp\",\"koya.wakayama.jp\",\"koza.wakayama.jp\",\"kozagawa.wakayama.jp\",\"kudoyama.wakayama.jp\",\"kushimoto.wakayama.jp\",\"mihama.wakayama.jp\",\"misato.wakayama.jp\",\"nachikatsuura.wakayama.jp\",\"shingu.wakayama.jp\",\"shirahama.wakayama.jp\",\"taiji.wakayama.jp\",\"tanabe.wakayama.jp\",\"wakayama.wakayama.jp\",\"yuasa.wakayama.jp\",\"yura.wakayama.jp\",\"asahi.yamagata.jp\",\"funagata.yamagata.jp\",\"higashine.yamagata.jp\",\"iide.yamagata.jp\",\"kahoku.yamagata.jp\",\"kaminoyama.yamagata.jp\",\"kaneyama.yamagata.jp\",\"kawanishi.yamagata.jp\",\"mamurogawa.yamagata.jp\",\"mikawa.yamagata.jp\",\"murayama.yamagata.jp\",\"nagai.yamagata.jp\",\"nakayama.yamagata.jp\",\"nanyo.yamagata.jp\",\"nishikawa.yamagata.jp\",\"obanazawa.yamagata.jp\",\"oe.yamagata.jp\",\"oguni.yamagata.jp\",\"ohkura.yamagata.jp\",\"oishida.yamagata.jp\",\"sagae.yamagata.jp\",\"sakata.yamagata.jp\",\"sakegawa.yamagata.jp\",\"shinjo.yamagata.jp\",\"shirataka.yamagata.jp\",\"shonai.yamagata.jp\",\"takahata.yamagata.jp\",\"tendo.yamagata.jp\",\"tozawa.yamagata.jp\",\"tsuruoka.yamagata.jp\",\"yamagata.yamagata.jp\",\"yamanobe.yamagata.jp\",\"yonezawa.yamagata.jp\",\"yuza.yamagata.jp\",\"abu.yamaguchi.jp\",\"hagi.yamaguchi.jp\",\"hikari.yamaguchi.jp\",\"hofu.yamaguchi.jp\",\"iwakuni.yamaguchi.jp\",\"kudamatsu.yamaguchi.jp\",\"mitou.yamaguchi.jp\",\"nagato.yamaguchi.jp\",\"oshima.yamaguchi.jp\",\"shimonoseki.yamaguchi.jp\",\"shunan.yamaguchi.jp\",\"tabuse.yamaguchi.jp\",\"tokuyama.yamaguchi.jp\",\"toyota.yamaguchi.jp\",\"ube.yamaguchi.jp\",\"yuu.yamaguchi.jp\",\"chuo.yamanashi.jp\",\"doshi.yamanashi.jp\",\"fuefuki.yamanashi.jp\",\"fujikawa.yamanashi.jp\",\"fujikawaguchiko.yamanashi.jp\",\"fujiyoshida.yamanashi.jp\",\"hayakawa.yamanashi.jp\",\"hokuto.yamanashi.jp\",\"ichikawamisato.yamanashi.jp\",\"kai.yamanashi.jp\",\"kofu.yamanashi.jp\",\"koshu.yamanashi.jp\",\"kosuge.yamanashi.jp\",\"minami-alps.yamanashi.jp\",\"minobu.yamanashi.jp\",\"nakamichi.yamanashi.jp\",\"nanbu.yamanashi.jp\",\"narusawa.yamanashi.jp\",\"nirasaki.yamanashi.jp\",\"nishikatsura.yamanashi.jp\",\"oshino.yamanashi.jp\",\"otsuki.yamanashi.jp\",\"showa.yamanashi.jp\",\"tabayama.yamanashi.jp\",\"tsuru.yamanashi.jp\",\"uenohara.yamanashi.jp\",\"yamanakako.yamanashi.jp\",\"yamanashi.yamanashi.jp\",\"ke\",\"ac.ke\",\"co.ke\",\"go.ke\",\"info.ke\",\"me.ke\",\"mobi.ke\",\"ne.ke\",\"or.ke\",\"sc.ke\",\"kg\",\"org.kg\",\"net.kg\",\"com.kg\",\"edu.kg\",\"gov.kg\",\"mil.kg\",\"*.kh\",\"ki\",\"edu.ki\",\"biz.ki\",\"net.ki\",\"org.ki\",\"gov.ki\",\"info.ki\",\"com.ki\",\"km\",\"org.km\",\"nom.km\",\"gov.km\",\"prd.km\",\"tm.km\",\"edu.km\",\"mil.km\",\"ass.km\",\"com.km\",\"coop.km\",\"asso.km\",\"presse.km\",\"medecin.km\",\"notaires.km\",\"pharmaciens.km\",\"veterinaire.km\",\"gouv.km\",\"kn\",\"net.kn\",\"org.kn\",\"edu.kn\",\"gov.kn\",\"kp\",\"com.kp\",\"edu.kp\",\"gov.kp\",\"org.kp\",\"rep.kp\",\"tra.kp\",\"kr\",\"ac.kr\",\"co.kr\",\"es.kr\",\"go.kr\",\"hs.kr\",\"kg.kr\",\"mil.kr\",\"ms.kr\",\"ne.kr\",\"or.kr\",\"pe.kr\",\"re.kr\",\"sc.kr\",\"busan.kr\",\"chungbuk.kr\",\"chungnam.kr\",\"daegu.kr\",\"daejeon.kr\",\"gangwon.kr\",\"gwangju.kr\",\"gyeongbuk.kr\",\"gyeonggi.kr\",\"gyeongnam.kr\",\"incheon.kr\",\"jeju.kr\",\"jeonbuk.kr\",\"jeonnam.kr\",\"seoul.kr\",\"ulsan.kr\",\"kw\",\"com.kw\",\"edu.kw\",\"emb.kw\",\"gov.kw\",\"ind.kw\",\"net.kw\",\"org.kw\",\"ky\",\"edu.ky\",\"gov.ky\",\"com.ky\",\"org.ky\",\"net.ky\",\"kz\",\"org.kz\",\"edu.kz\",\"net.kz\",\"gov.kz\",\"mil.kz\",\"com.kz\",\"la\",\"int.la\",\"net.la\",\"info.la\",\"edu.la\",\"gov.la\",\"per.la\",\"com.la\",\"org.la\",\"lb\",\"com.lb\",\"edu.lb\",\"gov.lb\",\"net.lb\",\"org.lb\",\"lc\",\"com.lc\",\"net.lc\",\"co.lc\",\"org.lc\",\"edu.lc\",\"gov.lc\",\"li\",\"lk\",\"gov.lk\",\"sch.lk\",\"net.lk\",\"int.lk\",\"com.lk\",\"org.lk\",\"edu.lk\",\"ngo.lk\",\"soc.lk\",\"web.lk\",\"ltd.lk\",\"assn.lk\",\"grp.lk\",\"hotel.lk\",\"ac.lk\",\"lr\",\"com.lr\",\"edu.lr\",\"gov.lr\",\"org.lr\",\"net.lr\",\"ls\",\"ac.ls\",\"biz.ls\",\"co.ls\",\"edu.ls\",\"gov.ls\",\"info.ls\",\"net.ls\",\"org.ls\",\"sc.ls\",\"lt\",\"gov.lt\",\"lu\",\"lv\",\"com.lv\",\"edu.lv\",\"gov.lv\",\"org.lv\",\"mil.lv\",\"id.lv\",\"net.lv\",\"asn.lv\",\"conf.lv\",\"ly\",\"com.ly\",\"net.ly\",\"gov.ly\",\"plc.ly\",\"edu.ly\",\"sch.ly\",\"med.ly\",\"org.ly\",\"id.ly\",\"ma\",\"co.ma\",\"net.ma\",\"gov.ma\",\"org.ma\",\"ac.ma\",\"press.ma\",\"mc\",\"tm.mc\",\"asso.mc\",\"md\",\"me\",\"co.me\",\"net.me\",\"org.me\",\"edu.me\",\"ac.me\",\"gov.me\",\"its.me\",\"priv.me\",\"mg\",\"org.mg\",\"nom.mg\",\"gov.mg\",\"prd.mg\",\"tm.mg\",\"edu.mg\",\"mil.mg\",\"com.mg\",\"co.mg\",\"mh\",\"mil\",\"mk\",\"com.mk\",\"org.mk\",\"net.mk\",\"edu.mk\",\"gov.mk\",\"inf.mk\",\"name.mk\",\"ml\",\"com.ml\",\"edu.ml\",\"gouv.ml\",\"gov.ml\",\"net.ml\",\"org.ml\",\"presse.ml\",\"*.mm\",\"mn\",\"gov.mn\",\"edu.mn\",\"org.mn\",\"mo\",\"com.mo\",\"net.mo\",\"org.mo\",\"edu.mo\",\"gov.mo\",\"mobi\",\"mp\",\"mq\",\"mr\",\"gov.mr\",\"ms\",\"com.ms\",\"edu.ms\",\"gov.ms\",\"net.ms\",\"org.ms\",\"mt\",\"com.mt\",\"edu.mt\",\"net.mt\",\"org.mt\",\"mu\",\"com.mu\",\"net.mu\",\"org.mu\",\"gov.mu\",\"ac.mu\",\"co.mu\",\"or.mu\",\"museum\",\"academy.museum\",\"agriculture.museum\",\"air.museum\",\"airguard.museum\",\"alabama.museum\",\"alaska.museum\",\"amber.museum\",\"ambulance.museum\",\"american.museum\",\"americana.museum\",\"americanantiques.museum\",\"americanart.museum\",\"amsterdam.museum\",\"and.museum\",\"annefrank.museum\",\"anthro.museum\",\"anthropology.museum\",\"antiques.museum\",\"aquarium.museum\",\"arboretum.museum\",\"archaeological.museum\",\"archaeology.museum\",\"architecture.museum\",\"art.museum\",\"artanddesign.museum\",\"artcenter.museum\",\"artdeco.museum\",\"arteducation.museum\",\"artgallery.museum\",\"arts.museum\",\"artsandcrafts.museum\",\"asmatart.museum\",\"assassination.museum\",\"assisi.museum\",\"association.museum\",\"astronomy.museum\",\"atlanta.museum\",\"austin.museum\",\"australia.museum\",\"automotive.museum\",\"aviation.museum\",\"axis.museum\",\"badajoz.museum\",\"baghdad.museum\",\"bahn.museum\",\"bale.museum\",\"baltimore.museum\",\"barcelona.museum\",\"baseball.museum\",\"basel.museum\",\"baths.museum\",\"bauern.museum\",\"beauxarts.museum\",\"beeldengeluid.museum\",\"bellevue.museum\",\"bergbau.museum\",\"berkeley.museum\",\"berlin.museum\",\"bern.museum\",\"bible.museum\",\"bilbao.museum\",\"bill.museum\",\"birdart.museum\",\"birthplace.museum\",\"bonn.museum\",\"boston.museum\",\"botanical.museum\",\"botanicalgarden.museum\",\"botanicgarden.museum\",\"botany.museum\",\"brandywinevalley.museum\",\"brasil.museum\",\"bristol.museum\",\"british.museum\",\"britishcolumbia.museum\",\"broadcast.museum\",\"brunel.museum\",\"brussel.museum\",\"brussels.museum\",\"bruxelles.museum\",\"building.museum\",\"burghof.museum\",\"bus.museum\",\"bushey.museum\",\"cadaques.museum\",\"california.museum\",\"cambridge.museum\",\"can.museum\",\"canada.museum\",\"capebreton.museum\",\"carrier.museum\",\"cartoonart.museum\",\"casadelamoneda.museum\",\"castle.museum\",\"castres.museum\",\"celtic.museum\",\"center.museum\",\"chattanooga.museum\",\"cheltenham.museum\",\"chesapeakebay.museum\",\"chicago.museum\",\"children.museum\",\"childrens.museum\",\"childrensgarden.museum\",\"chiropractic.museum\",\"chocolate.museum\",\"christiansburg.museum\",\"cincinnati.museum\",\"cinema.museum\",\"circus.museum\",\"civilisation.museum\",\"civilization.museum\",\"civilwar.museum\",\"clinton.museum\",\"clock.museum\",\"coal.museum\",\"coastaldefence.museum\",\"cody.museum\",\"coldwar.museum\",\"collection.museum\",\"colonialwilliamsburg.museum\",\"coloradoplateau.museum\",\"columbia.museum\",\"columbus.museum\",\"communication.museum\",\"communications.museum\",\"community.museum\",\"computer.museum\",\"computerhistory.museum\",\"comunicações.museum\",\"contemporary.museum\",\"contemporaryart.museum\",\"convent.museum\",\"copenhagen.museum\",\"corporation.museum\",\"correios-e-telecomunicações.museum\",\"corvette.museum\",\"costume.museum\",\"countryestate.museum\",\"county.museum\",\"crafts.museum\",\"cranbrook.museum\",\"creation.museum\",\"cultural.museum\",\"culturalcenter.museum\",\"culture.museum\",\"cyber.museum\",\"cymru.museum\",\"dali.museum\",\"dallas.museum\",\"database.museum\",\"ddr.museum\",\"decorativearts.museum\",\"delaware.museum\",\"delmenhorst.museum\",\"denmark.museum\",\"depot.museum\",\"design.museum\",\"detroit.museum\",\"dinosaur.museum\",\"discovery.museum\",\"dolls.museum\",\"donostia.museum\",\"durham.museum\",\"eastafrica.museum\",\"eastcoast.museum\",\"education.museum\",\"educational.museum\",\"egyptian.museum\",\"eisenbahn.museum\",\"elburg.museum\",\"elvendrell.museum\",\"embroidery.museum\",\"encyclopedic.museum\",\"england.museum\",\"entomology.museum\",\"environment.museum\",\"environmentalconservation.museum\",\"epilepsy.museum\",\"essex.museum\",\"estate.museum\",\"ethnology.museum\",\"exeter.museum\",\"exhibition.museum\",\"family.museum\",\"farm.museum\",\"farmequipment.museum\",\"farmers.museum\",\"farmstead.museum\",\"field.museum\",\"figueres.museum\",\"filatelia.museum\",\"film.museum\",\"fineart.museum\",\"finearts.museum\",\"finland.museum\",\"flanders.museum\",\"florida.museum\",\"force.museum\",\"fortmissoula.museum\",\"fortworth.museum\",\"foundation.museum\",\"francaise.museum\",\"frankfurt.museum\",\"franziskaner.museum\",\"freemasonry.museum\",\"freiburg.museum\",\"fribourg.museum\",\"frog.museum\",\"fundacio.museum\",\"furniture.museum\",\"gallery.museum\",\"garden.museum\",\"gateway.museum\",\"geelvinck.museum\",\"gemological.museum\",\"geology.museum\",\"georgia.museum\",\"giessen.museum\",\"glas.museum\",\"glass.museum\",\"gorge.museum\",\"grandrapids.museum\",\"graz.museum\",\"guernsey.museum\",\"halloffame.museum\",\"hamburg.museum\",\"handson.museum\",\"harvestcelebration.museum\",\"hawaii.museum\",\"health.museum\",\"heimatunduhren.museum\",\"hellas.museum\",\"helsinki.museum\",\"hembygdsforbund.museum\",\"heritage.museum\",\"histoire.museum\",\"historical.museum\",\"historicalsociety.museum\",\"historichouses.museum\",\"historisch.museum\",\"historisches.museum\",\"history.museum\",\"historyofscience.museum\",\"horology.museum\",\"house.museum\",\"humanities.museum\",\"illustration.museum\",\"imageandsound.museum\",\"indian.museum\",\"indiana.museum\",\"indianapolis.museum\",\"indianmarket.museum\",\"intelligence.museum\",\"interactive.museum\",\"iraq.museum\",\"iron.museum\",\"isleofman.museum\",\"jamison.museum\",\"jefferson.museum\",\"jerusalem.museum\",\"jewelry.museum\",\"jewish.museum\",\"jewishart.museum\",\"jfk.museum\",\"journalism.museum\",\"judaica.museum\",\"judygarland.museum\",\"juedisches.museum\",\"juif.museum\",\"karate.museum\",\"karikatur.museum\",\"kids.museum\",\"koebenhavn.museum\",\"koeln.museum\",\"kunst.museum\",\"kunstsammlung.museum\",\"kunstunddesign.museum\",\"labor.museum\",\"labour.museum\",\"lajolla.museum\",\"lancashire.museum\",\"landes.museum\",\"lans.museum\",\"läns.museum\",\"larsson.museum\",\"lewismiller.museum\",\"lincoln.museum\",\"linz.museum\",\"living.museum\",\"livinghistory.museum\",\"localhistory.museum\",\"london.museum\",\"losangeles.museum\",\"louvre.museum\",\"loyalist.museum\",\"lucerne.museum\",\"luxembourg.museum\",\"luzern.museum\",\"mad.museum\",\"madrid.museum\",\"mallorca.museum\",\"manchester.museum\",\"mansion.museum\",\"mansions.museum\",\"manx.museum\",\"marburg.museum\",\"maritime.museum\",\"maritimo.museum\",\"maryland.museum\",\"marylhurst.museum\",\"media.museum\",\"medical.museum\",\"medizinhistorisches.museum\",\"meeres.museum\",\"memorial.museum\",\"mesaverde.museum\",\"michigan.museum\",\"midatlantic.museum\",\"military.museum\",\"mill.museum\",\"miners.museum\",\"mining.museum\",\"minnesota.museum\",\"missile.museum\",\"missoula.museum\",\"modern.museum\",\"moma.museum\",\"money.museum\",\"monmouth.museum\",\"monticello.museum\",\"montreal.museum\",\"moscow.museum\",\"motorcycle.museum\",\"muenchen.museum\",\"muenster.museum\",\"mulhouse.museum\",\"muncie.museum\",\"museet.museum\",\"museumcenter.museum\",\"museumvereniging.museum\",\"music.museum\",\"national.museum\",\"nationalfirearms.museum\",\"nationalheritage.museum\",\"nativeamerican.museum\",\"naturalhistory.museum\",\"naturalhistorymuseum.museum\",\"naturalsciences.museum\",\"nature.museum\",\"naturhistorisches.museum\",\"natuurwetenschappen.museum\",\"naumburg.museum\",\"naval.museum\",\"nebraska.museum\",\"neues.museum\",\"newhampshire.museum\",\"newjersey.museum\",\"newmexico.museum\",\"newport.museum\",\"newspaper.museum\",\"newyork.museum\",\"niepce.museum\",\"norfolk.museum\",\"north.museum\",\"nrw.museum\",\"nuernberg.museum\",\"nuremberg.museum\",\"nyc.museum\",\"nyny.museum\",\"oceanographic.museum\",\"oceanographique.museum\",\"omaha.museum\",\"online.museum\",\"ontario.museum\",\"openair.museum\",\"oregon.museum\",\"oregontrail.museum\",\"otago.museum\",\"oxford.museum\",\"pacific.museum\",\"paderborn.museum\",\"palace.museum\",\"paleo.museum\",\"palmsprings.museum\",\"panama.museum\",\"paris.museum\",\"pasadena.museum\",\"pharmacy.museum\",\"philadelphia.museum\",\"philadelphiaarea.museum\",\"philately.museum\",\"phoenix.museum\",\"photography.museum\",\"pilots.museum\",\"pittsburgh.museum\",\"planetarium.museum\",\"plantation.museum\",\"plants.museum\",\"plaza.museum\",\"portal.museum\",\"portland.museum\",\"portlligat.museum\",\"posts-and-telecommunications.museum\",\"preservation.museum\",\"presidio.museum\",\"press.museum\",\"project.museum\",\"public.museum\",\"pubol.museum\",\"quebec.museum\",\"railroad.museum\",\"railway.museum\",\"research.museum\",\"resistance.museum\",\"riodejaneiro.museum\",\"rochester.museum\",\"rockart.museum\",\"roma.museum\",\"russia.museum\",\"saintlouis.museum\",\"salem.museum\",\"salvadordali.museum\",\"salzburg.museum\",\"sandiego.museum\",\"sanfrancisco.museum\",\"santabarbara.museum\",\"santacruz.museum\",\"santafe.museum\",\"saskatchewan.museum\",\"satx.museum\",\"savannahga.museum\",\"schlesisches.museum\",\"schoenbrunn.museum\",\"schokoladen.museum\",\"school.museum\",\"schweiz.museum\",\"science.museum\",\"scienceandhistory.museum\",\"scienceandindustry.museum\",\"sciencecenter.museum\",\"sciencecenters.museum\",\"science-fiction.museum\",\"sciencehistory.museum\",\"sciences.museum\",\"sciencesnaturelles.museum\",\"scotland.museum\",\"seaport.museum\",\"settlement.museum\",\"settlers.museum\",\"shell.museum\",\"sherbrooke.museum\",\"sibenik.museum\",\"silk.museum\",\"ski.museum\",\"skole.museum\",\"society.museum\",\"sologne.museum\",\"soundandvision.museum\",\"southcarolina.museum\",\"southwest.museum\",\"space.museum\",\"spy.museum\",\"square.museum\",\"stadt.museum\",\"stalbans.museum\",\"starnberg.museum\",\"state.museum\",\"stateofdelaware.museum\",\"station.museum\",\"steam.museum\",\"steiermark.museum\",\"stjohn.museum\",\"stockholm.museum\",\"stpetersburg.museum\",\"stuttgart.museum\",\"suisse.museum\",\"surgeonshall.museum\",\"surrey.museum\",\"svizzera.museum\",\"sweden.museum\",\"sydney.museum\",\"tank.museum\",\"tcm.museum\",\"technology.museum\",\"telekommunikation.museum\",\"television.museum\",\"texas.museum\",\"textile.museum\",\"theater.museum\",\"time.museum\",\"timekeeping.museum\",\"topology.museum\",\"torino.museum\",\"touch.museum\",\"town.museum\",\"transport.museum\",\"tree.museum\",\"trolley.museum\",\"trust.museum\",\"trustee.museum\",\"uhren.museum\",\"ulm.museum\",\"undersea.museum\",\"university.museum\",\"usa.museum\",\"usantiques.museum\",\"usarts.museum\",\"uscountryestate.museum\",\"usculture.museum\",\"usdecorativearts.museum\",\"usgarden.museum\",\"ushistory.museum\",\"ushuaia.museum\",\"uslivinghistory.museum\",\"utah.museum\",\"uvic.museum\",\"valley.museum\",\"vantaa.museum\",\"versailles.museum\",\"viking.museum\",\"village.museum\",\"virginia.museum\",\"virtual.museum\",\"virtuel.museum\",\"vlaanderen.museum\",\"volkenkunde.museum\",\"wales.museum\",\"wallonie.museum\",\"war.museum\",\"washingtondc.museum\",\"watchandclock.museum\",\"watch-and-clock.museum\",\"western.museum\",\"westfalen.museum\",\"whaling.museum\",\"wildlife.museum\",\"williamsburg.museum\",\"windmill.museum\",\"workshop.museum\",\"york.museum\",\"yorkshire.museum\",\"yosemite.museum\",\"youth.museum\",\"zoological.museum\",\"zoology.museum\",\"ירושלים.museum\",\"иком.museum\",\"mv\",\"aero.mv\",\"biz.mv\",\"com.mv\",\"coop.mv\",\"edu.mv\",\"gov.mv\",\"info.mv\",\"int.mv\",\"mil.mv\",\"museum.mv\",\"name.mv\",\"net.mv\",\"org.mv\",\"pro.mv\",\"mw\",\"ac.mw\",\"biz.mw\",\"co.mw\",\"com.mw\",\"coop.mw\",\"edu.mw\",\"gov.mw\",\"int.mw\",\"museum.mw\",\"net.mw\",\"org.mw\",\"mx\",\"com.mx\",\"org.mx\",\"gob.mx\",\"edu.mx\",\"net.mx\",\"my\",\"com.my\",\"net.my\",\"org.my\",\"gov.my\",\"edu.my\",\"mil.my\",\"name.my\",\"mz\",\"ac.mz\",\"adv.mz\",\"co.mz\",\"edu.mz\",\"gov.mz\",\"mil.mz\",\"net.mz\",\"org.mz\",\"na\",\"info.na\",\"pro.na\",\"name.na\",\"school.na\",\"or.na\",\"dr.na\",\"us.na\",\"mx.na\",\"ca.na\",\"in.na\",\"cc.na\",\"tv.na\",\"ws.na\",\"mobi.na\",\"co.na\",\"com.na\",\"org.na\",\"name\",\"nc\",\"asso.nc\",\"nom.nc\",\"ne\",\"net\",\"nf\",\"com.nf\",\"net.nf\",\"per.nf\",\"rec.nf\",\"web.nf\",\"arts.nf\",\"firm.nf\",\"info.nf\",\"other.nf\",\"store.nf\",\"ng\",\"com.ng\",\"edu.ng\",\"gov.ng\",\"i.ng\",\"mil.ng\",\"mobi.ng\",\"name.ng\",\"net.ng\",\"org.ng\",\"sch.ng\",\"ni\",\"ac.ni\",\"biz.ni\",\"co.ni\",\"com.ni\",\"edu.ni\",\"gob.ni\",\"in.ni\",\"info.ni\",\"int.ni\",\"mil.ni\",\"net.ni\",\"nom.ni\",\"org.ni\",\"web.ni\",\"nl\",\"no\",\"fhs.no\",\"vgs.no\",\"fylkesbibl.no\",\"folkebibl.no\",\"museum.no\",\"idrett.no\",\"priv.no\",\"mil.no\",\"stat.no\",\"dep.no\",\"kommune.no\",\"herad.no\",\"aa.no\",\"ah.no\",\"bu.no\",\"fm.no\",\"hl.no\",\"hm.no\",\"jan-mayen.no\",\"mr.no\",\"nl.no\",\"nt.no\",\"of.no\",\"ol.no\",\"oslo.no\",\"rl.no\",\"sf.no\",\"st.no\",\"svalbard.no\",\"tm.no\",\"tr.no\",\"va.no\",\"vf.no\",\"gs.aa.no\",\"gs.ah.no\",\"gs.bu.no\",\"gs.fm.no\",\"gs.hl.no\",\"gs.hm.no\",\"gs.jan-mayen.no\",\"gs.mr.no\",\"gs.nl.no\",\"gs.nt.no\",\"gs.of.no\",\"gs.ol.no\",\"gs.oslo.no\",\"gs.rl.no\",\"gs.sf.no\",\"gs.st.no\",\"gs.svalbard.no\",\"gs.tm.no\",\"gs.tr.no\",\"gs.va.no\",\"gs.vf.no\",\"akrehamn.no\",\"åkrehamn.no\",\"algard.no\",\"ålgård.no\",\"arna.no\",\"brumunddal.no\",\"bryne.no\",\"bronnoysund.no\",\"brønnøysund.no\",\"drobak.no\",\"drøbak.no\",\"egersund.no\",\"fetsund.no\",\"floro.no\",\"florø.no\",\"fredrikstad.no\",\"hokksund.no\",\"honefoss.no\",\"hønefoss.no\",\"jessheim.no\",\"jorpeland.no\",\"jørpeland.no\",\"kirkenes.no\",\"kopervik.no\",\"krokstadelva.no\",\"langevag.no\",\"langevåg.no\",\"leirvik.no\",\"mjondalen.no\",\"mjøndalen.no\",\"mo-i-rana.no\",\"mosjoen.no\",\"mosjøen.no\",\"nesoddtangen.no\",\"orkanger.no\",\"osoyro.no\",\"osøyro.no\",\"raholt.no\",\"råholt.no\",\"sandnessjoen.no\",\"sandnessjøen.no\",\"skedsmokorset.no\",\"slattum.no\",\"spjelkavik.no\",\"stathelle.no\",\"stavern.no\",\"stjordalshalsen.no\",\"stjørdalshalsen.no\",\"tananger.no\",\"tranby.no\",\"vossevangen.no\",\"afjord.no\",\"åfjord.no\",\"agdenes.no\",\"al.no\",\"ål.no\",\"alesund.no\",\"ålesund.no\",\"alstahaug.no\",\"alta.no\",\"áltá.no\",\"alaheadju.no\",\"álaheadju.no\",\"alvdal.no\",\"amli.no\",\"åmli.no\",\"amot.no\",\"åmot.no\",\"andebu.no\",\"andoy.no\",\"andøy.no\",\"andasuolo.no\",\"ardal.no\",\"årdal.no\",\"aremark.no\",\"arendal.no\",\"ås.no\",\"aseral.no\",\"åseral.no\",\"asker.no\",\"askim.no\",\"askvoll.no\",\"askoy.no\",\"askøy.no\",\"asnes.no\",\"åsnes.no\",\"audnedaln.no\",\"aukra.no\",\"aure.no\",\"aurland.no\",\"aurskog-holand.no\",\"aurskog-høland.no\",\"austevoll.no\",\"austrheim.no\",\"averoy.no\",\"averøy.no\",\"balestrand.no\",\"ballangen.no\",\"balat.no\",\"bálát.no\",\"balsfjord.no\",\"bahccavuotna.no\",\"báhccavuotna.no\",\"bamble.no\",\"bardu.no\",\"beardu.no\",\"beiarn.no\",\"bajddar.no\",\"bájddar.no\",\"baidar.no\",\"báidár.no\",\"berg.no\",\"bergen.no\",\"berlevag.no\",\"berlevåg.no\",\"bearalvahki.no\",\"bearalváhki.no\",\"bindal.no\",\"birkenes.no\",\"bjarkoy.no\",\"bjarkøy.no\",\"bjerkreim.no\",\"bjugn.no\",\"bodo.no\",\"bodø.no\",\"badaddja.no\",\"bådåddjå.no\",\"budejju.no\",\"bokn.no\",\"bremanger.no\",\"bronnoy.no\",\"brønnøy.no\",\"bygland.no\",\"bykle.no\",\"barum.no\",\"bærum.no\",\"bo.telemark.no\",\"bø.telemark.no\",\"bo.nordland.no\",\"bø.nordland.no\",\"bievat.no\",\"bievát.no\",\"bomlo.no\",\"bømlo.no\",\"batsfjord.no\",\"båtsfjord.no\",\"bahcavuotna.no\",\"báhcavuotna.no\",\"dovre.no\",\"drammen.no\",\"drangedal.no\",\"dyroy.no\",\"dyrøy.no\",\"donna.no\",\"dønna.no\",\"eid.no\",\"eidfjord.no\",\"eidsberg.no\",\"eidskog.no\",\"eidsvoll.no\",\"eigersund.no\",\"elverum.no\",\"enebakk.no\",\"engerdal.no\",\"etne.no\",\"etnedal.no\",\"evenes.no\",\"evenassi.no\",\"evenášši.no\",\"evje-og-hornnes.no\",\"farsund.no\",\"fauske.no\",\"fuossko.no\",\"fuoisku.no\",\"fedje.no\",\"fet.no\",\"finnoy.no\",\"finnøy.no\",\"fitjar.no\",\"fjaler.no\",\"fjell.no\",\"flakstad.no\",\"flatanger.no\",\"flekkefjord.no\",\"flesberg.no\",\"flora.no\",\"fla.no\",\"flå.no\",\"folldal.no\",\"forsand.no\",\"fosnes.no\",\"frei.no\",\"frogn.no\",\"froland.no\",\"frosta.no\",\"frana.no\",\"fræna.no\",\"froya.no\",\"frøya.no\",\"fusa.no\",\"fyresdal.no\",\"forde.no\",\"førde.no\",\"gamvik.no\",\"gangaviika.no\",\"gáŋgaviika.no\",\"gaular.no\",\"gausdal.no\",\"gildeskal.no\",\"gildeskål.no\",\"giske.no\",\"gjemnes.no\",\"gjerdrum.no\",\"gjerstad.no\",\"gjesdal.no\",\"gjovik.no\",\"gjøvik.no\",\"gloppen.no\",\"gol.no\",\"gran.no\",\"grane.no\",\"granvin.no\",\"gratangen.no\",\"grimstad.no\",\"grong.no\",\"kraanghke.no\",\"kråanghke.no\",\"grue.no\",\"gulen.no\",\"hadsel.no\",\"halden.no\",\"halsa.no\",\"hamar.no\",\"hamaroy.no\",\"habmer.no\",\"hábmer.no\",\"hapmir.no\",\"hápmir.no\",\"hammerfest.no\",\"hammarfeasta.no\",\"hámmárfeasta.no\",\"haram.no\",\"hareid.no\",\"harstad.no\",\"hasvik.no\",\"aknoluokta.no\",\"ákŋoluokta.no\",\"hattfjelldal.no\",\"aarborte.no\",\"haugesund.no\",\"hemne.no\",\"hemnes.no\",\"hemsedal.no\",\"heroy.more-og-romsdal.no\",\"herøy.møre-og-romsdal.no\",\"heroy.nordland.no\",\"herøy.nordland.no\",\"hitra.no\",\"hjartdal.no\",\"hjelmeland.no\",\"hobol.no\",\"hobøl.no\",\"hof.no\",\"hol.no\",\"hole.no\",\"holmestrand.no\",\"holtalen.no\",\"holtålen.no\",\"hornindal.no\",\"horten.no\",\"hurdal.no\",\"hurum.no\",\"hvaler.no\",\"hyllestad.no\",\"hagebostad.no\",\"hægebostad.no\",\"hoyanger.no\",\"høyanger.no\",\"hoylandet.no\",\"høylandet.no\",\"ha.no\",\"hå.no\",\"ibestad.no\",\"inderoy.no\",\"inderøy.no\",\"iveland.no\",\"jevnaker.no\",\"jondal.no\",\"jolster.no\",\"jølster.no\",\"karasjok.no\",\"karasjohka.no\",\"kárášjohka.no\",\"karlsoy.no\",\"galsa.no\",\"gálsá.no\",\"karmoy.no\",\"karmøy.no\",\"kautokeino.no\",\"guovdageaidnu.no\",\"klepp.no\",\"klabu.no\",\"klæbu.no\",\"kongsberg.no\",\"kongsvinger.no\",\"kragero.no\",\"kragerø.no\",\"kristiansand.no\",\"kristiansund.no\",\"krodsherad.no\",\"krødsherad.no\",\"kvalsund.no\",\"rahkkeravju.no\",\"ráhkkerávju.no\",\"kvam.no\",\"kvinesdal.no\",\"kvinnherad.no\",\"kviteseid.no\",\"kvitsoy.no\",\"kvitsøy.no\",\"kvafjord.no\",\"kvæfjord.no\",\"giehtavuoatna.no\",\"kvanangen.no\",\"kvænangen.no\",\"navuotna.no\",\"návuotna.no\",\"kafjord.no\",\"kåfjord.no\",\"gaivuotna.no\",\"gáivuotna.no\",\"larvik.no\",\"lavangen.no\",\"lavagis.no\",\"loabat.no\",\"loabát.no\",\"lebesby.no\",\"davvesiida.no\",\"leikanger.no\",\"leirfjord.no\",\"leka.no\",\"leksvik.no\",\"lenvik.no\",\"leangaviika.no\",\"leaŋgaviika.no\",\"lesja.no\",\"levanger.no\",\"lier.no\",\"lierne.no\",\"lillehammer.no\",\"lillesand.no\",\"lindesnes.no\",\"lindas.no\",\"lindås.no\",\"lom.no\",\"loppa.no\",\"lahppi.no\",\"láhppi.no\",\"lund.no\",\"lunner.no\",\"luroy.no\",\"lurøy.no\",\"luster.no\",\"lyngdal.no\",\"lyngen.no\",\"ivgu.no\",\"lardal.no\",\"lerdal.no\",\"lærdal.no\",\"lodingen.no\",\"lødingen.no\",\"lorenskog.no\",\"lørenskog.no\",\"loten.no\",\"løten.no\",\"malvik.no\",\"masoy.no\",\"måsøy.no\",\"muosat.no\",\"muosát.no\",\"mandal.no\",\"marker.no\",\"marnardal.no\",\"masfjorden.no\",\"meland.no\",\"meldal.no\",\"melhus.no\",\"meloy.no\",\"meløy.no\",\"meraker.no\",\"meråker.no\",\"moareke.no\",\"moåreke.no\",\"midsund.no\",\"midtre-gauldal.no\",\"modalen.no\",\"modum.no\",\"molde.no\",\"moskenes.no\",\"moss.no\",\"mosvik.no\",\"malselv.no\",\"målselv.no\",\"malatvuopmi.no\",\"málatvuopmi.no\",\"namdalseid.no\",\"aejrie.no\",\"namsos.no\",\"namsskogan.no\",\"naamesjevuemie.no\",\"nååmesjevuemie.no\",\"laakesvuemie.no\",\"nannestad.no\",\"narvik.no\",\"narviika.no\",\"naustdal.no\",\"nedre-eiker.no\",\"nes.akershus.no\",\"nes.buskerud.no\",\"nesna.no\",\"nesodden.no\",\"nesseby.no\",\"unjarga.no\",\"unjárga.no\",\"nesset.no\",\"nissedal.no\",\"nittedal.no\",\"nord-aurdal.no\",\"nord-fron.no\",\"nord-odal.no\",\"norddal.no\",\"nordkapp.no\",\"davvenjarga.no\",\"davvenjárga.no\",\"nordre-land.no\",\"nordreisa.no\",\"raisa.no\",\"ráisa.no\",\"nore-og-uvdal.no\",\"notodden.no\",\"naroy.no\",\"nærøy.no\",\"notteroy.no\",\"nøtterøy.no\",\"odda.no\",\"oksnes.no\",\"øksnes.no\",\"oppdal.no\",\"oppegard.no\",\"oppegård.no\",\"orkdal.no\",\"orland.no\",\"ørland.no\",\"orskog.no\",\"ørskog.no\",\"orsta.no\",\"ørsta.no\",\"os.hedmark.no\",\"os.hordaland.no\",\"osen.no\",\"osteroy.no\",\"osterøy.no\",\"ostre-toten.no\",\"østre-toten.no\",\"overhalla.no\",\"ovre-eiker.no\",\"øvre-eiker.no\",\"oyer.no\",\"øyer.no\",\"oygarden.no\",\"øygarden.no\",\"oystre-slidre.no\",\"øystre-slidre.no\",\"porsanger.no\",\"porsangu.no\",\"porsáŋgu.no\",\"porsgrunn.no\",\"radoy.no\",\"radøy.no\",\"rakkestad.no\",\"rana.no\",\"ruovat.no\",\"randaberg.no\",\"rauma.no\",\"rendalen.no\",\"rennebu.no\",\"rennesoy.no\",\"rennesøy.no\",\"rindal.no\",\"ringebu.no\",\"ringerike.no\",\"ringsaker.no\",\"rissa.no\",\"risor.no\",\"risør.no\",\"roan.no\",\"rollag.no\",\"rygge.no\",\"ralingen.no\",\"rælingen.no\",\"rodoy.no\",\"rødøy.no\",\"romskog.no\",\"rømskog.no\",\"roros.no\",\"røros.no\",\"rost.no\",\"røst.no\",\"royken.no\",\"røyken.no\",\"royrvik.no\",\"røyrvik.no\",\"rade.no\",\"råde.no\",\"salangen.no\",\"siellak.no\",\"saltdal.no\",\"salat.no\",\"sálát.no\",\"sálat.no\",\"samnanger.no\",\"sande.more-og-romsdal.no\",\"sande.møre-og-romsdal.no\",\"sande.vestfold.no\",\"sandefjord.no\",\"sandnes.no\",\"sandoy.no\",\"sandøy.no\",\"sarpsborg.no\",\"sauda.no\",\"sauherad.no\",\"sel.no\",\"selbu.no\",\"selje.no\",\"seljord.no\",\"sigdal.no\",\"siljan.no\",\"sirdal.no\",\"skaun.no\",\"skedsmo.no\",\"ski.no\",\"skien.no\",\"skiptvet.no\",\"skjervoy.no\",\"skjervøy.no\",\"skierva.no\",\"skiervá.no\",\"skjak.no\",\"skjåk.no\",\"skodje.no\",\"skanland.no\",\"skånland.no\",\"skanit.no\",\"skánit.no\",\"smola.no\",\"smøla.no\",\"snillfjord.no\",\"snasa.no\",\"snåsa.no\",\"snoasa.no\",\"snaase.no\",\"snåase.no\",\"sogndal.no\",\"sokndal.no\",\"sola.no\",\"solund.no\",\"songdalen.no\",\"sortland.no\",\"spydeberg.no\",\"stange.no\",\"stavanger.no\",\"steigen.no\",\"steinkjer.no\",\"stjordal.no\",\"stjørdal.no\",\"stokke.no\",\"stor-elvdal.no\",\"stord.no\",\"stordal.no\",\"storfjord.no\",\"omasvuotna.no\",\"strand.no\",\"stranda.no\",\"stryn.no\",\"sula.no\",\"suldal.no\",\"sund.no\",\"sunndal.no\",\"surnadal.no\",\"sveio.no\",\"svelvik.no\",\"sykkylven.no\",\"sogne.no\",\"søgne.no\",\"somna.no\",\"sømna.no\",\"sondre-land.no\",\"søndre-land.no\",\"sor-aurdal.no\",\"sør-aurdal.no\",\"sor-fron.no\",\"sør-fron.no\",\"sor-odal.no\",\"sør-odal.no\",\"sor-varanger.no\",\"sør-varanger.no\",\"matta-varjjat.no\",\"mátta-várjjat.no\",\"sorfold.no\",\"sørfold.no\",\"sorreisa.no\",\"sørreisa.no\",\"sorum.no\",\"sørum.no\",\"tana.no\",\"deatnu.no\",\"time.no\",\"tingvoll.no\",\"tinn.no\",\"tjeldsund.no\",\"dielddanuorri.no\",\"tjome.no\",\"tjøme.no\",\"tokke.no\",\"tolga.no\",\"torsken.no\",\"tranoy.no\",\"tranøy.no\",\"tromso.no\",\"tromsø.no\",\"tromsa.no\",\"romsa.no\",\"trondheim.no\",\"troandin.no\",\"trysil.no\",\"trana.no\",\"træna.no\",\"trogstad.no\",\"trøgstad.no\",\"tvedestrand.no\",\"tydal.no\",\"tynset.no\",\"tysfjord.no\",\"divtasvuodna.no\",\"divttasvuotna.no\",\"tysnes.no\",\"tysvar.no\",\"tysvær.no\",\"tonsberg.no\",\"tønsberg.no\",\"ullensaker.no\",\"ullensvang.no\",\"ulvik.no\",\"utsira.no\",\"vadso.no\",\"vadsø.no\",\"cahcesuolo.no\",\"čáhcesuolo.no\",\"vaksdal.no\",\"valle.no\",\"vang.no\",\"vanylven.no\",\"vardo.no\",\"vardø.no\",\"varggat.no\",\"várggát.no\",\"vefsn.no\",\"vaapste.no\",\"vega.no\",\"vegarshei.no\",\"vegårshei.no\",\"vennesla.no\",\"verdal.no\",\"verran.no\",\"vestby.no\",\"vestnes.no\",\"vestre-slidre.no\",\"vestre-toten.no\",\"vestvagoy.no\",\"vestvågøy.no\",\"vevelstad.no\",\"vik.no\",\"vikna.no\",\"vindafjord.no\",\"volda.no\",\"voss.no\",\"varoy.no\",\"værøy.no\",\"vagan.no\",\"vågan.no\",\"voagat.no\",\"vagsoy.no\",\"vågsøy.no\",\"vaga.no\",\"vågå.no\",\"valer.ostfold.no\",\"våler.østfold.no\",\"valer.hedmark.no\",\"våler.hedmark.no\",\"*.np\",\"nr\",\"biz.nr\",\"info.nr\",\"gov.nr\",\"edu.nr\",\"org.nr\",\"net.nr\",\"com.nr\",\"nu\",\"nz\",\"ac.nz\",\"co.nz\",\"cri.nz\",\"geek.nz\",\"gen.nz\",\"govt.nz\",\"health.nz\",\"iwi.nz\",\"kiwi.nz\",\"maori.nz\",\"mil.nz\",\"māori.nz\",\"net.nz\",\"org.nz\",\"parliament.nz\",\"school.nz\",\"om\",\"co.om\",\"com.om\",\"edu.om\",\"gov.om\",\"med.om\",\"museum.om\",\"net.om\",\"org.om\",\"pro.om\",\"onion\",\"org\",\"pa\",\"ac.pa\",\"gob.pa\",\"com.pa\",\"org.pa\",\"sld.pa\",\"edu.pa\",\"net.pa\",\"ing.pa\",\"abo.pa\",\"med.pa\",\"nom.pa\",\"pe\",\"edu.pe\",\"gob.pe\",\"nom.pe\",\"mil.pe\",\"org.pe\",\"com.pe\",\"net.pe\",\"pf\",\"com.pf\",\"org.pf\",\"edu.pf\",\"*.pg\",\"ph\",\"com.ph\",\"net.ph\",\"org.ph\",\"gov.ph\",\"edu.ph\",\"ngo.ph\",\"mil.ph\",\"i.ph\",\"pk\",\"com.pk\",\"net.pk\",\"edu.pk\",\"org.pk\",\"fam.pk\",\"biz.pk\",\"web.pk\",\"gov.pk\",\"gob.pk\",\"gok.pk\",\"gon.pk\",\"gop.pk\",\"gos.pk\",\"info.pk\",\"pl\",\"com.pl\",\"net.pl\",\"org.pl\",\"aid.pl\",\"agro.pl\",\"atm.pl\",\"auto.pl\",\"biz.pl\",\"edu.pl\",\"gmina.pl\",\"gsm.pl\",\"info.pl\",\"mail.pl\",\"miasta.pl\",\"media.pl\",\"mil.pl\",\"nieruchomosci.pl\",\"nom.pl\",\"pc.pl\",\"powiat.pl\",\"priv.pl\",\"realestate.pl\",\"rel.pl\",\"sex.pl\",\"shop.pl\",\"sklep.pl\",\"sos.pl\",\"szkola.pl\",\"targi.pl\",\"tm.pl\",\"tourism.pl\",\"travel.pl\",\"turystyka.pl\",\"gov.pl\",\"ap.gov.pl\",\"ic.gov.pl\",\"is.gov.pl\",\"us.gov.pl\",\"kmpsp.gov.pl\",\"kppsp.gov.pl\",\"kwpsp.gov.pl\",\"psp.gov.pl\",\"wskr.gov.pl\",\"kwp.gov.pl\",\"mw.gov.pl\",\"ug.gov.pl\",\"um.gov.pl\",\"umig.gov.pl\",\"ugim.gov.pl\",\"upow.gov.pl\",\"uw.gov.pl\",\"starostwo.gov.pl\",\"pa.gov.pl\",\"po.gov.pl\",\"psse.gov.pl\",\"pup.gov.pl\",\"rzgw.gov.pl\",\"sa.gov.pl\",\"so.gov.pl\",\"sr.gov.pl\",\"wsa.gov.pl\",\"sko.gov.pl\",\"uzs.gov.pl\",\"wiih.gov.pl\",\"winb.gov.pl\",\"pinb.gov.pl\",\"wios.gov.pl\",\"witd.gov.pl\",\"wzmiuw.gov.pl\",\"piw.gov.pl\",\"wiw.gov.pl\",\"griw.gov.pl\",\"wif.gov.pl\",\"oum.gov.pl\",\"sdn.gov.pl\",\"zp.gov.pl\",\"uppo.gov.pl\",\"mup.gov.pl\",\"wuoz.gov.pl\",\"konsulat.gov.pl\",\"oirm.gov.pl\",\"augustow.pl\",\"babia-gora.pl\",\"bedzin.pl\",\"beskidy.pl\",\"bialowieza.pl\",\"bialystok.pl\",\"bielawa.pl\",\"bieszczady.pl\",\"boleslawiec.pl\",\"bydgoszcz.pl\",\"bytom.pl\",\"cieszyn.pl\",\"czeladz.pl\",\"czest.pl\",\"dlugoleka.pl\",\"elblag.pl\",\"elk.pl\",\"glogow.pl\",\"gniezno.pl\",\"gorlice.pl\",\"grajewo.pl\",\"ilawa.pl\",\"jaworzno.pl\",\"jelenia-gora.pl\",\"jgora.pl\",\"kalisz.pl\",\"kazimierz-dolny.pl\",\"karpacz.pl\",\"kartuzy.pl\",\"kaszuby.pl\",\"katowice.pl\",\"kepno.pl\",\"ketrzyn.pl\",\"klodzko.pl\",\"kobierzyce.pl\",\"kolobrzeg.pl\",\"konin.pl\",\"konskowola.pl\",\"kutno.pl\",\"lapy.pl\",\"lebork.pl\",\"legnica.pl\",\"lezajsk.pl\",\"limanowa.pl\",\"lomza.pl\",\"lowicz.pl\",\"lubin.pl\",\"lukow.pl\",\"malbork.pl\",\"malopolska.pl\",\"mazowsze.pl\",\"mazury.pl\",\"mielec.pl\",\"mielno.pl\",\"mragowo.pl\",\"naklo.pl\",\"nowaruda.pl\",\"nysa.pl\",\"olawa.pl\",\"olecko.pl\",\"olkusz.pl\",\"olsztyn.pl\",\"opoczno.pl\",\"opole.pl\",\"ostroda.pl\",\"ostroleka.pl\",\"ostrowiec.pl\",\"ostrowwlkp.pl\",\"pila.pl\",\"pisz.pl\",\"podhale.pl\",\"podlasie.pl\",\"polkowice.pl\",\"pomorze.pl\",\"pomorskie.pl\",\"prochowice.pl\",\"pruszkow.pl\",\"przeworsk.pl\",\"pulawy.pl\",\"radom.pl\",\"rawa-maz.pl\",\"rybnik.pl\",\"rzeszow.pl\",\"sanok.pl\",\"sejny.pl\",\"slask.pl\",\"slupsk.pl\",\"sosnowiec.pl\",\"stalowa-wola.pl\",\"skoczow.pl\",\"starachowice.pl\",\"stargard.pl\",\"suwalki.pl\",\"swidnica.pl\",\"swiebodzin.pl\",\"swinoujscie.pl\",\"szczecin.pl\",\"szczytno.pl\",\"tarnobrzeg.pl\",\"tgory.pl\",\"turek.pl\",\"tychy.pl\",\"ustka.pl\",\"walbrzych.pl\",\"warmia.pl\",\"warszawa.pl\",\"waw.pl\",\"wegrow.pl\",\"wielun.pl\",\"wlocl.pl\",\"wloclawek.pl\",\"wodzislaw.pl\",\"wolomin.pl\",\"wroclaw.pl\",\"zachpomor.pl\",\"zagan.pl\",\"zarow.pl\",\"zgora.pl\",\"zgorzelec.pl\",\"pm\",\"pn\",\"gov.pn\",\"co.pn\",\"org.pn\",\"edu.pn\",\"net.pn\",\"post\",\"pr\",\"com.pr\",\"net.pr\",\"org.pr\",\"gov.pr\",\"edu.pr\",\"isla.pr\",\"pro.pr\",\"biz.pr\",\"info.pr\",\"name.pr\",\"est.pr\",\"prof.pr\",\"ac.pr\",\"pro\",\"aaa.pro\",\"aca.pro\",\"acct.pro\",\"avocat.pro\",\"bar.pro\",\"cpa.pro\",\"eng.pro\",\"jur.pro\",\"law.pro\",\"med.pro\",\"recht.pro\",\"ps\",\"edu.ps\",\"gov.ps\",\"sec.ps\",\"plo.ps\",\"com.ps\",\"org.ps\",\"net.ps\",\"pt\",\"net.pt\",\"gov.pt\",\"org.pt\",\"edu.pt\",\"int.pt\",\"publ.pt\",\"com.pt\",\"nome.pt\",\"pw\",\"co.pw\",\"ne.pw\",\"or.pw\",\"ed.pw\",\"go.pw\",\"belau.pw\",\"py\",\"com.py\",\"coop.py\",\"edu.py\",\"gov.py\",\"mil.py\",\"net.py\",\"org.py\",\"qa\",\"com.qa\",\"edu.qa\",\"gov.qa\",\"mil.qa\",\"name.qa\",\"net.qa\",\"org.qa\",\"sch.qa\",\"re\",\"asso.re\",\"com.re\",\"nom.re\",\"ro\",\"arts.ro\",\"com.ro\",\"firm.ro\",\"info.ro\",\"nom.ro\",\"nt.ro\",\"org.ro\",\"rec.ro\",\"store.ro\",\"tm.ro\",\"www.ro\",\"rs\",\"ac.rs\",\"co.rs\",\"edu.rs\",\"gov.rs\",\"in.rs\",\"org.rs\",\"ru\",\"ac.ru\",\"edu.ru\",\"gov.ru\",\"int.ru\",\"mil.ru\",\"test.ru\",\"rw\",\"ac.rw\",\"co.rw\",\"coop.rw\",\"gov.rw\",\"mil.rw\",\"net.rw\",\"org.rw\",\"sa\",\"com.sa\",\"net.sa\",\"org.sa\",\"gov.sa\",\"med.sa\",\"pub.sa\",\"edu.sa\",\"sch.sa\",\"sb\",\"com.sb\",\"edu.sb\",\"gov.sb\",\"net.sb\",\"org.sb\",\"sc\",\"com.sc\",\"gov.sc\",\"net.sc\",\"org.sc\",\"edu.sc\",\"sd\",\"com.sd\",\"net.sd\",\"org.sd\",\"edu.sd\",\"med.sd\",\"tv.sd\",\"gov.sd\",\"info.sd\",\"se\",\"a.se\",\"ac.se\",\"b.se\",\"bd.se\",\"brand.se\",\"c.se\",\"d.se\",\"e.se\",\"f.se\",\"fh.se\",\"fhsk.se\",\"fhv.se\",\"g.se\",\"h.se\",\"i.se\",\"k.se\",\"komforb.se\",\"kommunalforbund.se\",\"komvux.se\",\"l.se\",\"lanbib.se\",\"m.se\",\"n.se\",\"naturbruksgymn.se\",\"o.se\",\"org.se\",\"p.se\",\"parti.se\",\"pp.se\",\"press.se\",\"r.se\",\"s.se\",\"t.se\",\"tm.se\",\"u.se\",\"w.se\",\"x.se\",\"y.se\",\"z.se\",\"sg\",\"com.sg\",\"net.sg\",\"org.sg\",\"gov.sg\",\"edu.sg\",\"per.sg\",\"sh\",\"com.sh\",\"net.sh\",\"gov.sh\",\"org.sh\",\"mil.sh\",\"si\",\"sj\",\"sk\",\"sl\",\"com.sl\",\"net.sl\",\"edu.sl\",\"gov.sl\",\"org.sl\",\"sm\",\"sn\",\"art.sn\",\"com.sn\",\"edu.sn\",\"gouv.sn\",\"org.sn\",\"perso.sn\",\"univ.sn\",\"so\",\"com.so\",\"net.so\",\"org.so\",\"sr\",\"st\",\"co.st\",\"com.st\",\"consulado.st\",\"edu.st\",\"embaixada.st\",\"gov.st\",\"mil.st\",\"net.st\",\"org.st\",\"principe.st\",\"saotome.st\",\"store.st\",\"su\",\"sv\",\"com.sv\",\"edu.sv\",\"gob.sv\",\"org.sv\",\"red.sv\",\"sx\",\"gov.sx\",\"sy\",\"edu.sy\",\"gov.sy\",\"net.sy\",\"mil.sy\",\"com.sy\",\"org.sy\",\"sz\",\"co.sz\",\"ac.sz\",\"org.sz\",\"tc\",\"td\",\"tel\",\"tf\",\"tg\",\"th\",\"ac.th\",\"co.th\",\"go.th\",\"in.th\",\"mi.th\",\"net.th\",\"or.th\",\"tj\",\"ac.tj\",\"biz.tj\",\"co.tj\",\"com.tj\",\"edu.tj\",\"go.tj\",\"gov.tj\",\"int.tj\",\"mil.tj\",\"name.tj\",\"net.tj\",\"nic.tj\",\"org.tj\",\"test.tj\",\"web.tj\",\"tk\",\"tl\",\"gov.tl\",\"tm\",\"com.tm\",\"co.tm\",\"org.tm\",\"net.tm\",\"nom.tm\",\"gov.tm\",\"mil.tm\",\"edu.tm\",\"tn\",\"com.tn\",\"ens.tn\",\"fin.tn\",\"gov.tn\",\"ind.tn\",\"intl.tn\",\"nat.tn\",\"net.tn\",\"org.tn\",\"info.tn\",\"perso.tn\",\"tourism.tn\",\"edunet.tn\",\"rnrt.tn\",\"rns.tn\",\"rnu.tn\",\"mincom.tn\",\"agrinet.tn\",\"defense.tn\",\"turen.tn\",\"to\",\"com.to\",\"gov.to\",\"net.to\",\"org.to\",\"edu.to\",\"mil.to\",\"tr\",\"av.tr\",\"bbs.tr\",\"bel.tr\",\"biz.tr\",\"com.tr\",\"dr.tr\",\"edu.tr\",\"gen.tr\",\"gov.tr\",\"info.tr\",\"mil.tr\",\"k12.tr\",\"kep.tr\",\"name.tr\",\"net.tr\",\"org.tr\",\"pol.tr\",\"tel.tr\",\"tsk.tr\",\"tv.tr\",\"web.tr\",\"nc.tr\",\"gov.nc.tr\",\"tt\",\"co.tt\",\"com.tt\",\"org.tt\",\"net.tt\",\"biz.tt\",\"info.tt\",\"pro.tt\",\"int.tt\",\"coop.tt\",\"jobs.tt\",\"mobi.tt\",\"travel.tt\",\"museum.tt\",\"aero.tt\",\"name.tt\",\"gov.tt\",\"edu.tt\",\"tv\",\"tw\",\"edu.tw\",\"gov.tw\",\"mil.tw\",\"com.tw\",\"net.tw\",\"org.tw\",\"idv.tw\",\"game.tw\",\"ebiz.tw\",\"club.tw\",\"網路.tw\",\"組織.tw\",\"商業.tw\",\"tz\",\"ac.tz\",\"co.tz\",\"go.tz\",\"hotel.tz\",\"info.tz\",\"me.tz\",\"mil.tz\",\"mobi.tz\",\"ne.tz\",\"or.tz\",\"sc.tz\",\"tv.tz\",\"ua\",\"com.ua\",\"edu.ua\",\"gov.ua\",\"in.ua\",\"net.ua\",\"org.ua\",\"cherkassy.ua\",\"cherkasy.ua\",\"chernigov.ua\",\"chernihiv.ua\",\"chernivtsi.ua\",\"chernovtsy.ua\",\"ck.ua\",\"cn.ua\",\"cr.ua\",\"crimea.ua\",\"cv.ua\",\"dn.ua\",\"dnepropetrovsk.ua\",\"dnipropetrovsk.ua\",\"dominic.ua\",\"donetsk.ua\",\"dp.ua\",\"if.ua\",\"ivano-frankivsk.ua\",\"kh.ua\",\"kharkiv.ua\",\"kharkov.ua\",\"kherson.ua\",\"khmelnitskiy.ua\",\"khmelnytskyi.ua\",\"kiev.ua\",\"kirovograd.ua\",\"km.ua\",\"kr.ua\",\"krym.ua\",\"ks.ua\",\"kv.ua\",\"kyiv.ua\",\"lg.ua\",\"lt.ua\",\"lugansk.ua\",\"lutsk.ua\",\"lv.ua\",\"lviv.ua\",\"mk.ua\",\"mykolaiv.ua\",\"nikolaev.ua\",\"od.ua\",\"odesa.ua\",\"odessa.ua\",\"pl.ua\",\"poltava.ua\",\"rivne.ua\",\"rovno.ua\",\"rv.ua\",\"sb.ua\",\"sebastopol.ua\",\"sevastopol.ua\",\"sm.ua\",\"sumy.ua\",\"te.ua\",\"ternopil.ua\",\"uz.ua\",\"uzhgorod.ua\",\"vinnica.ua\",\"vinnytsia.ua\",\"vn.ua\",\"volyn.ua\",\"yalta.ua\",\"zaporizhzhe.ua\",\"zaporizhzhia.ua\",\"zhitomir.ua\",\"zhytomyr.ua\",\"zp.ua\",\"zt.ua\",\"ug\",\"co.ug\",\"or.ug\",\"ac.ug\",\"sc.ug\",\"go.ug\",\"ne.ug\",\"com.ug\",\"org.ug\",\"uk\",\"ac.uk\",\"co.uk\",\"gov.uk\",\"ltd.uk\",\"me.uk\",\"net.uk\",\"nhs.uk\",\"org.uk\",\"plc.uk\",\"police.uk\",\"*.sch.uk\",\"us\",\"dni.us\",\"fed.us\",\"isa.us\",\"kids.us\",\"nsn.us\",\"ak.us\",\"al.us\",\"ar.us\",\"as.us\",\"az.us\",\"ca.us\",\"co.us\",\"ct.us\",\"dc.us\",\"de.us\",\"fl.us\",\"ga.us\",\"gu.us\",\"hi.us\",\"ia.us\",\"id.us\",\"il.us\",\"in.us\",\"ks.us\",\"ky.us\",\"la.us\",\"ma.us\",\"md.us\",\"me.us\",\"mi.us\",\"mn.us\",\"mo.us\",\"ms.us\",\"mt.us\",\"nc.us\",\"nd.us\",\"ne.us\",\"nh.us\",\"nj.us\",\"nm.us\",\"nv.us\",\"ny.us\",\"oh.us\",\"ok.us\",\"or.us\",\"pa.us\",\"pr.us\",\"ri.us\",\"sc.us\",\"sd.us\",\"tn.us\",\"tx.us\",\"ut.us\",\"vi.us\",\"vt.us\",\"va.us\",\"wa.us\",\"wi.us\",\"wv.us\",\"wy.us\",\"k12.ak.us\",\"k12.al.us\",\"k12.ar.us\",\"k12.as.us\",\"k12.az.us\",\"k12.ca.us\",\"k12.co.us\",\"k12.ct.us\",\"k12.dc.us\",\"k12.de.us\",\"k12.fl.us\",\"k12.ga.us\",\"k12.gu.us\",\"k12.ia.us\",\"k12.id.us\",\"k12.il.us\",\"k12.in.us\",\"k12.ks.us\",\"k12.ky.us\",\"k12.la.us\",\"k12.ma.us\",\"k12.md.us\",\"k12.me.us\",\"k12.mi.us\",\"k12.mn.us\",\"k12.mo.us\",\"k12.ms.us\",\"k12.mt.us\",\"k12.nc.us\",\"k12.ne.us\",\"k12.nh.us\",\"k12.nj.us\",\"k12.nm.us\",\"k12.nv.us\",\"k12.ny.us\",\"k12.oh.us\",\"k12.ok.us\",\"k12.or.us\",\"k12.pa.us\",\"k12.pr.us\",\"k12.ri.us\",\"k12.sc.us\",\"k12.tn.us\",\"k12.tx.us\",\"k12.ut.us\",\"k12.vi.us\",\"k12.vt.us\",\"k12.va.us\",\"k12.wa.us\",\"k12.wi.us\",\"k12.wy.us\",\"cc.ak.us\",\"cc.al.us\",\"cc.ar.us\",\"cc.as.us\",\"cc.az.us\",\"cc.ca.us\",\"cc.co.us\",\"cc.ct.us\",\"cc.dc.us\",\"cc.de.us\",\"cc.fl.us\",\"cc.ga.us\",\"cc.gu.us\",\"cc.hi.us\",\"cc.ia.us\",\"cc.id.us\",\"cc.il.us\",\"cc.in.us\",\"cc.ks.us\",\"cc.ky.us\",\"cc.la.us\",\"cc.ma.us\",\"cc.md.us\",\"cc.me.us\",\"cc.mi.us\",\"cc.mn.us\",\"cc.mo.us\",\"cc.ms.us\",\"cc.mt.us\",\"cc.nc.us\",\"cc.nd.us\",\"cc.ne.us\",\"cc.nh.us\",\"cc.nj.us\",\"cc.nm.us\",\"cc.nv.us\",\"cc.ny.us\",\"cc.oh.us\",\"cc.ok.us\",\"cc.or.us\",\"cc.pa.us\",\"cc.pr.us\",\"cc.ri.us\",\"cc.sc.us\",\"cc.sd.us\",\"cc.tn.us\",\"cc.tx.us\",\"cc.ut.us\",\"cc.vi.us\",\"cc.vt.us\",\"cc.va.us\",\"cc.wa.us\",\"cc.wi.us\",\"cc.wv.us\",\"cc.wy.us\",\"lib.ak.us\",\"lib.al.us\",\"lib.ar.us\",\"lib.as.us\",\"lib.az.us\",\"lib.ca.us\",\"lib.co.us\",\"lib.ct.us\",\"lib.dc.us\",\"lib.fl.us\",\"lib.ga.us\",\"lib.gu.us\",\"lib.hi.us\",\"lib.ia.us\",\"lib.id.us\",\"lib.il.us\",\"lib.in.us\",\"lib.ks.us\",\"lib.ky.us\",\"lib.la.us\",\"lib.ma.us\",\"lib.md.us\",\"lib.me.us\",\"lib.mi.us\",\"lib.mn.us\",\"lib.mo.us\",\"lib.ms.us\",\"lib.mt.us\",\"lib.nc.us\",\"lib.nd.us\",\"lib.ne.us\",\"lib.nh.us\",\"lib.nj.us\",\"lib.nm.us\",\"lib.nv.us\",\"lib.ny.us\",\"lib.oh.us\",\"lib.ok.us\",\"lib.or.us\",\"lib.pa.us\",\"lib.pr.us\",\"lib.ri.us\",\"lib.sc.us\",\"lib.sd.us\",\"lib.tn.us\",\"lib.tx.us\",\"lib.ut.us\",\"lib.vi.us\",\"lib.vt.us\",\"lib.va.us\",\"lib.wa.us\",\"lib.wi.us\",\"lib.wy.us\",\"pvt.k12.ma.us\",\"chtr.k12.ma.us\",\"paroch.k12.ma.us\",\"ann-arbor.mi.us\",\"cog.mi.us\",\"dst.mi.us\",\"eaton.mi.us\",\"gen.mi.us\",\"mus.mi.us\",\"tec.mi.us\",\"washtenaw.mi.us\",\"uy\",\"com.uy\",\"edu.uy\",\"gub.uy\",\"mil.uy\",\"net.uy\",\"org.uy\",\"uz\",\"co.uz\",\"com.uz\",\"net.uz\",\"org.uz\",\"va\",\"vc\",\"com.vc\",\"net.vc\",\"org.vc\",\"gov.vc\",\"mil.vc\",\"edu.vc\",\"ve\",\"arts.ve\",\"co.ve\",\"com.ve\",\"e12.ve\",\"edu.ve\",\"firm.ve\",\"gob.ve\",\"gov.ve\",\"info.ve\",\"int.ve\",\"mil.ve\",\"net.ve\",\"org.ve\",\"rec.ve\",\"store.ve\",\"tec.ve\",\"web.ve\",\"vg\",\"vi\",\"co.vi\",\"com.vi\",\"k12.vi\",\"net.vi\",\"org.vi\",\"vn\",\"com.vn\",\"net.vn\",\"org.vn\",\"edu.vn\",\"gov.vn\",\"int.vn\",\"ac.vn\",\"biz.vn\",\"info.vn\",\"name.vn\",\"pro.vn\",\"health.vn\",\"vu\",\"com.vu\",\"edu.vu\",\"net.vu\",\"org.vu\",\"wf\",\"ws\",\"com.ws\",\"net.ws\",\"org.ws\",\"gov.ws\",\"edu.ws\",\"yt\",\"امارات\",\"հայ\",\"বাংলা\",\"бг\",\"бел\",\"中国\",\"中國\",\"الجزائر\",\"مصر\",\"ею\",\"გე\",\"ελ\",\"香港\",\"公司.香港\",\"教育.香港\",\"政府.香港\",\"個人.香港\",\"網絡.香港\",\"組織.香港\",\"ಭಾರತ\",\"ଭାରତ\",\"ভাৰত\",\"भारतम्\",\"भारोत\",\"ڀارت\",\"ഭാരതം\",\"भारत\",\"بارت\",\"بھارت\",\"భారత్\",\"ભારત\",\"ਭਾਰਤ\",\"ভারত\",\"இந்தியா\",\"ایران\",\"ايران\",\"عراق\",\"الاردن\",\"한국\",\"қаз\",\"ලංකා\",\"<22><><EFBFBD>லங்கை\",\"المغرب\",\"мкд\",\"мон\",\"澳門\",\"澳门\",\"مليسيا\",\"عمان\",\"پاکستان\",\"پاكستان\",\"فلسطين\",\"срб\",\"пр.срб\",\"орг.срб\",\"обр.срб\",\"од.срб\",\"упр.срб\",\"ак.срб\",\"рф\",\"قطر\",\"السعودية\",\"السعودیة\",\"السعودیۃ\",\"السعوديه\",\"سودان\",\"新加坡\",\"சிங்கப்பூர்\",\"سورية\",\"سوريا\",\"ไทย\",\"ศึกษา.ไทย\",\"ธุรกิจ.ไทย\",\"รัฐบาล.ไทย\",\"ทหาร.ไทย\",\"เน็ต.ไทย\",\"องค์กร.ไทย\",\"تونس\",\"台灣\",\"台湾\",\"臺灣\",\"укр\",\"اليمن\",\"xxx\",\"*.ye\",\"ac.za\",\"agric.za\",\"alt.za\",\"co.za\",\"edu.za\",\"gov.za\",\"grondar.za\",\"law.za\",\"mil.za\",\"net.za\",\"ngo.za\",\"nis.za\",\"nom.za\",\"org.za\",\"school.za\",\"tm.za\",\"web.za\",\"zm\",\"ac.zm\",\"biz.zm\",\"co.zm\",\"com.zm\",\"edu.zm\",\"gov.zm\",\"info.zm\",\"mil.zm\",\"net.zm\",\"org.zm\",\"sch.zm\",\"zw\",\"ac.zw\",\"co.zw\",\"gov.zw\",\"mil.zw\",\"org.zw\",\"aaa\",\"aarp\",\"abarth\",\"abb\",\"abbott\",\"abbvie\",\"abc\",\"able\",\"abogado\",\"abudhabi\",\"academy\",\"accenture\",\"accountant\",\"accountants\",\"aco\",\"actor\",\"adac\",\"ads\",\"adult\",\"aeg\",\"aetna\",\"afamilycompany\",\"afl\",\"africa\",\"agakhan\",\"agency\",\"aig\",\"aigo\",\"airbus\",\"airforce\",\"airtel\",\"akdn\",\"alfaromeo\",\"alibaba\",\"alipay\",\"allfinanz\",\"allstate\",\"ally\",\"alsace\",\"alstom\",\"americanexpress\",\"americanfamily\",\"amex\",\"amfam\",\"amica\",\"amsterdam\",\"analytics\",\"android\",\"anquan\",\"anz\",\"aol\",\"apartments\",\"app\",\"apple\",\"aquarelle\",\"arab\",\"aramco\",\"archi\",\"army\",\"art\",\"arte\",\"asda\",\"associates\",\"athleta\",\"attorney\",\"auction\",\"audi\",\"audible\",\"audio\",\"auspost\",\"author\",\"auto\",\"autos\",\"avianca\",\"aws\",\"axa\",\"azure\",\"baby\",\"baidu\",\"banamex\",\"bananarepublic\",\"band\",\"bank\",\"bar\",\"barcelona\",\"barclaycard\",\"barclays\",\"barefoot\",\"bargains\",\"baseball\",\"basketball\",\"bauhaus\",\"bayern\",\"bbc\",\"bbt\",\"bbva\",\"bcg\",\"bcn\",\"beats\",\"beauty\",\"beer\",\"bentley\",\"berlin\",\"best\",\"bestbuy\",\"bet\",\"bharti\",\"bible\",\"bid\",\"bike\",\"bing\",\"bingo\",\"bio\",\"black\",\"blackfriday\",\"blockbuster\",\"blog\",\"bloomberg\",\"blue\",\"bms\",\"bmw\",\"bnl\",\"bnpparibas\",\"boats\",\"boehringer\",\"bofa\",\"bom\",\"bond\",\"boo\",\"book\",\"booking\",\"bosch\",\"bostik\",\"boston\",\"bot\",\"boutique\",\"box\",\"bradesco\",\"bridgestone\",\"broadway\",\"broker\",\"brother\",\"brussels\",\"budapest\",\"bugatti\",\"build\",\"builders\",\"business\",\"buy\",\"buzz\",\"bzh\",\"cab\",\"cafe\",\"cal\",\"call\",\"calvinklein\",\"cam\",\"camera\",\"camp\",\"cancerresearch\",\"canon\",\"capetown\",\"capital\",\"capitalone\",\"car\",\"caravan\",\"cards\",\"care\",\"career\",\"careers\",\"cars\",\"cartier\",\"casa\",\"case\",\"caseih\",\"cash\",\"casino\",\"catering\",\"catholic\",\"cba\",\"cbn\",\"cbre\",\"cbs\",\"ceb\",\"center\",\"ceo\",\"cern\",\"cfa\",\"cfd\",\"chanel\",\"channel\",\"charity\",\"chase\",\"chat\",\"cheap\",\"chintai\",\"christmas\",\"chrome\",\"chrysler\",\"church\",\"cipriani\",\"circle\",\"cisco\",\"citadel\",\"citi\",\"citic\",\"city\",\"cityeats\",\"claims\",\"cleaning\",\"click\",\"clinic\",\"clinique\",\"clothing\",\"cloud\",\"club\",\"clubmed\",\"coach\",\"codes\",\"coffee\",\"college\",\"cologne\",\"comcast\",\"commbank\",\"community\",\"company\",\"compare\",\"computer\",\"comsec\",\"condos\",\"construction\",\"consulting\",\"contact\",\"contractors\",\"cooking\",\"cookingchannel\",\"cool\",\"corsica\",\"country\",\"coupon\",\"coupons\",\"courses\",\"credit\",\"creditcard\",\"creditunion\",\"cricket\",\"crown\",\"crs\",\"cruise\",\"cruises\",\"csc\",\"cuisinella\",\"cymru\",\"cyou\",\"dabur\",\"dad\",\"dance\",\"data\",\"date\",\"dating\",\"datsun\",\"day\",\"dclk\",\"dds\",\"deal\",\"dealer\",\"deals\",\"degree\",\"delivery\",\"dell\",\"deloitte\",\"delta\",\"democrat\",\"dental\",\"dentist\",\"desi\",\"design\",\"dev\",\"dhl\",\"diamonds\",\"diet\",\"digital\",\"direct\",\"directory\",\"discount\",\"discover\",\"dish\",\"diy\",\"dnp\",\"docs\",\"doctor\",\"dodge\",\"dog\",\"domains\",\"dot\",\"download\",\"drive\",\"dtv\",\"dubai\",\"duck\",\"dunlop\",\"duns\",\"dupont\",\"durban\",\"dvag\",\"dvr\",\"earth\",\"eat\",\"eco\",\"edeka\",\"education\",\"email\",\"emerck\",\"energy\",\"engineer\",\"engineering\",\"enterprises\",\"epson\",\"equipment\",\"ericsson\",\"erni\",\"esq\",\"estate\",\"esurance\",\"etisalat\",\"eurovision\",\"eus\",\"events\",\"everbank\",\"exchange\",\"expert\",\"exposed\",\"express\",\"extraspace\",\"fage\",\"fail\",\"fairwinds\",\"faith\",\"family\",\"fan\",\"fans\",\"farm\",\"farmers\",\"fashion\",\"fast\",\"fedex\",\"feedback\",\"ferrari\",\"ferrero\",\"fiat\",\"fidelity\",\"fido\",\"film\",\"final\",\"finance\",\"financial\",\"fire\",\"firestone\",\"firmdale\",\"fish\",\"fishing\",\"fit\",\"fitness\",\"flickr\",\"flights\",\"flir\",\"florist\",\"flowers\",\"fly\",\"foo\",\"food\",\"foodnetwork\",\"football\",\"ford\",\"forex\",\"forsale\",\"forum\",\"foundation\",\"fox\",\"free\",\"fresenius\",\"frl\",\"frogans\",\"frontdoor\",\"frontier\",\"ftr\",\"fujitsu\",\"fujixerox\",\"fun\",\"fund\",\"furniture\",\"futbol\",\"fyi\",\"gal\",\"gallery\",\"gallo\",\"gallup\",\"game\",\"games\",\"gap\",\"garden\",\"gbiz\",\"gdn\",\"gea\",\"gent\",\"genting\",\"george\",\"ggee\",\"gift\",\"gifts\",\"gives\",\"giving\",\"glade\",\"glass\",\"gle\",\"global\",\"globo\",\"gmail\",\"gmbh\",\"gmo\",\"gmx\",\"godaddy\",\"gold\",\"goldpoint\",\"golf\",\"goo\",\"goodyear\",\"goog\",\"google\",\"gop\",\"got\",\"grainger\",\"graphics\",\"gratis\",\"green\",\"gripe\",\"grocery\",\"group\",\"guardian\",\"gucci\",\"guge\",\"guide\",\"guitars\",\"guru\",\"hair\",\"hamburg\",\"hangout\",\"haus\",\"hbo\",\"hdfc\",\"hdfcbank\",\"health\",\"healthcare\",\"help\",\"helsinki\",\"here\",\"hermes\",\"hgtv\",\"hiphop\",\"hisamitsu\",\"hitachi\",\"hiv\",\"hkt\",\"hockey\",\"holdings\",\"holiday\",\"homedepot\",\"homegoods\",\"homes\",\"homesense\",\"honda\",\"honeywell\",\"horse\",\"hospital\",\"host\",\"hosting\",\"hot\",\"hoteles\",\"hotels\",\"hotmail\",\"house\",\"how\",\"hsbc\",\"hughes\",\"hyatt\",\"hyundai\",\"ibm\",\"icbc\",\"ice\",\"icu\",\"ieee\",\"ifm\",\"ikano\",\"imamat\",\"imdb\",\"immo\",\"immobilien\",\"inc\",\"industries\",\"infiniti\",\"ing\",\"ink\",\"institute\",\"insurance\",\"insure\",\"intel\",\"international\",\"intuit\",\"investments\",\"ipiranga\",\"irish\",\"iselect\",\"ismaili\",\"ist\",\"istanbul\",\"itau\",\"itv\",\"iveco\",\"jaguar\",\"java\",\"jcb\",\"jcp\",\"jeep\",\"jetzt\",\"jewelry\",\"jio\",\"jll\",\"jmp\",\"jnj\",\"joburg\",\"jot\",\"joy\",\"jpmorgan\",\"jprs\",\"juegos\",\"juniper\",\"kaufen\",\"kddi\",\"kerryhotels\",\"kerrylogistics\",\"kerryproperties\",\"kfh\",\"kia\",\"kim\",\"kinder\",\"kindle\",\"kitchen\",\"kiwi\",\"koeln\",\"komatsu\",\"kosher\",\"kpmg\",\"kpn\",\"krd\",\"kred\",\"kuokgroup\",\"kyoto\",\"lacaixa\",\"ladbrokes\",\"lamborghini\",\"lamer\",\"lancaster\",\"lancia\",\"lancome\",\"land\",\"landrover\",\"lanxess\",\"lasalle\",\"lat\",\"latino\",\"latrobe\",\"law\",\"lawyer\",\"lds\",\"lease\",\"leclerc\",\"lefrak\",\"legal\",\"lego\",\"lexus\",\"lgbt\",\"liaison\",\"lidl\",\"life\",\"lifeinsurance\",\"lifestyle\",\"lighting\",\"like\",\"lilly\",\"limited\",\"limo\",\"lincoln\",\"linde\",\"link\",\"lipsy\",\"live\",\"living\",\"lixil\",\"llc\",\"loan\",\"loans\",\"locker\",\"locus\",\"loft\",\"lol\",\"london\",\"lotte\",\"lotto\",\"love\",\"lpl\",\"lplfinancial\",\"ltd\",\"ltda\",\"lundbeck\",\"lupin\",\"luxe\",\"luxury\",\"macys\",\"madrid\",\"maif\",\"maison\",\"makeup\",\"man\",\"management\",\"mango\",\"map\",\"market\",\"marketing\",\"markets\",\"marriott\",\"marshalls\",\"maserati\",\"mattel\",\"mba\",\"mckinsey\",\"med\",\"media\",\"meet\",\"melbourne\",\"meme\",\"memorial\",\"men\",\"menu\",\"merckmsd\",\"metlife\",\"miami\",\"microsoft\",\"mini\",\"mint\",\"mit\",\"mitsubishi\",\"mlb\",\"mls\",\"mma\",\"mobile\",\"mobily\",\"moda\",\"moe\",\"moi\",\"mom\",\"monash\",\"money\",\"monster\",\"mopar\",\"mormon\",\"mortgage\",\"moscow\",\"moto\",\"motorcycles\",\"mov\",\"movie\",\"movistar\",\"msd\",\"mtn\",\"mtr\",\"mutual\",\"nab\",\"nadex\",\"nagoya\",\"nationwide\",\"natura\",\"navy\",\"nba\",\"nec\",\"netbank\",\"netflix\",\"network\",\"neustar\",\"new\",\"newholland\",\"news\",\"next\",\"nextdirect\",\"nexus\",\"nfl\",\"ngo\",\"nhk\",\"nico\",\"nike\",\"nikon\",\"ninja\",\"nissan\",\"nissay\",\"nokia\",\"northwesternmutual\",\"norton\",\"now\",\"nowruz\",\"nowtv\",\"nra\",\"nrw\",\"ntt\",\"nyc\",\"obi\",\"observer\",\"off\",\"office\",\"okinawa\",\"olayan\",\"olayangroup\",\"oldnavy\",\"ollo\",\"omega\",\"one\",\"ong\",\"onl\",\"online\",\"onyourside\",\"ooo\",\"open\",\"oracle\",\"orange\",\"organic\",\"origins\",\"osaka\",\"otsuka\",\"ott\",\"ovh\",\"page\",\"panasonic\",\"paris\",\"pars\",\"partners\",\"parts\",\"party\",\"passagens\",\"pay\",\"pccw\",\"pet\",\"pfizer\",\"pharmacy\",\"phd\",\"philips\",\"phone\",\"photo\",\"photography\",\"photos\",\"physio\",\"piaget\",\"pics\",\"pictet\",\"pictures\",\"pid\",\"pin\",\"ping\",\"pink\",\"pioneer\",\"pizza\",\"place\",\"play\",\"playstation\",\"plumbing\",\"plus\",\"pnc\",\"pohl\",\"poker\",\"politie\",\"porn\",\"pramerica\",\"praxi\",\"press\",\"prime\",\"prod\",\"productions\",\"prof\",\"progressive\",\"promo\",\"properties\",\"property\",\"protection\",\"pru\",\"prudential\",\"pub\",\"pwc\",\"qpon\",\"quebec\",\"quest\",\"qvc\",\"racing\",\"radio\",\"raid\",\"read\",\"realestate\",\"realtor\",\"realty\",\"recipes\",\"red\",\"redstone\",\"redumbrella\",\"rehab\",\"reise\",\"reisen\",\"reit\",\"reliance\",\"ren\",\"rent\",\"rentals\",\"repair\",\"report\",\"republican\",\"rest\",\"restaurant\",\"review\",\"reviews\",\"rexroth\",\"rich\",\"richardli\",\"ricoh\",\"rightathome\",\"ril\",\"rio\",\"rip\",\"rmit\",\"rocher\",\"rocks\",\"rodeo\",\"rogers\",\"room\",\"rsvp\",\"rugby\",\"ruhr\",\"run\",\"rwe\",\"ryukyu\",\"saarland\",\"safe\",\"safety\",\"sakura\",\"sale\",\"salon\",\"samsclub\",\"samsung\",\"sandvik\",\"sandvikcoromant\",\"sanofi\",\"sap\",\"sarl\",\"sas\",\"save\",\"saxo\",\"sbi\",\"sbs\",\"sca\",\"scb\",\"schaeffler\",\"schmidt\",\"scholarships\",\"school\",\"schule\",\"schwarz\",\"science\",\"scjohnson\",\"scor\",\"scot\",\"search\",\"seat\",\"secure\",\"security\",\"seek\",\"select\",\"sener\",\"services\",\"ses\",\"seven\",\"sew\",\"sex\",\"sexy\",\"sfr\",\"shangrila\",\"sharp\",\"shaw\",\"shell\",\"shia\",\"shiksha\",\"shoes\",\"shop\",\"shopping\",\"shouji\",\"show\",\"showtime\",\"shriram\",\"silk\",\"sina\",\"singles\",\"site\",\"ski\",\"skin\",\"sky\",\"skype\",\"sling\",\"smart\",\"smile\",\"sncf\",\"soccer\",\"social\",\"softbank\",\"software\",\"sohu\",\"solar\",\"solutions\",\"song\",\"sony\",\"soy\",\"space\",\"sport\",\"spot\",\"spreadbetting\",\"srl\",\"srt\",\"stada\",\"staples\",\"star\",\"starhub\",\"statebank\",\"statefarm\",\"stc\",\"stcgroup\",\"stockholm\",\"storage\",\"store\",\"stream\",\"studio\",\"study\",\"style\",\"sucks\",\"supplies\",\"supply\",\"support\",\"surf\",\"surgery\",\"suzuki\",\"swatch\",\"swiftcover\",\"swiss\",\"sydney\",\"symantec\",\"systems\",\"tab\",\"taipei\",\"talk\",\"taobao\",\"target\",\"tatamotors\",\"tatar\",\"tattoo\",\"tax\",\"taxi\",\"tci\",\"tdk\",\"team\",\"tech\",\"technology\",\"telefonica\",\"temasek\",\"tennis\",\"teva\",\"thd\",\"theater\",\"theatre\",\"tiaa\",\"tickets\",\"tienda\",\"tiffany\",\"tips\",\"tires\",\"tirol\",\"tjmaxx\",\"tjx\",\"tkmaxx\",\"tmall\",\"today\",\"tokyo\",\"tools\",\"top\",\"toray\",\"toshiba\",\"total\",\"tours\",\"town\",\"toyota\",\"toys\",\"trade\",\"trading\",\"training\",\"travel\",\"travelchannel\",\"travelers\",\"travelersinsurance\",\"trust\",\"trv\",\"tube\",\"tui\",\"tunes\",\"tushu\",\"tvs\",\"ubank\",\"ubs\",\"uconnect\",\"unicom\",\"university\",\"uno\",\"uol\",\"ups\",\"vacations\",\"vana\",\"vanguard\",\"vegas\",\"ventures\",\"verisign\",\"versicherung\",\"vet\",\"viajes\",\"video\",\"vig\",\"viking\",\"villas\",\"vin\",\"vip\",\"virgin\",\"visa\",\"vision\",\"vistaprint\",\"viva\",\"vivo\",\"vlaanderen\",\"vodka\",\"volkswagen\",\"volvo\",\"vote\",\"voting\",\"voto\",\"voyage\",\"vuelos\",\"wales\",\"walmart\",\"walter\",\"wang\",\"wanggou\",\"warman\",\"watch\",\"watches\",\"weather\",\"weatherchannel\",\"webcam\",\"weber\",\"website\",\"wed\",\"wedding\",\"weibo\",\"weir\",\"whoswho\",\"wien\",\"wiki\",\"williamhill\",\"win\",\"windows\",\"wine\",\"winners\",\"wme\",\"wolterskluwer\",\"woodside\",\"work\",\"works\",\"world\",\"wow\",\"wtc\",\"wtf\",\"xbox\",\"xerox\",\"xfinity\",\"xihuan\",\"xin\",\"कॉम\",\"セール\",\"佛山\",\"慈善\",\"集团\",\"在线\",\"大众汽车\",\"点看\",\"คอม\",\"八卦\",\"موقع\",\"公益\",\"公司\",\"香格里拉\",\"网站\",\"移动\",\"我爱你\",\"москва\",\"католик\",\"онлайн\",\"сайт\",\"联通\",\"קום\",\"时尚\",\"微博\",\"淡马锡\",\"ファッション\",\"орг\",\"नेट\",\"ストア\",\"삼성\",\"商标\",\"商店\",\"商城\",\"дети\",\"ポイント\",\"新闻\",\"工行\",\"家電\",\"كوم\",\"中文网\",\"中信\",\"娱乐\",\"谷歌\",\"電訊盈科\",\"购物\",\"クラウド\",\"通販\",\"网店\",\"संगठन\",\"餐厅\",\"网络\",\"ком\",\"诺基亚\",\"食品\",\"飞利浦\",\"手表\",\"手机\",\"ارامكو\",\"العليان\",\"اتصالات\",\"بازار\",\"موبايلي\",\"ابوظبي\",\"كاثوليك\",\"همراه\",\"닷컴\",\"政府\",\"شبكة\",\"بيتك\",\"عرب\",\"机构\",\"组织机构\",\"健康\",\"招聘\",\"рус\",\"珠宝\",\"大拿\",\"みんな\",\"グーグル\",\"世界\",\"書籍\",\"网址\",\"닷넷\",\"コム\",\"天主教\",\"游戏\",\"vermögensberater\",\"vermögensberatung\",\"企业\",\"信息\",\"嘉里大酒店\",\"嘉里\",\"广东\",\"政务\",\"xyz\",\"yachts\",\"yahoo\",\"yamaxun\",\"yandex\",\"yodobashi\",\"yoga\",\"yokohama\",\"you\",\"youtube\",\"yun\",\"zappos\",\"zara\",\"zero\",\"zip\",\"zone\",\"zuerich\",\"cc.ua\",\"inf.ua\",\"ltd.ua\",\"beep.pl\",\"barsy.ca\",\"*.compute.estate\",\"*.alces.network\",\"alwaysdata.net\",\"cloudfront.net\",\"*.compute.amazonaws.com\",\"*.compute-1.amazonaws.com\",\"*.compute.amazonaws.com.cn\",\"us-east-1.amazonaws.com\",\"cn-north-1.eb.amazonaws.com.cn\",\"cn-northwest-1.eb.amazonaws.com.cn\",\"elasticbeanstalk.com\",\"ap-northeast-1.elasticbeanstalk.com\",\"ap-northeast-2.elasticbeanstalk.com\",\"ap-northeast-3.elasticbeanstalk.com\",\"ap-south-1.elasticbeanstalk.com\",\"ap-southeast-1.elasticbeanstalk.com\",\"ap-southeast-2.elasticbeanstalk.com\",\"ca-central-1.elasticbeanstalk.com\",\"eu-central-1.elasticbeanstalk.com\",\"eu-west-1.elasticbeanstalk.com\",\"eu-west-2.elasticbeanstalk.com\",\"eu-west-3.elasticbeanstalk.com\",\"sa-east-1.elasticbeanstalk.com\",\"us-east-1.elasticbeanstalk.com\",\"us-east-2.elasticbeanstalk.com\",\"us-gov-west-1.elasticbeanstalk.com\",\"us-west-1.elasticbeanstalk.com\",\"us-west-2.elasticbeanstalk.com\",\"*.elb.amazonaws.com\",\"*.elb.amazonaws.com.cn\",\"s3.amazonaws.com\",\"s3-ap-northeast-1.amazonaws.com\",\"s3-ap-northeast-2.amazonaws.com\",\"s3-ap-south-1.amazonaws.com\",\"s3-ap-southeast-1.amazonaws.com\",\"s3-ap-southeast-2.amazonaws.com\",\"s3-ca-central-1.amazonaws.com\",\"s3-eu-central-1.amazonaws.com\",\"s3-eu-west-1.amazonaws.com\",\"s3-eu-west-2.amazonaws.com\",\"s3-eu-west-3.amazonaws.com\",\"s3-external-1.amazonaws.com\",\"s3-fips-us-gov-west-1.amazonaws.com\",\"s3-sa-east-1.amazonaws.com\",\"s3-us-gov-west-1.amazonaws.com\",\"s3-us-east-2.amazonaws.com\",\"s3-us-west-1.amazonaws.com\",\"s3-us-west-2.amazonaws.com\",\"s3.ap-northeast-2.amazonaws.com\",\"s3.ap-south-1.amazonaws.com\",\"s3.cn-north-1.amazonaws.com.cn\",\"s3.ca-central-1.amazonaws.com\",\"s3.eu-central-1.amazonaws.com\",\"s3.eu-west-2.amazonaws.com\",\"s3.eu-west-3.amazonaws.com\",\"s3.us-east-2.amazonaws.com\",\"s3.dualstack.ap-northeast-1.amazonaws.com\",\"s3.dualstack.ap-northeast-2.amazonaws.com\",\"s3.dualstack.ap-south-1.amazonaws.com\",\"s3.dualstack.ap-southeast-1.amazonaws.com\",\"s3.dualstack.ap-southeast-2.amazonaws.com\",\"s3.dualstack.ca-central-1.amazonaws.com\",\"s3.dualstack.eu-central-1.amazonaws.com\",\"s3.dualstack.eu-west-1.amazonaws.com\",\"s3.dualstack.eu-west-2.amazonaws.com\",\"s3.dualstack.eu-west-3.amazonaws.com\",\"s3.dualstack.sa-east-1.amazonaws.com\",\"s3.dualstack.us-east-1.amazonaws.com\",\"s3.dualstack.us-east-2.amazonaws.com\",\"s3-website-us-east-1.amazonaws.com\",\"s3-website-us-west-1.amazonaws.com\",\"s3-website-us-west-2.amazonaws.com\",\"s3-website-ap-northeast-1.amazonaws.com\",\"s3-website-ap-southeast-1.amazonaws.com\",\"s3-website-ap-southeast-2.amazonaws.com\",\"s3-website-eu-west-1.amazonaws.com\",\"s3-website-sa-east-1.amazonaws.com\",\"s3-website.ap-northeast-2.amazonaws.com\",\"s3-website.ap-south-1.amazonaws.com\",\"s3-website.ca-central-1.amazonaws.com\",\"s3-website.eu-central-1.amazonaws.com\",\"s3-website.eu-west-2.amazonaws.com\",\"s3-website.eu-west-3.amazonaws.com\",\"s3-website.us-east-2.amazonaws.com\",\"t3l3p0rt.net\",\"tele.amune.org\",\"apigee.io\",\"on-aptible.com\",\"user.party.eus\",\"pimienta.org\",\"poivron.org\",\"potager.org\",\"sweetpepper.org\",\"myasustor.com\",\"go-vip.co\",\"go-vip.net\",\"wpcomstaging.com\",\"myfritz.net\",\"*.awdev.ca\",\"*.advisor.ws\",\"b-data.io\",\"backplaneapp.io\",\"balena-devices.com\",\"app.banzaicloud.io\",\"betainabox.com\",\"bnr.la\",\"blackbaudcdn.net\",\"boomla.net\",\"boxfuse.io\",\"square7.ch\",\"bplaced.com\",\"bplaced.de\",\"square7.de\",\"bplaced.net\",\"square7.net\",\"browsersafetymark.io\",\"uk0.bigv.io\",\"dh.bytemark.co.uk\",\"vm.bytemark.co.uk\",\"mycd.eu\",\"carrd.co\",\"crd.co\",\"uwu.ai\",\"ae.org\",\"ar.com\",\"br.com\",\"cn.com\",\"com.de\",\"com.se\",\"de.com\",\"eu.com\",\"gb.com\",\"gb.net\",\"hu.com\",\"hu.net\",\"jp.net\",\"jpn.com\",\"kr.com\",\"mex.com\",\"no.com\",\"qc.com\",\"ru.com\",\"sa.com\",\"se.net\",\"uk.com\",\"uk.net\",\"us.com\",\"uy.com\",\"za.bz\",\"za.com\",\"africa.com\",\"gr.com\",\"in.net\",\"us.org\",\"co.com\",\"c.la\",\"certmgr.org\",\"xenapponazure.com\",\"discourse.group\",\"virtueeldomein.nl\",\"cleverapps.io\",\"*.lcl.dev\",\"*.stg.dev\",\"c66.me\",\"cloud66.ws\",\"cloud66.zone\",\"jdevcloud.com\",\"wpdevcloud.com\",\"cloudaccess.host\",\"freesite.host\",\"cloudaccess.net\",\"cloudcontrolled.com\",\"cloudcontrolapp.com\",\"cloudera.site\",\"workers.dev\",\"wnext.app\",\"co.ca\",\"*.otap.co\",\"co.cz\",\"c.cdn77.org\",\"cdn77-ssl.net\",\"r.cdn77.net\",\"rsc.cdn77.org\",\"ssl.origin.cdn77-secure.org\",\"cloudns.asia\",\"cloudns.biz\",\"cloudns.club\",\"cloudns.cc\",\"cloudns.eu\",\"cloudns.in\",\"cloudns.info\",\"cloudns.org\",\"cloudns.pro\",\"cloudns.pw\",\"cloudns.us\",\"cloudeity.net\",\"cnpy.gdn\",\"co.nl\",\"co.no\",\"webhosting.be\",\"hosting-cluster.nl\",\"dyn.cosidns.de\",\"dynamisches-dns.de\",\"dnsupdater.de\",\"internet-dns.de\",\"l-o-g-i-n.de\",\"dynamic-dns.info\",\"feste-ip.net\",\"knx-server.net\",\"static-access.net\",\"realm.cz\",\"*.cryptonomic.net\",\"cupcake.is\",\"cyon.link\",\"cyon.site\",\"daplie.me\",\"localhost.daplie.me\",\"dattolocal.com\",\"dattorelay.com\",\"dattoweb.com\",\"mydatto.com\",\"dattolocal.net\",\"mydatto.net\",\"biz.dk\",\"co.dk\",\"firm.dk\",\"reg.dk\",\"store.dk\",\"*.dapps.earth\",\"*.bzz.dapps.earth\",\"debian.net\",\"dedyn.io\",\"dnshome.de\",\"online.th\",\"shop.th\",\"drayddns.com\",\"dreamhosters.com\",\"mydrobo.com\",\"drud.io\",\"drud.us\",\"duckdns.org\",\"dy.fi\",\"tunk.org\",\"dyndns-at-home.com\",\"dyndns-at-work.com\",\"dyndns-blog.com\",\"dyndns-free.com\",\"dyndns-home.com\",\"dyndns-ip.com\",\"dyndns-mail.com\",\"dyndns-office.com\",\"dyndns-pics.com\",\"dyndns-remote.com\",\"dyndns-server.com\",\"dyndns-web.com\",\"dyndns-wiki.com\",\"dyndns-work.com\",\"dyndns.biz\",\"dyndns.info\",\"dyndns.org\",\"dyndns.tv\",\"at-band-camp.net\",\"ath.cx\",\"barrel-of-knowledge.info\",\"barrell-of-knowledge.info\",\"better-than.tv\",\"blogdns.com\",\"blogdns.net\",\"blogdns.org\",\"blogsite.org\",\"boldlygoingnowhere.org\",\"broke-it.net\",\"buyshouses.net\",\"cechire.com\",\"dnsalias.com\",\"dnsalias.net\",\"dnsalias.org\",\"dnsdojo.com\",\"dnsdojo.net\",\"dnsdojo.org\",\"does-it.net\",\"doesntexist.com\",\"doesntexist.org\",\"dontexist.com\",\"dontexist.net\",\"dontexist.org\",\"doomdns.com\",\"doomdns.org\",\"dvrdns.org\",\"dyn-o-saur.com\",\"dynalias.com\",\"dynalias.net\",\"dynalias.org\",\"dynathome.net\",\"dyndns.ws\",\"endofinternet.net\",\"endofinternet.org\",\"endoftheinternet.org\",\"est-a-la-maison.com\",\"est-a-la-masion.com\",\"est-le-patron.com\",\"est-mon-blogueur.com\",\"for-better.biz\",\"for-more.biz\",\"for-our.info\",\"for-some.biz\",\"for-the.biz\",\"forgot.her.name\",\"forgot.his.name\",\"from-ak.com\",\"from-al.com\",\"from-ar.com\",\"from-az.net\",\"from-ca.com\",\"from-co.net\",\"from-ct.com\",\"from-dc.com\",\"from-de.com\",\"from-fl.com\",\"from-ga.com\",\"from-hi.com\",\"from-ia.com\",\"from-id.com\",\"from-il.com\",\"from-in.com\",\"from-ks.com\",\"from-ky.com\",\"from-la.net\",\"from-ma.com\",\"from-md.com\",\"from-me.org\",\"from-mi.com\",\"from-mn.com\",\"from-mo.com\",\"from-ms.com\",\"from-mt.com\",\"from-nc.com\",\"from-nd.com\",\"from-ne.com\",\"from-nh.com\",\"from-nj.com\",\"from-nm.com\",\"from-nv.com\",\"from-ny.net\",\"from-oh.com\",\"from-ok.com\",\"from-or.com\",\"from-pa.com\",\"from-pr.com\",\"from-ri.com\",\"from-sc.com\",\"from-sd.com\",\"from-tn.com\",\"from-tx.com\",\"from-ut.com\",\"from-va.com\",\"from-vt.com\",\"from-wa.com\",\"from-wi.com\",\"from-wv.com\",\"from-wy.com\",\"ftpaccess.cc\",\"fuettertdasnetz.de\",\"game-host.org\",\"game-server.cc\",\"getmyip.com\",\"gets-it.net\",\"go.dyndns.org\",\"gotdns.com\",\"gotdns.org\",\"groks-the.info\",\"groks-this.info\",\"ham-radio-op.net\",\"here-for-more.info\",\"hobby-site.com\",\"hobby-site.org\",\"home.dyndns.org\",\"homedns.org\",\"homeftp.net\",\"homeftp.org\",\"homeip.net\",\"homelinux.com\",\"homelinux.net\",\"homelinux.org\",\"homeunix.com\",\"homeunix.net\",\"homeunix.org\",\"iamallama.com\",\"in-the-band.net\",\"is-a-anarchist.com\",\"is-a-blogger.com\",\"is-a-bookkeeper.com\",\"is-a-bruinsfan.org\",\"is-a-bulls-fan.com\",\"is-a-candidate.org\",\"is-a-caterer.com\",\"is-a-celticsfan.org\",\"is-a-chef.com\",\"is-a-chef.net\",\"is-a-chef.org\",\"is-a-conservative.com\",\"is-a-cpa.com\",\"is-a-cubicle-slave.com\",\"is-a-democrat.com\",\"is-a-designer.com\",\"is-a-doctor.com\",\"is-a-financialadvisor.com\",\"is-a-geek.com\",\"is-a-geek.net\",\"is-a-geek.org\",\"is-a-green.com\",\"is-a-guru.com\",\"is-a-hard-worker.com\",\"is-a-hunter.com\",\"is-a-knight.org\",\"is-a-landscaper.com\",\"is-a-lawyer.com\",\"is-a-liberal.com\",\"is-a-libertarian.com\",\"is-a-linux-user.org\",\"is-a-llama.com\",\"is-a-musician.com\",\"is-a-nascarfan.com\",\"is-a-nurse.com\",\"is-a-painter.com\",\"is-a-patsfan.org\",\"is-a-personaltrainer.com\",\"is-a-photographer.com\",\"is-a-player.com\",\"is-a-republican.com\",\"is-a-rockstar.com\",\"is-a-socialist.com\",\"is-a-soxfan.org\",\"is-a-student.com\",\"is-a-teacher.com\",\"is-a-techie.com\",\"is-a-therapist.com\",\"is-an-accountant.com\",\"is-an-actor.com\",\"is-an-actress.com\",\"is-an-anarchist.com\",\"is-an-artist.com\",\"is-an-engineer.com\",\"is-an-entertainer.com\",\"is-by.us\",\"is-certified.com\",\"is-found.org\",\"is-gone.com\",\"is-into-anime.com\",\"is-into-cars.com\",\"is-into-cartoons.com\",\"is-into-games.com\",\"is-leet.com\",\"is-lost.org\",\"is-not-certified.com\",\"is-saved.org\",\"is-slick.com\",\"is-uberleet.com\",\"is-very-bad.org\",\"is-very-evil.org\",\"is-very-good.org\",\"is-very-nice.org\",\"is-very-sweet.org\",\"is-with-theband.com\",\"isa-geek.com\",\"isa-geek.net\",\"isa-geek.org\",\"isa-hockeynut.com\",\"issmarterthanyou.com\",\"isteingeek.de\",\"istmein.de\",\"kicks-ass.net\",\"kicks-ass.org\",\"knowsitall.info\",\"land-4-sale.us\",\"lebtimnetz.de\",\"leitungsen.de\",\"likes-pie.com\",\"likescandy.com\",\"merseine.nu\",\"mine.nu\",\"misconfused.org\",\"mypets.ws\",\"myphotos.cc\",\"neat-url.com\",\"office-on-the.net\",\"on-the-web.tv\",\"podzone.net\",\"podzone.org\",\"readmyblog.org\",\"saves-the-whales.com\",\"scrapper-site.net\",\"scrapping.cc\",\"selfip.biz\",\"selfip.com\",\"selfip.info\",\"selfip.net\",\"selfip.org\",\"sells-for-less.com\",\"sells-for-u.com\",\"sells-it.net\",\"sellsyourhome.org\",\"servebbs.com\",\"servebbs.net\",\"servebbs.org\",\"serveftp.net\",\"serveftp.org\",\"servegame.org\",\"shacknet.nu\",\"simple-url.com\",\"space-to-rent.com\",\"stuff-4-sale.org\",\"stuff-4-sale.us\",\"teaches-yoga.com\",\"thruhere.net\",\"traeumtgerade.de\",\"webhop.biz\",\"webhop.info\",\"webhop.net\",\"webhop.org\",\"worse-than.tv\",\"writesthisblog.com\",\"ddnss.de\",\"dyn.ddnss.de\",\"dyndns.ddnss.de\",\"dyndns1.de\",\"dyn-ip24.de\",\"home-webserver.de\",\"dyn.home-webserver.de\",\"myhome-server.de\",\"ddnss.org\",\"definima.net\",\"definima.io\",\"bci.dnstrace.pro\",\"ddnsfree.com\",\"ddnsgeek.com\",\"giize.com\",\"gleeze.com\",\"kozow.com\",\"loseyourip.com\",\"ooguy.com\",\"theworkpc.com\",\"casacam.net\",\"dynu.net\",\"accesscam.org\",\"camdvr.org\",\"freeddns.org\",\"mywire.org\",\"webredirect.org\",\"myddns.rocks\",\"blogsite.xyz\",\"dynv6.net\",\"e4.cz\",\"mytuleap.com\",\"onred.one\",\"staging.onred.one\",\"enonic.io\",\"customer.enonic.io\",\"eu.org\",\"al.eu.org\",\"asso.eu.org\",\"at.eu.org\",\"au.eu.org\",\"be.eu.org\",\"bg.eu.org\",\"ca.eu.org\",\"cd.eu.org\",\"ch.eu.org\",\"cn.eu.org\",\"cy.eu.org\",\"cz.eu.org\",\"de.eu.org\",\"dk.eu.org\",\"edu.eu.org\",\"ee.eu.org\",\"es.eu.org\",\"fi.eu.org\",\"fr.eu.org\",\"gr.eu.org\",\"hr.eu.org\",\"hu.eu.org\",\"ie.eu.org\",\"il.eu.org\",\"in.eu.org\",\"int.eu.org\",\"is.eu.org\",\"it.eu.org\",\"jp.eu.org\",\"kr.eu.org\",\"lt.eu.org\",\"lu.eu.org\",\"lv.eu.org\",\"mc.eu.org\",\"me.eu.org\",\"mk.eu.org\",\"mt.eu.org\",\"my.eu.org\",\"net.eu.org\",\"ng.eu.org\",\"nl.eu.org\",\"no.eu.org\",\"nz.eu.org\",\"paris.eu.org\",\"pl.eu.org\",\"pt.eu.org\",\"q-a.eu.org\",\"ro.eu.org\",\"ru.eu.org\",\"se.eu.org\",\"si.eu.org\",\"sk.eu.org\",\"tr.eu.org\",\"uk.eu.org\",\"us.eu.org\",\"eu-1.evennode.com\",\"eu-2.evennode.com\",\"eu-3.evennode.com\",\"eu-4.evennode.com\",\"us-1.evennode.com\",\"us-2.evennode.com\",\"us-3.evennode.com\",\"us-4.evennode.com\",\"twmail.cc\",\"twmail.net\",\"twmail.org\",\"mymailer.com.tw\",\"url.tw\",\"apps.fbsbx.com\",\"ru.net\",\"adygeya.ru\",\"bashkiria.ru\",\"bir.ru\",\"cbg.ru\",\"com.ru\",\"dagestan.ru\",\"grozny.ru\",\"kalmykia.ru\",\"kustanai.ru\",\"marine.ru\",\"mordovia.ru\",\"msk.ru\",\"mytis.ru\",\"nalchik.ru\",\"nov.ru\",\"pyatigorsk.ru\",\"spb.ru\",\"vladikavkaz.ru\",\"vladimir.ru\",\"abkhazia.su\",\"adygeya.su\",\"aktyubinsk.su\",\"arkhangelsk.su\",\"armenia.su\",\"ashgabad.su\",\"azerbaijan.su\",\"balashov.su\",\"bashkiria.su\",\"bryansk.su\",\"bukhara.su\",\"chimkent.su\",\"dagestan.su\",\"east-kazakhstan.su\",\"exnet.su\",\"georgia.su\",\"grozny.su\",\"ivanovo.su\",\"jambyl.su\",\"kalmykia.su\",\"kaluga.su\",\"karacol.su\",\"karaganda.su\",\"karelia.su\",\"khakassia.su\",\"krasnodar.su\",\"kurgan.su\",\"kustanai.su\",\"lenug.su\",\"mangyshlak.su\",\"mordovia.su\",\"msk.su\",\"murmansk.su\",\"nalchik.su\",\"navoi.su\",\"north-kazakhstan.su\",\"nov.su\",\"obninsk.su\",\"penza.su\",\"pokrovsk.su\",\"sochi.su\",\"spb.su\",\"tashkent.su\",\"termez.su\",\"togliatti.su\",\"troitsk.su\",\"tselinograd.su\",\"tula.su\",\"tuva.su\",\"vladikavkaz.su\",\"vladimir.su\",\"vologda.su\",\"channelsdvr.net\",\"fastly-terrarium.com\",\"fastlylb.net\",\"map.fastlylb.net\",\"freetls.fastly.net\",\"map.fastly.net\",\"a.prod.fastly.net\",\"global.prod.fastly.net\",\"a.ssl.fastly.net\",\"b.ssl.fastly.net\",\"global.ssl.fastly.net\",\"fastpanel.direct\",\"fastvps-server.com\",\"fhapp.xyz\",\"fedorainfracloud.org\",\"fedorapeople.org\",\"cloud.fedoraproject.org\",\"app.os.fedoraproject.org\",\"app.os.stg.fedoraproject.org\",\"mydobiss.com\",\"filegear.me\",\"filegear-au.me\",\"filegear-de.me\",\"filegear-gb.me\",\"filegear-ie.me\",\"filegear-jp.me\",\"filegear-sg.me\",\"firebaseapp.com\",\"flynnhub.com\",\"flynnhosting.net\",\"freebox-os.com\",\"freeboxos.com\",\"fbx-os.fr\",\"fbxos.fr\",\"freebox-os.fr\",\"freeboxos.fr\",\"freedesktop.org\",\"*.futurecms.at\",\"*.ex.futurecms.at\",\"*.in.futurecms.at\",\"futurehosting.at\",\"futuremailing.at\",\"*.ex.ortsinfo.at\",\"*.kunden.ortsinfo.at\",\"*.statics.cloud\",\"service.gov.uk\",\"gehirn.ne.jp\",\"usercontent.jp\",\"lab.ms\",\"github.io\",\"githubusercontent.com\",\"gitlab.io\",\"glitch.me\",\"cloudapps.digital\",\"london.cloudapps.digital\",\"homeoffice.gov.uk\",\"ro.im\",\"shop.ro\",\"goip.de\",\"run.app\",\"a.run.app\",\"web.app\",\"*.0emm.com\",\"appspot.com\",\"blogspot.ae\",\"blogspot.al\",\"blogspot.am\",\"blogspot.ba\",\"blogspot.be\",\"blogspot.bg\",\"blogspot.bj\",\"blogspot.ca\",\"blogspot.cf\",\"blogspot.ch\",\"blogspot.cl\",\"blogspot.co.at\",\"blogspot.co.id\",\"blogspot.co.il\",\"blogspot.co.ke\",\"blogspot.co.nz\",\"blogspot.co.uk\",\"blogspot.co.za\",\"blogspot.com\",\"blogspot.com.ar\",\"blogspot.com.au\",\"blogspot.com.br\",\"blogspot.com.by\",\"blogspot.com.co\",\"blogspot.com.cy\",\"blogspot.com.ee\",\"blogspot.com.eg\",\"blogspot.com.es\",\"blogspot.com.mt\",\"blogspot.com.ng\",\"blogspot.com.tr\",\"blogspot.com.uy\",\"blogspot.cv\",\"blogspot.cz\",\"blogspot.de\",\"blogspot.dk\",\"blogspot.fi\",\"blogspot.fr\",\"blogspot.gr\",\"blogspot.hk\",\"blogspot.hr\",\"blogspot.hu\",\"blogspot.ie\",\"blogspot.in\",\"blogspot.is\",\"blogspot.it\",\"blogspot.jp\",\"blogspot.kr\",\"blogspot.li\",\"blogspot.lt\",\"blogspot.lu\",\"blogspot.md\",\"blogspot.mk\",\"blogspot.mr\",\"blogspot.mx\",\"blogspot.my\",\"blogspot.nl\",\"blogspot.no\",\"blogspot.pe\",\"blogspot.pt\",\"blogspot.qa\",\"blogspot.re\",\"blogspot.ro\",\"blogspot.rs\",\"blogspot.ru\",\"blogspot.se\",\"blogspot.sg\",\"blogspot.si\",\"blogspot.sk\",\"blogspot.sn\",\"blogspot.td\",\"blogspot.tw\",\"blogspot.ug\",\"blogspot.vn\",\"cloudfunctions.net\",\"cloud.goog\",\"codespot.com\",\"googleapis.com\",\"googlecode.com\",\"pagespeedmobilizer.com\",\"publishproxy.com\",\"withgoogle.com\",\"withyoutube.com\",\"fin.ci\",\"free.hr\",\"caa.li\",\"ua.rs\",\"conf.se\",\"hashbang.sh\",\"hasura.app\",\"hasura-app.io\",\"hepforge.org\",\"herokuapp.com\",\"herokussl.com\",\"myravendb.com\",\"ravendb.community\",\"ravendb.me\",\"development.run\",\"ravendb.run\",\"bpl.biz\",\"orx.biz\",\"ng.city\",\"ng.ink\",\"biz.gl\",\"col.ng\",\"gen.ng\",\"ltd.ng\",\"sch.so\",\"häkkinen.fi\",\"*.moonscale.io\",\"moonscale.net\",\"iki.fi\",\"dyn-berlin.de\",\"in-berlin.de\",\"in-brb.de\",\"in-butter.de\",\"in-dsl.de\",\"in-dsl.net\",\"in-dsl.org\",\"in-vpn.de\",\"in-vpn.net\",\"in-vpn.org\",\"biz.at\",\"info.at\",\"info.cx\",\"ac.leg.br\",\"al.leg.br\",\"am.leg.br\",\"ap.leg.br\",\"ba.leg.br\",\"ce.leg.br\",\"df.leg.br\",\"es.leg.br\",\"go.leg.br\",\"ma.leg.br\",\"mg.leg.br\",\"ms.leg.br\",\"mt.leg.br\",\"pa.leg.br\",\"pb.leg.br\",\"pe.leg.br\",\"pi.leg.br\",\"pr.leg.br\",\"rj.leg.br\",\"rn.leg.br\",\"ro.leg.br\",\"rr.leg.br\",\"rs.leg.br\",\"sc.leg.br\",\"se.leg.br\",\"sp.leg.br\",\"to.leg.br\",\"pixolino.com\",\"ipifony.net\",\"mein-iserv.de\",\"test-iserv.de\",\"iobb.net\",\"myjino.ru\",\"*.hosting.myjino.ru\",\"*.landing.myjino.ru\",\"*.spectrum.myjino.ru\",\"*.vps.myjino.ru\",\"*.triton.zone\",\"*.cns.joyent.com\",\"js.org\",\"kaas.gg\",\"khplay.nl\",\"keymachine.de\",\"kinghost.net\",\"uni5.net\",\"knightpoint.systems\",\"co.krd\",\"edu.krd\",\"git-repos.de\",\"lcube-server.de\",\"svn-repos.de\",\"leadpages.co\",\"lpages.co\",\"lpusercontent.com\",\"co.business\",\"co.education\",\"co.events\",\"co.financial\",\"co.network\",\"co.place\",\"co.technology\",\"app.lmpm.com\",\"linkitools.space\",\"linkyard.cloud\",\"linkyard-cloud.ch\",\"members.linode.com\",\"nodebalancer.linode.com\",\"we.bs\",\"loginline.app\",\"loginline.dev\",\"loginline.io\",\"loginline.services\",\"loginline.site\",\"krasnik.pl\",\"leczna.pl\",\"lubartow.pl\",\"lublin.pl\",\"poniatowa.pl\",\"swidnik.pl\",\"uklugs.org\",\"glug.org.uk\",\"lug.org.uk\",\"lugs.org.uk\",\"barsy.bg\",\"barsy.co.uk\",\"barsyonline.co.uk\",\"barsycenter.com\",\"barsyonline.com\",\"barsy.club\",\"barsy.de\",\"barsy.eu\",\"barsy.in\",\"barsy.info\",\"barsy.io\",\"barsy.me\",\"barsy.menu\",\"barsy.mobi\",\"barsy.net\",\"barsy.online\",\"barsy.org\",\"barsy.pro\",\"barsy.pub\",\"barsy.shop\",\"barsy.site\",\"barsy.support\",\"barsy.uk\",\"*.magentosite.cloud\",\"mayfirst.info\",\"mayfirst.org\",\"hb.cldmail.ru\",\"miniserver.com\",\"memset.net\",\"cloud.metacentrum.cz\",\"custom.metacentrum.cz\",\"flt.cloud.muni.cz\",\"usr.cloud.muni.cz\",\"meteorapp.com\",\"eu.meteorapp.com\",\"co.pl\",\"azurecontainer.io\",\"azurewebsites.net\",\"azure-mobile.net\",\"cloudapp.net\",\"mozilla-iot.org\",\"bmoattachments.org\",\"net.ru\",\"org.ru\",\"pp.ru\",\"ui.nabu.casa\",\"pony.club\",\"of.fashion\",\"on.fashion\",\"of.football\",\"in.london\",\"of.london\",\"for.men\",\"and.mom\",\"for.mom\",\"for.one\",\"for.sale\",\"of.work\",\"to.work\",\"nctu.me\",\"bitballoon.com\",\"netlify.com\",\"4u.com\",\"ngrok.io\",\"nh-serv.co.uk\",\"nfshost.com\",\"dnsking.ch\",\"mypi.co\",\"n4t.co\",\"001www.com\",\"ddnslive.com\",\"myiphost.com\",\"forumz.info\",\"16-b.it\",\"32-b.it\",\"64-b.it\",\"soundcast.me\",\"tcp4.me\",\"dnsup.net\",\"hicam.net\",\"now-dns.net\",\"ownip.net\",\"vpndns.net\",\"dynserv.org\",\"now-dns.org\",\"x443.pw\",\"now-dns.top\",\"ntdll.top\",\"freeddns.us\",\"crafting.xyz\",\"zapto.xyz\",\"nsupdate.info\",\"nerdpol.ovh\",\"blogsyte.com\",\"brasilia.me\",\"cable-modem.org\",\"ciscofreak.com\",\"collegefan.org\",\"couchpotatofries.org\",\"damnserver.com\",\"ddns.me\",\"ditchyourip.com\",\"dnsfor.me\",\"dnsiskinky.com\",\"dvrcam.info\",\"dynns.com\",\"eating-organic.net\",\"fantasyleague.cc\",\"geekgalaxy.com\",\"golffan.us\",\"health-carereform.com\",\"homesecuritymac.com\",\"homesecuritypc.com\",\"hopto.me\",\"ilovecollege.info\",\"loginto.me\",\"mlbfan.org\",\"mmafan.biz\",\"myactivedirectory.com\",\"mydissent.net\",\"myeffect.net\",\"mymediapc.net\",\"mypsx.net\",\"mysecuritycamera.com\",\"mysecuritycamera.net\",\"mysecuritycamera.org\",\"net-freaks.com\",\"nflfan.org\",\"nhlfan.net\",\"no-ip.ca\",\"no-ip.co.uk\",\"no-ip.net\",\"noip.us\",\"onthewifi.com\",\"pgafan.net\",\"point2this.com\",\"pointto.us\",\"privatizehealthinsurance.net\",\"quicksytes.com\",\"read-books.org\",\"securitytactics.com\",\"serveexchange.com\",\"servehumour.com\",\"servep2p.com\",\"servesarcasm.com\",\"stufftoread.com\",\"ufcfan.org\",\"unusualperson.com\",\"workisboring.com\",\"3utilities.com\",\"bounceme.net\",\"ddns.net\",\"ddnsking.com\",\"gotdns.ch\",\"hopto.org\",\"myftp.biz\",\"myftp.org\",\"myvnc.com\",\"no-ip.biz\",\"no-ip.info\",\"no-ip.org\",\"noip.me\",\"redirectme.net\",\"servebeer.com\",\"serveblog.net\",\"servecounterstrike.com\",\"serveftp.com\",\"servegame.com\",\"servehalflife.com\",\"servehttp.com\",\"serveirc.com\",\"serveminecraft.net\",\"servemp3.com\",\"servepics.com\",\"servequake.com\",\"sytes.net\",\"webhop.me\",\"zapto.org\",\"stage.nodeart.io\",\"nodum.co\",\"nodum.io\",\"pcloud.host\",\"nyc.mn\",\"nom.ae\",\"nom.af\",\"nom.ai\",\"nom.al\",\"nym.by\",\"nym.bz\",\"nom.cl\",\"nom.gd\",\"nom.ge\",\"nom.gl\",\"nym.gr\",\"nom.gt\",\"nym.gy\",\"nom.hn\",\"nym.ie\",\"nom.im\",\"nom.ke\",\"nym.kz\",\"nym.la\",\"nym.lc\",\"nom.li\",\"nym.li\",\"nym.lt\",\"nym.lu\",\"nym.me\",\"nom.mk\",\"nym.mn\",\"nym.mx\",\"nom.nu\",\"nym.nz\",\"nym.pe\",\"nym.pt\",\"nom.pw\",\"nom.qa\",\"nym.ro\",\"nom.rs\",\"nom.si\",\"nym.sk\",\"nom.st\",\"nym.su\",\"nym.sx\",\"nom.tj\",\"nym.tw\",\"nom.ug\",\"nom.uy\",\"nom.vc\",\"nom.vg\",\"cya.gg\",\"cloudycluster.net\",\"nid.io\",\"opencraft.hosting\",\"operaunite.com\",\"outsystemscloud.com\",\"ownprovider.com\",\"own.pm\",\"ox.rs\",\"oy.lc\",\"pgfog.com\",\"pagefrontapp.com\",\"art.pl\",\"gliwice.pl\",\"krakow.pl\",\"poznan.pl\",\"wroc.pl\",\"zakopane.pl\",\"pantheonsite.io\",\"gotpantheon.com\",\"mypep.link\",\"on-web.fr\",\"*.platform.sh\",\"*.platformsh.site\",\"dyn53.io\",\"co.bn\",\"xen.prgmr.com\",\"priv.at\",\"prvcy.page\",\"*.dweb.link\",\"protonet.io\",\"chirurgiens-dentistes-en-france.fr\",\"byen.site\",\"instantcloud.cn\",\"ras.ru\",\"qa2.com\",\"dev-myqnapcloud.com\",\"alpha-myqnapcloud.com\",\"myqnapcloud.com\",\"*.quipelements.com\",\"vapor.cloud\",\"vaporcloud.io\",\"rackmaze.com\",\"rackmaze.net\",\"*.on-rancher.cloud\",\"*.on-rio.io\",\"readthedocs.io\",\"rhcloud.com\",\"app.render.com\",\"onrender.com\",\"repl.co\",\"repl.run\",\"resindevice.io\",\"devices.resinstaging.io\",\"hzc.io\",\"wellbeingzone.eu\",\"ptplus.fit\",\"wellbeingzone.co.uk\",\"git-pages.rit.edu\",\"sandcats.io\",\"logoip.de\",\"logoip.com\",\"schokokeks.net\",\"scrysec.com\",\"firewall-gateway.com\",\"firewall-gateway.de\",\"my-gateway.de\",\"my-router.de\",\"spdns.de\",\"spdns.eu\",\"firewall-gateway.net\",\"my-firewall.org\",\"myfirewall.org\",\"spdns.org\",\"*.s5y.io\",\"*.sensiosite.cloud\",\"biz.ua\",\"co.ua\",\"pp.ua\",\"shiftedit.io\",\"myshopblocks.com\",\"mo-siemens.io\",\"1kapp.com\",\"appchizi.com\",\"applinzi.com\",\"sinaapp.com\",\"vipsinaapp.com\",\"siteleaf.net\",\"bounty-full.com\",\"alpha.bounty-full.com\",\"beta.bounty-full.com\",\"stackhero-network.com\",\"static.land\",\"dev.static.land\",\"sites.static.land\",\"apps.lair.io\",\"*.stolos.io\",\"spacekit.io\",\"customer.speedpartner.de\",\"api.stdlib.com\",\"storj.farm\",\"utwente.io\",\"soc.srcf.net\",\"user.srcf.net\",\"temp-dns.com\",\"applicationcloud.io\",\"scapp.io\",\"syncloud.it\",\"diskstation.me\",\"dscloud.biz\",\"dscloud.me\",\"dscloud.mobi\",\"dsmynas.com\",\"dsmynas.net\",\"dsmynas.org\",\"familyds.com\",\"familyds.net\",\"familyds.org\",\"i234.me\",\"myds.me\",\"synology.me\",\"vpnplus.to\",\"taifun-dns.de\",\"gda.pl\",\"gdansk.pl\",\"gdynia.pl\",\"med.pl\",\"sopot.pl\",\"edugit.org\",\"telebit.app\",\"telebit.io\",\"*.telebit.xyz\",\"gwiddle.co.uk\",\"thingdustdata.com\",\"cust.dev.thingdust.io\",\"cust.disrec.thingdust.io\",\"cust.prod.thingdust.io\",\"cust.testing.thingdust.io\",\"arvo.network\",\"azimuth.network\",\"bloxcms.com\",\"townnews-staging.com\",\"12hp.at\",\"2ix.at\",\"4lima.at\",\"lima-city.at\",\"12hp.ch\",\"2ix.ch\",\"4lima.ch\",\"lima-city.ch\",\"trafficplex.cloud\",\"de.cool\",\"12hp.de\",\"2ix.de\",\"4lima.de\",\"lima-city.de\",\"1337.pictures\",\"clan.rip\",\"lima-city.rocks\",\"webspace.rocks\",\"lima.zone\",\"*.transurl.be\",\"*.transurl.eu\",\"*.transurl.nl\",\"tuxfamily.org\",\"dd-dns.de\",\"diskstation.eu\",\"diskstation.org\",\"dray-dns.de\",\"draydns.de\",\"dyn-vpn.de\",\"dynvpn.de\",\"mein-vigor.de\",\"my-vigor.de\",\"my-wan.de\",\"syno-ds.de\",\"synology-diskstation.de\",\"synology-ds.de\",\"uber.space\",\"*.uberspace.de\",\"hk.com\",\"hk.org\",\"ltd.hk\",\"inc.hk\",\"virtualuser.de\",\"virtual-user.de\",\"lib.de.us\",\"2038.io\",\"router.management\",\"v-info.info\",\"voorloper.cloud\",\"wafflecell.com\",\"wedeploy.io\",\"wedeploy.me\",\"wedeploy.sh\",\"remotewd.com\",\"wmflabs.org\",\"half.host\",\"xnbay.com\",\"u2.xnbay.com\",\"u2-local.xnbay.com\",\"cistron.nl\",\"demon.nl\",\"xs4all.space\",\"official.academy\",\"yolasite.com\",\"ybo.faith\",\"yombo.me\",\"homelink.one\",\"ybo.party\",\"ybo.review\",\"ybo.science\",\"ybo.trade\",\"nohost.me\",\"noho.st\",\"za.net\",\"za.org\",\"now.sh\",\"bss.design\",\"basicserver.io\",\"virtualserver.io\",\"site.builder.nu\",\"enterprisecloud.nu\",\"zone.id\"];\n\n//# sourceURL=webpack:///./node_modules/psl/data/rules.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/psl/index.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/psl/index.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */\n\n\n\nvar Punycode = __webpack_require__(/*! punycode */ \"./node_modules/punycode/punycode.js\");\n\n\nvar internals = {};\n\n\n//\n// Read rules from file.\n//\ninternals.rules = __webpack_require__(/*! ./data/rules.json */ \"./node_modules/psl/data/rules.json\").map(function (rule) {\n\n return {\n rule: rule,\n suffix: rule.replace(/^(\\*\\.|\\!)/, ''),\n punySuffix: -1,\n wildcard: rule.charAt(0) === '*',\n exception: rule.charAt(0) === '!'\n };\n});\n\n\n//\n// Check is given string ends with `suffix`.\n//\ninternals.endsWith = function (str, suffix) {\n\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n};\n\n\n//\n// Find rule for a given domain.\n//\ninternals.findRule = function (domain) {\n\n var punyDomain = Punycode.toASCII(domain);\n return internals.rules.reduce(function (memo, rule) {\n\n if (rule.punySuffix === -1){\n rule.punySuffix = Punycode.toASCII(rule.suffix);\n }\n if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) {\n return memo;\n }\n // This has been commented out as it never seems to run. This is because\n // sub tlds always appear after their parents and we never find a shorter\n // match.\n //if (memo) {\n // var memoSuffix = Punycode.toASCII(memo.suffix);\n // if (memoSuffix.length >= punySuffix.length) {\n // return memo;\n // }\n //}\n return rule;\n }, null);\n};\n\n\n//\n// Error codes and messages.\n//\nexports.errorCodes = {\n DOMAIN_TOO_SHORT: 'Domain name too short.',\n DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.',\n LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.',\n LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.',\n LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.',\n LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.',\n LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.'\n};\n\n\n//\n// Validate domain name and throw if not valid.\n//\n// From wikipedia:\n//\n// Hostnames are composed of series of labels concatenated with dots, as are all\n// domain names. Each label must be between 1 and 63 characters long, and the\n// entire hostname (including the delimiting dots) has a maximum of 255 chars.\n//\n// Allowed chars:\n//\n// * `a-z`\n// * `0-9`\n// * `-` but not as a starting or ending character\n// * `.` as a separator for the textual portions of a domain name\n//\n// * http://en.wikipedia.org/wiki/Domain_name\n// * http://en.wikipedia.org/wiki/Hostname\n//\ninternals.validate = function (input) {\n\n // Before we can validate we need to take care of IDNs with unicode chars.\n var ascii = Punycode.toASCII(input);\n\n if (ascii.length < 1) {\n return 'DOMAIN_TOO_SHORT';\n }\n if (ascii.length > 255) {\n return 'DOMAIN_TOO_LONG';\n }\n\n // Check each part's length and allowed chars.\n var labels = ascii.split('.');\n var label;\n\n for (var i = 0; i < labels.length; ++i) {\n label = labels[i];\n if (!label.length) {\n return 'LABEL_TOO_SHORT';\n }\n if (label.length > 63) {\n return 'LABEL_TOO_LONG';\n }\n if (label.charAt(0) === '-') {\n return 'LABEL_STARTS_WITH_DASH';\n }\n if (label.charAt(label.length - 1) === '-') {\n return 'LABEL_ENDS_WITH_DASH';\n }\n if (!/^[a-z0-9\\-]+$/.test(label)) {\n return 'LABEL_INVALID_CHARS';\n }\n }\n};\n\n\n//\n// Public API\n//\n\n\n//\n// Parse domain.\n//\nexports.parse = function (input) {\n\n if (typeof input !== 'string') {\n throw new TypeError('Domain name must be a string.');\n }\n\n // Force domain to lowercase.\n var domain = input.slice(0).toLowerCase();\n\n // Handle FQDN.\n // TODO: Simply remove trailing dot?\n if (domain.charAt(domain.length - 1) === '.') {\n domain = domain.slice(0, domain.length - 1);\n }\n\n // Validate and sanitise input.\n var error = internals.validate(domain);\n if (error) {\n return {\n input: input,\n error: {\n message: exports.errorCodes[error],\n code: error\n }\n };\n }\n\n var parsed = {\n input: input,\n tld: null,\n sld: null,\n domain: null,\n subdomain: null,\n listed: false\n };\n\n var domainParts = domain.split('.');\n\n // Non-Internet TLD\n if (domainParts[domainParts.length - 1] === 'local') {\n return parsed;\n }\n\n var handlePunycode = function () {\n\n if (!/xn--/.test(domain)) {\n return parsed;\n }\n if (parsed.domain) {\n parsed.domain = Punycode.toASCII(parsed.domain);\n }\n if (parsed.subdomain) {\n parsed.subdomain = Punycode.toASCII(parsed.subdomain);\n }\n return parsed;\n };\n\n var rule = internals.findRule(domain);\n\n // Unlisted tld.\n if (!rule) {\n if (domainParts.length < 2) {\n return parsed;\n }\n parsed.tld = domainParts.pop();\n parsed.sld = domainParts.pop();\n parsed.domain = [parsed.sld, parsed.tld].join('.');\n if (domainParts.length) {\n parsed.subdomain = domainParts.pop();\n }\n return handlePunycode();\n }\n\n // At this point we know the public suffix is listed.\n parsed.listed = true;\n\n var tldParts = rule.suffix.split('.');\n var privateParts = domainParts.slice(0, domainParts.length - tldParts.length);\n\n if (rule.exception) {\n privateParts.push(tldParts.shift());\n }\n\n parsed.tld = tldParts.join('.');\n\n if (!privateParts.length) {\n return handlePunycode();\n }\n\n if (rule.wildcard) {\n tldParts.unshift(privateParts.pop());\n parsed.tld = tldParts.join('.');\n }\n\n if (!privateParts.length) {\n return handlePunycode();\n }\n\n parsed.sld = privateParts.pop();\n parsed.domain = [parsed.sld, parsed.tld].join('.');\n\n if (privateParts.length) {\n parsed.subdomain = privateParts.join('.');\n }\n\n return handlePunycode();\n};\n\n\n//\n// Get domain.\n//\nexports.get = function (domain) {\n\n if (!domain) {\n return null;\n }\n return exports.parse(domain).domain || null;\n};\n\n\n//\n// Check whether domain belongs to a known public suffix.\n//\nexports.isValid = function (domain) {\n\n var parsed = exports.parse(domain);\n return Boolean(parsed.domain && parsed.listed);\n};\n\n\n//# sourceURL=webpack:///./node_modules/psl/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-defer/duplex.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/pull-defer/duplex.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("\nvar Source = __webpack_require__(/*! ./source */ \"./node_modules/pull-defer/source.js\")\nvar Sink = __webpack_require__(/*! ./sink */ \"./node_modules/pull-defer/sink.js\")\n\nmodule.exports = function () {\n\n var source = Source()\n var sink = Sink()\n\n return {\n source: source,\n sink: sink,\n resolve: function (duplex) {\n source.resolve(duplex.source)\n sink.resolve(duplex.sink)\n\n }\n }\n\n\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-defer/duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-defer/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/pull-defer/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("\nexports.source = __webpack_require__(/*! ./source */ \"./node_modules/pull-defer/source.js\")\nexports.through = __webpack_require__(/*! ./through */ \"./node_modules/pull-defer/through.js\")\nexports.sink = __webpack_require__(/*! ./sink */ \"./node_modules/pull-defer/sink.js\")\nexports.duplex = __webpack_require__(/*! ./duplex */ \"./node_modules/pull-defer/duplex.js\")\n\n\n//# sourceURL=webpack:///./node_modules/pull-defer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-defer/sink.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/pull-defer/sink.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function (stream) {\n var read, started = false\n\n function consume (_read) {\n if(!_read) throw new Error('must be passed a readable')\n read = _read\n if(started) stream(read)\n }\n\n consume.resolve =\n consume.ready =\n consume.start = function (_stream) {\n started = true; stream = _stream || stream\n if(read) stream(read)\n return consume\n }\n\n return consume\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-defer/sink.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-defer/source.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/pull-defer/source.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\nmodule.exports = function () {\n var _read, _cb, abortCb, _end\n\n var read = function (end, cb) {\n if(!_read) {\n if(end) {\n _end = end\n abortCb = cb\n }\n else\n _cb = cb\n }\n else _read(end, cb)\n }\n read.resolve = function (read) {\n if(_read) throw new Error('already resolved')\n _read = read\n if(!_read) throw new Error('no read cannot resolve!' + _read)\n if(_cb) read(null, _cb)\n if(abortCb) read(_end, abortCb)\n }\n read.abort = function(err) {\n read.resolve(function (_, cb) {\n cb(err || true)\n })\n }\n return read\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-defer/source.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-defer/through.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/pull-defer/through.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\nmodule.exports = function () {\n var read, reader, cb, abort, stream\n\n function delayed (_read) {\n //if we already have the stream, go!\n if(stream) return stream(_read)\n\n read = _read\n return function (_abort, _cb) {\n if(reader) reader(_abort, _cb)\n else abort = _abort, cb = _cb\n\n }\n }\n\n delayed.resolve = function (_stream) {\n if(stream) throw new Error('already resolved')\n stream = _stream\n if(!stream) throw new Error('resolve *must* be passed a transform stream')\n if(read) {\n reader = stream(read)\n if(cb) reader(abort, cb)\n }\n }\n\n return delayed\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-defer/through.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-pushable/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/pull-pushable/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = pullPushable\n\nfunction pullPushable (separated, onClose) {\n if (typeof separated === 'function') {\n onClose = separated\n separated = false\n }\n\n // create a buffer for data\n // that have been pushed\n // but not yet pulled.\n var buffer = []\n\n // a pushable is a source stream\n // (abort, cb) => cb(end, data)\n //\n // when pushable is pulled,\n // keep references to abort and cb\n // so we can call back after\n // .end(end) or .push(data)\n var abort, cb\n function read (_abort, _cb) {\n if (_abort) {\n abort = _abort\n // if there is already a cb waiting, abort it.\n if (cb) callback(abort)\n }\n cb = _cb\n drain()\n }\n\n var ended\n function end (end) {\n ended = ended || end || true\n // attempt to drain\n drain()\n }\n\n function push (data) {\n if (ended) return\n // if sink already waiting,\n // we can call back directly.\n if (cb) {\n callback(abort, data)\n return\n }\n // otherwise buffer data\n buffer.push(data)\n }\n\n // Return functions separated from source { push, end, source }\n if (separated) {\n return { push: push, end: end, source: read, buffer: buffer }\n }\n\n // Return normal\n read.push = push\n read.end = end\n read.buffer = buffer\n return read\n\n // `drain` calls back to (if any) waiting\n // sink with abort, end, or next data.\n function drain () {\n if (!cb) return\n\n if (abort) callback(abort)\n else if (!buffer.length && ended) callback(ended)\n else if (buffer.length) callback(null, buffer.shift())\n }\n\n // `callback` calls back to waiting sink,\n // and removes references to sink cb.\n function callback (err, val) {\n var _cb = cb\n // if error and pushable passed onClose, call it\n // the first time this stream ends or errors.\n if (err && onClose) {\n var c = onClose\n onClose = null\n c(err === true ? null : err)\n }\n cb = null\n _cb(err, val)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-pushable/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/pull-stream/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar sources = __webpack_require__(/*! ./sources */ \"./node_modules/pull-stream/sources/index.js\")\nvar sinks = __webpack_require__(/*! ./sinks */ \"./node_modules/pull-stream/sinks/index.js\")\nvar throughs = __webpack_require__(/*! ./throughs */ \"./node_modules/pull-stream/throughs/index.js\")\n\nexports = module.exports = __webpack_require__(/*! ./pull */ \"./node_modules/pull-stream/pull.js\")\n\nexports.pull = exports\n\nfor(var k in sources)\n exports[k] = sources[k]\n\nfor(var k in throughs)\n exports[k] = throughs[k]\n\nfor(var k in sinks)\n exports[k] = sinks[k]\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/pull.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/pull-stream/pull.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = function pull (a) {\n var length = arguments.length\n if (typeof a === 'function' && a.length === 1) {\n var args = new Array(length)\n for(var i = 0; i < length; i++)\n args[i] = arguments[i]\n return function (read) {\n if (args == null) {\n throw new TypeError(\"partial sink should only be called once!\")\n }\n\n // Grab the reference after the check, because it's always an array now\n // (engines like that kind of consistency).\n var ref = args\n args = null\n\n // Prioritize common case of small number of pulls.\n switch (length) {\n case 1: return pull(read, ref[0])\n case 2: return pull(read, ref[0], ref[1])\n case 3: return pull(read, ref[0], ref[1], ref[2])\n case 4: return pull(read, ref[0], ref[1], ref[2], ref[3])\n default:\n ref.unshift(read)\n return pull.apply(null, ref)\n }\n }\n }\n\n var read = a\n\n if (read && typeof read.source === 'function') {\n read = read.source\n }\n\n for (var i = 1; i < length; i++) {\n var s = arguments[i]\n if (typeof s === 'function') {\n read = s(read)\n } else if (s && typeof s === 'object') {\n s.sink(read)\n read = s.source\n }\n }\n\n return read\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/pull.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/collect.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/collect.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar reduce = __webpack_require__(/*! ./reduce */ \"./node_modules/pull-stream/sinks/reduce.js\")\n\nmodule.exports = function collect (cb) {\n return reduce(function (arr, item) {\n arr.push(item)\n return arr\n }, [], cb)\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/collect.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/concat.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/concat.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar reduce = __webpack_require__(/*! ./reduce */ \"./node_modules/pull-stream/sinks/reduce.js\")\n\nmodule.exports = function concat (cb) {\n return reduce(function (a, b) {\n return a + b\n }, '', cb)\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/concat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/drain.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/drain.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = function drain (op, done) {\n var read, abort\n\n function sink (_read) {\n read = _read\n if(abort) return sink.abort()\n //this function is much simpler to write if you\n //just use recursion, but by using a while loop\n //we do not blow the stack if the stream happens to be sync.\n ;(function next() {\n var loop = true, cbed = false\n while(loop) {\n cbed = false\n read(null, function (end, data) {\n cbed = true\n if(end = end || abort) {\n loop = false\n if(done) done(end === true ? null : end)\n else if(end && end !== true)\n throw end\n }\n else if(op && false === op(data) || abort) {\n loop = false\n read(abort || true, done || function () {})\n }\n else if(!loop){\n next()\n }\n })\n if(!cbed) {\n loop = false\n return\n }\n }\n })()\n }\n\n sink.abort = function (err, cb) {\n if('function' == typeof err)\n cb = err, err = true\n abort = err || true\n if(read) return read(abort, cb || function () {})\n }\n\n return sink\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/drain.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/find.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/find.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(/*! ../util/prop */ \"./node_modules/pull-stream/util/prop.js\")\nvar drain = __webpack_require__(/*! ./drain */ \"./node_modules/pull-stream/sinks/drain.js\")\n\nmodule.exports = function find (test, cb) {\n var ended = false\n if(!cb)\n cb = test, test = id\n else\n test = prop(test) || id\n\n return drain(function (data) {\n if(test(data)) {\n ended = true\n cb(null, data)\n return false\n }\n }, function (err) {\n if(ended) return //already called back\n cb(err === true ? null : err, null)\n })\n}\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/find.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/index.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/index.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = {\n drain: __webpack_require__(/*! ./drain */ \"./node_modules/pull-stream/sinks/drain.js\"),\n onEnd: __webpack_require__(/*! ./on-end */ \"./node_modules/pull-stream/sinks/on-end.js\"),\n log: __webpack_require__(/*! ./log */ \"./node_modules/pull-stream/sinks/log.js\"),\n find: __webpack_require__(/*! ./find */ \"./node_modules/pull-stream/sinks/find.js\"),\n reduce: __webpack_require__(/*! ./reduce */ \"./node_modules/pull-stream/sinks/reduce.js\"),\n collect: __webpack_require__(/*! ./collect */ \"./node_modules/pull-stream/sinks/collect.js\"),\n concat: __webpack_require__(/*! ./concat */ \"./node_modules/pull-stream/sinks/concat.js\")\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/log.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/log.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar drain = __webpack_require__(/*! ./drain */ \"./node_modules/pull-stream/sinks/drain.js\")\n\nmodule.exports = function log (done) {\n return drain(function (data) {\n console.log(data)\n }, done)\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/log.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/on-end.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/on-end.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar drain = __webpack_require__(/*! ./drain */ \"./node_modules/pull-stream/sinks/drain.js\")\n\nmodule.exports = function onEnd (done) {\n return drain(null, done)\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/on-end.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sinks/reduce.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/pull-stream/sinks/reduce.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar drain = __webpack_require__(/*! ./drain */ \"./node_modules/pull-stream/sinks/drain.js\")\n\nmodule.exports = function reduce (reducer, acc, cb ) {\n if(!cb) cb = acc, acc = null\n var sink = drain(function (data) {\n acc = reducer(acc, data)\n }, function (err) {\n cb(err, acc)\n })\n if (arguments.length === 2)\n return function (source) {\n source(null, function (end, data) {\n //if ended immediately, and no initial...\n if(end) return cb(end === true ? null : end)\n acc = data; sink(source)\n })\n }\n else\n return sink\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sinks/reduce.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/count.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/count.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = function count (max) {\n var i = 0; max = max || Infinity\n return function (end, cb) {\n if(end) return cb && cb(end)\n if(i > max)\n return cb(true)\n cb(null, i++)\n }\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/count.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/empty.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/empty.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n//a stream that ends immediately.\nmodule.exports = function empty () {\n return function (abort, cb) {\n cb(true)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/empty.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/error.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/error.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n//a stream that errors immediately.\nmodule.exports = function error (err) {\n return function (abort, cb) {\n cb(err)\n }\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/error.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = {\n keys: __webpack_require__(/*! ./keys */ \"./node_modules/pull-stream/sources/keys.js\"),\n once: __webpack_require__(/*! ./once */ \"./node_modules/pull-stream/sources/once.js\"),\n values: __webpack_require__(/*! ./values */ \"./node_modules/pull-stream/sources/values.js\"),\n count: __webpack_require__(/*! ./count */ \"./node_modules/pull-stream/sources/count.js\"),\n infinite: __webpack_require__(/*! ./infinite */ \"./node_modules/pull-stream/sources/infinite.js\"),\n empty: __webpack_require__(/*! ./empty */ \"./node_modules/pull-stream/sources/empty.js\"),\n error: __webpack_require__(/*! ./error */ \"./node_modules/pull-stream/sources/error.js\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/infinite.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/infinite.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function infinite (generate) {\n generate = generate || Math.random\n return function (end, cb) {\n if(end) return cb && cb(end)\n return cb(null, generate())\n }\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/infinite.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/keys.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/keys.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar values = __webpack_require__(/*! ./values */ \"./node_modules/pull-stream/sources/values.js\")\nmodule.exports = function (object) {\n return values(Object.keys(object))\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/keys.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/once.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/once.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar abortCb = __webpack_require__(/*! ../util/abort-cb */ \"./node_modules/pull-stream/util/abort-cb.js\")\n\nmodule.exports = function once (value, onAbort) {\n return function (abort, cb) {\n if(abort)\n return abortCb(cb, abort, onAbort)\n if(value != null) {\n var _value = value; value = null\n cb(null, _value)\n } else\n cb(true)\n }\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/once.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/sources/values.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/pull-stream/sources/values.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar abortCb = __webpack_require__(/*! ../util/abort-cb */ \"./node_modules/pull-stream/util/abort-cb.js\")\n\nmodule.exports = function values (array, onAbort) {\n if(!array)\n return function (abort, cb) {\n if(abort) return abortCb(cb, abort, onAbort)\n return cb(true)\n }\n if(!Array.isArray(array))\n array = Object.keys(array).map(function (k) {\n return array[k]\n })\n var i = 0\n return function (abort, cb) {\n if(abort)\n return abortCb(cb, abort, onAbort)\n if(i >= array.length)\n cb(true)\n else\n cb(null, array[i++])\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/sources/values.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/async-map.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/async-map.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(/*! ../util/prop */ \"./node_modules/pull-stream/util/prop.js\")\n\nmodule.exports = function asyncMap (map) {\n if(!map) return id\n map = prop(map)\n var busy = false, abortCb, aborted\n return function (read) {\n return function next (abort, cb) {\n if(aborted) return cb(aborted)\n if(abort) {\n aborted = abort\n if(!busy) read(abort, function (err) {\n //incase the source has already ended normally,\n //we should pass our own error.\n cb(abort)\n })\n else read(abort, function (err) {\n //if we are still busy, wait for the mapper to complete.\n if(busy) abortCb = cb\n else cb(abort)\n })\n }\n else\n read(null, function (end, data) {\n if(end) cb(end)\n else if(aborted) cb(aborted)\n else {\n busy = true\n map(data, function (err, data) {\n busy = false\n if(aborted) {\n cb(aborted)\n abortCb && abortCb(aborted)\n }\n else if(err) next (err, cb)\n else cb(null, data)\n })\n }\n })\n }\n }\n}\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/async-map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/filter-not.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/filter-not.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar tester = __webpack_require__(/*! ../util/tester */ \"./node_modules/pull-stream/util/tester.js\")\nvar filter = __webpack_require__(/*! ./filter */ \"./node_modules/pull-stream/throughs/filter.js\")\n\nmodule.exports = function filterNot (test) {\n test = tester(test)\n return filter(function (data) { return !test(data) })\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/filter-not.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/filter.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/filter.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar tester = __webpack_require__(/*! ../util/tester */ \"./node_modules/pull-stream/util/tester.js\")\n\nmodule.exports = function filter (test) {\n //regexp\n test = tester(test)\n return function (read) {\n return function next (end, cb) {\n var sync, loop = true\n while(loop) {\n loop = false\n sync = true\n read(end, function (end, data) {\n if(!end && !test(data))\n return sync ? loop = true : next(end, cb)\n cb(end, data)\n })\n sync = false\n }\n }\n }\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/filter.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/flatten.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/flatten.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar values = __webpack_require__(/*! ../sources/values */ \"./node_modules/pull-stream/sources/values.js\")\nvar once = __webpack_require__(/*! ../sources/once */ \"./node_modules/pull-stream/sources/once.js\")\n\n//convert a stream of arrays or streams into just a stream.\nmodule.exports = function flatten () {\n return function (read) {\n var _read\n return function (abort, cb) {\n if (abort) { //abort the current stream, and then stream of streams.\n _read ? _read(abort, function(err) {\n read(err || abort, cb)\n }) : read(abort, cb)\n }\n else if(_read) nextChunk()\n else nextStream()\n\n function nextChunk () {\n _read(null, function (err, data) {\n if (err === true) nextStream()\n else if (err) {\n read(true, function(abortErr) {\n // TODO: what do we do with the abortErr?\n cb(err)\n })\n }\n else cb(null, data)\n })\n }\n function nextStream () {\n _read = null\n read(null, function (end, stream) {\n if(end)\n return cb(end)\n if(Array.isArray(stream) || stream && 'object' === typeof stream)\n stream = values(stream)\n else if('function' != typeof stream)\n stream = once(stream)\n _read = stream\n nextChunk()\n })\n }\n }\n }\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/flatten.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = {\n map: __webpack_require__(/*! ./map */ \"./node_modules/pull-stream/throughs/map.js\"),\n asyncMap: __webpack_require__(/*! ./async-map */ \"./node_modules/pull-stream/throughs/async-map.js\"),\n filter: __webpack_require__(/*! ./filter */ \"./node_modules/pull-stream/throughs/filter.js\"),\n filterNot: __webpack_require__(/*! ./filter-not */ \"./node_modules/pull-stream/throughs/filter-not.js\"),\n through: __webpack_require__(/*! ./through */ \"./node_modules/pull-stream/throughs/through.js\"),\n take: __webpack_require__(/*! ./take */ \"./node_modules/pull-stream/throughs/take.js\"),\n unique: __webpack_require__(/*! ./unique */ \"./node_modules/pull-stream/throughs/unique.js\"),\n nonUnique: __webpack_require__(/*! ./non-unique */ \"./node_modules/pull-stream/throughs/non-unique.js\"),\n flatten: __webpack_require__(/*! ./flatten */ \"./node_modules/pull-stream/throughs/flatten.js\")\n}\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/map.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/map.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(/*! ../util/prop */ \"./node_modules/pull-stream/util/prop.js\")\n\nmodule.exports = function map (mapper) {\n if(!mapper) return id\n mapper = prop(mapper)\n return function (read) {\n return function (abort, cb) {\n read(abort, function (end, data) {\n try {\n data = !end ? mapper(data) : null\n } catch (err) {\n return read(err, function () {\n return cb(err)\n })\n }\n cb(end, data)\n })\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/non-unique.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/non-unique.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar unique = __webpack_require__(/*! ./unique */ \"./node_modules/pull-stream/throughs/unique.js\")\n\n//passes an item through when you see it for the second time.\nmodule.exports = function nonUnique (field) {\n return unique(field, true)\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/non-unique.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/take.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/take.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n//read a number of items and then stop.\nmodule.exports = function take (test, opts) {\n opts = opts || {}\n var last = opts.last || false // whether the first item for which !test(item) should still pass\n var ended = false\n if('number' === typeof test) {\n last = true\n var n = test; test = function () {\n return --n\n }\n }\n\n return function (read) {\n\n function terminate (cb) {\n read(true, function (err) {\n last = false; cb(err || true)\n })\n }\n\n return function (end, cb) {\n if(ended && !end) last ? terminate(cb) : cb(ended)\n else if(ended = end) read(ended, cb)\n else\n read(null, function (end, data) {\n if(ended = ended || end) {\n //last ? terminate(cb) :\n cb(ended)\n }\n else if(!test(data)) {\n ended = true\n last ? cb(null, data) : terminate(cb)\n }\n else\n cb(null, data)\n })\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/take.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/through.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/through.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n//a pass through stream that doesn't change the value.\nmodule.exports = function through (op, onEnd) {\n var a = false\n\n function once (abort) {\n if(a || !onEnd) return\n a = true\n onEnd(abort === true ? null : abort)\n }\n\n return function (read) {\n return function (end, cb) {\n if(end) once(end)\n return read(end, function (end, data) {\n if(!end) op && op(data)\n else once(end)\n cb(end, data)\n })\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/through.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/throughs/unique.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/pull-stream/throughs/unique.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(/*! ../util/prop */ \"./node_modules/pull-stream/util/prop.js\")\nvar filter = __webpack_require__(/*! ./filter */ \"./node_modules/pull-stream/throughs/filter.js\")\n\n//drop items you have already seen.\nmodule.exports = function unique (field, invert) {\n field = prop(field) || id\n var seen = {}\n return filter(function (data) {\n var key = field(data)\n if(seen[key]) return !!invert //false, by default\n else seen[key] = true\n return !invert //true by default\n })\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/throughs/unique.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/util/abort-cb.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/pull-stream/util/abort-cb.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function abortCb(cb, abort, onAbort) {\n cb(abort)\n onAbort && onAbort(abort === true ? null: abort)\n return\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/util/abort-cb.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/util/prop.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/pull-stream/util/prop.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function prop (key) {\n return key && (\n 'string' == typeof key\n ? function (data) { return data[key] }\n : 'object' === typeof key && 'function' === typeof key.exec //regexp\n ? function (data) { var v = key.exec(data); return v && v[0] }\n : key\n )\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/util/prop.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-stream/util/tester.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/pull-stream/util/tester.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var prop = __webpack_require__(/*! ./prop */ \"./node_modules/pull-stream/util/prop.js\")\n\nfunction id (e) { return e }\n\nmodule.exports = function tester (test) {\n return (\n 'object' === typeof test && 'function' === typeof test.test //regexp\n ? function (data) { return test.test(data) }\n : prop (test) || id\n )\n}\n\n\n//# sourceURL=webpack:///./node_modules/pull-stream/util/tester.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pull-to-stream/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/pull-to-stream/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nconst { Duplex } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\");\n\nclass PullDuplexStream extends Duplex {\n constructor(source, sink, options) {\n super(options);\n this.source = source;\n this.drainingSource = false;\n this.sink = sink;\n this.input = [];\n this.writeCallbacks = [];\n this.internalSourceCallbacks = [];\n if (this.sink) {\n this.sink(this._internalSource.bind(this));\n }\n }\n\n drainPull() {\n const self = this;\n\n this.drainingSource = true;\n this.source(null, function next(end, data) {\n if (end instanceof Error) {\n return self.emit('error', end);\n }\n\n if (end) {\n return self.push(null);\n }\n\n if (self.push(data)) {\n self.source(null, next);\n } else {\n self.drainingSource = false;\n }\n });\n }\n\n _read() {\n if (this.source && !this.drainingSource) {\n this.drainPull();\n }\n }\n\n _write(chunk, encoding, callback) {\n if (this.internalSourceCallbacks.length > 0) {\n this.internalSourceCallbacks.shift()(null, chunk);\n callback();\n } else {\n this.input.push(chunk);\n this.writeCallbacks.push(callback);\n }\n }\n\n _internalSource(end, cb) {\n if (end) {\n if (this.writeCallbacks.length > 0) {\n // call write callback with error\n this.writeCallbacks.shift()(\n end instanceof Error ? end : new Error('Aborted')\n );\n }\n\n return cb(end);\n }\n\n if (this.input.length > 0) {\n cb(null, this.input.shift());\n this.writeCallbacks.shift()();\n } else {\n this.internalSourceCallbacks.push(cb);\n }\n }\n\n _final(callback) {\n // end the internal source\n if (this.internalSourceCallbacks.length > 0) {\n this.internalSourceCallbacks.shift()(true);\n }\n callback();\n }\n _destroy(err, cb) {\n // abort the source\n if (!this._readableState.ended && this.source) {\n this.source(true, () => {\n // do nothing\n });\n }\n\n // propagate error to sink\n if (this.internalSourceCallbacks.length > 0) {\n this.internalSourceCallbacks.shift()(err);\n }\n\n cb(err);\n }\n}\n\nfunction wrapper(source, sink, options) {\n if (source && typeof source === 'object') {\n source = source.source;\n sink = source.sink;\n }\n\n return new PullDuplexStream(\n source,\n sink,\n Object.assign(\n {\n readableObjectMode: true,\n writableObjectMode: true\n },\n options\n )\n );\n}\n\nmodule.exports = {\n duplex: wrapper,\n readable: (source, options) => wrapper(source, null, options),\n writeable: (sink, options) => wrapper(null, sink, options)\n};\n\n\n//# sourceURL=webpack:///./node_modules/pull-to-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/pump/index.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/pump/index.js ***!
|
||
\************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nvar eos = __webpack_require__(/*! end-of-stream */ \"./node_modules/end-of-stream/index.js\")\nvar fs = __webpack_require__(/*! fs */ 10) // we only need fs to get the ReadStream and WriteStream prototypes\n\nvar noop = function () {}\nvar ancient = /^v?\\.0/.test(process.version)\n\nvar isFn = function (fn) {\n return typeof fn === 'function'\n}\n\nvar isFS = function (stream) {\n if (!ancient) return false // newer node version do not need to care about fs is a special way\n if (!fs) return false // browser\n return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)\n}\n\nvar isRequest = function (stream) {\n return stream.setHeader && isFn(stream.abort)\n}\n\nvar destroyer = function (stream, reading, writing, callback) {\n callback = once(callback)\n\n var closed = false\n stream.on('close', function () {\n closed = true\n })\n\n eos(stream, {readable: reading, writable: writing}, function (err) {\n if (err) return callback(err)\n closed = true\n callback()\n })\n\n var destroyed = false\n return function (err) {\n if (closed) return\n if (destroyed) return\n destroyed = true\n\n if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks\n if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want\n\n if (isFn(stream.destroy)) return stream.destroy()\n\n callback(err || new Error('stream was destroyed'))\n }\n}\n\nvar call = function (fn) {\n fn()\n}\n\nvar pipe = function (from, to) {\n return from.pipe(to)\n}\n\nvar pump = function () {\n var streams = Array.prototype.slice.call(arguments)\n var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop\n\n if (Array.isArray(streams[0])) streams = streams[0]\n if (streams.length < 2) throw new Error('pump requires two streams per minimum')\n\n var error\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1\n var writing = i > 0\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err\n if (err) destroys.forEach(call)\n if (reading) return\n destroys.forEach(call)\n callback(error)\n })\n })\n\n return streams.reduce(pipe)\n}\n\nmodule.exports = pump\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/pump/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/punycode/punycode.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/punycode/punycode.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = true && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = true && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttrue\n\t) {\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\t\treturn punycode;\n\t\t}).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n\n}(this));\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module), __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/punycode/punycode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/qs/lib/formats.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/qs/lib/formats.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nmodule.exports = {\n 'default': 'RFC3986',\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return value;\n }\n },\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\n\n//# sourceURL=webpack:///./node_modules/qs/lib/formats.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/qs/lib/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/qs/lib/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar stringify = __webpack_require__(/*! ./stringify */ \"./node_modules/qs/lib/stringify.js\");\nvar parse = __webpack_require__(/*! ./parse */ \"./node_modules/qs/lib/parse.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"./node_modules/qs/lib/formats.js\");\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n\n\n//# sourceURL=webpack:///./node_modules/qs/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/qs/lib/parse.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/qs/lib/parse.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/qs/lib/utils.js\");\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset);\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset);\n val = options.decoder(part.slice(pos + 1), defaults.decoder, charset);\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (val && options.comma && val.indexOf(',') > -1) {\n val = val.split(',');\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options) {\n var leaf = val;\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while ((segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options);\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n\n\n//# sourceURL=webpack:///./node_modules/qs/lib/parse.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/qs/lib/stringify.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/qs/lib/stringify.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/qs/lib/utils.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"./node_modules/qs/lib/formats.js\");\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) { // eslint-disable-line func-name-matching\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) { // eslint-disable-line func-name-matching\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) { // eslint-disable-line func-name-matching\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n formatter: formats.formatters[formats['default']],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar stringify = function stringify( // eslint-disable-line func-name-matching\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = obj.join(',');\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix;\n }\n\n obj = '';\n }\n\n if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n if (isArray(obj)) {\n pushToArray(values, stringify(\n obj[key],\n typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n } else {\n pushToArray(values, stringify(\n obj[key],\n prefix + (allowDots ? '.' + key : '[' + key + ']'),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n }\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.formatter,\n options.encodeValuesOnly,\n options.charset\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n\n\n//# sourceURL=webpack:///./node_modules/qs/lib/stringify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/qs/lib/utils.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/qs/lib/utils.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = typeof str === 'string' ? str : String(str);\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n merge: merge\n};\n\n\n//# sourceURL=webpack:///./node_modules/qs/lib/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/querystring-es3/decode.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/querystring-es3/decode.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\n\n//# sourceURL=webpack:///./node_modules/querystring-es3/decode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/querystring-es3/encode.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/querystring-es3/encode.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n\n\n//# sourceURL=webpack:///./node_modules/querystring-es3/encode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/querystring-es3/index.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/querystring-es3/index.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nexports.decode = exports.parse = __webpack_require__(/*! ./decode */ \"./node_modules/querystring-es3/decode.js\");\nexports.encode = exports.stringify = __webpack_require__(/*! ./encode */ \"./node_modules/querystring-es3/encode.js\");\n\n\n//# sourceURL=webpack:///./node_modules/querystring-es3/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/random-iterate/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/random-iterate/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var iterate = function (list) {\n var offset = 0\n return function () {\n if (offset === list.length) return null\n\n var len = list.length - offset\n var i = (Math.random() * len) | 0\n var el = list[offset + i]\n\n var tmp = list[offset]\n list[offset] = el\n list[offset + i] = tmp\n offset++\n\n return el\n }\n}\n\nmodule.exports = iterate\n\n\n//# sourceURL=webpack:///./node_modules/random-iterate/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/randombytes/browser.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/randombytes/browser.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nvar MAX_BYTES = 65536\n\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nvar MAX_UINT32 = 4294967295\n\nfunction oldBrowser () {\n throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11')\n}\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar crypto = global.crypto || global.msCrypto\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes\n} else {\n module.exports = oldBrowser\n}\n\nfunction randomBytes (size, cb) {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n\n var bytes = Buffer.allocUnsafe(size)\n\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (var generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n\n if (typeof cb === 'function') {\n return process.nextTick(function () {\n cb(null, bytes)\n })\n }\n\n return bytes\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/randombytes/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/range-slice-stream/index.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/range-slice-stream/index.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\nInstance of writable stream.\n\ncall .get(length) or .discard(length) to get a stream (relative to the last end)\n\nemits 'stalled' once everything is written\n\n*/\nconst { Writable, PassThrough } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\nclass RangeSliceStream extends Writable {\n constructor (offset, opts = {}) {\n super(opts)\n\n this.destroyed = false\n this._queue = []\n this._position = offset || 0\n this._cb = null\n this._buffer = null\n this._out = null\n }\n\n _write (chunk, encoding, cb) {\n let drained = true\n\n while (true) {\n if (this.destroyed) {\n return\n }\n\n // Wait for more queue entries\n if (this._queue.length === 0) {\n this._buffer = chunk\n this._cb = cb\n return\n }\n\n this._buffer = null\n var currRange = this._queue[0]\n // Relative to the start of chunk, what data do we need?\n const writeStart = Math.max(currRange.start - this._position, 0)\n const writeEnd = currRange.end - this._position\n\n // Check if we need to throw it all away\n if (writeStart >= chunk.length) {\n this._position += chunk.length\n return cb(null)\n }\n\n // Check if we need to use it all\n let toWrite\n if (writeEnd > chunk.length) {\n this._position += chunk.length\n if (writeStart === 0) {\n toWrite = chunk\n } else {\n toWrite = chunk.slice(writeStart)\n }\n drained = currRange.stream.write(toWrite) && drained\n break\n }\n\n this._position += writeEnd\n\n toWrite = (writeStart === 0 && writeEnd === chunk.length)\n ? chunk\n : chunk.slice(writeStart, writeEnd)\n\n drained = currRange.stream.write(toWrite) && drained\n if (currRange.last) {\n currRange.stream.end()\n }\n chunk = chunk.slice(writeEnd)\n this._queue.shift()\n }\n\n if (drained) {\n cb(null)\n } else {\n currRange.stream.once('drain', cb.bind(null, null))\n }\n }\n\n slice (ranges) {\n if (this.destroyed) return null\n\n if (!Array.isArray(ranges)) ranges = [ranges]\n\n const str = new PassThrough()\n\n ranges.forEach((range, i) => {\n this._queue.push({\n start: range.start,\n end: range.end,\n stream: str,\n last: i === ranges.length - 1\n })\n })\n\n if (this._buffer) {\n this._write(this._buffer, null, this._cb)\n }\n\n return str\n }\n\n destroy (err) {\n if (this.destroyed) return\n this.destroyed = true\n\n if (err) this.emit('error', err)\n }\n}\n\nmodule.exports = RangeSliceStream\n\n\n//# sourceURL=webpack:///./node_modules/range-slice-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/errors-browser.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/readable-stream/errors-browser.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar codes = {};\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inheritsLoose(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;\n }\n\n return NodeError;\n }(Base);\n\n NodeError.prototype.name = Base.name;\n NodeError.prototype.code = code;\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {\n return 'The value \"' + value + '\" is invalid for option \"' + name + '\"';\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n msg += \". Received type \".concat(typeof actual);\n return msg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');\ncreateErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {\n return 'The ' + name + ' method is not implemented';\n});\ncreateErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');\ncreateErrorType('ERR_STREAM_DESTROYED', function (name) {\n return 'Cannot call ' + name + ' after a stream was destroyed';\n});\ncreateErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');\ncreateErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');\ncreateErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');\ncreateErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);\ncreateErrorType('ERR_UNKNOWN_ENCODING', function (arg) {\n return 'Unknown encoding: ' + arg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');\nmodule.exports.codes = codes;\n\n\n//# sourceURL=webpack:///./node_modules/readable-stream/errors-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/experimentalWarning.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/readable-stream/experimentalWarning.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar experimentalWarnings = new Set();\n\nfunction emitExperimentalWarning(feature) {\n if (experimentalWarnings.has(feature)) return;\n var msg = feature + ' is an experimental feature. This feature could ' +\n 'change at any time';\n experimentalWarnings.add(feature);\n process.emitWarning(msg, 'ExperimentalWarning');\n}\n\nfunction noop() {}\n\nmodule.exports.emitExperimentalWarning = process.emitWarning\n ? emitExperimentalWarning\n : noop;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/readable-stream/experimentalWarning.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n/*<replacement>*/\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n\n for (var key in obj) {\n keys.push(key);\n }\n\n return keys;\n};\n/*</replacement>*/\n\n\nmodule.exports = Duplex;\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/readable-stream/lib/_stream_readable.js\");\n\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/readable-stream/lib/_stream_writable.js\");\n\n__webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")(Duplex, Readable);\n\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n}); // the no-half-open enforcer\n\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return; // no more data can be written.\n // But allow more writes to happen in this tick.\n\n process.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/readable-stream/lib/_stream_transform.js\");\n\n__webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nmodule.exports = Readable;\n/*<replacement>*/\n\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n/*<replacement>*/\n\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\n\n\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/*<replacement>*/\n\n\nvar debugUtil = __webpack_require__(/*! util */ 1);\n\nvar debug;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/*</replacement>*/\n\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ \"./node_modules/readable-stream/lib/internal/streams/buffer_list.js\");\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nvar _require = __webpack_require__(/*! ./internal/streams/state */ \"./node_modules/readable-stream/lib/internal/streams/state.js\"),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = __webpack_require__(/*! ../errors */ \"./node_modules/readable-stream/errors-browser.js\").codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;\n\nvar _require2 = __webpack_require__(/*! ../experimentalWarning */ \"./node_modules/readable-stream/experimentalWarning.js\"),\n emitExperimentalWarning = _require2.emitExperimentalWarning; // Lazy loaded to improve the startup performance.\n\n\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\n\n__webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n } // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n\n\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n\n return er;\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc); // if setEncoding(null), decoder.encoding equals utf8\n\n this._readableState.encoding = this._readableState.decoder.encoding;\n return this;\n}; // Don't raise the hwm > 8MB\n\n\nvar MAX_HWM = 0x800000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true;\n\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\n\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n } // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n\n\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n this.emit('error', new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused\n\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true; // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume'); // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n\n state.paused = false;\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n\n if (!state.reading) {\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n this._readableState.paused = true;\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {\n ;\n }\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n emitExperimentalWarning('Readable[Symbol.asyncIterator]');\n\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ \"./node_modules/readable-stream/lib/internal/streams/async_iterator.js\");\n }\n\n return createReadableStreamAsyncIterator(this);\n };\n}\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n}); // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.\n\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\nmodule.exports = Transform;\n\nvar _require$codes = __webpack_require__(/*! ../errors */ \"./node_modules/readable-stream/errors-browser.js\").codes,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,\n ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n__webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n var cb = ts.writecb;\n\n if (cb === null) {\n return this.emit('error', new ERR_MULTIPLE_CALLBACK());\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n cb(er);\n var rs = this._readableState;\n rs.reading = false;\n\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n Duplex.call(this, options);\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n }; // start out asking for a readable event once data is transformed.\n\n this._readableState.needReadable = true; // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n if (typeof options.flush === 'function') this._flush = options.flush;\n } // When the writable side finishes, then flush out anything remaining.\n\n\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function' && !this._readableState.destroyed) {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n}; // This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\n\n\nTransform.prototype._transform = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n}; // Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\n\n\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && !ts.transforming) {\n ts.transforming = true;\n\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data); // TODO(BridgeAR): Write a test for these two error cases\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n\n if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();\n if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\nmodule.exports = Writable;\n/* <replacement> */\n\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n} // It seems a linked list but it is not\n// there will be only 2 of these for each stream\n\n\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\n\n\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n/*<replacement>*/\n\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nvar _require = __webpack_require__(/*! ./internal/streams/state */ \"./node_modules/readable-stream/lib/internal/streams/state.js\"),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = __webpack_require__(/*! ../errors */ \"./node_modules/readable-stream/errors-browser.js\").codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,\n ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;\n\n__webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream, isDuplex) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n\n this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called\n\n this.finalCalled = false; // drain event flag.\n\n this.needDrain = false; // at the start of calling end()\n\n this.ending = false; // when end() has been called, and returned\n\n this.ended = false; // when 'finish' is emitted\n\n this.finished = false; // has it been destroyed\n\n this.destroyed = false; // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n\n this.length = 0; // a flag to see when we're in the middle of a write.\n\n this.writing = false; // when true all writes will be buffered until .uncork() call\n\n this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n\n this.sync = true; // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n\n this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)\n\n this.onwrite = function (er) {\n onwrite(stream, er);\n }; // the callback that the user supplies to write(chunk,encoding,cb)\n\n\n this.writecb = null; // the amount that is being written when _write is called.\n\n this.writelen = 0;\n this.bufferedRequest = null;\n this.lastBufferedRequest = null; // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n\n this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n\n this.prefinished = false; // True if the error was already emitted and should not be thrown again\n\n this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // count buffered requests\n\n this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n\n while (current) {\n out.push(current);\n current = current.next;\n }\n\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function writableStateBufferGetter() {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})(); // Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\n\n\nvar realHasInstance;\n\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function value(object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function realHasInstance(object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\"); // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);\n this._writableState = new WritableState(options, this, isDuplex); // legacy.\n\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n if (typeof options.writev === 'function') this._writev = options.writev;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n} // Otherwise people can pipe Writable streams, which is just wrong.\n\n\nWritable.prototype.pipe = function () {\n this.emit('error', new ERR_STREAM_CANNOT_PIPE());\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb\n\n stream.emit('error', er);\n process.nextTick(cb, er);\n} // Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\n\n\nfunction validChunk(stream, state, chunk, cb) {\n var er;\n\n if (chunk === null) {\n er = new ERR_STREAM_NULL_VALUES();\n } else if (typeof chunk !== 'string' && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);\n }\n\n if (er) {\n stream.emit('error', er);\n process.nextTick(cb, er);\n return false;\n }\n\n return true;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n if (typeof cb !== 'function') cb = nop;\n if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n return ret;\n};\n\nWritable.prototype.cork = function () {\n this._writableState.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nObject.defineProperty(Writable.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n}); // if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\n\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n\n var len = state.objectMode ? 1 : chunk.length;\n state.length += len;\n var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.\n\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n process.nextTick(cb, er); // this can emit finish, and it will always happen\n // after error\n\n process.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er); // this can emit finish, but finish must\n // always follow error\n\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();\n onwriteStateUpdate(state);\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state) || stream.destroyed;\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n process.nextTick(afterWrite, stream, state, finished, cb);\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n} // Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\n\n\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it\n\n\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n var count = 0;\n var allBuffers = true;\n\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n\n buffer.allBuffers = allBuffers;\n doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n\n state.pendingcb++;\n state.lastBufferedRequest = null;\n\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks\n\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n } // ignore unnecessary end() calls.\n\n\n if (!state.ending) endWritable(this, state, cb);\n return this;\n};\n\nObject.defineProperty(Writable.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\n\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n\n if (err) {\n stream.emit('error', err);\n }\n\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\n\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.pendingcb++;\n state.finalCalled = true;\n process.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n\n if (need) {\n prefinish(stream, state);\n\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n\n if (cb) {\n if (state.finished) process.nextTick(cb);else stream.once('finish', cb);\n }\n\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n } // reuse the free corkReq.\n\n\n state.corkedRequestsFree.next = corkReq;\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._writableState === undefined) {\n return false;\n }\n\n return this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._writableState.destroyed = value;\n }\n});\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\n\nWritable.prototype._destroy = function (err, cb) {\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/async_iterator.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/async_iterator.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar _Object$setPrototypeO;\n\nfunction _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; }\n\nvar finished = __webpack_require__(/*! ./end-of-stream */ \"./node_modules/readable-stream/lib/internal/streams/end-of-stream.js\");\n\nvar kLastResolve = Symbol('lastResolve');\nvar kLastReject = Symbol('lastReject');\nvar kError = Symbol('error');\nvar kEnded = Symbol('ended');\nvar kLastPromise = Symbol('lastPromise');\nvar kHandlePromise = Symbol('handlePromise');\nvar kStream = Symbol('stream');\n\nfunction createIterResult(value, done) {\n return {\n value: value,\n done: done\n };\n}\n\nfunction readAndResolve(iter) {\n var resolve = iter[kLastResolve];\n\n if (resolve !== null) {\n var data = iter[kStream].read(); // we defer if data is null\n // we can be expecting either 'end' or\n // 'error'\n\n if (data !== null) {\n iter[kLastPromise] = null;\n iter[kLastResolve] = null;\n iter[kLastReject] = null;\n resolve(createIterResult(data, false));\n }\n }\n}\n\nfunction onReadable(iter) {\n // we wait for the next tick, because it might\n // emit an error with process.nextTick\n process.nextTick(readAndResolve, iter);\n}\n\nfunction wrapForNext(lastPromise, iter) {\n return function (resolve, reject) {\n lastPromise.then(function () {\n if (iter[kEnded]) {\n resolve(createIterResult(undefined, true));\n return;\n }\n\n iter[kHandlePromise](resolve, reject);\n }, reject);\n };\n}\n\nvar AsyncIteratorPrototype = Object.getPrototypeOf(function () {});\nvar ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {\n get stream() {\n return this[kStream];\n },\n\n next: function next() {\n var _this = this;\n\n // if we have detected an error in the meanwhile\n // reject straight away\n var error = this[kError];\n\n if (error !== null) {\n return Promise.reject(error);\n }\n\n if (this[kEnded]) {\n return Promise.resolve(createIterResult(undefined, true));\n }\n\n if (this[kStream].destroyed) {\n // We need to defer via nextTick because if .destroy(err) is\n // called, the error will be emitted via nextTick, and\n // we cannot guarantee that there is no error lingering around\n // waiting to be emitted.\n return new Promise(function (resolve, reject) {\n process.nextTick(function () {\n if (_this[kError]) {\n reject(_this[kError]);\n } else {\n resolve(createIterResult(undefined, true));\n }\n });\n });\n } // if we have multiple next() calls\n // we will wait for the previous Promise to finish\n // this logic is optimized to support for await loops,\n // where next() is only called once at a time\n\n\n var lastPromise = this[kLastPromise];\n var promise;\n\n if (lastPromise) {\n promise = new Promise(wrapForNext(lastPromise, this));\n } else {\n // fast path needed to support multiple this.push()\n // without triggering the next() queue\n var data = this[kStream].read();\n\n if (data !== null) {\n return Promise.resolve(createIterResult(data, false));\n }\n\n promise = new Promise(this[kHandlePromise]);\n }\n\n this[kLastPromise] = promise;\n return promise;\n }\n}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {\n return this;\n}), _defineProperty(_Object$setPrototypeO, \"return\", function _return() {\n var _this2 = this;\n\n // destroy(err, cb) is a private API\n // we can guarantee we have that here, because we control the\n // Readable class this is attached to\n return new Promise(function (resolve, reject) {\n _this2[kStream].destroy(null, function (err) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(createIterResult(undefined, true));\n });\n });\n}), _Object$setPrototypeO), AsyncIteratorPrototype);\n\nvar createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {\n var _Object$create;\n\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {\n value: stream,\n writable: true\n }), _defineProperty(_Object$create, kLastResolve, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kLastReject, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kError, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kEnded, {\n value: stream._readableState.endEmitted,\n writable: true\n }), _defineProperty(_Object$create, kHandlePromise, {\n value: function value(resolve, reject) {\n var data = iterator[kStream].read();\n\n if (data) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(data, false));\n } else {\n iterator[kLastResolve] = resolve;\n iterator[kLastReject] = reject;\n }\n },\n writable: true\n }), _Object$create));\n iterator[kLastPromise] = null;\n finished(stream, function (err) {\n if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise\n // returned by next() and store the error\n\n if (reject !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n reject(err);\n }\n\n iterator[kError] = err;\n return;\n }\n\n var resolve = iterator[kLastResolve];\n\n if (resolve !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(undefined, true));\n }\n\n iterator[kEnded] = true;\n });\n stream.on('readable', onReadable.bind(null, iterator));\n return iterator;\n};\n\nmodule.exports = createReadableStreamAsyncIterator;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/async_iterator.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/buffer_list.js":
|
||
/*!**************************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/buffer_list.js ***!
|
||
\**************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _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; }\n\nvar _require = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\"),\n Buffer = _require.Buffer;\n\nvar _require2 = __webpack_require__(/*! util */ 2),\n inspect = _require2.inspect;\n\nvar custom = inspect && inspect.custom || 'inspect';\n\nfunction copyBuffer(src, target, offset) {\n Buffer.prototype.copy.call(src, target, offset);\n}\n\nmodule.exports =\n/*#__PURE__*/\nfunction () {\n function BufferList() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n var _proto = BufferList.prototype;\n\n _proto.push = function push(v) {\n var entry = {\n data: v,\n next: null\n };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n _proto.unshift = function unshift(v) {\n var entry = {\n data: v,\n next: this.head\n };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n _proto.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n _proto.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n _proto.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n\n while (p = p.next) {\n ret += s + p.data;\n }\n\n return ret;\n };\n\n _proto.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n\n return ret;\n } // Consumes a specified amount of bytes or characters from the buffered data.\n ;\n\n _proto.consume = function consume(n, hasStrings) {\n var ret;\n\n if (n < this.head.data.length) {\n // `slice` is the same for buffers and strings.\n ret = this.head.data.slice(0, n);\n this.head.data = this.head.data.slice(n);\n } else if (n === this.head.data.length) {\n // First chunk is a perfect match.\n ret = this.shift();\n } else {\n // Result spans more than one buffer.\n ret = hasStrings ? this._getString(n) : this._getBuffer(n);\n }\n\n return ret;\n };\n\n _proto.first = function first() {\n return this.head.data;\n } // Consumes a specified amount of characters from the buffered data.\n ;\n\n _proto._getString = function _getString(n) {\n var p = this.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = str.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n this.length -= c;\n return ret;\n } // Consumes a specified amount of bytes from the buffered data.\n ;\n\n _proto._getBuffer = function _getBuffer(n) {\n var ret = Buffer.allocUnsafe(n);\n var p = this.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = buf.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n this.length -= c;\n return ret;\n } // Make sure the linked list only shows the minimal necessary information.\n ;\n\n _proto[custom] = function (_, options) {\n return inspect(this, _objectSpread({}, options, {\n // Only inspect one level.\n depth: 0,\n // It should not recurse.\n customInspect: false\n }));\n };\n\n return BufferList;\n}();\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/buffer_list.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\**********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) { // undocumented cb() API, needed for core, not for public API\n\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n process.nextTick(emitErrorNT, this, err);\n }\n\n return this;\n } // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n } // if this is a duplex stream mark the writable part as destroyed as well\n\n\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n\n return this;\n}\n\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\n\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/end-of-stream.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***!
|
||
\****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n\nvar ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(/*! ../../../errors */ \"./node_modules/readable-stream/errors-browser.js\").codes.ERR_STREAM_PREMATURE_CLOSE;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n callback.apply(this, args);\n };\n}\n\nfunction noop() {}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction eos(stream, opts, callback) {\n if (typeof opts === 'function') return eos(stream, null, opts);\n if (!opts) opts = {};\n callback = once(callback || noop);\n var readable = opts.readable || opts.readable !== false && stream.readable;\n var writable = opts.writable || opts.writable !== false && stream.writable;\n\n var onlegacyfinish = function onlegacyfinish() {\n if (!stream.writable) onfinish();\n };\n\n var writableEnded = stream._writableState && stream._writableState.finished;\n\n var onfinish = function onfinish() {\n writable = false;\n writableEnded = true;\n if (!readable) callback.call(stream);\n };\n\n var readableEnded = stream._readableState && stream._readableState.endEmitted;\n\n var onend = function onend() {\n readable = false;\n readableEnded = true;\n if (!writable) callback.call(stream);\n };\n\n var onerror = function onerror(err) {\n callback.call(stream, err);\n };\n\n var onclose = function onclose() {\n var err;\n\n if (readable && !readableEnded) {\n if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n\n if (writable && !writableEnded) {\n if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n };\n\n var onrequest = function onrequest() {\n stream.req.on('finish', onfinish);\n };\n\n if (isRequest(stream)) {\n stream.on('complete', onfinish);\n stream.on('abort', onclose);\n if (stream.req) onrequest();else stream.on('request', onrequest);\n } else if (writable && !stream._writableState) {\n // legacy streams\n stream.on('end', onlegacyfinish);\n stream.on('close', onlegacyfinish);\n }\n\n stream.on('end', onend);\n stream.on('finish', onfinish);\n if (opts.error !== false) stream.on('error', onerror);\n stream.on('close', onclose);\n return function () {\n stream.removeListener('complete', onfinish);\n stream.removeListener('abort', onclose);\n stream.removeListener('request', onrequest);\n if (stream.req) stream.req.removeListener('finish', onfinish);\n stream.removeListener('end', onlegacyfinish);\n stream.removeListener('close', onlegacyfinish);\n stream.removeListener('finish', onfinish);\n stream.removeListener('end', onend);\n stream.removeListener('error', onerror);\n stream.removeListener('close', onclose);\n };\n}\n\nmodule.exports = eos;\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/end-of-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/pipeline.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/pipeline.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n\nvar eos;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\n\nvar _require$codes = __webpack_require__(/*! ../../../errors */ \"./node_modules/readable-stream/errors-browser.js\").codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\n\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ \"./node_modules/readable-stream/lib/internal/streams/end-of-stream.js\");\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true; // request.destroy just do .end - .abort is what we want\n\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\n\nfunction call(fn) {\n fn();\n}\n\nfunction pipe(from, to) {\n return from.pipe(to);\n}\n\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\n\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\n\nmodule.exports = pipeline;\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/pipeline.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/state.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/state.js ***!
|
||
\********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar ERR_INVALID_OPT_VALUE = __webpack_require__(/*! ../../../errors */ \"./node_modules/readable-stream/errors-browser.js\").codes.ERR_INVALID_OPT_VALUE;\n\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;\n}\n\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n\n if (hwm != null) {\n if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {\n var name = isDuplex ? duplexKey : 'highWaterMark';\n throw new ERR_INVALID_OPT_VALUE(name, hwm);\n }\n\n return Math.floor(hwm);\n } // Default value\n\n\n return state.objectMode ? 16 : 16 * 1024;\n}\n\nmodule.exports = {\n getHighWaterMark: getHighWaterMark\n};\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/state.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/readable-stream/readable-browser.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/readable-stream/readable-browser.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/readable-stream/lib/_stream_passthrough.js\");\nexports.finished = __webpack_require__(/*! ./lib/internal/streams/end-of-stream.js */ \"./node_modules/readable-stream/lib/internal/streams/end-of-stream.js\");\nexports.pipeline = __webpack_require__(/*! ./lib/internal/streams/pipeline.js */ \"./node_modules/readable-stream/lib/internal/streams/pipeline.js\");\n\n\n//# sourceURL=webpack:///./node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/render-media/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/render-media/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports.render = render\nexports.append = append\nexports.mime = __webpack_require__(/*! ./lib/mime.json */ \"./node_modules/render-media/lib/mime.json\")\n\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/render-media/node_modules/debug/src/browser.js\")('render-media')\nvar isAscii = __webpack_require__(/*! is-ascii */ \"./node_modules/is-ascii/index.js\")\nvar MediaElementWrapper = __webpack_require__(/*! mediasource */ \"./node_modules/mediasource/index.js\")\nvar path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\nvar streamToBlobURL = __webpack_require__(/*! stream-to-blob-url */ \"./node_modules/render-media/node_modules/stream-to-blob-url/index.js\")\nvar videostream = __webpack_require__(/*! videostream */ \"./node_modules/videostream/videostream.js\")\n\nvar VIDEOSTREAM_EXTS = [\n '.m4a',\n '.m4v',\n '.mp4'\n]\n\nvar MEDIASOURCE_VIDEO_EXTS = [\n '.m4v',\n '.mkv',\n '.mp4',\n '.webm'\n]\n\nvar MEDIASOURCE_AUDIO_EXTS = [\n '.m4a',\n '.mp3'\n]\n\nvar MEDIASOURCE_EXTS = [].concat(\n MEDIASOURCE_VIDEO_EXTS,\n MEDIASOURCE_AUDIO_EXTS\n)\n\nvar AUDIO_EXTS = [\n '.aac',\n '.oga',\n '.ogg',\n '.wav',\n '.flac'\n]\n\nvar IMAGE_EXTS = [\n '.bmp',\n '.gif',\n '.jpeg',\n '.jpg',\n '.png',\n '.svg'\n]\n\nvar IFRAME_EXTS = [\n '.css',\n '.html',\n '.js',\n '.md',\n '.pdf',\n '.txt'\n]\n\n// Maximum file length for which the Blob URL strategy will be attempted\n// See: https://github.com/feross/render-media/issues/18\nvar MAX_BLOB_LENGTH = 200 * 1000 * 1000 // 200 MB\n\nvar MediaSource = typeof window !== 'undefined' && window.MediaSource\n\nfunction render (file, elem, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n if (!opts) opts = {}\n if (!cb) cb = function () {}\n\n validateFile(file)\n parseOpts(opts)\n\n if (typeof elem === 'string') elem = document.querySelector(elem)\n\n renderMedia(file, function (tagName) {\n if (elem.nodeName !== tagName.toUpperCase()) {\n var extname = path.extname(file.name).toLowerCase()\n\n throw new Error(\n 'Cannot render \"' + extname + '\" inside a \"' +\n elem.nodeName.toLowerCase() + '\" element, expected \"' + tagName + '\"'\n )\n }\n\n return elem\n }, opts, cb)\n}\n\nfunction append (file, rootElem, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n if (!opts) opts = {}\n if (!cb) cb = function () {}\n\n validateFile(file)\n parseOpts(opts)\n\n if (typeof rootElem === 'string') rootElem = document.querySelector(rootElem)\n\n if (rootElem && (rootElem.nodeName === 'VIDEO' || rootElem.nodeName === 'AUDIO')) {\n throw new Error(\n 'Invalid video/audio node argument. Argument must be root element that ' +\n 'video/audio tag will be appended to.'\n )\n }\n\n renderMedia(file, getElem, opts, done)\n\n function getElem (tagName) {\n if (tagName === 'video' || tagName === 'audio') return createMedia(tagName)\n else return createElem(tagName)\n }\n\n function createMedia (tagName) {\n var elem = createElem(tagName)\n if (opts.autoplay) elem.autoplay = true\n if (opts.muted) elem.muted = true\n if (opts.controls) elem.controls = true\n rootElem.appendChild(elem)\n return elem\n }\n\n function createElem (tagName) {\n var elem = document.createElement(tagName)\n rootElem.appendChild(elem)\n return elem\n }\n\n function done (err, elem) {\n if (err && elem) elem.remove()\n cb(err, elem)\n }\n}\n\nfunction renderMedia (file, getElem, opts, cb) {\n var extname = path.extname(file.name).toLowerCase()\n var currentTime = 0\n var elem\n\n if (MEDIASOURCE_EXTS.indexOf(extname) >= 0) {\n renderMediaSource()\n } else if (AUDIO_EXTS.indexOf(extname) >= 0) {\n renderAudio()\n } else if (IMAGE_EXTS.indexOf(extname) >= 0) {\n renderImage()\n } else if (IFRAME_EXTS.indexOf(extname) >= 0) {\n renderIframe()\n } else {\n tryRenderIframe()\n }\n\n function renderMediaSource () {\n var tagName = MEDIASOURCE_VIDEO_EXTS.indexOf(extname) >= 0 ? 'video' : 'audio'\n\n if (MediaSource) {\n if (VIDEOSTREAM_EXTS.indexOf(extname) >= 0) {\n useVideostream()\n } else {\n useMediaSource()\n }\n } else {\n useBlobURL()\n }\n\n function useVideostream () {\n debug('Use `videostream` package for ' + file.name)\n prepareElem()\n elem.addEventListener('error', fallbackToMediaSource)\n elem.addEventListener('loadstart', onLoadStart)\n elem.addEventListener('canplay', onCanPlay)\n videostream(file, elem)\n }\n\n function useMediaSource () {\n debug('Use MediaSource API for ' + file.name)\n prepareElem()\n elem.addEventListener('error', fallbackToBlobURL)\n elem.addEventListener('loadstart', onLoadStart)\n elem.addEventListener('canplay', onCanPlay)\n\n var wrapper = new MediaElementWrapper(elem)\n var writable = wrapper.createWriteStream(getCodec(file.name))\n file.createReadStream().pipe(writable)\n\n if (currentTime) elem.currentTime = currentTime\n }\n\n function useBlobURL () {\n debug('Use Blob URL for ' + file.name)\n prepareElem()\n elem.addEventListener('error', fatalError)\n elem.addEventListener('loadstart', onLoadStart)\n elem.addEventListener('canplay', onCanPlay)\n getBlobURL(file, function (err, url) {\n if (err) return fatalError(err)\n elem.src = url\n if (currentTime) elem.currentTime = currentTime\n })\n }\n\n function fallbackToMediaSource (err) {\n debug('videostream error: fallback to MediaSource API: %o', err.message || err)\n elem.removeEventListener('error', fallbackToMediaSource)\n elem.removeEventListener('canplay', onCanPlay)\n\n useMediaSource()\n }\n\n function fallbackToBlobURL (err) {\n debug('MediaSource API error: fallback to Blob URL: %o', err.message || err)\n\n if (typeof file.length === 'number' && file.length > opts.maxBlobLength) {\n debug(\n 'File length too large for Blob URL approach: %d (max: %d)',\n file.length, opts.maxBlobLength\n )\n return fatalError(new Error(\n 'File length too large for Blob URL approach: ' + file.length +\n ' (max: ' + opts.maxBlobLength + ')'\n ))\n }\n\n elem.removeEventListener('error', fallbackToBlobURL)\n elem.removeEventListener('canplay', onCanPlay)\n\n useBlobURL()\n }\n\n function prepareElem () {\n if (!elem) {\n elem = getElem(tagName)\n\n elem.addEventListener('progress', function () {\n currentTime = elem.currentTime\n })\n }\n }\n }\n\n function renderAudio () {\n elem = getElem('audio')\n getBlobURL(file, function (err, url) {\n if (err) return fatalError(err)\n elem.addEventListener('error', fatalError)\n elem.addEventListener('loadstart', onLoadStart)\n elem.addEventListener('canplay', onCanPlay)\n elem.src = url\n })\n }\n\n function onLoadStart () {\n elem.removeEventListener('loadstart', onLoadStart)\n if (opts.autoplay) elem.play()\n }\n\n function onCanPlay () {\n elem.removeEventListener('canplay', onCanPlay)\n cb(null, elem)\n }\n\n function renderImage () {\n elem = getElem('img')\n getBlobURL(file, function (err, url) {\n if (err) return fatalError(err)\n elem.src = url\n elem.alt = file.name\n cb(null, elem)\n })\n }\n\n function renderIframe () {\n getBlobURL(file, function (err, url) {\n if (err) return fatalError(err)\n\n if (extname !== '.pdf') {\n // Render iframe\n elem = getElem('iframe')\n elem.sandbox = 'allow-forms allow-scripts'\n elem.src = url\n } else {\n // Render .pdf\n elem = getElem('object')\n // Firefox-only: `typemustmatch` keeps the embedded file from running unless\n // its content type matches the specified `type` attribute\n elem.setAttribute('typemustmatch', true)\n elem.setAttribute('type', 'application/pdf')\n elem.setAttribute('data', url)\n }\n cb(null, elem)\n })\n }\n\n function tryRenderIframe () {\n debug('Unknown file extension \"%s\" - will attempt to render into iframe', extname)\n\n var str = ''\n file.createReadStream({ start: 0, end: 1000 })\n .setEncoding('utf8')\n .on('data', function (chunk) {\n str += chunk\n })\n .on('end', done)\n .on('error', cb)\n\n function done () {\n if (isAscii(str)) {\n debug('File extension \"%s\" appears ascii, so will render.', extname)\n renderIframe()\n } else {\n debug('File extension \"%s\" appears non-ascii, will not render.', extname)\n cb(new Error('Unsupported file type \"' + extname + '\": Cannot append to DOM'))\n }\n }\n }\n\n function fatalError (err) {\n err.message = 'Error rendering file \"' + file.name + '\": ' + err.message\n debug(err.message)\n cb(err)\n }\n}\n\nfunction getBlobURL (file, cb) {\n var extname = path.extname(file.name).toLowerCase()\n streamToBlobURL(file.createReadStream(), exports.mime[extname], cb)\n}\n\nfunction validateFile (file) {\n if (file == null) {\n throw new Error('file cannot be null or undefined')\n }\n if (typeof file.name !== 'string') {\n throw new Error('missing or invalid file.name property')\n }\n if (typeof file.createReadStream !== 'function') {\n throw new Error('missing or invalid file.createReadStream property')\n }\n}\n\nfunction getCodec (name) {\n var extname = path.extname(name).toLowerCase()\n return {\n '.m4a': 'audio/mp4; codecs=\"mp4a.40.5\"',\n '.m4v': 'video/mp4; codecs=\"avc1.640029, mp4a.40.5\"',\n '.mkv': 'video/webm; codecs=\"avc1.640029, mp4a.40.5\"',\n '.mp3': 'audio/mpeg',\n '.mp4': 'video/mp4; codecs=\"avc1.640029, mp4a.40.5\"',\n '.webm': 'video/webm; codecs=\"vorbis, vp8\"'\n }[extname]\n}\n\nfunction parseOpts (opts) {\n if (opts.autoplay == null) opts.autoplay = false\n if (opts.muted == null) opts.muted = false\n if (opts.controls == null) opts.controls = true\n if (opts.maxBlobLength == null) opts.maxBlobLength = MAX_BLOB_LENGTH\n}\n\n\n//# sourceURL=webpack:///./node_modules/render-media/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/render-media/lib/mime.json":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/render-media/lib/mime.json ***!
|
||
\*************************************************/
|
||
/*! exports provided: .3gp, .aac, .aif, .aiff, .atom, .avi, .bmp, .bz2, .conf, .css, .csv, .diff, .doc, .flv, .gif, .gz, .htm, .html, .ico, .ics, .iso, .jar, .jpeg, .jpg, .js, .json, .less, .log, .m3u, .m4a, .m4v, .manifest, .markdown, .mathml, .md, .mid, .midi, .mov, .mp3, .mp4, .mp4v, .mpeg, .mpg, .odp, .ods, .odt, .oga, .ogg, .pdf, .png, .pps, .ppt, .ps, .psd, .qt, .rar, .rdf, .rss, .rtf, .svg, .svgz, .swf, .tar, .tbz, .text, .tif, .tiff, .torrent, .ttf, .txt, .wav, .webm, .wma, .wmv, .xls, .xml, .yaml, .yml, .zip, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\".3gp\":\"video/3gpp\",\".aac\":\"audio/aac\",\".aif\":\"audio/x-aiff\",\".aiff\":\"audio/x-aiff\",\".atom\":\"application/atom+xml\",\".avi\":\"video/x-msvideo\",\".bmp\":\"image/bmp\",\".bz2\":\"application/x-bzip2\",\".conf\":\"text/plain\",\".css\":\"text/css\",\".csv\":\"text/plain\",\".diff\":\"text/x-diff\",\".doc\":\"application/msword\",\".flv\":\"video/x-flv\",\".gif\":\"image/gif\",\".gz\":\"application/x-gzip\",\".htm\":\"text/html\",\".html\":\"text/html\",\".ico\":\"image/vnd.microsoft.icon\",\".ics\":\"text/calendar\",\".iso\":\"application/octet-stream\",\".jar\":\"application/java-archive\",\".jpeg\":\"image/jpeg\",\".jpg\":\"image/jpeg\",\".js\":\"application/javascript\",\".json\":\"application/json\",\".less\":\"text/css\",\".log\":\"text/plain\",\".m3u\":\"audio/x-mpegurl\",\".m4a\":\"audio/mp4\",\".m4v\":\"video/mp4\",\".manifest\":\"text/cache-manifest\",\".markdown\":\"text/x-markdown\",\".mathml\":\"application/mathml+xml\",\".md\":\"text/x-markdown\",\".mid\":\"audio/midi\",\".midi\":\"audio/midi\",\".mov\":\"video/quicktime\",\".mp3\":\"audio/mpeg\",\".mp4\":\"video/mp4\",\".mp4v\":\"video/mp4\",\".mpeg\":\"video/mpeg\",\".mpg\":\"video/mpeg\",\".odp\":\"application/vnd.oasis.opendocument.presentation\",\".ods\":\"application/vnd.oasis.opendocument.spreadsheet\",\".odt\":\"application/vnd.oasis.opendocument.text\",\".oga\":\"audio/ogg\",\".ogg\":\"application/ogg\",\".pdf\":\"application/pdf\",\".png\":\"image/png\",\".pps\":\"application/vnd.ms-powerpoint\",\".ppt\":\"application/vnd.ms-powerpoint\",\".ps\":\"application/postscript\",\".psd\":\"image/vnd.adobe.photoshop\",\".qt\":\"video/quicktime\",\".rar\":\"application/x-rar-compressed\",\".rdf\":\"application/rdf+xml\",\".rss\":\"application/rss+xml\",\".rtf\":\"application/rtf\",\".svg\":\"image/svg+xml\",\".svgz\":\"image/svg+xml\",\".swf\":\"application/x-shockwave-flash\",\".tar\":\"application/x-tar\",\".tbz\":\"application/x-bzip-compressed-tar\",\".text\":\"text/plain\",\".tif\":\"image/tiff\",\".tiff\":\"image/tiff\",\".torrent\":\"application/x-bittorrent\",\".ttf\":\"application/x-font-ttf\",\".txt\":\"text/plain\",\".wav\":\"audio/wav\",\".webm\":\"video/webm\",\".wma\":\"audio/x-ms-wma\",\".wmv\":\"video/x-ms-wmv\",\".xls\":\"application/vnd.ms-excel\",\".xml\":\"application/xml\",\".yaml\":\"text/yaml\",\".yml\":\"text/yaml\",\".zip\":\"application/zip\"};\n\n//# sourceURL=webpack:///./node_modules/render-media/lib/mime.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/render-media/node_modules/debug/src/browser.js":
|
||
/*!*********************************************************************!*\
|
||
!*** ./node_modules/render-media/node_modules/debug/src/browser.js ***!
|
||
\*********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/render-media/node_modules/debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/render-media/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/render-media/node_modules/debug/src/common.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/render-media/node_modules/debug/src/common.js ***!
|
||
\********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/render-media/node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/render-media/node_modules/stream-to-blob-url/index.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./node_modules/render-media/node_modules/stream-to-blob-url/index.js ***!
|
||
\****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* global URL */\n\nvar getBlob = __webpack_require__(/*! stream-to-blob */ \"./node_modules/stream-to-blob/index.js\")\n\nmodule.exports = function getBlobURL (stream, mimeType, cb) {\n if (typeof mimeType === 'function') return getBlobURL(stream, null, mimeType)\n getBlob(stream, mimeType, function (err, blob) {\n if (err) return cb(err)\n var url = URL.createObjectURL(blob)\n cb(null, url)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/render-media/node_modules/stream-to-blob-url/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request-promise-core/configure/request2.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/request-promise-core/configure/request2.js ***!
|
||
\*****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar core = __webpack_require__(/*! ../ */ \"./node_modules/request-promise-core/lib/plumbing.js\"),\n isArray = __webpack_require__(/*! lodash/isArray */ \"./node_modules/lodash/isArray.js\"),\n isFunction = __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isObjectLike = __webpack_require__(/*! lodash/isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n\nmodule.exports = function (options) {\n\n var errorText = 'Please verify options'; // For better minification because this string is repeating\n\n if (!isObjectLike(options)) {\n throw new TypeError(errorText);\n }\n\n if (!isFunction(options.request)) {\n throw new TypeError(errorText + '.request');\n }\n\n if (!isArray(options.expose) || options.expose.length === 0) {\n throw new TypeError(errorText + '.expose');\n }\n\n\n var plumbing = core({\n PromiseImpl: options.PromiseImpl,\n constructorMixin: options.constructorMixin\n });\n\n\n // Intercepting Request's init method\n\n var originalInit = options.request.Request.prototype.init;\n\n options.request.Request.prototype.init = function RP$initInterceptor(requestOptions) {\n\n // Init may be called again - currently in case of redirects\n if (isObjectLike(requestOptions) && !this._callback && !this._rp_promise) {\n\n plumbing.init.call(this, requestOptions);\n\n }\n\n return originalInit.apply(this, arguments);\n\n };\n\n\n // Exposing the Promise capabilities\n\n var thenExposed = false;\n for ( var i = 0; i < options.expose.length; i+=1 ) {\n\n var method = options.expose[i];\n\n plumbing[ method === 'promise' ? 'exposePromise' : 'exposePromiseMethod' ](\n options.request.Request.prototype,\n null,\n '_rp_promise',\n method\n );\n\n if (method === 'then') {\n thenExposed = true;\n }\n\n }\n\n if (!thenExposed) {\n throw new Error('Please expose \"then\"');\n }\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/request-promise-core/configure/request2.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request-promise-core/errors.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/request-promise-core/errors.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = __webpack_require__(/*! ./lib/errors.js */ \"./node_modules/request-promise-core/lib/errors.js\");\n\n\n//# sourceURL=webpack:///./node_modules/request-promise-core/errors.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request-promise-core/lib/errors.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/request-promise-core/lib/errors.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n\nfunction RequestError(cause, options, response) {\n\n this.name = 'RequestError';\n this.message = String(cause);\n this.cause = cause;\n this.error = cause; // legacy attribute\n this.options = options;\n this.response = response;\n\n if (Error.captureStackTrace) { // required for non-V8 environments\n Error.captureStackTrace(this);\n }\n\n}\nRequestError.prototype = Object.create(Error.prototype);\nRequestError.prototype.constructor = RequestError;\n\n\nfunction StatusCodeError(statusCode, body, options, response) {\n\n this.name = 'StatusCodeError';\n this.statusCode = statusCode;\n this.message = statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(body) : body);\n this.error = body; // legacy attribute\n this.options = options;\n this.response = response;\n\n if (Error.captureStackTrace) { // required for non-V8 environments\n Error.captureStackTrace(this);\n }\n\n}\nStatusCodeError.prototype = Object.create(Error.prototype);\nStatusCodeError.prototype.constructor = StatusCodeError;\n\n\nfunction TransformError(cause, options, response) {\n\n this.name = 'TransformError';\n this.message = String(cause);\n this.cause = cause;\n this.error = cause; // legacy attribute\n this.options = options;\n this.response = response;\n\n if (Error.captureStackTrace) { // required for non-V8 environments\n Error.captureStackTrace(this);\n }\n\n}\nTransformError.prototype = Object.create(Error.prototype);\nTransformError.prototype.constructor = TransformError;\n\n\nmodule.exports = {\n RequestError: RequestError,\n StatusCodeError: StatusCodeError,\n TransformError: TransformError\n};\n\n\n//# sourceURL=webpack:///./node_modules/request-promise-core/lib/errors.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request-promise-core/lib/plumbing.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/request-promise-core/lib/plumbing.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar errors = __webpack_require__(/*! ./errors.js */ \"./node_modules/request-promise-core/lib/errors.js\"),\n isFunction = __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isObjectLike = __webpack_require__(/*! lodash/isObjectLike */ \"./node_modules/lodash/isObjectLike.js\"),\n isString = __webpack_require__(/*! lodash/isString */ \"./node_modules/lodash/isString.js\"),\n isUndefined = __webpack_require__(/*! lodash/isUndefined */ \"./node_modules/lodash/isUndefined.js\");\n\n\nmodule.exports = function (options) {\n\n var errorText = 'Please verify options'; // For better minification because this string is repeating\n\n if (!isObjectLike(options)) {\n throw new TypeError(errorText);\n }\n\n if (!isFunction(options.PromiseImpl)) {\n throw new TypeError(errorText + '.PromiseImpl');\n }\n\n if (!isUndefined(options.constructorMixin) && !isFunction(options.constructorMixin)) {\n throw new TypeError(errorText + '.PromiseImpl');\n }\n\n var PromiseImpl = options.PromiseImpl;\n var constructorMixin = options.constructorMixin;\n\n\n var plumbing = {};\n\n plumbing.init = function (requestOptions) {\n\n var self = this;\n\n self._rp_promise = new PromiseImpl(function (resolve, reject) {\n self._rp_resolve = resolve;\n self._rp_reject = reject;\n if (constructorMixin) {\n constructorMixin.apply(self, arguments); // Using arguments since specific Promise libraries may pass additional parameters\n }\n });\n\n self._rp_callbackOrig = requestOptions.callback;\n requestOptions.callback = self.callback = function RP$callback(err, response, body) {\n plumbing.callback.call(self, err, response, body);\n };\n\n if (isString(requestOptions.method)) {\n requestOptions.method = requestOptions.method.toUpperCase();\n }\n\n requestOptions.transform = requestOptions.transform || plumbing.defaultTransformations[requestOptions.method];\n\n self._rp_options = requestOptions;\n self._rp_options.simple = requestOptions.simple !== false;\n self._rp_options.resolveWithFullResponse = requestOptions.resolveWithFullResponse === true;\n self._rp_options.transform2xxOnly = requestOptions.transform2xxOnly === true;\n\n };\n\n plumbing.defaultTransformations = {\n HEAD: function (body, response, resolveWithFullResponse) {\n return resolveWithFullResponse ? response : response.headers;\n }\n };\n\n plumbing.callback = function (err, response, body) {\n\n var self = this;\n\n var origCallbackThrewException = false, thrownException = null;\n\n if (isFunction(self._rp_callbackOrig)) {\n try {\n self._rp_callbackOrig.apply(self, arguments); // TODO: Apply to self mimics behavior of request@2. Is that also right for request@next?\n } catch (e) {\n origCallbackThrewException = true;\n thrownException = e;\n }\n }\n\n var is2xx = !err && /^2/.test('' + response.statusCode);\n\n if (err) {\n\n self._rp_reject(new errors.RequestError(err, self._rp_options, response));\n\n } else if (self._rp_options.simple && !is2xx) {\n\n if (isFunction(self._rp_options.transform) && self._rp_options.transform2xxOnly === false) {\n\n (new PromiseImpl(function (resolve) {\n resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise\n }))\n .then(function (transformedResponse) {\n self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, transformedResponse));\n })\n .catch(function (transformErr) {\n self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response));\n });\n\n } else {\n self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, response));\n }\n\n } else {\n\n if (isFunction(self._rp_options.transform) && (is2xx || self._rp_options.transform2xxOnly === false)) {\n\n (new PromiseImpl(function (resolve) {\n resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise\n }))\n .then(function (transformedResponse) {\n self._rp_resolve(transformedResponse);\n })\n .catch(function (transformErr) {\n self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response));\n });\n\n } else if (self._rp_options.resolveWithFullResponse) {\n self._rp_resolve(response);\n } else {\n self._rp_resolve(body);\n }\n\n }\n\n if (origCallbackThrewException) {\n throw thrownException;\n }\n\n };\n\n plumbing.exposePromiseMethod = function (exposeTo, bindTo, promisePropertyKey, methodToExpose, exposeAs) {\n\n exposeAs = exposeAs || methodToExpose;\n\n if (exposeAs in exposeTo) {\n throw new Error('Unable to expose method \"' + exposeAs + '\"');\n }\n\n exposeTo[exposeAs] = function RP$exposed() {\n var self = bindTo || this;\n return self[promisePropertyKey][methodToExpose].apply(self[promisePropertyKey], arguments);\n };\n\n };\n\n plumbing.exposePromise = function (exposeTo, bindTo, promisePropertyKey, exposeAs) {\n\n exposeAs = exposeAs || 'promise';\n\n if (exposeAs in exposeTo) {\n throw new Error('Unable to expose method \"' + exposeAs + '\"');\n }\n\n exposeTo[exposeAs] = function RP$promise() {\n var self = bindTo || this;\n return self[promisePropertyKey];\n };\n\n };\n\n return plumbing;\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/request-promise-core/lib/plumbing.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request-promise/errors.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/request-promise/errors.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = __webpack_require__(/*! request-promise-core/errors */ \"./node_modules/request-promise-core/errors.js\");\n\n\n//# sourceURL=webpack:///./node_modules/request-promise/errors.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request-promise/lib/rp.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/request-promise/lib/rp.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(module) {\n\nvar Bluebird = __webpack_require__(/*! bluebird */ \"./node_modules/bluebird/js/browser/bluebird.js\").getNewLibraryCopy(),\n configure = __webpack_require__(/*! request-promise-core/configure/request2 */ \"./node_modules/request-promise-core/configure/request2.js\"),\n stealthyRequire = __webpack_require__(/*! stealthy-require */ \"./node_modules/stealthy-require/lib/index.js\");\n\ntry {\n\n // Load Request freshly - so that users can require an unaltered request instance!\n var request = stealthyRequire(__webpack_require__.c, function () {\n return __webpack_require__(/*! request */ \"./node_modules/request/index.js\");\n },\n function () {\n __webpack_require__(/*! tough-cookie */ \"./node_modules/tough-cookie/lib/cookie.js\");\n }, module);\n\n} catch (err) {\n /* istanbul ignore next */\n var EOL = __webpack_require__(/*! os */ \"./node_modules/os-browserify/browser.js\").EOL;\n /* istanbul ignore next */\n console.error(EOL + '###' + EOL + '### The \"request\" library is not installed automatically anymore.' + EOL + '### But is a dependency of \"request-promise\".' + EOL + '### Please install it with:' + EOL + '### npm install request --save' + EOL + '###' + EOL);\n /* istanbul ignore next */\n throw err;\n}\n\nBluebird.config({cancellation: true});\n\nconfigure({\n request: request,\n PromiseImpl: Bluebird,\n expose: [\n 'then',\n 'catch',\n 'finally',\n 'cancel',\n 'promise'\n // Would you like to expose more Bluebird methods? Try e.g. `rp(...).promise().tap(...)` first. `.promise()` returns the full-fledged Bluebird promise.\n ],\n constructorMixin: function (resolve, reject, onCancel) {\n var self = this;\n onCancel(function () {\n self.abort();\n });\n }\n});\n\nrequest.bindCLS = function RP$bindCLS() {\n throw new Error('CLS support was dropped. To get it back read: https://github.com/request/request-promise/wiki/Getting-Back-Support-for-Continuation-Local-Storage');\n};\n\n\nmodule.exports = request;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/request-promise/lib/rp.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/index.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/request/index.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright 2010-2012 Mikeal Rogers\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n\n\nvar extend = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\")\nvar cookies = __webpack_require__(/*! ./lib/cookies */ \"./node_modules/request/lib/cookies.js\")\nvar helpers = __webpack_require__(/*! ./lib/helpers */ \"./node_modules/request/lib/helpers.js\")\n\nvar paramsHaveRequestBody = helpers.paramsHaveRequestBody\n\n// organize params for patch, post, put, head, del\nfunction initParams (uri, options, callback) {\n if (typeof options === 'function') {\n callback = options\n }\n\n var params = {}\n if (typeof options === 'object') {\n extend(params, options, {uri: uri})\n } else if (typeof uri === 'string') {\n extend(params, {uri: uri})\n } else {\n extend(params, uri)\n }\n\n params.callback = callback || params.callback\n return params\n}\n\nfunction request (uri, options, callback) {\n if (typeof uri === 'undefined') {\n throw new Error('undefined is not a valid uri or options object.')\n }\n\n var params = initParams(uri, options, callback)\n\n if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {\n throw new Error('HTTP HEAD requests MUST NOT include a request body.')\n }\n\n return new request.Request(params)\n}\n\nfunction verbFunc (verb) {\n var method = verb.toUpperCase()\n return function (uri, options, callback) {\n var params = initParams(uri, options, callback)\n params.method = method\n return request(params, params.callback)\n }\n}\n\n// define like this to please codeintel/intellisense IDEs\nrequest.get = verbFunc('get')\nrequest.head = verbFunc('head')\nrequest.options = verbFunc('options')\nrequest.post = verbFunc('post')\nrequest.put = verbFunc('put')\nrequest.patch = verbFunc('patch')\nrequest.del = verbFunc('delete')\nrequest['delete'] = verbFunc('delete')\n\nrequest.jar = function (store) {\n return cookies.jar(store)\n}\n\nrequest.cookie = function (str) {\n return cookies.parse(str)\n}\n\nfunction wrapRequestMethod (method, options, requester, verb) {\n return function (uri, opts, callback) {\n var params = initParams(uri, opts, callback)\n\n var target = {}\n extend(true, target, options, params)\n\n target.pool = params.pool || options.pool\n\n if (verb) {\n target.method = verb.toUpperCase()\n }\n\n if (typeof requester === 'function') {\n method = requester\n }\n\n return method(target, target.callback)\n }\n}\n\nrequest.defaults = function (options, requester) {\n var self = this\n\n options = options || {}\n\n if (typeof options === 'function') {\n requester = options\n options = {}\n }\n\n var defaults = wrapRequestMethod(self, options, requester)\n\n var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']\n verbs.forEach(function (verb) {\n defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)\n })\n\n defaults.cookie = wrapRequestMethod(self.cookie, options, requester)\n defaults.jar = self.jar\n defaults.defaults = self.defaults\n return defaults\n}\n\nrequest.forever = function (agentOptions, optionsArg) {\n var options = {}\n if (optionsArg) {\n extend(options, optionsArg)\n }\n if (agentOptions) {\n options.agentOptions = agentOptions\n }\n\n options.forever = true\n return request.defaults(options)\n}\n\n// Exports\n\nmodule.exports = request\nrequest.Request = __webpack_require__(/*! ./request */ \"./node_modules/request/request.js\")\nrequest.initParams = initParams\n\n// Backwards compatibility for request.debug\nObject.defineProperty(request, 'debug', {\n enumerable: true,\n get: function () {\n return request.Request.debug\n },\n set: function (debug) {\n request.Request.debug = debug\n }\n})\n\n\n//# sourceURL=webpack:///./node_modules/request/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/auth.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/request/lib/auth.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar caseless = __webpack_require__(/*! caseless */ \"./node_modules/caseless/index.js\")\nvar uuid = __webpack_require__(/*! uuid/v4 */ \"./node_modules/uuid/v4.js\")\nvar helpers = __webpack_require__(/*! ./helpers */ \"./node_modules/request/lib/helpers.js\")\n\nvar md5 = helpers.md5\nvar toBase64 = helpers.toBase64\n\nfunction Auth (request) {\n // define all public properties here\n this.request = request\n this.hasAuth = false\n this.sentAuth = false\n this.bearerToken = null\n this.user = null\n this.pass = null\n}\n\nAuth.prototype.basic = function (user, pass, sendImmediately) {\n var self = this\n if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {\n self.request.emit('error', new Error('auth() received invalid user or password'))\n }\n self.user = user\n self.pass = pass\n self.hasAuth = true\n var header = user + ':' + (pass || '')\n if (sendImmediately || typeof sendImmediately === 'undefined') {\n var authHeader = 'Basic ' + toBase64(header)\n self.sentAuth = true\n return authHeader\n }\n}\n\nAuth.prototype.bearer = function (bearer, sendImmediately) {\n var self = this\n self.bearerToken = bearer\n self.hasAuth = true\n if (sendImmediately || typeof sendImmediately === 'undefined') {\n if (typeof bearer === 'function') {\n bearer = bearer()\n }\n var authHeader = 'Bearer ' + (bearer || '')\n self.sentAuth = true\n return authHeader\n }\n}\n\nAuth.prototype.digest = function (method, path, authHeader) {\n // TODO: More complete implementation of RFC 2617.\n // - handle challenge.domain\n // - support qop=\"auth-int\" only\n // - handle Authentication-Info (not necessarily?)\n // - check challenge.stale (not necessarily?)\n // - increase nc (not necessarily?)\n // For reference:\n // http://tools.ietf.org/html/rfc2617#section-3\n // https://github.com/bagder/curl/blob/master/lib/http_digest.c\n\n var self = this\n\n var challenge = {}\n var re = /([a-z0-9_-]+)=(?:\"([^\"]+)\"|([a-z0-9_-]+))/gi\n for (;;) {\n var match = re.exec(authHeader)\n if (!match) {\n break\n }\n challenge[match[1]] = match[2] || match[3]\n }\n\n /**\n * RFC 2617: handle both MD5 and MD5-sess algorithms.\n *\n * If the algorithm directive's value is \"MD5\" or unspecified, then HA1 is\n * HA1=MD5(username:realm:password)\n * If the algorithm directive's value is \"MD5-sess\", then HA1 is\n * HA1=MD5(MD5(username:realm:password):nonce:cnonce)\n */\n var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {\n var ha1 = md5(user + ':' + realm + ':' + pass)\n if (algorithm && algorithm.toLowerCase() === 'md5-sess') {\n return md5(ha1 + ':' + nonce + ':' + cnonce)\n } else {\n return ha1\n }\n }\n\n var qop = /(^|,)\\s*auth\\s*($|,)/.test(challenge.qop) && 'auth'\n var nc = qop && '00000001'\n var cnonce = qop && uuid().replace(/-/g, '')\n var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)\n var ha2 = md5(method + ':' + path)\n var digestResponse = qop\n ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)\n : md5(ha1 + ':' + challenge.nonce + ':' + ha2)\n var authValues = {\n username: self.user,\n realm: challenge.realm,\n nonce: challenge.nonce,\n uri: path,\n qop: qop,\n response: digestResponse,\n nc: nc,\n cnonce: cnonce,\n algorithm: challenge.algorithm,\n opaque: challenge.opaque\n }\n\n authHeader = []\n for (var k in authValues) {\n if (authValues[k]) {\n if (k === 'qop' || k === 'nc' || k === 'algorithm') {\n authHeader.push(k + '=' + authValues[k])\n } else {\n authHeader.push(k + '=\"' + authValues[k] + '\"')\n }\n }\n }\n authHeader = 'Digest ' + authHeader.join(', ')\n self.sentAuth = true\n return authHeader\n}\n\nAuth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {\n var self = this\n var request = self.request\n\n var authHeader\n if (bearer === undefined && user === undefined) {\n self.request.emit('error', new Error('no auth mechanism defined'))\n } else if (bearer !== undefined) {\n authHeader = self.bearer(bearer, sendImmediately)\n } else {\n authHeader = self.basic(user, pass, sendImmediately)\n }\n if (authHeader) {\n request.setHeader('authorization', authHeader)\n }\n}\n\nAuth.prototype.onResponse = function (response) {\n var self = this\n var request = self.request\n\n if (!self.hasAuth || self.sentAuth) { return null }\n\n var c = caseless(response.headers)\n\n var authHeader = c.get('www-authenticate')\n var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()\n request.debug('reauth', authVerb)\n\n switch (authVerb) {\n case 'basic':\n return self.basic(self.user, self.pass, true)\n\n case 'bearer':\n return self.bearer(self.bearerToken, true)\n\n case 'digest':\n return self.digest(request.method, request.path, authHeader)\n }\n}\n\nexports.Auth = Auth\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/auth.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/cookies.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/request/lib/cookies.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar tough = __webpack_require__(/*! tough-cookie */ \"./node_modules/request/node_modules/tough-cookie/lib/cookie.js\")\n\nvar Cookie = tough.Cookie\nvar CookieJar = tough.CookieJar\n\nexports.parse = function (str) {\n if (str && str.uri) {\n str = str.uri\n }\n if (typeof str !== 'string') {\n throw new Error('The cookie function only accepts STRING as param')\n }\n return Cookie.parse(str, {loose: true})\n}\n\n// Adapt the sometimes-Async api of tough.CookieJar to our requirements\nfunction RequestJar (store) {\n var self = this\n self._jar = new CookieJar(store, {looseMode: true})\n}\nRequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {\n var self = this\n return self._jar.setCookieSync(cookieOrStr, uri, options || {})\n}\nRequestJar.prototype.getCookieString = function (uri) {\n var self = this\n return self._jar.getCookieStringSync(uri)\n}\nRequestJar.prototype.getCookies = function (uri) {\n var self = this\n return self._jar.getCookiesSync(uri)\n}\n\nexports.jar = function (store) {\n return new RequestJar(store)\n}\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/cookies.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/getProxyFromURI.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/request/lib/getProxyFromURI.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction formatHostname (hostname) {\n // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'\n return hostname.replace(/^\\.*/, '.').toLowerCase()\n}\n\nfunction parseNoProxyZone (zone) {\n zone = zone.trim().toLowerCase()\n\n var zoneParts = zone.split(':', 2)\n var zoneHost = formatHostname(zoneParts[0])\n var zonePort = zoneParts[1]\n var hasPort = zone.indexOf(':') > -1\n\n return {hostname: zoneHost, port: zonePort, hasPort: hasPort}\n}\n\nfunction uriInNoProxy (uri, noProxy) {\n var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')\n var hostname = formatHostname(uri.hostname)\n var noProxyList = noProxy.split(',')\n\n // iterate through the noProxyList until it finds a match.\n return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {\n var isMatchedAt = hostname.indexOf(noProxyZone.hostname)\n var hostnameMatched = (\n isMatchedAt > -1 &&\n (isMatchedAt === hostname.length - noProxyZone.hostname.length)\n )\n\n if (noProxyZone.hasPort) {\n return (port === noProxyZone.port) && hostnameMatched\n }\n\n return hostnameMatched\n })\n}\n\nfunction getProxyFromURI (uri) {\n // Decide the proper request proxy to use based on the request URI object and the\n // environmental variables (NO_PROXY, HTTP_PROXY, etc.)\n // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)\n\n var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''\n\n // if the noProxy is a wildcard then return null\n\n if (noProxy === '*') {\n return null\n }\n\n // if the noProxy is not empty and the uri is found return null\n\n if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {\n return null\n }\n\n // Check for HTTP or HTTPS Proxy in environment Else default to null\n\n if (uri.protocol === 'http:') {\n return process.env.HTTP_PROXY ||\n process.env.http_proxy || null\n }\n\n if (uri.protocol === 'https:') {\n return process.env.HTTPS_PROXY ||\n process.env.https_proxy ||\n process.env.HTTP_PROXY ||\n process.env.http_proxy || null\n }\n\n // if none of that works, return null\n // (What uri protocol are you using then?)\n\n return null\n}\n\nmodule.exports = getProxyFromURI\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/request/lib/getProxyFromURI.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/har.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/request/lib/har.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\")\nvar qs = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\")\nvar validate = __webpack_require__(/*! har-validator */ \"./node_modules/har-validator/lib/promise.js\")\nvar extend = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\")\n\nfunction Har (request) {\n this.request = request\n}\n\nHar.prototype.reducer = function (obj, pair) {\n // new property ?\n if (obj[pair.name] === undefined) {\n obj[pair.name] = pair.value\n return obj\n }\n\n // existing? convert to array\n var arr = [\n obj[pair.name],\n pair.value\n ]\n\n obj[pair.name] = arr\n\n return obj\n}\n\nHar.prototype.prep = function (data) {\n // construct utility properties\n data.queryObj = {}\n data.headersObj = {}\n data.postData.jsonObj = false\n data.postData.paramsObj = false\n\n // construct query objects\n if (data.queryString && data.queryString.length) {\n data.queryObj = data.queryString.reduce(this.reducer, {})\n }\n\n // construct headers objects\n if (data.headers && data.headers.length) {\n // loweCase header keys\n data.headersObj = data.headers.reduceRight(function (headers, header) {\n headers[header.name] = header.value\n return headers\n }, {})\n }\n\n // construct Cookie header\n if (data.cookies && data.cookies.length) {\n var cookies = data.cookies.map(function (cookie) {\n return cookie.name + '=' + cookie.value\n })\n\n if (cookies.length) {\n data.headersObj.cookie = cookies.join('; ')\n }\n }\n\n // prep body\n function some (arr) {\n return arr.some(function (type) {\n return data.postData.mimeType.indexOf(type) === 0\n })\n }\n\n if (some([\n 'multipart/mixed',\n 'multipart/related',\n 'multipart/form-data',\n 'multipart/alternative'])) {\n // reset values\n data.postData.mimeType = 'multipart/form-data'\n } else if (some([\n 'application/x-www-form-urlencoded'])) {\n if (!data.postData.params) {\n data.postData.text = ''\n } else {\n data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})\n\n // always overwrite\n data.postData.text = qs.stringify(data.postData.paramsObj)\n }\n } else if (some([\n 'text/json',\n 'text/x-json',\n 'application/json',\n 'application/x-json'])) {\n data.postData.mimeType = 'application/json'\n\n if (data.postData.text) {\n try {\n data.postData.jsonObj = JSON.parse(data.postData.text)\n } catch (e) {\n this.request.debug(e)\n\n // force back to text/plain\n data.postData.mimeType = 'text/plain'\n }\n }\n }\n\n return data\n}\n\nHar.prototype.options = function (options) {\n // skip if no har property defined\n if (!options.har) {\n return options\n }\n\n var har = {}\n extend(har, options.har)\n\n // only process the first entry\n if (har.log && har.log.entries) {\n har = har.log.entries[0]\n }\n\n // add optional properties to make validation successful\n har.url = har.url || options.url || options.uri || options.baseUrl || '/'\n har.httpVersion = har.httpVersion || 'HTTP/1.1'\n har.queryString = har.queryString || []\n har.headers = har.headers || []\n har.cookies = har.cookies || []\n har.postData = har.postData || {}\n har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'\n\n har.bodySize = 0\n har.headersSize = 0\n har.postData.size = 0\n\n if (!validate.request(har)) {\n return options\n }\n\n // clean up and get some utility properties\n var req = this.prep(har)\n\n // construct new options\n if (req.url) {\n options.url = req.url\n }\n\n if (req.method) {\n options.method = req.method\n }\n\n if (Object.keys(req.queryObj).length) {\n options.qs = req.queryObj\n }\n\n if (Object.keys(req.headersObj).length) {\n options.headers = req.headersObj\n }\n\n function test (type) {\n return req.postData.mimeType.indexOf(type) === 0\n }\n if (test('application/x-www-form-urlencoded')) {\n options.form = req.postData.paramsObj\n } else if (test('application/json')) {\n if (req.postData.jsonObj) {\n options.body = req.postData.jsonObj\n options.json = true\n }\n } else if (test('multipart/form-data')) {\n options.formData = {}\n\n req.postData.params.forEach(function (param) {\n var attachment = {}\n\n if (!param.fileName && !param.fileName && !param.contentType) {\n options.formData[param.name] = param.value\n return\n }\n\n // attempt to read from disk!\n if (param.fileName && !param.value) {\n attachment.value = fs.createReadStream(param.fileName)\n } else if (param.value) {\n attachment.value = param.value\n }\n\n if (param.fileName) {\n attachment.options = {\n filename: param.fileName,\n contentType: param.contentType ? param.contentType : null\n }\n }\n\n options.formData[param.name] = attachment\n })\n } else {\n if (req.postData.text) {\n options.body = req.postData.text\n }\n }\n\n return options\n}\n\nexports.Har = Har\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/har.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/hawk.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/request/lib/hawk.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\")\n\nfunction randomString (size) {\n var bits = (size + 1) * 6\n var buffer = crypto.randomBytes(Math.ceil(bits / 8))\n var string = buffer.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '')\n return string.slice(0, size)\n}\n\nfunction calculatePayloadHash (payload, algorithm, contentType) {\n var hash = crypto.createHash(algorithm)\n hash.update('hawk.1.payload\\n')\n hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\\n')\n hash.update(payload || '')\n hash.update('\\n')\n return hash.digest('base64')\n}\n\nexports.calculateMac = function (credentials, opts) {\n var normalized = 'hawk.1.header\\n' +\n opts.ts + '\\n' +\n opts.nonce + '\\n' +\n (opts.method || '').toUpperCase() + '\\n' +\n opts.resource + '\\n' +\n opts.host.toLowerCase() + '\\n' +\n opts.port + '\\n' +\n (opts.hash || '') + '\\n'\n\n if (opts.ext) {\n normalized = normalized + opts.ext.replace('\\\\', '\\\\\\\\').replace('\\n', '\\\\n')\n }\n\n normalized = normalized + '\\n'\n\n if (opts.app) {\n normalized = normalized + opts.app + '\\n' + (opts.dlg || '') + '\\n'\n }\n\n var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)\n var digest = hmac.digest('base64')\n return digest\n}\n\nexports.header = function (uri, method, opts) {\n var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)\n var credentials = opts.credentials\n if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {\n return ''\n }\n\n if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {\n return ''\n }\n\n var artifacts = {\n ts: timestamp,\n nonce: opts.nonce || randomString(6),\n method: method,\n resource: uri.pathname + (uri.search || ''),\n host: uri.hostname,\n port: uri.port || (uri.protocol === 'http:' ? 80 : 443),\n hash: opts.hash,\n ext: opts.ext,\n app: opts.app,\n dlg: opts.dlg\n }\n\n if (!artifacts.hash && (opts.payload || opts.payload === '')) {\n artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)\n }\n\n var mac = exports.calculateMac(credentials, artifacts)\n\n var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''\n var header = 'Hawk id=\"' + credentials.id +\n '\", ts=\"' + artifacts.ts +\n '\", nonce=\"' + artifacts.nonce +\n (artifacts.hash ? '\", hash=\"' + artifacts.hash : '') +\n (hasExt ? '\", ext=\"' + artifacts.ext.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') : '') +\n '\", mac=\"' + mac + '\"'\n\n if (artifacts.app) {\n header = header + ', app=\"' + artifacts.app + (artifacts.dlg ? '\", dlg=\"' + artifacts.dlg : '') + '\"'\n }\n\n return header\n}\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/hawk.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/helpers.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/request/lib/helpers.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar jsonSafeStringify = __webpack_require__(/*! json-stringify-safe */ \"./node_modules/json-stringify-safe/stringify.js\")\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar defer = typeof setImmediate === 'undefined'\n ? process.nextTick\n : setImmediate\n\nfunction paramsHaveRequestBody (params) {\n return (\n params.body ||\n params.requestBodyStream ||\n (params.json && typeof params.json !== 'boolean') ||\n params.multipart\n )\n}\n\nfunction safeStringify (obj, replacer) {\n var ret\n try {\n ret = JSON.stringify(obj, replacer)\n } catch (e) {\n ret = jsonSafeStringify(obj, replacer)\n }\n return ret\n}\n\nfunction md5 (str) {\n return crypto.createHash('md5').update(str).digest('hex')\n}\n\nfunction isReadStream (rs) {\n return rs.readable && rs.path && rs.mode\n}\n\nfunction toBase64 (str) {\n return Buffer.from(str || '', 'utf8').toString('base64')\n}\n\nfunction copy (obj) {\n var o = {}\n Object.keys(obj).forEach(function (i) {\n o[i] = obj[i]\n })\n return o\n}\n\nfunction version () {\n var numbers = process.version.replace('v', '').split('.')\n return {\n major: parseInt(numbers[0], 10),\n minor: parseInt(numbers[1], 10),\n patch: parseInt(numbers[2], 10)\n }\n}\n\nexports.paramsHaveRequestBody = paramsHaveRequestBody\nexports.safeStringify = safeStringify\nexports.md5 = md5\nexports.isReadStream = isReadStream\nexports.toBase64 = toBase64\nexports.copy = copy\nexports.version = version\nexports.defer = defer\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/request/lib/helpers.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/multipart.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/request/lib/multipart.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar uuid = __webpack_require__(/*! uuid/v4 */ \"./node_modules/uuid/v4.js\")\nvar CombinedStream = __webpack_require__(/*! combined-stream */ \"./node_modules/combined-stream/lib/combined_stream.js\")\nvar isstream = __webpack_require__(/*! isstream */ \"./node_modules/isstream/isstream.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nfunction Multipart (request) {\n this.request = request\n this.boundary = uuid()\n this.chunked = false\n this.body = null\n}\n\nMultipart.prototype.isChunked = function (options) {\n var self = this\n var chunked = false\n var parts = options.data || options\n\n if (!parts.forEach) {\n self.request.emit('error', new Error('Argument error, options.multipart.'))\n }\n\n if (options.chunked !== undefined) {\n chunked = options.chunked\n }\n\n if (self.request.getHeader('transfer-encoding') === 'chunked') {\n chunked = true\n }\n\n if (!chunked) {\n parts.forEach(function (part) {\n if (typeof part.body === 'undefined') {\n self.request.emit('error', new Error('Body attribute missing in multipart.'))\n }\n if (isstream(part.body)) {\n chunked = true\n }\n })\n }\n\n return chunked\n}\n\nMultipart.prototype.setHeaders = function (chunked) {\n var self = this\n\n if (chunked && !self.request.hasHeader('transfer-encoding')) {\n self.request.setHeader('transfer-encoding', 'chunked')\n }\n\n var header = self.request.getHeader('content-type')\n\n if (!header || header.indexOf('multipart') === -1) {\n self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)\n } else {\n if (header.indexOf('boundary') !== -1) {\n self.boundary = header.replace(/.*boundary=([^\\s;]+).*/, '$1')\n } else {\n self.request.setHeader('content-type', header + '; boundary=' + self.boundary)\n }\n }\n}\n\nMultipart.prototype.build = function (parts, chunked) {\n var self = this\n var body = chunked ? new CombinedStream() : []\n\n function add (part) {\n if (typeof part === 'number') {\n part = part.toString()\n }\n return chunked ? body.append(part) : body.push(Buffer.from(part))\n }\n\n if (self.request.preambleCRLF) {\n add('\\r\\n')\n }\n\n parts.forEach(function (part) {\n var preamble = '--' + self.boundary + '\\r\\n'\n Object.keys(part).forEach(function (key) {\n if (key === 'body') { return }\n preamble += key + ': ' + part[key] + '\\r\\n'\n })\n preamble += '\\r\\n'\n add(preamble)\n add(part.body)\n add('\\r\\n')\n })\n add('--' + self.boundary + '--')\n\n if (self.request.postambleCRLF) {\n add('\\r\\n')\n }\n\n return body\n}\n\nMultipart.prototype.onRequest = function (options) {\n var self = this\n\n var chunked = self.isChunked(options)\n var parts = options.data || options\n\n self.setHeaders(chunked)\n self.chunked = chunked\n self.body = self.build(parts, chunked)\n}\n\nexports.Multipart = Multipart\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/multipart.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/oauth.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/request/lib/oauth.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/request/node_modules/qs/lib/index.js\")\nvar caseless = __webpack_require__(/*! caseless */ \"./node_modules/caseless/index.js\")\nvar uuid = __webpack_require__(/*! uuid/v4 */ \"./node_modules/uuid/v4.js\")\nvar oauth = __webpack_require__(/*! oauth-sign */ \"./node_modules/oauth-sign/index.js\")\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nfunction OAuth (request) {\n this.request = request\n this.params = null\n}\n\nOAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {\n var oa = {}\n for (var i in _oauth) {\n oa['oauth_' + i] = _oauth[i]\n }\n if (!oa.oauth_version) {\n oa.oauth_version = '1.0'\n }\n if (!oa.oauth_timestamp) {\n oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()\n }\n if (!oa.oauth_nonce) {\n oa.oauth_nonce = uuid().replace(/-/g, '')\n }\n if (!oa.oauth_signature_method) {\n oa.oauth_signature_method = 'HMAC-SHA1'\n }\n\n var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase\n delete oa.oauth_consumer_secret\n delete oa.oauth_private_key\n\n var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase\n delete oa.oauth_token_secret\n\n var realm = oa.oauth_realm\n delete oa.oauth_realm\n delete oa.oauth_transport_method\n\n var baseurl = uri.protocol + '//' + uri.host + uri.pathname\n var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))\n\n oa.oauth_signature = oauth.sign(\n oa.oauth_signature_method,\n method,\n baseurl,\n params,\n consumer_secret_or_private_key, // eslint-disable-line camelcase\n token_secret // eslint-disable-line camelcase\n )\n\n if (realm) {\n oa.realm = realm\n }\n\n return oa\n}\n\nOAuth.prototype.buildBodyHash = function (_oauth, body) {\n if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {\n this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +\n ' signature_method not supported with body_hash signing.'))\n }\n\n var shasum = crypto.createHash('sha1')\n shasum.update(body || '')\n var sha1 = shasum.digest('hex')\n\n return Buffer.from(sha1, 'hex').toString('base64')\n}\n\nOAuth.prototype.concatParams = function (oa, sep, wrap) {\n wrap = wrap || ''\n\n var params = Object.keys(oa).filter(function (i) {\n return i !== 'realm' && i !== 'oauth_signature'\n }).sort()\n\n if (oa.realm) {\n params.splice(0, 0, 'realm')\n }\n params.push('oauth_signature')\n\n return params.map(function (i) {\n return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap\n }).join(sep)\n}\n\nOAuth.prototype.onRequest = function (_oauth) {\n var self = this\n self.params = _oauth\n\n var uri = self.request.uri || {}\n var method = self.request.method || ''\n var headers = caseless(self.request.headers)\n var body = self.request.body || ''\n var qsLib = self.request.qsLib || qs\n\n var form\n var query\n var contentType = headers.get('content-type') || ''\n var formContentType = 'application/x-www-form-urlencoded'\n var transport = _oauth.transport_method || 'header'\n\n if (contentType.slice(0, formContentType.length) === formContentType) {\n contentType = formContentType\n form = body\n }\n if (uri.query) {\n query = uri.query\n }\n if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {\n self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +\n 'and content-type ' + formContentType))\n }\n\n if (!form && typeof _oauth.body_hash === 'boolean') {\n _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())\n }\n\n var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)\n\n switch (transport) {\n case 'header':\n self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '\"'))\n break\n\n case 'query':\n var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')\n self.request.uri = url.parse(href)\n self.request.path = self.request.uri.path\n break\n\n case 'body':\n self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')\n break\n\n default:\n self.request.emit('error', new Error('oauth: transport_method invalid'))\n }\n}\n\nexports.OAuth = OAuth\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/oauth.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/querystring.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/request/lib/querystring.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/request/node_modules/qs/lib/index.js\")\nvar querystring = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\")\n\nfunction Querystring (request) {\n this.request = request\n this.lib = null\n this.useQuerystring = null\n this.parseOptions = null\n this.stringifyOptions = null\n}\n\nQuerystring.prototype.init = function (options) {\n if (this.lib) { return }\n\n this.useQuerystring = options.useQuerystring\n this.lib = (this.useQuerystring ? querystring : qs)\n\n this.parseOptions = options.qsParseOptions || {}\n this.stringifyOptions = options.qsStringifyOptions || {}\n}\n\nQuerystring.prototype.stringify = function (obj) {\n return (this.useQuerystring)\n ? this.rfc3986(this.lib.stringify(obj,\n this.stringifyOptions.sep || null,\n this.stringifyOptions.eq || null,\n this.stringifyOptions))\n : this.lib.stringify(obj, this.stringifyOptions)\n}\n\nQuerystring.prototype.parse = function (str) {\n return (this.useQuerystring)\n ? this.lib.parse(str,\n this.parseOptions.sep || null,\n this.parseOptions.eq || null,\n this.parseOptions)\n : this.lib.parse(str, this.parseOptions)\n}\n\nQuerystring.prototype.rfc3986 = function (str) {\n return str.replace(/[!'()*]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\nQuerystring.prototype.unescape = querystring.unescape\n\nexports.Querystring = Querystring\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/querystring.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/redirect.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/request/lib/redirect.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\nvar isUrl = /^https?:/\n\nfunction Redirect (request) {\n this.request = request\n this.followRedirect = true\n this.followRedirects = true\n this.followAllRedirects = false\n this.followOriginalHttpMethod = false\n this.allowRedirect = function () { return true }\n this.maxRedirects = 10\n this.redirects = []\n this.redirectsFollowed = 0\n this.removeRefererHeader = false\n}\n\nRedirect.prototype.onRequest = function (options) {\n var self = this\n\n if (options.maxRedirects !== undefined) {\n self.maxRedirects = options.maxRedirects\n }\n if (typeof options.followRedirect === 'function') {\n self.allowRedirect = options.followRedirect\n }\n if (options.followRedirect !== undefined) {\n self.followRedirects = !!options.followRedirect\n }\n if (options.followAllRedirects !== undefined) {\n self.followAllRedirects = options.followAllRedirects\n }\n if (self.followRedirects || self.followAllRedirects) {\n self.redirects = self.redirects || []\n }\n if (options.removeRefererHeader !== undefined) {\n self.removeRefererHeader = options.removeRefererHeader\n }\n if (options.followOriginalHttpMethod !== undefined) {\n self.followOriginalHttpMethod = options.followOriginalHttpMethod\n }\n}\n\nRedirect.prototype.redirectTo = function (response) {\n var self = this\n var request = self.request\n\n var redirectTo = null\n if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {\n var location = response.caseless.get('location')\n request.debug('redirect', location)\n\n if (self.followAllRedirects) {\n redirectTo = location\n } else if (self.followRedirects) {\n switch (request.method) {\n case 'PATCH':\n case 'PUT':\n case 'POST':\n case 'DELETE':\n // Do not follow redirects\n break\n default:\n redirectTo = location\n break\n }\n }\n } else if (response.statusCode === 401) {\n var authHeader = request._auth.onResponse(response)\n if (authHeader) {\n request.setHeader('authorization', authHeader)\n redirectTo = request.uri\n }\n }\n return redirectTo\n}\n\nRedirect.prototype.onResponse = function (response) {\n var self = this\n var request = self.request\n\n var redirectTo = self.redirectTo(response)\n if (!redirectTo || !self.allowRedirect.call(request, response)) {\n return false\n }\n\n request.debug('redirect to', redirectTo)\n\n // ignore any potential response body. it cannot possibly be useful\n // to us at this point.\n // response.resume should be defined, but check anyway before calling. Workaround for browserify.\n if (response.resume) {\n response.resume()\n }\n\n if (self.redirectsFollowed >= self.maxRedirects) {\n request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))\n return false\n }\n self.redirectsFollowed += 1\n\n if (!isUrl.test(redirectTo)) {\n redirectTo = url.resolve(request.uri.href, redirectTo)\n }\n\n var uriPrev = request.uri\n request.uri = url.parse(redirectTo)\n\n // handle the case where we change protocol from https to http or vice versa\n if (request.uri.protocol !== uriPrev.protocol) {\n delete request.agent\n }\n\n self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })\n\n if (self.followAllRedirects && request.method !== 'HEAD' &&\n response.statusCode !== 401 && response.statusCode !== 307) {\n request.method = self.followOriginalHttpMethod ? request.method : 'GET'\n }\n // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215\n delete request.src\n delete request.req\n delete request._started\n if (response.statusCode !== 401 && response.statusCode !== 307) {\n // Remove parameters from the previous response, unless this is the second request\n // for a server that requires digest authentication.\n delete request.body\n delete request._form\n if (request.headers) {\n request.removeHeader('host')\n request.removeHeader('content-type')\n request.removeHeader('content-length')\n if (request.uri.hostname !== request.originalHost.split(':')[0]) {\n // Remove authorization if changing hostnames (but not if just\n // changing ports or protocols). This matches the behavior of curl:\n // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710\n request.removeHeader('authorization')\n }\n }\n }\n\n if (!self.removeRefererHeader) {\n request.setHeader('referer', uriPrev.href)\n }\n\n request.emit('redirect')\n\n request.init()\n\n return true\n}\n\nexports.Redirect = Redirect\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/redirect.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/lib/tunnel.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/request/lib/tunnel.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\nvar tunnel = __webpack_require__(/*! tunnel-agent */ \"./node_modules/tunnel-agent/index.js\")\n\nvar defaultProxyHeaderWhiteList = [\n 'accept',\n 'accept-charset',\n 'accept-encoding',\n 'accept-language',\n 'accept-ranges',\n 'cache-control',\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-md5',\n 'content-range',\n 'content-type',\n 'connection',\n 'date',\n 'expect',\n 'max-forwards',\n 'pragma',\n 'referer',\n 'te',\n 'user-agent',\n 'via'\n]\n\nvar defaultProxyHeaderExclusiveList = [\n 'proxy-authorization'\n]\n\nfunction constructProxyHost (uriObject) {\n var port = uriObject.port\n var protocol = uriObject.protocol\n var proxyHost = uriObject.hostname + ':'\n\n if (port) {\n proxyHost += port\n } else if (protocol === 'https:') {\n proxyHost += '443'\n } else {\n proxyHost += '80'\n }\n\n return proxyHost\n}\n\nfunction constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {\n var whiteList = proxyHeaderWhiteList\n .reduce(function (set, header) {\n set[header.toLowerCase()] = true\n return set\n }, {})\n\n return Object.keys(headers)\n .filter(function (header) {\n return whiteList[header.toLowerCase()]\n })\n .reduce(function (set, header) {\n set[header] = headers[header]\n return set\n }, {})\n}\n\nfunction constructTunnelOptions (request, proxyHeaders) {\n var proxy = request.proxy\n\n var tunnelOptions = {\n proxy: {\n host: proxy.hostname,\n port: +proxy.port,\n proxyAuth: proxy.auth,\n headers: proxyHeaders\n },\n headers: request.headers,\n ca: request.ca,\n cert: request.cert,\n key: request.key,\n passphrase: request.passphrase,\n pfx: request.pfx,\n ciphers: request.ciphers,\n rejectUnauthorized: request.rejectUnauthorized,\n secureOptions: request.secureOptions,\n secureProtocol: request.secureProtocol\n }\n\n return tunnelOptions\n}\n\nfunction constructTunnelFnName (uri, proxy) {\n var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')\n var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')\n return [uriProtocol, proxyProtocol].join('Over')\n}\n\nfunction getTunnelFn (request) {\n var uri = request.uri\n var proxy = request.proxy\n var tunnelFnName = constructTunnelFnName(uri, proxy)\n return tunnel[tunnelFnName]\n}\n\nfunction Tunnel (request) {\n this.request = request\n this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList\n this.proxyHeaderExclusiveList = []\n if (typeof request.tunnel !== 'undefined') {\n this.tunnelOverride = request.tunnel\n }\n}\n\nTunnel.prototype.isEnabled = function () {\n var self = this\n var request = self.request\n // Tunnel HTTPS by default. Allow the user to override this setting.\n\n // If self.tunnelOverride is set (the user specified a value), use it.\n if (typeof self.tunnelOverride !== 'undefined') {\n return self.tunnelOverride\n }\n\n // If the destination is HTTPS, tunnel.\n if (request.uri.protocol === 'https:') {\n return true\n }\n\n // Otherwise, do not use tunnel.\n return false\n}\n\nTunnel.prototype.setup = function (options) {\n var self = this\n var request = self.request\n\n options = options || {}\n\n if (typeof request.proxy === 'string') {\n request.proxy = url.parse(request.proxy)\n }\n\n if (!request.proxy || !request.tunnel) {\n return false\n }\n\n // Setup Proxy Header Exclusive List and White List\n if (options.proxyHeaderWhiteList) {\n self.proxyHeaderWhiteList = options.proxyHeaderWhiteList\n }\n if (options.proxyHeaderExclusiveList) {\n self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList\n }\n\n var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)\n var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)\n\n // Setup Proxy Headers and Proxy Headers Host\n // Only send the Proxy White Listed Header names\n var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)\n proxyHeaders.host = constructProxyHost(request.uri)\n\n proxyHeaderExclusiveList.forEach(request.removeHeader, request)\n\n // Set Agent from Tunnel Data\n var tunnelFn = getTunnelFn(request)\n var tunnelOptions = constructTunnelOptions(request, proxyHeaders)\n request.agent = tunnelFn(tunnelOptions)\n\n return true\n}\n\nTunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList\nTunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList\nexports.Tunnel = Tunnel\n\n\n//# sourceURL=webpack:///./node_modules/request/lib/tunnel.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/qs/lib/formats.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/qs/lib/formats.js ***!
|
||
\*************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nmodule.exports = {\n 'default': 'RFC3986',\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return value;\n }\n },\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/qs/lib/formats.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/qs/lib/index.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/request/node_modules/qs/lib/index.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar stringify = __webpack_require__(/*! ./stringify */ \"./node_modules/request/node_modules/qs/lib/stringify.js\");\nvar parse = __webpack_require__(/*! ./parse */ \"./node_modules/request/node_modules/qs/lib/parse.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"./node_modules/request/node_modules/qs/lib/formats.js\");\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/qs/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/qs/lib/parse.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/request/node_modules/qs/lib/parse.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/request/node_modules/qs/lib/utils.js\");\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n parameterLimit: 1000,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n\n for (var i = 0; i < parts.length; ++i) {\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder);\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder);\n val = options.decoder(part.slice(pos + 1), defaults.decoder);\n }\n if (has.call(obj, key)) {\n obj[key] = [].concat(obj[key]).concat(val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options) {\n var leaf = val;\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]') {\n obj = [];\n obj = obj.concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys\n // that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while ((segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options);\n};\n\nmodule.exports = function (str, opts) {\n var options = opts ? utils.assign({}, opts) : {};\n\n if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;\n options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;\n options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;\n options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;\n options.parseArrays = options.parseArrays !== false;\n options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;\n options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;\n options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;\n options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;\n options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;\n options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options);\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/qs/lib/parse.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/qs/lib/stringify.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/qs/lib/stringify.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/request/node_modules/qs/lib/utils.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"./node_modules/request/node_modules/qs/lib/formats.js\");\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) { // eslint-disable-line func-name-matching\n return prefix + '[]';\n },\n indices: function indices(prefix, key) { // eslint-disable-line func-name-matching\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) { // eslint-disable-line func-name-matching\n return prefix;\n }\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaults = {\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar stringify = function stringify( // eslint-disable-line func-name-matching\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;\n }\n\n obj = '';\n }\n\n if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (Array.isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n if (Array.isArray(obj)) {\n values = values.concat(stringify(\n obj[key],\n generateArrayPrefix(prefix, key),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n } else {\n values = values.concat(stringify(\n obj[key],\n prefix + (allowDots ? '.' + key : '[' + key + ']'),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n }\n }\n\n return values;\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = opts ? utils.assign({}, opts) : {};\n\n if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;\n var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;\n var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;\n var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;\n var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;\n var sort = typeof options.sort === 'function' ? options.sort : null;\n var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;\n var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;\n var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;\n if (typeof options.format === 'undefined') {\n options.format = formats['default'];\n } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n var formatter = formats.formatters[options.format];\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (Array.isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (options.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = options.arrayFormat;\n } else if ('indices' in options) {\n arrayFormat = options.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (sort) {\n objKeys.sort(sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n keys = keys.concat(stringify(\n obj[key],\n key,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encode ? encoder : null,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n }\n\n var joined = keys.join(delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n return joined.length > 0 ? prefix + joined : '';\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/qs/lib/stringify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/qs/lib/utils.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/request/node_modules/qs/lib/utils.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n var obj;\n\n while (queue.length) {\n var item = queue.pop();\n obj = item.obj[item.prop];\n\n if (Array.isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n\n return obj;\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (Array.isArray(target)) {\n target.push(source);\n } else if (typeof target === 'object') {\n if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (Array.isArray(target) && !Array.isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (Array.isArray(target) && Array.isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n if (target[i] && typeof target[i] === 'object') {\n target[i] = merge(target[i], item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str) {\n try {\n return decodeURIComponent(str.replace(/\\+/g, ' '));\n } catch (e) {\n return str;\n }\n};\n\nvar encode = function encode(str) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = typeof str === 'string' ? str : String(str);\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n return compactQueue(queue);\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (obj === null || typeof obj === 'undefined') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n merge: merge\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/qs/lib/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/lib/cookie.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/lib/cookie.js ***!
|
||
\**********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar net = __webpack_require__(/*! net */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar urlParse = __webpack_require__(/*! url */ \"./node_modules/url/url.js\").parse;\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js\");\nvar Store = __webpack_require__(/*! ./store */ \"./node_modules/request/node_modules/tough-cookie/lib/store.js\").Store;\nvar MemoryCookieStore = __webpack_require__(/*! ./memstore */ \"./node_modules/request/node_modules/tough-cookie/lib/memstore.js\").MemoryCookieStore;\nvar pathMatch = __webpack_require__(/*! ./pathMatch */ \"./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js\").pathMatch;\nvar VERSION = __webpack_require__(/*! ../package.json */ \"./node_modules/request/node_modules/tough-cookie/package.json\").version;\n\nvar punycode;\ntry {\n punycode = __webpack_require__(/*! punycode */ \"./node_modules/punycode/punycode.js\");\n} catch(e) {\n console.warn(\"tough-cookie: can't load punycode; won't use punycode for domain normalization\");\n}\n\n// From RFC6265 S4.1.1\n// note that it excludes \\x3B \";\"\nvar COOKIE_OCTETS = /^[\\x21\\x23-\\x2B\\x2D-\\x3A\\x3C-\\x5B\\x5D-\\x7E]+$/;\n\nvar CONTROL_CHARS = /[\\x00-\\x1F]/;\n\n// From Chromium // '\\r', '\\n' and '\\0' should be treated as a terminator in\n// the \"relaxed\" mode, see:\n// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60\nvar TERMINATORS = ['\\n', '\\r', '\\0'];\n\n// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or \";\"'\n// Note ';' is \\x3B\nvar PATH_VALUE = /[\\x20-\\x3A\\x3C-\\x7E]+/;\n\n// date-time parsing constants (RFC6265 S5.1.1)\n\nvar DATE_DELIM = /[\\x09\\x20-\\x2F\\x3B-\\x40\\x5B-\\x60\\x7B-\\x7E]/;\n\nvar MONTH_TO_NUM = {\n jan:0, feb:1, mar:2, apr:3, may:4, jun:5,\n jul:6, aug:7, sep:8, oct:9, nov:10, dec:11\n};\nvar NUM_TO_MONTH = [\n 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'\n];\nvar NUM_TO_DAY = [\n 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'\n];\n\nvar MAX_TIME = 2147483647000; // 31-bit max\nvar MIN_TIME = 0; // 31-bit min\n\n/*\n * Parses a Natural number (i.e., non-negative integer) with either the\n * <min>*<max>DIGIT ( non-digit *OCTET )\n * or\n * <min>*<max>DIGIT\n * grammar (RFC6265 S5.1.1).\n *\n * The \"trailingOK\" boolean controls if the grammar accepts a\n * \"( non-digit *OCTET )\" trailer.\n */\nfunction parseDigits(token, minDigits, maxDigits, trailingOK) {\n var count = 0;\n while (count < token.length) {\n var c = token.charCodeAt(count);\n // \"non-digit = %x00-2F / %x3A-FF\"\n if (c <= 0x2F || c >= 0x3A) {\n break;\n }\n count++;\n }\n\n // constrain to a minimum and maximum number of digits.\n if (count < minDigits || count > maxDigits) {\n return null;\n }\n\n if (!trailingOK && count != token.length) {\n return null;\n }\n\n return parseInt(token.substr(0,count), 10);\n}\n\nfunction parseTime(token) {\n var parts = token.split(':');\n var result = [0,0,0];\n\n /* RF6256 S5.1.1:\n * time = hms-time ( non-digit *OCTET )\n * hms-time = time-field \":\" time-field \":\" time-field\n * time-field = 1*2DIGIT\n */\n\n if (parts.length !== 3) {\n return null;\n }\n\n for (var i = 0; i < 3; i++) {\n // \"time-field\" must be strictly \"1*2DIGIT\", HOWEVER, \"hms-time\" can be\n // followed by \"( non-digit *OCTET )\" so therefore the last time-field can\n // have a trailer\n var trailingOK = (i == 2);\n var num = parseDigits(parts[i], 1, 2, trailingOK);\n if (num === null) {\n return null;\n }\n result[i] = num;\n }\n\n return result;\n}\n\nfunction parseMonth(token) {\n token = String(token).substr(0,3).toLowerCase();\n var num = MONTH_TO_NUM[token];\n return num >= 0 ? num : null;\n}\n\n/*\n * RFC6265 S5.1.1 date parser (see RFC for full grammar)\n */\nfunction parseDate(str) {\n if (!str) {\n return;\n }\n\n /* RFC6265 S5.1.1:\n * 2. Process each date-token sequentially in the order the date-tokens\n * appear in the cookie-date\n */\n var tokens = str.split(DATE_DELIM);\n if (!tokens) {\n return;\n }\n\n var hour = null;\n var minute = null;\n var second = null;\n var dayOfMonth = null;\n var month = null;\n var year = null;\n\n for (var i=0; i<tokens.length; i++) {\n var token = tokens[i].trim();\n if (!token.length) {\n continue;\n }\n\n var result;\n\n /* 2.1. If the found-time flag is not set and the token matches the time\n * production, set the found-time flag and set the hour- value,\n * minute-value, and second-value to the numbers denoted by the digits in\n * the date-token, respectively. Skip the remaining sub-steps and continue\n * to the next date-token.\n */\n if (second === null) {\n result = parseTime(token);\n if (result) {\n hour = result[0];\n minute = result[1];\n second = result[2];\n continue;\n }\n }\n\n /* 2.2. If the found-day-of-month flag is not set and the date-token matches\n * the day-of-month production, set the found-day-of- month flag and set\n * the day-of-month-value to the number denoted by the date-token. Skip\n * the remaining sub-steps and continue to the next date-token.\n */\n if (dayOfMonth === null) {\n // \"day-of-month = 1*2DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 1, 2, true);\n if (result !== null) {\n dayOfMonth = result;\n continue;\n }\n }\n\n /* 2.3. If the found-month flag is not set and the date-token matches the\n * month production, set the found-month flag and set the month-value to\n * the month denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (month === null) {\n result = parseMonth(token);\n if (result !== null) {\n month = result;\n continue;\n }\n }\n\n /* 2.4. If the found-year flag is not set and the date-token matches the\n * year production, set the found-year flag and set the year-value to the\n * number denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (year === null) {\n // \"year = 2*4DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 2, 4, true);\n if (result !== null) {\n year = result;\n /* From S5.1.1:\n * 3. If the year-value is greater than or equal to 70 and less\n * than or equal to 99, increment the year-value by 1900.\n * 4. If the year-value is greater than or equal to 0 and less\n * than or equal to 69, increment the year-value by 2000.\n */\n if (year >= 70 && year <= 99) {\n year += 1900;\n } else if (year >= 0 && year <= 69) {\n year += 2000;\n }\n }\n }\n }\n\n /* RFC 6265 S5.1.1\n * \"5. Abort these steps and fail to parse the cookie-date if:\n * * at least one of the found-day-of-month, found-month, found-\n * year, or found-time flags is not set,\n * * the day-of-month-value is less than 1 or greater than 31,\n * * the year-value is less than 1601,\n * * the hour-value is greater than 23,\n * * the minute-value is greater than 59, or\n * * the second-value is greater than 59.\n * (Note that leap seconds cannot be represented in this syntax.)\"\n *\n * So, in order as above:\n */\n if (\n dayOfMonth === null || month === null || year === null || second === null ||\n dayOfMonth < 1 || dayOfMonth > 31 ||\n year < 1601 ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return;\n }\n\n return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));\n}\n\nfunction formatDate(date) {\n var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;\n var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;\n var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;\n var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;\n return NUM_TO_DAY[date.getUTCDay()] + ', ' +\n d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+\n h+':'+m+':'+s+' GMT';\n}\n\n// S5.1.2 Canonicalized Host Names\nfunction canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}\n\n// S5.1.3 Domain Matching\nfunction domainMatch(str, domStr, canonicalize) {\n if (str == null || domStr == null) {\n return null;\n }\n if (canonicalize !== false) {\n str = canonicalDomain(str);\n domStr = canonicalDomain(domStr);\n }\n\n /*\n * \"The domain string and the string are identical. (Note that both the\n * domain string and the string will have been canonicalized to lower case at\n * this point)\"\n */\n if (str == domStr) {\n return true;\n }\n\n /* \"All of the following [three] conditions hold:\" (order adjusted from the RFC) */\n\n /* \"* The string is a host name (i.e., not an IP address).\" */\n if (net.isIP(str)) {\n return false;\n }\n\n /* \"* The domain string is a suffix of the string\" */\n var idx = str.indexOf(domStr);\n if (idx <= 0) {\n return false; // it's a non-match (-1) or prefix (0)\n }\n\n // e.g \"a.b.c\".indexOf(\"b.c\") === 2\n // 5 === 3+2\n if (str.length !== domStr.length + idx) { // it's not a suffix\n return false;\n }\n\n /* \"* The last character of the string that is not included in the domain\n * string is a %x2E (\".\") character.\" */\n if (str.substr(idx-1,1) !== '.') {\n return false;\n }\n\n return true;\n}\n\n\n// RFC6265 S5.1.4 Paths and Path-Match\n\n/*\n * \"The user agent MUST use an algorithm equivalent to the following algorithm\n * to compute the default-path of a cookie:\"\n *\n * Assumption: the path (and not query part or absolute uri) is passed in.\n */\nfunction defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}\n\nfunction trimTerminator(str) {\n for (var t = 0; t < TERMINATORS.length; t++) {\n var terminatorIdx = str.indexOf(TERMINATORS[t]);\n if (terminatorIdx !== -1) {\n str = str.substr(0,terminatorIdx);\n }\n }\n\n return str;\n}\n\nfunction parseCookiePair(cookiePair, looseMode) {\n cookiePair = trimTerminator(cookiePair);\n\n var firstEq = cookiePair.indexOf('=');\n if (looseMode) {\n if (firstEq === 0) { // '=' is immediately at start\n cookiePair = cookiePair.substr(1);\n firstEq = cookiePair.indexOf('='); // might still need to split on '='\n }\n } else { // non-loose mode\n if (firstEq <= 0) { // no '=' or is at start\n return; // needs to have non-empty \"cookie-name\"\n }\n }\n\n var cookieName, cookieValue;\n if (firstEq <= 0) {\n cookieName = \"\";\n cookieValue = cookiePair.trim();\n } else {\n cookieName = cookiePair.substr(0, firstEq).trim();\n cookieValue = cookiePair.substr(firstEq+1).trim();\n }\n\n if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {\n return;\n }\n\n var c = new Cookie();\n c.key = cookieName;\n c.value = cookieValue;\n return c;\n}\n\nfunction parse(str, options) {\n if (!options || typeof options !== 'object') {\n options = {};\n }\n str = str.trim();\n\n // We use a regex to parse the \"name-value-pair\" part of S5.2\n var firstSemi = str.indexOf(';'); // S5.2 step 1\n var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);\n var c = parseCookiePair(cookiePair, !!options.loose);\n if (!c) {\n return;\n }\n\n if (firstSemi === -1) {\n return c;\n }\n\n // S5.2.3 \"unparsed-attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\" plus later on in the same section\n // \"discard the first \";\" and trim\".\n var unparsed = str.slice(firstSemi + 1).trim();\n\n // \"If the unparsed-attributes string is empty, skip the rest of these\n // steps.\"\n if (unparsed.length === 0) {\n return c;\n }\n\n /*\n * S5.2 says that when looping over the items \"[p]rocess the attribute-name\n * and attribute-value according to the requirements in the following\n * subsections\" for every item. Plus, for many of the individual attributes\n * in S5.3 it says to use the \"attribute-value of the last attribute in the\n * cookie-attribute-list\". Therefore, in this implementation, we overwrite\n * the previous value.\n */\n var cookie_avs = unparsed.split(';');\n while (cookie_avs.length) {\n var av = cookie_avs.shift().trim();\n if (av.length === 0) { // happens if \";;\" appears\n continue;\n }\n var av_sep = av.indexOf('=');\n var av_key, av_value;\n\n if (av_sep === -1) {\n av_key = av;\n av_value = null;\n } else {\n av_key = av.substr(0,av_sep);\n av_value = av.substr(av_sep+1);\n }\n\n av_key = av_key.trim().toLowerCase();\n\n if (av_value) {\n av_value = av_value.trim();\n }\n\n switch(av_key) {\n case 'expires': // S5.2.1\n if (av_value) {\n var exp = parseDate(av_value);\n // \"If the attribute-value failed to parse as a cookie date, ignore the\n // cookie-av.\"\n if (exp) {\n // over and underflow not realistically a concern: V8's getTime() seems to\n // store something larger than a 32-bit time_t (even with 32-bit node)\n c.expires = exp;\n }\n }\n break;\n\n case 'max-age': // S5.2.2\n if (av_value) {\n // \"If the first character of the attribute-value is not a DIGIT or a \"-\"\n // character ...[or]... If the remainder of attribute-value contains a\n // non-DIGIT character, ignore the cookie-av.\"\n if (/^-?[0-9]+$/.test(av_value)) {\n var delta = parseInt(av_value, 10);\n // \"If delta-seconds is less than or equal to zero (0), let expiry-time\n // be the earliest representable date and time.\"\n c.setMaxAge(delta);\n }\n }\n break;\n\n case 'domain': // S5.2.3\n // \"If the attribute-value is empty, the behavior is undefined. However,\n // the user agent SHOULD ignore the cookie-av entirely.\"\n if (av_value) {\n // S5.2.3 \"Let cookie-domain be the attribute-value without the leading %x2E\n // (\".\") character.\"\n var domain = av_value.trim().replace(/^\\./, '');\n if (domain) {\n // \"Convert the cookie-domain to lower case.\"\n c.domain = domain.toLowerCase();\n }\n }\n break;\n\n case 'path': // S5.2.4\n /*\n * \"If the attribute-value is empty or if the first character of the\n * attribute-value is not %x2F (\"/\"):\n * Let cookie-path be the default-path.\n * Otherwise:\n * Let cookie-path be the attribute-value.\"\n *\n * We'll represent the default-path as null since it depends on the\n * context of the parsing.\n */\n c.path = av_value && av_value[0] === \"/\" ? av_value : null;\n break;\n\n case 'secure': // S5.2.5\n /*\n * \"If the attribute-name case-insensitively matches the string \"Secure\",\n * the user agent MUST append an attribute to the cookie-attribute-list\n * with an attribute-name of Secure and an empty attribute-value.\"\n */\n c.secure = true;\n break;\n\n case 'httponly': // S5.2.6 -- effectively the same as 'secure'\n c.httpOnly = true;\n break;\n\n default:\n c.extensions = c.extensions || [];\n c.extensions.push(av);\n break;\n }\n }\n\n return c;\n}\n\n// avoid the V8 deoptimization monster!\nfunction jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}\n\nfunction fromJSON(str) {\n if (!str) {\n return null;\n }\n\n var obj;\n if (typeof str === 'string') {\n obj = jsonParse(str);\n if (obj instanceof Error) {\n return null;\n }\n } else {\n // assume it's an Object\n obj = str;\n }\n\n var c = new Cookie();\n for (var i=0; i<Cookie.serializableProperties.length; i++) {\n var prop = Cookie.serializableProperties[i];\n if (obj[prop] === undefined ||\n obj[prop] === Cookie.prototype[prop])\n {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (obj[prop] === null) {\n c[prop] = null;\n } else {\n c[prop] = obj[prop] == \"Infinity\" ?\n \"Infinity\" : new Date(obj[prop]);\n }\n } else {\n c[prop] = obj[prop];\n }\n }\n\n return c;\n}\n\n/* Section 5.4 part 2:\n * \"* Cookies with longer paths are listed before cookies with\n * shorter paths.\n *\n * * Among cookies that have equal-length path fields, cookies with\n * earlier creation-times are listed before cookies with later\n * creation-times.\"\n */\n\nfunction cookieCompare(a,b) {\n var cmp = 0;\n\n // descending for length: b CMP a\n var aPathLen = a.path ? a.path.length : 0;\n var bPathLen = b.path ? b.path.length : 0;\n cmp = bPathLen - aPathLen;\n if (cmp !== 0) {\n return cmp;\n }\n\n // ascending for time: a CMP b\n var aTime = a.creation ? a.creation.getTime() : MAX_TIME;\n var bTime = b.creation ? b.creation.getTime() : MAX_TIME;\n cmp = aTime - bTime;\n if (cmp !== 0) {\n return cmp;\n }\n\n // break ties for the same millisecond (precision of JavaScript's clock)\n cmp = a.creationIndex - b.creationIndex;\n\n return cmp;\n}\n\n// Gives the permutation of all possible pathMatch()es of a given path. The\n// array is in longest-to-shortest order. Handy for indexing.\nfunction permutePath(path) {\n if (path === '/') {\n return ['/'];\n }\n if (path.lastIndexOf('/') === path.length-1) {\n path = path.substr(0,path.length-1);\n }\n var permutations = [path];\n while (path.length > 1) {\n var lindex = path.lastIndexOf('/');\n if (lindex === 0) {\n break;\n }\n path = path.substr(0,lindex);\n permutations.push(path);\n }\n permutations.push('/');\n return permutations;\n}\n\nfunction getCookieContext(url) {\n if (url instanceof Object) {\n return url;\n }\n // NOTE: decodeURI will throw on malformed URIs (see GH-32).\n // Therefore, we will just skip decoding for such URIs.\n try {\n url = decodeURI(url);\n }\n catch(err) {\n // Silently swallow error\n }\n\n return urlParse(url);\n}\n\nfunction Cookie(options) {\n options = options || {};\n\n Object.keys(options).forEach(function(prop) {\n if (Cookie.prototype.hasOwnProperty(prop) &&\n Cookie.prototype[prop] !== options[prop] &&\n prop.substr(0,1) !== '_')\n {\n this[prop] = options[prop];\n }\n }, this);\n\n this.creation = this.creation || new Date();\n\n // used to break creation ties in cookieCompare():\n Object.defineProperty(this, 'creationIndex', {\n configurable: false,\n enumerable: false, // important for assert.deepEqual checks\n writable: true,\n value: ++Cookie.cookiesCreated\n });\n}\n\nCookie.cookiesCreated = 0; // incremented each time a cookie is created\n\nCookie.parse = parse;\nCookie.fromJSON = fromJSON;\n\nCookie.prototype.key = \"\";\nCookie.prototype.value = \"\";\n\n// the order in which the RFC has them:\nCookie.prototype.expires = \"Infinity\"; // coerces to literal Infinity\nCookie.prototype.maxAge = null; // takes precedence over expires for TTL\nCookie.prototype.domain = null;\nCookie.prototype.path = null;\nCookie.prototype.secure = false;\nCookie.prototype.httpOnly = false;\nCookie.prototype.extensions = null;\n\n// set by the CookieJar:\nCookie.prototype.hostOnly = null; // boolean when set\nCookie.prototype.pathIsDefault = null; // boolean when set\nCookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse\nCookie.prototype.lastAccessed = null; // Date when set\nObject.defineProperty(Cookie.prototype, 'creationIndex', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: 0\n});\n\nCookie.serializableProperties = Object.keys(Cookie.prototype)\n .filter(function(prop) {\n return !(\n Cookie.prototype[prop] instanceof Function ||\n prop === 'creationIndex' ||\n prop.substr(0,1) === '_'\n );\n });\n\nCookie.prototype.inspect = function inspect() {\n var now = Date.now();\n return 'Cookie=\"'+this.toString() +\n '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +\n '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +\n '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +\n '\"';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;\n}\n\nCookie.prototype.toJSON = function() {\n var obj = {};\n\n var props = Cookie.serializableProperties;\n for (var i=0; i<props.length; i++) {\n var prop = props[i];\n if (this[prop] === Cookie.prototype[prop]) {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (this[prop] === null) {\n obj[prop] = null;\n } else {\n obj[prop] = this[prop] == \"Infinity\" ? // intentionally not ===\n \"Infinity\" : this[prop].toISOString();\n }\n } else if (prop === 'maxAge') {\n if (this[prop] !== null) {\n // again, intentionally not ===\n obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?\n this[prop].toString() : this[prop];\n }\n } else {\n if (this[prop] !== Cookie.prototype[prop]) {\n obj[prop] = this[prop];\n }\n }\n }\n\n return obj;\n};\n\nCookie.prototype.clone = function() {\n return fromJSON(this.toJSON());\n};\n\nCookie.prototype.validate = function validate() {\n if (!COOKIE_OCTETS.test(this.value)) {\n return false;\n }\n if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {\n return false;\n }\n if (this.maxAge != null && this.maxAge <= 0) {\n return false; // \"Max-Age=\" non-zero-digit *DIGIT\n }\n if (this.path != null && !PATH_VALUE.test(this.path)) {\n return false;\n }\n\n var cdomain = this.cdomain();\n if (cdomain) {\n if (cdomain.match(/\\.$/)) {\n return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this\n }\n var suffix = pubsuffix.getPublicSuffix(cdomain);\n if (suffix == null) { // it's a public suffix\n return false;\n }\n }\n return true;\n};\n\nCookie.prototype.setExpires = function setExpires(exp) {\n if (exp instanceof Date) {\n this.expires = exp;\n } else {\n this.expires = parseDate(exp) || \"Infinity\";\n }\n};\n\nCookie.prototype.setMaxAge = function setMaxAge(age) {\n if (age === Infinity || age === -Infinity) {\n this.maxAge = age.toString(); // so JSON.stringify() works\n } else {\n this.maxAge = age;\n }\n};\n\n// gives Cookie header format\nCookie.prototype.cookieString = function cookieString() {\n var val = this.value;\n if (val == null) {\n val = '';\n }\n if (this.key === '') {\n return val;\n }\n return this.key+'='+val;\n};\n\n// gives Set-Cookie header format\nCookie.prototype.toString = function toString() {\n var str = this.cookieString();\n\n if (this.expires != Infinity) {\n if (this.expires instanceof Date) {\n str += '; Expires='+formatDate(this.expires);\n } else {\n str += '; Expires='+this.expires;\n }\n }\n\n if (this.maxAge != null && this.maxAge != Infinity) {\n str += '; Max-Age='+this.maxAge;\n }\n\n if (this.domain && !this.hostOnly) {\n str += '; Domain='+this.domain;\n }\n if (this.path) {\n str += '; Path='+this.path;\n }\n\n if (this.secure) {\n str += '; Secure';\n }\n if (this.httpOnly) {\n str += '; HttpOnly';\n }\n if (this.extensions) {\n this.extensions.forEach(function(ext) {\n str += '; '+ext;\n });\n }\n\n return str;\n};\n\n// TTL() partially replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\n// S5.3 says to give the \"latest representable date\" for which we use Infinity\n// For \"expired\" we use 0\nCookie.prototype.TTL = function TTL(now) {\n /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires\n * attribute, the Max-Age attribute has precedence and controls the\n * expiration date of the cookie.\n * (Concurs with S5.3 step 3)\n */\n if (this.maxAge != null) {\n return this.maxAge<=0 ? 0 : this.maxAge*1000;\n }\n\n var expires = this.expires;\n if (expires != Infinity) {\n if (!(expires instanceof Date)) {\n expires = parseDate(expires) || Infinity;\n }\n\n if (expires == Infinity) {\n return Infinity;\n }\n\n return expires.getTime() - (now || Date.now());\n }\n\n return Infinity;\n};\n\n// expiryTime() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\nCookie.prototype.expiryTime = function expiryTime(now) {\n if (this.maxAge != null) {\n var relativeTo = now || this.creation || new Date();\n var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;\n return relativeTo.getTime() + age;\n }\n\n if (this.expires == Infinity) {\n return Infinity;\n }\n return this.expires.getTime();\n};\n\n// expiryDate() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere), except it returns a Date\nCookie.prototype.expiryDate = function expiryDate(now) {\n var millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n};\n\n// This replaces the \"persistent-flag\" parts of S5.3 step 3\nCookie.prototype.isPersistent = function isPersistent() {\n return (this.maxAge != null || this.expires != Infinity);\n};\n\n// Mostly S5.1.2 and S5.2.3:\nCookie.prototype.cdomain =\nCookie.prototype.canonicalizedDomain = function canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n};\n\nfunction CookieJar(store, options) {\n if (typeof options === \"boolean\") {\n options = {rejectPublicSuffixes: options};\n } else if (options == null) {\n options = {};\n }\n if (options.rejectPublicSuffixes != null) {\n this.rejectPublicSuffixes = options.rejectPublicSuffixes;\n }\n if (options.looseMode != null) {\n this.enableLooseMode = options.looseMode;\n }\n\n if (!store) {\n store = new MemoryCookieStore();\n }\n this.store = store;\n}\nCookieJar.prototype.store = null;\nCookieJar.prototype.rejectPublicSuffixes = true;\nCookieJar.prototype.enableLooseMode = false;\nvar CAN_BE_SYNC = [];\n\nCAN_BE_SYNC.push('setCookie');\nCookieJar.prototype.setCookie = function(cookie, url, options, cb) {\n var err;\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var loose = this.enableLooseMode;\n if (options.loose != null) {\n loose = options.loose;\n }\n\n // S5.3 step 1\n if (!(cookie instanceof Cookie)) {\n cookie = Cookie.parse(cookie, { loose: loose });\n }\n if (!cookie) {\n err = new Error(\"Cookie failed to parse\");\n return cb(options.ignoreError ? null : err);\n }\n\n // S5.3 step 2\n var now = options.now || new Date(); // will assign later to save effort in the face of errors\n\n // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()\n\n // S5.3 step 4: NOOP; domain is null by default\n\n // S5.3 step 5: public suffixes\n if (this.rejectPublicSuffixes && cookie.domain) {\n var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());\n if (suffix == null) { // e.g. \"com\"\n err = new Error(\"Cookie has domain set to a public suffix\");\n return cb(options.ignoreError ? null : err);\n }\n }\n\n // S5.3 step 6:\n if (cookie.domain) {\n if (!domainMatch(host, cookie.cdomain(), false)) {\n err = new Error(\"Cookie not in this host's domain. Cookie:\"+cookie.cdomain()+\" Request:\"+host);\n return cb(options.ignoreError ? null : err);\n }\n\n if (cookie.hostOnly == null) { // don't reset if already set\n cookie.hostOnly = false;\n }\n\n } else {\n cookie.hostOnly = true;\n cookie.domain = host;\n }\n\n //S5.2.4 If the attribute-value is empty or if the first character of the\n //attribute-value is not %x2F (\"/\"):\n //Let cookie-path be the default-path.\n if (!cookie.path || cookie.path[0] !== '/') {\n cookie.path = defaultPath(context.pathname);\n cookie.pathIsDefault = true;\n }\n\n // S5.3 step 8: NOOP; secure attribute\n // S5.3 step 9: NOOP; httpOnly attribute\n\n // S5.3 step 10\n if (options.http === false && cookie.httpOnly) {\n err = new Error(\"Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n\n var store = this.store;\n\n if (!store.updateCookie) {\n store.updateCookie = function(oldCookie, newCookie, cb) {\n this.putCookie(newCookie, cb);\n };\n }\n\n function withCookie(err, oldCookie) {\n if (err) {\n return cb(err);\n }\n\n var next = function(err) {\n if (err) {\n return cb(err);\n } else {\n cb(null, cookie);\n }\n };\n\n if (oldCookie) {\n // S5.3 step 11 - \"If the cookie store contains a cookie with the same name,\n // domain, and path as the newly created cookie:\"\n if (options.http === false && oldCookie.httpOnly) { // step 11.2\n err = new Error(\"old Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n cookie.creation = oldCookie.creation; // step 11.3\n cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker\n cookie.lastAccessed = now;\n // Step 11.4 (delete cookie) is implied by just setting the new one:\n store.updateCookie(oldCookie, cookie, next); // step 12\n\n } else {\n cookie.creation = cookie.lastAccessed = now;\n store.putCookie(cookie, next); // step 12\n }\n }\n\n store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);\n};\n\n// RFC6365 S5.4\nCAN_BE_SYNC.push('getCookies');\nCookieJar.prototype.getCookies = function(url, options, cb) {\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var path = context.pathname || '/';\n\n var secure = options.secure;\n if (secure == null && context.protocol &&\n (context.protocol == 'https:' || context.protocol == 'wss:'))\n {\n secure = true;\n }\n\n var http = options.http;\n if (http == null) {\n http = true;\n }\n\n var now = options.now || Date.now();\n var expireCheck = options.expire !== false;\n var allPaths = !!options.allPaths;\n var store = this.store;\n\n function matchingCookie(c) {\n // \"Either:\n // The cookie's host-only-flag is true and the canonicalized\n // request-host is identical to the cookie's domain.\n // Or:\n // The cookie's host-only-flag is false and the canonicalized\n // request-host domain-matches the cookie's domain.\"\n if (c.hostOnly) {\n if (c.domain != host) {\n return false;\n }\n } else {\n if (!domainMatch(host, c.domain, false)) {\n return false;\n }\n }\n\n // \"The request-uri's path path-matches the cookie's path.\"\n if (!allPaths && !pathMatch(path, c.path)) {\n return false;\n }\n\n // \"If the cookie's secure-only-flag is true, then the request-uri's\n // scheme must denote a \"secure\" protocol\"\n if (c.secure && !secure) {\n return false;\n }\n\n // \"If the cookie's http-only-flag is true, then exclude the cookie if the\n // cookie-string is being generated for a \"non-HTTP\" API\"\n if (c.httpOnly && !http) {\n return false;\n }\n\n // deferred from S5.3\n // non-RFC: allow retention of expired cookies by choice\n if (expireCheck && c.expiryTime() <= now) {\n store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored\n return false;\n }\n\n return true;\n }\n\n store.findCookies(host, allPaths ? null : path, function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n cookies = cookies.filter(matchingCookie);\n\n // sorting of S5.4 part 2\n if (options.sort !== false) {\n cookies = cookies.sort(cookieCompare);\n }\n\n // S5.4 part 3\n var now = new Date();\n cookies.forEach(function(c) {\n c.lastAccessed = now;\n });\n // TODO persist lastAccessed\n\n cb(null,cookies);\n });\n};\n\nCAN_BE_SYNC.push('getCookieString');\nCookieJar.prototype.getCookieString = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies\n .sort(cookieCompare)\n .map(function(c){\n return c.cookieString();\n })\n .join('; '));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('getSetCookieStrings');\nCookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies.map(function(c){\n return c.toString();\n }));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('serialize');\nCookieJar.prototype.serialize = function(cb) {\n var type = this.store.constructor.name;\n if (type === 'Object') {\n type = null;\n }\n\n // update README.md \"Serialization Format\" if you change this, please!\n var serialized = {\n // The version of tough-cookie that serialized this jar. Generally a good\n // practice since future versions can make data import decisions based on\n // known past behavior. When/if this matters, use `semver`.\n version: 'tough-cookie@'+VERSION,\n\n // add the store type, to make humans happy:\n storeType: type,\n\n // CookieJar configuration:\n rejectPublicSuffixes: !!this.rejectPublicSuffixes,\n\n // this gets filled from getAllCookies:\n cookies: []\n };\n\n if (!(this.store.getAllCookies &&\n typeof this.store.getAllCookies === 'function'))\n {\n return cb(new Error('store does not support getAllCookies and cannot be serialized'));\n }\n\n this.store.getAllCookies(function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n serialized.cookies = cookies.map(function(cookie) {\n // convert to serialized 'raw' cookies\n cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;\n\n // Remove the index so new ones get assigned during deserialization\n delete cookie.creationIndex;\n\n return cookie;\n });\n\n return cb(null, serialized);\n });\n};\n\n// well-known name that JSON.stringify calls\nCookieJar.prototype.toJSON = function() {\n return this.serializeSync();\n};\n\n// use the class method CookieJar.deserialize instead of calling this directly\nCAN_BE_SYNC.push('_importCookies');\nCookieJar.prototype._importCookies = function(serialized, cb) {\n var jar = this;\n var cookies = serialized.cookies;\n if (!cookies || !Array.isArray(cookies)) {\n return cb(new Error('serialized jar has no cookies array'));\n }\n cookies = cookies.slice(); // do not modify the original\n\n function putNext(err) {\n if (err) {\n return cb(err);\n }\n\n if (!cookies.length) {\n return cb(err, jar);\n }\n\n var cookie;\n try {\n cookie = fromJSON(cookies.shift());\n } catch (e) {\n return cb(e);\n }\n\n if (cookie === null) {\n return putNext(null); // skip this cookie\n }\n\n jar.store.putCookie(cookie, putNext);\n }\n\n putNext();\n};\n\nCookieJar.deserialize = function(strOrObj, store, cb) {\n if (arguments.length !== 3) {\n // store is optional\n cb = store;\n store = null;\n }\n\n var serialized;\n if (typeof strOrObj === 'string') {\n serialized = jsonParse(strOrObj);\n if (serialized instanceof Error) {\n return cb(serialized);\n }\n } else {\n serialized = strOrObj;\n }\n\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n jar._importCookies(serialized, function(err) {\n if (err) {\n return cb(err);\n }\n cb(null, jar);\n });\n};\n\nCookieJar.deserializeSync = function(strOrObj, store) {\n var serialized = typeof strOrObj === 'string' ?\n JSON.parse(strOrObj) : strOrObj;\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n\n // catch this mistake early:\n if (!jar.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n jar._importCookiesSync(serialized);\n return jar;\n};\nCookieJar.fromJSON = CookieJar.deserializeSync;\n\nCAN_BE_SYNC.push('clone');\nCookieJar.prototype.clone = function(newStore, cb) {\n if (arguments.length === 1) {\n cb = newStore;\n newStore = null;\n }\n\n this.serialize(function(err,serialized) {\n if (err) {\n return cb(err);\n }\n CookieJar.deserialize(newStore, serialized, cb);\n });\n};\n\n// Use a closure to provide a true imperative API for synchronous stores.\nfunction syncWrap(method) {\n return function() {\n if (!this.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n var args = Array.prototype.slice.call(arguments);\n var syncErr, syncResult;\n args.push(function syncCb(err, result) {\n syncErr = err;\n syncResult = result;\n });\n this[method].apply(this, args);\n\n if (syncErr) {\n throw syncErr;\n }\n return syncResult;\n };\n}\n\n// wrap all declared CAN_BE_SYNC methods in the sync wrapper\nCAN_BE_SYNC.forEach(function(method) {\n CookieJar.prototype[method+'Sync'] = syncWrap(method);\n});\n\nexports.CookieJar = CookieJar;\nexports.Cookie = Cookie;\nexports.Store = Store;\nexports.MemoryCookieStore = MemoryCookieStore;\nexports.parseDate = parseDate;\nexports.formatDate = formatDate;\nexports.parse = parse;\nexports.fromJSON = fromJSON;\nexports.domainMatch = domainMatch;\nexports.defaultPath = defaultPath;\nexports.pathMatch = pathMatch;\nexports.getPublicSuffix = pubsuffix.getPublicSuffix;\nexports.cookieCompare = cookieCompare;\nexports.permuteDomain = __webpack_require__(/*! ./permuteDomain */ \"./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain;\nexports.permutePath = permutePath;\nexports.canonicalDomain = canonicalDomain;\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/lib/cookie.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/lib/memstore.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/lib/memstore.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar Store = __webpack_require__(/*! ./store */ \"./node_modules/request/node_modules/tough-cookie/lib/store.js\").Store;\nvar permuteDomain = __webpack_require__(/*! ./permuteDomain */ \"./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain;\nvar pathMatch = __webpack_require__(/*! ./pathMatch */ \"./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js\").pathMatch;\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nfunction MemoryCookieStore() {\n Store.call(this);\n this.idx = {};\n}\nutil.inherits(MemoryCookieStore, Store);\nexports.MemoryCookieStore = MemoryCookieStore;\nMemoryCookieStore.prototype.idx = null;\n\n// Since it's just a struct in RAM, this Store is synchronous\nMemoryCookieStore.prototype.synchronous = true;\n\n// force a default depth:\nMemoryCookieStore.prototype.inspect = function() {\n return \"{ idx: \"+util.inspect(this.idx, false, 2)+' }';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;\n}\n\nMemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {\n if (!this.idx[domain]) {\n return cb(null,undefined);\n }\n if (!this.idx[domain][path]) {\n return cb(null,undefined);\n }\n return cb(null,this.idx[domain][path][key]||null);\n};\n\nMemoryCookieStore.prototype.findCookies = function(domain, path, cb) {\n var results = [];\n if (!domain) {\n return cb(null,[]);\n }\n\n var pathMatcher;\n if (!path) {\n // null means \"all paths\"\n pathMatcher = function matchAll(domainIndex) {\n for (var curPath in domainIndex) {\n var pathIndex = domainIndex[curPath];\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n };\n\n } else {\n pathMatcher = function matchRFC(domainIndex) {\n //NOTE: we should use path-match algorithm from S5.1.4 here\n //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)\n Object.keys(domainIndex).forEach(function (cookiePath) {\n if (pathMatch(path, cookiePath)) {\n var pathIndex = domainIndex[cookiePath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n });\n };\n }\n\n var domains = permuteDomain(domain) || [domain];\n var idx = this.idx;\n domains.forEach(function(curDomain) {\n var domainIndex = idx[curDomain];\n if (!domainIndex) {\n return;\n }\n pathMatcher(domainIndex);\n });\n\n cb(null,results);\n};\n\nMemoryCookieStore.prototype.putCookie = function(cookie, cb) {\n if (!this.idx[cookie.domain]) {\n this.idx[cookie.domain] = {};\n }\n if (!this.idx[cookie.domain][cookie.path]) {\n this.idx[cookie.domain][cookie.path] = {};\n }\n this.idx[cookie.domain][cookie.path][cookie.key] = cookie;\n cb(null);\n};\n\nMemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // updateCookie() may avoid updating cookies that are identical. For example,\n // lastAccessed may not be important to some stores and an equality\n // comparison could exclude that field.\n this.putCookie(newCookie,cb);\n};\n\nMemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {\n if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {\n delete this.idx[domain][path][key];\n }\n cb(null);\n};\n\nMemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {\n if (this.idx[domain]) {\n if (path) {\n delete this.idx[domain][path];\n } else {\n delete this.idx[domain];\n }\n }\n return cb(null);\n};\n\nMemoryCookieStore.prototype.getAllCookies = function(cb) {\n var cookies = [];\n var idx = this.idx;\n\n var domains = Object.keys(idx);\n domains.forEach(function(domain) {\n var paths = Object.keys(idx[domain]);\n paths.forEach(function(path) {\n var keys = Object.keys(idx[domain][path]);\n keys.forEach(function(key) {\n if (key !== null) {\n cookies.push(idx[domain][path][key]);\n }\n });\n });\n });\n\n // Sort by creationIndex so deserializing retains the creation order.\n // When implementing your own store, this SHOULD retain the order too\n cookies.sort(function(a,b) {\n return (a.creationIndex||0) - (b.creationIndex||0);\n });\n\n cb(null, cookies);\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/lib/memstore.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * \"A request-path path-matches a given cookie-path if at least one of the\n * following conditions holds:\"\n */\nfunction pathMatch (reqPath, cookiePath) {\n // \"o The cookie-path and the request-path are identical.\"\n if (cookiePath === reqPath) {\n return true;\n }\n\n var idx = reqPath.indexOf(cookiePath);\n if (idx === 0) {\n // \"o The cookie-path is a prefix of the request-path, and the last\n // character of the cookie-path is %x2F (\"/\").\"\n if (cookiePath.substr(-1) === \"/\") {\n return true;\n }\n\n // \" o The cookie-path is a prefix of the request-path, and the first\n // character of the request-path that is not included in the cookie- path\n // is a %x2F (\"/\") character.\"\n if (reqPath.substr(cookiePath.length, 1) === \"/\") {\n return true;\n }\n }\n\n return false;\n}\n\nexports.pathMatch = pathMatch;\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js\");\n\n// Gives the permutation of all possible domainMatch()es of a given domain. The\n// array is in shortest-to-longest order. Handy for indexing.\nfunction permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}\n\nexports.permuteDomain = permuteDomain;\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js":
|
||
/*!*****************************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js ***!
|
||
\*****************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2018, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar psl = __webpack_require__(/*! psl */ \"./node_modules/psl/index.js\");\n\nfunction getPublicSuffix(domain) {\n return psl.get(domain);\n}\n\nexports.getPublicSuffix = getPublicSuffix;\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/lib/store.js":
|
||
/*!*********************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/lib/store.js ***!
|
||
\*********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*jshint unused:false */\n\nfunction Store() {\n}\nexports.Store = Store;\n\n// Stores may be synchronous, but are still required to use a\n// Continuation-Passing Style API. The CookieJar itself will expose a \"*Sync\"\n// API that converts from synchronous-callbacks to imperative style.\nStore.prototype.synchronous = false;\n\nStore.prototype.findCookie = function(domain, path, key, cb) {\n throw new Error('findCookie is not implemented');\n};\n\nStore.prototype.findCookies = function(domain, path, cb) {\n throw new Error('findCookies is not implemented');\n};\n\nStore.prototype.putCookie = function(cookie, cb) {\n throw new Error('putCookie is not implemented');\n};\n\nStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // recommended default implementation:\n // return this.putCookie(newCookie, cb);\n throw new Error('updateCookie is not implemented');\n};\n\nStore.prototype.removeCookie = function(domain, path, key, cb) {\n throw new Error('removeCookie is not implemented');\n};\n\nStore.prototype.removeCookies = function(domain, path, cb) {\n throw new Error('removeCookies is not implemented');\n};\n\nStore.prototype.getAllCookies = function(cb) {\n throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');\n};\n\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/lib/store.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/node_modules/tough-cookie/package.json":
|
||
/*!*********************************************************************!*\
|
||
!*** ./node_modules/request/node_modules/tough-cookie/package.json ***!
|
||
\*********************************************************************/
|
||
/*! exports provided: author, contributors, license, name, description, keywords, version, homepage, repository, bugs, main, files, scripts, engines, devDependencies, dependencies, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"author\":{\"name\":\"Jeremy Stashewsky\",\"email\":\"jstash@gmail.com\",\"website\":\"https://github.com/stash\"},\"contributors\":[{\"name\":\"Alexander Savin\",\"website\":\"https://github.com/apsavin\"},{\"name\":\"Ian Livingstone\",\"website\":\"https://github.com/ianlivingstone\"},{\"name\":\"Ivan Nikulin\",\"website\":\"https://github.com/inikulin\"},{\"name\":\"Lalit Kapoor\",\"website\":\"https://github.com/lalitkapoor\"},{\"name\":\"Sam Thompson\",\"website\":\"https://github.com/sambthompson\"},{\"name\":\"Sebastian Mayr\",\"website\":\"https://github.com/Sebmaster\"}],\"license\":\"BSD-3-Clause\",\"name\":\"tough-cookie\",\"description\":\"RFC6265 Cookies and Cookie Jar for node.js\",\"keywords\":[\"HTTP\",\"cookie\",\"cookies\",\"set-cookie\",\"cookiejar\",\"jar\",\"RFC6265\",\"RFC2965\"],\"version\":\"2.4.3\",\"homepage\":\"https://github.com/salesforce/tough-cookie\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/salesforce/tough-cookie.git\"},\"bugs\":{\"url\":\"https://github.com/salesforce/tough-cookie/issues\"},\"main\":\"./lib/cookie\",\"files\":[\"lib\"],\"scripts\":{\"test\":\"vows test/*_test.js\",\"cover\":\"nyc --reporter=lcov --reporter=html vows test/*_test.js\"},\"engines\":{\"node\":\">=0.8\"},\"devDependencies\":{\"async\":\"^1.4.2\",\"nyc\":\"^11.6.0\",\"string.prototype.repeat\":\"^0.2.0\",\"vows\":\"^0.8.1\"},\"dependencies\":{\"psl\":\"^1.1.24\",\"punycode\":\"^1.4.1\"}};\n\n//# sourceURL=webpack:///./node_modules/request/node_modules/tough-cookie/package.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/request/request.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/request/request.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar http = __webpack_require__(/*! http */ \"./node_modules/stream-http/index.js\")\nvar https = __webpack_require__(/*! https */ \"./node_modules/https-browserify/index.js\")\nvar url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\")\nvar stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\")\nvar zlib = __webpack_require__(/*! zlib */ \"./node_modules/browserify-zlib/lib/index.js\")\nvar aws2 = __webpack_require__(/*! aws-sign2 */ \"./node_modules/aws-sign2/index.js\")\nvar aws4 = __webpack_require__(/*! aws4 */ \"./node_modules/aws4/aws4.js\")\nvar httpSignature = __webpack_require__(/*! http-signature */ \"./node_modules/http-signature/lib/index.js\")\nvar mime = __webpack_require__(/*! mime-types */ \"./node_modules/mime-types/index.js\")\nvar caseless = __webpack_require__(/*! caseless */ \"./node_modules/caseless/index.js\")\nvar ForeverAgent = __webpack_require__(/*! forever-agent */ \"./node_modules/forever-agent/index.js\")\nvar FormData = __webpack_require__(/*! form-data */ \"./node_modules/form-data/lib/browser.js\")\nvar extend = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\")\nvar isstream = __webpack_require__(/*! isstream */ \"./node_modules/isstream/isstream.js\")\nvar isTypedArray = __webpack_require__(/*! is-typedarray */ \"./node_modules/is-typedarray/index.js\").strict\nvar helpers = __webpack_require__(/*! ./lib/helpers */ \"./node_modules/request/lib/helpers.js\")\nvar cookies = __webpack_require__(/*! ./lib/cookies */ \"./node_modules/request/lib/cookies.js\")\nvar getProxyFromURI = __webpack_require__(/*! ./lib/getProxyFromURI */ \"./node_modules/request/lib/getProxyFromURI.js\")\nvar Querystring = __webpack_require__(/*! ./lib/querystring */ \"./node_modules/request/lib/querystring.js\").Querystring\nvar Har = __webpack_require__(/*! ./lib/har */ \"./node_modules/request/lib/har.js\").Har\nvar Auth = __webpack_require__(/*! ./lib/auth */ \"./node_modules/request/lib/auth.js\").Auth\nvar OAuth = __webpack_require__(/*! ./lib/oauth */ \"./node_modules/request/lib/oauth.js\").OAuth\nvar hawk = __webpack_require__(/*! ./lib/hawk */ \"./node_modules/request/lib/hawk.js\")\nvar Multipart = __webpack_require__(/*! ./lib/multipart */ \"./node_modules/request/lib/multipart.js\").Multipart\nvar Redirect = __webpack_require__(/*! ./lib/redirect */ \"./node_modules/request/lib/redirect.js\").Redirect\nvar Tunnel = __webpack_require__(/*! ./lib/tunnel */ \"./node_modules/request/lib/tunnel.js\").Tunnel\nvar now = __webpack_require__(/*! performance-now */ \"./node_modules/performance-now/lib/performance-now.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar safeStringify = helpers.safeStringify\nvar isReadStream = helpers.isReadStream\nvar toBase64 = helpers.toBase64\nvar defer = helpers.defer\nvar copy = helpers.copy\nvar version = helpers.version\nvar globalCookieJar = cookies.jar()\n\nvar globalPool = {}\n\nfunction filterForNonReserved (reserved, options) {\n // Filter out properties that are not reserved.\n // Reserved values are passed in at call site.\n\n var object = {}\n for (var i in options) {\n var notReserved = (reserved.indexOf(i) === -1)\n if (notReserved) {\n object[i] = options[i]\n }\n }\n return object\n}\n\nfunction filterOutReservedFunctions (reserved, options) {\n // Filter out properties that are functions and are reserved.\n // Reserved values are passed in at call site.\n\n var object = {}\n for (var i in options) {\n var isReserved = !(reserved.indexOf(i) === -1)\n var isFunction = (typeof options[i] === 'function')\n if (!(isReserved && isFunction)) {\n object[i] = options[i]\n }\n }\n return object\n}\n\n// Return a simpler request object to allow serialization\nfunction requestToJSON () {\n var self = this\n return {\n uri: self.uri,\n method: self.method,\n headers: self.headers\n }\n}\n\n// Return a simpler response object to allow serialization\nfunction responseToJSON () {\n var self = this\n return {\n statusCode: self.statusCode,\n body: self.body,\n headers: self.headers,\n request: requestToJSON.call(self.request)\n }\n}\n\nfunction Request (options) {\n // if given the method property in options, set property explicitMethod to true\n\n // extend the Request instance with any non-reserved properties\n // remove any reserved functions from the options object\n // set Request instance to be readable and writable\n // call init\n\n var self = this\n\n // start with HAR, then override with additional options\n if (options.har) {\n self._har = new Har(self)\n options = self._har.options(options)\n }\n\n stream.Stream.call(self)\n var reserved = Object.keys(Request.prototype)\n var nonReserved = filterForNonReserved(reserved, options)\n\n extend(self, nonReserved)\n options = filterOutReservedFunctions(reserved, options)\n\n self.readable = true\n self.writable = true\n if (options.method) {\n self.explicitMethod = true\n }\n self._qs = new Querystring(self)\n self._auth = new Auth(self)\n self._oauth = new OAuth(self)\n self._multipart = new Multipart(self)\n self._redirect = new Redirect(self)\n self._tunnel = new Tunnel(self)\n self.init(options)\n}\n\nutil.inherits(Request, stream.Stream)\n\n// Debugging\nRequest.debug = process.env.NODE_DEBUG && /\\brequest\\b/.test(process.env.NODE_DEBUG)\nfunction debug () {\n if (Request.debug) {\n console.error('REQUEST %s', util.format.apply(util, arguments))\n }\n}\nRequest.prototype.debug = debug\n\nRequest.prototype.init = function (options) {\n // init() contains all the code to setup the request object.\n // the actual outgoing request is not started until start() is called\n // this function is called from both the constructor and on redirect.\n var self = this\n if (!options) {\n options = {}\n }\n self.headers = self.headers ? copy(self.headers) : {}\n\n // Delete headers with value undefined since they break\n // ClientRequest.OutgoingMessage.setHeader in node 0.12\n for (var headerName in self.headers) {\n if (typeof self.headers[headerName] === 'undefined') {\n delete self.headers[headerName]\n }\n }\n\n caseless.httpify(self, self.headers)\n\n if (!self.method) {\n self.method = options.method || 'GET'\n }\n if (!self.localAddress) {\n self.localAddress = options.localAddress\n }\n\n self._qs.init(options)\n\n debug(options)\n if (!self.pool && self.pool !== false) {\n self.pool = globalPool\n }\n self.dests = self.dests || []\n self.__isRequestRequest = true\n\n // Protect against double callback\n if (!self._callback && self.callback) {\n self._callback = self.callback\n self.callback = function () {\n if (self._callbackCalled) {\n return // Print a warning maybe?\n }\n self._callbackCalled = true\n self._callback.apply(self, arguments)\n }\n self.on('error', self.callback.bind())\n self.on('complete', self.callback.bind(self, null))\n }\n\n // People use this property instead all the time, so support it\n if (!self.uri && self.url) {\n self.uri = self.url\n delete self.url\n }\n\n // If there's a baseUrl, then use it as the base URL (i.e. uri must be\n // specified as a relative path and is appended to baseUrl).\n if (self.baseUrl) {\n if (typeof self.baseUrl !== 'string') {\n return self.emit('error', new Error('options.baseUrl must be a string'))\n }\n\n if (typeof self.uri !== 'string') {\n return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))\n }\n\n if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {\n return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))\n }\n\n // Handle all cases to make sure that there's only one slash between\n // baseUrl and uri.\n var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1\n var uriStartsWithSlash = self.uri.indexOf('/') === 0\n\n if (baseUrlEndsWithSlash && uriStartsWithSlash) {\n self.uri = self.baseUrl + self.uri.slice(1)\n } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {\n self.uri = self.baseUrl + self.uri\n } else if (self.uri === '') {\n self.uri = self.baseUrl\n } else {\n self.uri = self.baseUrl + '/' + self.uri\n }\n delete self.baseUrl\n }\n\n // A URI is needed by this point, emit error if we haven't been able to get one\n if (!self.uri) {\n return self.emit('error', new Error('options.uri is a required argument'))\n }\n\n // If a string URI/URL was given, parse it into a URL object\n if (typeof self.uri === 'string') {\n self.uri = url.parse(self.uri)\n }\n\n // Some URL objects are not from a URL parsed string and need href added\n if (!self.uri.href) {\n self.uri.href = url.format(self.uri)\n }\n\n // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme\n if (self.uri.protocol === 'unix:') {\n return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))\n }\n\n // Support Unix Sockets\n if (self.uri.host === 'unix') {\n self.enableUnixSocket()\n }\n\n if (self.strictSSL === false) {\n self.rejectUnauthorized = false\n }\n\n if (!self.uri.pathname) { self.uri.pathname = '/' }\n\n if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {\n // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar\n // Detect and reject it as soon as possible\n var faultyUri = url.format(self.uri)\n var message = 'Invalid URI \"' + faultyUri + '\"'\n if (Object.keys(options).length === 0) {\n // No option ? This can be the sign of a redirect\n // As this is a case where the user cannot do anything (they didn't call request directly with this URL)\n // they should be warned that it can be caused by a redirection (can save some hair)\n message += '. This can be caused by a crappy redirection.'\n }\n // This error was fatal\n self.abort()\n return self.emit('error', new Error(message))\n }\n\n if (!self.hasOwnProperty('proxy')) {\n self.proxy = getProxyFromURI(self.uri)\n }\n\n self.tunnel = self._tunnel.isEnabled()\n if (self.proxy) {\n self._tunnel.setup(options)\n }\n\n self._redirect.onRequest(options)\n\n self.setHost = false\n if (!self.hasHeader('host')) {\n var hostHeaderName = self.originalHostHeaderName || 'host'\n self.setHeader(hostHeaderName, self.uri.host)\n // Drop :port suffix from Host header if known protocol.\n if (self.uri.port) {\n if ((self.uri.port === '80' && self.uri.protocol === 'http:') ||\n (self.uri.port === '443' && self.uri.protocol === 'https:')) {\n self.setHeader(hostHeaderName, self.uri.hostname)\n }\n }\n self.setHost = true\n }\n\n self.jar(self._jar || options.jar)\n\n if (!self.uri.port) {\n if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }\n }\n\n if (self.proxy && !self.tunnel) {\n self.port = self.proxy.port\n self.host = self.proxy.hostname\n } else {\n self.port = self.uri.port\n self.host = self.uri.hostname\n }\n\n if (options.form) {\n self.form(options.form)\n }\n\n if (options.formData) {\n var formData = options.formData\n var requestForm = self.form()\n var appendFormValue = function (key, value) {\n if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) {\n requestForm.append(key, value.value, value.options)\n } else {\n requestForm.append(key, value)\n }\n }\n for (var formKey in formData) {\n if (formData.hasOwnProperty(formKey)) {\n var formValue = formData[formKey]\n if (formValue instanceof Array) {\n for (var j = 0; j < formValue.length; j++) {\n appendFormValue(formKey, formValue[j])\n }\n } else {\n appendFormValue(formKey, formValue)\n }\n }\n }\n }\n\n if (options.qs) {\n self.qs(options.qs)\n }\n\n if (self.uri.path) {\n self.path = self.uri.path\n } else {\n self.path = self.uri.pathname + (self.uri.search || '')\n }\n\n if (self.path.length === 0) {\n self.path = '/'\n }\n\n // Auth must happen last in case signing is dependent on other headers\n if (options.aws) {\n self.aws(options.aws)\n }\n\n if (options.hawk) {\n self.hawk(options.hawk)\n }\n\n if (options.httpSignature) {\n self.httpSignature(options.httpSignature)\n }\n\n if (options.auth) {\n if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {\n options.auth.user = options.auth.username\n }\n if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {\n options.auth.pass = options.auth.password\n }\n\n self.auth(\n options.auth.user,\n options.auth.pass,\n options.auth.sendImmediately,\n options.auth.bearer\n )\n }\n\n if (self.gzip && !self.hasHeader('accept-encoding')) {\n self.setHeader('accept-encoding', 'gzip, deflate')\n }\n\n if (self.uri.auth && !self.hasHeader('authorization')) {\n var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })\n self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)\n }\n\n if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {\n var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })\n var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))\n self.setHeader('proxy-authorization', authHeader)\n }\n\n if (self.proxy && !self.tunnel) {\n self.path = (self.uri.protocol + '//' + self.uri.host + self.path)\n }\n\n if (options.json) {\n self.json(options.json)\n }\n if (options.multipart) {\n self.multipart(options.multipart)\n }\n\n if (options.time) {\n self.timing = true\n\n // NOTE: elapsedTime is deprecated in favor of .timings\n self.elapsedTime = self.elapsedTime || 0\n }\n\n function setContentLength () {\n if (isTypedArray(self.body)) {\n self.body = Buffer.from(self.body)\n }\n\n if (!self.hasHeader('content-length')) {\n var length\n if (typeof self.body === 'string') {\n length = Buffer.byteLength(self.body)\n } else if (Array.isArray(self.body)) {\n length = self.body.reduce(function (a, b) { return a + b.length }, 0)\n } else {\n length = self.body.length\n }\n\n if (length) {\n self.setHeader('content-length', length)\n } else {\n self.emit('error', new Error('Argument error, options.body.'))\n }\n }\n }\n if (self.body && !isstream(self.body)) {\n setContentLength()\n }\n\n if (options.oauth) {\n self.oauth(options.oauth)\n } else if (self._oauth.params && self.hasHeader('authorization')) {\n self.oauth(self._oauth.params)\n }\n\n var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol\n var defaultModules = {'http:': http, 'https:': https}\n var httpModules = self.httpModules || {}\n\n self.httpModule = httpModules[protocol] || defaultModules[protocol]\n\n if (!self.httpModule) {\n return self.emit('error', new Error('Invalid protocol: ' + protocol))\n }\n\n if (options.ca) {\n self.ca = options.ca\n }\n\n if (!self.agent) {\n if (options.agentOptions) {\n self.agentOptions = options.agentOptions\n }\n\n if (options.agentClass) {\n self.agentClass = options.agentClass\n } else if (options.forever) {\n var v = version()\n // use ForeverAgent in node 0.10- only\n if (v.major === 0 && v.minor <= 10) {\n self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL\n } else {\n self.agentClass = self.httpModule.Agent\n self.agentOptions = self.agentOptions || {}\n self.agentOptions.keepAlive = true\n }\n } else {\n self.agentClass = self.httpModule.Agent\n }\n }\n\n if (self.pool === false) {\n self.agent = false\n } else {\n self.agent = self.agent || self.getNewAgent()\n }\n\n self.on('pipe', function (src) {\n if (self.ntick && self._started) {\n self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.'))\n }\n self.src = src\n if (isReadStream(src)) {\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', mime.lookup(src.path))\n }\n } else {\n if (src.headers) {\n for (var i in src.headers) {\n if (!self.hasHeader(i)) {\n self.setHeader(i, src.headers[i])\n }\n }\n }\n if (self._json && !self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n if (src.method && !self.explicitMethod) {\n self.method = src.method\n }\n }\n\n // self.on('pipe', function () {\n // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')\n // })\n })\n\n defer(function () {\n if (self._aborted) {\n return\n }\n\n var end = function () {\n if (self._form) {\n if (!self._auth.hasAuth) {\n self._form.pipe(self)\n } else if (self._auth.hasAuth && self._auth.sentAuth) {\n self._form.pipe(self)\n }\n }\n if (self._multipart && self._multipart.chunked) {\n self._multipart.body.pipe(self)\n }\n if (self.body) {\n if (isstream(self.body)) {\n self.body.pipe(self)\n } else {\n setContentLength()\n if (Array.isArray(self.body)) {\n self.body.forEach(function (part) {\n self.write(part)\n })\n } else {\n self.write(self.body)\n }\n self.end()\n }\n } else if (self.requestBodyStream) {\n console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')\n self.requestBodyStream.pipe(self)\n } else if (!self.src) {\n if (self._auth.hasAuth && !self._auth.sentAuth) {\n self.end()\n return\n }\n if (self.method !== 'GET' && typeof self.method !== 'undefined') {\n self.setHeader('content-length', 0)\n }\n self.end()\n }\n }\n\n if (self._form && !self.hasHeader('content-length')) {\n // Before ending the request, we had to compute the length of the whole form, asyncly\n self.setHeader(self._form.getHeaders(), true)\n self._form.getLength(function (err, length) {\n if (!err && !isNaN(length)) {\n self.setHeader('content-length', length)\n }\n end()\n })\n } else {\n end()\n }\n\n self.ntick = true\n })\n}\n\nRequest.prototype.getNewAgent = function () {\n var self = this\n var Agent = self.agentClass\n var options = {}\n if (self.agentOptions) {\n for (var i in self.agentOptions) {\n options[i] = self.agentOptions[i]\n }\n }\n if (self.ca) {\n options.ca = self.ca\n }\n if (self.ciphers) {\n options.ciphers = self.ciphers\n }\n if (self.secureProtocol) {\n options.secureProtocol = self.secureProtocol\n }\n if (self.secureOptions) {\n options.secureOptions = self.secureOptions\n }\n if (typeof self.rejectUnauthorized !== 'undefined') {\n options.rejectUnauthorized = self.rejectUnauthorized\n }\n\n if (self.cert && self.key) {\n options.key = self.key\n options.cert = self.cert\n }\n\n if (self.pfx) {\n options.pfx = self.pfx\n }\n\n if (self.passphrase) {\n options.passphrase = self.passphrase\n }\n\n var poolKey = ''\n\n // different types of agents are in different pools\n if (Agent !== self.httpModule.Agent) {\n poolKey += Agent.name\n }\n\n // ca option is only relevant if proxy or destination are https\n var proxy = self.proxy\n if (typeof proxy === 'string') {\n proxy = url.parse(proxy)\n }\n var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'\n\n if (isHttps) {\n if (options.ca) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.ca\n }\n\n if (typeof options.rejectUnauthorized !== 'undefined') {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.rejectUnauthorized\n }\n\n if (options.cert) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.cert.toString('ascii') + options.key.toString('ascii')\n }\n\n if (options.pfx) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.pfx.toString('ascii')\n }\n\n if (options.ciphers) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.ciphers\n }\n\n if (options.secureProtocol) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.secureProtocol\n }\n\n if (options.secureOptions) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.secureOptions\n }\n }\n\n if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {\n // not doing anything special. Use the globalAgent\n return self.httpModule.globalAgent\n }\n\n // we're using a stored agent. Make sure it's protocol-specific\n poolKey = self.uri.protocol + poolKey\n\n // generate a new agent for this setting if none yet exists\n if (!self.pool[poolKey]) {\n self.pool[poolKey] = new Agent(options)\n // properly set maxSockets on new agents\n if (self.pool.maxSockets) {\n self.pool[poolKey].maxSockets = self.pool.maxSockets\n }\n }\n\n return self.pool[poolKey]\n}\n\nRequest.prototype.start = function () {\n // start() is called once we are ready to send the outgoing HTTP request.\n // this is usually called on the first write(), end() or on nextTick()\n var self = this\n\n if (self.timing) {\n // All timings will be relative to this request's startTime. In order to do this,\n // we need to capture the wall-clock start time (via Date), immediately followed\n // by the high-resolution timer (via now()). While these two won't be set\n // at the _exact_ same time, they should be close enough to be able to calculate\n // high-resolution, monotonically non-decreasing timestamps relative to startTime.\n var startTime = new Date().getTime()\n var startTimeNow = now()\n }\n\n if (self._aborted) {\n return\n }\n\n self._started = true\n self.method = self.method || 'GET'\n self.href = self.uri.href\n\n if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {\n self.setHeader('content-length', self.src.stat.size)\n }\n if (self._aws) {\n self.aws(self._aws, true)\n }\n\n // We have a method named auth, which is completely different from the http.request\n // auth option. If we don't remove it, we're gonna have a bad time.\n var reqOptions = copy(self)\n delete reqOptions.auth\n\n debug('make request', self.uri.href)\n\n // node v6.8.0 now supports a `timeout` value in `http.request()`, but we\n // should delete it for now since we handle timeouts manually for better\n // consistency with node versions before v6.8.0\n delete reqOptions.timeout\n\n try {\n self.req = self.httpModule.request(reqOptions)\n } catch (err) {\n self.emit('error', err)\n return\n }\n\n if (self.timing) {\n self.startTime = startTime\n self.startTimeNow = startTimeNow\n\n // Timing values will all be relative to startTime (by comparing to startTimeNow\n // so we have an accurate clock)\n self.timings = {}\n }\n\n var timeout\n if (self.timeout && !self.timeoutTimer) {\n if (self.timeout < 0) {\n timeout = 0\n } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) {\n timeout = self.timeout\n }\n }\n\n self.req.on('response', self.onRequestResponse.bind(self))\n self.req.on('error', self.onRequestError.bind(self))\n self.req.on('drain', function () {\n self.emit('drain')\n })\n\n self.req.on('socket', function (socket) {\n // `._connecting` was the old property which was made public in node v6.1.0\n var isConnecting = socket._connecting || socket.connecting\n if (self.timing) {\n self.timings.socket = now() - self.startTimeNow\n\n if (isConnecting) {\n var onLookupTiming = function () {\n self.timings.lookup = now() - self.startTimeNow\n }\n\n var onConnectTiming = function () {\n self.timings.connect = now() - self.startTimeNow\n }\n\n socket.once('lookup', onLookupTiming)\n socket.once('connect', onConnectTiming)\n\n // clean up timing event listeners if needed on error\n self.req.once('error', function () {\n socket.removeListener('lookup', onLookupTiming)\n socket.removeListener('connect', onConnectTiming)\n })\n }\n }\n\n var setReqTimeout = function () {\n // This timeout sets the amount of time to wait *between* bytes sent\n // from the server once connected.\n //\n // In particular, it's useful for erroring if the server fails to send\n // data halfway through streaming a response.\n self.req.setTimeout(timeout, function () {\n if (self.req) {\n self.abort()\n var e = new Error('ESOCKETTIMEDOUT')\n e.code = 'ESOCKETTIMEDOUT'\n e.connect = false\n self.emit('error', e)\n }\n })\n }\n if (timeout !== undefined) {\n // Only start the connection timer if we're actually connecting a new\n // socket, otherwise if we're already connected (because this is a\n // keep-alive connection) do not bother. This is important since we won't\n // get a 'connect' event for an already connected socket.\n if (isConnecting) {\n var onReqSockConnect = function () {\n socket.removeListener('connect', onReqSockConnect)\n clearTimeout(self.timeoutTimer)\n self.timeoutTimer = null\n setReqTimeout()\n }\n\n socket.on('connect', onReqSockConnect)\n\n self.req.on('error', function (err) { // eslint-disable-line handle-callback-err\n socket.removeListener('connect', onReqSockConnect)\n })\n\n // Set a timeout in memory - this block will throw if the server takes more\n // than `timeout` to write the HTTP status and headers (corresponding to\n // the on('response') event on the client). NB: this measures wall-clock\n // time, not the time between bytes sent by the server.\n self.timeoutTimer = setTimeout(function () {\n socket.removeListener('connect', onReqSockConnect)\n self.abort()\n var e = new Error('ETIMEDOUT')\n e.code = 'ETIMEDOUT'\n e.connect = true\n self.emit('error', e)\n }, timeout)\n } else {\n // We're already connected\n setReqTimeout()\n }\n }\n self.emit('socket', socket)\n })\n\n self.emit('request', self.req)\n}\n\nRequest.prototype.onRequestError = function (error) {\n var self = this\n if (self._aborted) {\n return\n }\n if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&\n self.agent.addRequestNoreuse) {\n self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }\n self.start()\n self.req.end()\n return\n }\n if (self.timeout && self.timeoutTimer) {\n clearTimeout(self.timeoutTimer)\n self.timeoutTimer = null\n }\n self.emit('error', error)\n}\n\nRequest.prototype.onRequestResponse = function (response) {\n var self = this\n\n if (self.timing) {\n self.timings.response = now() - self.startTimeNow\n }\n\n debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)\n response.on('end', function () {\n if (self.timing) {\n self.timings.end = now() - self.startTimeNow\n response.timingStart = self.startTime\n\n // fill in the blanks for any periods that didn't trigger, such as\n // no lookup or connect due to keep alive\n if (!self.timings.socket) {\n self.timings.socket = 0\n }\n if (!self.timings.lookup) {\n self.timings.lookup = self.timings.socket\n }\n if (!self.timings.connect) {\n self.timings.connect = self.timings.lookup\n }\n if (!self.timings.response) {\n self.timings.response = self.timings.connect\n }\n\n debug('elapsed time', self.timings.end)\n\n // elapsedTime includes all redirects\n self.elapsedTime += Math.round(self.timings.end)\n\n // NOTE: elapsedTime is deprecated in favor of .timings\n response.elapsedTime = self.elapsedTime\n\n // timings is just for the final fetch\n response.timings = self.timings\n\n // pre-calculate phase timings as well\n response.timingPhases = {\n wait: self.timings.socket,\n dns: self.timings.lookup - self.timings.socket,\n tcp: self.timings.connect - self.timings.lookup,\n firstByte: self.timings.response - self.timings.connect,\n download: self.timings.end - self.timings.response,\n total: self.timings.end\n }\n }\n debug('response end', self.uri.href, response.statusCode, response.headers)\n })\n\n if (self._aborted) {\n debug('aborted', self.uri.href)\n response.resume()\n return\n }\n\n self.response = response\n response.request = self\n response.toJSON = responseToJSON\n\n // XXX This is different on 0.10, because SSL is strict by default\n if (self.httpModule === https &&\n self.strictSSL && (!response.hasOwnProperty('socket') ||\n !response.socket.authorized)) {\n debug('strict ssl error', self.uri.href)\n var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'\n self.emit('error', new Error('SSL Error: ' + sslErr))\n return\n }\n\n // Save the original host before any redirect (if it changes, we need to\n // remove any authorization headers). Also remember the case of the header\n // name because lots of broken servers expect Host instead of host and we\n // want the caller to be able to specify this.\n self.originalHost = self.getHeader('host')\n if (!self.originalHostHeaderName) {\n self.originalHostHeaderName = self.hasHeader('host')\n }\n if (self.setHost) {\n self.removeHeader('host')\n }\n if (self.timeout && self.timeoutTimer) {\n clearTimeout(self.timeoutTimer)\n self.timeoutTimer = null\n }\n\n var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar\n var addCookie = function (cookie) {\n // set the cookie if it's domain in the href's domain.\n try {\n targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})\n } catch (e) {\n self.emit('error', e)\n }\n }\n\n response.caseless = caseless(response.headers)\n\n if (response.caseless.has('set-cookie') && (!self._disableCookies)) {\n var headerName = response.caseless.has('set-cookie')\n if (Array.isArray(response.headers[headerName])) {\n response.headers[headerName].forEach(addCookie)\n } else {\n addCookie(response.headers[headerName])\n }\n }\n\n if (self._redirect.onResponse(response)) {\n return // Ignore the rest of the response\n } else {\n // Be a good stream and emit end when the response is finished.\n // Hack to emit end on close because of a core bug that never fires end\n response.on('close', function () {\n if (!self._ended) {\n self.response.emit('end')\n }\n })\n\n response.once('end', function () {\n self._ended = true\n })\n\n var noBody = function (code) {\n return (\n self.method === 'HEAD' ||\n // Informational\n (code >= 100 && code < 200) ||\n // No Content\n code === 204 ||\n // Not Modified\n code === 304\n )\n }\n\n var responseContent\n if (self.gzip && !noBody(response.statusCode)) {\n var contentEncoding = response.headers['content-encoding'] || 'identity'\n contentEncoding = contentEncoding.trim().toLowerCase()\n\n // Be more lenient with decoding compressed responses, since (very rarely)\n // servers send slightly invalid gzip responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n var zlibOptions = {\n flush: zlib.Z_SYNC_FLUSH,\n finishFlush: zlib.Z_SYNC_FLUSH\n }\n\n if (contentEncoding === 'gzip') {\n responseContent = zlib.createGunzip(zlibOptions)\n response.pipe(responseContent)\n } else if (contentEncoding === 'deflate') {\n responseContent = zlib.createInflate(zlibOptions)\n response.pipe(responseContent)\n } else {\n // Since previous versions didn't check for Content-Encoding header,\n // ignore any invalid values to preserve backwards-compatibility\n if (contentEncoding !== 'identity') {\n debug('ignoring unrecognized Content-Encoding ' + contentEncoding)\n }\n responseContent = response\n }\n } else {\n responseContent = response\n }\n\n if (self.encoding) {\n if (self.dests.length !== 0) {\n console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')\n } else {\n responseContent.setEncoding(self.encoding)\n }\n }\n\n if (self._paused) {\n responseContent.pause()\n }\n\n self.responseContent = responseContent\n\n self.emit('response', response)\n\n self.dests.forEach(function (dest) {\n self.pipeDest(dest)\n })\n\n responseContent.on('data', function (chunk) {\n if (self.timing && !self.responseStarted) {\n self.responseStartTime = (new Date()).getTime()\n\n // NOTE: responseStartTime is deprecated in favor of .timings\n response.responseStartTime = self.responseStartTime\n }\n self._destdata = true\n self.emit('data', chunk)\n })\n responseContent.once('end', function (chunk) {\n self.emit('end', chunk)\n })\n responseContent.on('error', function (error) {\n self.emit('error', error)\n })\n responseContent.on('close', function () { self.emit('close') })\n\n if (self.callback) {\n self.readResponseBody(response)\n } else { // if no callback\n self.on('end', function () {\n if (self._aborted) {\n debug('aborted', self.uri.href)\n return\n }\n self.emit('complete', response)\n })\n }\n }\n debug('finish init function', self.uri.href)\n}\n\nRequest.prototype.readResponseBody = function (response) {\n var self = this\n debug(\"reading response's body\")\n var buffers = []\n var bufferLength = 0\n var strings = []\n\n self.on('data', function (chunk) {\n if (!Buffer.isBuffer(chunk)) {\n strings.push(chunk)\n } else if (chunk.length) {\n bufferLength += chunk.length\n buffers.push(chunk)\n }\n })\n self.on('end', function () {\n debug('end event', self.uri.href)\n if (self._aborted) {\n debug('aborted', self.uri.href)\n // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.\n // This can lead to leaky behavior if the user retains a reference to the request object.\n buffers = []\n bufferLength = 0\n return\n }\n\n if (bufferLength) {\n debug('has body', self.uri.href, bufferLength)\n response.body = Buffer.concat(buffers, bufferLength)\n if (self.encoding !== null) {\n response.body = response.body.toString(self.encoding)\n }\n // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.\n // This can lead to leaky behavior if the user retains a reference to the request object.\n buffers = []\n bufferLength = 0\n } else if (strings.length) {\n // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.\n // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().\n if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\\uFEFF') {\n strings[0] = strings[0].substring(1)\n }\n response.body = strings.join('')\n }\n\n if (self._json) {\n try {\n response.body = JSON.parse(response.body, self._jsonReviver)\n } catch (e) {\n debug('invalid JSON received', self.uri.href)\n }\n }\n debug('emitting complete', self.uri.href)\n if (typeof response.body === 'undefined' && !self._json) {\n response.body = self.encoding === null ? Buffer.alloc(0) : ''\n }\n self.emit('complete', response, response.body)\n })\n}\n\nRequest.prototype.abort = function () {\n var self = this\n self._aborted = true\n\n if (self.req) {\n self.req.abort()\n } else if (self.response) {\n self.response.destroy()\n }\n\n self.emit('abort')\n}\n\nRequest.prototype.pipeDest = function (dest) {\n var self = this\n var response = self.response\n // Called after the response is received\n if (dest.headers && !dest.headersSent) {\n if (response.caseless.has('content-type')) {\n var ctname = response.caseless.has('content-type')\n if (dest.setHeader) {\n dest.setHeader(ctname, response.headers[ctname])\n } else {\n dest.headers[ctname] = response.headers[ctname]\n }\n }\n\n if (response.caseless.has('content-length')) {\n var clname = response.caseless.has('content-length')\n if (dest.setHeader) {\n dest.setHeader(clname, response.headers[clname])\n } else {\n dest.headers[clname] = response.headers[clname]\n }\n }\n }\n if (dest.setHeader && !dest.headersSent) {\n for (var i in response.headers) {\n // If the response content is being decoded, the Content-Encoding header\n // of the response doesn't represent the piped content, so don't pass it.\n if (!self.gzip || i !== 'content-encoding') {\n dest.setHeader(i, response.headers[i])\n }\n }\n dest.statusCode = response.statusCode\n }\n if (self.pipefilter) {\n self.pipefilter(response, dest)\n }\n}\n\nRequest.prototype.qs = function (q, clobber) {\n var self = this\n var base\n if (!clobber && self.uri.query) {\n base = self._qs.parse(self.uri.query)\n } else {\n base = {}\n }\n\n for (var i in q) {\n base[i] = q[i]\n }\n\n var qs = self._qs.stringify(base)\n\n if (qs === '') {\n return self\n }\n\n self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)\n self.url = self.uri\n self.path = self.uri.path\n\n if (self.uri.host === 'unix') {\n self.enableUnixSocket()\n }\n\n return self\n}\nRequest.prototype.form = function (form) {\n var self = this\n if (form) {\n if (!/^application\\/x-www-form-urlencoded\\b/.test(self.getHeader('content-type'))) {\n self.setHeader('content-type', 'application/x-www-form-urlencoded')\n }\n self.body = (typeof form === 'string')\n ? self._qs.rfc3986(form.toString('utf8'))\n : self._qs.stringify(form).toString('utf8')\n return self\n }\n // create form-data object\n self._form = new FormData()\n self._form.on('error', function (err) {\n err.message = 'form-data: ' + err.message\n self.emit('error', err)\n self.abort()\n })\n return self._form\n}\nRequest.prototype.multipart = function (multipart) {\n var self = this\n\n self._multipart.onRequest(multipart)\n\n if (!self._multipart.chunked) {\n self.body = self._multipart.body\n }\n\n return self\n}\nRequest.prototype.json = function (val) {\n var self = this\n\n if (!self.hasHeader('accept')) {\n self.setHeader('accept', 'application/json')\n }\n\n if (typeof self.jsonReplacer === 'function') {\n self._jsonReplacer = self.jsonReplacer\n }\n\n self._json = true\n if (typeof val === 'boolean') {\n if (self.body !== undefined) {\n if (!/^application\\/x-www-form-urlencoded\\b/.test(self.getHeader('content-type'))) {\n self.body = safeStringify(self.body, self._jsonReplacer)\n } else {\n self.body = self._qs.rfc3986(self.body)\n }\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n }\n } else {\n self.body = safeStringify(val, self._jsonReplacer)\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n }\n\n if (typeof self.jsonReviver === 'function') {\n self._jsonReviver = self.jsonReviver\n }\n\n return self\n}\nRequest.prototype.getHeader = function (name, headers) {\n var self = this\n var result, re, match\n if (!headers) {\n headers = self.headers\n }\n Object.keys(headers).forEach(function (key) {\n if (key.length !== name.length) {\n return\n }\n re = new RegExp(name, 'i')\n match = key.match(re)\n if (match) {\n result = headers[key]\n }\n })\n return result\n}\nRequest.prototype.enableUnixSocket = function () {\n // Get the socket & request paths from the URL\n var unixParts = this.uri.path.split(':')\n var host = unixParts[0]\n var path = unixParts[1]\n // Apply unix properties to request\n this.socketPath = host\n this.uri.pathname = path\n this.uri.path = path\n this.uri.host = host\n this.uri.hostname = host\n this.uri.isUnix = true\n}\n\nRequest.prototype.auth = function (user, pass, sendImmediately, bearer) {\n var self = this\n\n self._auth.onRequest(user, pass, sendImmediately, bearer)\n\n return self\n}\nRequest.prototype.aws = function (opts, now) {\n var self = this\n\n if (!now) {\n self._aws = opts\n return self\n }\n\n if (opts.sign_version === 4 || opts.sign_version === '4') {\n // use aws4\n var options = {\n host: self.uri.host,\n path: self.uri.path,\n method: self.method,\n headers: self.headers,\n body: self.body\n }\n if (opts.service) {\n options.service = opts.service\n }\n var signRes = aws4.sign(options, {\n accessKeyId: opts.key,\n secretAccessKey: opts.secret,\n sessionToken: opts.session\n })\n self.setHeader('authorization', signRes.headers.Authorization)\n self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])\n if (signRes.headers['X-Amz-Security-Token']) {\n self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])\n }\n } else {\n // default: use aws-sign2\n var date = new Date()\n self.setHeader('date', date.toUTCString())\n var auth = {\n key: opts.key,\n secret: opts.secret,\n verb: self.method.toUpperCase(),\n date: date,\n contentType: self.getHeader('content-type') || '',\n md5: self.getHeader('content-md5') || '',\n amazonHeaders: aws2.canonicalizeHeaders(self.headers)\n }\n var path = self.uri.path\n if (opts.bucket && path) {\n auth.resource = '/' + opts.bucket + path\n } else if (opts.bucket && !path) {\n auth.resource = '/' + opts.bucket\n } else if (!opts.bucket && path) {\n auth.resource = path\n } else if (!opts.bucket && !path) {\n auth.resource = '/'\n }\n auth.resource = aws2.canonicalizeResource(auth.resource)\n self.setHeader('authorization', aws2.authorization(auth))\n }\n\n return self\n}\nRequest.prototype.httpSignature = function (opts) {\n var self = this\n httpSignature.signRequest({\n getHeader: function (header) {\n return self.getHeader(header, self.headers)\n },\n setHeader: function (header, value) {\n self.setHeader(header, value)\n },\n method: self.method,\n path: self.path\n }, opts)\n debug('httpSignature authorization', self.getHeader('authorization'))\n\n return self\n}\nRequest.prototype.hawk = function (opts) {\n var self = this\n self.setHeader('Authorization', hawk.header(self.uri, self.method, opts))\n}\nRequest.prototype.oauth = function (_oauth) {\n var self = this\n\n self._oauth.onRequest(_oauth)\n\n return self\n}\n\nRequest.prototype.jar = function (jar) {\n var self = this\n var cookies\n\n if (self._redirect.redirectsFollowed === 0) {\n self.originalCookieHeader = self.getHeader('cookie')\n }\n\n if (!jar) {\n // disable cookies\n cookies = false\n self._disableCookies = true\n } else {\n var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar\n var urihref = self.uri.href\n // fetch cookie in the Specified host\n if (targetCookieJar) {\n cookies = targetCookieJar.getCookieString(urihref)\n }\n }\n\n // if need cookie and cookie is not empty\n if (cookies && cookies.length) {\n if (self.originalCookieHeader) {\n // Don't overwrite existing Cookie header\n self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)\n } else {\n self.setHeader('cookie', cookies)\n }\n }\n self._jar = jar\n return self\n}\n\n// Stream API\nRequest.prototype.pipe = function (dest, opts) {\n var self = this\n\n if (self.response) {\n if (self._destdata) {\n self.emit('error', new Error('You cannot pipe after data has been emitted from the response.'))\n } else if (self._ended) {\n self.emit('error', new Error('You cannot pipe after the response has been ended.'))\n } else {\n stream.Stream.prototype.pipe.call(self, dest, opts)\n self.pipeDest(dest)\n return dest\n }\n } else {\n self.dests.push(dest)\n stream.Stream.prototype.pipe.call(self, dest, opts)\n return dest\n }\n}\nRequest.prototype.write = function () {\n var self = this\n if (self._aborted) { return }\n\n if (!self._started) {\n self.start()\n }\n if (self.req) {\n return self.req.write.apply(self.req, arguments)\n }\n}\nRequest.prototype.end = function (chunk) {\n var self = this\n if (self._aborted) { return }\n\n if (chunk) {\n self.write(chunk)\n }\n if (!self._started) {\n self.start()\n }\n if (self.req) {\n self.req.end()\n }\n}\nRequest.prototype.pause = function () {\n var self = this\n if (!self.responseContent) {\n self._paused = true\n } else {\n self.responseContent.pause.apply(self.responseContent, arguments)\n }\n}\nRequest.prototype.resume = function () {\n var self = this\n if (!self.responseContent) {\n self._paused = false\n } else {\n self.responseContent.resume.apply(self.responseContent, arguments)\n }\n}\nRequest.prototype.destroy = function () {\n var self = this\n if (!self._ended) {\n self.end()\n } else if (self.response) {\n self.response.destroy()\n }\n}\n\nRequest.defaultProxyHeaderWhiteList =\n Tunnel.defaultProxyHeaderWhiteList.slice()\n\nRequest.defaultProxyHeaderExclusiveList =\n Tunnel.defaultProxyHeaderExclusiveList.slice()\n\n// Exports\n\nRequest.prototype.toJSON = requestToJSON\nmodule.exports = Request\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/request/request.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ripemd160/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ripemd160/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar HashBase = __webpack_require__(/*! hash-base */ \"./node_modules/hash-base/index.js\")\n\nvar ARRAY16 = new Array(16)\n\nvar zl = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n]\n\nvar zr = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n]\n\nvar sl = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n]\n\nvar sr = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n]\n\nvar hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]\nvar hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]\n\nfunction RIPEMD160 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n}\n\ninherits(RIPEMD160, HashBase)\n\nRIPEMD160.prototype._update = function () {\n var words = ARRAY16\n for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)\n\n var al = this._a | 0\n var bl = this._b | 0\n var cl = this._c | 0\n var dl = this._d | 0\n var el = this._e | 0\n\n var ar = this._a | 0\n var br = this._b | 0\n var cr = this._c | 0\n var dr = this._d | 0\n var er = this._e | 0\n\n // computation\n for (var i = 0; i < 80; i += 1) {\n var tl\n var tr\n if (i < 16) {\n tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])\n tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])\n } else if (i < 32) {\n tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])\n tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])\n } else if (i < 48) {\n tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])\n tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])\n } else if (i < 64) {\n tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])\n tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])\n } else { // if (i<80) {\n tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])\n tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])\n }\n\n al = el\n el = dl\n dl = rotl(cl, 10)\n cl = bl\n bl = tl\n\n ar = er\n er = dr\n dr = rotl(cr, 10)\n cr = br\n br = tr\n }\n\n // update state\n var t = (this._b + cl + dr) | 0\n this._b = (this._c + dl + er) | 0\n this._c = (this._d + el + ar) | 0\n this._d = (this._e + al + br) | 0\n this._e = (this._a + bl + cr) | 0\n this._a = t\n}\n\nRIPEMD160.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n buffer.writeInt32LE(this._e, 16)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fn1 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn2 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn3 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn4 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn5 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0\n}\n\nmodule.exports = RIPEMD160\n\n\n//# sourceURL=webpack:///./node_modules/ripemd160/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/run-parallel-limit/index.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/run-parallel-limit/index.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {module.exports = runParallelLimit\n\nfunction runParallelLimit (tasks, limit, cb) {\n if (typeof limit !== 'number') throw new Error('second argument must be a Number')\n var results, len, pending, keys, isErrored\n var isSync = true\n\n if (Array.isArray(tasks)) {\n results = []\n pending = len = tasks.length\n } else {\n keys = Object.keys(tasks)\n results = {}\n pending = len = keys.length\n }\n\n function done (err) {\n function end () {\n if (cb) cb(err, results)\n cb = null\n }\n if (isSync) process.nextTick(end)\n else end()\n }\n\n function each (i, err, result) {\n results[i] = result\n if (err) isErrored = true\n if (--pending === 0 || err) {\n done(err)\n } else if (!isErrored && next < len) {\n var key\n if (keys) {\n key = keys[next]\n next += 1\n tasks[key](function (err, result) { each(key, err, result) })\n } else {\n key = next\n next += 1\n tasks[key](function (err, result) { each(key, err, result) })\n }\n }\n }\n\n var next = limit\n if (!pending) {\n // empty\n done(null)\n } else if (keys) {\n // object\n keys.some(function (key, i) {\n tasks[key](function (err, result) { each(key, err, result) })\n if (i === limit - 1) return true // early return\n })\n } else {\n // array\n tasks.some(function (task, i) {\n task(function (err, result) { each(i, err, result) })\n if (i === limit - 1) return true // early return\n })\n }\n\n isSync = false\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/run-parallel-limit/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/run-parallel/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/run-parallel/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {module.exports = runParallel\n\nfunction runParallel (tasks, cb) {\n var results, pending, keys\n var isSync = true\n\n if (Array.isArray(tasks)) {\n results = []\n pending = tasks.length\n } else {\n keys = Object.keys(tasks)\n results = {}\n pending = keys.length\n }\n\n function done (err) {\n function end () {\n if (cb) cb(err, results)\n cb = null\n }\n if (isSync) process.nextTick(end)\n else end()\n }\n\n function each (i, err, result) {\n results[i] = result\n if (--pending === 0 || err) {\n done(err)\n }\n }\n\n if (!pending) {\n // empty\n done(null)\n } else if (keys) {\n // object\n keys.forEach(function (key) {\n tasks[key](function (err, result) { each(key, err, result) })\n })\n } else {\n // array\n tasks.forEach(function (task, i) {\n task(function (err, result) { each(i, err, result) })\n })\n }\n\n isSync = false\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/run-parallel/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/rusha/dist/rusha.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/rusha/dist/rusha.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse {}\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-env commonjs, browser */\n\nvar RushaCore = __webpack_require__(5);\n\nvar _require = __webpack_require__(1),\n toHex = _require.toHex,\n ceilHeapSize = _require.ceilHeapSize;\n\nvar conv = __webpack_require__(6);\n\n// Calculate the length of buffer that the sha1 routine uses\n// including the padding.\nvar padlen = function (len) {\n for (len += 9; len % 64 > 0; len += 1) {}\n return len;\n};\n\nvar padZeroes = function (bin, len) {\n var h8 = new Uint8Array(bin.buffer);\n var om = len % 4,\n align = len - om;\n switch (om) {\n case 0:\n h8[align + 3] = 0;\n case 1:\n h8[align + 2] = 0;\n case 2:\n h8[align + 1] = 0;\n case 3:\n h8[align + 0] = 0;\n }\n for (var i = (len >> 2) + 1; i < bin.length; i++) {\n bin[i] = 0;\n }\n};\n\nvar padData = function (bin, chunkLen, msgLen) {\n bin[chunkLen >> 2] |= 0x80 << 24 - (chunkLen % 4 << 3);\n // To support msgLen >= 2 GiB, use a float division when computing the\n // high 32-bits of the big-endian message length in bits.\n bin[((chunkLen >> 2) + 2 & ~0x0f) + 14] = msgLen / (1 << 29) | 0;\n bin[((chunkLen >> 2) + 2 & ~0x0f) + 15] = msgLen << 3;\n};\n\nvar getRawDigest = function (heap, padMaxChunkLen) {\n var io = new Int32Array(heap, padMaxChunkLen + 320, 5);\n var out = new Int32Array(5);\n var arr = new DataView(out.buffer);\n arr.setInt32(0, io[0], false);\n arr.setInt32(4, io[1], false);\n arr.setInt32(8, io[2], false);\n arr.setInt32(12, io[3], false);\n arr.setInt32(16, io[4], false);\n return out;\n};\n\nvar Rusha = function () {\n function Rusha(chunkSize) {\n _classCallCheck(this, Rusha);\n\n chunkSize = chunkSize || 64 * 1024;\n if (chunkSize % 64 > 0) {\n throw new Error('Chunk size must be a multiple of 128 bit');\n }\n this._offset = 0;\n this._maxChunkLen = chunkSize;\n this._padMaxChunkLen = padlen(chunkSize);\n // The size of the heap is the sum of:\n // 1. The padded input message size\n // 2. The extended space the algorithm needs (320 byte)\n // 3. The 160 bit state the algoritm uses\n this._heap = new ArrayBuffer(ceilHeapSize(this._padMaxChunkLen + 320 + 20));\n this._h32 = new Int32Array(this._heap);\n this._h8 = new Int8Array(this._heap);\n this._core = new RushaCore({ Int32Array: Int32Array }, {}, this._heap);\n }\n\n Rusha.prototype._initState = function _initState(heap, padMsgLen) {\n this._offset = 0;\n var io = new Int32Array(heap, padMsgLen + 320, 5);\n io[0] = 1732584193;\n io[1] = -271733879;\n io[2] = -1732584194;\n io[3] = 271733878;\n io[4] = -1009589776;\n };\n\n Rusha.prototype._padChunk = function _padChunk(chunkLen, msgLen) {\n var padChunkLen = padlen(chunkLen);\n var view = new Int32Array(this._heap, 0, padChunkLen >> 2);\n padZeroes(view, chunkLen);\n padData(view, chunkLen, msgLen);\n return padChunkLen;\n };\n\n Rusha.prototype._write = function _write(data, chunkOffset, chunkLen, off) {\n conv(data, this._h8, this._h32, chunkOffset, chunkLen, off || 0);\n };\n\n Rusha.prototype._coreCall = function _coreCall(data, chunkOffset, chunkLen, msgLen, finalize) {\n var padChunkLen = chunkLen;\n this._write(data, chunkOffset, chunkLen);\n if (finalize) {\n padChunkLen = this._padChunk(chunkLen, msgLen);\n }\n this._core.hash(padChunkLen, this._padMaxChunkLen);\n };\n\n Rusha.prototype.rawDigest = function rawDigest(str) {\n var msgLen = str.byteLength || str.length || str.size || 0;\n this._initState(this._heap, this._padMaxChunkLen);\n var chunkOffset = 0,\n chunkLen = this._maxChunkLen;\n for (chunkOffset = 0; msgLen > chunkOffset + chunkLen; chunkOffset += chunkLen) {\n this._coreCall(str, chunkOffset, chunkLen, msgLen, false);\n }\n this._coreCall(str, chunkOffset, msgLen - chunkOffset, msgLen, true);\n return getRawDigest(this._heap, this._padMaxChunkLen);\n };\n\n Rusha.prototype.digest = function digest(str) {\n return toHex(this.rawDigest(str).buffer);\n };\n\n Rusha.prototype.digestFromString = function digestFromString(str) {\n return this.digest(str);\n };\n\n Rusha.prototype.digestFromBuffer = function digestFromBuffer(str) {\n return this.digest(str);\n };\n\n Rusha.prototype.digestFromArrayBuffer = function digestFromArrayBuffer(str) {\n return this.digest(str);\n };\n\n Rusha.prototype.resetState = function resetState() {\n this._initState(this._heap, this._padMaxChunkLen);\n return this;\n };\n\n Rusha.prototype.append = function append(chunk) {\n var chunkOffset = 0;\n var chunkLen = chunk.byteLength || chunk.length || chunk.size || 0;\n var turnOffset = this._offset % this._maxChunkLen;\n var inputLen = void 0;\n\n this._offset += chunkLen;\n while (chunkOffset < chunkLen) {\n inputLen = Math.min(chunkLen - chunkOffset, this._maxChunkLen - turnOffset);\n this._write(chunk, chunkOffset, inputLen, turnOffset);\n turnOffset += inputLen;\n chunkOffset += inputLen;\n if (turnOffset === this._maxChunkLen) {\n this._core.hash(this._maxChunkLen, this._padMaxChunkLen);\n turnOffset = 0;\n }\n }\n return this;\n };\n\n Rusha.prototype.getState = function getState() {\n var turnOffset = this._offset % this._maxChunkLen;\n var heap = void 0;\n if (!turnOffset) {\n var io = new Int32Array(this._heap, this._padMaxChunkLen + 320, 5);\n heap = io.buffer.slice(io.byteOffset, io.byteOffset + io.byteLength);\n } else {\n heap = this._heap.slice(0);\n }\n return {\n offset: this._offset,\n heap: heap\n };\n };\n\n Rusha.prototype.setState = function setState(state) {\n this._offset = state.offset;\n if (state.heap.byteLength === 20) {\n var io = new Int32Array(this._heap, this._padMaxChunkLen + 320, 5);\n io.set(new Int32Array(state.heap));\n } else {\n this._h32.set(new Int32Array(state.heap));\n }\n return this;\n };\n\n Rusha.prototype.rawEnd = function rawEnd() {\n var msgLen = this._offset;\n var chunkLen = msgLen % this._maxChunkLen;\n var padChunkLen = this._padChunk(chunkLen, msgLen);\n this._core.hash(padChunkLen, this._padMaxChunkLen);\n var result = getRawDigest(this._heap, this._padMaxChunkLen);\n this._initState(this._heap, this._padMaxChunkLen);\n return result;\n };\n\n Rusha.prototype.end = function end() {\n return toHex(this.rawEnd().buffer);\n };\n\n return Rusha;\n}();\n\nmodule.exports = Rusha;\nmodule.exports._core = RushaCore;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n/* eslint-env commonjs, browser */\n\n//\n// toHex\n//\n\nvar precomputedHex = new Array(256);\nfor (var i = 0; i < 256; i++) {\n precomputedHex[i] = (i < 0x10 ? '0' : '') + i.toString(16);\n}\n\nmodule.exports.toHex = function (arrayBuffer) {\n var binarray = new Uint8Array(arrayBuffer);\n var res = new Array(arrayBuffer.byteLength);\n for (var _i = 0; _i < res.length; _i++) {\n res[_i] = precomputedHex[binarray[_i]];\n }\n return res.join('');\n};\n\n//\n// ceilHeapSize\n//\n\nmodule.exports.ceilHeapSize = function (v) {\n // The asm.js spec says:\n // The heap object's byteLength must be either\n // 2^n for n in [12, 24) or 2^24 * n for n ≥ 1.\n // Also, byteLengths smaller than 2^16 are deprecated.\n var p = 0;\n // If v is smaller than 2^16, the smallest possible solution\n // is 2^16.\n if (v <= 65536) return 65536;\n // If v < 2^24, we round up to 2^n,\n // otherwise we round up to 2^24 * n.\n if (v < 16777216) {\n for (p = 1; p < v; p = p << 1) {}\n } else {\n for (p = 16777216; p < v; p += 16777216) {}\n }\n return p;\n};\n\n//\n// isDedicatedWorkerScope\n//\n\nmodule.exports.isDedicatedWorkerScope = function (self) {\n var isRunningInWorker = 'WorkerGlobalScope' in self && self instanceof self.WorkerGlobalScope;\n var isRunningInSharedWorker = 'SharedWorkerGlobalScope' in self && self instanceof self.SharedWorkerGlobalScope;\n var isRunningInServiceWorker = 'ServiceWorkerGlobalScope' in self && self instanceof self.ServiceWorkerGlobalScope;\n\n // Detects whether we run inside a dedicated worker or not.\n //\n // We can't just check for `DedicatedWorkerGlobalScope`, since IE11\n // has a bug where it only supports `WorkerGlobalScope`.\n //\n // Therefore, we consider us as running inside a dedicated worker\n // when we are running inside a worker, but not in a shared or service worker.\n //\n // When new types of workers are introduced, we will need to adjust this code.\n return isRunningInWorker && !isRunningInSharedWorker && !isRunningInServiceWorker;\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* eslint-env commonjs, worker */\n\nmodule.exports = function () {\n var Rusha = __webpack_require__(0);\n\n var hashData = function (hasher, data, cb) {\n try {\n return cb(null, hasher.digest(data));\n } catch (e) {\n return cb(e);\n }\n };\n\n var hashFile = function (hasher, readTotal, blockSize, file, cb) {\n var reader = new self.FileReader();\n reader.onloadend = function onloadend() {\n if (reader.error) {\n return cb(reader.error);\n }\n var buffer = reader.result;\n readTotal += reader.result.byteLength;\n try {\n hasher.append(buffer);\n } catch (e) {\n cb(e);\n return;\n }\n if (readTotal < file.size) {\n hashFile(hasher, readTotal, blockSize, file, cb);\n } else {\n cb(null, hasher.end());\n }\n };\n reader.readAsArrayBuffer(file.slice(readTotal, readTotal + blockSize));\n };\n\n var workerBehaviourEnabled = true;\n\n self.onmessage = function (event) {\n if (!workerBehaviourEnabled) {\n return;\n }\n\n var data = event.data.data,\n file = event.data.file,\n id = event.data.id;\n if (typeof id === 'undefined') return;\n if (!file && !data) return;\n var blockSize = event.data.blockSize || 4 * 1024 * 1024;\n var hasher = new Rusha(blockSize);\n hasher.resetState();\n var done = function (err, hash) {\n if (!err) {\n self.postMessage({ id: id, hash: hash });\n } else {\n self.postMessage({ id: id, error: err.name });\n }\n };\n if (data) hashData(hasher, data, done);\n if (file) hashFile(hasher, 0, blockSize, file, done);\n };\n\n return function () {\n workerBehaviourEnabled = false;\n };\n};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* eslint-env commonjs, browser */\n\nvar work = __webpack_require__(4);\nvar Rusha = __webpack_require__(0);\nvar createHash = __webpack_require__(7);\nvar runWorker = __webpack_require__(2);\n\nvar _require = __webpack_require__(1),\n isDedicatedWorkerScope = _require.isDedicatedWorkerScope;\n\nvar isRunningInDedicatedWorker = typeof self !== 'undefined' && isDedicatedWorkerScope(self);\n\nRusha.disableWorkerBehaviour = isRunningInDedicatedWorker ? runWorker() : function () {};\n\nRusha.createWorker = function () {\n var worker = work(/*require.resolve*/(2));\n var terminate = worker.terminate;\n worker.terminate = function () {\n URL.revokeObjectURL(worker.objectURL);\n terminate.call(worker);\n };\n return worker;\n};\n\nRusha.createHash = createHash;\n\nmodule.exports = Rusha;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction webpackBootstrapFunc (modules) {\n/******/ // The module cache\n/******/ var installedModules = {};\n\n/******/ // The require function\n/******/ function __webpack_require__(moduleId) {\n\n/******/ // Check if module is in cache\n/******/ if(installedModules[moduleId])\n/******/ return installedModules[moduleId].exports;\n\n/******/ // Create a new module (and put it into the cache)\n/******/ var module = installedModules[moduleId] = {\n/******/ i: moduleId,\n/******/ l: false,\n/******/ exports: {}\n/******/ };\n\n/******/ // Execute the module function\n/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ // Flag the module as loaded\n/******/ module.l = true;\n\n/******/ // Return the exports of the module\n/******/ return module.exports;\n/******/ }\n\n/******/ // expose the modules object (__webpack_modules__)\n/******/ __webpack_require__.m = modules;\n\n/******/ // expose the module cache\n/******/ __webpack_require__.c = installedModules;\n\n/******/ // identity function for calling harmony imports with the correct context\n/******/ __webpack_require__.i = function(value) { return value; };\n\n/******/ // define getter function for harmony exports\n/******/ __webpack_require__.d = function(exports, name, getter) {\n/******/ if(!__webpack_require__.o(exports, name)) {\n/******/ Object.defineProperty(exports, name, {\n/******/ configurable: false,\n/******/ enumerable: true,\n/******/ get: getter\n/******/ });\n/******/ }\n/******/ };\n\n/******/ // define __esModule on exports\n/******/ __webpack_require__.r = function(exports) {\n/******/ Object.defineProperty(exports, '__esModule', { value: true });\n/******/ };\n\n/******/ // getDefaultExport function for compatibility with non-harmony modules\n/******/ __webpack_require__.n = function(module) {\n/******/ var getter = module && module.__esModule ?\n/******/ function getDefault() { return module['default']; } :\n/******/ function getModuleExports() { return module; };\n/******/ __webpack_require__.d(getter, 'a', getter);\n/******/ return getter;\n/******/ };\n\n/******/ // Object.prototype.hasOwnProperty.call\n/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n/******/ // __webpack_public_path__\n/******/ __webpack_require__.p = \"/\";\n\n/******/ // on error function for async loading\n/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n var f = __webpack_require__(__webpack_require__.s = ENTRY_MODULE)\n return f.default || f // try to call default if defined to also support babel esmodule exports\n}\n\nvar moduleNameReqExp = '[\\\\.|\\\\-|\\\\+|\\\\w|\\/|@]+'\nvar dependencyRegExp = '\\\\((\\/\\\\*.*?\\\\*\\/)?\\s?.*?(' + moduleNameReqExp + ').*?\\\\)' // additional chars when output.pathinfo is true\n\n// http://stackoverflow.com/a/2593661/130442\nfunction quoteRegExp (str) {\n return (str + '').replace(/[.?*+^$[\\]\\\\(){}|-]/g, '\\\\$&')\n}\n\nfunction getModuleDependencies (sources, module, queueName) {\n var retval = {}\n retval[queueName] = []\n\n var fnString = module.toString()\n var wrapperSignature = fnString.match(/^function\\s?\\(\\w+,\\s*\\w+,\\s*(\\w+)\\)/)\n if (!wrapperSignature) return retval\n var webpackRequireName = wrapperSignature[1]\n\n // main bundle deps\n var re = new RegExp('(\\\\\\\\n|\\\\W)' + quoteRegExp(webpackRequireName) + dependencyRegExp, 'g')\n var match\n while ((match = re.exec(fnString))) {\n if (match[3] === 'dll-reference') continue\n retval[queueName].push(match[3])\n }\n\n // dll deps\n re = new RegExp('\\\\(' + quoteRegExp(webpackRequireName) + '\\\\(\"(dll-reference\\\\s(' + moduleNameReqExp + '))\"\\\\)\\\\)' + dependencyRegExp, 'g')\n while ((match = re.exec(fnString))) {\n if (!sources[match[2]]) {\n retval[queueName].push(match[1])\n sources[match[2]] = __webpack_require__(match[1]).m\n }\n retval[match[2]] = retval[match[2]] || []\n retval[match[2]].push(match[4])\n }\n\n return retval\n}\n\nfunction hasValuesInQueues (queues) {\n var keys = Object.keys(queues)\n return keys.reduce(function (hasValues, key) {\n return hasValues || queues[key].length > 0\n }, false)\n}\n\nfunction getRequiredModules (sources, moduleId) {\n var modulesQueue = {\n main: [moduleId]\n }\n var requiredModules = {\n main: []\n }\n var seenModules = {\n main: {}\n }\n\n while (hasValuesInQueues(modulesQueue)) {\n var queues = Object.keys(modulesQueue)\n for (var i = 0; i < queues.length; i++) {\n var queueName = queues[i]\n var queue = modulesQueue[queueName]\n var moduleToCheck = queue.pop()\n seenModules[queueName] = seenModules[queueName] || {}\n if (seenModules[queueName][moduleToCheck] || !sources[queueName][moduleToCheck]) continue\n seenModules[queueName][moduleToCheck] = true\n requiredModules[queueName] = requiredModules[queueName] || []\n requiredModules[queueName].push(moduleToCheck)\n var newModules = getModuleDependencies(sources, sources[queueName][moduleToCheck], queueName)\n var newModulesKeys = Object.keys(newModules)\n for (var j = 0; j < newModulesKeys.length; j++) {\n modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]] || []\n modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]].concat(newModules[newModulesKeys[j]])\n }\n }\n }\n\n return requiredModules\n}\n\nmodule.exports = function (moduleId, options) {\n options = options || {}\n var sources = {\n main: __webpack_require__.m\n }\n\n var requiredModules = options.all ? { main: Object.keys(sources) } : getRequiredModules(sources, moduleId)\n\n var src = ''\n\n Object.keys(requiredModules).filter(function (m) { return m !== 'main' }).forEach(function (module) {\n var entryModule = 0\n while (requiredModules[module][entryModule]) {\n entryModule++\n }\n requiredModules[module].push(entryModule)\n sources[module][entryModule] = '(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })'\n src = src + 'var ' + module + ' = (' + webpackBootstrapFunc.toString().replace('ENTRY_MODULE', JSON.stringify(entryModule)) + ')({' + requiredModules[module].map(function (id) { return '' + JSON.stringify(id) + ': ' + sources[module][id].toString() }).join(',') + '});\\n'\n })\n\n src = src + '(' + webpackBootstrapFunc.toString().replace('ENTRY_MODULE', JSON.stringify(moduleId)) + ')({' + requiredModules.main.map(function (id) { return '' + JSON.stringify(id) + ': ' + sources.main[id].toString() }).join(',') + '})(self);'\n\n var blob = new window.Blob([src], { type: 'text/javascript' })\n if (options.bare) { return blob }\n\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL\n\n var workerUrl = URL.createObjectURL(blob)\n var worker = new window.Worker(workerUrl)\n worker.objectURL = workerUrl\n\n return worker\n}\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n// The low-level RushCore module provides the heart of Rusha,\n// a high-speed sha1 implementation working on an Int32Array heap.\n// At first glance, the implementation seems complicated, however\n// with the SHA1 spec at hand, it is obvious this almost a textbook\n// implementation that has a few functions hand-inlined and a few loops\n// hand-unrolled.\nmodule.exports = function RushaCore(stdlib$846, foreign$847, heap$848) {\n 'use asm';\n var H$849 = new stdlib$846.Int32Array(heap$848);\n function hash$850(k$851, x$852) {\n // k in bytes\n k$851 = k$851 | 0;\n x$852 = x$852 | 0;\n var i$853 = 0, j$854 = 0, y0$855 = 0, z0$856 = 0, y1$857 = 0, z1$858 = 0, y2$859 = 0, z2$860 = 0, y3$861 = 0, z3$862 = 0, y4$863 = 0, z4$864 = 0, t0$865 = 0, t1$866 = 0;\n y0$855 = H$849[x$852 + 320 >> 2] | 0;\n y1$857 = H$849[x$852 + 324 >> 2] | 0;\n y2$859 = H$849[x$852 + 328 >> 2] | 0;\n y3$861 = H$849[x$852 + 332 >> 2] | 0;\n y4$863 = H$849[x$852 + 336 >> 2] | 0;\n for (i$853 = 0; (i$853 | 0) < (k$851 | 0); i$853 = i$853 + 64 | 0) {\n z0$856 = y0$855;\n z1$858 = y1$857;\n z2$860 = y2$859;\n z3$862 = y3$861;\n z4$864 = y4$863;\n for (j$854 = 0; (j$854 | 0) < 64; j$854 = j$854 + 4 | 0) {\n t1$866 = H$849[i$853 + j$854 >> 2] | 0;\n t0$865 = ((y0$855 << 5 | y0$855 >>> 27) + (y1$857 & y2$859 | ~y1$857 & y3$861) | 0) + ((t1$866 + y4$863 | 0) + 1518500249 | 0) | 0;\n y4$863 = y3$861;\n y3$861 = y2$859;\n y2$859 = y1$857 << 30 | y1$857 >>> 2;\n y1$857 = y0$855;\n y0$855 = t0$865;\n H$849[k$851 + j$854 >> 2] = t1$866;\n }\n for (j$854 = k$851 + 64 | 0; (j$854 | 0) < (k$851 + 80 | 0); j$854 = j$854 + 4 | 0) {\n t1$866 = (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) << 1 | (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) >>> 31;\n t0$865 = ((y0$855 << 5 | y0$855 >>> 27) + (y1$857 & y2$859 | ~y1$857 & y3$861) | 0) + ((t1$866 + y4$863 | 0) + 1518500249 | 0) | 0;\n y4$863 = y3$861;\n y3$861 = y2$859;\n y2$859 = y1$857 << 30 | y1$857 >>> 2;\n y1$857 = y0$855;\n y0$855 = t0$865;\n H$849[j$854 >> 2] = t1$866;\n }\n for (j$854 = k$851 + 80 | 0; (j$854 | 0) < (k$851 + 160 | 0); j$854 = j$854 + 4 | 0) {\n t1$866 = (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) << 1 | (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) >>> 31;\n t0$865 = ((y0$855 << 5 | y0$855 >>> 27) + (y1$857 ^ y2$859 ^ y3$861) | 0) + ((t1$866 + y4$863 | 0) + 1859775393 | 0) | 0;\n y4$863 = y3$861;\n y3$861 = y2$859;\n y2$859 = y1$857 << 30 | y1$857 >>> 2;\n y1$857 = y0$855;\n y0$855 = t0$865;\n H$849[j$854 >> 2] = t1$866;\n }\n for (j$854 = k$851 + 160 | 0; (j$854 | 0) < (k$851 + 240 | 0); j$854 = j$854 + 4 | 0) {\n t1$866 = (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) << 1 | (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) >>> 31;\n t0$865 = ((y0$855 << 5 | y0$855 >>> 27) + (y1$857 & y2$859 | y1$857 & y3$861 | y2$859 & y3$861) | 0) + ((t1$866 + y4$863 | 0) - 1894007588 | 0) | 0;\n y4$863 = y3$861;\n y3$861 = y2$859;\n y2$859 = y1$857 << 30 | y1$857 >>> 2;\n y1$857 = y0$855;\n y0$855 = t0$865;\n H$849[j$854 >> 2] = t1$866;\n }\n for (j$854 = k$851 + 240 | 0; (j$854 | 0) < (k$851 + 320 | 0); j$854 = j$854 + 4 | 0) {\n t1$866 = (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) << 1 | (H$849[j$854 - 12 >> 2] ^ H$849[j$854 - 32 >> 2] ^ H$849[j$854 - 56 >> 2] ^ H$849[j$854 - 64 >> 2]) >>> 31;\n t0$865 = ((y0$855 << 5 | y0$855 >>> 27) + (y1$857 ^ y2$859 ^ y3$861) | 0) + ((t1$866 + y4$863 | 0) - 899497514 | 0) | 0;\n y4$863 = y3$861;\n y3$861 = y2$859;\n y2$859 = y1$857 << 30 | y1$857 >>> 2;\n y1$857 = y0$855;\n y0$855 = t0$865;\n H$849[j$854 >> 2] = t1$866;\n }\n y0$855 = y0$855 + z0$856 | 0;\n y1$857 = y1$857 + z1$858 | 0;\n y2$859 = y2$859 + z2$860 | 0;\n y3$861 = y3$861 + z3$862 | 0;\n y4$863 = y4$863 + z4$864 | 0;\n }\n H$849[x$852 + 320 >> 2] = y0$855;\n H$849[x$852 + 324 >> 2] = y1$857;\n H$849[x$852 + 328 >> 2] = y2$859;\n H$849[x$852 + 332 >> 2] = y3$861;\n H$849[x$852 + 336 >> 2] = y4$863;\n }\n return { hash: hash$850 };\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\nvar _this = this;\n\n/* eslint-env commonjs, browser */\n\nvar reader = void 0;\nif (typeof self !== 'undefined' && typeof self.FileReaderSync !== 'undefined') {\n reader = new self.FileReaderSync();\n}\n\n// Convert a binary string and write it to the heap.\n// A binary string is expected to only contain char codes < 256.\nvar convStr = function (str, H8, H32, start, len, off) {\n var i = void 0,\n om = off % 4,\n lm = (len + om) % 4,\n j = len - lm;\n switch (om) {\n case 0:\n H8[off] = str.charCodeAt(start + 3);\n case 1:\n H8[off + 1 - (om << 1) | 0] = str.charCodeAt(start + 2);\n case 2:\n H8[off + 2 - (om << 1) | 0] = str.charCodeAt(start + 1);\n case 3:\n H8[off + 3 - (om << 1) | 0] = str.charCodeAt(start);\n }\n if (len < lm + (4 - om)) {\n return;\n }\n for (i = 4 - om; i < j; i = i + 4 | 0) {\n H32[off + i >> 2] = str.charCodeAt(start + i) << 24 | str.charCodeAt(start + i + 1) << 16 | str.charCodeAt(start + i + 2) << 8 | str.charCodeAt(start + i + 3);\n }\n switch (lm) {\n case 3:\n H8[off + j + 1 | 0] = str.charCodeAt(start + j + 2);\n case 2:\n H8[off + j + 2 | 0] = str.charCodeAt(start + j + 1);\n case 1:\n H8[off + j + 3 | 0] = str.charCodeAt(start + j);\n }\n};\n\n// Convert a buffer or array and write it to the heap.\n// The buffer or array is expected to only contain elements < 256.\nvar convBuf = function (buf, H8, H32, start, len, off) {\n var i = void 0,\n om = off % 4,\n lm = (len + om) % 4,\n j = len - lm;\n switch (om) {\n case 0:\n H8[off] = buf[start + 3];\n case 1:\n H8[off + 1 - (om << 1) | 0] = buf[start + 2];\n case 2:\n H8[off + 2 - (om << 1) | 0] = buf[start + 1];\n case 3:\n H8[off + 3 - (om << 1) | 0] = buf[start];\n }\n if (len < lm + (4 - om)) {\n return;\n }\n for (i = 4 - om; i < j; i = i + 4 | 0) {\n H32[off + i >> 2 | 0] = buf[start + i] << 24 | buf[start + i + 1] << 16 | buf[start + i + 2] << 8 | buf[start + i + 3];\n }\n switch (lm) {\n case 3:\n H8[off + j + 1 | 0] = buf[start + j + 2];\n case 2:\n H8[off + j + 2 | 0] = buf[start + j + 1];\n case 1:\n H8[off + j + 3 | 0] = buf[start + j];\n }\n};\n\nvar convBlob = function (blob, H8, H32, start, len, off) {\n var i = void 0,\n om = off % 4,\n lm = (len + om) % 4,\n j = len - lm;\n var buf = new Uint8Array(reader.readAsArrayBuffer(blob.slice(start, start + len)));\n switch (om) {\n case 0:\n H8[off] = buf[3];\n case 1:\n H8[off + 1 - (om << 1) | 0] = buf[2];\n case 2:\n H8[off + 2 - (om << 1) | 0] = buf[1];\n case 3:\n H8[off + 3 - (om << 1) | 0] = buf[0];\n }\n if (len < lm + (4 - om)) {\n return;\n }\n for (i = 4 - om; i < j; i = i + 4 | 0) {\n H32[off + i >> 2 | 0] = buf[i] << 24 | buf[i + 1] << 16 | buf[i + 2] << 8 | buf[i + 3];\n }\n switch (lm) {\n case 3:\n H8[off + j + 1 | 0] = buf[j + 2];\n case 2:\n H8[off + j + 2 | 0] = buf[j + 1];\n case 1:\n H8[off + j + 3 | 0] = buf[j];\n }\n};\n\nmodule.exports = function (data, H8, H32, start, len, off) {\n if (typeof data === 'string') {\n return convStr(data, H8, H32, start, len, off);\n }\n if (data instanceof Array) {\n return convBuf(data, H8, H32, start, len, off);\n }\n // Safely doing a Buffer check using \"this\" to avoid Buffer polyfill to be included in the dist\n if (_this && _this.Buffer && _this.Buffer.isBuffer(data)) {\n return convBuf(data, H8, H32, start, len, off);\n }\n if (data instanceof ArrayBuffer) {\n return convBuf(new Uint8Array(data), H8, H32, start, len, off);\n }\n if (data.buffer instanceof ArrayBuffer) {\n return convBuf(new Uint8Array(data.buffer, data.byteOffset, data.byteLength), H8, H32, start, len, off);\n }\n if (data instanceof Blob) {\n return convBlob(data, H8, H32, start, len, off);\n }\n throw new Error('Unsupported data type.');\n};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-env commonjs, browser */\n\nvar Rusha = __webpack_require__(0);\n\nvar _require = __webpack_require__(1),\n toHex = _require.toHex;\n\nvar Hash = function () {\n function Hash() {\n _classCallCheck(this, Hash);\n\n this._rusha = new Rusha();\n this._rusha.resetState();\n }\n\n Hash.prototype.update = function update(data) {\n this._rusha.append(data);\n return this;\n };\n\n Hash.prototype.digest = function digest(encoding) {\n var digest = this._rusha.rawEnd().buffer;\n if (!encoding) {\n return digest;\n }\n if (encoding === 'hex') {\n return toHex(digest);\n }\n throw new Error('unsupported digest encoding');\n };\n\n return Hash;\n}();\n\nmodule.exports = function () {\n return new Hash();\n};\n\n/***/ })\n/******/ ]);\n});\n\n//# sourceURL=webpack:///./node_modules/rusha/dist/rusha.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/safe-buffer/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/safe-buffer/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* eslint-disable node/no-deprecated-api */\nvar buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n\n\n//# sourceURL=webpack:///./node_modules/safe-buffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/safer-buffer/safer.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/safer-buffer/safer.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/* eslint-disable node/no-deprecated-api */\n\n\n\nvar buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\")\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/safer-buffer/safer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/js.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/secp256k1/js.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = __webpack_require__(/*! ./lib */ \"./node_modules/secp256k1/lib/index.js\")(__webpack_require__(/*! ./lib/js */ \"./node_modules/secp256k1/lib/js/index.js\"))\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/js.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/assert.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/assert.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar toString = Object.prototype.toString\n\n// TypeError\nexports.isArray = function (value, message) {\n if (!Array.isArray(value)) throw TypeError(message)\n}\n\nexports.isBoolean = function (value, message) {\n if (toString.call(value) !== '[object Boolean]') throw TypeError(message)\n}\n\nexports.isBuffer = function (value, message) {\n if (!Buffer.isBuffer(value)) throw TypeError(message)\n}\n\nexports.isFunction = function (value, message) {\n if (toString.call(value) !== '[object Function]') throw TypeError(message)\n}\n\nexports.isNumber = function (value, message) {\n if (toString.call(value) !== '[object Number]') throw TypeError(message)\n}\n\nexports.isObject = function (value, message) {\n if (toString.call(value) !== '[object Object]') throw TypeError(message)\n}\n\n// RangeError\nexports.isBufferLength = function (buffer, length, message) {\n if (buffer.length !== length) throw RangeError(message)\n}\n\nexports.isBufferLength2 = function (buffer, length1, length2, message) {\n if (buffer.length !== length1 && buffer.length !== length2) throw RangeError(message)\n}\n\nexports.isLengthGTZero = function (value, message) {\n if (value.length === 0) throw RangeError(message)\n}\n\nexports.isNumberInInterval = function (number, x, y, message) {\n if (number <= x || number >= y) throw RangeError(message)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/assert.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/der.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/der.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar bip66 = __webpack_require__(/*! bip66 */ \"./node_modules/bip66/index.js\")\n\nvar EC_PRIVKEY_EXPORT_DER_COMPRESSED = Buffer.from([\n // begin\n 0x30, 0x81, 0xd3, 0x02, 0x01, 0x01, 0x04, 0x20,\n // private key\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // middle\n 0xa0, 0x81, 0x85, 0x30, 0x81, 0x82, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,\n 0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,\n 0x21, 0x02, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,\n 0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,\n 0x17, 0x98, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,\n 0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x24, 0x03, 0x22, 0x00,\n // public key\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00\n])\n\nvar EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED = Buffer.from([\n // begin\n 0x30, 0x82, 0x01, 0x13, 0x02, 0x01, 0x01, 0x04, 0x20,\n // private key\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // middle\n 0xa0, 0x81, 0xa5, 0x30, 0x81, 0xa2, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,\n 0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,\n 0x41, 0x04, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,\n 0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,\n 0x17, 0x98, 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc, 0x0E, 0x11,\n 0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19, 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10,\n 0xd4, 0xb8, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,\n 0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x44, 0x03, 0x42, 0x00,\n // public key\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00\n])\n\nexports.privateKeyExport = function (privateKey, publicKey, compressed) {\n var result = Buffer.from(compressed ? EC_PRIVKEY_EXPORT_DER_COMPRESSED : EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED)\n privateKey.copy(result, compressed ? 8 : 9)\n publicKey.copy(result, compressed ? 181 : 214)\n return result\n}\n\nexports.privateKeyImport = function (privateKey) {\n var length = privateKey.length\n\n // sequence header\n var index = 0\n if (length < index + 1 || privateKey[index] !== 0x30) return\n index += 1\n\n // sequence length constructor\n if (length < index + 1 || !(privateKey[index] & 0x80)) return\n\n var lenb = privateKey[index] & 0x7f\n index += 1\n if (lenb < 1 || lenb > 2) return\n if (length < index + lenb) return\n\n // sequence length\n var len = privateKey[index + lenb - 1] | (lenb > 1 ? privateKey[index + lenb - 2] << 8 : 0)\n index += lenb\n if (length < index + len) return\n\n // sequence element 0: version number (=1)\n if (length < index + 3 ||\n privateKey[index] !== 0x02 ||\n privateKey[index + 1] !== 0x01 ||\n privateKey[index + 2] !== 0x01) {\n return\n }\n index += 3\n\n // sequence element 1: octet string, up to 32 bytes\n if (length < index + 2 ||\n privateKey[index] !== 0x04 ||\n privateKey[index + 1] > 0x20 ||\n length < index + 2 + privateKey[index + 1]) {\n return\n }\n\n return privateKey.slice(index + 2, index + 2 + privateKey[index + 1])\n}\n\nexports.signatureExport = function (sigObj) {\n var r = Buffer.concat([Buffer.from([0]), sigObj.r])\n for (var lenR = 33, posR = 0; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);\n\n var s = Buffer.concat([Buffer.from([0]), sigObj.s])\n for (var lenS = 33, posS = 0; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);\n\n return bip66.encode(r.slice(posR), s.slice(posS))\n}\n\nexports.signatureImport = function (sig) {\n var r = Buffer.alloc(32, 0)\n var s = Buffer.alloc(32, 0)\n\n try {\n var sigObj = bip66.decode(sig)\n if (sigObj.r.length === 33 && sigObj.r[0] === 0x00) sigObj.r = sigObj.r.slice(1)\n if (sigObj.r.length > 32) throw new Error('R length is too long')\n if (sigObj.s.length === 33 && sigObj.s[0] === 0x00) sigObj.s = sigObj.s.slice(1)\n if (sigObj.s.length > 32) throw new Error('S length is too long')\n } catch (err) {\n return\n }\n\n sigObj.r.copy(r, 32 - sigObj.r.length)\n sigObj.s.copy(s, 32 - sigObj.s.length)\n\n return { r: r, s: s }\n}\n\nexports.signatureImportLax = function (sig) {\n var r = Buffer.alloc(32, 0)\n var s = Buffer.alloc(32, 0)\n\n var length = sig.length\n var index = 0\n\n // sequence tag byte\n if (sig[index++] !== 0x30) return\n\n // sequence length byte\n var lenbyte = sig[index++]\n if (lenbyte & 0x80) {\n index += lenbyte - 0x80\n if (index > length) return\n }\n\n // sequence tag byte for r\n if (sig[index++] !== 0x02) return\n\n // length for r\n var rlen = sig[index++]\n if (rlen & 0x80) {\n lenbyte = rlen - 0x80\n if (index + lenbyte > length) return\n for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);\n for (rlen = 0; lenbyte > 0; index += 1, lenbyte -= 1) rlen = (rlen << 8) + sig[index]\n }\n if (rlen > length - index) return\n var rindex = index\n index += rlen\n\n // sequence tag byte for s\n if (sig[index++] !== 0x02) return\n\n // length for s\n var slen = sig[index++]\n if (slen & 0x80) {\n lenbyte = slen - 0x80\n if (index + lenbyte > length) return\n for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);\n for (slen = 0; lenbyte > 0; index += 1, lenbyte -= 1) slen = (slen << 8) + sig[index]\n }\n if (slen > length - index) return\n var sindex = index\n index += slen\n\n // ignore leading zeros in r\n for (; rlen > 0 && sig[rindex] === 0x00; rlen -= 1, rindex += 1);\n // copy r value\n if (rlen > 32) return\n var rvalue = sig.slice(rindex, rindex + rlen)\n rvalue.copy(r, 32 - rvalue.length)\n\n // ignore leading zeros in s\n for (; slen > 0 && sig[sindex] === 0x00; slen -= 1, sindex += 1);\n // copy s value\n if (slen > 32) return\n var svalue = sig.slice(sindex, sindex + slen)\n svalue.copy(s, 32 - svalue.length)\n\n return { r: r, s: s }\n}\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/der.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar assert = __webpack_require__(/*! ./assert */ \"./node_modules/secp256k1/lib/assert.js\")\nvar der = __webpack_require__(/*! ./der */ \"./node_modules/secp256k1/lib/der.js\")\nvar messages = __webpack_require__(/*! ./messages.json */ \"./node_modules/secp256k1/lib/messages.json\")\n\nfunction initCompressedValue (value, defaultValue) {\n if (value === undefined) return defaultValue\n\n assert.isBoolean(value, messages.COMPRESSED_TYPE_INVALID)\n return value\n}\n\nmodule.exports = function (secp256k1) {\n return {\n privateKeyVerify: function (privateKey) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n return privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)\n },\n\n privateKeyExport: function (privateKey, compressed) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n var publicKey = secp256k1.privateKeyExport(privateKey, compressed)\n\n return der.privateKeyExport(privateKey, publicKey, compressed)\n },\n\n privateKeyImport: function (privateKey) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n\n privateKey = der.privateKeyImport(privateKey)\n if (privateKey && privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)) return privateKey\n\n throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)\n },\n\n privateKeyNegate: function (privateKey) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n return secp256k1.privateKeyNegate(privateKey)\n },\n\n privateKeyModInverse: function (privateKey) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n return secp256k1.privateKeyModInverse(privateKey)\n },\n\n privateKeyTweakAdd: function (privateKey, tweak) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n return secp256k1.privateKeyTweakAdd(privateKey, tweak)\n },\n\n privateKeyTweakMul: function (privateKey, tweak) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n return secp256k1.privateKeyTweakMul(privateKey, tweak)\n },\n\n publicKeyCreate: function (privateKey, compressed) {\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.publicKeyCreate(privateKey, compressed)\n },\n\n publicKeyConvert: function (publicKey, compressed) {\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.publicKeyConvert(publicKey, compressed)\n },\n\n publicKeyVerify: function (publicKey) {\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n return secp256k1.publicKeyVerify(publicKey)\n },\n\n publicKeyTweakAdd: function (publicKey, tweak, compressed) {\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.publicKeyTweakAdd(publicKey, tweak, compressed)\n },\n\n publicKeyTweakMul: function (publicKey, tweak, compressed) {\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.publicKeyTweakMul(publicKey, tweak, compressed)\n },\n\n publicKeyCombine: function (publicKeys, compressed) {\n assert.isArray(publicKeys, messages.EC_PUBLIC_KEYS_TYPE_INVALID)\n assert.isLengthGTZero(publicKeys, messages.EC_PUBLIC_KEYS_LENGTH_INVALID)\n for (var i = 0; i < publicKeys.length; ++i) {\n assert.isBuffer(publicKeys[i], messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKeys[i], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n }\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.publicKeyCombine(publicKeys, compressed)\n },\n\n signatureNormalize: function (signature) {\n assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n return secp256k1.signatureNormalize(signature)\n },\n\n signatureExport: function (signature) {\n assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n var sigObj = secp256k1.signatureExport(signature)\n return der.signatureExport(sigObj)\n },\n\n signatureImport: function (sig) {\n assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n var sigObj = der.signatureImport(sig)\n if (sigObj) return secp256k1.signatureImport(sigObj)\n\n throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)\n },\n\n signatureImportLax: function (sig) {\n assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n var sigObj = der.signatureImportLax(sig)\n if (sigObj) return secp256k1.signatureImport(sigObj)\n\n throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)\n },\n\n sign: function (message, privateKey, options) {\n assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n var data = null\n var noncefn = null\n if (options !== undefined) {\n assert.isObject(options, messages.OPTIONS_TYPE_INVALID)\n\n if (options.data !== undefined) {\n assert.isBuffer(options.data, messages.OPTIONS_DATA_TYPE_INVALID)\n assert.isBufferLength(options.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID)\n data = options.data\n }\n\n if (options.noncefn !== undefined) {\n assert.isFunction(options.noncefn, messages.OPTIONS_NONCEFN_TYPE_INVALID)\n noncefn = options.noncefn\n }\n }\n\n return secp256k1.sign(message, privateKey, noncefn, data)\n },\n\n verify: function (message, signature, publicKey) {\n assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n return secp256k1.verify(message, signature, publicKey)\n },\n\n recover: function (message, signature, recovery, compressed) {\n assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n assert.isNumber(recovery, messages.RECOVERY_ID_TYPE_INVALID)\n assert.isNumberInInterval(recovery, -1, 4, messages.RECOVERY_ID_VALUE_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.recover(message, signature, recovery, compressed)\n },\n\n ecdh: function (publicKey, privateKey) {\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n return secp256k1.ecdh(publicKey, privateKey)\n },\n\n ecdhUnsafe: function (publicKey, privateKey, compressed) {\n assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n compressed = initCompressedValue(compressed, true)\n\n return secp256k1.ecdhUnsafe(publicKey, privateKey, compressed)\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/js/bn/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/js/bn/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar optimized = __webpack_require__(/*! ./optimized */ \"./node_modules/secp256k1/lib/js/bn/optimized.js\")\n\nfunction BN () {\n this.negative = 0\n this.words = null\n this.length = 0\n}\n\nBN.fromNumber = function (n) {\n var bn = new BN()\n bn.words = [n & 0x03ffffff]\n bn.length = 1\n return bn\n}\n\nBN.fromBuffer = function (b32) {\n var bn = new BN()\n\n bn.words = new Array(10)\n bn.words[0] = (b32[28] & 0x03) << 24 | b32[29] << 16 | b32[30] << 8 | b32[31]\n bn.words[1] = (b32[25] & 0x0F) << 22 | b32[26] << 14 | b32[27] << 6 | b32[28] >>> 2\n bn.words[2] = (b32[22] & 0x3F) << 20 | b32[23] << 12 | b32[24] << 4 | b32[25] >>> 4\n bn.words[3] = (b32[19] & 0xFF) << 18 | b32[20] << 10 | b32[21] << 2 | b32[22] >>> 6\n\n bn.words[4] = (b32[15] & 0x03) << 24 | b32[16] << 16 | b32[17] << 8 | b32[18]\n bn.words[5] = (b32[12] & 0x0F) << 22 | b32[13] << 14 | b32[14] << 6 | b32[15] >>> 2\n bn.words[6] = (b32[9] & 0x3F) << 20 | b32[10] << 12 | b32[11] << 4 | b32[12] >>> 4\n bn.words[7] = (b32[6] & 0xFF) << 18 | b32[7] << 10 | b32[8] << 2 | b32[9] >>> 6\n\n bn.words[8] = (b32[2] & 0x03) << 24 | b32[3] << 16 | b32[4] << 8 | b32[5]\n bn.words[9] = b32[0] << 14 | b32[1] << 6 | b32[2] >>> 2\n\n bn.length = 10\n return bn.strip()\n}\n\nBN.prototype.toBuffer = function () {\n var w = this.words\n for (var i = this.length; i < 10; ++i) w[i] = 0\n\n return Buffer.from([\n (w[9] >>> 14) & 0xFF, (w[9] >>> 6) & 0xFF, (w[9] & 0x3F) << 2 | ((w[8] >>> 24) & 0x03), // 0, 1, 2\n (w[8] >>> 16) & 0xFF, (w[8] >>> 8) & 0xFF, w[8] & 0xFF, // 3, 4, 5\n\n (w[7] >>> 18) & 0xFF, (w[7] >>> 10) & 0xFF, (w[7] >>> 2) & 0xFF, // 6, 7, 8\n ((w[7] & 0x03) << 6) | ((w[6] >>> 20) & 0x3F), (w[6] >>> 12) & 0xFF, (w[6] >>> 4) & 0xFF, // 9, 10, 11\n ((w[6] & 0x0F) << 4) | ((w[5] >>> 22) & 0x0F), (w[5] >>> 14) & 0xFF, (w[5] >>> 6) & 0xFF, // 12, 13, 14\n ((w[5] & 0x3F) << 2) | ((w[4] >>> 24) & 0x03), (w[4] >>> 16) & 0xFF, (w[4] >>> 8) & 0xFF, w[4] & 0xFF, // 15, 16, 17, 18\n\n (w[3] >>> 18) & 0xFF, (w[3] >>> 10) & 0xFF, (w[3] >>> 2) & 0xFF, // 19, 20, 21\n ((w[3] & 0x03) << 6) | ((w[2] >>> 20) & 0x3F), (w[2] >>> 12) & 0xFF, (w[2] >>> 4) & 0xFF, // 22, 23, 24\n ((w[2] & 0x0F) << 4) | ((w[1] >>> 22) & 0x0F), (w[1] >>> 14) & 0xFF, (w[1] >>> 6) & 0xFF, // 25, 26, 27\n ((w[1] & 0x3F) << 2) | ((w[0] >>> 24) & 0x03), (w[0] >>> 16) & 0xFF, (w[0] >>> 8) & 0xFF, w[0] & 0xFF // 28, 29, 30, 31\n ])\n}\n\nBN.prototype.clone = function () {\n var r = new BN()\n r.words = new Array(this.length)\n for (var i = 0; i < this.length; i++) r.words[i] = this.words[i]\n r.length = this.length\n r.negative = this.negative\n return r\n}\n\nBN.prototype.strip = function () {\n while (this.length > 1 && (this.words[this.length - 1] | 0) === 0) this.length--\n return this\n}\n\nBN.prototype.normSign = function () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) this.negative = 0\n return this\n}\n\nBN.prototype.isEven = function () {\n return (this.words[0] & 1) === 0\n}\n\nBN.prototype.isOdd = function () {\n return (this.words[0] & 1) === 1\n}\n\nBN.prototype.isZero = function () {\n return this.length === 1 && this.words[0] === 0\n}\n\nBN.prototype.ucmp = function (num) {\n if (this.length !== num.length) return this.length > num.length ? 1 : -1\n\n for (var i = this.length - 1; i >= 0; --i) {\n if (this.words[i] !== num.words[i]) return this.words[i] > num.words[i] ? 1 : -1\n }\n\n return 0\n}\n\nBN.prototype.gtOne = function () {\n return this.length > 1 || this.words[0] > 1\n}\n\nBN.prototype.isOverflow = function () {\n return this.ucmp(BN.n) >= 0\n}\n\nBN.prototype.isHigh = function () {\n return this.ucmp(BN.nh) === 1\n}\n\nBN.prototype.bitLengthGT256 = function () {\n return this.length > 10 || (this.length === 10 && this.words[9] > 0x003fffff)\n}\n\nBN.prototype.iuaddn = function (num) {\n this.words[0] += num\n\n for (var i = 0; this.words[i] > 0x03ffffff && i < this.length; ++i) {\n this.words[i] -= 0x04000000\n this.words[i + 1] += 1\n }\n\n if (i === this.length) {\n this.words[i] = 1\n this.length += 1\n }\n\n return this\n}\n\nBN.prototype.iadd = function (num) {\n // (-this) + num -> -(this - num)\n // this + (-num) -> this - num\n if (this.negative !== num.negative) {\n if (this.negative !== 0) {\n this.negative = 0\n this.isub(num)\n this.negative ^= 1\n } else {\n num.negative = 0\n this.isub(num)\n num.negative = 1\n }\n\n return this.normSign()\n }\n\n // a.length > b.length\n var a\n var b\n if (this.length > num.length) {\n a = this\n b = num\n } else {\n a = num\n b = this\n }\n\n for (var i = 0, carry = 0; i < b.length; ++i) {\n var word = a.words[i] + b.words[i] + carry\n this.words[i] = word & 0x03ffffff\n carry = word >>> 26\n }\n\n for (; carry !== 0 && i < a.length; ++i) {\n word = a.words[i] + carry\n this.words[i] = word & 0x03ffffff\n carry = word >>> 26\n }\n\n this.length = a.length\n if (carry !== 0) {\n this.words[this.length++] = carry\n } else if (a !== this) {\n for (; i < a.length; ++i) {\n this.words[i] = a.words[i]\n }\n }\n\n return this\n}\n\nBN.prototype.add = function (num) {\n return this.clone().iadd(num)\n}\n\nBN.prototype.isub = function (num) {\n // (-this) - num -> -(this + num)\n // this - (-num) -> this + num\n if (this.negative !== num.negative) {\n if (this.negative !== 0) {\n this.negative = 0\n this.iadd(num)\n this.negative = 1\n } else {\n num.negative = 0\n this.iadd(num)\n num.negative = 1\n }\n\n return this.normSign()\n }\n\n var cmp = this.ucmp(num)\n if (cmp === 0) {\n this.negative = 0\n this.words[0] = 0\n this.length = 1\n return this\n }\n\n // a > b\n var a\n var b\n if (cmp > 0) {\n a = this\n b = num\n } else {\n a = num\n b = this\n }\n\n for (var i = 0, carry = 0; i < b.length; ++i) {\n var word = a.words[i] - b.words[i] + carry\n carry = word >> 26\n this.words[i] = word & 0x03ffffff\n }\n\n for (; carry !== 0 && i < a.length; ++i) {\n word = a.words[i] + carry\n carry = word >> 26\n this.words[i] = word & 0x03ffffff\n }\n\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; ++i) this.words[i] = a.words[i]\n }\n\n this.length = Math.max(this.length, i)\n\n if (a !== this) this.negative ^= 1\n\n return this.strip().normSign()\n}\n\nBN.prototype.sub = function (num) {\n return this.clone().isub(num)\n}\n\nBN.umulTo = function (num1, num2, out) {\n out.length = num1.length + num2.length - 1\n\n var a1 = num1.words[0]\n var b1 = num2.words[0]\n var r1 = a1 * b1\n\n var carry = (r1 / 0x04000000) | 0\n out.words[0] = r1 & 0x03ffffff\n\n for (var k = 1, maxK = out.length; k < maxK; k++) {\n var ncarry = carry >>> 26\n var rword = carry & 0x03ffffff\n for (var j = Math.max(0, k - num1.length + 1), maxJ = Math.min(k, num2.length - 1); j <= maxJ; j++) {\n var i = k - j\n var a = num1.words[i]\n var b = num2.words[j]\n var r = a * b + rword\n ncarry += (r / 0x04000000) | 0\n rword = r & 0x03ffffff\n }\n out.words[k] = rword\n carry = ncarry\n }\n\n if (carry !== 0) out.words[out.length++] = carry\n\n return out.strip()\n}\n\nBN.umulTo10x10 = Math.imul ? optimized.umulTo10x10 : BN.umulTo\n\nBN.umulnTo = function (num, k, out) {\n if (k === 0) {\n out.words = [0]\n out.length = 1\n return out\n }\n\n for (var i = 0, carry = 0; i < num.length; ++i) {\n var r = num.words[i] * k + carry\n out.words[i] = r & 0x03ffffff\n carry = (r / 0x04000000) | 0\n }\n\n if (carry > 0) {\n out.words[i] = carry\n out.length = num.length + 1\n } else {\n out.length = num.length\n }\n\n return out\n}\n\nBN.prototype.umul = function (num) {\n var out = new BN()\n out.words = new Array(this.length + num.length)\n\n if (this.length === 10 && num.length === 10) {\n return BN.umulTo10x10(this, num, out)\n } else if (this.length === 1) {\n return BN.umulnTo(num, this.words[0], out)\n } else if (num.length === 1) {\n return BN.umulnTo(this, num.words[0], out)\n } else {\n return BN.umulTo(this, num, out)\n }\n}\n\nBN.prototype.isplit = function (output) {\n output.length = Math.min(this.length, 9)\n for (var i = 0; i < output.length; ++i) output.words[i] = this.words[i]\n\n if (this.length <= 9) {\n this.words[0] = 0\n this.length = 1\n return this\n }\n\n // Shift by 9 limbs\n var prev = this.words[9]\n output.words[output.length++] = prev & 0x003fffff\n\n for (i = 10; i < this.length; ++i) {\n var word = this.words[i]\n this.words[i - 10] = ((word & 0x003fffff) << 4) | (prev >>> 22)\n prev = word\n }\n prev >>>= 22\n this.words[i - 10] = prev\n\n if (prev === 0 && this.length > 10) {\n this.length -= 10\n } else {\n this.length -= 9\n }\n\n return this\n}\n\nBN.prototype.fireduce = function () {\n if (this.isOverflow()) this.isub(BN.n)\n return this\n}\n\nBN.prototype.ureduce = function () {\n var num = this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)\n if (num.bitLengthGT256()) {\n num = num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)\n if (num.bitLengthGT256()) num = num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)\n }\n\n return num.fireduce()\n}\n\nBN.prototype.ishrn = function (n) {\n var mask = (1 << n) - 1\n var m = 26 - n\n\n for (var i = this.length - 1, carry = 0; i >= 0; --i) {\n var word = this.words[i]\n this.words[i] = (carry << m) | (word >>> n)\n carry = word & mask\n }\n\n if (this.length > 1 && this.words[this.length - 1] === 0) this.length -= 1\n\n return this\n}\n\nBN.prototype.uinvm = function () {\n var x = this.clone()\n var y = BN.n.clone()\n\n // A * x + B * y = x\n var A = BN.fromNumber(1)\n var B = BN.fromNumber(0)\n\n // C * x + D * y = y\n var C = BN.fromNumber(0)\n var D = BN.fromNumber(1)\n\n while (x.isEven() && y.isEven()) {\n for (var k = 1, m = 1; (x.words[0] & m) === 0 && (y.words[0] & m) === 0 && k < 26; ++k, m <<= 1);\n x.ishrn(k)\n y.ishrn(k)\n }\n\n var yp = y.clone()\n var xp = x.clone()\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.ishrn(i)\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp)\n B.isub(xp)\n }\n\n A.ishrn(1)\n B.ishrn(1)\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.ishrn(j)\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp)\n D.isub(xp)\n }\n\n C.ishrn(1)\n D.ishrn(1)\n }\n }\n\n if (x.ucmp(y) >= 0) {\n x.isub(y)\n A.isub(C)\n B.isub(D)\n } else {\n y.isub(x)\n C.isub(A)\n D.isub(B)\n }\n }\n\n if (C.negative === 1) {\n C.negative = 0\n var result = C.ureduce()\n result.negative ^= 1\n return result.normSign().iadd(BN.n)\n } else {\n return C.ureduce()\n }\n}\n\nBN.prototype.imulK = function () {\n this.words[this.length] = 0\n this.words[this.length + 1] = 0\n this.length += 2\n\n for (var i = 0, lo = 0; i < this.length; ++i) {\n var w = this.words[i] | 0\n lo += w * 0x3d1\n this.words[i] = lo & 0x03ffffff\n lo = w * 0x40 + ((lo / 0x04000000) | 0)\n }\n\n if (this.words[this.length - 1] === 0) {\n this.length -= 1\n if (this.words[this.length - 1] === 0) this.length -= 1\n }\n\n return this\n}\n\nBN.prototype.redIReduce = function () {\n this.isplit(BN.tmp).imulK().iadd(BN.tmp)\n if (this.bitLengthGT256()) this.isplit(BN.tmp).imulK().iadd(BN.tmp)\n\n var cmp = this.ucmp(BN.p)\n if (cmp === 0) {\n this.words[0] = 0\n this.length = 1\n } else if (cmp > 0) {\n this.isub(BN.p)\n } else {\n this.strip()\n }\n\n return this\n}\n\nBN.prototype.redNeg = function () {\n if (this.isZero()) return BN.fromNumber(0)\n\n return BN.p.sub(this)\n}\n\nBN.prototype.redAdd = function (num) {\n return this.clone().redIAdd(num)\n}\n\nBN.prototype.redIAdd = function (num) {\n this.iadd(num)\n if (this.ucmp(BN.p) >= 0) this.isub(BN.p)\n\n return this\n}\n\nBN.prototype.redIAdd7 = function () {\n this.iuaddn(7)\n if (this.ucmp(BN.p) >= 0) this.isub(BN.p)\n\n return this\n}\n\nBN.prototype.redSub = function (num) {\n return this.clone().redISub(num)\n}\n\nBN.prototype.redISub = function (num) {\n this.isub(num)\n if (this.negative !== 0) this.iadd(BN.p)\n\n return this\n}\n\nBN.prototype.redMul = function (num) {\n return this.umul(num).redIReduce()\n}\n\nBN.prototype.redSqr = function () {\n return this.umul(this).redIReduce()\n}\n\nBN.prototype.redSqrt = function () {\n if (this.isZero()) return this.clone()\n\n var wv2 = this.redSqr()\n var wv4 = wv2.redSqr()\n var wv12 = wv4.redSqr().redMul(wv4)\n var wv14 = wv12.redMul(wv2)\n var wv15 = wv14.redMul(this)\n\n var out = wv15\n for (var i = 0; i < 54; ++i) out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv15)\n out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv14)\n for (i = 0; i < 5; ++i) out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv15)\n out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv12)\n out = out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12)\n\n if (out.redSqr().ucmp(this) === 0) {\n return out\n } else {\n return null\n }\n}\n\nBN.prototype.redInvm = function () {\n var a = this.clone()\n var b = BN.p.clone()\n\n var x1 = BN.fromNumber(1)\n var x2 = BN.fromNumber(0)\n\n while (a.gtOne() && b.gtOne()) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.ishrn(i)\n while (i-- > 0) {\n if (x1.isOdd()) x1.iadd(BN.p)\n x1.ishrn(1)\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.ishrn(j)\n while (j-- > 0) {\n if (x2.isOdd()) x2.iadd(BN.p)\n x2.ishrn(1)\n }\n }\n\n if (a.ucmp(b) >= 0) {\n a.isub(b)\n x1.isub(x2)\n } else {\n b.isub(a)\n x2.isub(x1)\n }\n }\n\n var res\n if (a.length === 1 && a.words[0] === 1) {\n res = x1\n } else {\n res = x2\n }\n\n if (res.negative !== 0) res.iadd(BN.p)\n\n if (res.negative !== 0) {\n res.negative = 0\n return res.redIReduce().redNeg()\n } else {\n return res.redIReduce()\n }\n}\n\nBN.prototype.getNAF = function (w) {\n var naf = []\n var ws = 1 << (w + 1)\n var wsm1 = ws - 1\n var ws2 = ws >> 1\n\n var k = this.clone()\n while (!k.isZero()) {\n for (var i = 0, m = 1; (k.words[0] & m) === 0 && i < 26; ++i, m <<= 1) naf.push(0)\n\n if (i !== 0) {\n k.ishrn(i)\n } else {\n var mod = k.words[0] & wsm1\n if (mod >= ws2) {\n naf.push(ws2 - mod)\n k.iuaddn(mod - ws2).ishrn(1)\n } else {\n naf.push(mod)\n k.words[0] -= mod\n if (!k.isZero()) {\n for (i = w - 1; i > 0; --i) naf.push(0)\n k.ishrn(w)\n }\n }\n }\n }\n\n return naf\n}\n\nBN.prototype.inspect = function () {\n if (this.isZero()) return '0'\n\n var buffer = this.toBuffer().toString('hex')\n for (var i = 0; buffer[i] === '0'; ++i);\n return buffer.slice(i)\n}\n\nBN.n = BN.fromBuffer(Buffer.from('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141', 'hex'))\nBN.nh = BN.n.clone().ishrn(1)\nBN.nc = BN.fromBuffer(Buffer.from('000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF', 'hex'))\nBN.p = BN.fromBuffer(Buffer.from('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', 'hex'))\nBN.psn = BN.p.sub(BN.n)\nBN.tmp = new BN()\nBN.tmp.words = new Array(10)\n\n// WTF?! it speed-up benchmark on ~20%\n;(function () {\n var x = BN.fromNumber(1)\n x.words[3] = 0\n})()\n\nmodule.exports = BN\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/js/bn/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/js/bn/optimized.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/js/bn/optimized.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nexports.umulTo10x10 = function (num1, num2, out) {\n var a = num1.words\n var b = num2.words\n var o = out.words\n var c = 0\n var lo\n var mid\n var hi\n var a0 = a[0] | 0\n var al0 = a0 & 0x1fff\n var ah0 = a0 >>> 13\n var a1 = a[1] | 0\n var al1 = a1 & 0x1fff\n var ah1 = a1 >>> 13\n var a2 = a[2] | 0\n var al2 = a2 & 0x1fff\n var ah2 = a2 >>> 13\n var a3 = a[3] | 0\n var al3 = a3 & 0x1fff\n var ah3 = a3 >>> 13\n var a4 = a[4] | 0\n var al4 = a4 & 0x1fff\n var ah4 = a4 >>> 13\n var a5 = a[5] | 0\n var al5 = a5 & 0x1fff\n var ah5 = a5 >>> 13\n var a6 = a[6] | 0\n var al6 = a6 & 0x1fff\n var ah6 = a6 >>> 13\n var a7 = a[7] | 0\n var al7 = a7 & 0x1fff\n var ah7 = a7 >>> 13\n var a8 = a[8] | 0\n var al8 = a8 & 0x1fff\n var ah8 = a8 >>> 13\n var a9 = a[9] | 0\n var al9 = a9 & 0x1fff\n var ah9 = a9 >>> 13\n var b0 = b[0] | 0\n var bl0 = b0 & 0x1fff\n var bh0 = b0 >>> 13\n var b1 = b[1] | 0\n var bl1 = b1 & 0x1fff\n var bh1 = b1 >>> 13\n var b2 = b[2] | 0\n var bl2 = b2 & 0x1fff\n var bh2 = b2 >>> 13\n var b3 = b[3] | 0\n var bl3 = b3 & 0x1fff\n var bh3 = b3 >>> 13\n var b4 = b[4] | 0\n var bl4 = b4 & 0x1fff\n var bh4 = b4 >>> 13\n var b5 = b[5] | 0\n var bl5 = b5 & 0x1fff\n var bh5 = b5 >>> 13\n var b6 = b[6] | 0\n var bl6 = b6 & 0x1fff\n var bh6 = b6 >>> 13\n var b7 = b[7] | 0\n var bl7 = b7 & 0x1fff\n var bh7 = b7 >>> 13\n var b8 = b[8] | 0\n var bl8 = b8 & 0x1fff\n var bh8 = b8 >>> 13\n var b9 = b[9] | 0\n var bl9 = b9 & 0x1fff\n var bh9 = b9 >>> 13\n\n out.length = 19\n /* k = 0 */\n lo = Math.imul(al0, bl0)\n mid = Math.imul(al0, bh0)\n mid += Math.imul(ah0, bl0)\n hi = Math.imul(ah0, bh0)\n var w0 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w0 >>> 26)\n w0 &= 0x3ffffff\n /* k = 1 */\n lo = Math.imul(al1, bl0)\n mid = Math.imul(al1, bh0)\n mid += Math.imul(ah1, bl0)\n hi = Math.imul(ah1, bh0)\n lo += Math.imul(al0, bl1)\n mid += Math.imul(al0, bh1)\n mid += Math.imul(ah0, bl1)\n hi += Math.imul(ah0, bh1)\n var w1 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w1 >>> 26)\n w1 &= 0x3ffffff\n /* k = 2 */\n lo = Math.imul(al2, bl0)\n mid = Math.imul(al2, bh0)\n mid += Math.imul(ah2, bl0)\n hi = Math.imul(ah2, bh0)\n lo += Math.imul(al1, bl1)\n mid += Math.imul(al1, bh1)\n mid += Math.imul(ah1, bl1)\n hi += Math.imul(ah1, bh1)\n lo += Math.imul(al0, bl2)\n mid += Math.imul(al0, bh2)\n mid += Math.imul(ah0, bl2)\n hi += Math.imul(ah0, bh2)\n var w2 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w2 >>> 26)\n w2 &= 0x3ffffff\n /* k = 3 */\n lo = Math.imul(al3, bl0)\n mid = Math.imul(al3, bh0)\n mid += Math.imul(ah3, bl0)\n hi = Math.imul(ah3, bh0)\n lo += Math.imul(al2, bl1)\n mid += Math.imul(al2, bh1)\n mid += Math.imul(ah2, bl1)\n hi += Math.imul(ah2, bh1)\n lo += Math.imul(al1, bl2)\n mid += Math.imul(al1, bh2)\n mid += Math.imul(ah1, bl2)\n hi += Math.imul(ah1, bh2)\n lo += Math.imul(al0, bl3)\n mid += Math.imul(al0, bh3)\n mid += Math.imul(ah0, bl3)\n hi += Math.imul(ah0, bh3)\n var w3 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w3 >>> 26)\n w3 &= 0x3ffffff\n /* k = 4 */\n lo = Math.imul(al4, bl0)\n mid = Math.imul(al4, bh0)\n mid += Math.imul(ah4, bl0)\n hi = Math.imul(ah4, bh0)\n lo += Math.imul(al3, bl1)\n mid += Math.imul(al3, bh1)\n mid += Math.imul(ah3, bl1)\n hi += Math.imul(ah3, bh1)\n lo += Math.imul(al2, bl2)\n mid += Math.imul(al2, bh2)\n mid += Math.imul(ah2, bl2)\n hi += Math.imul(ah2, bh2)\n lo += Math.imul(al1, bl3)\n mid += Math.imul(al1, bh3)\n mid += Math.imul(ah1, bl3)\n hi += Math.imul(ah1, bh3)\n lo += Math.imul(al0, bl4)\n mid += Math.imul(al0, bh4)\n mid += Math.imul(ah0, bl4)\n hi += Math.imul(ah0, bh4)\n var w4 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w4 >>> 26)\n w4 &= 0x3ffffff\n /* k = 5 */\n lo = Math.imul(al5, bl0)\n mid = Math.imul(al5, bh0)\n mid += Math.imul(ah5, bl0)\n hi = Math.imul(ah5, bh0)\n lo += Math.imul(al4, bl1)\n mid += Math.imul(al4, bh1)\n mid += Math.imul(ah4, bl1)\n hi += Math.imul(ah4, bh1)\n lo += Math.imul(al3, bl2)\n mid += Math.imul(al3, bh2)\n mid += Math.imul(ah3, bl2)\n hi += Math.imul(ah3, bh2)\n lo += Math.imul(al2, bl3)\n mid += Math.imul(al2, bh3)\n mid += Math.imul(ah2, bl3)\n hi += Math.imul(ah2, bh3)\n lo += Math.imul(al1, bl4)\n mid += Math.imul(al1, bh4)\n mid += Math.imul(ah1, bl4)\n hi += Math.imul(ah1, bh4)\n lo += Math.imul(al0, bl5)\n mid += Math.imul(al0, bh5)\n mid += Math.imul(ah0, bl5)\n hi += Math.imul(ah0, bh5)\n var w5 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w5 >>> 26)\n w5 &= 0x3ffffff\n /* k = 6 */\n lo = Math.imul(al6, bl0)\n mid = Math.imul(al6, bh0)\n mid += Math.imul(ah6, bl0)\n hi = Math.imul(ah6, bh0)\n lo += Math.imul(al5, bl1)\n mid += Math.imul(al5, bh1)\n mid += Math.imul(ah5, bl1)\n hi += Math.imul(ah5, bh1)\n lo += Math.imul(al4, bl2)\n mid += Math.imul(al4, bh2)\n mid += Math.imul(ah4, bl2)\n hi += Math.imul(ah4, bh2)\n lo += Math.imul(al3, bl3)\n mid += Math.imul(al3, bh3)\n mid += Math.imul(ah3, bl3)\n hi += Math.imul(ah3, bh3)\n lo += Math.imul(al2, bl4)\n mid += Math.imul(al2, bh4)\n mid += Math.imul(ah2, bl4)\n hi += Math.imul(ah2, bh4)\n lo += Math.imul(al1, bl5)\n mid += Math.imul(al1, bh5)\n mid += Math.imul(ah1, bl5)\n hi += Math.imul(ah1, bh5)\n lo += Math.imul(al0, bl6)\n mid += Math.imul(al0, bh6)\n mid += Math.imul(ah0, bl6)\n hi += Math.imul(ah0, bh6)\n var w6 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w6 >>> 26)\n w6 &= 0x3ffffff\n /* k = 7 */\n lo = Math.imul(al7, bl0)\n mid = Math.imul(al7, bh0)\n mid += Math.imul(ah7, bl0)\n hi = Math.imul(ah7, bh0)\n lo += Math.imul(al6, bl1)\n mid += Math.imul(al6, bh1)\n mid += Math.imul(ah6, bl1)\n hi += Math.imul(ah6, bh1)\n lo += Math.imul(al5, bl2)\n mid += Math.imul(al5, bh2)\n mid += Math.imul(ah5, bl2)\n hi += Math.imul(ah5, bh2)\n lo += Math.imul(al4, bl3)\n mid += Math.imul(al4, bh3)\n mid += Math.imul(ah4, bl3)\n hi += Math.imul(ah4, bh3)\n lo += Math.imul(al3, bl4)\n mid += Math.imul(al3, bh4)\n mid += Math.imul(ah3, bl4)\n hi += Math.imul(ah3, bh4)\n lo += Math.imul(al2, bl5)\n mid += Math.imul(al2, bh5)\n mid += Math.imul(ah2, bl5)\n hi += Math.imul(ah2, bh5)\n lo += Math.imul(al1, bl6)\n mid += Math.imul(al1, bh6)\n mid += Math.imul(ah1, bl6)\n hi += Math.imul(ah1, bh6)\n lo += Math.imul(al0, bl7)\n mid += Math.imul(al0, bh7)\n mid += Math.imul(ah0, bl7)\n hi += Math.imul(ah0, bh7)\n var w7 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w7 >>> 26)\n w7 &= 0x3ffffff\n /* k = 8 */\n lo = Math.imul(al8, bl0)\n mid = Math.imul(al8, bh0)\n mid += Math.imul(ah8, bl0)\n hi = Math.imul(ah8, bh0)\n lo += Math.imul(al7, bl1)\n mid += Math.imul(al7, bh1)\n mid += Math.imul(ah7, bl1)\n hi += Math.imul(ah7, bh1)\n lo += Math.imul(al6, bl2)\n mid += Math.imul(al6, bh2)\n mid += Math.imul(ah6, bl2)\n hi += Math.imul(ah6, bh2)\n lo += Math.imul(al5, bl3)\n mid += Math.imul(al5, bh3)\n mid += Math.imul(ah5, bl3)\n hi += Math.imul(ah5, bh3)\n lo += Math.imul(al4, bl4)\n mid += Math.imul(al4, bh4)\n mid += Math.imul(ah4, bl4)\n hi += Math.imul(ah4, bh4)\n lo += Math.imul(al3, bl5)\n mid += Math.imul(al3, bh5)\n mid += Math.imul(ah3, bl5)\n hi += Math.imul(ah3, bh5)\n lo += Math.imul(al2, bl6)\n mid += Math.imul(al2, bh6)\n mid += Math.imul(ah2, bl6)\n hi += Math.imul(ah2, bh6)\n lo += Math.imul(al1, bl7)\n mid += Math.imul(al1, bh7)\n mid += Math.imul(ah1, bl7)\n hi += Math.imul(ah1, bh7)\n lo += Math.imul(al0, bl8)\n mid += Math.imul(al0, bh8)\n mid += Math.imul(ah0, bl8)\n hi += Math.imul(ah0, bh8)\n var w8 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w8 >>> 26)\n w8 &= 0x3ffffff\n /* k = 9 */\n lo = Math.imul(al9, bl0)\n mid = Math.imul(al9, bh0)\n mid += Math.imul(ah9, bl0)\n hi = Math.imul(ah9, bh0)\n lo += Math.imul(al8, bl1)\n mid += Math.imul(al8, bh1)\n mid += Math.imul(ah8, bl1)\n hi += Math.imul(ah8, bh1)\n lo += Math.imul(al7, bl2)\n mid += Math.imul(al7, bh2)\n mid += Math.imul(ah7, bl2)\n hi += Math.imul(ah7, bh2)\n lo += Math.imul(al6, bl3)\n mid += Math.imul(al6, bh3)\n mid += Math.imul(ah6, bl3)\n hi += Math.imul(ah6, bh3)\n lo += Math.imul(al5, bl4)\n mid += Math.imul(al5, bh4)\n mid += Math.imul(ah5, bl4)\n hi += Math.imul(ah5, bh4)\n lo += Math.imul(al4, bl5)\n mid += Math.imul(al4, bh5)\n mid += Math.imul(ah4, bl5)\n hi += Math.imul(ah4, bh5)\n lo += Math.imul(al3, bl6)\n mid += Math.imul(al3, bh6)\n mid += Math.imul(ah3, bl6)\n hi += Math.imul(ah3, bh6)\n lo += Math.imul(al2, bl7)\n mid += Math.imul(al2, bh7)\n mid += Math.imul(ah2, bl7)\n hi += Math.imul(ah2, bh7)\n lo += Math.imul(al1, bl8)\n mid += Math.imul(al1, bh8)\n mid += Math.imul(ah1, bl8)\n hi += Math.imul(ah1, bh8)\n lo += Math.imul(al0, bl9)\n mid += Math.imul(al0, bh9)\n mid += Math.imul(ah0, bl9)\n hi += Math.imul(ah0, bh9)\n var w9 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w9 >>> 26)\n w9 &= 0x3ffffff\n /* k = 10 */\n lo = Math.imul(al9, bl1)\n mid = Math.imul(al9, bh1)\n mid += Math.imul(ah9, bl1)\n hi = Math.imul(ah9, bh1)\n lo += Math.imul(al8, bl2)\n mid += Math.imul(al8, bh2)\n mid += Math.imul(ah8, bl2)\n hi += Math.imul(ah8, bh2)\n lo += Math.imul(al7, bl3)\n mid += Math.imul(al7, bh3)\n mid += Math.imul(ah7, bl3)\n hi += Math.imul(ah7, bh3)\n lo += Math.imul(al6, bl4)\n mid += Math.imul(al6, bh4)\n mid += Math.imul(ah6, bl4)\n hi += Math.imul(ah6, bh4)\n lo += Math.imul(al5, bl5)\n mid += Math.imul(al5, bh5)\n mid += Math.imul(ah5, bl5)\n hi += Math.imul(ah5, bh5)\n lo += Math.imul(al4, bl6)\n mid += Math.imul(al4, bh6)\n mid += Math.imul(ah4, bl6)\n hi += Math.imul(ah4, bh6)\n lo += Math.imul(al3, bl7)\n mid += Math.imul(al3, bh7)\n mid += Math.imul(ah3, bl7)\n hi += Math.imul(ah3, bh7)\n lo += Math.imul(al2, bl8)\n mid += Math.imul(al2, bh8)\n mid += Math.imul(ah2, bl8)\n hi += Math.imul(ah2, bh8)\n lo += Math.imul(al1, bl9)\n mid += Math.imul(al1, bh9)\n mid += Math.imul(ah1, bl9)\n hi += Math.imul(ah1, bh9)\n var w10 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w10 >>> 26)\n w10 &= 0x3ffffff\n /* k = 11 */\n lo = Math.imul(al9, bl2)\n mid = Math.imul(al9, bh2)\n mid += Math.imul(ah9, bl2)\n hi = Math.imul(ah9, bh2)\n lo += Math.imul(al8, bl3)\n mid += Math.imul(al8, bh3)\n mid += Math.imul(ah8, bl3)\n hi += Math.imul(ah8, bh3)\n lo += Math.imul(al7, bl4)\n mid += Math.imul(al7, bh4)\n mid += Math.imul(ah7, bl4)\n hi += Math.imul(ah7, bh4)\n lo += Math.imul(al6, bl5)\n mid += Math.imul(al6, bh5)\n mid += Math.imul(ah6, bl5)\n hi += Math.imul(ah6, bh5)\n lo += Math.imul(al5, bl6)\n mid += Math.imul(al5, bh6)\n mid += Math.imul(ah5, bl6)\n hi += Math.imul(ah5, bh6)\n lo += Math.imul(al4, bl7)\n mid += Math.imul(al4, bh7)\n mid += Math.imul(ah4, bl7)\n hi += Math.imul(ah4, bh7)\n lo += Math.imul(al3, bl8)\n mid += Math.imul(al3, bh8)\n mid += Math.imul(ah3, bl8)\n hi += Math.imul(ah3, bh8)\n lo += Math.imul(al2, bl9)\n mid += Math.imul(al2, bh9)\n mid += Math.imul(ah2, bl9)\n hi += Math.imul(ah2, bh9)\n var w11 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w11 >>> 26)\n w11 &= 0x3ffffff\n /* k = 12 */\n lo = Math.imul(al9, bl3)\n mid = Math.imul(al9, bh3)\n mid += Math.imul(ah9, bl3)\n hi = Math.imul(ah9, bh3)\n lo += Math.imul(al8, bl4)\n mid += Math.imul(al8, bh4)\n mid += Math.imul(ah8, bl4)\n hi += Math.imul(ah8, bh4)\n lo += Math.imul(al7, bl5)\n mid += Math.imul(al7, bh5)\n mid += Math.imul(ah7, bl5)\n hi += Math.imul(ah7, bh5)\n lo += Math.imul(al6, bl6)\n mid += Math.imul(al6, bh6)\n mid += Math.imul(ah6, bl6)\n hi += Math.imul(ah6, bh6)\n lo += Math.imul(al5, bl7)\n mid += Math.imul(al5, bh7)\n mid += Math.imul(ah5, bl7)\n hi += Math.imul(ah5, bh7)\n lo += Math.imul(al4, bl8)\n mid += Math.imul(al4, bh8)\n mid += Math.imul(ah4, bl8)\n hi += Math.imul(ah4, bh8)\n lo += Math.imul(al3, bl9)\n mid += Math.imul(al3, bh9)\n mid += Math.imul(ah3, bl9)\n hi += Math.imul(ah3, bh9)\n var w12 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w12 >>> 26)\n w12 &= 0x3ffffff\n /* k = 13 */\n lo = Math.imul(al9, bl4)\n mid = Math.imul(al9, bh4)\n mid += Math.imul(ah9, bl4)\n hi = Math.imul(ah9, bh4)\n lo += Math.imul(al8, bl5)\n mid += Math.imul(al8, bh5)\n mid += Math.imul(ah8, bl5)\n hi += Math.imul(ah8, bh5)\n lo += Math.imul(al7, bl6)\n mid += Math.imul(al7, bh6)\n mid += Math.imul(ah7, bl6)\n hi += Math.imul(ah7, bh6)\n lo += Math.imul(al6, bl7)\n mid += Math.imul(al6, bh7)\n mid += Math.imul(ah6, bl7)\n hi += Math.imul(ah6, bh7)\n lo += Math.imul(al5, bl8)\n mid += Math.imul(al5, bh8)\n mid += Math.imul(ah5, bl8)\n hi += Math.imul(ah5, bh8)\n lo += Math.imul(al4, bl9)\n mid += Math.imul(al4, bh9)\n mid += Math.imul(ah4, bl9)\n hi += Math.imul(ah4, bh9)\n var w13 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w13 >>> 26)\n w13 &= 0x3ffffff\n /* k = 14 */\n lo = Math.imul(al9, bl5)\n mid = Math.imul(al9, bh5)\n mid += Math.imul(ah9, bl5)\n hi = Math.imul(ah9, bh5)\n lo += Math.imul(al8, bl6)\n mid += Math.imul(al8, bh6)\n mid += Math.imul(ah8, bl6)\n hi += Math.imul(ah8, bh6)\n lo += Math.imul(al7, bl7)\n mid += Math.imul(al7, bh7)\n mid += Math.imul(ah7, bl7)\n hi += Math.imul(ah7, bh7)\n lo += Math.imul(al6, bl8)\n mid += Math.imul(al6, bh8)\n mid += Math.imul(ah6, bl8)\n hi += Math.imul(ah6, bh8)\n lo += Math.imul(al5, bl9)\n mid += Math.imul(al5, bh9)\n mid += Math.imul(ah5, bl9)\n hi += Math.imul(ah5, bh9)\n var w14 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w14 >>> 26)\n w14 &= 0x3ffffff\n /* k = 15 */\n lo = Math.imul(al9, bl6)\n mid = Math.imul(al9, bh6)\n mid += Math.imul(ah9, bl6)\n hi = Math.imul(ah9, bh6)\n lo += Math.imul(al8, bl7)\n mid += Math.imul(al8, bh7)\n mid += Math.imul(ah8, bl7)\n hi += Math.imul(ah8, bh7)\n lo += Math.imul(al7, bl8)\n mid += Math.imul(al7, bh8)\n mid += Math.imul(ah7, bl8)\n hi += Math.imul(ah7, bh8)\n lo += Math.imul(al6, bl9)\n mid += Math.imul(al6, bh9)\n mid += Math.imul(ah6, bl9)\n hi += Math.imul(ah6, bh9)\n var w15 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w15 >>> 26)\n w15 &= 0x3ffffff\n /* k = 16 */\n lo = Math.imul(al9, bl7)\n mid = Math.imul(al9, bh7)\n mid += Math.imul(ah9, bl7)\n hi = Math.imul(ah9, bh7)\n lo += Math.imul(al8, bl8)\n mid += Math.imul(al8, bh8)\n mid += Math.imul(ah8, bl8)\n hi += Math.imul(ah8, bh8)\n lo += Math.imul(al7, bl9)\n mid += Math.imul(al7, bh9)\n mid += Math.imul(ah7, bl9)\n hi += Math.imul(ah7, bh9)\n var w16 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w16 >>> 26)\n w16 &= 0x3ffffff\n /* k = 17 */\n lo = Math.imul(al9, bl8)\n mid = Math.imul(al9, bh8)\n mid += Math.imul(ah9, bl8)\n hi = Math.imul(ah9, bh8)\n lo += Math.imul(al8, bl9)\n mid += Math.imul(al8, bh9)\n mid += Math.imul(ah8, bl9)\n hi += Math.imul(ah8, bh9)\n var w17 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w17 >>> 26)\n w17 &= 0x3ffffff\n /* k = 18 */\n lo = Math.imul(al9, bl9)\n mid = Math.imul(al9, bh9)\n mid += Math.imul(ah9, bl9)\n hi = Math.imul(ah9, bh9)\n var w18 = c + lo + ((mid & 0x1fff) << 13)\n c = hi + (mid >>> 13) + (w18 >>> 26)\n w18 &= 0x3ffffff\n o[0] = w0\n o[1] = w1\n o[2] = w2\n o[3] = w3\n o[4] = w4\n o[5] = w5\n o[6] = w6\n o[7] = w7\n o[8] = w8\n o[9] = w9\n o[10] = w10\n o[11] = w11\n o[12] = w12\n o[13] = w13\n o[14] = w14\n o[15] = w15\n o[16] = w16\n o[17] = w17\n o[18] = w18\n if (c !== 0) {\n o[19] = c\n out.length++\n }\n return out\n}\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/js/bn/optimized.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/js/ecjpoint.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/js/ecjpoint.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar BN = __webpack_require__(/*! ./bn */ \"./node_modules/secp256k1/lib/js/bn/index.js\")\n\nfunction ECJPoint (x, y, z) {\n if (x === null && y === null && z === null) {\n this.x = ECJPoint.one\n this.y = ECJPoint.one\n this.z = ECJPoint.zero\n } else {\n this.x = x\n this.y = y\n this.z = z\n }\n\n this.zOne = this.z === ECJPoint.one\n}\n\nECJPoint.zero = BN.fromNumber(0)\nECJPoint.one = BN.fromNumber(1)\n\nECJPoint.prototype.neg = function () {\n if (this.inf) return this\n\n return new ECJPoint(this.x, this.y.redNeg(), this.z)\n}\n\nECJPoint.prototype.add = function (p) {\n // O + P = P\n if (this.inf) return p\n\n // P + O = P\n if (p.inf) return this\n\n // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-1998-cmo-2\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr()\n var z2 = this.z.redSqr()\n var u1 = this.x.redMul(pz2)\n var u2 = p.x.redMul(z2)\n var s1 = this.y.redMul(pz2).redMul(p.z)\n var s2 = p.y.redMul(z2).redMul(this.z)\n\n var h = u1.redSub(u2)\n var r = s1.redSub(s2)\n if (h.isZero()) {\n if (r.isZero()) return this.dbl()\n return new ECJPoint(null, null, null)\n }\n\n var h2 = h.redSqr()\n var v = u1.redMul(h2)\n var h3 = h2.redMul(h)\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v)\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3))\n var nz = this.z.redMul(p.z).redMul(h)\n\n return new ECJPoint(nx, ny, nz)\n}\n\nECJPoint.prototype.mixedAdd = function (p) {\n // O + P = P\n if (this.inf) return p.toECJPoint()\n\n // P + O = P\n if (p.inf) return this\n\n // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-1998-cmo-2\n // with p.z = 1\n // 8M + 3S + 7A\n var z2 = this.z.redSqr()\n var u1 = this.x\n var u2 = p.x.redMul(z2)\n var s1 = this.y\n var s2 = p.y.redMul(z2).redMul(this.z)\n\n var h = u1.redSub(u2)\n var r = s1.redSub(s2)\n if (h.isZero()) {\n if (r.isZero()) return this.dbl()\n return new ECJPoint(null, null, null)\n }\n\n var h2 = h.redSqr()\n var v = u1.redMul(h2)\n var h3 = h2.redMul(h)\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v)\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3))\n var nz = this.z.redMul(h)\n\n return new ECJPoint(nx, ny, nz)\n}\n\nECJPoint.prototype.dbl = function () {\n if (this.inf) return this\n\n var nx\n var ny\n var nz\n\n // Z = 1\n if (this.zOne) {\n // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl\n // 1M + 5S + 6A + 3*2 + 1*3 + 1*8\n\n // XX = X1^2\n var xx = this.x.redSqr()\n // YY = Y1^2\n var yy = this.y.redSqr()\n // YYYY = YY^2\n var yyyy = yy.redSqr()\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy)\n s = s.redIAdd(s)\n // M = 3 * XX\n var m = xx.redAdd(xx).redIAdd(xx)\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s)\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy).redIAdd(yyyy).redIAdd(yyyy)\n\n // X3 = T\n nx = t\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8)\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y)\n } else {\n // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n // 2M + 5S + 6A + 3*2 + 1*3 + 1*8\n\n // A = X1^2\n var a = this.x.redSqr()\n // B = Y1^2\n var b = this.y.redSqr()\n // C = B^2\n var c = b.redSqr()\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c)\n d = d.redIAdd(d)\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a)\n // F = E^2\n var f = e.redSqr()\n\n // 8 * C\n var c8 = c.redIAdd(c).redIAdd(c).redIAdd(c)\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d)\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8)\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z)\n nz = nz.redIAdd(nz)\n }\n\n return new ECJPoint(nx, ny, nz)\n}\n\nECJPoint.prototype.dblp = function (pow) {\n if (pow === 0 || this.inf) return this\n\n var point = this\n for (var i = 0; i < pow; i++) point = point.dbl()\n\n return point\n}\n\nObject.defineProperty(ECJPoint.prototype, 'inf', {\n enumerable: true,\n get: function () {\n return this.z.isZero()\n }\n})\n\nmodule.exports = ECJPoint\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/js/ecjpoint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/js/ecpoint.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/js/ecpoint.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar BN = __webpack_require__(/*! ./bn */ \"./node_modules/secp256k1/lib/js/bn/index.js\")\nvar ECJPoint = __webpack_require__(/*! ./ecjpoint */ \"./node_modules/secp256k1/lib/js/ecjpoint.js\")\n\nfunction ECPoint (x, y) {\n if (x === null && y === null) {\n this.x = this.y = null\n this.inf = true\n } else {\n this.x = x\n this.y = y\n this.inf = false\n }\n}\n\nECPoint.fromPublicKey = function (publicKey) {\n var first = publicKey[0]\n var x\n var y\n\n if (publicKey.length === 33 && (first === 0x02 || first === 0x03)) {\n x = BN.fromBuffer(publicKey.slice(1, 33))\n\n // overflow\n if (x.ucmp(BN.p) >= 0) return null\n\n // create from X\n y = x.redSqr().redMul(x).redIAdd7().redSqrt()\n if (y === null) return null\n if ((first === 0x03) !== y.isOdd()) y = y.redNeg()\n\n return new ECPoint(x, y)\n }\n\n if (publicKey.length === 65 && (first === 0x04 || first === 0x06 || first === 0x07)) {\n x = BN.fromBuffer(publicKey.slice(1, 33))\n y = BN.fromBuffer(publicKey.slice(33, 65))\n\n // overflow\n if (x.ucmp(BN.p) >= 0 || y.ucmp(BN.p) >= 0) return null\n\n // is odd flag\n if ((first === 0x06 || first === 0x07) && y.isOdd() !== (first === 0x07)) return null\n\n // x*x*x + 7 = y*y\n if (x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr()) !== 0) return null\n\n return new ECPoint(x, y)\n }\n\n return null\n}\n\nECPoint.prototype.toPublicKey = function (compressed) {\n var x = this.x\n var y = this.y\n var publicKey\n\n if (compressed) {\n publicKey = Buffer.alloc(33)\n publicKey[0] = y.isOdd() ? 0x03 : 0x02\n x.toBuffer().copy(publicKey, 1)\n } else {\n publicKey = Buffer.alloc(65)\n publicKey[0] = 0x04\n x.toBuffer().copy(publicKey, 1)\n y.toBuffer().copy(publicKey, 33)\n }\n\n return publicKey\n}\n\nECPoint.fromECJPoint = function (p) {\n if (p.inf) return new ECPoint(null, null)\n\n var zinv = p.z.redInvm()\n var zinv2 = zinv.redSqr()\n var ax = p.x.redMul(zinv2)\n var ay = p.y.redMul(zinv2).redMul(zinv)\n\n return new ECPoint(ax, ay)\n}\n\nECPoint.prototype.toECJPoint = function () {\n if (this.inf) return new ECJPoint(null, null, null)\n\n return new ECJPoint(this.x, this.y, ECJPoint.one)\n}\n\nECPoint.prototype.neg = function () {\n if (this.inf) return this\n\n return new ECPoint(this.x, this.y.redNeg())\n}\n\nECPoint.prototype.add = function (p) {\n // O + P = P\n if (this.inf) return p\n\n // P + O = P\n if (p.inf) return this\n\n if (this.x.ucmp(p.x) === 0) {\n // P + P = 2P\n if (this.y.ucmp(p.y) === 0) return this.dbl()\n // P + (-P) = O\n return new ECPoint(null, null)\n }\n\n // s = (y - yp) / (x - xp)\n // nx = s^2 - x - xp\n // ny = s * (x - nx) - y\n var s = this.y.redSub(p.y)\n if (!s.isZero()) s = s.redMul(this.x.redSub(p.x).redInvm())\n\n var nx = s.redSqr().redISub(this.x).redISub(p.x)\n var ny = s.redMul(this.x.redSub(nx)).redISub(this.y)\n return new ECPoint(nx, ny)\n}\n\nECPoint.prototype.dbl = function () {\n if (this.inf) return this\n\n // 2P = O\n var yy = this.y.redAdd(this.y)\n if (yy.isZero()) return new ECPoint(null, null)\n\n // s = (3 * x^2) / (2 * y)\n // nx = s^2 - 2*x\n // ny = s * (x - nx) - y\n var x2 = this.x.redSqr()\n var s = x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm())\n\n var nx = s.redSqr().redISub(this.x.redAdd(this.x))\n var ny = s.redMul(this.x.redSub(nx)).redISub(this.y)\n return new ECPoint(nx, ny)\n}\n\nECPoint.prototype.mul = function (num) {\n // Algorithm 3.36 Window NAF method for point multiplication\n var nafPoints = this._getNAFPoints(4)\n var points = nafPoints.points\n\n // Get NAF form\n var naf = num.getNAF(nafPoints.wnd)\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = new ECJPoint(null, null, null)\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var k = 0; i >= 0 && naf[i] === 0; i--, ++k);\n if (i >= 0) k += 1\n acc = acc.dblp(k)\n\n if (i < 0) break\n\n // J +- P\n var z = naf[i]\n if (z > 0) {\n acc = acc.mixedAdd(points[(z - 1) >> 1])\n } else {\n acc = acc.mixedAdd(points[(-z - 1) >> 1].neg())\n }\n }\n\n return ECPoint.fromECJPoint(acc)\n}\n\nECPoint.prototype._getNAFPoints1 = function () {\n return { wnd: 1, points: [this] }\n}\n\nECPoint.prototype._getNAFPoints = function (wnd) {\n var points = new Array((1 << wnd) - 1)\n points[0] = this\n var dbl = this.dbl()\n for (var i = 1; i < points.length; ++i) points[i] = points[i - 1].add(dbl)\n return { wnd: wnd, points: points }\n}\n\nmodule.exports = ECPoint\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/js/ecpoint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/js/ecpointg.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/js/ecpointg.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar BN = __webpack_require__(/*! ./bn */ \"./node_modules/secp256k1/lib/js/bn/index.js\")\nvar ECPoint = __webpack_require__(/*! ./ecpoint */ \"./node_modules/secp256k1/lib/js/ecpoint.js\")\nvar ECJPoint = __webpack_require__(/*! ./ecjpoint */ \"./node_modules/secp256k1/lib/js/ecjpoint.js\")\n\nfunction ECPointG () {\n this.x = BN.fromBuffer(Buffer.from('79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798', 'hex'))\n this.y = BN.fromBuffer(Buffer.from('483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8', 'hex'))\n this.inf = false\n\n this._precompute()\n}\n\nECPointG.prototype._precompute = function () {\n var ecpoint = new ECPoint(this.x, this.y)\n\n var dstep = 4\n var points = new Array(1 + Math.ceil(257 / dstep))\n var acc = points[0] = ecpoint\n for (var i = 1; i < points.length; ++i) {\n for (var j = 0; j < dstep; j++) acc = acc.dbl()\n points[i] = acc\n }\n\n this.precomputed = {\n naf: ecpoint._getNAFPoints(7),\n doubles: {\n step: dstep,\n points: points,\n negpoints: points.map(function (p) { return p.neg() })\n }\n }\n}\n\nECPointG.prototype.mul = function (num) {\n // Algorithm 3.42 Fixed-base NAF windowing method for point multiplication\n var step = this.precomputed.doubles.step\n var points = this.precomputed.doubles.points\n var negpoints = this.precomputed.doubles.negpoints\n\n var naf = num.getNAF(1)\n var I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3\n\n // Translate into more windowed form\n var repr = []\n for (var j = 0; j < naf.length; j += step) {\n var nafW = 0\n for (var k = j + step - 1; k >= j; k--) nafW = (nafW << 1) + naf[k]\n repr.push(nafW)\n }\n\n var a = new ECJPoint(null, null, null)\n var b = new ECJPoint(null, null, null)\n for (var i = I; i > 0; i--) {\n for (var jj = 0; jj < repr.length; jj++) {\n if (repr[jj] === i) {\n b = b.mixedAdd(points[jj])\n } else if (repr[jj] === -i) {\n b = b.mixedAdd(negpoints[jj])\n }\n }\n\n a = a.add(b)\n }\n\n return ECPoint.fromECJPoint(a)\n}\n\nECPointG.prototype.mulAdd = function (k1, p2, k2) {\n var nafPointsP1 = this.precomputed.naf\n var nafPointsP2 = p2._getNAFPoints1()\n var wnd = [nafPointsP1.points, nafPointsP2.points]\n var naf = [k1.getNAF(nafPointsP1.wnd), k2.getNAF(nafPointsP2.wnd)]\n\n var acc = new ECJPoint(null, null, null)\n var tmp = [null, null]\n for (var i = Math.max(naf[0].length, naf[1].length); i >= 0; i--) {\n var k = 0\n\n for (; i >= 0; ++k, --i) {\n tmp[0] = naf[0][i] | 0\n tmp[1] = naf[1][i] | 0\n\n if (tmp[0] !== 0 || tmp[1] !== 0) break\n }\n\n if (i >= 0) k += 1\n acc = acc.dblp(k)\n\n if (i < 0) break\n\n for (var jj = 0; jj < 2; jj++) {\n var z = tmp[jj]\n var p\n if (z === 0) {\n continue\n } else if (z > 0) {\n p = wnd[jj][z >> 1]\n } else if (z < 0) {\n p = wnd[jj][-z >> 1].neg()\n }\n\n // hack: ECPoint detection\n if (p.z === undefined) {\n acc = acc.mixedAdd(p)\n } else {\n acc = acc.add(p)\n }\n }\n }\n\n return acc\n}\n\nmodule.exports = new ECPointG()\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/js/ecpointg.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/js/index.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/js/index.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\")\nvar HmacDRBG = __webpack_require__(/*! drbg.js/hmac */ \"./node_modules/drbg.js/hmac.js\")\nvar messages = __webpack_require__(/*! ../messages.json */ \"./node_modules/secp256k1/lib/messages.json\")\nvar BN = __webpack_require__(/*! ./bn */ \"./node_modules/secp256k1/lib/js/bn/index.js\")\nvar ECPoint = __webpack_require__(/*! ./ecpoint */ \"./node_modules/secp256k1/lib/js/ecpoint.js\")\nvar g = __webpack_require__(/*! ./ecpointg */ \"./node_modules/secp256k1/lib/js/ecpointg.js\")\n\nexports.privateKeyVerify = function (privateKey) {\n var bn = BN.fromBuffer(privateKey)\n return !(bn.isOverflow() || bn.isZero())\n}\n\nexports.privateKeyExport = function (privateKey, compressed) {\n var d = BN.fromBuffer(privateKey)\n if (d.isOverflow() || d.isZero()) throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL)\n\n return g.mul(d).toPublicKey(compressed)\n}\n\nexports.privateKeyNegate = function (privateKey) {\n var bn = BN.fromBuffer(privateKey)\n if (bn.isZero()) return Buffer.alloc(32)\n\n if (bn.ucmp(BN.n) > 0) bn.isub(BN.n)\n return BN.n.sub(bn).toBuffer()\n}\n\nexports.privateKeyModInverse = function (privateKey) {\n var bn = BN.fromBuffer(privateKey)\n if (bn.isOverflow() || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_RANGE_INVALID)\n\n return bn.uinvm().toBuffer()\n}\n\nexports.privateKeyTweakAdd = function (privateKey, tweak) {\n var bn = BN.fromBuffer(tweak)\n if (bn.isOverflow()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n bn.iadd(BN.fromBuffer(privateKey))\n if (bn.isOverflow()) bn.isub(BN.n)\n if (bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n return bn.toBuffer()\n}\n\nexports.privateKeyTweakMul = function (privateKey, tweak) {\n var bn = BN.fromBuffer(tweak)\n if (bn.isOverflow() || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL)\n\n var d = BN.fromBuffer(privateKey)\n return bn.umul(d).ureduce().toBuffer()\n}\n\nexports.publicKeyCreate = function (privateKey, compressed) {\n var d = BN.fromBuffer(privateKey)\n if (d.isOverflow() || d.isZero()) throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL)\n\n return g.mul(d).toPublicKey(compressed)\n}\n\nexports.publicKeyConvert = function (publicKey, compressed) {\n var point = ECPoint.fromPublicKey(publicKey)\n if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n return point.toPublicKey(compressed)\n}\n\nexports.publicKeyVerify = function (publicKey) {\n return ECPoint.fromPublicKey(publicKey) !== null\n}\n\nexports.publicKeyTweakAdd = function (publicKey, tweak, compressed) {\n var point = ECPoint.fromPublicKey(publicKey)\n if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n tweak = BN.fromBuffer(tweak)\n if (tweak.isOverflow()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)\n\n var result = g.mul(tweak).add(point)\n if (result.inf) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)\n\n return result.toPublicKey(compressed)\n}\n\nexports.publicKeyTweakMul = function (publicKey, tweak, compressed) {\n var point = ECPoint.fromPublicKey(publicKey)\n if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n tweak = BN.fromBuffer(tweak)\n if (tweak.isOverflow() || tweak.isZero()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL)\n\n return point.mul(tweak).toPublicKey(compressed)\n}\n\nexports.publicKeyCombine = function (publicKeys, compressed) {\n var points = new Array(publicKeys.length)\n for (var i = 0; i < publicKeys.length; ++i) {\n points[i] = ECPoint.fromPublicKey(publicKeys[i])\n if (points[i] === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n }\n\n var point = points[0]\n for (var j = 1; j < points.length; ++j) point = point.add(points[j])\n if (point.inf) throw new Error(messages.EC_PUBLIC_KEY_COMBINE_FAIL)\n\n return point.toPublicKey(compressed)\n}\n\nexports.signatureNormalize = function (signature) {\n var r = BN.fromBuffer(signature.slice(0, 32))\n var s = BN.fromBuffer(signature.slice(32, 64))\n if (r.isOverflow() || s.isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n var result = Buffer.from(signature)\n if (s.isHigh()) BN.n.sub(s).toBuffer().copy(result, 32)\n\n return result\n}\n\nexports.signatureExport = function (signature) {\n var r = signature.slice(0, 32)\n var s = signature.slice(32, 64)\n if (BN.fromBuffer(r).isOverflow() || BN.fromBuffer(s).isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n return { r: r, s: s }\n}\n\nexports.signatureImport = function (sigObj) {\n var r = BN.fromBuffer(sigObj.r)\n if (r.isOverflow()) r = BN.fromNumber(0)\n\n var s = BN.fromBuffer(sigObj.s)\n if (s.isOverflow()) s = BN.fromNumber(0)\n\n return Buffer.concat([r.toBuffer(), s.toBuffer()])\n}\n\nexports.sign = function (message, privateKey, noncefn, data) {\n var d = BN.fromBuffer(privateKey)\n if (d.isOverflow() || d.isZero()) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n if (noncefn === null) {\n var drbg = new HmacDRBG('sha256', privateKey, message, data)\n noncefn = function () { return drbg.generate(32) }\n }\n\n var bnMessage = BN.fromBuffer(message)\n for (var count = 0; ; ++count) {\n var nonce = noncefn(message, privateKey, null, data, count)\n if (!Buffer.isBuffer(nonce) || nonce.length !== 32) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n var k = BN.fromBuffer(nonce)\n if (k.isOverflow() || k.isZero()) continue\n\n var kp = g.mul(k)\n var r = kp.x.fireduce()\n if (r.isZero()) continue\n\n var s = k.uinvm().umul(r.umul(d).ureduce().iadd(bnMessage).fireduce()).ureduce()\n if (s.isZero()) continue\n\n var recovery = (kp.x.ucmp(r) !== 0 ? 2 : 0) | (kp.y.isOdd() ? 1 : 0)\n if (s.isHigh()) {\n s = BN.n.sub(s)\n recovery ^= 1\n }\n\n return {\n signature: Buffer.concat([r.toBuffer(), s.toBuffer()]),\n recovery: recovery\n }\n }\n}\n\nexports.verify = function (message, signature, publicKey) {\n var sigr = BN.fromBuffer(signature.slice(0, 32))\n var sigs = BN.fromBuffer(signature.slice(32, 64))\n if (sigr.isOverflow() || sigs.isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n if (sigs.isHigh() || sigr.isZero() || sigs.isZero()) return false\n\n var pub = ECPoint.fromPublicKey(publicKey)\n if (pub === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n var sinv = sigs.uinvm()\n var u1 = sinv.umul(BN.fromBuffer(message)).ureduce()\n var u2 = sinv.umul(sigr).ureduce()\n var point = g.mulAdd(u1, pub, u2)\n if (point.inf) return false\n\n // return ECPoint.fromECJPoint(point).x.fireduce().ucmp(sigr) === 0\n // Inversion-free\n var z2 = point.z.redSqr()\n if (sigr.redMul(z2).ucmp(point.x) === 0) return true\n if (sigr.ucmp(BN.psn) >= 0) return false\n\n return sigr.iadd(BN.psn).redMul(z2).ucmp(point.x) === 0\n}\n\nexports.recover = function (message, signature, recovery, compressed) {\n var sigr = BN.fromBuffer(signature.slice(0, 32))\n var sigs = BN.fromBuffer(signature.slice(32, 64))\n if (sigr.isOverflow() || sigs.isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n do {\n if (sigr.isZero() || sigs.isZero()) break\n\n var kpx = sigr\n if (recovery >> 1) {\n if (kpx.ucmp(BN.psn) >= 0) break\n kpx = sigr.add(BN.n)\n }\n\n var kpPublicKey = Buffer.concat([Buffer.from([0x02 + (recovery & 0x01)]), kpx.toBuffer()])\n var kp = ECPoint.fromPublicKey(kpPublicKey)\n if (kp === null) break\n\n var rInv = sigr.uinvm()\n var s1 = BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce()\n var s2 = sigs.umul(rInv).ureduce()\n var point = ECPoint.fromECJPoint(g.mulAdd(s1, kp, s2))\n return point.toPublicKey(compressed)\n } while (false)\n\n throw new Error(messages.ECDSA_RECOVER_FAIL)\n}\n\nexports.ecdh = function (publicKey, privateKey) {\n var shared = exports.ecdhUnsafe(publicKey, privateKey, true)\n return createHash('sha256').update(shared).digest()\n}\n\nexports.ecdhUnsafe = function (publicKey, privateKey, compressed) {\n var point = ECPoint.fromPublicKey(publicKey)\n if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n var scalar = BN.fromBuffer(privateKey)\n if (scalar.isOverflow() || scalar.isZero()) throw new Error(messages.ECDH_FAIL)\n\n return point.mul(scalar).toPublicKey(compressed)\n}\n\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/js/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/secp256k1/lib/messages.json":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/secp256k1/lib/messages.json ***!
|
||
\**************************************************/
|
||
/*! exports provided: COMPRESSED_TYPE_INVALID, EC_PRIVATE_KEY_TYPE_INVALID, EC_PRIVATE_KEY_LENGTH_INVALID, EC_PRIVATE_KEY_RANGE_INVALID, EC_PRIVATE_KEY_TWEAK_ADD_FAIL, EC_PRIVATE_KEY_TWEAK_MUL_FAIL, EC_PRIVATE_KEY_EXPORT_DER_FAIL, EC_PRIVATE_KEY_IMPORT_DER_FAIL, EC_PUBLIC_KEYS_TYPE_INVALID, EC_PUBLIC_KEYS_LENGTH_INVALID, EC_PUBLIC_KEY_TYPE_INVALID, EC_PUBLIC_KEY_LENGTH_INVALID, EC_PUBLIC_KEY_PARSE_FAIL, EC_PUBLIC_KEY_CREATE_FAIL, EC_PUBLIC_KEY_TWEAK_ADD_FAIL, EC_PUBLIC_KEY_TWEAK_MUL_FAIL, EC_PUBLIC_KEY_COMBINE_FAIL, ECDH_FAIL, ECDSA_SIGNATURE_TYPE_INVALID, ECDSA_SIGNATURE_LENGTH_INVALID, ECDSA_SIGNATURE_PARSE_FAIL, ECDSA_SIGNATURE_PARSE_DER_FAIL, ECDSA_SIGNATURE_SERIALIZE_DER_FAIL, ECDSA_SIGN_FAIL, ECDSA_RECOVER_FAIL, MSG32_TYPE_INVALID, MSG32_LENGTH_INVALID, OPTIONS_TYPE_INVALID, OPTIONS_DATA_TYPE_INVALID, OPTIONS_DATA_LENGTH_INVALID, OPTIONS_NONCEFN_TYPE_INVALID, RECOVERY_ID_TYPE_INVALID, RECOVERY_ID_VALUE_INVALID, TWEAK_TYPE_INVALID, TWEAK_LENGTH_INVALID, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"COMPRESSED_TYPE_INVALID\":\"compressed should be a boolean\",\"EC_PRIVATE_KEY_TYPE_INVALID\":\"private key should be a Buffer\",\"EC_PRIVATE_KEY_LENGTH_INVALID\":\"private key length is invalid\",\"EC_PRIVATE_KEY_RANGE_INVALID\":\"private key range is invalid\",\"EC_PRIVATE_KEY_TWEAK_ADD_FAIL\":\"tweak out of range or resulting private key is invalid\",\"EC_PRIVATE_KEY_TWEAK_MUL_FAIL\":\"tweak out of range\",\"EC_PRIVATE_KEY_EXPORT_DER_FAIL\":\"couldn't export to DER format\",\"EC_PRIVATE_KEY_IMPORT_DER_FAIL\":\"couldn't import from DER format\",\"EC_PUBLIC_KEYS_TYPE_INVALID\":\"public keys should be an Array\",\"EC_PUBLIC_KEYS_LENGTH_INVALID\":\"public keys Array should have at least 1 element\",\"EC_PUBLIC_KEY_TYPE_INVALID\":\"public key should be a Buffer\",\"EC_PUBLIC_KEY_LENGTH_INVALID\":\"public key length is invalid\",\"EC_PUBLIC_KEY_PARSE_FAIL\":\"the public key could not be parsed or is invalid\",\"EC_PUBLIC_KEY_CREATE_FAIL\":\"private was invalid, try again\",\"EC_PUBLIC_KEY_TWEAK_ADD_FAIL\":\"tweak out of range or resulting public key is invalid\",\"EC_PUBLIC_KEY_TWEAK_MUL_FAIL\":\"tweak out of range\",\"EC_PUBLIC_KEY_COMBINE_FAIL\":\"the sum of the public keys is not valid\",\"ECDH_FAIL\":\"scalar was invalid (zero or overflow)\",\"ECDSA_SIGNATURE_TYPE_INVALID\":\"signature should be a Buffer\",\"ECDSA_SIGNATURE_LENGTH_INVALID\":\"signature length is invalid\",\"ECDSA_SIGNATURE_PARSE_FAIL\":\"couldn't parse signature\",\"ECDSA_SIGNATURE_PARSE_DER_FAIL\":\"couldn't parse DER signature\",\"ECDSA_SIGNATURE_SERIALIZE_DER_FAIL\":\"couldn't serialize signature to DER format\",\"ECDSA_SIGN_FAIL\":\"nonce generation function failed or private key is invalid\",\"ECDSA_RECOVER_FAIL\":\"couldn't recover public key from signature\",\"MSG32_TYPE_INVALID\":\"message should be a Buffer\",\"MSG32_LENGTH_INVALID\":\"message length is invalid\",\"OPTIONS_TYPE_INVALID\":\"options should be an Object\",\"OPTIONS_DATA_TYPE_INVALID\":\"options.data should be a Buffer\",\"OPTIONS_DATA_LENGTH_INVALID\":\"options.data length is invalid\",\"OPTIONS_NONCEFN_TYPE_INVALID\":\"options.noncefn should be a Function\",\"RECOVERY_ID_TYPE_INVALID\":\"recovery should be a Number\",\"RECOVERY_ID_VALUE_INVALID\":\"recovery should have value between -1 and 4\",\"TWEAK_TYPE_INVALID\":\"tweak should be a Buffer\",\"TWEAK_LENGTH_INVALID\":\"tweak length is invalid\"};\n\n//# sourceURL=webpack:///./node_modules/secp256k1/lib/messages.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/setimmediate/setImmediate.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/setimmediate/setImmediate.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var script = doc.createElement(\"script\");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don't get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === \"[object process]\") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\n // For IE 6–8\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === \"undefined\" ? typeof global === \"undefined\" ? this : global : self));\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/setimmediate/setImmediate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/hash.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/sha.js/hash.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/hash.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/sha.js/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = __webpack_require__(/*! ./sha */ \"./node_modules/sha.js/sha.js\")\nexports.sha1 = __webpack_require__(/*! ./sha1 */ \"./node_modules/sha.js/sha1.js\")\nexports.sha224 = __webpack_require__(/*! ./sha224 */ \"./node_modules/sha.js/sha224.js\")\nexports.sha256 = __webpack_require__(/*! ./sha256 */ \"./node_modules/sha.js/sha256.js\")\nexports.sha384 = __webpack_require__(/*! ./sha384 */ \"./node_modules/sha.js/sha384.js\")\nexports.sha512 = __webpack_require__(/*! ./sha512 */ \"./node_modules/sha.js/sha512.js\")\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/sha.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/sha.js/sha.js ***!
|
||
\************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Hash = __webpack_require__(/*! ./hash */ \"./node_modules/sha.js/hash.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/sha.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/sha1.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/sha.js/sha1.js ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Hash = __webpack_require__(/*! ./hash */ \"./node_modules/sha.js/hash.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha1 () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha1, Hash)\n\nSha1.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl1 (num) {\n return (num << 1) | (num >>> 31)\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha1.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha1.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha1\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/sha1.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/sha224.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/sha.js/sha224.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Sha256 = __webpack_require__(/*! ./sha256 */ \"./node_modules/sha.js/sha256.js\")\nvar Hash = __webpack_require__(/*! ./hash */ \"./node_modules/sha.js/hash.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar W = new Array(64)\n\nfunction Sha224 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha224, Sha256)\n\nSha224.prototype.init = function () {\n this._a = 0xc1059ed8\n this._b = 0x367cd507\n this._c = 0x3070dd17\n this._d = 0xf70e5939\n this._e = 0xffc00b31\n this._f = 0x68581511\n this._g = 0x64f98fa7\n this._h = 0xbefa4fa4\n\n return this\n}\n\nSha224.prototype._hash = function () {\n var H = Buffer.allocUnsafe(28)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n\n return H\n}\n\nmodule.exports = Sha224\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/sha224.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/sha256.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/sha.js/sha256.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Hash = __webpack_require__(/*! ./hash */ \"./node_modules/sha.js/hash.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/sha256.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/sha384.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/sha.js/sha384.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar SHA512 = __webpack_require__(/*! ./sha512 */ \"./node_modules/sha.js/sha512.js\")\nvar Hash = __webpack_require__(/*! ./hash */ \"./node_modules/sha.js/hash.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar W = new Array(160)\n\nfunction Sha384 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha384, SHA512)\n\nSha384.prototype.init = function () {\n this._ah = 0xcbbb9d5d\n this._bh = 0x629a292a\n this._ch = 0x9159015a\n this._dh = 0x152fecd8\n this._eh = 0x67332667\n this._fh = 0x8eb44a87\n this._gh = 0xdb0c2e0d\n this._hh = 0x47b5481d\n\n this._al = 0xc1059ed8\n this._bl = 0x367cd507\n this._cl = 0x3070dd17\n this._dl = 0xf70e5939\n this._el = 0xffc00b31\n this._fl = 0x68581511\n this._gl = 0x64f98fa7\n this._hl = 0xbefa4fa4\n\n return this\n}\n\nSha384.prototype._hash = function () {\n var H = Buffer.allocUnsafe(48)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n\n return H\n}\n\nmodule.exports = Sha384\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/sha384.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha.js/sha512.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/sha.js/sha512.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Hash = __webpack_require__(/*! ./hash */ \"./node_modules/sha.js/hash.js\")\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n\n\n//# sourceURL=webpack:///./node_modules/sha.js/sha512.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sha256/lib/sha256.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/sha256/lib/sha256.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("!function(globals) {\n'use strict'\n\nvar _imports = {}\n\nif ( true && module.exports) { //CommonJS\n _imports.bytesToHex = __webpack_require__(/*! convert-hex */ \"./node_modules/convert-hex/convert-hex.js\").bytesToHex\n _imports.convertString = __webpack_require__(/*! convert-string */ \"./node_modules/convert-string/convert-string.js\")\n module.exports = sha256\n} else {\n _imports.bytesToHex = globals.convertHex.bytesToHex\n _imports.convertString = globals.convertString\n globals.sha256 = sha256\n}\n\n/*\nCryptoJS v3.1.2\ncode.google.com/p/crypto-js\n(c) 2009-2013 by Jeff Mott. All rights reserved.\ncode.google.com/p/crypto-js/wiki/License\n*/\n\n// Initialization round constants tables\nvar K = []\n\n// Compute constants\n!function () {\n function isPrime(n) {\n var sqrtN = Math.sqrt(n);\n for (var factor = 2; factor <= sqrtN; factor++) {\n if (!(n % factor)) return false\n }\n\n return true\n }\n\n function getFractionalBits(n) {\n return ((n - (n | 0)) * 0x100000000) | 0\n }\n\n var n = 2\n var nPrime = 0\n while (nPrime < 64) {\n if (isPrime(n)) {\n K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3))\n nPrime++\n }\n\n n++\n }\n}()\n\nvar bytesToWords = function (bytes) {\n var words = []\n for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {\n words[b >>> 5] |= bytes[i] << (24 - b % 32)\n }\n return words\n}\n\nvar wordsToBytes = function (words) {\n var bytes = []\n for (var b = 0; b < words.length * 32; b += 8) {\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF)\n }\n return bytes\n}\n\n// Reusable object\nvar W = []\n\nvar processBlock = function (H, M, offset) {\n // Working variables\n var a = H[0], b = H[1], c = H[2], d = H[3]\n var e = H[4], f = H[5], g = H[6], h = H[7]\n\n // Computation\n for (var i = 0; i < 64; i++) {\n if (i < 16) {\n W[i] = M[offset + i] | 0\n } else {\n var gamma0x = W[i - 15]\n var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n ((gamma0x << 14) | (gamma0x >>> 18)) ^\n (gamma0x >>> 3)\n\n var gamma1x = W[i - 2];\n var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n ((gamma1x << 13) | (gamma1x >>> 19)) ^\n (gamma1x >>> 10)\n\n W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n }\n\n var ch = (e & f) ^ (~e & g);\n var maj = (a & b) ^ (a & c) ^ (b & c);\n\n var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n var t1 = h + sigma1 + ch + K[i] + W[i];\n var t2 = sigma0 + maj;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n // Intermediate hash value\n H[0] = (H[0] + a) | 0;\n H[1] = (H[1] + b) | 0;\n H[2] = (H[2] + c) | 0;\n H[3] = (H[3] + d) | 0;\n H[4] = (H[4] + e) | 0;\n H[5] = (H[5] + f) | 0;\n H[6] = (H[6] + g) | 0;\n H[7] = (H[7] + h) | 0;\n}\n\nfunction sha256(message, options) {;\n if (message.constructor === String) {\n message = _imports.convertString.UTF8.stringToBytes(message);\n }\n\n var H =[ 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,\n 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 ];\n\n var m = bytesToWords(message);\n var l = message.length * 8;\n\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >> 9) << 4) + 15] = l;\n\n for (var i=0 ; i<m.length; i += 16) {\n processBlock(H, m, i);\n }\n\n var digestbytes = wordsToBytes(H);\n return options && options.asBytes ? digestbytes :\n options && options.asString ? _imports.convertString.bytesToString(digestbytes) :\n _imports.bytesToHex(digestbytes)\n}\n\nsha256.x2 = function(message, options) {\n return sha256(sha256(message, { asBytes:true }), options)\n}\n\n}(this);\n\n\n//# sourceURL=webpack:///./node_modules/sha256/lib/sha256.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/signed-varint/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/signed-varint/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var varint = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\")\nexports.encode = function encode (v, b, o) {\n v = v >= 0 ? v*2 : v*-2 - 1\n var r = varint.encode(v, b, o)\n encode.bytes = varint.encode.bytes\n return r\n}\nexports.decode = function decode (b, o) {\n var v = varint.decode(b, o)\n decode.bytes = varint.decode.bytes\n return v & 1 ? (v+1) / -2 : v / 2\n}\n\nexports.encodingLength = function (v) {\n return varint.encodingLength(v >= 0 ? v*2 : v*-2 - 1)\n}\n\n\n//# sourceURL=webpack:///./node_modules/signed-varint/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-concat/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/simple-concat/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function (stream, cb) {\n var chunks = []\n stream.on('data', function (chunk) {\n chunks.push(chunk)\n })\n stream.once('end', function () {\n if (cb) cb(null, Buffer.concat(chunks))\n cb = null\n })\n stream.once('error', function (err) {\n if (cb) cb(err)\n cb = null\n })\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/simple-concat/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-get/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/simple-get/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = simpleGet\n\nconst concat = __webpack_require__(/*! simple-concat */ \"./node_modules/simple-concat/index.js\")\nconst decompressResponse = __webpack_require__(/*! decompress-response */ 17) // excluded from browser build\nconst http = __webpack_require__(/*! http */ \"./node_modules/stream-http/index.js\")\nconst https = __webpack_require__(/*! https */ \"./node_modules/https-browserify/index.js\")\nconst once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\nconst querystring = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\")\nconst url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\n\nconst isStream = o => o !== null && typeof o === 'object' && typeof o.pipe === 'function'\n\nfunction simpleGet (opts, cb) {\n opts = Object.assign({ maxRedirects: 10 }, typeof opts === 'string' ? { url: opts } : opts)\n cb = once(cb)\n\n if (opts.url) {\n const { hostname, port, protocol, auth, path } = url.parse(opts.url)\n delete opts.url\n if (!hostname && !port && !protocol && !auth) opts.path = path // Relative redirect\n else Object.assign(opts, { hostname, port, protocol, auth, path }) // Absolute redirect\n }\n\n const headers = { 'accept-encoding': 'gzip, deflate' }\n if (opts.headers) Object.keys(opts.headers).forEach(k => (headers[k.toLowerCase()] = opts.headers[k]))\n opts.headers = headers\n\n let body\n if (opts.body) {\n body = opts.json && !isStream(opts.body) ? JSON.stringify(opts.body) : opts.body\n } else if (opts.form) {\n body = typeof opts.form === 'string' ? opts.form : querystring.stringify(opts.form)\n opts.headers['content-type'] = 'application/x-www-form-urlencoded'\n }\n\n if (body) {\n if (!opts.method) opts.method = 'POST'\n if (!isStream(body)) opts.headers['content-length'] = Buffer.byteLength(body)\n if (opts.json && !opts.form) opts.headers['content-type'] = 'application/json'\n }\n delete opts.body; delete opts.form\n\n if (opts.json) opts.headers.accept = 'application/json'\n if (opts.method) opts.method = opts.method.toUpperCase()\n\n const protocol = opts.protocol === 'https:' ? https : http // Support http/https urls\n const req = protocol.request(opts, res => {\n if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {\n opts.url = res.headers.location // Follow 3xx redirects\n delete opts.headers.host // Discard `host` header on redirect (see #32)\n res.resume() // Discard response\n\n if (opts.method === 'POST' && [301, 302].includes(res.statusCode)) {\n opts.method = 'GET' // On 301/302 redirect, change POST to GET (see #35)\n delete opts.headers['content-length']; delete opts.headers['content-type']\n }\n\n if (opts.maxRedirects-- === 0) return cb(new Error('too many redirects'))\n else return simpleGet(opts, cb)\n }\n\n const tryUnzip = typeof decompressResponse === 'function' && opts.method !== 'HEAD'\n cb(null, tryUnzip ? decompressResponse(res) : res)\n })\n req.on('timeout', () => {\n req.abort()\n cb(new Error('Request timed out'))\n })\n req.on('error', cb)\n\n if (isStream(body)) body.on('error', cb).pipe(req)\n else req.end(body)\n\n return req\n}\n\nsimpleGet.concat = (opts, cb) => {\n return simpleGet(opts, (err, res) => {\n if (err) return cb(err)\n concat(res, (err, data) => {\n if (err) return cb(err)\n if (opts.json) {\n try {\n data = JSON.parse(data.toString())\n } catch (err) {\n return cb(err, res, data)\n }\n }\n cb(null, res, data)\n })\n })\n}\n\n;['get', 'post', 'put', 'patch', 'head', 'delete'].forEach(method => {\n simpleGet[method] = (opts, cb) => {\n if (typeof opts === 'string') opts = {url: opts}\n return simpleGet(Object.assign({ method: method.toUpperCase() }, opts), cb)\n }\n})\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/simple-get/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/simple-peer/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = Peer\n\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('simple-peer')\nvar getBrowserRTC = __webpack_require__(/*! get-browser-rtc */ \"./node_modules/get-browser-rtc/index.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/simple-peer/node_modules/readable-stream/readable-browser.js\")\n\nvar MAX_BUFFERED_AMOUNT = 64 * 1024\nvar ICECOMPLETE_TIMEOUT = 5 * 1000\nvar CHANNEL_CLOSING_TIMEOUT = 5 * 1000\n\ninherits(Peer, stream.Duplex)\n\n/**\n * WebRTC peer connection. Same API as node core `net.Socket`, plus a few extra methods.\n * Duplex stream.\n * @param {Object} opts\n */\nfunction Peer (opts) {\n var self = this\n if (!(self instanceof Peer)) return new Peer(opts)\n\n self._id = randombytes(4).toString('hex').slice(0, 7)\n self._debug('new peer %o', opts)\n\n opts = Object.assign({\n allowHalfOpen: false\n }, opts)\n\n stream.Duplex.call(self, opts)\n\n self.channelName = opts.initiator\n ? opts.channelName || randombytes(20).toString('hex')\n : null\n\n self.initiator = opts.initiator || false\n self.channelConfig = opts.channelConfig || Peer.channelConfig\n self.config = Object.assign({}, Peer.config, opts.config)\n self.offerOptions = opts.offerOptions || {}\n self.answerOptions = opts.answerOptions || {}\n self.sdpTransform = opts.sdpTransform || function (sdp) { return sdp }\n self.streams = opts.streams || (opts.stream ? [opts.stream] : []) // support old \"stream\" option\n self.trickle = opts.trickle !== undefined ? opts.trickle : true\n self.allowHalfTrickle = opts.allowHalfTrickle !== undefined ? opts.allowHalfTrickle : false\n self.iceCompleteTimeout = opts.iceCompleteTimeout || ICECOMPLETE_TIMEOUT\n\n self.destroyed = false\n self.connected = false\n\n self.remoteAddress = undefined\n self.remoteFamily = undefined\n self.remotePort = undefined\n self.localAddress = undefined\n self.localFamily = undefined\n self.localPort = undefined\n\n self._wrtc = (opts.wrtc && typeof opts.wrtc === 'object')\n ? opts.wrtc\n : getBrowserRTC()\n\n if (!self._wrtc) {\n if (typeof window === 'undefined') {\n throw makeError('No WebRTC support: Specify `opts.wrtc` option in this environment', 'ERR_WEBRTC_SUPPORT')\n } else {\n throw makeError('No WebRTC support: Not a supported browser', 'ERR_WEBRTC_SUPPORT')\n }\n }\n\n self._pcReady = false\n self._channelReady = false\n self._iceComplete = false // ice candidate trickle done (got null candidate)\n self._iceCompleteTimer = null // send an offer/answer anyway after some timeout\n self._channel = null\n self._pendingCandidates = []\n\n self._isNegotiating = !self.initiator // is this peer waiting for negotiation to complete?\n self._batchedNegotiation = false // batch synchronous negotiations\n self._queuedNegotiation = false // is there a queued negotiation request?\n self._sendersAwaitingStable = []\n self._senderMap = new Map()\n self._firstStable = true\n self._closingInterval = null\n\n self._remoteTracks = []\n self._remoteStreams = []\n\n self._chunk = null\n self._cb = null\n self._interval = null\n\n try {\n self._pc = new (self._wrtc.RTCPeerConnection)(self.config)\n } catch (err) {\n self.destroy(err)\n }\n\n // We prefer feature detection whenever possible, but sometimes that's not\n // possible for certain implementations.\n self._isReactNativeWebrtc = typeof self._pc._peerConnectionId === 'number'\n\n self._pc.oniceconnectionstatechange = function () {\n self._onIceStateChange()\n }\n self._pc.onicegatheringstatechange = function () {\n self._onIceStateChange()\n }\n self._pc.onsignalingstatechange = function () {\n self._onSignalingStateChange()\n }\n self._pc.onicecandidate = function (event) {\n self._onIceCandidate(event)\n }\n\n // Other spec events, unused by this implementation:\n // - onconnectionstatechange\n // - onicecandidateerror\n // - onfingerprintfailure\n // - onnegotiationneeded\n\n if (self.initiator) {\n self._setupData({\n channel: self._pc.createDataChannel(self.channelName, self.channelConfig)\n })\n } else {\n self._pc.ondatachannel = function (event) {\n self._setupData(event)\n }\n }\n\n if (self.streams) {\n self.streams.forEach(function (stream) {\n self.addStream(stream)\n })\n }\n self._pc.ontrack = function (event) {\n self._onTrack(event)\n }\n\n if (self.initiator) {\n self._needsNegotiation()\n }\n\n self._onFinishBound = function () {\n self._onFinish()\n }\n self.once('finish', self._onFinishBound)\n}\n\nPeer.WEBRTC_SUPPORT = !!getBrowserRTC()\n\n/**\n * Expose peer and data channel config for overriding all Peer\n * instances. Otherwise, just set opts.config or opts.channelConfig\n * when constructing a Peer.\n */\nPeer.config = {\n iceServers: [\n {\n urls: 'stun:stun.l.google.com:19302'\n },\n {\n urls: 'stun:global.stun.twilio.com:3478?transport=udp'\n }\n ],\n sdpSemantics: 'unified-plan'\n}\nPeer.channelConfig = {}\n\nObject.defineProperty(Peer.prototype, 'bufferSize', {\n get: function () {\n var self = this\n return (self._channel && self._channel.bufferedAmount) || 0\n }\n})\n\nPeer.prototype.address = function () {\n var self = this\n return { port: self.localPort, family: self.localFamily, address: self.localAddress }\n}\n\nPeer.prototype.signal = function (data) {\n var self = this\n if (self.destroyed) throw makeError('cannot signal after peer is destroyed', 'ERR_SIGNALING')\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data)\n } catch (err) {\n data = {}\n }\n }\n self._debug('signal()')\n\n if (data.renegotiate && self.initiator) {\n self._debug('got request to renegotiate')\n self._needsNegotiation()\n }\n if (data.transceiverRequest && self.initiator) {\n self._debug('got request for transceiver')\n self.addTransceiver(data.transceiverRequest.kind, data.transceiverRequest.init)\n }\n if (data.candidate) {\n if (self._pc.localDescription && self._pc.localDescription.type && self._pc.remoteDescription && self._pc.remoteDescription.type) {\n self._addIceCandidate(data.candidate)\n } else {\n self._pendingCandidates.push(data.candidate)\n }\n }\n if (data.sdp) {\n self._pc.setRemoteDescription(new (self._wrtc.RTCSessionDescription)(data)).then(function () {\n if (self.destroyed) return\n\n self._pendingCandidates.forEach(function (candidate) {\n self._addIceCandidate(candidate)\n })\n self._pendingCandidates = []\n\n if (self._pc.remoteDescription.type === 'offer') self._createAnswer()\n }).catch(function (err) { self.destroy(makeError(err, 'ERR_SET_REMOTE_DESCRIPTION')) })\n }\n if (!data.sdp && !data.candidate && !data.renegotiate && !data.transceiverRequest) {\n self.destroy(makeError('signal() called with invalid signal data', 'ERR_SIGNALING'))\n }\n}\n\nPeer.prototype._addIceCandidate = function (candidate) {\n var self = this\n self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate)).catch(function (err) {\n // HACK: node-webrtc throws an incorrect error https://github.com/node-webrtc/node-webrtc/issues/498\n if (self._pc.signalingState !== 'closed' && err.message === 'Failed to set ICE candidate; RTCPeerConnection is closed.') {\n return self._debug('ignoring incorrect wrtc error')\n }\n self.destroy(makeError(err, 'ERR_ADD_ICE_CANDIDATE'))\n })\n}\n\n/**\n * Send text/binary data to the remote peer.\n * @param {ArrayBufferView|ArrayBuffer|Buffer|string|Blob} chunk\n */\nPeer.prototype.send = function (chunk) {\n var self = this\n self._channel.send(chunk)\n}\n\n/**\n * Add a Transceiver to the connection.\n * @param {String} kind\n * @param {Object} init\n */\nPeer.prototype.addTransceiver = function (kind, init) {\n var self = this\n\n self._debug('addTransceiver()')\n\n if (self.initiator) {\n try {\n self._pc.addTransceiver(kind, init)\n self._needsNegotiation()\n } catch (err) {\n self.destroy(err)\n }\n } else {\n self.emit('signal', { // request initiator to renegotiate\n transceiverRequest: { kind, init }\n })\n }\n}\n\n/**\n * Add a MediaStream to the connection.\n * @param {MediaStream} stream\n */\nPeer.prototype.addStream = function (stream) {\n var self = this\n\n self._debug('addStream()')\n\n stream.getTracks().forEach(function (track) {\n self.addTrack(track, stream)\n })\n}\n\n/**\n * Add a MediaStreamTrack to the connection.\n * @param {MediaStreamTrack} track\n * @param {MediaStream} stream\n */\nPeer.prototype.addTrack = function (track, stream) {\n var self = this\n\n self._debug('addTrack()')\n\n var submap = self._senderMap.get(track) || new Map() // nested Maps map [track, stream] to sender\n var sender = submap.get(stream)\n if (!sender) {\n sender = self._pc.addTrack(track, stream)\n submap.set(stream, sender)\n self._senderMap.set(track, submap)\n self._needsNegotiation()\n } else if (sender.removed) {\n self.destroy(makeError('Track has been removed. You should enable/disable tracks that you want to re-add.'), 'ERR_SENDER_REMOVED')\n } else {\n self.destroy(makeError('Track has already been added to that stream.'), 'ERR_SENDER_ALREADY_ADDED')\n }\n}\n\n/**\n * Replace a MediaStreamTrack by another in the connection.\n * @param {MediaStreamTrack} oldTrack\n * @param {MediaStreamTrack} newTrack\n * @param {MediaStream} stream\n */\nPeer.prototype.replaceTrack = function (oldTrack, newTrack, stream) {\n var self = this\n\n self._debug('replaceTrack()')\n\n var submap = self._senderMap.get(oldTrack)\n var sender = submap ? submap.get(stream) : null\n if (!sender) {\n self.destroy(makeError('Cannot replace track that was never added.'), 'ERR_TRACK_NOT_ADDED')\n }\n if (newTrack) self._senderMap.set(newTrack, submap)\n\n if (sender.replaceTrack != null) {\n sender.replaceTrack(newTrack)\n } else {\n self.destroy(makeError('replaceTrack is not supported in this browser', 'ERR_UNSUPPORTED_REPLACETRACK'))\n }\n}\n\n/**\n * Remove a MediaStreamTrack from the connection.\n * @param {MediaStreamTrack} track\n * @param {MediaStream} stream\n */\nPeer.prototype.removeTrack = function (track, stream) {\n var self = this\n\n self._debug('removeSender()')\n\n var submap = self._senderMap.get(track)\n var sender = submap ? submap.get(stream) : null\n if (!sender) {\n self.destroy(makeError('Cannot remove track that was never added.', 'ERR_TRACK_NOT_ADDED'))\n }\n try {\n sender.removed = true\n self._pc.removeTrack(sender)\n } catch (err) {\n if (err.name === 'NS_ERROR_UNEXPECTED') {\n self._sendersAwaitingStable.push(sender) // HACK: Firefox must wait until (signalingState === stable) https://bugzilla.mozilla.org/show_bug.cgi?id=1133874\n } else {\n self.destroy(err)\n }\n }\n self._needsNegotiation()\n}\n\n/**\n * Remove a MediaStream from the connection.\n * @param {MediaStream} stream\n */\nPeer.prototype.removeStream = function (stream) {\n var self = this\n\n self._debug('removeSenders()')\n\n stream.getTracks().forEach(function (track) {\n self.removeTrack(track, stream)\n })\n}\n\nPeer.prototype._needsNegotiation = function () {\n var self = this\n\n self._debug('_needsNegotiation')\n if (self._batchedNegotiation) return // batch synchronous renegotiations\n self._batchedNegotiation = true\n setTimeout(function () {\n self._batchedNegotiation = false\n self._debug('starting batched negotiation')\n self.negotiate()\n }, 0)\n}\n\nPeer.prototype.negotiate = function () {\n var self = this\n\n if (self.initiator) {\n if (self._isNegotiating) {\n self._queuedNegotiation = true\n self._debug('already negotiating, queueing')\n } else {\n self._debug('start negotiation')\n setTimeout(() => { // HACK: Chrome crashes if we immediately call createOffer\n self._createOffer()\n }, 0)\n }\n } else {\n if (!self._isNegotiating) {\n self._debug('requesting negotiation from initiator')\n self.emit('signal', { // request initiator to renegotiate\n renegotiate: true\n })\n }\n }\n self._isNegotiating = true\n}\n\n// TODO: Delete this method once readable-stream is updated to contain a default\n// implementation of destroy() that automatically calls _destroy()\n// See: https://github.com/nodejs/readable-stream/issues/283\nPeer.prototype.destroy = function (err) {\n var self = this\n self._destroy(err, function () {})\n}\n\nPeer.prototype._destroy = function (err, cb) {\n var self = this\n if (self.destroyed) return\n\n self._debug('destroy (error: %s)', err && (err.message || err))\n\n self.readable = self.writable = false\n\n if (!self._readableState.ended) self.push(null)\n if (!self._writableState.finished) self.end()\n\n self.destroyed = true\n self.connected = false\n self._pcReady = false\n self._channelReady = false\n self._remoteTracks = null\n self._remoteStreams = null\n self._senderMap = null\n\n clearInterval(self._closingInterval)\n self._closingInterval = null\n\n clearInterval(self._interval)\n self._interval = null\n self._chunk = null\n self._cb = null\n\n if (self._onFinishBound) self.removeListener('finish', self._onFinishBound)\n self._onFinishBound = null\n\n if (self._channel) {\n try {\n self._channel.close()\n } catch (err) {}\n\n self._channel.onmessage = null\n self._channel.onopen = null\n self._channel.onclose = null\n self._channel.onerror = null\n }\n if (self._pc) {\n try {\n self._pc.close()\n } catch (err) {}\n\n self._pc.oniceconnectionstatechange = null\n self._pc.onicegatheringstatechange = null\n self._pc.onsignalingstatechange = null\n self._pc.onicecandidate = null\n self._pc.ontrack = null\n self._pc.ondatachannel = null\n }\n self._pc = null\n self._channel = null\n\n if (err) self.emit('error', err)\n self.emit('close')\n cb()\n}\n\nPeer.prototype._setupData = function (event) {\n var self = this\n if (!event.channel) {\n // In some situations `pc.createDataChannel()` returns `undefined` (in wrtc),\n // which is invalid behavior. Handle it gracefully.\n // See: https://github.com/feross/simple-peer/issues/163\n return self.destroy(makeError('Data channel event is missing `channel` property', 'ERR_DATA_CHANNEL'))\n }\n\n self._channel = event.channel\n self._channel.binaryType = 'arraybuffer'\n\n if (typeof self._channel.bufferedAmountLowThreshold === 'number') {\n self._channel.bufferedAmountLowThreshold = MAX_BUFFERED_AMOUNT\n }\n\n self.channelName = self._channel.label\n\n self._channel.onmessage = function (event) {\n self._onChannelMessage(event)\n }\n self._channel.onbufferedamountlow = function () {\n self._onChannelBufferedAmountLow()\n }\n self._channel.onopen = function () {\n self._onChannelOpen()\n }\n self._channel.onclose = function () {\n self._onChannelClose()\n }\n self._channel.onerror = function (err) {\n self.destroy(makeError(err, 'ERR_DATA_CHANNEL'))\n }\n\n // HACK: Chrome will sometimes get stuck in readyState \"closing\", let's check for this condition\n // https://bugs.chromium.org/p/chromium/issues/detail?id=882743\n var isClosing = false\n self._closingInterval = setInterval(function () { // No \"onclosing\" event\n if (self._channel && self._channel.readyState === 'closing') {\n if (isClosing) self._onChannelClose() // closing timed out: equivalent to onclose firing\n isClosing = true\n } else {\n isClosing = false\n }\n }, CHANNEL_CLOSING_TIMEOUT)\n}\n\nPeer.prototype._read = function () {}\n\nPeer.prototype._write = function (chunk, encoding, cb) {\n var self = this\n if (self.destroyed) return cb(makeError('cannot write after peer is destroyed', 'ERR_DATA_CHANNEL'))\n\n if (self.connected) {\n try {\n self.send(chunk)\n } catch (err) {\n return self.destroy(makeError(err, 'ERR_DATA_CHANNEL'))\n }\n if (self._channel.bufferedAmount > MAX_BUFFERED_AMOUNT) {\n self._debug('start backpressure: bufferedAmount %d', self._channel.bufferedAmount)\n self._cb = cb\n } else {\n cb(null)\n }\n } else {\n self._debug('write before connect')\n self._chunk = chunk\n self._cb = cb\n }\n}\n\n// When stream finishes writing, close socket. Half open connections are not\n// supported.\nPeer.prototype._onFinish = function () {\n var self = this\n if (self.destroyed) return\n\n if (self.connected) {\n destroySoon()\n } else {\n self.once('connect', destroySoon)\n }\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n function destroySoon () {\n setTimeout(function () {\n self.destroy()\n }, 1000)\n }\n}\n\nPeer.prototype._startIceCompleteTimeout = function () {\n var self = this\n if (self.destroyed) return\n if (self._iceCompleteTimer) return\n self._debug('started iceComplete timeout')\n self._iceCompleteTimer = setTimeout(function () {\n if (!self._iceComplete) {\n self._iceComplete = true\n self._debug('iceComplete timeout completed')\n self.emit('iceTimeout')\n self.emit('_iceComplete')\n }\n }, self.iceCompleteTimeout)\n}\n\nPeer.prototype._createOffer = function () {\n var self = this\n if (self.destroyed) return\n\n self._pc.createOffer(self.offerOptions).then(function (offer) {\n if (self.destroyed) return\n if (!self.trickle && !self.allowHalfTrickle) offer.sdp = filterTrickle(offer.sdp)\n offer.sdp = self.sdpTransform(offer.sdp)\n self._pc.setLocalDescription(offer).then(onSuccess).catch(onError)\n\n function onSuccess () {\n self._debug('createOffer success')\n if (self.destroyed) return\n if (self.trickle || self._iceComplete) sendOffer()\n else self.once('_iceComplete', sendOffer) // wait for candidates\n }\n\n function onError (err) {\n self.destroy(makeError(err, 'ERR_SET_LOCAL_DESCRIPTION'))\n }\n\n function sendOffer () {\n if (self.destroyed) return\n var signal = self._pc.localDescription || offer\n self._debug('signal')\n self.emit('signal', {\n type: signal.type,\n sdp: signal.sdp\n })\n }\n }).catch(function (err) { self.destroy(makeError(err, 'ERR_CREATE_OFFER')) })\n}\n\nPeer.prototype._requestMissingTransceivers = function () {\n var self = this\n\n if (self._pc.getTransceivers) {\n self._pc.getTransceivers().forEach(transceiver => {\n if (!transceiver.mid && transceiver.sender.track) {\n self.addTransceiver(transceiver.sender.track.kind)\n }\n })\n }\n}\n\nPeer.prototype._createAnswer = function () {\n var self = this\n if (self.destroyed) return\n\n self._pc.createAnswer(self.answerOptions).then(function (answer) {\n if (self.destroyed) return\n if (!self.trickle && !self.allowHalfTrickle) answer.sdp = filterTrickle(answer.sdp)\n answer.sdp = self.sdpTransform(answer.sdp)\n self._pc.setLocalDescription(answer).then(onSuccess).catch(onError)\n\n function onSuccess () {\n if (self.destroyed) return\n if (self.trickle || self._iceComplete) sendAnswer()\n else self.once('_iceComplete', sendAnswer)\n }\n\n function onError (err) {\n self.destroy(makeError(err, 'ERR_SET_LOCAL_DESCRIPTION'))\n }\n\n function sendAnswer () {\n if (self.destroyed) return\n var signal = self._pc.localDescription || answer\n self._debug('signal')\n self.emit('signal', {\n type: signal.type,\n sdp: signal.sdp\n })\n if (!self.initiator) self._requestMissingTransceivers()\n }\n }).catch(function (err) { self.destroy(makeError(err, 'ERR_CREATE_ANSWER')) })\n}\n\nPeer.prototype._onIceStateChange = function () {\n var self = this\n if (self.destroyed) return\n var iceConnectionState = self._pc.iceConnectionState\n var iceGatheringState = self._pc.iceGatheringState\n\n self._debug(\n 'iceStateChange (connection: %s) (gathering: %s)',\n iceConnectionState,\n iceGatheringState\n )\n self.emit('iceStateChange', iceConnectionState, iceGatheringState)\n\n if (iceConnectionState === 'connected' || iceConnectionState === 'completed') {\n self._pcReady = true\n self._maybeReady()\n }\n if (iceConnectionState === 'failed') {\n self.destroy(makeError('Ice connection failed.', 'ERR_ICE_CONNECTION_FAILURE'))\n }\n if (iceConnectionState === 'closed') {\n self.destroy(makeError('Ice connection closed.', 'ERR_ICE_CONNECTION_CLOSED'))\n }\n}\n\nPeer.prototype.getStats = function (cb) {\n var self = this\n\n // Promise-based getStats() (standard)\n if (self._pc.getStats.length === 0) {\n self._pc.getStats().then(function (res) {\n var reports = []\n res.forEach(function (report) {\n reports.push(flattenValues(report))\n })\n cb(null, reports)\n }, function (err) { cb(err) })\n\n // Two-parameter callback-based getStats() (deprecated, former standard)\n } else if (self._isReactNativeWebrtc) {\n self._pc.getStats(null, function (res) {\n var reports = []\n res.forEach(function (report) {\n reports.push(flattenValues(report))\n })\n cb(null, reports)\n }, function (err) { cb(err) })\n\n // Single-parameter callback-based getStats() (non-standard)\n } else if (self._pc.getStats.length > 0) {\n self._pc.getStats(function (res) {\n // If we destroy connection in `connect` callback this code might happen to run when actual connection is already closed\n if (self.destroyed) return\n\n var reports = []\n res.result().forEach(function (result) {\n var report = {}\n result.names().forEach(function (name) {\n report[name] = result.stat(name)\n })\n report.id = result.id\n report.type = result.type\n report.timestamp = result.timestamp\n reports.push(flattenValues(report))\n })\n cb(null, reports)\n }, function (err) { cb(err) })\n\n // Unknown browser, skip getStats() since it's anyone's guess which style of\n // getStats() they implement.\n } else {\n cb(null, [])\n }\n\n // statreports can come with a value array instead of properties\n function flattenValues (report) {\n if (Object.prototype.toString.call(report.values) === '[object Array]') {\n report.values.forEach(function (value) {\n Object.assign(report, value)\n })\n }\n return report\n }\n}\n\nPeer.prototype._maybeReady = function () {\n var self = this\n self._debug('maybeReady pc %s channel %s', self._pcReady, self._channelReady)\n if (self.connected || self._connecting || !self._pcReady || !self._channelReady) return\n\n self._connecting = true\n\n // HACK: We can't rely on order here, for details see https://github.com/js-platform/node-webrtc/issues/339\n function findCandidatePair () {\n if (self.destroyed) return\n\n self.getStats(function (err, items) {\n if (self.destroyed) return\n\n // Treat getStats error as non-fatal. It's not essential.\n if (err) items = []\n\n var remoteCandidates = {}\n var localCandidates = {}\n var candidatePairs = {}\n var foundSelectedCandidatePair = false\n\n items.forEach(function (item) {\n // TODO: Once all browsers support the hyphenated stats report types, remove\n // the non-hypenated ones\n if (item.type === 'remotecandidate' || item.type === 'remote-candidate') {\n remoteCandidates[item.id] = item\n }\n if (item.type === 'localcandidate' || item.type === 'local-candidate') {\n localCandidates[item.id] = item\n }\n if (item.type === 'candidatepair' || item.type === 'candidate-pair') {\n candidatePairs[item.id] = item\n }\n })\n\n items.forEach(function (item) {\n // Spec-compliant\n if (item.type === 'transport' && item.selectedCandidatePairId) {\n setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId])\n }\n\n // Old implementations\n if (\n (item.type === 'googCandidatePair' && item.googActiveConnection === 'true') ||\n ((item.type === 'candidatepair' || item.type === 'candidate-pair') && item.selected)\n ) {\n setSelectedCandidatePair(item)\n }\n })\n\n function setSelectedCandidatePair (selectedCandidatePair) {\n foundSelectedCandidatePair = true\n\n var local = localCandidates[selectedCandidatePair.localCandidateId]\n\n if (local && (local.ip || local.address)) {\n // Spec\n self.localAddress = local.ip || local.address\n self.localPort = Number(local.port)\n } else if (local && local.ipAddress) {\n // Firefox\n self.localAddress = local.ipAddress\n self.localPort = Number(local.portNumber)\n } else if (typeof selectedCandidatePair.googLocalAddress === 'string') {\n // TODO: remove this once Chrome 58 is released\n local = selectedCandidatePair.googLocalAddress.split(':')\n self.localAddress = local[0]\n self.localPort = Number(local[1])\n }\n if (self.localAddress) {\n self.localFamily = self.localAddress.includes(':') ? 'IPv6' : 'IPv4'\n }\n\n var remote = remoteCandidates[selectedCandidatePair.remoteCandidateId]\n\n if (remote && (remote.ip || remote.address)) {\n // Spec\n self.remoteAddress = remote.ip || remote.address\n self.remotePort = Number(remote.port)\n } else if (remote && remote.ipAddress) {\n // Firefox\n self.remoteAddress = remote.ipAddress\n self.remotePort = Number(remote.portNumber)\n } else if (typeof selectedCandidatePair.googRemoteAddress === 'string') {\n // TODO: remove this once Chrome 58 is released\n remote = selectedCandidatePair.googRemoteAddress.split(':')\n self.remoteAddress = remote[0]\n self.remotePort = Number(remote[1])\n }\n if (self.remoteAddress) {\n self.remoteFamily = self.remoteAddress.includes(':') ? 'IPv6' : 'IPv4'\n }\n\n self._debug(\n 'connect local: %s:%s remote: %s:%s',\n self.localAddress, self.localPort, self.remoteAddress, self.remotePort\n )\n }\n\n // Ignore candidate pair selection in browsers like Safari 11 that do not have any local or remote candidates\n // But wait until at least 1 candidate pair is available\n if (!foundSelectedCandidatePair && (!Object.keys(candidatePairs).length || Object.keys(localCandidates).length)) {\n setTimeout(findCandidatePair, 100)\n return\n } else {\n self._connecting = false\n self.connected = true\n }\n\n if (self._chunk) {\n try {\n self.send(self._chunk)\n } catch (err) {\n return self.destroy(makeError(err, 'ERR_DATA_CHANNEL'))\n }\n self._chunk = null\n self._debug('sent chunk from \"write before connect\"')\n\n var cb = self._cb\n self._cb = null\n cb(null)\n }\n\n // If `bufferedAmountLowThreshold` and 'onbufferedamountlow' are unsupported,\n // fallback to using setInterval to implement backpressure.\n if (typeof self._channel.bufferedAmountLowThreshold !== 'number') {\n self._interval = setInterval(function () { self._onInterval() }, 150)\n if (self._interval.unref) self._interval.unref()\n }\n\n self._debug('connect')\n self.emit('connect')\n })\n }\n findCandidatePair()\n}\n\nPeer.prototype._onInterval = function () {\n var self = this\n if (!self._cb || !self._channel || self._channel.bufferedAmount > MAX_BUFFERED_AMOUNT) {\n return\n }\n self._onChannelBufferedAmountLow()\n}\n\nPeer.prototype._onSignalingStateChange = function () {\n var self = this\n if (self.destroyed) return\n\n if (self._pc.signalingState === 'stable' && !self._firstStable) {\n self._isNegotiating = false\n\n // HACK: Firefox doesn't yet support removing tracks when signalingState !== 'stable'\n self._debug('flushing sender queue', self._sendersAwaitingStable)\n self._sendersAwaitingStable.forEach(function (sender) {\n self._pc.removeTrack(sender)\n self._queuedNegotiation = true\n })\n self._sendersAwaitingStable = []\n\n if (self._queuedNegotiation) {\n self._debug('flushing negotiation queue')\n self._queuedNegotiation = false\n self._needsNegotiation() // negotiate again\n }\n\n self._debug('negotiate')\n self.emit('negotiate')\n }\n self._firstStable = false\n\n self._debug('signalingStateChange %s', self._pc.signalingState)\n self.emit('signalingStateChange', self._pc.signalingState)\n}\n\nPeer.prototype._onIceCandidate = function (event) {\n var self = this\n if (self.destroyed) return\n if (event.candidate && self.trickle) {\n self.emit('signal', {\n candidate: {\n candidate: event.candidate.candidate,\n sdpMLineIndex: event.candidate.sdpMLineIndex,\n sdpMid: event.candidate.sdpMid\n }\n })\n } else if (!event.candidate && !self._iceComplete) {\n self._iceComplete = true\n self.emit('_iceComplete')\n }\n // as soon as we've received one valid candidate start timeout\n if (event.candidate) {\n self._startIceCompleteTimeout()\n }\n}\n\nPeer.prototype._onChannelMessage = function (event) {\n var self = this\n if (self.destroyed) return\n var data = event.data\n if (data instanceof ArrayBuffer) data = Buffer.from(data)\n self.push(data)\n}\n\nPeer.prototype._onChannelBufferedAmountLow = function () {\n var self = this\n if (self.destroyed || !self._cb) return\n self._debug('ending backpressure: bufferedAmount %d', self._channel.bufferedAmount)\n var cb = self._cb\n self._cb = null\n cb(null)\n}\n\nPeer.prototype._onChannelOpen = function () {\n var self = this\n if (self.connected || self.destroyed) return\n self._debug('on channel open')\n self._channelReady = true\n self._maybeReady()\n}\n\nPeer.prototype._onChannelClose = function () {\n var self = this\n if (self.destroyed) return\n self._debug('on channel close')\n self.destroy()\n}\n\nPeer.prototype._onTrack = function (event) {\n var self = this\n if (self.destroyed) return\n\n event.streams.forEach(function (eventStream) {\n self._debug('on track')\n self.emit('track', event.track, eventStream)\n\n self._remoteTracks.push({\n track: event.track,\n stream: eventStream\n })\n\n if (self._remoteStreams.some(function (remoteStream) {\n return remoteStream.id === eventStream.id\n })) return // Only fire one 'stream' event, even though there may be multiple tracks per stream\n\n self._remoteStreams.push(eventStream)\n setTimeout(function () {\n self.emit('stream', eventStream) // ensure all tracks have been added\n }, 0)\n })\n}\n\nPeer.prototype._debug = function () {\n var self = this\n var args = [].slice.call(arguments)\n args[0] = '[' + self._id + '] ' + args[0]\n debug.apply(null, args)\n}\n\n// HACK: Filter trickle lines when trickle is disabled #354\nfunction filterTrickle (sdp) {\n return sdp.replace(/a=ice-options:trickle\\s\\n/g, '')\n}\n\nfunction makeError (message, code) {\n var err = new Error(message)\n err.code = code\n return err\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/simple-peer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!*************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\*************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!******************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 20);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!****************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!**************************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\**************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 21);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!***********************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\***********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!******************************************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\******************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-peer/node_modules/readable-stream/readable-browser.js":
|
||
/*!***********************************************************************************!*\
|
||
!*** ./node_modules/simple-peer/node_modules/readable-stream/readable-browser.js ***!
|
||
\***********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/simple-peer/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/simple-peer/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-sha1/browser.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/simple-sha1/browser.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Rusha = __webpack_require__(/*! rusha */ \"./node_modules/rusha/dist/rusha.js\")\n\nvar rusha = new Rusha\nvar scope = typeof window !== 'undefined' ? window : self\nvar crypto = scope.crypto || scope.msCrypto || {}\nvar subtle = crypto.subtle || crypto.webkitSubtle\n\nfunction sha1sync (buf) {\n return rusha.digest(buf)\n}\n\n// Browsers throw if they lack support for an algorithm.\n// Promise will be rejected on non-secure origins. (http://goo.gl/lq4gCo)\ntry {\n subtle.digest({ name: 'sha-1' }, new Uint8Array).catch(function () {\n subtle = false\n })\n} catch (err) { subtle = false }\n\nfunction sha1 (buf, cb) {\n if (!subtle) {\n // Use Rusha\n setTimeout(cb, 0, sha1sync(buf))\n return\n }\n\n if (typeof buf === 'string') {\n buf = uint8array(buf)\n }\n\n subtle.digest({ name: 'sha-1' }, buf)\n .then(function succeed (result) {\n cb(hex(new Uint8Array(result)))\n },\n function fail (error) {\n cb(sha1sync(buf))\n })\n}\n\nfunction uint8array (s) {\n var l = s.length\n var array = new Uint8Array(l)\n for (var i = 0; i < l; i++) {\n array[i] = s.charCodeAt(i)\n }\n return array\n}\n\nfunction hex (buf) {\n var l = buf.length\n var chars = []\n for (var i = 0; i < l; i++) {\n var bite = buf[i]\n chars.push((bite >>> 4).toString(16))\n chars.push((bite & 0x0f).toString(16))\n }\n return chars.join('')\n}\n\nmodule.exports = sha1\nmodule.exports.sync = sha1sync\n\n\n//# sourceURL=webpack:///./node_modules/simple-sha1/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/index.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/simple-websocket/index.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {/* global WebSocket, DOMException */\n\nmodule.exports = Socket\n\nvar debug = __webpack_require__(/*! debug */ \"./node_modules/simple-websocket/node_modules/debug/src/browser.js\")('simple-websocket')\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/simple-websocket/node_modules/readable-stream/readable-browser.js\")\nvar ws = __webpack_require__(/*! ws */ 29) // websockets in node - will be empty object in browser\n\nvar _WebSocket = typeof ws !== 'function' ? WebSocket : ws\n\nvar MAX_BUFFERED_AMOUNT = 64 * 1024\n\ninherits(Socket, stream.Duplex)\n\n/**\n * WebSocket. Same API as node core `net.Socket`. Duplex stream.\n * @param {Object} opts\n * @param {string=} opts.url websocket server url\n * @param {string=} opts.socket raw websocket instance to wrap\n */\nfunction Socket (opts) {\n var self = this\n if (!(self instanceof Socket)) return new Socket(opts)\n if (!opts) opts = {}\n\n // Support simple usage: `new Socket(url)`\n if (typeof opts === 'string') {\n opts = { url: opts }\n }\n\n if (opts.url == null && opts.socket == null) {\n throw new Error('Missing required `url` or `socket` option')\n }\n if (opts.url != null && opts.socket != null) {\n throw new Error('Must specify either `url` or `socket` option, not both')\n }\n\n self._id = randombytes(4).toString('hex').slice(0, 7)\n self._debug('new websocket: %o', opts)\n\n opts = Object.assign({\n allowHalfOpen: false\n }, opts)\n\n stream.Duplex.call(self, opts)\n\n self.connected = false\n self.destroyed = false\n\n self._chunk = null\n self._cb = null\n self._interval = null\n\n if (opts.socket) {\n self.url = opts.socket.url\n self._ws = opts.socket\n } else {\n self.url = opts.url\n try {\n if (typeof ws === 'function') {\n // `ws` package accepts options\n self._ws = new _WebSocket(opts.url, opts)\n } else {\n self._ws = new _WebSocket(opts.url)\n }\n } catch (err) {\n process.nextTick(function () {\n self.destroy(err)\n })\n return\n }\n }\n\n self._ws.binaryType = 'arraybuffer'\n self._ws.onopen = function () {\n self._onOpen()\n }\n self._ws.onmessage = function (event) {\n self._onMessage(event)\n }\n self._ws.onclose = function () {\n self._onClose()\n }\n self._ws.onerror = function () {\n self.destroy(new Error('connection error to ' + self.url))\n }\n\n self._onFinishBound = function () {\n self._onFinish()\n }\n self.once('finish', self._onFinishBound)\n}\n\nSocket.WEBSOCKET_SUPPORT = !!_WebSocket\n\n/**\n * Send text/binary data to the WebSocket server.\n * @param {TypedArrayView|ArrayBuffer|Buffer|string|Blob|Object} chunk\n */\nSocket.prototype.send = function (chunk) {\n this._ws.send(chunk)\n}\n\n// TODO: Delete this method once readable-stream is updated to contain a default\n// implementation of destroy() that automatically calls _destroy()\n// See: https://github.com/nodejs/readable-stream/issues/283\nSocket.prototype.destroy = function (err) {\n this._destroy(err, function () {})\n}\n\nSocket.prototype._destroy = function (err, cb) {\n var self = this\n if (self.destroyed) return\n\n self._debug('destroy (error: %s)', err && (err.message || err))\n\n self.readable = self.writable = false\n if (!self._readableState.ended) self.push(null)\n if (!self._writableState.finished) self.end()\n\n self.connected = false\n self.destroyed = true\n\n clearInterval(self._interval)\n self._interval = null\n self._chunk = null\n self._cb = null\n\n if (self._onFinishBound) self.removeListener('finish', self._onFinishBound)\n self._onFinishBound = null\n\n if (self._ws) {\n var ws = self._ws\n var onClose = function () {\n ws.onclose = null\n }\n if (ws.readyState === _WebSocket.CLOSED) {\n onClose()\n } else {\n try {\n ws.onclose = onClose\n ws.close()\n } catch (err) {\n onClose()\n }\n }\n\n ws.onopen = null\n ws.onmessage = null\n ws.onerror = function () {}\n }\n self._ws = null\n\n if (err) {\n if (typeof DOMException !== 'undefined' && err instanceof DOMException) {\n // Convert Edge DOMException object to Error object\n var code = err.code\n err = new Error(err.message)\n err.code = code\n }\n self.emit('error', err)\n }\n self.emit('close')\n cb()\n}\n\nSocket.prototype._read = function () {}\n\nSocket.prototype._write = function (chunk, encoding, cb) {\n if (this.destroyed) return cb(new Error('cannot write after socket is destroyed'))\n\n if (this.connected) {\n try {\n this.send(chunk)\n } catch (err) {\n return this.destroy(err)\n }\n if (typeof ws !== 'function' && this._ws.bufferedAmount > MAX_BUFFERED_AMOUNT) {\n this._debug('start backpressure: bufferedAmount %d', this._ws.bufferedAmount)\n this._cb = cb\n } else {\n cb(null)\n }\n } else {\n this._debug('write before connect')\n this._chunk = chunk\n this._cb = cb\n }\n}\n\n// When stream finishes writing, close socket. Half open connections are not\n// supported.\nSocket.prototype._onFinish = function () {\n var self = this\n if (self.destroyed) return\n\n if (self.connected) {\n destroySoon()\n } else {\n self.once('connect', destroySoon)\n }\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n function destroySoon () {\n setTimeout(function () {\n self.destroy()\n }, 1000)\n }\n}\n\nSocket.prototype._onMessage = function (event) {\n if (this.destroyed) return\n var data = event.data\n if (data instanceof ArrayBuffer) data = Buffer.from(data)\n this.push(data)\n}\n\nSocket.prototype._onOpen = function () {\n var self = this\n if (self.connected || self.destroyed) return\n self.connected = true\n\n if (self._chunk) {\n try {\n self.send(self._chunk)\n } catch (err) {\n return self.destroy(err)\n }\n self._chunk = null\n self._debug('sent chunk from \"write before connect\"')\n\n var cb = self._cb\n self._cb = null\n cb(null)\n }\n\n // Backpressure is not implemented in Node.js. The `ws` module has a buggy\n // `bufferedAmount` property. See: https://github.com/websockets/ws/issues/492\n if (typeof ws !== 'function') {\n self._interval = setInterval(function () {\n self._onInterval()\n }, 150)\n if (self._interval.unref) self._interval.unref()\n }\n\n self._debug('connect')\n self.emit('connect')\n}\n\nSocket.prototype._onInterval = function () {\n if (!this._cb || !this._ws || this._ws.bufferedAmount > MAX_BUFFERED_AMOUNT) {\n return\n }\n this._debug('ending backpressure: bufferedAmount %d', this._ws.bufferedAmount)\n var cb = this._cb\n this._cb = null\n cb(null)\n}\n\nSocket.prototype._onClose = function () {\n if (this.destroyed) return\n this._debug('on close')\n this.destroy()\n}\n\nSocket.prototype._debug = function () {\n var args = [].slice.call(arguments)\n args[0] = '[' + this._id + '] ' + args[0]\n debug.apply(null, args)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/debug/src/browser.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/debug/src/browser.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/simple-websocket/node_modules/debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/debug/src/common.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/debug/src/common.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!******************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!***********************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\***********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!********************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 27);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!*********************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\*********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!********************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!*******************************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\*******************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 28);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!****************************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\****************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!***********************************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\***********************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/simple-websocket/node_modules/readable-stream/readable-browser.js":
|
||
/*!****************************************************************************************!*\
|
||
!*** ./node_modules/simple-websocket/node_modules/readable-stream/readable-browser.js ***!
|
||
\****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/simple-websocket/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/simple-websocket/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/speedometer/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/speedometer/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var tick = 1\nvar maxTick = 65535\nvar resolution = 4\nvar timer\nvar inc = function () {\n tick = (tick + 1) & maxTick\n}\n\n\nmodule.exports = function (seconds) {\n if (!timer) {\n timer = setInterval(inc, (1000 / resolution) | 0)\n if (timer.unref) timer.unref()\n }\n\n var size = resolution * (seconds || 5)\n var buffer = [0]\n var pointer = 1\n var last = (tick - 1) & maxTick\n\n return function (delta) {\n var dist = (tick - last) & maxTick\n if (dist > size) dist = size\n last = tick\n\n while (dist--) {\n if (pointer === size) pointer = 0\n buffer[pointer] = buffer[pointer === 0 ? size - 1 : pointer - 1]\n pointer++\n }\n\n if (delta) buffer[pointer - 1] += delta\n\n var top = buffer[pointer - 1]\n var btm = buffer.length < size ? 0 : buffer[pointer === size ? 0 : pointer]\n\n return buffer.length < resolution ? top : (top - btm) * resolution / buffer.length\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/speedometer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/split2/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/split2/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*\nCopyright (c) 2014-2018, Matteo Collina <hello@matteocollina.com>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR\nIN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\n\n\nconst { Transform } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst { StringDecoder } = __webpack_require__(/*! string_decoder */ \"./node_modules/string_decoder/lib/string_decoder.js\")\nconst kLast = Symbol('last')\nconst kDecoder = Symbol('decoder')\n\nfunction transform (chunk, enc, cb) {\n var list\n if (this.overflow) { // Line buffer is full. Skip to start of next line.\n var buf = this[kDecoder].write(chunk)\n list = buf.split(this.matcher)\n\n if (list.length === 1) return cb() // Line ending not found. Discard entire chunk.\n\n // Line ending found. Discard trailing fragment of previous line and reset overflow state.\n list.shift()\n this.overflow = false\n } else {\n this[kLast] += this[kDecoder].write(chunk)\n list = this[kLast].split(this.matcher)\n }\n\n this[kLast] = list.pop()\n\n for (var i = 0; i < list.length; i++) {\n push(this, this.mapper(list[i]))\n }\n\n this.overflow = this[kLast].length > this.maxLength\n if (this.overflow && !this.skipOverflow) return cb(new Error('maximum buffer reached'))\n\n cb()\n}\n\nfunction flush (cb) {\n // forward any gibberish left in there\n this[kLast] += this[kDecoder].end()\n\n if (this[kLast]) {\n push(this, this.mapper(this[kLast]))\n }\n\n cb()\n}\n\nfunction push (self, val) {\n if (val !== undefined) {\n self.push(val)\n }\n}\n\nfunction noop (incoming) {\n return incoming\n}\n\nfunction split (matcher, mapper, options) {\n // Set defaults for any arguments not supplied.\n matcher = matcher || /\\r?\\n/\n mapper = mapper || noop\n options = options || {}\n\n // Test arguments explicitly.\n switch (arguments.length) {\n case 1:\n // If mapper is only argument.\n if (typeof matcher === 'function') {\n mapper = matcher\n matcher = /\\r?\\n/\n // If options is only argument.\n } else if (typeof matcher === 'object' && !(matcher instanceof RegExp)) {\n options = matcher\n matcher = /\\r?\\n/\n }\n break\n\n case 2:\n // If mapper and options are arguments.\n if (typeof matcher === 'function') {\n options = mapper\n mapper = matcher\n matcher = /\\r?\\n/\n // If matcher and options are arguments.\n } else if (typeof mapper === 'object') {\n options = mapper\n mapper = noop\n }\n }\n\n options = Object.assign({}, options)\n options.transform = transform\n options.flush = flush\n options.readableObjectMode = true\n\n const stream = new Transform(options)\n\n stream[kLast] = ''\n stream[kDecoder] = new StringDecoder('utf8')\n stream.matcher = matcher\n stream.mapper = mapper\n stream.maxLength = options.maxLength\n stream.skipOverflow = options.skipOverflow\n stream.overflow = false\n\n return stream\n}\n\nmodule.exports = split\n\n\n//# sourceURL=webpack:///./node_modules/split2/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/algs.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/sshpk/lib/algs.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\n\nvar algInfo = {\n\t'dsa': {\n\t\tparts: ['p', 'q', 'g', 'y'],\n\t\tsizePart: 'p'\n\t},\n\t'rsa': {\n\t\tparts: ['e', 'n'],\n\t\tsizePart: 'n'\n\t},\n\t'ecdsa': {\n\t\tparts: ['curve', 'Q'],\n\t\tsizePart: 'Q'\n\t},\n\t'ed25519': {\n\t\tparts: ['A'],\n\t\tsizePart: 'A'\n\t}\n};\nalgInfo['curve25519'] = algInfo['ed25519'];\n\nvar algPrivInfo = {\n\t'dsa': {\n\t\tparts: ['p', 'q', 'g', 'y', 'x']\n\t},\n\t'rsa': {\n\t\tparts: ['n', 'e', 'd', 'iqmp', 'p', 'q']\n\t},\n\t'ecdsa': {\n\t\tparts: ['curve', 'Q', 'd']\n\t},\n\t'ed25519': {\n\t\tparts: ['A', 'k']\n\t}\n};\nalgPrivInfo['curve25519'] = algPrivInfo['ed25519'];\n\nvar hashAlgs = {\n\t'md5': true,\n\t'sha1': true,\n\t'sha256': true,\n\t'sha384': true,\n\t'sha512': true\n};\n\n/*\n * Taken from\n * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf\n */\nvar curves = {\n\t'nistp256': {\n\t\tsize: 256,\n\t\tpkcs8oid: '1.2.840.10045.3.1.7',\n\t\tp: Buffer.from(('00' +\n\t\t 'ffffffff 00000001 00000000 00000000' +\n\t\t '00000000 ffffffff ffffffff ffffffff').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('00' +\n\t\t 'FFFFFFFF 00000001 00000000 00000000' +\n\t\t '00000000 FFFFFFFF FFFFFFFF FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from((\n\t\t '5ac635d8 aa3a93e7 b3ebbd55 769886bc' +\n\t\t '651d06b0 cc53b0f6 3bce3c3e 27d2604b').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'c49d3608 86e70493 6a6678e1 139d26b7' +\n\t\t '819f7e90').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('00' +\n\t\t 'ffffffff 00000000 ffffffff ffffffff' +\n\t\t 'bce6faad a7179e84 f3b9cac2 fc632551').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t '6b17d1f2 e12c4247 f8bce6e5 63a440f2' +\n\t\t '77037d81 2deb33a0 f4a13945 d898c296' +\n\t\t '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' +\n\t\t '2bce3357 6b315ece cbb64068 37bf51f5').\n\t\t replace(/ /g, ''), 'hex')\n\t},\n\t'nistp384': {\n\t\tsize: 384,\n\t\tpkcs8oid: '1.3.132.0.34',\n\t\tp: Buffer.from(('00' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff fffffffe' +\n\t\t 'ffffffff 00000000 00000000 ffffffff').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('00' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' +\n\t\t 'FFFFFFFF 00000000 00000000 FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from((\n\t\t 'b3312fa7 e23ee7e4 988e056b e3f82d19' +\n\t\t '181d9c6e fe814112 0314088f 5013875a' +\n\t\t 'c656398d 8a2ed19d 2a85c8ed d3ec2aef').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'a335926a a319a27a 1d00896a 6773a482' +\n\t\t '7acdac73').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('00' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff c7634d81 f4372ddf' +\n\t\t '581a0db2 48b0a77a ecec196a ccc52973').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t 'aa87ca22 be8b0537 8eb1c71e f320ad74' +\n\t\t '6e1d3b62 8ba79b98 59f741e0 82542a38' +\n\t\t '5502f25d bf55296c 3a545e38 72760ab7' +\n\t\t '3617de4a 96262c6f 5d9e98bf 9292dc29' +\n\t\t 'f8f41dbd 289a147c e9da3113 b5f0b8c0' +\n\t\t '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f').\n\t\t replace(/ /g, ''), 'hex')\n\t},\n\t'nistp521': {\n\t\tsize: 521,\n\t\tpkcs8oid: '1.3.132.0.35',\n\t\tp: Buffer.from((\n\t\t '01ffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffff').replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('01FF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from(('51' +\n\t\t '953eb961 8e1c9a1f 929a21a0 b68540ee' +\n\t\t 'a2da725b 99b315f3 b8b48991 8ef109e1' +\n\t\t '56193951 ec7e937b 1652c0bd 3bb1bf07' +\n\t\t '3573df88 3d2c34f1 ef451fd4 6b503f00').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'd09e8800 291cb853 96cc6717 393284aa' +\n\t\t 'a0da64ba').replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('01ff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff fffffffa' +\n\t\t '51868783 bf2f966b 7fcc0148 f709a5d0' +\n\t\t '3bb5c9b8 899c47ae bb6fb71e 91386409').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' +\n\t\t '9c648139 053fb521 f828af60 6b4d3dba' +\n\t\t 'a14b5e77 efe75928 fe1dc127 a2ffa8de' +\n\t\t '3348b3c1 856a429b f97e7e31 c2e5bd66' +\n\t\t '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' +\n\t\t '98f54449 579b4468 17afbd17 273e662c' +\n\t\t '97ee7299 5ef42640 c550b901 3fad0761' +\n\t\t '353c7086 a272c240 88be9476 9fd16650').\n\t\t replace(/ /g, ''), 'hex')\n\t}\n};\n\nmodule.exports = {\n\tinfo: algInfo,\n\tprivInfo: algPrivInfo,\n\thashAlgs: hashAlgs,\n\tcurves: curves\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/algs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/certificate.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/certificate.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2016 Joyent, Inc.\n\nmodule.exports = Certificate;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Fingerprint = __webpack_require__(/*! ./fingerprint */ \"./node_modules/sshpk/lib/fingerprint.js\");\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ./key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ./private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar Identity = __webpack_require__(/*! ./identity */ \"./node_modules/sshpk/lib/identity.js\");\n\nvar formats = {};\nformats['openssh'] = __webpack_require__(/*! ./formats/openssh-cert */ \"./node_modules/sshpk/lib/formats/openssh-cert.js\");\nformats['x509'] = __webpack_require__(/*! ./formats/x509 */ \"./node_modules/sshpk/lib/formats/x509.js\");\nformats['pem'] = __webpack_require__(/*! ./formats/x509-pem */ \"./node_modules/sshpk/lib/formats/x509-pem.js\");\n\nvar CertificateParseError = errs.CertificateParseError;\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\n\nfunction Certificate(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.subjects, 'options.subjects');\n\tutils.assertCompatible(opts.subjects[0], Identity, [1, 0],\n\t 'options.subjects');\n\tutils.assertCompatible(opts.subjectKey, Key, [1, 0],\n\t 'options.subjectKey');\n\tutils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer');\n\tif (opts.issuerKey !== undefined) {\n\t\tutils.assertCompatible(opts.issuerKey, Key, [1, 0],\n\t\t 'options.issuerKey');\n\t}\n\tassert.object(opts.signatures, 'options.signatures');\n\tassert.buffer(opts.serial, 'options.serial');\n\tassert.date(opts.validFrom, 'options.validFrom');\n\tassert.date(opts.validUntil, 'optons.validUntil');\n\n\tassert.optionalArrayOfString(opts.purposes, 'options.purposes');\n\n\tthis._hashCache = {};\n\n\tthis.subjects = opts.subjects;\n\tthis.issuer = opts.issuer;\n\tthis.subjectKey = opts.subjectKey;\n\tthis.issuerKey = opts.issuerKey;\n\tthis.signatures = opts.signatures;\n\tthis.serial = opts.serial;\n\tthis.validFrom = opts.validFrom;\n\tthis.validUntil = opts.validUntil;\n\tthis.purposes = opts.purposes;\n}\n\nCertificate.formats = formats;\n\nCertificate.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'x509';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\treturn (formats[format].write(this, options));\n};\n\nCertificate.prototype.toString = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'pem';\n\treturn (this.toBuffer(format, options).toString());\n};\n\nCertificate.prototype.fingerprint = function (algo) {\n\tif (algo === undefined)\n\t\talgo = 'sha256';\n\tassert.string(algo, 'algorithm');\n\tvar opts = {\n\t\ttype: 'certificate',\n\t\thash: this.hash(algo),\n\t\talgorithm: algo\n\t};\n\treturn (new Fingerprint(opts));\n};\n\nCertificate.prototype.hash = function (algo) {\n\tassert.string(algo, 'algorithm');\n\talgo = algo.toLowerCase();\n\tif (algs.hashAlgs[algo] === undefined)\n\t\tthrow (new InvalidAlgorithmError(algo));\n\n\tif (this._hashCache[algo])\n\t\treturn (this._hashCache[algo]);\n\n\tvar hash = crypto.createHash(algo).\n\t update(this.toBuffer('x509')).digest();\n\tthis._hashCache[algo] = hash;\n\treturn (hash);\n};\n\nCertificate.prototype.isExpired = function (when) {\n\tif (when === undefined)\n\t\twhen = new Date();\n\treturn (!((when.getTime() >= this.validFrom.getTime()) &&\n\t\t(when.getTime() < this.validUntil.getTime())));\n};\n\nCertificate.prototype.isSignedBy = function (issuerCert) {\n\tutils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer');\n\n\tif (!this.issuer.equals(issuerCert.subjects[0]))\n\t\treturn (false);\n\tif (this.issuer.purposes && this.issuer.purposes.length > 0 &&\n\t this.issuer.purposes.indexOf('ca') === -1) {\n\t\treturn (false);\n\t}\n\n\treturn (this.isSignedByKey(issuerCert.subjectKey));\n};\n\nCertificate.prototype.getExtension = function (keyOrOid) {\n\tassert.string(keyOrOid, 'keyOrOid');\n\tvar ext = this.getExtensions().filter(function (maybeExt) {\n\t\tif (maybeExt.format === 'x509')\n\t\t\treturn (maybeExt.oid === keyOrOid);\n\t\tif (maybeExt.format === 'openssh')\n\t\t\treturn (maybeExt.name === keyOrOid);\n\t\treturn (false);\n\t})[0];\n\treturn (ext);\n};\n\nCertificate.prototype.getExtensions = function () {\n\tvar exts = [];\n\tvar x509 = this.signatures.x509;\n\tif (x509 && x509.extras && x509.extras.exts) {\n\t\tx509.extras.exts.forEach(function (ext) {\n\t\t\text.format = 'x509';\n\t\t\texts.push(ext);\n\t\t});\n\t}\n\tvar openssh = this.signatures.openssh;\n\tif (openssh && openssh.exts) {\n\t\topenssh.exts.forEach(function (ext) {\n\t\t\text.format = 'openssh';\n\t\t\texts.push(ext);\n\t\t});\n\t}\n\treturn (exts);\n};\n\nCertificate.prototype.isSignedByKey = function (issuerKey) {\n\tutils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey');\n\n\tif (this.issuerKey !== undefined) {\n\t\treturn (this.issuerKey.\n\t\t fingerprint('sha512').matches(issuerKey));\n\t}\n\n\tvar fmt = Object.keys(this.signatures)[0];\n\tvar valid = formats[fmt].verify(this, issuerKey);\n\tif (valid)\n\t\tthis.issuerKey = issuerKey;\n\treturn (valid);\n};\n\nCertificate.prototype.signWith = function (key) {\n\tutils.assertCompatible(key, PrivateKey, [1, 2], 'key');\n\tvar fmts = Object.keys(formats);\n\tvar didOne = false;\n\tfor (var i = 0; i < fmts.length; ++i) {\n\t\tif (fmts[i] !== 'pem') {\n\t\t\tvar ret = formats[fmts[i]].sign(this, key);\n\t\t\tif (ret === true)\n\t\t\t\tdidOne = true;\n\t\t}\n\t}\n\tif (!didOne) {\n\t\tthrow (new Error('Failed to sign the certificate for any ' +\n\t\t 'available certificate formats'));\n\t}\n};\n\nCertificate.createSelfSigned = function (subjectOrSubjects, key, options) {\n\tvar subjects;\n\tif (Array.isArray(subjectOrSubjects))\n\t\tsubjects = subjectOrSubjects;\n\telse\n\t\tsubjects = [subjectOrSubjects];\n\n\tassert.arrayOfObject(subjects);\n\tsubjects.forEach(function (subject) {\n\t\tutils.assertCompatible(subject, Identity, [1, 0], 'subject');\n\t});\n\n\tutils.assertCompatible(key, PrivateKey, [1, 2], 'private key');\n\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalObject(options.validFrom, 'options.validFrom');\n\tassert.optionalObject(options.validUntil, 'options.validUntil');\n\tvar validFrom = options.validFrom;\n\tvar validUntil = options.validUntil;\n\tif (validFrom === undefined)\n\t\tvalidFrom = new Date();\n\tif (validUntil === undefined) {\n\t\tassert.optionalNumber(options.lifetime, 'options.lifetime');\n\t\tvar lifetime = options.lifetime;\n\t\tif (lifetime === undefined)\n\t\t\tlifetime = 10*365*24*3600;\n\t\tvalidUntil = new Date();\n\t\tvalidUntil.setTime(validUntil.getTime() + lifetime*1000);\n\t}\n\tassert.optionalBuffer(options.serial, 'options.serial');\n\tvar serial = options.serial;\n\tif (serial === undefined)\n\t\tserial = Buffer.from('0000000000000001', 'hex');\n\n\tvar purposes = options.purposes;\n\tif (purposes === undefined)\n\t\tpurposes = [];\n\n\tif (purposes.indexOf('signature') === -1)\n\t\tpurposes.push('signature');\n\n\t/* Self-signed certs are always CAs. */\n\tif (purposes.indexOf('ca') === -1)\n\t\tpurposes.push('ca');\n\tif (purposes.indexOf('crl') === -1)\n\t\tpurposes.push('crl');\n\n\t/*\n\t * If we weren't explicitly given any other purposes, do the sensible\n\t * thing and add some basic ones depending on the subject type.\n\t */\n\tif (purposes.length <= 3) {\n\t\tvar hostSubjects = subjects.filter(function (subject) {\n\t\t\treturn (subject.type === 'host');\n\t\t});\n\t\tvar userSubjects = subjects.filter(function (subject) {\n\t\t\treturn (subject.type === 'user');\n\t\t});\n\t\tif (hostSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('serverAuth') === -1)\n\t\t\t\tpurposes.push('serverAuth');\n\t\t}\n\t\tif (userSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('clientAuth') === -1)\n\t\t\t\tpurposes.push('clientAuth');\n\t\t}\n\t\tif (userSubjects.length > 0 || hostSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('keyAgreement') === -1)\n\t\t\t\tpurposes.push('keyAgreement');\n\t\t\tif (key.type === 'rsa' &&\n\t\t\t purposes.indexOf('encryption') === -1)\n\t\t\t\tpurposes.push('encryption');\n\t\t}\n\t}\n\n\tvar cert = new Certificate({\n\t\tsubjects: subjects,\n\t\tissuer: subjects[0],\n\t\tsubjectKey: key.toPublic(),\n\t\tissuerKey: key.toPublic(),\n\t\tsignatures: {},\n\t\tserial: serial,\n\t\tvalidFrom: validFrom,\n\t\tvalidUntil: validUntil,\n\t\tpurposes: purposes\n\t});\n\tcert.signWith(key);\n\n\treturn (cert);\n};\n\nCertificate.create =\n function (subjectOrSubjects, key, issuer, issuerKey, options) {\n\tvar subjects;\n\tif (Array.isArray(subjectOrSubjects))\n\t\tsubjects = subjectOrSubjects;\n\telse\n\t\tsubjects = [subjectOrSubjects];\n\n\tassert.arrayOfObject(subjects);\n\tsubjects.forEach(function (subject) {\n\t\tutils.assertCompatible(subject, Identity, [1, 0], 'subject');\n\t});\n\n\tutils.assertCompatible(key, Key, [1, 0], 'key');\n\tif (PrivateKey.isPrivateKey(key))\n\t\tkey = key.toPublic();\n\tutils.assertCompatible(issuer, Identity, [1, 0], 'issuer');\n\tutils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key');\n\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalObject(options.validFrom, 'options.validFrom');\n\tassert.optionalObject(options.validUntil, 'options.validUntil');\n\tvar validFrom = options.validFrom;\n\tvar validUntil = options.validUntil;\n\tif (validFrom === undefined)\n\t\tvalidFrom = new Date();\n\tif (validUntil === undefined) {\n\t\tassert.optionalNumber(options.lifetime, 'options.lifetime');\n\t\tvar lifetime = options.lifetime;\n\t\tif (lifetime === undefined)\n\t\t\tlifetime = 10*365*24*3600;\n\t\tvalidUntil = new Date();\n\t\tvalidUntil.setTime(validUntil.getTime() + lifetime*1000);\n\t}\n\tassert.optionalBuffer(options.serial, 'options.serial');\n\tvar serial = options.serial;\n\tif (serial === undefined)\n\t\tserial = Buffer.from('0000000000000001', 'hex');\n\n\tvar purposes = options.purposes;\n\tif (purposes === undefined)\n\t\tpurposes = [];\n\n\tif (purposes.indexOf('signature') === -1)\n\t\tpurposes.push('signature');\n\n\tif (options.ca === true) {\n\t\tif (purposes.indexOf('ca') === -1)\n\t\t\tpurposes.push('ca');\n\t\tif (purposes.indexOf('crl') === -1)\n\t\t\tpurposes.push('crl');\n\t}\n\n\tvar hostSubjects = subjects.filter(function (subject) {\n\t\treturn (subject.type === 'host');\n\t});\n\tvar userSubjects = subjects.filter(function (subject) {\n\t\treturn (subject.type === 'user');\n\t});\n\tif (hostSubjects.length > 0) {\n\t\tif (purposes.indexOf('serverAuth') === -1)\n\t\t\tpurposes.push('serverAuth');\n\t}\n\tif (userSubjects.length > 0) {\n\t\tif (purposes.indexOf('clientAuth') === -1)\n\t\t\tpurposes.push('clientAuth');\n\t}\n\tif (userSubjects.length > 0 || hostSubjects.length > 0) {\n\t\tif (purposes.indexOf('keyAgreement') === -1)\n\t\t\tpurposes.push('keyAgreement');\n\t\tif (key.type === 'rsa' &&\n\t\t purposes.indexOf('encryption') === -1)\n\t\t\tpurposes.push('encryption');\n\t}\n\n\tvar cert = new Certificate({\n\t\tsubjects: subjects,\n\t\tissuer: issuer,\n\t\tsubjectKey: key,\n\t\tissuerKey: issuerKey.toPublic(),\n\t\tsignatures: {},\n\t\tserial: serial,\n\t\tvalidFrom: validFrom,\n\t\tvalidUntil: validUntil,\n\t\tpurposes: purposes\n\t});\n\tcert.signWith(issuerKey);\n\n\treturn (cert);\n};\n\nCertificate.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\treturn (k);\n\t} catch (e) {\n\t\tthrow (new CertificateParseError(options.filename, format, e));\n\t}\n};\n\nCertificate.isCertificate = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Certificate, ver));\n};\n\n/*\n * API versions for Certificate:\n * [1,0] -- initial ver\n * [1,1] -- openssh format now unpacks extensions\n */\nCertificate.prototype._sshpkApiVersion = [1, 1];\n\nCertificate._oldVersionDetect = function (obj) {\n\treturn ([1, 0]);\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/certificate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/dhe.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/sshpk/lib/dhe.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tDiffieHellman: DiffieHellman,\n\tgenerateECDSA: generateECDSA,\n\tgenerateED25519: generateED25519\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar nacl = __webpack_require__(/*! tweetnacl */ \"./node_modules/tweetnacl/nacl-fast.js\");\n\nvar Key = __webpack_require__(/*! ./key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ./private-key */ \"./node_modules/sshpk/lib/private-key.js\");\n\nvar CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined);\n\nvar ecdh = __webpack_require__(/*! ecc-jsbn */ \"./node_modules/ecc-jsbn/index.js\");\nvar ec = __webpack_require__(/*! ecc-jsbn/lib/ec */ \"./node_modules/ecc-jsbn/lib/ec.js\");\nvar jsbn = __webpack_require__(/*! jsbn */ \"./node_modules/jsbn/index.js\").BigInteger;\n\nfunction DiffieHellman(key) {\n\tutils.assertCompatible(key, Key, [1, 4], 'key');\n\tthis._isPriv = PrivateKey.isPrivateKey(key, [1, 3]);\n\tthis._algo = key.type;\n\tthis._curve = key.curve;\n\tthis._key = key;\n\tif (key.type === 'dsa') {\n\t\tif (!CRYPTO_HAVE_ECDH) {\n\t\t\tthrow (new Error('Due to bugs in the node 0.10 ' +\n\t\t\t 'crypto API, node 0.12.x or later is required ' +\n\t\t\t 'to use DH'));\n\t\t}\n\t\tthis._dh = crypto.createDiffieHellman(\n\t\t key.part.p.data, undefined,\n\t\t key.part.g.data, undefined);\n\t\tthis._p = key.part.p;\n\t\tthis._g = key.part.g;\n\t\tif (this._isPriv)\n\t\t\tthis._dh.setPrivateKey(key.part.x.data);\n\t\tthis._dh.setPublicKey(key.part.y.data);\n\n\t} else if (key.type === 'ecdsa') {\n\t\tif (!CRYPTO_HAVE_ECDH) {\n\t\t\tthis._ecParams = new X9ECParameters(this._curve);\n\n\t\t\tif (this._isPriv) {\n\t\t\t\tthis._priv = new ECPrivate(\n\t\t\t\t this._ecParams, key.part.d.data);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tvar curve = {\n\t\t\t'nistp256': 'prime256v1',\n\t\t\t'nistp384': 'secp384r1',\n\t\t\t'nistp521': 'secp521r1'\n\t\t}[key.curve];\n\t\tthis._dh = crypto.createECDH(curve);\n\t\tif (typeof (this._dh) !== 'object' ||\n\t\t typeof (this._dh.setPrivateKey) !== 'function') {\n\t\t\tCRYPTO_HAVE_ECDH = false;\n\t\t\tDiffieHellman.call(this, key);\n\t\t\treturn;\n\t\t}\n\t\tif (this._isPriv)\n\t\t\tthis._dh.setPrivateKey(key.part.d.data);\n\t\tthis._dh.setPublicKey(key.part.Q.data);\n\n\t} else if (key.type === 'curve25519') {\n\t\tif (this._isPriv) {\n\t\t\tutils.assertCompatible(key, PrivateKey, [1, 5], 'key');\n\t\t\tthis._priv = key.part.k.data;\n\t\t}\n\n\t} else {\n\t\tthrow (new Error('DH not supported for ' + key.type + ' keys'));\n\t}\n}\n\nDiffieHellman.prototype.getPublicKey = function () {\n\tif (this._isPriv)\n\t\treturn (this._key.toPublic());\n\treturn (this._key);\n};\n\nDiffieHellman.prototype.getPrivateKey = function () {\n\tif (this._isPriv)\n\t\treturn (this._key);\n\telse\n\t\treturn (undefined);\n};\nDiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey;\n\nDiffieHellman.prototype._keyCheck = function (pk, isPub) {\n\tassert.object(pk, 'key');\n\tif (!isPub)\n\t\tutils.assertCompatible(pk, PrivateKey, [1, 3], 'key');\n\tutils.assertCompatible(pk, Key, [1, 4], 'key');\n\n\tif (pk.type !== this._algo) {\n\t\tthrow (new Error('A ' + pk.type + ' key cannot be used in ' +\n\t\t this._algo + ' Diffie-Hellman'));\n\t}\n\n\tif (pk.curve !== this._curve) {\n\t\tthrow (new Error('A key from the ' + pk.curve + ' curve ' +\n\t\t 'cannot be used with a ' + this._curve +\n\t\t ' Diffie-Hellman'));\n\t}\n\n\tif (pk.type === 'dsa') {\n\t\tassert.deepEqual(pk.part.p, this._p,\n\t\t 'DSA key prime does not match');\n\t\tassert.deepEqual(pk.part.g, this._g,\n\t\t 'DSA key generator does not match');\n\t}\n};\n\nDiffieHellman.prototype.setKey = function (pk) {\n\tthis._keyCheck(pk);\n\n\tif (pk.type === 'dsa') {\n\t\tthis._dh.setPrivateKey(pk.part.x.data);\n\t\tthis._dh.setPublicKey(pk.part.y.data);\n\n\t} else if (pk.type === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\tthis._dh.setPrivateKey(pk.part.d.data);\n\t\t\tthis._dh.setPublicKey(pk.part.Q.data);\n\t\t} else {\n\t\t\tthis._priv = new ECPrivate(\n\t\t\t this._ecParams, pk.part.d.data);\n\t\t}\n\n\t} else if (pk.type === 'curve25519') {\n\t\tvar k = pk.part.k;\n\t\tif (!pk.part.k)\n\t\t\tk = pk.part.r;\n\t\tthis._priv = k.data;\n\t\tif (this._priv[0] === 0x00)\n\t\t\tthis._priv = this._priv.slice(1);\n\t\tthis._priv = this._priv.slice(0, 32);\n\t}\n\tthis._key = pk;\n\tthis._isPriv = true;\n};\nDiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey;\n\nDiffieHellman.prototype.computeSecret = function (otherpk) {\n\tthis._keyCheck(otherpk, true);\n\tif (!this._isPriv)\n\t\tthrow (new Error('DH exchange has not been initialized with ' +\n\t\t 'a private key yet'));\n\n\tvar pub;\n\tif (this._algo === 'dsa') {\n\t\treturn (this._dh.computeSecret(\n\t\t otherpk.part.y.data));\n\n\t} else if (this._algo === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\treturn (this._dh.computeSecret(\n\t\t\t otherpk.part.Q.data));\n\t\t} else {\n\t\t\tpub = new ECPublic(\n\t\t\t this._ecParams, otherpk.part.Q.data);\n\t\t\treturn (this._priv.deriveSharedSecret(pub));\n\t\t}\n\n\t} else if (this._algo === 'curve25519') {\n\t\tpub = otherpk.part.A.data;\n\t\twhile (pub[0] === 0x00 && pub.length > 32)\n\t\t\tpub = pub.slice(1);\n\t\tvar priv = this._priv;\n\t\tassert.strictEqual(pub.length, 32);\n\t\tassert.strictEqual(priv.length, 32);\n\n\t\tvar secret = nacl.box.before(new Uint8Array(pub),\n\t\t new Uint8Array(priv));\n\n\t\treturn (Buffer.from(secret));\n\t}\n\n\tthrow (new Error('Invalid algorithm: ' + this._algo));\n};\n\nDiffieHellman.prototype.generateKey = function () {\n\tvar parts = [];\n\tvar priv, pub;\n\tif (this._algo === 'dsa') {\n\t\tthis._dh.generateKeys();\n\n\t\tparts.push({name: 'p', data: this._p.data});\n\t\tparts.push({name: 'q', data: this._key.part.q.data});\n\t\tparts.push({name: 'g', data: this._g.data});\n\t\tparts.push({name: 'y', data: this._dh.getPublicKey()});\n\t\tparts.push({name: 'x', data: this._dh.getPrivateKey()});\n\t\tthis._key = new PrivateKey({\n\t\t\ttype: 'dsa',\n\t\t\tparts: parts\n\t\t});\n\t\tthis._isPriv = true;\n\t\treturn (this._key);\n\n\t} else if (this._algo === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\tthis._dh.generateKeys();\n\n\t\t\tparts.push({name: 'curve',\n\t\t\t data: Buffer.from(this._curve)});\n\t\t\tparts.push({name: 'Q', data: this._dh.getPublicKey()});\n\t\t\tparts.push({name: 'd', data: this._dh.getPrivateKey()});\n\t\t\tthis._key = new PrivateKey({\n\t\t\t\ttype: 'ecdsa',\n\t\t\t\tcurve: this._curve,\n\t\t\t\tparts: parts\n\t\t\t});\n\t\t\tthis._isPriv = true;\n\t\t\treturn (this._key);\n\n\t\t} else {\n\t\t\tvar n = this._ecParams.getN();\n\t\t\tvar r = new jsbn(crypto.randomBytes(n.bitLength()));\n\t\t\tvar n1 = n.subtract(jsbn.ONE);\n\t\t\tpriv = r.mod(n1).add(jsbn.ONE);\n\t\t\tpub = this._ecParams.getG().multiply(priv);\n\n\t\t\tpriv = Buffer.from(priv.toByteArray());\n\t\t\tpub = Buffer.from(this._ecParams.getCurve().\n\t\t\t encodePointHex(pub), 'hex');\n\n\t\t\tthis._priv = new ECPrivate(this._ecParams, priv);\n\n\t\t\tparts.push({name: 'curve',\n\t\t\t data: Buffer.from(this._curve)});\n\t\t\tparts.push({name: 'Q', data: pub});\n\t\t\tparts.push({name: 'd', data: priv});\n\n\t\t\tthis._key = new PrivateKey({\n\t\t\t\ttype: 'ecdsa',\n\t\t\t\tcurve: this._curve,\n\t\t\t\tparts: parts\n\t\t\t});\n\t\t\tthis._isPriv = true;\n\t\t\treturn (this._key);\n\t\t}\n\n\t} else if (this._algo === 'curve25519') {\n\t\tvar pair = nacl.box.keyPair();\n\t\tpriv = Buffer.from(pair.secretKey);\n\t\tpub = Buffer.from(pair.publicKey);\n\t\tpriv = Buffer.concat([priv, pub]);\n\t\tassert.strictEqual(priv.length, 64);\n\t\tassert.strictEqual(pub.length, 32);\n\n\t\tparts.push({name: 'A', data: pub});\n\t\tparts.push({name: 'k', data: priv});\n\t\tthis._key = new PrivateKey({\n\t\t\ttype: 'curve25519',\n\t\t\tparts: parts\n\t\t});\n\t\tthis._isPriv = true;\n\t\treturn (this._key);\n\t}\n\n\tthrow (new Error('Invalid algorithm: ' + this._algo));\n};\nDiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey;\n\n/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */\n\nfunction X9ECParameters(name) {\n\tvar params = algs.curves[name];\n\tassert.object(params);\n\n\tvar p = new jsbn(params.p);\n\tvar a = new jsbn(params.a);\n\tvar b = new jsbn(params.b);\n\tvar n = new jsbn(params.n);\n\tvar h = jsbn.ONE;\n\tvar curve = new ec.ECCurveFp(p, a, b);\n\tvar G = curve.decodePointHex(params.G.toString('hex'));\n\n\tthis.curve = curve;\n\tthis.g = G;\n\tthis.n = n;\n\tthis.h = h;\n}\nX9ECParameters.prototype.getCurve = function () { return (this.curve); };\nX9ECParameters.prototype.getG = function () { return (this.g); };\nX9ECParameters.prototype.getN = function () { return (this.n); };\nX9ECParameters.prototype.getH = function () { return (this.h); };\n\nfunction ECPublic(params, buffer) {\n\tthis._params = params;\n\tif (buffer[0] === 0x00)\n\t\tbuffer = buffer.slice(1);\n\tthis._pub = params.getCurve().decodePointHex(buffer.toString('hex'));\n}\n\nfunction ECPrivate(params, buffer) {\n\tthis._params = params;\n\tthis._priv = new jsbn(utils.mpNormalize(buffer));\n}\nECPrivate.prototype.deriveSharedSecret = function (pubKey) {\n\tassert.ok(pubKey instanceof ECPublic);\n\tvar S = pubKey._pub.multiply(this._priv);\n\treturn (Buffer.from(S.getX().toBigInteger().toByteArray()));\n};\n\nfunction generateED25519() {\n\tvar pair = nacl.sign.keyPair();\n\tvar priv = Buffer.from(pair.secretKey);\n\tvar pub = Buffer.from(pair.publicKey);\n\tassert.strictEqual(priv.length, 64);\n\tassert.strictEqual(pub.length, 32);\n\n\tvar parts = [];\n\tparts.push({name: 'A', data: pub});\n\tparts.push({name: 'k', data: priv.slice(0, 32)});\n\tvar key = new PrivateKey({\n\t\ttype: 'ed25519',\n\t\tparts: parts\n\t});\n\treturn (key);\n}\n\n/* Generates a new ECDSA private key on a given curve. */\nfunction generateECDSA(curve) {\n\tvar parts = [];\n\tvar key;\n\n\tif (CRYPTO_HAVE_ECDH) {\n\t\t/*\n\t\t * Node crypto doesn't expose key generation directly, but the\n\t\t * ECDH instances can generate keys. It turns out this just\n\t\t * calls into the OpenSSL generic key generator, and we can\n\t\t * read its output happily without doing an actual DH. So we\n\t\t * use that here.\n\t\t */\n\t\tvar osCurve = {\n\t\t\t'nistp256': 'prime256v1',\n\t\t\t'nistp384': 'secp384r1',\n\t\t\t'nistp521': 'secp521r1'\n\t\t}[curve];\n\n\t\tvar dh = crypto.createECDH(osCurve);\n\t\tdh.generateKeys();\n\n\t\tparts.push({name: 'curve',\n\t\t data: Buffer.from(curve)});\n\t\tparts.push({name: 'Q', data: dh.getPublicKey()});\n\t\tparts.push({name: 'd', data: dh.getPrivateKey()});\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tparts: parts\n\t\t});\n\t\treturn (key);\n\t} else {\n\n\t\tvar ecParams = new X9ECParameters(curve);\n\n\t\t/* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */\n\t\tvar n = ecParams.getN();\n\t\t/*\n\t\t * The crypto.randomBytes() function can only give us whole\n\t\t * bytes, so taking a nod from X9.62, we round up.\n\t\t */\n\t\tvar cByteLen = Math.ceil((n.bitLength() + 64) / 8);\n\t\tvar c = new jsbn(crypto.randomBytes(cByteLen));\n\n\t\tvar n1 = n.subtract(jsbn.ONE);\n\t\tvar priv = c.mod(n1).add(jsbn.ONE);\n\t\tvar pub = ecParams.getG().multiply(priv);\n\n\t\tpriv = Buffer.from(priv.toByteArray());\n\t\tpub = Buffer.from(ecParams.getCurve().\n\t\t encodePointHex(pub), 'hex');\n\n\t\tparts.push({name: 'curve', data: Buffer.from(curve)});\n\t\tparts.push({name: 'Q', data: pub});\n\t\tparts.push({name: 'd', data: priv});\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tparts: parts\n\t\t});\n\t\treturn (key);\n\t}\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/dhe.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/ed-compat.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/ed-compat.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tVerifier: Verifier,\n\tSigner: Signer\n};\n\nvar nacl = __webpack_require__(/*! tweetnacl */ \"./node_modules/tweetnacl/nacl-fast.js\");\nvar stream = __webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/sshpk/lib/signature.js\");\n\nfunction Verifier(key, hashAlgo) {\n\tif (hashAlgo.toLowerCase() !== 'sha512')\n\t\tthrow (new Error('ED25519 only supports the use of ' +\n\t\t 'SHA-512 hashes'));\n\n\tthis.key = key;\n\tthis.chunks = [];\n\n\tstream.Writable.call(this, {});\n}\nutil.inherits(Verifier, stream.Writable);\n\nVerifier.prototype._write = function (chunk, enc, cb) {\n\tthis.chunks.push(chunk);\n\tcb();\n};\n\nVerifier.prototype.update = function (chunk) {\n\tif (typeof (chunk) === 'string')\n\t\tchunk = Buffer.from(chunk, 'binary');\n\tthis.chunks.push(chunk);\n};\n\nVerifier.prototype.verify = function (signature, fmt) {\n\tvar sig;\n\tif (Signature.isSignature(signature, [2, 0])) {\n\t\tif (signature.type !== 'ed25519')\n\t\t\treturn (false);\n\t\tsig = signature.toBuffer('raw');\n\n\t} else if (typeof (signature) === 'string') {\n\t\tsig = Buffer.from(signature, 'base64');\n\n\t} else if (Signature.isSignature(signature, [1, 0])) {\n\t\tthrow (new Error('signature was created by too old ' +\n\t\t 'a version of sshpk and cannot be verified'));\n\t}\n\n\tassert.buffer(sig);\n\treturn (nacl.sign.detached.verify(\n\t new Uint8Array(Buffer.concat(this.chunks)),\n\t new Uint8Array(sig),\n\t new Uint8Array(this.key.part.A.data)));\n};\n\nfunction Signer(key, hashAlgo) {\n\tif (hashAlgo.toLowerCase() !== 'sha512')\n\t\tthrow (new Error('ED25519 only supports the use of ' +\n\t\t 'SHA-512 hashes'));\n\n\tthis.key = key;\n\tthis.chunks = [];\n\n\tstream.Writable.call(this, {});\n}\nutil.inherits(Signer, stream.Writable);\n\nSigner.prototype._write = function (chunk, enc, cb) {\n\tthis.chunks.push(chunk);\n\tcb();\n};\n\nSigner.prototype.update = function (chunk) {\n\tif (typeof (chunk) === 'string')\n\t\tchunk = Buffer.from(chunk, 'binary');\n\tthis.chunks.push(chunk);\n};\n\nSigner.prototype.sign = function () {\n\tvar sig = nacl.sign.detached(\n\t new Uint8Array(Buffer.concat(this.chunks)),\n\t new Uint8Array(Buffer.concat([\n\t\tthis.key.part.k.data, this.key.part.A.data])));\n\tvar sigBuf = Buffer.from(sig);\n\tvar sigObj = Signature.parse(sigBuf, 'ed25519', 'raw');\n\tsigObj.hashAlgorithm = 'sha512';\n\treturn (sigObj);\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/ed-compat.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/errors.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/sshpk/lib/errors.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nfunction FingerprintFormatError(fp, format) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, FingerprintFormatError);\n\tthis.name = 'FingerprintFormatError';\n\tthis.fingerprint = fp;\n\tthis.format = format;\n\tthis.message = 'Fingerprint format is not supported, or is invalid: ';\n\tif (fp !== undefined)\n\t\tthis.message += ' fingerprint = ' + fp;\n\tif (format !== undefined)\n\t\tthis.message += ' format = ' + format;\n}\nutil.inherits(FingerprintFormatError, Error);\n\nfunction InvalidAlgorithmError(alg) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, InvalidAlgorithmError);\n\tthis.name = 'InvalidAlgorithmError';\n\tthis.algorithm = alg;\n\tthis.message = 'Algorithm \"' + alg + '\" is not supported';\n}\nutil.inherits(InvalidAlgorithmError, Error);\n\nfunction KeyParseError(name, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, KeyParseError);\n\tthis.name = 'KeyParseError';\n\tthis.format = format;\n\tthis.keyName = name;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse ' + name + ' as a valid ' + format +\n\t ' format key: ' + innerErr.message;\n}\nutil.inherits(KeyParseError, Error);\n\nfunction SignatureParseError(type, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, SignatureParseError);\n\tthis.name = 'SignatureParseError';\n\tthis.type = type;\n\tthis.format = format;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse the given data as a ' + type +\n\t ' signature in ' + format + ' format: ' + innerErr.message;\n}\nutil.inherits(SignatureParseError, Error);\n\nfunction CertificateParseError(name, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, CertificateParseError);\n\tthis.name = 'CertificateParseError';\n\tthis.format = format;\n\tthis.certName = name;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse ' + name + ' as a valid ' + format +\n\t ' format certificate: ' + innerErr.message;\n}\nutil.inherits(CertificateParseError, Error);\n\nfunction KeyEncryptedError(name, format) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, KeyEncryptedError);\n\tthis.name = 'KeyEncryptedError';\n\tthis.format = format;\n\tthis.keyName = name;\n\tthis.message = 'The ' + format + ' format key ' + name + ' is ' +\n\t 'encrypted (password-protected), and no passphrase was ' +\n\t 'provided in `options`';\n}\nutil.inherits(KeyEncryptedError, Error);\n\nmodule.exports = {\n\tFingerprintFormatError: FingerprintFormatError,\n\tInvalidAlgorithmError: InvalidAlgorithmError,\n\tKeyParseError: KeyParseError,\n\tSignatureParseError: SignatureParseError,\n\tKeyEncryptedError: KeyEncryptedError,\n\tCertificateParseError: CertificateParseError\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/errors.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/fingerprint.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/fingerprint.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2018 Joyent, Inc.\n\nmodule.exports = Fingerprint;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\nvar Key = __webpack_require__(/*! ./key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ./private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar Certificate = __webpack_require__(/*! ./certificate */ \"./node_modules/sshpk/lib/certificate.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\n\nvar FingerprintFormatError = errs.FingerprintFormatError;\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\n\nfunction Fingerprint(opts) {\n\tassert.object(opts, 'options');\n\tassert.string(opts.type, 'options.type');\n\tassert.buffer(opts.hash, 'options.hash');\n\tassert.string(opts.algorithm, 'options.algorithm');\n\n\tthis.algorithm = opts.algorithm.toLowerCase();\n\tif (algs.hashAlgs[this.algorithm] !== true)\n\t\tthrow (new InvalidAlgorithmError(this.algorithm));\n\n\tthis.hash = opts.hash;\n\tthis.type = opts.type;\n\tthis.hashType = opts.hashType;\n}\n\nFingerprint.prototype.toString = function (format) {\n\tif (format === undefined) {\n\t\tif (this.algorithm === 'md5' || this.hashType === 'spki')\n\t\t\tformat = 'hex';\n\t\telse\n\t\t\tformat = 'base64';\n\t}\n\tassert.string(format);\n\n\tswitch (format) {\n\tcase 'hex':\n\t\tif (this.hashType === 'spki')\n\t\t\treturn (this.hash.toString('hex'));\n\t\treturn (addColons(this.hash.toString('hex')));\n\tcase 'base64':\n\t\tif (this.hashType === 'spki')\n\t\t\treturn (this.hash.toString('base64'));\n\t\treturn (sshBase64Format(this.algorithm,\n\t\t this.hash.toString('base64')));\n\tdefault:\n\t\tthrow (new FingerprintFormatError(undefined, format));\n\t}\n};\n\nFingerprint.prototype.matches = function (other) {\n\tassert.object(other, 'key or certificate');\n\tif (this.type === 'key' && this.hashType !== 'ssh') {\n\t\tutils.assertCompatible(other, Key, [1, 7], 'key with spki');\n\t\tif (PrivateKey.isPrivateKey(other)) {\n\t\t\tutils.assertCompatible(other, PrivateKey, [1, 6],\n\t\t\t 'privatekey with spki support');\n\t\t}\n\t} else if (this.type === 'key') {\n\t\tutils.assertCompatible(other, Key, [1, 0], 'key');\n\t} else {\n\t\tutils.assertCompatible(other, Certificate, [1, 0],\n\t\t 'certificate');\n\t}\n\n\tvar theirHash = other.hash(this.algorithm, this.hashType);\n\tvar theirHash2 = crypto.createHash(this.algorithm).\n\t update(theirHash).digest('base64');\n\n\tif (this.hash2 === undefined)\n\t\tthis.hash2 = crypto.createHash(this.algorithm).\n\t\t update(this.hash).digest('base64');\n\n\treturn (this.hash2 === theirHash2);\n};\n\n/*JSSTYLED*/\nvar base64RE = /^[A-Za-z0-9+\\/=]+$/;\n/*JSSTYLED*/\nvar hexRE = /^[a-fA-F0-9]+$/;\n\nFingerprint.parse = function (fp, options) {\n\tassert.string(fp, 'fingerprint');\n\n\tvar alg, hash, enAlgs;\n\tif (Array.isArray(options)) {\n\t\tenAlgs = options;\n\t\toptions = {};\n\t}\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tif (options.enAlgs !== undefined)\n\t\tenAlgs = options.enAlgs;\n\tif (options.algorithms !== undefined)\n\t\tenAlgs = options.algorithms;\n\tassert.optionalArrayOfString(enAlgs, 'algorithms');\n\n\tvar hashType = 'ssh';\n\tif (options.hashType !== undefined)\n\t\thashType = options.hashType;\n\tassert.string(hashType, 'options.hashType');\n\n\tvar parts = fp.split(':');\n\tif (parts.length == 2) {\n\t\talg = parts[0].toLowerCase();\n\t\tif (!base64RE.test(parts[1]))\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\ttry {\n\t\t\thash = Buffer.from(parts[1], 'base64');\n\t\t} catch (e) {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\t} else if (parts.length > 2) {\n\t\talg = 'md5';\n\t\tif (parts[0].toLowerCase() === 'md5')\n\t\t\tparts = parts.slice(1);\n\t\tparts = parts.map(function (p) {\n\t\t\twhile (p.length < 2)\n\t\t\t\tp = '0' + p;\n\t\t\tif (p.length > 2)\n\t\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t\treturn (p);\n\t\t});\n\t\tparts = parts.join('');\n\t\tif (!hexRE.test(parts) || parts.length % 2 !== 0)\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\ttry {\n\t\t\thash = Buffer.from(parts, 'hex');\n\t\t} catch (e) {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\t} else {\n\t\tif (hexRE.test(fp)) {\n\t\t\thash = Buffer.from(fp, 'hex');\n\t\t} else if (base64RE.test(fp)) {\n\t\t\thash = Buffer.from(fp, 'base64');\n\t\t} else {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\n\t\tswitch (hash.length) {\n\t\tcase 32:\n\t\t\talg = 'sha256';\n\t\t\tbreak;\n\t\tcase 16:\n\t\t\talg = 'md5';\n\t\t\tbreak;\n\t\tcase 20:\n\t\t\talg = 'sha1';\n\t\t\tbreak;\n\t\tcase 64:\n\t\t\talg = 'sha512';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\n\t\t/* Plain hex/base64: guess it's probably SPKI unless told. */\n\t\tif (options.hashType === undefined)\n\t\t\thashType = 'spki';\n\t}\n\n\tif (alg === undefined)\n\t\tthrow (new FingerprintFormatError(fp));\n\n\tif (algs.hashAlgs[alg] === undefined)\n\t\tthrow (new InvalidAlgorithmError(alg));\n\n\tif (enAlgs !== undefined) {\n\t\tenAlgs = enAlgs.map(function (a) { return a.toLowerCase(); });\n\t\tif (enAlgs.indexOf(alg) === -1)\n\t\t\tthrow (new InvalidAlgorithmError(alg));\n\t}\n\n\treturn (new Fingerprint({\n\t\talgorithm: alg,\n\t\thash: hash,\n\t\ttype: options.type || 'key',\n\t\thashType: hashType\n\t}));\n};\n\nfunction addColons(s) {\n\t/*JSSTYLED*/\n\treturn (s.replace(/(.{2})(?=.)/g, '$1:'));\n}\n\nfunction base64Strip(s) {\n\t/*JSSTYLED*/\n\treturn (s.replace(/=*$/, ''));\n}\n\nfunction sshBase64Format(alg, h) {\n\treturn (alg.toUpperCase() + ':' + base64Strip(h));\n}\n\nFingerprint.isFingerprint = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Fingerprint, ver));\n};\n\n/*\n * API versions for Fingerprint:\n * [1,0] -- initial ver\n * [1,1] -- first tagged ver\n * [1,2] -- hashType and spki support\n */\nFingerprint.prototype._sshpkApiVersion = [1, 2];\n\nFingerprint._oldVersionDetect = function (obj) {\n\tassert.func(obj.toString);\n\tassert.func(obj.matches);\n\treturn ([1, 0]);\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/fingerprint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/auto.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/auto.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\n\nvar pem = __webpack_require__(/*! ./pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\nvar ssh = __webpack_require__(/*! ./ssh */ \"./node_modules/sshpk/lib/formats/ssh.js\");\nvar rfc4253 = __webpack_require__(/*! ./rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nvar dnssec = __webpack_require__(/*! ./dnssec */ \"./node_modules/sshpk/lib/formats/dnssec.js\");\nvar putty = __webpack_require__(/*! ./putty */ \"./node_modules/sshpk/lib/formats/putty.js\");\n\nvar DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1';\n\nfunction read(buf, options) {\n\tif (typeof (buf) === 'string') {\n\t\tif (buf.trim().match(/^[-]+[ ]*BEGIN/))\n\t\t\treturn (pem.read(buf, options));\n\t\tif (buf.match(/^\\s*ssh-[a-z]/))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (buf.match(/^\\s*ecdsa-/))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (buf.match(/^putty-user-key-file-2:/i))\n\t\t\treturn (putty.read(buf, options));\n\t\tif (findDNSSECHeader(buf))\n\t\t\treturn (dnssec.read(buf, options));\n\t\tbuf = Buffer.from(buf, 'binary');\n\t} else {\n\t\tassert.buffer(buf);\n\t\tif (findPEMHeader(buf))\n\t\t\treturn (pem.read(buf, options));\n\t\tif (findSSHHeader(buf))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (findPuTTYHeader(buf))\n\t\t\treturn (putty.read(buf, options));\n\t\tif (findDNSSECHeader(buf))\n\t\t\treturn (dnssec.read(buf, options));\n\t}\n\tif (buf.readUInt32BE(0) < buf.length)\n\t\treturn (rfc4253.read(buf, options));\n\tthrow (new Error('Failed to auto-detect format of key'));\n}\n\nfunction findPuTTYHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))\n\t\t++offset;\n\tif (offset + 22 <= buf.length &&\n\t buf.slice(offset, offset + 22).toString('ascii').toLowerCase() ===\n\t 'putty-user-key-file-2:')\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction findSSHHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))\n\t\t++offset;\n\tif (offset + 4 <= buf.length &&\n\t buf.slice(offset, offset + 4).toString('ascii') === 'ssh-')\n\t\treturn (true);\n\tif (offset + 6 <= buf.length &&\n\t buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-')\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction findPEMHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10))\n\t\t++offset;\n\tif (buf[offset] !== 45)\n\t\treturn (false);\n\twhile (offset < buf.length &&\n\t (buf[offset] === 45))\n\t\t++offset;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32))\n\t\t++offset;\n\tif (offset + 5 > buf.length ||\n\t buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN')\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction findDNSSECHeader(buf) {\n\t// private case first\n\tif (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length)\n\t\treturn (false);\n\tvar headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length);\n\tif (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX)\n\t\treturn (true);\n\n\t// public-key RFC3110 ?\n\t// 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...'\n\t// skip any comment-lines\n\tif (typeof (buf) !== 'string') {\n\t\tbuf = buf.toString('ascii');\n\t}\n\tvar lines = buf.split('\\n');\n\tvar line = 0;\n\t/* JSSTYLED */\n\twhile (lines[line].match(/^\\;/))\n\t\tline++;\n\tif (lines[line].toString('ascii').match(/\\. IN KEY /))\n\t\treturn (true);\n\tif (lines[line].toString('ascii').match(/\\. IN DNSKEY /))\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction write(key, options) {\n\tthrow (new Error('\"auto\" format cannot be used for writing'));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/auto.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/dnssec.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/dnssec.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar SSHBuffer = __webpack_require__(/*! ../ssh-buffer */ \"./node_modules/sshpk/lib/ssh-buffer.js\");\nvar Dhe = __webpack_require__(/*! ../dhe */ \"./node_modules/sshpk/lib/dhe.js\");\n\nvar supportedAlgos = {\n\t'rsa-sha1' : 5,\n\t'rsa-sha256' : 8,\n\t'rsa-sha512' : 10,\n\t'ecdsa-p256-sha256' : 13,\n\t'ecdsa-p384-sha384' : 14\n\t/*\n\t * ed25519 is hypothetically supported with id 15\n\t * but the common tools available don't appear to be\n\t * capable of generating/using ed25519 keys\n\t */\n};\n\nvar supportedAlgosById = {};\nObject.keys(supportedAlgos).forEach(function (k) {\n\tsupportedAlgosById[supportedAlgos[k]] = k.toUpperCase();\n});\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\tvar lines = buf.split('\\n');\n\tif (lines[0].match(/^Private-key-format\\: v1/)) {\n\t\tvar algElems = lines[1].split(' ');\n\t\tvar algoNum = parseInt(algElems[1], 10);\n\t\tvar algoName = algElems[2];\n\t\tif (!supportedAlgosById[algoNum])\n\t\t\tthrow (new Error('Unsupported algorithm: ' + algoName));\n\t\treturn (readDNSSECPrivateKey(algoNum, lines.slice(2)));\n\t}\n\n\t// skip any comment-lines\n\tvar line = 0;\n\t/* JSSTYLED */\n\twhile (lines[line].match(/^\\;/))\n\t\tline++;\n\t// we should now have *one single* line left with our KEY on it.\n\tif ((lines[line].match(/\\. IN KEY /) ||\n\t lines[line].match(/\\. IN DNSKEY /)) && lines[line+1].length === 0) {\n\t\treturn (readRFC3110(lines[line]));\n\t}\n\tthrow (new Error('Cannot parse dnssec key'));\n}\n\nfunction readRFC3110(keyString) {\n\tvar elems = keyString.split(' ');\n\t//unused var flags = parseInt(elems[3], 10);\n\t//unused var protocol = parseInt(elems[4], 10);\n\tvar algorithm = parseInt(elems[5], 10);\n\tif (!supportedAlgosById[algorithm])\n\t\tthrow (new Error('Unsupported algorithm: ' + algorithm));\n\tvar base64key = elems.slice(6, elems.length).join();\n\tvar keyBuffer = Buffer.from(base64key, 'base64');\n\tif (supportedAlgosById[algorithm].match(/^RSA-/)) {\n\t\t// join the rest of the body into a single base64-blob\n\t\tvar publicExponentLen = keyBuffer.readUInt8(0);\n\t\tif (publicExponentLen != 3 && publicExponentLen != 1)\n\t\t\tthrow (new Error('Cannot parse dnssec key: ' +\n\t\t\t 'unsupported exponent length'));\n\n\t\tvar publicExponent = keyBuffer.slice(1, publicExponentLen+1);\n\t\tpublicExponent = utils.mpNormalize(publicExponent);\n\t\tvar modulus = keyBuffer.slice(1+publicExponentLen);\n\t\tmodulus = utils.mpNormalize(modulus);\n\t\t// now, make the key\n\t\tvar rsaKey = {\n\t\t\ttype: 'rsa',\n\t\t\tparts: []\n\t\t};\n\t\trsaKey.parts.push({ name: 'e', data: publicExponent});\n\t\trsaKey.parts.push({ name: 'n', data: modulus});\n\t\treturn (new Key(rsaKey));\n\t}\n\tif (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' ||\n\t supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') {\n\t\tvar curve = 'nistp384';\n\t\tvar size = 384;\n\t\tif (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) {\n\t\t\tcurve = 'nistp256';\n\t\t\tsize = 256;\n\t\t}\n\n\t\tvar ecdsaKey = {\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tsize: size,\n\t\t\tparts: [\n\t\t\t\t{name: 'curve', data: Buffer.from(curve) },\n\t\t\t\t{name: 'Q', data: utils.ecNormalize(keyBuffer) }\n\t\t\t]\n\t\t};\n\t\treturn (new Key(ecdsaKey));\n\t}\n\tthrow (new Error('Unsupported algorithm: ' +\n\t supportedAlgosById[algorithm]));\n}\n\nfunction elementToBuf(e) {\n\treturn (Buffer.from(e.split(' ')[1], 'base64'));\n}\n\nfunction readDNSSECRSAPrivateKey(elements) {\n\tvar rsaParams = {};\n\telements.forEach(function (element) {\n\t\tif (element.split(' ')[0] === 'Modulus:')\n\t\t\trsaParams['n'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'PublicExponent:')\n\t\t\trsaParams['e'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'PrivateExponent:')\n\t\t\trsaParams['d'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Prime1:')\n\t\t\trsaParams['p'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Prime2:')\n\t\t\trsaParams['q'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Exponent1:')\n\t\t\trsaParams['dmodp'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Exponent2:')\n\t\t\trsaParams['dmodq'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Coefficient:')\n\t\t\trsaParams['iqmp'] = elementToBuf(element);\n\t});\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'e', data: utils.mpNormalize(rsaParams['e'])},\n\t\t\t{ name: 'n', data: utils.mpNormalize(rsaParams['n'])},\n\t\t\t{ name: 'd', data: utils.mpNormalize(rsaParams['d'])},\n\t\t\t{ name: 'p', data: utils.mpNormalize(rsaParams['p'])},\n\t\t\t{ name: 'q', data: utils.mpNormalize(rsaParams['q'])},\n\t\t\t{ name: 'dmodp',\n\t\t\t data: utils.mpNormalize(rsaParams['dmodp'])},\n\t\t\t{ name: 'dmodq',\n\t\t\t data: utils.mpNormalize(rsaParams['dmodq'])},\n\t\t\t{ name: 'iqmp',\n\t\t\t data: utils.mpNormalize(rsaParams['iqmp'])}\n\t\t]\n\t};\n\treturn (new PrivateKey(key));\n}\n\nfunction readDNSSECPrivateKey(alg, elements) {\n\tif (supportedAlgosById[alg].match(/^RSA-/)) {\n\t\treturn (readDNSSECRSAPrivateKey(elements));\n\t}\n\tif (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' ||\n\t supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {\n\t\tvar d = Buffer.from(elements[0].split(' ')[1], 'base64');\n\t\tvar curve = 'nistp384';\n\t\tvar size = 384;\n\t\tif (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {\n\t\t\tcurve = 'nistp256';\n\t\t\tsize = 256;\n\t\t}\n\t\t// DNSSEC generates the public-key on the fly (go calculate it)\n\t\tvar publicKey = utils.publicFromPrivateECDSA(curve, d);\n\t\tvar Q = publicKey.part['Q'].data;\n\t\tvar ecdsaKey = {\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tsize: size,\n\t\t\tparts: [\n\t\t\t\t{name: 'curve', data: Buffer.from(curve) },\n\t\t\t\t{name: 'd', data: d },\n\t\t\t\t{name: 'Q', data: Q }\n\t\t\t]\n\t\t};\n\t\treturn (new PrivateKey(ecdsaKey));\n\t}\n\tthrow (new Error('Unsupported algorithm: ' + supportedAlgosById[alg]));\n}\n\nfunction dnssecTimestamp(date) {\n\tvar year = date.getFullYear() + ''; //stringify\n\tvar month = (date.getMonth() + 1);\n\tvar timestampStr = year + month + date.getUTCDate();\n\ttimestampStr += '' + date.getUTCHours() + date.getUTCMinutes();\n\ttimestampStr += date.getUTCSeconds();\n\treturn (timestampStr);\n}\n\nfunction rsaAlgFromOptions(opts) {\n\tif (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1')\n\t\treturn ('5 (RSASHA1)');\n\telse if (opts.hashAlgo === 'sha256')\n\t\treturn ('8 (RSASHA256)');\n\telse if (opts.hashAlgo === 'sha512')\n\t\treturn ('10 (RSASHA512)');\n\telse\n\t\tthrow (new Error('Unknown or unsupported hash: ' +\n\t\t opts.hashAlgo));\n}\n\nfunction writeRSA(key, options) {\n\t// if we're missing parts, add them.\n\tif (!key.part.dmodp || !key.part.dmodq) {\n\t\tutils.addRSAMissing(key);\n\t}\n\n\tvar out = '';\n\tout += 'Private-key-format: v1.3\\n';\n\tout += 'Algorithm: ' + rsaAlgFromOptions(options) + '\\n';\n\tvar n = utils.mpDenormalize(key.part['n'].data);\n\tout += 'Modulus: ' + n.toString('base64') + '\\n';\n\tvar e = utils.mpDenormalize(key.part['e'].data);\n\tout += 'PublicExponent: ' + e.toString('base64') + '\\n';\n\tvar d = utils.mpDenormalize(key.part['d'].data);\n\tout += 'PrivateExponent: ' + d.toString('base64') + '\\n';\n\tvar p = utils.mpDenormalize(key.part['p'].data);\n\tout += 'Prime1: ' + p.toString('base64') + '\\n';\n\tvar q = utils.mpDenormalize(key.part['q'].data);\n\tout += 'Prime2: ' + q.toString('base64') + '\\n';\n\tvar dmodp = utils.mpDenormalize(key.part['dmodp'].data);\n\tout += 'Exponent1: ' + dmodp.toString('base64') + '\\n';\n\tvar dmodq = utils.mpDenormalize(key.part['dmodq'].data);\n\tout += 'Exponent2: ' + dmodq.toString('base64') + '\\n';\n\tvar iqmp = utils.mpDenormalize(key.part['iqmp'].data);\n\tout += 'Coefficient: ' + iqmp.toString('base64') + '\\n';\n\t// Assume that we're valid as-of now\n\tvar timestamp = new Date();\n\tout += 'Created: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Publish: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Activate: ' + dnssecTimestamp(timestamp) + '\\n';\n\treturn (Buffer.from(out, 'ascii'));\n}\n\nfunction writeECDSA(key, options) {\n\tvar out = '';\n\tout += 'Private-key-format: v1.3\\n';\n\n\tif (key.curve === 'nistp256') {\n\t\tout += 'Algorithm: 13 (ECDSAP256SHA256)\\n';\n\t} else if (key.curve === 'nistp384') {\n\t\tout += 'Algorithm: 14 (ECDSAP384SHA384)\\n';\n\t} else {\n\t\tthrow (new Error('Unsupported curve'));\n\t}\n\tvar base64Key = key.part['d'].data.toString('base64');\n\tout += 'PrivateKey: ' + base64Key + '\\n';\n\n\t// Assume that we're valid as-of now\n\tvar timestamp = new Date();\n\tout += 'Created: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Publish: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Activate: ' + dnssecTimestamp(timestamp) + '\\n';\n\n\treturn (Buffer.from(out, 'ascii'));\n}\n\nfunction write(key, options) {\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tif (key.type === 'rsa') {\n\t\t\treturn (writeRSA(key, options));\n\t\t} else if (key.type === 'ecdsa') {\n\t\t\treturn (writeECDSA(key, options));\n\t\t} else {\n\t\t\tthrow (new Error('Unsupported algorithm: ' + key.type));\n\t\t}\n\t} else if (Key.isKey(key)) {\n\t\t/*\n\t\t * RFC3110 requires a keyname, and a keytype, which we\n\t\t * don't really have a mechanism for specifying such\n\t\t * additional metadata.\n\t\t */\n\t\tthrow (new Error('Format \"dnssec\" only supports ' +\n\t\t 'writing private keys'));\n\t} else {\n\t\tthrow (new Error('key is not a Key or PrivateKey'));\n\t}\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/dnssec.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/openssh-cert.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/openssh-cert.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\tverify: verify,\n\tsign: sign,\n\tsignAsync: signAsync,\n\twrite: write,\n\n\t/* Internal private API */\n\tfromBuffer: fromBuffer,\n\ttoBuffer: toBuffer\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar SSHBuffer = __webpack_require__(/*! ../ssh-buffer */ \"./node_modules/sshpk/lib/ssh-buffer.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar Identity = __webpack_require__(/*! ../identity */ \"./node_modules/sshpk/lib/identity.js\");\nvar rfc4253 = __webpack_require__(/*! ./rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nvar Signature = __webpack_require__(/*! ../signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Certificate = __webpack_require__(/*! ../certificate */ \"./node_modules/sshpk/lib/certificate.js\");\n\nfunction verify(cert, key) {\n\t/*\n\t * We always give an issuerKey, so if our verify() is being called then\n\t * there was no signature. Return false.\n\t */\n\treturn (false);\n}\n\nvar TYPES = {\n\t'user': 1,\n\t'host': 2\n};\nObject.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; });\n\nvar ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;\n\nfunction read(buf, options) {\n\tif (Buffer.isBuffer(buf))\n\t\tbuf = buf.toString('ascii');\n\tvar parts = buf.trim().split(/[ \\t\\n]+/g);\n\tif (parts.length < 2 || parts.length > 3)\n\t\tthrow (new Error('Not a valid SSH certificate line'));\n\n\tvar algo = parts[0];\n\tvar data = parts[1];\n\n\tdata = Buffer.from(data, 'base64');\n\treturn (fromBuffer(data, algo));\n}\n\nfunction fromBuffer(data, algo, partial) {\n\tvar sshbuf = new SSHBuffer({ buffer: data });\n\tvar innerAlgo = sshbuf.readString();\n\tif (algo !== undefined && innerAlgo !== algo)\n\t\tthrow (new Error('SSH certificate algorithm mismatch'));\n\tif (algo === undefined)\n\t\talgo = innerAlgo;\n\n\tvar cert = {};\n\tcert.signatures = {};\n\tcert.signatures.openssh = {};\n\n\tcert.signatures.openssh.nonce = sshbuf.readBuffer();\n\n\tvar key = {};\n\tvar parts = (key.parts = []);\n\tkey.type = getAlg(algo);\n\n\tvar partCount = algs.info[key.type].parts.length;\n\twhile (parts.length < partCount)\n\t\tparts.push(sshbuf.readPart());\n\tassert.ok(parts.length >= 1, 'key must have at least one part');\n\n\tvar algInfo = algs.info[key.type];\n\tif (key.type === 'ecdsa') {\n\t\tvar res = ECDSA_ALGO.exec(algo);\n\t\tassert.ok(res !== null);\n\t\tassert.strictEqual(res[1], parts[0].data.toString());\n\t}\n\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tparts[i].name = algInfo.parts[i];\n\t\tif (parts[i].name !== 'curve' &&\n\t\t algInfo.normalize !== false) {\n\t\t\tvar p = parts[i];\n\t\t\tp.data = utils.mpNormalize(p.data);\n\t\t}\n\t}\n\n\tcert.subjectKey = new Key(key);\n\n\tcert.serial = sshbuf.readInt64();\n\n\tvar type = TYPES[sshbuf.readInt()];\n\tassert.string(type, 'valid cert type');\n\n\tcert.signatures.openssh.keyId = sshbuf.readString();\n\n\tvar principals = [];\n\tvar pbuf = sshbuf.readBuffer();\n\tvar psshbuf = new SSHBuffer({ buffer: pbuf });\n\twhile (!psshbuf.atEnd())\n\t\tprincipals.push(psshbuf.readString());\n\tif (principals.length === 0)\n\t\tprincipals = ['*'];\n\n\tcert.subjects = principals.map(function (pr) {\n\t\tif (type === 'user')\n\t\t\treturn (Identity.forUser(pr));\n\t\telse if (type === 'host')\n\t\t\treturn (Identity.forHost(pr));\n\t\tthrow (new Error('Unknown identity type ' + type));\n\t});\n\n\tcert.validFrom = int64ToDate(sshbuf.readInt64());\n\tcert.validUntil = int64ToDate(sshbuf.readInt64());\n\n\tvar exts = [];\n\tvar extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });\n\tvar ext;\n\twhile (!extbuf.atEnd()) {\n\t\text = { critical: true };\n\t\text.name = extbuf.readString();\n\t\text.data = extbuf.readBuffer();\n\t\texts.push(ext);\n\t}\n\textbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });\n\twhile (!extbuf.atEnd()) {\n\t\text = { critical: false };\n\t\text.name = extbuf.readString();\n\t\text.data = extbuf.readBuffer();\n\t\texts.push(ext);\n\t}\n\tcert.signatures.openssh.exts = exts;\n\n\t/* reserved */\n\tsshbuf.readBuffer();\n\n\tvar signingKeyBuf = sshbuf.readBuffer();\n\tcert.issuerKey = rfc4253.read(signingKeyBuf);\n\n\t/*\n\t * OpenSSH certs don't give the identity of the issuer, just their\n\t * public key. So, we use an Identity that matches anything. The\n\t * isSignedBy() function will later tell you if the key matches.\n\t */\n\tcert.issuer = Identity.forHost('**');\n\n\tvar sigBuf = sshbuf.readBuffer();\n\tcert.signatures.openssh.signature =\n\t Signature.parse(sigBuf, cert.issuerKey.type, 'ssh');\n\n\tif (partial !== undefined) {\n\t\tpartial.remainder = sshbuf.remainder();\n\t\tpartial.consumed = sshbuf._offset;\n\t}\n\n\treturn (new Certificate(cert));\n}\n\nfunction int64ToDate(buf) {\n\tvar i = buf.readUInt32BE(0) * 4294967296;\n\ti += buf.readUInt32BE(4);\n\tvar d = new Date();\n\td.setTime(i * 1000);\n\td.sourceInt64 = buf;\n\treturn (d);\n}\n\nfunction dateToInt64(date) {\n\tif (date.sourceInt64 !== undefined)\n\t\treturn (date.sourceInt64);\n\tvar i = Math.round(date.getTime() / 1000);\n\tvar upper = Math.floor(i / 4294967296);\n\tvar lower = Math.floor(i % 4294967296);\n\tvar buf = Buffer.alloc(8);\n\tbuf.writeUInt32BE(upper, 0);\n\tbuf.writeUInt32BE(lower, 4);\n\treturn (buf);\n}\n\nfunction sign(cert, key) {\n\tif (cert.signatures.openssh === undefined)\n\t\tcert.signatures.openssh = {};\n\ttry {\n\t\tvar blob = toBuffer(cert, true);\n\t} catch (e) {\n\t\tdelete (cert.signatures.openssh);\n\t\treturn (false);\n\t}\n\tvar sig = cert.signatures.openssh;\n\tvar hashAlgo = undefined;\n\tif (key.type === 'rsa' || key.type === 'dsa')\n\t\thashAlgo = 'sha1';\n\tvar signer = key.createSign(hashAlgo);\n\tsigner.write(blob);\n\tsig.signature = signer.sign();\n\treturn (true);\n}\n\nfunction signAsync(cert, signer, done) {\n\tif (cert.signatures.openssh === undefined)\n\t\tcert.signatures.openssh = {};\n\ttry {\n\t\tvar blob = toBuffer(cert, true);\n\t} catch (e) {\n\t\tdelete (cert.signatures.openssh);\n\t\tdone(e);\n\t\treturn;\n\t}\n\tvar sig = cert.signatures.openssh;\n\n\tsigner(blob, function (err, signature) {\n\t\tif (err) {\n\t\t\tdone(err);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\t/*\n\t\t\t * This will throw if the signature isn't of a\n\t\t\t * type/algo that can be used for SSH.\n\t\t\t */\n\t\t\tsignature.toBuffer('ssh');\n\t\t} catch (e) {\n\t\t\tdone(e);\n\t\t\treturn;\n\t\t}\n\t\tsig.signature = signature;\n\t\tdone();\n\t});\n}\n\nfunction write(cert, options) {\n\tif (options === undefined)\n\t\toptions = {};\n\n\tvar blob = toBuffer(cert);\n\tvar out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64');\n\tif (options.comment)\n\t\tout = out + ' ' + options.comment;\n\treturn (out);\n}\n\n\nfunction toBuffer(cert, noSig) {\n\tassert.object(cert.signatures.openssh, 'signature for openssh format');\n\tvar sig = cert.signatures.openssh;\n\n\tif (sig.nonce === undefined)\n\t\tsig.nonce = crypto.randomBytes(16);\n\tvar buf = new SSHBuffer({});\n\tbuf.writeString(getCertType(cert.subjectKey));\n\tbuf.writeBuffer(sig.nonce);\n\n\tvar key = cert.subjectKey;\n\tvar algInfo = algs.info[key.type];\n\talgInfo.parts.forEach(function (part) {\n\t\tbuf.writePart(key.part[part]);\n\t});\n\n\tbuf.writeInt64(cert.serial);\n\n\tvar type = cert.subjects[0].type;\n\tassert.notStrictEqual(type, 'unknown');\n\tcert.subjects.forEach(function (id) {\n\t\tassert.strictEqual(id.type, type);\n\t});\n\ttype = TYPES[type];\n\tbuf.writeInt(type);\n\n\tif (sig.keyId === undefined) {\n\t\tsig.keyId = cert.subjects[0].type + '_' +\n\t\t (cert.subjects[0].uid || cert.subjects[0].hostname);\n\t}\n\tbuf.writeString(sig.keyId);\n\n\tvar sub = new SSHBuffer({});\n\tcert.subjects.forEach(function (id) {\n\t\tif (type === TYPES.host)\n\t\t\tsub.writeString(id.hostname);\n\t\telse if (type === TYPES.user)\n\t\t\tsub.writeString(id.uid);\n\t});\n\tbuf.writeBuffer(sub.toBuffer());\n\n\tbuf.writeInt64(dateToInt64(cert.validFrom));\n\tbuf.writeInt64(dateToInt64(cert.validUntil));\n\n\tvar exts = sig.exts;\n\tif (exts === undefined)\n\t\texts = [];\n\n\tvar extbuf = new SSHBuffer({});\n\texts.forEach(function (ext) {\n\t\tif (ext.critical !== true)\n\t\t\treturn;\n\t\textbuf.writeString(ext.name);\n\t\textbuf.writeBuffer(ext.data);\n\t});\n\tbuf.writeBuffer(extbuf.toBuffer());\n\n\textbuf = new SSHBuffer({});\n\texts.forEach(function (ext) {\n\t\tif (ext.critical === true)\n\t\t\treturn;\n\t\textbuf.writeString(ext.name);\n\t\textbuf.writeBuffer(ext.data);\n\t});\n\tbuf.writeBuffer(extbuf.toBuffer());\n\n\t/* reserved */\n\tbuf.writeBuffer(Buffer.alloc(0));\n\n\tsub = rfc4253.write(cert.issuerKey);\n\tbuf.writeBuffer(sub);\n\n\tif (!noSig)\n\t\tbuf.writeBuffer(sig.signature.toBuffer('ssh'));\n\n\treturn (buf.toBuffer());\n}\n\nfunction getAlg(certType) {\n\tif (certType === 'ssh-rsa-cert-v01@openssh.com')\n\t\treturn ('rsa');\n\tif (certType === 'ssh-dss-cert-v01@openssh.com')\n\t\treturn ('dsa');\n\tif (certType.match(ECDSA_ALGO))\n\t\treturn ('ecdsa');\n\tif (certType === 'ssh-ed25519-cert-v01@openssh.com')\n\t\treturn ('ed25519');\n\tthrow (new Error('Unsupported cert type ' + certType));\n}\n\nfunction getCertType(key) {\n\tif (key.type === 'rsa')\n\t\treturn ('ssh-rsa-cert-v01@openssh.com');\n\tif (key.type === 'dsa')\n\t\treturn ('ssh-dss-cert-v01@openssh.com');\n\tif (key.type === 'ecdsa')\n\t\treturn ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com');\n\tif (key.type === 'ed25519')\n\t\treturn ('ssh-ed25519-cert-v01@openssh.com');\n\tthrow (new Error('Unsupported key type ' + key.type));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/openssh-cert.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/pem.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/pem.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\n\nvar pkcs1 = __webpack_require__(/*! ./pkcs1 */ \"./node_modules/sshpk/lib/formats/pkcs1.js\");\nvar pkcs8 = __webpack_require__(/*! ./pkcs8 */ \"./node_modules/sshpk/lib/formats/pkcs8.js\");\nvar sshpriv = __webpack_require__(/*! ./ssh-private */ \"./node_modules/sshpk/lib/formats/ssh-private.js\");\nvar rfc4253 = __webpack_require__(/*! ./rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\n\nvar errors = __webpack_require__(/*! ../errors */ \"./node_modules/sshpk/lib/errors.js\");\n\nvar OID_PBES2 = '1.2.840.113549.1.5.13';\nvar OID_PBKDF2 = '1.2.840.113549.1.5.12';\n\nvar OID_TO_CIPHER = {\n\t'1.2.840.113549.3.7': '3des-cbc',\n\t'2.16.840.1.101.3.4.1.2': 'aes128-cbc',\n\t'2.16.840.1.101.3.4.1.42': 'aes256-cbc'\n};\nvar CIPHER_TO_OID = {};\nObject.keys(OID_TO_CIPHER).forEach(function (k) {\n\tCIPHER_TO_OID[OID_TO_CIPHER[k]] = k;\n});\n\nvar OID_TO_HASH = {\n\t'1.2.840.113549.2.7': 'sha1',\n\t'1.2.840.113549.2.9': 'sha256',\n\t'1.2.840.113549.2.11': 'sha512'\n};\nvar HASH_TO_OID = {};\nObject.keys(OID_TO_HASH).forEach(function (k) {\n\tHASH_TO_OID[OID_TO_HASH[k]] = k;\n});\n\n/*\n * For reading we support both PKCS#1 and PKCS#8. If we find a private key,\n * we just take the public component of it and use that.\n */\nfunction read(buf, options, forceType) {\n\tvar input = buf;\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split(/[\\r\\n]+/g);\n\n\tvar m;\n\tvar si = -1;\n\twhile (!m && si < lines.length) {\n\t\tm = lines[++si].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\t}\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2;\n\tvar ei = lines.length;\n\twhile (!m2 && ei > 0) {\n\t\tm2 = lines[--ei].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\t}\n\tassert.ok(m2, 'invalid PEM footer');\n\n\t/* Begin and end banners must match key type */\n\tassert.equal(m[2], m2[2]);\n\tvar type = m[2].toLowerCase();\n\n\tvar alg;\n\tif (m[1]) {\n\t\t/* They also must match algorithms, if given */\n\t\tassert.equal(m[1], m2[1], 'PEM header and footer mismatch');\n\t\talg = m[1].trim();\n\t}\n\n\tlines = lines.slice(si, ei + 1);\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match(/*JSSTYLED*/\n\t\t /^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m)\n\t\t\tbreak;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = Buffer.from(lines, 'base64');\n\n\tvar cipher, key, iv;\n\tif (headers['proc-type']) {\n\t\tvar parts = headers['proc-type'].split(',');\n\t\tif (parts[0] === '4' && parts[1] === 'ENCRYPTED') {\n\t\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\t\toptions.passphrase = Buffer.from(\n\t\t\t\t options.passphrase, 'utf-8');\n\t\t\t}\n\t\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t\t options.filename, 'PEM'));\n\t\t\t} else {\n\t\t\t\tparts = headers['dek-info'].split(',');\n\t\t\t\tassert.ok(parts.length === 2);\n\t\t\t\tcipher = parts[0].toLowerCase();\n\t\t\t\tiv = Buffer.from(parts[1], 'hex');\n\t\t\t\tkey = utils.opensslKeyDeriv(cipher, iv,\n\t\t\t\t options.passphrase, 1).key;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (alg && alg.toLowerCase() === 'encrypted') {\n\t\tvar eder = new asn1.BerReader(buf);\n\t\tvar pbesEnd;\n\t\teder.readSequence();\n\n\t\teder.readSequence();\n\t\tpbesEnd = eder.offset + eder.length;\n\n\t\tvar method = eder.readOID();\n\t\tif (method !== OID_PBES2) {\n\t\t\tthrow (new Error('Unsupported PEM/PKCS8 encryption ' +\n\t\t\t 'scheme: ' + method));\n\t\t}\n\n\t\teder.readSequence();\t/* PBES2-params */\n\n\t\teder.readSequence();\t/* keyDerivationFunc */\n\t\tvar kdfEnd = eder.offset + eder.length;\n\t\tvar kdfOid = eder.readOID();\n\t\tif (kdfOid !== OID_PBKDF2)\n\t\t\tthrow (new Error('Unsupported PBES2 KDF: ' + kdfOid));\n\t\teder.readSequence();\n\t\tvar salt = eder.readString(asn1.Ber.OctetString, true);\n\t\tvar iterations = eder.readInt();\n\t\tvar hashAlg = 'sha1';\n\t\tif (eder.offset < kdfEnd) {\n\t\t\teder.readSequence();\n\t\t\tvar hashAlgOid = eder.readOID();\n\t\t\thashAlg = OID_TO_HASH[hashAlgOid];\n\t\t\tif (hashAlg === undefined) {\n\t\t\t\tthrow (new Error('Unsupported PBKDF2 hash: ' +\n\t\t\t\t hashAlgOid));\n\t\t\t}\n\t\t}\n\t\teder._offset = kdfEnd;\n\n\t\teder.readSequence();\t/* encryptionScheme */\n\t\tvar cipherOid = eder.readOID();\n\t\tcipher = OID_TO_CIPHER[cipherOid];\n\t\tif (cipher === undefined) {\n\t\t\tthrow (new Error('Unsupported PBES2 cipher: ' +\n\t\t\t cipherOid));\n\t\t}\n\t\tiv = eder.readString(asn1.Ber.OctetString, true);\n\n\t\teder._offset = pbesEnd;\n\t\tbuf = eder.readString(asn1.Ber.OctetString, true);\n\n\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\toptions.passphrase = Buffer.from(\n\t\t\t options.passphrase, 'utf-8');\n\t\t}\n\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t options.filename, 'PEM'));\n\t\t}\n\n\t\tvar cinfo = utils.opensshCipherInfo(cipher);\n\n\t\tcipher = cinfo.opensslName;\n\t\tkey = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize,\n\t\t options.passphrase);\n\t\talg = undefined;\n\t}\n\n\tif (cipher && key && iv) {\n\t\tvar cipherStream = crypto.createDecipheriv(cipher, key, iv);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow (new Error('Incorrect passphrase ' +\n\t\t\t\t 'supplied, could not decrypt key'));\n\t\t\t}\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(buf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tbuf = Buffer.concat(chunks);\n\t}\n\n\t/* The new OpenSSH internal format abuses PEM headers */\n\tif (alg && alg.toLowerCase() === 'openssh')\n\t\treturn (sshpriv.readSSHPrivate(type, buf, options));\n\tif (alg && alg.toLowerCase() === 'ssh2')\n\t\treturn (rfc4253.readType(type, buf, options));\n\n\tvar der = new asn1.BerReader(buf);\n\tder.originalInput = input;\n\n\t/*\n\t * All of the PEM file types start with a sequence tag, so chop it\n\t * off here\n\t */\n\tder.readSequence();\n\n\t/* PKCS#1 type keys name an algorithm in the banner explicitly */\n\tif (alg) {\n\t\tif (forceType)\n\t\t\tassert.strictEqual(forceType, 'pkcs1');\n\t\treturn (pkcs1.readPkcs1(alg, type, der));\n\t} else {\n\t\tif (forceType)\n\t\t\tassert.strictEqual(forceType, 'pkcs8');\n\t\treturn (pkcs8.readPkcs8(alg, type, der));\n\t}\n}\n\nfunction write(key, options, type) {\n\tassert.object(key);\n\n\tvar alg = {\n\t 'ecdsa': 'EC',\n\t 'rsa': 'RSA',\n\t 'dsa': 'DSA',\n\t 'ed25519': 'EdDSA'\n\t}[key.type];\n\tvar header;\n\n\tvar der = new asn1.BerWriter();\n\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tif (type && type === 'pkcs8') {\n\t\t\theader = 'PRIVATE KEY';\n\t\t\tpkcs8.writePkcs8(der, key);\n\t\t} else {\n\t\t\tif (type)\n\t\t\t\tassert.strictEqual(type, 'pkcs1');\n\t\t\theader = alg + ' PRIVATE KEY';\n\t\t\tpkcs1.writePkcs1(der, key);\n\t\t}\n\n\t} else if (Key.isKey(key)) {\n\t\tif (type && type === 'pkcs1') {\n\t\t\theader = alg + ' PUBLIC KEY';\n\t\t\tpkcs1.writePkcs1(der, key);\n\t\t} else {\n\t\t\tif (type)\n\t\t\t\tassert.strictEqual(type, 'pkcs8');\n\t\t\theader = 'PUBLIC KEY';\n\t\t\tpkcs8.writePkcs8(der, key);\n\t\t}\n\n\t} else {\n\t\tthrow (new Error('key is not a Key or PrivateKey'));\n\t}\n\n\tvar tmp = der.buffer.toString('base64');\n\tvar len = tmp.length + (tmp.length / 64) +\n\t 18 + 16 + header.length*2 + 10;\n\tvar buf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 64;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/pem.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/pkcs1.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/pkcs1.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadPkcs1: readPkcs1,\n\twrite: write,\n\twritePkcs1: writePkcs1\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\n\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar pem = __webpack_require__(/*! ./pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\n\nvar pkcs8 = __webpack_require__(/*! ./pkcs8 */ \"./node_modules/sshpk/lib/formats/pkcs8.js\");\nvar readECDSACurve = pkcs8.readECDSACurve;\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options, 'pkcs1'));\n}\n\nfunction write(key, options) {\n\treturn (pem.write(key, options, 'pkcs1'));\n}\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction readPkcs1(alg, type, der) {\n\tswitch (alg) {\n\tcase 'RSA':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs1RSAPublic(der));\n\t\telse if (type === 'private')\n\t\t\treturn (readPkcs1RSAPrivate(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'DSA':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs1DSAPublic(der));\n\t\telse if (type === 'private')\n\t\t\treturn (readPkcs1DSAPrivate(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'EC':\n\tcase 'ECDSA':\n\t\tif (type === 'private')\n\t\t\treturn (readPkcs1ECDSAPrivate(der));\n\t\telse if (type === 'public')\n\t\t\treturn (readPkcs1ECDSAPublic(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'EDDSA':\n\tcase 'EdDSA':\n\t\tif (type === 'private')\n\t\t\treturn (readPkcs1EdDSAPrivate(der));\n\t\tthrow (new Error(type + ' keys not supported with EdDSA'));\n\tdefault:\n\t\tthrow (new Error('Unknown key algo: ' + alg));\n\t}\n}\n\nfunction readPkcs1RSAPublic(der) {\n\t// modulus and exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'exponent');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'n', data: n }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1RSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version[0], 0);\n\n\t// modulus then public exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'public exponent');\n\tvar d = readMPInt(der, 'private exponent');\n\tvar p = readMPInt(der, 'prime1');\n\tvar q = readMPInt(der, 'prime2');\n\tvar dmodp = readMPInt(der, 'exponent1');\n\tvar dmodq = readMPInt(der, 'exponent2');\n\tvar iqmp = readMPInt(der, 'iqmp');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'n', data: n },\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'd', data: d },\n\t\t\t{ name: 'iqmp', data: iqmp },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'dmodp', data: dmodp },\n\t\t\t{ name: 'dmodq', data: dmodq }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1DSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 0);\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\tvar y = readMPInt(der, 'y');\n\tvar x = readMPInt(der, 'x');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'x', data: x }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1EdDSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 1);\n\n\t// private key\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\n\tder.readSequence(0xa0);\n\tvar oid = der.readOID();\n\tassert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier');\n\n\tder.readSequence(0xa1);\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: k }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1DSAPublic(der) {\n\tvar y = readMPInt(der, 'y');\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1ECDSAPublic(der) {\n\tder.readSequence();\n\n\tvar oid = der.readOID();\n\tassert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey');\n\n\tvar curveOid = der.readOID();\n\n\tvar curve;\n\tvar curves = Object.keys(algs.curves);\n\tfor (var j = 0; j < curves.length; ++j) {\n\t\tvar c = curves[j];\n\t\tvar cd = algs.curves[c];\n\t\tif (cd.pkcs8oid === curveOid) {\n\t\t\tcurve = c;\n\t\t\tbreak;\n\t\t}\n\t}\n\tassert.string(curve, 'a known ECDSA named curve');\n\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curve) },\n\t\t\t{ name: 'Q', data: Q }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1ECDSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 1);\n\n\t// private key\n\tvar d = der.readString(asn1.Ber.OctetString, true);\n\n\tder.readSequence(0xa0);\n\tvar curve = readECDSACurve(der);\n\tassert.string(curve, 'a known elliptic curve');\n\n\tder.readSequence(0xa1);\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curve) },\n\t\t\t{ name: 'Q', data: Q },\n\t\t\t{ name: 'd', data: d }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction writePkcs1(der, key) {\n\tder.startSequence();\n\n\tswitch (key.type) {\n\tcase 'rsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1RSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1RSAPublic(der, key);\n\t\tbreak;\n\tcase 'dsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1DSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1DSAPublic(der, key);\n\t\tbreak;\n\tcase 'ecdsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1ECDSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1ECDSAPublic(der, key);\n\t\tbreak;\n\tcase 'ed25519':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1EdDSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1EdDSAPublic(der, key);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unknown key algo: ' + key.type));\n\t}\n\n\tder.endSequence();\n}\n\nfunction writePkcs1RSAPublic(der, key) {\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1RSAPrivate(der, key) {\n\tvar ver = Buffer.from([0]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.d.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tif (!key.part.dmodp || !key.part.dmodq)\n\t\tutils.addRSAMissing(key);\n\tder.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1DSAPrivate(der, key) {\n\tvar ver = Buffer.from([0]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.x.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1DSAPublic(der, key) {\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1ECDSAPublic(der, key) {\n\tder.startSequence();\n\n\tder.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */\n\tvar curve = key.part.curve.data.toString();\n\tvar curveOid = algs.curves[curve].pkcs8oid;\n\tassert.string(curveOid, 'a known ECDSA named curve');\n\tder.writeOID(curveOid);\n\n\tder.endSequence();\n\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n}\n\nfunction writePkcs1ECDSAPrivate(der, key) {\n\tvar ver = Buffer.from([1]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.d.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa0);\n\tvar curve = key.part.curve.data.toString();\n\tvar curveOid = algs.curves[curve].pkcs8oid;\n\tassert.string(curveOid, 'a known ECDSA named curve');\n\tder.writeOID(curveOid);\n\tder.endSequence();\n\n\tder.startSequence(0xa1);\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n\tder.endSequence();\n}\n\nfunction writePkcs1EdDSAPrivate(der, key) {\n\tvar ver = Buffer.from([1]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.k.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa0);\n\tder.writeOID('1.3.101.112');\n\tder.endSequence();\n\n\tder.startSequence(0xa1);\n\tutils.writeBitString(der, key.part.A.data);\n\tder.endSequence();\n}\n\nfunction writePkcs1EdDSAPublic(der, key) {\n\tthrow (new Error('Public keys are not supported for EdDSA PKCS#1'));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/pkcs1.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/pkcs8.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/pkcs8.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadPkcs8: readPkcs8,\n\twrite: write,\n\twritePkcs8: writePkcs8,\n\tpkcs8ToBuffer: pkcs8ToBuffer,\n\n\treadECDSACurve: readECDSACurve,\n\twriteECDSACurve: writeECDSACurve\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar pem = __webpack_require__(/*! ./pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options, 'pkcs8'));\n}\n\nfunction write(key, options) {\n\treturn (pem.write(key, options, 'pkcs8'));\n}\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction readPkcs8(alg, type, der) {\n\t/* Private keys in pkcs#8 format have a weird extra int */\n\tif (der.peek() === asn1.Ber.Integer) {\n\t\tassert.strictEqual(type, 'private',\n\t\t 'unexpected Integer at start of public key');\n\t\tder.readString(asn1.Ber.Integer, true);\n\t}\n\n\tder.readSequence();\n\tvar next = der.offset + der.length;\n\n\tvar oid = der.readOID();\n\tswitch (oid) {\n\tcase '1.2.840.113549.1.1.1':\n\t\tder._offset = next;\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8RSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8RSAPrivate(der));\n\tcase '1.2.840.10040.4.1':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8DSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8DSAPrivate(der));\n\tcase '1.2.840.10045.2.1':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8ECDSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8ECDSAPrivate(der));\n\tcase '1.3.101.112':\n\t\tif (type === 'public') {\n\t\t\treturn (readPkcs8EdDSAPublic(der));\n\t\t} else {\n\t\t\treturn (readPkcs8EdDSAPrivate(der));\n\t\t}\n\tcase '1.3.101.110':\n\t\tif (type === 'public') {\n\t\t\treturn (readPkcs8X25519Public(der));\n\t\t} else {\n\t\t\treturn (readPkcs8X25519Private(der));\n\t\t}\n\tdefault:\n\t\tthrow (new Error('Unknown key type OID ' + oid));\n\t}\n}\n\nfunction readPkcs8RSAPublic(der) {\n\t// bit string sequence\n\tder.readSequence(asn1.Ber.BitString);\n\tder.readByte();\n\tder.readSequence();\n\n\t// modulus\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'exponent');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tsource: der.originalInput,\n\t\tparts: [\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'n', data: n }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8RSAPrivate(der) {\n\tder.readSequence(asn1.Ber.OctetString);\n\tder.readSequence();\n\n\tvar ver = readMPInt(der, 'version');\n\tassert.equal(ver[0], 0x0, 'unknown RSA private key version');\n\n\t// modulus then public exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'public exponent');\n\tvar d = readMPInt(der, 'private exponent');\n\tvar p = readMPInt(der, 'prime1');\n\tvar q = readMPInt(der, 'prime2');\n\tvar dmodp = readMPInt(der, 'exponent1');\n\tvar dmodq = readMPInt(der, 'exponent2');\n\tvar iqmp = readMPInt(der, 'iqmp');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'n', data: n },\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'd', data: d },\n\t\t\t{ name: 'iqmp', data: iqmp },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'dmodp', data: dmodp },\n\t\t\t{ name: 'dmodq', data: dmodq }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8DSAPublic(der) {\n\tder.readSequence();\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\t// bit string sequence\n\tder.readSequence(asn1.Ber.BitString);\n\tder.readByte();\n\n\tvar y = readMPInt(der, 'y');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8DSAPrivate(der) {\n\tder.readSequence();\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar x = readMPInt(der, 'x');\n\n\t/* The pkcs#8 format does not include the public key */\n\tvar y = utils.calculateDSAPublic(g, p, x);\n\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'x', data: x }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readECDSACurve(der) {\n\tvar curveName, curveNames;\n\tvar j, c, cd;\n\n\tif (der.peek() === asn1.Ber.OID) {\n\t\tvar oid = der.readOID();\n\n\t\tcurveNames = Object.keys(algs.curves);\n\t\tfor (j = 0; j < curveNames.length; ++j) {\n\t\t\tc = curveNames[j];\n\t\t\tcd = algs.curves[c];\n\t\t\tif (cd.pkcs8oid === oid) {\n\t\t\t\tcurveName = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\t// ECParameters sequence\n\t\tder.readSequence();\n\t\tvar version = der.readString(asn1.Ber.Integer, true);\n\t\tassert.strictEqual(version[0], 1, 'ECDSA key not version 1');\n\n\t\tvar curve = {};\n\n\t\t// FieldID sequence\n\t\tder.readSequence();\n\t\tvar fieldTypeOid = der.readOID();\n\t\tassert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1',\n\t\t 'ECDSA key is not from a prime-field');\n\t\tvar p = curve.p = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\t/*\n\t\t * p always starts with a 1 bit, so count the zeros to get its\n\t\t * real size.\n\t\t */\n\t\tcurve.size = p.length * 8 - utils.countZeros(p);\n\n\t\t// Curve sequence\n\t\tder.readSequence();\n\t\tcurve.a = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.OctetString, true));\n\t\tcurve.b = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.OctetString, true));\n\t\tif (der.peek() === asn1.Ber.BitString)\n\t\t\tcurve.s = der.readString(asn1.Ber.BitString, true);\n\n\t\t// Combined Gx and Gy\n\t\tcurve.G = der.readString(asn1.Ber.OctetString, true);\n\t\tassert.strictEqual(curve.G[0], 0x4,\n\t\t 'uncompressed G is required');\n\n\t\tcurve.n = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\tcurve.h = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\tassert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' +\n\t\t 'required');\n\n\t\tcurveNames = Object.keys(algs.curves);\n\t\tvar ks = Object.keys(curve);\n\t\tfor (j = 0; j < curveNames.length; ++j) {\n\t\t\tc = curveNames[j];\n\t\t\tcd = algs.curves[c];\n\t\t\tvar equal = true;\n\t\t\tfor (var i = 0; i < ks.length; ++i) {\n\t\t\t\tvar k = ks[i];\n\t\t\t\tif (cd[k] === undefined)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (typeof (cd[k]) === 'object' &&\n\t\t\t\t cd[k].equals !== undefined) {\n\t\t\t\t\tif (!cd[k].equals(curve[k])) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (Buffer.isBuffer(cd[k])) {\n\t\t\t\t\tif (cd[k].toString('binary')\n\t\t\t\t\t !== curve[k].toString('binary')) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (cd[k] !== curve[k]) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (equal) {\n\t\t\t\tcurveName = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn (curveName);\n}\n\nfunction readPkcs8ECDSAPrivate(der) {\n\tvar curveName = readECDSACurve(der);\n\tassert.string(curveName, 'a known elliptic curve');\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tder.readSequence();\n\n\tvar version = readMPInt(der, 'version');\n\tassert.equal(version[0], 1, 'unknown version of ECDSA key');\n\n\tvar d = der.readString(asn1.Ber.OctetString, true);\n\tvar Q;\n\n\tif (der.peek() == 0xa0) {\n\t\tder.readSequence(0xa0);\n\t\tder._offset += der.length;\n\t}\n\tif (der.peek() == 0xa1) {\n\t\tder.readSequence(0xa1);\n\t\tQ = der.readString(asn1.Ber.BitString, true);\n\t\tQ = utils.ecNormalize(Q);\n\t}\n\n\tif (Q === undefined) {\n\t\tvar pub = utils.publicFromPrivateECDSA(curveName, d);\n\t\tQ = pub.part.Q.data;\n\t}\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curveName) },\n\t\t\t{ name: 'Q', data: Q },\n\t\t\t{ name: 'd', data: d }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8ECDSAPublic(der) {\n\tvar curveName = readECDSACurve(der);\n\tassert.string(curveName, 'a known elliptic curve');\n\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curveName) },\n\t\t\t{ name: 'Q', data: Q }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8EdDSAPublic(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8X25519Public(der) {\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'curve25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8EdDSAPrivate(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\tk = utils.zeroPadToLength(k, 32);\n\n\tvar A;\n\tif (der.peek() === asn1.Ber.BitString) {\n\t\tA = utils.readBitString(der);\n\t\tA = utils.zeroPadToLength(A, 32);\n\t} else {\n\t\tA = utils.calculateED25519Public(k);\n\t}\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: utils.zeroPadToLength(k, 32) }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8X25519Private(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\tk = utils.zeroPadToLength(k, 32);\n\n\tvar A = utils.calculateX25519Public(k);\n\n\tvar key = {\n\t\ttype: 'curve25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: utils.zeroPadToLength(k, 32) }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction pkcs8ToBuffer(key) {\n\tvar der = new asn1.BerWriter();\n\twritePkcs8(der, key);\n\treturn (der.buffer);\n}\n\nfunction writePkcs8(der, key) {\n\tder.startSequence();\n\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tvar sillyInt = Buffer.from([0]);\n\t\tder.writeBuffer(sillyInt, asn1.Ber.Integer);\n\t}\n\n\tder.startSequence();\n\tswitch (key.type) {\n\tcase 'rsa':\n\t\tder.writeOID('1.2.840.113549.1.1.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8RSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8RSAPublic(key, der);\n\t\tbreak;\n\tcase 'dsa':\n\t\tder.writeOID('1.2.840.10040.4.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8DSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8DSAPublic(key, der);\n\t\tbreak;\n\tcase 'ecdsa':\n\t\tder.writeOID('1.2.840.10045.2.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8ECDSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8ECDSAPublic(key, der);\n\t\tbreak;\n\tcase 'ed25519':\n\t\tder.writeOID('1.3.101.112');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\tthrow (new Error('Ed25519 private keys in pkcs8 ' +\n\t\t\t 'format are not supported'));\n\t\twritePkcs8EdDSAPublic(key, der);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unsupported key type: ' + key.type));\n\t}\n\n\tder.endSequence();\n}\n\nfunction writePkcs8RSAPrivate(key, der) {\n\tder.writeNull();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.startSequence();\n\n\tvar version = Buffer.from([0]);\n\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.d.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tif (!key.part.dmodp || !key.part.dmodq)\n\t\tutils.addRSAMissing(key);\n\tder.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);\n\n\tder.endSequence();\n\tder.endSequence();\n}\n\nfunction writePkcs8RSAPublic(key, der) {\n\tder.writeNull();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.BitString);\n\tder.writeByte(0x00);\n\n\tder.startSequence();\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.endSequence();\n\n\tder.endSequence();\n}\n\nfunction writePkcs8DSAPrivate(key, der) {\n\tder.startSequence();\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.endSequence();\n\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.writeBuffer(key.part.x.data, asn1.Ber.Integer);\n\tder.endSequence();\n}\n\nfunction writePkcs8DSAPublic(key, der) {\n\tder.startSequence();\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.endSequence();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.BitString);\n\tder.writeByte(0x00);\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.endSequence();\n}\n\nfunction writeECDSACurve(key, der) {\n\tvar curve = algs.curves[key.curve];\n\tif (curve.pkcs8oid) {\n\t\t/* This one has a name in pkcs#8, so just write the oid */\n\t\tder.writeOID(curve.pkcs8oid);\n\n\t} else {\n\t\t// ECParameters sequence\n\t\tder.startSequence();\n\n\t\tvar version = Buffer.from([1]);\n\t\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\t\t// FieldID sequence\n\t\tder.startSequence();\n\t\tder.writeOID('1.2.840.10045.1.1'); // prime-field\n\t\tder.writeBuffer(curve.p, asn1.Ber.Integer);\n\t\tder.endSequence();\n\n\t\t// Curve sequence\n\t\tder.startSequence();\n\t\tvar a = curve.p;\n\t\tif (a[0] === 0x0)\n\t\t\ta = a.slice(1);\n\t\tder.writeBuffer(a, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.b, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.s, asn1.Ber.BitString);\n\t\tder.endSequence();\n\n\t\tder.writeBuffer(curve.G, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.n, asn1.Ber.Integer);\n\t\tvar h = curve.h;\n\t\tif (!h) {\n\t\t\th = Buffer.from([1]);\n\t\t}\n\t\tder.writeBuffer(h, asn1.Ber.Integer);\n\n\t\t// ECParameters\n\t\tder.endSequence();\n\t}\n}\n\nfunction writePkcs8ECDSAPublic(key, der) {\n\twriteECDSACurve(key, der);\n\tder.endSequence();\n\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n}\n\nfunction writePkcs8ECDSAPrivate(key, der) {\n\twriteECDSACurve(key, der);\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.startSequence();\n\n\tvar version = Buffer.from([1]);\n\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.d.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa1);\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n\tder.endSequence();\n\n\tder.endSequence();\n\tder.endSequence();\n}\n\nfunction writePkcs8EdDSAPublic(key, der) {\n\tder.endSequence();\n\n\tutils.writeBitString(der, key.part.A.data);\n}\n\nfunction writePkcs8EdDSAPrivate(key, der) {\n\tder.endSequence();\n\n\tvar k = utils.mpNormalize(key.part.k.data, true);\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.writeBuffer(k, asn1.Ber.OctetString);\n\tder.endSequence();\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/pkcs8.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/putty.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/putty.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar rfc4253 = __webpack_require__(/*! ./rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\n\nvar errors = __webpack_require__(/*! ../errors */ \"./node_modules/sshpk/lib/errors.js\");\n\nfunction read(buf, options) {\n\tvar lines = buf.toString('ascii').split(/[\\r\\n]+/);\n\tvar found = false;\n\tvar parts;\n\tvar si = 0;\n\twhile (si < lines.length) {\n\t\tparts = splitHeader(lines[si++]);\n\t\tif (parts &&\n\t\t parts[0].toLowerCase() === 'putty-user-key-file-2') {\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!found) {\n\t\tthrow (new Error('No PuTTY format first line found'));\n\t}\n\tvar alg = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'encryption');\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'comment');\n\tvar comment = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'public-lines');\n\tvar publicLines = parseInt(parts[1], 10);\n\tif (!isFinite(publicLines) || publicLines < 0 ||\n\t publicLines > lines.length) {\n\t\tthrow (new Error('Invalid public-lines count'));\n\t}\n\n\tvar publicBuf = Buffer.from(\n\t lines.slice(si, si + publicLines).join(''), 'base64');\n\tvar keyType = rfc4253.algToKeyType(alg);\n\tvar key = rfc4253.read(publicBuf);\n\tif (key.type !== keyType) {\n\t\tthrow (new Error('Outer key algorithm mismatch'));\n\t}\n\tkey.comment = comment;\n\treturn (key);\n}\n\nfunction splitHeader(line) {\n\tvar idx = line.indexOf(':');\n\tif (idx === -1)\n\t\treturn (null);\n\tvar header = line.slice(0, idx);\n\t++idx;\n\twhile (line[idx] === ' ')\n\t\t++idx;\n\tvar rest = line.slice(idx);\n\treturn ([header, rest]);\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\tif (!Key.isKey(key))\n\t\tthrow (new Error('Must be a public key'));\n\n\tvar alg = rfc4253.keyTypeToAlg(key);\n\tvar buf = rfc4253.write(key);\n\tvar comment = key.comment || '';\n\n\tvar b64 = buf.toString('base64');\n\tvar lines = wrap(b64, 64);\n\n\tlines.unshift('Public-Lines: ' + lines.length);\n\tlines.unshift('Comment: ' + comment);\n\tlines.unshift('Encryption: none');\n\tlines.unshift('PuTTY-User-Key-File-2: ' + alg);\n\n\treturn (Buffer.from(lines.join('\\n') + '\\n'));\n}\n\nfunction wrap(txt, len) {\n\tvar lines = [];\n\tvar pos = 0;\n\twhile (pos < txt.length) {\n\t\tlines.push(txt.slice(pos, pos + 64));\n\t\tpos += 64;\n\t}\n\treturn (lines);\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/putty.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/rfc4253.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/rfc4253.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read.bind(undefined, false, undefined),\n\treadType: read.bind(undefined, false),\n\twrite: write,\n\t/* semi-private api, used by sshpk-agent */\n\treadPartial: read.bind(undefined, true),\n\n\t/* shared with ssh format */\n\treadInternal: read,\n\tkeyTypeToAlg: keyTypeToAlg,\n\talgToKeyType: algToKeyType\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar SSHBuffer = __webpack_require__(/*! ../ssh-buffer */ \"./node_modules/sshpk/lib/ssh-buffer.js\");\n\nfunction algToKeyType(alg) {\n\tassert.string(alg);\n\tif (alg === 'ssh-dss')\n\t\treturn ('dsa');\n\telse if (alg === 'ssh-rsa')\n\t\treturn ('rsa');\n\telse if (alg === 'ssh-ed25519')\n\t\treturn ('ed25519');\n\telse if (alg === 'ssh-curve25519')\n\t\treturn ('curve25519');\n\telse if (alg.match(/^ecdsa-sha2-/))\n\t\treturn ('ecdsa');\n\telse\n\t\tthrow (new Error('Unknown algorithm ' + alg));\n}\n\nfunction keyTypeToAlg(key) {\n\tassert.object(key);\n\tif (key.type === 'dsa')\n\t\treturn ('ssh-dss');\n\telse if (key.type === 'rsa')\n\t\treturn ('ssh-rsa');\n\telse if (key.type === 'ed25519')\n\t\treturn ('ssh-ed25519');\n\telse if (key.type === 'curve25519')\n\t\treturn ('ssh-curve25519');\n\telse if (key.type === 'ecdsa')\n\t\treturn ('ecdsa-sha2-' + key.part.curve.data.toString());\n\telse\n\t\tthrow (new Error('Unknown key type ' + key.type));\n}\n\nfunction read(partial, type, buf, options) {\n\tif (typeof (buf) === 'string')\n\t\tbuf = Buffer.from(buf);\n\tassert.buffer(buf, 'buf');\n\n\tvar key = {};\n\n\tvar parts = key.parts = [];\n\tvar sshbuf = new SSHBuffer({buffer: buf});\n\n\tvar alg = sshbuf.readString();\n\tassert.ok(!sshbuf.atEnd(), 'key must have at least one part');\n\n\tkey.type = algToKeyType(alg);\n\n\tvar partCount = algs.info[key.type].parts.length;\n\tif (type && type === 'private')\n\t\tpartCount = algs.privInfo[key.type].parts.length;\n\n\twhile (!sshbuf.atEnd() && parts.length < partCount)\n\t\tparts.push(sshbuf.readPart());\n\twhile (!partial && !sshbuf.atEnd())\n\t\tparts.push(sshbuf.readPart());\n\n\tassert.ok(parts.length >= 1,\n\t 'key must have at least one part');\n\tassert.ok(partial || sshbuf.atEnd(),\n\t 'leftover bytes at end of key');\n\n\tvar Constructor = Key;\n\tvar algInfo = algs.info[key.type];\n\tif (type === 'private' || algInfo.parts.length !== parts.length) {\n\t\talgInfo = algs.privInfo[key.type];\n\t\tConstructor = PrivateKey;\n\t}\n\tassert.strictEqual(algInfo.parts.length, parts.length);\n\n\tif (key.type === 'ecdsa') {\n\t\tvar res = /^ecdsa-sha2-(.+)$/.exec(alg);\n\t\tassert.ok(res !== null);\n\t\tassert.strictEqual(res[1], parts[0].data.toString());\n\t}\n\n\tvar normalized = true;\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tvar p = parts[i];\n\t\tp.name = algInfo.parts[i];\n\t\t/*\n\t\t * OpenSSH stores ed25519 \"private\" keys as seed + public key\n\t\t * concat'd together (k followed by A). We want to keep them\n\t\t * separate for other formats that don't do this.\n\t\t */\n\t\tif (key.type === 'ed25519' && p.name === 'k')\n\t\t\tp.data = p.data.slice(0, 32);\n\n\t\tif (p.name !== 'curve' && algInfo.normalize !== false) {\n\t\t\tvar nd;\n\t\t\tif (key.type === 'ed25519') {\n\t\t\t\tnd = utils.zeroPadToLength(p.data, 32);\n\t\t\t} else {\n\t\t\t\tnd = utils.mpNormalize(p.data);\n\t\t\t}\n\t\t\tif (nd.toString('binary') !==\n\t\t\t p.data.toString('binary')) {\n\t\t\t\tp.data = nd;\n\t\t\t\tnormalized = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (normalized)\n\t\tkey._rfc4253Cache = sshbuf.toBuffer();\n\n\tif (partial && typeof (partial) === 'object') {\n\t\tpartial.remainder = sshbuf.remainder();\n\t\tpartial.consumed = sshbuf._offset;\n\t}\n\n\treturn (new Constructor(key));\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\n\tvar alg = keyTypeToAlg(key);\n\tvar i;\n\n\tvar algInfo = algs.info[key.type];\n\tif (PrivateKey.isPrivateKey(key))\n\t\talgInfo = algs.privInfo[key.type];\n\tvar parts = algInfo.parts;\n\n\tvar buf = new SSHBuffer({});\n\n\tbuf.writeString(alg);\n\n\tfor (i = 0; i < parts.length; ++i) {\n\t\tvar data = key.part[parts[i]].data;\n\t\tif (algInfo.normalize !== false) {\n\t\t\tif (key.type === 'ed25519')\n\t\t\t\tdata = utils.zeroPadToLength(data, 32);\n\t\t\telse\n\t\t\t\tdata = utils.mpNormalize(data);\n\t\t}\n\t\tif (key.type === 'ed25519' && parts[i] === 'k')\n\t\t\tdata = Buffer.concat([data, key.part.A.data]);\n\t\tbuf.writeBuffer(data);\n\t}\n\n\treturn (buf.toBuffer());\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/rfc4253.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/ssh-private.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/ssh-private.js ***!
|
||
\*******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadSSHPrivate: readSSHPrivate,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\n\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar pem = __webpack_require__(/*! ./pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\nvar rfc4253 = __webpack_require__(/*! ./rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nvar SSHBuffer = __webpack_require__(/*! ../ssh-buffer */ \"./node_modules/sshpk/lib/ssh-buffer.js\");\nvar errors = __webpack_require__(/*! ../errors */ \"./node_modules/sshpk/lib/errors.js\");\n\nvar bcrypt;\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options));\n}\n\nvar MAGIC = 'openssh-key-v1';\n\nfunction readSSHPrivate(type, buf, options) {\n\tbuf = new SSHBuffer({buffer: buf});\n\n\tvar magic = buf.readCString();\n\tassert.strictEqual(magic, MAGIC, 'bad magic string');\n\n\tvar cipher = buf.readString();\n\tvar kdf = buf.readString();\n\tvar kdfOpts = buf.readBuffer();\n\n\tvar nkeys = buf.readInt();\n\tif (nkeys !== 1) {\n\t\tthrow (new Error('OpenSSH-format key file contains ' +\n\t\t 'multiple keys: this is unsupported.'));\n\t}\n\n\tvar pubKey = buf.readBuffer();\n\n\tif (type === 'public') {\n\t\tassert.ok(buf.atEnd(), 'excess bytes left after key');\n\t\treturn (rfc4253.read(pubKey));\n\t}\n\n\tvar privKeyBlob = buf.readBuffer();\n\tassert.ok(buf.atEnd(), 'excess bytes left after key');\n\n\tvar kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts });\n\tswitch (kdf) {\n\tcase 'none':\n\t\tif (cipher !== 'none') {\n\t\t\tthrow (new Error('OpenSSH-format key uses KDF \"none\" ' +\n\t\t\t 'but specifies a cipher other than \"none\"'));\n\t\t}\n\t\tbreak;\n\tcase 'bcrypt':\n\t\tvar salt = kdfOptsBuf.readBuffer();\n\t\tvar rounds = kdfOptsBuf.readInt();\n\t\tvar cinf = utils.opensshCipherInfo(cipher);\n\t\tif (bcrypt === undefined) {\n\t\t\tbcrypt = __webpack_require__(/*! bcrypt-pbkdf */ \"./node_modules/bcrypt-pbkdf/index.js\");\n\t\t}\n\n\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\toptions.passphrase = Buffer.from(options.passphrase,\n\t\t\t 'utf-8');\n\t\t}\n\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t options.filename, 'OpenSSH'));\n\t\t}\n\n\t\tvar pass = new Uint8Array(options.passphrase);\n\t\tvar salti = new Uint8Array(salt);\n\t\t/* Use the pbkdf to derive both the key and the IV. */\n\t\tvar out = new Uint8Array(cinf.keySize + cinf.blockSize);\n\t\tvar res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,\n\t\t out, out.length, rounds);\n\t\tif (res !== 0) {\n\t\t\tthrow (new Error('bcrypt_pbkdf function returned ' +\n\t\t\t 'failure, parameters invalid'));\n\t\t}\n\t\tout = Buffer.from(out);\n\t\tvar ckey = out.slice(0, cinf.keySize);\n\t\tvar iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);\n\t\tvar cipherStream = crypto.createDecipheriv(cinf.opensslName,\n\t\t ckey, iv);\n\t\tcipherStream.setAutoPadding(false);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow (new Error('Incorrect passphrase ' +\n\t\t\t\t 'supplied, could not decrypt key'));\n\t\t\t}\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(privKeyBlob);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tprivKeyBlob = Buffer.concat(chunks);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error(\n\t\t 'OpenSSH-format key uses unknown KDF \"' + kdf + '\"'));\n\t}\n\n\tbuf = new SSHBuffer({buffer: privKeyBlob});\n\n\tvar checkInt1 = buf.readInt();\n\tvar checkInt2 = buf.readInt();\n\tif (checkInt1 !== checkInt2) {\n\t\tthrow (new Error('Incorrect passphrase supplied, could not ' +\n\t\t 'decrypt key'));\n\t}\n\n\tvar ret = {};\n\tvar key = rfc4253.readInternal(ret, 'private', buf.remainder());\n\n\tbuf.skip(ret.consumed);\n\n\tvar comment = buf.readString();\n\tkey.comment = comment;\n\n\treturn (key);\n}\n\nfunction write(key, options) {\n\tvar pubKey;\n\tif (PrivateKey.isPrivateKey(key))\n\t\tpubKey = key.toPublic();\n\telse\n\t\tpubKey = key;\n\n\tvar cipher = 'none';\n\tvar kdf = 'none';\n\tvar kdfopts = Buffer.alloc(0);\n\tvar cinf = { blockSize: 8 };\n\tvar passphrase;\n\tif (options !== undefined) {\n\t\tpassphrase = options.passphrase;\n\t\tif (typeof (passphrase) === 'string')\n\t\t\tpassphrase = Buffer.from(passphrase, 'utf-8');\n\t\tif (passphrase !== undefined) {\n\t\t\tassert.buffer(passphrase, 'options.passphrase');\n\t\t\tassert.optionalString(options.cipher, 'options.cipher');\n\t\t\tcipher = options.cipher;\n\t\t\tif (cipher === undefined)\n\t\t\t\tcipher = 'aes128-ctr';\n\t\t\tcinf = utils.opensshCipherInfo(cipher);\n\t\t\tkdf = 'bcrypt';\n\t\t}\n\t}\n\n\tvar privBuf;\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tprivBuf = new SSHBuffer({});\n\t\tvar checkInt = crypto.randomBytes(4).readUInt32BE(0);\n\t\tprivBuf.writeInt(checkInt);\n\t\tprivBuf.writeInt(checkInt);\n\t\tprivBuf.write(key.toBuffer('rfc4253'));\n\t\tprivBuf.writeString(key.comment || '');\n\n\t\tvar n = 1;\n\t\twhile (privBuf._offset % cinf.blockSize !== 0)\n\t\t\tprivBuf.writeChar(n++);\n\t\tprivBuf = privBuf.toBuffer();\n\t}\n\n\tswitch (kdf) {\n\tcase 'none':\n\t\tbreak;\n\tcase 'bcrypt':\n\t\tvar salt = crypto.randomBytes(16);\n\t\tvar rounds = 16;\n\t\tvar kdfssh = new SSHBuffer({});\n\t\tkdfssh.writeBuffer(salt);\n\t\tkdfssh.writeInt(rounds);\n\t\tkdfopts = kdfssh.toBuffer();\n\n\t\tif (bcrypt === undefined) {\n\t\t\tbcrypt = __webpack_require__(/*! bcrypt-pbkdf */ \"./node_modules/bcrypt-pbkdf/index.js\");\n\t\t}\n\t\tvar pass = new Uint8Array(passphrase);\n\t\tvar salti = new Uint8Array(salt);\n\t\t/* Use the pbkdf to derive both the key and the IV. */\n\t\tvar out = new Uint8Array(cinf.keySize + cinf.blockSize);\n\t\tvar res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,\n\t\t out, out.length, rounds);\n\t\tif (res !== 0) {\n\t\t\tthrow (new Error('bcrypt_pbkdf function returned ' +\n\t\t\t 'failure, parameters invalid'));\n\t\t}\n\t\tout = Buffer.from(out);\n\t\tvar ckey = out.slice(0, cinf.keySize);\n\t\tvar iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);\n\n\t\tvar cipherStream = crypto.createCipheriv(cinf.opensslName,\n\t\t ckey, iv);\n\t\tcipherStream.setAutoPadding(false);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(privBuf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tprivBuf = Buffer.concat(chunks);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unsupported kdf ' + kdf));\n\t}\n\n\tvar buf = new SSHBuffer({});\n\n\tbuf.writeCString(MAGIC);\n\tbuf.writeString(cipher);\t/* cipher */\n\tbuf.writeString(kdf);\t\t/* kdf */\n\tbuf.writeBuffer(kdfopts);\t/* kdfoptions */\n\n\tbuf.writeInt(1);\t\t/* nkeys */\n\tbuf.writeBuffer(pubKey.toBuffer('rfc4253'));\n\n\tif (privBuf)\n\t\tbuf.writeBuffer(privBuf);\n\n\tbuf = buf.toBuffer();\n\n\tvar header;\n\tif (PrivateKey.isPrivateKey(key))\n\t\theader = 'OPENSSH PRIVATE KEY';\n\telse\n\t\theader = 'OPENSSH PUBLIC KEY';\n\n\tvar tmp = buf.toString('base64');\n\tvar len = tmp.length + (tmp.length / 70) +\n\t 18 + 16 + header.length*2 + 10;\n\tbuf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 70;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/ssh-private.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/ssh.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/ssh.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar rfc4253 = __webpack_require__(/*! ./rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\n\nvar sshpriv = __webpack_require__(/*! ./ssh-private */ \"./node_modules/sshpk/lib/formats/ssh-private.js\");\n\n/*JSSTYLED*/\nvar SSHKEY_RE = /^([a-z0-9-]+)[ \\t]+([a-zA-Z0-9+\\/]+[=]*)([ \\t]+([^ \\t][^\\n]*[\\n]*)?)?$/;\n/*JSSTYLED*/\nvar SSHKEY_RE2 = /^([a-z0-9-]+)[ \\t\\n]+([a-zA-Z0-9+\\/][a-zA-Z0-9+\\/ \\t\\n=]*)([^a-zA-Z0-9+\\/ \\t\\n=].*)?$/;\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar trimmed = buf.trim().replace(/[\\\\\\r]/g, '');\n\tvar m = trimmed.match(SSHKEY_RE);\n\tif (!m)\n\t\tm = trimmed.match(SSHKEY_RE2);\n\tassert.ok(m, 'key must match regex');\n\n\tvar type = rfc4253.algToKeyType(m[1]);\n\tvar kbuf = Buffer.from(m[2], 'base64');\n\n\t/*\n\t * This is a bit tricky. If we managed to parse the key and locate the\n\t * key comment with the regex, then do a non-partial read and assert\n\t * that we have consumed all bytes. If we couldn't locate the key\n\t * comment, though, there may be whitespace shenanigans going on that\n\t * have conjoined the comment to the rest of the key. We do a partial\n\t * read in this case to try to make the best out of a sorry situation.\n\t */\n\tvar key;\n\tvar ret = {};\n\tif (m[4]) {\n\t\ttry {\n\t\t\tkey = rfc4253.read(kbuf);\n\n\t\t} catch (e) {\n\t\t\tm = trimmed.match(SSHKEY_RE2);\n\t\t\tassert.ok(m, 'key must match regex');\n\t\t\tkbuf = Buffer.from(m[2], 'base64');\n\t\t\tkey = rfc4253.readInternal(ret, 'public', kbuf);\n\t\t}\n\t} else {\n\t\tkey = rfc4253.readInternal(ret, 'public', kbuf);\n\t}\n\n\tassert.strictEqual(type, key.type);\n\n\tif (m[4] && m[4].length > 0) {\n\t\tkey.comment = m[4];\n\n\t} else if (ret.consumed) {\n\t\t/*\n\t\t * Now the magic: trying to recover the key comment when it's\n\t\t * gotten conjoined to the key or otherwise shenanigan'd.\n\t\t *\n\t\t * Work out how much base64 we used, then drop all non-base64\n\t\t * chars from the beginning up to this point in the the string.\n\t\t * Then offset in this and try to make up for missing = chars.\n\t\t */\n\t\tvar data = m[2] + (m[3] ? m[3] : '');\n\t\tvar realOffset = Math.ceil(ret.consumed / 3) * 4;\n\t\tdata = data.slice(0, realOffset - 2). /*JSSTYLED*/\n\t\t replace(/[^a-zA-Z0-9+\\/=]/g, '') +\n\t\t data.slice(realOffset - 2);\n\n\t\tvar padding = ret.consumed % 3;\n\t\tif (padding > 0 &&\n\t\t data.slice(realOffset - 1, realOffset) !== '=')\n\t\t\trealOffset--;\n\t\twhile (data.slice(realOffset, realOffset + 1) === '=')\n\t\t\trealOffset++;\n\n\t\t/* Finally, grab what we think is the comment & clean it up. */\n\t\tvar trailer = data.slice(realOffset);\n\t\ttrailer = trailer.replace(/[\\r\\n]/g, ' ').\n\t\t replace(/^\\s+/, '');\n\t\tif (trailer.match(/^[a-zA-Z0-9]/))\n\t\t\tkey.comment = trailer;\n\t}\n\n\treturn (key);\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\tif (!Key.isKey(key))\n\t\tthrow (new Error('Must be a public key'));\n\n\tvar parts = [];\n\tvar alg = rfc4253.keyTypeToAlg(key);\n\tparts.push(alg);\n\n\tvar buf = rfc4253.write(key);\n\tparts.push(buf.toString('base64'));\n\n\tif (key.comment)\n\t\tparts.push(key.comment);\n\n\treturn (Buffer.from(parts.join(' ')));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/ssh.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/x509-pem.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/x509-pem.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2016 Joyent, Inc.\n\nvar x509 = __webpack_require__(/*! ./x509 */ \"./node_modules/sshpk/lib/formats/x509.js\");\n\nmodule.exports = {\n\tread: read,\n\tverify: x509.verify,\n\tsign: x509.sign,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar pem = __webpack_require__(/*! ./pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\nvar Identity = __webpack_require__(/*! ../identity */ \"./node_modules/sshpk/lib/identity.js\");\nvar Signature = __webpack_require__(/*! ../signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar Certificate = __webpack_require__(/*! ../certificate */ \"./node_modules/sshpk/lib/certificate.js\");\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split(/[\\r\\n]+/g);\n\n\tvar m;\n\tvar si = -1;\n\twhile (!m && si < lines.length) {\n\t\tm = lines[++si].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/);\n\t}\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2;\n\tvar ei = lines.length;\n\twhile (!m2 && ei > 0) {\n\t\tm2 = lines[--ei].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*END CERTIFICATE[ ]*[-]+/);\n\t}\n\tassert.ok(m2, 'invalid PEM footer');\n\n\tlines = lines.slice(si, ei + 1);\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match(/*JSSTYLED*/\n\t\t /^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m)\n\t\t\tbreak;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = Buffer.from(lines, 'base64');\n\n\treturn (x509.read(buf, options));\n}\n\nfunction write(cert, options) {\n\tvar dbuf = x509.write(cert, options);\n\n\tvar header = 'CERTIFICATE';\n\tvar tmp = dbuf.toString('base64');\n\tvar len = tmp.length + (tmp.length / 64) +\n\t 18 + 16 + header.length*2 + 10;\n\tvar buf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 64;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/x509-pem.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/formats/x509.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/sshpk/lib/formats/x509.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\tverify: verify,\n\tsign: sign,\n\tsignAsync: signAsync,\n\twrite: write\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ../algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar Key = __webpack_require__(/*! ../key */ \"./node_modules/sshpk/lib/key.js\");\nvar PrivateKey = __webpack_require__(/*! ../private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar pem = __webpack_require__(/*! ./pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\nvar Identity = __webpack_require__(/*! ../identity */ \"./node_modules/sshpk/lib/identity.js\");\nvar Signature = __webpack_require__(/*! ../signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar Certificate = __webpack_require__(/*! ../certificate */ \"./node_modules/sshpk/lib/certificate.js\");\nvar pkcs8 = __webpack_require__(/*! ./pkcs8 */ \"./node_modules/sshpk/lib/formats/pkcs8.js\");\n\n/*\n * This file is based on RFC5280 (X.509).\n */\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction verify(cert, key) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tvar algParts = sig.algo.split('-');\n\tif (algParts[0] !== key.type)\n\t\treturn (false);\n\n\tvar blob = sig.cache;\n\tif (blob === undefined) {\n\t\tvar der = new asn1.BerWriter();\n\t\twriteTBSCert(cert, der);\n\t\tblob = der.buffer;\n\t}\n\n\tvar verifier = key.createVerify(algParts[1]);\n\tverifier.write(blob);\n\treturn (verifier.verify(sig.signature));\n}\n\nfunction Local(i) {\n\treturn (asn1.Ber.Context | asn1.Ber.Constructor | i);\n}\n\nfunction Context(i) {\n\treturn (asn1.Ber.Context | i);\n}\n\nvar SIGN_ALGS = {\n\t'rsa-md5': '1.2.840.113549.1.1.4',\n\t'rsa-sha1': '1.2.840.113549.1.1.5',\n\t'rsa-sha256': '1.2.840.113549.1.1.11',\n\t'rsa-sha384': '1.2.840.113549.1.1.12',\n\t'rsa-sha512': '1.2.840.113549.1.1.13',\n\t'dsa-sha1': '1.2.840.10040.4.3',\n\t'dsa-sha256': '2.16.840.1.101.3.4.3.2',\n\t'ecdsa-sha1': '1.2.840.10045.4.1',\n\t'ecdsa-sha256': '1.2.840.10045.4.3.2',\n\t'ecdsa-sha384': '1.2.840.10045.4.3.3',\n\t'ecdsa-sha512': '1.2.840.10045.4.3.4',\n\t'ed25519-sha512': '1.3.101.112'\n};\nObject.keys(SIGN_ALGS).forEach(function (k) {\n\tSIGN_ALGS[SIGN_ALGS[k]] = k;\n});\nSIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5';\nSIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1';\n\nvar EXTS = {\n\t'issuerKeyId': '2.5.29.35',\n\t'altName': '2.5.29.17',\n\t'basicConstraints': '2.5.29.19',\n\t'keyUsage': '2.5.29.15',\n\t'extKeyUsage': '2.5.29.37'\n};\n\nfunction read(buf, options) {\n\tif (typeof (buf) === 'string') {\n\t\tbuf = Buffer.from(buf, 'binary');\n\t}\n\tassert.buffer(buf, 'buf');\n\n\tvar der = new asn1.BerReader(buf);\n\n\tder.readSequence();\n\tif (Math.abs(der.length - der.remain) > 1) {\n\t\tthrow (new Error('DER sequence does not contain whole byte ' +\n\t\t 'stream'));\n\t}\n\n\tvar tbsStart = der.offset;\n\tder.readSequence();\n\tvar sigOffset = der.offset + der.length;\n\tvar tbsEnd = sigOffset;\n\n\tif (der.peek() === Local(0)) {\n\t\tder.readSequence(Local(0));\n\t\tvar version = der.readInt();\n\t\tassert.ok(version <= 3,\n\t\t 'only x.509 versions up to v3 supported');\n\t}\n\n\tvar cert = {};\n\tcert.signatures = {};\n\tvar sig = (cert.signatures.x509 = {});\n\tsig.extras = {};\n\n\tcert.serial = readMPInt(der, 'serial');\n\n\tder.readSequence();\n\tvar after = der.offset + der.length;\n\tvar certAlgOid = der.readOID();\n\tvar certAlg = SIGN_ALGS[certAlgOid];\n\tif (certAlg === undefined)\n\t\tthrow (new Error('unknown signature algorithm ' + certAlgOid));\n\n\tder._offset = after;\n\tcert.issuer = Identity.parseAsn1(der);\n\n\tder.readSequence();\n\tcert.validFrom = readDate(der);\n\tcert.validUntil = readDate(der);\n\n\tcert.subjects = [Identity.parseAsn1(der)];\n\n\tder.readSequence();\n\tafter = der.offset + der.length;\n\tcert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der);\n\tder._offset = after;\n\n\t/* issuerUniqueID */\n\tif (der.peek() === Local(1)) {\n\t\tder.readSequence(Local(1));\n\t\tsig.extras.issuerUniqueID =\n\t\t buf.slice(der.offset, der.offset + der.length);\n\t\tder._offset += der.length;\n\t}\n\n\t/* subjectUniqueID */\n\tif (der.peek() === Local(2)) {\n\t\tder.readSequence(Local(2));\n\t\tsig.extras.subjectUniqueID =\n\t\t buf.slice(der.offset, der.offset + der.length);\n\t\tder._offset += der.length;\n\t}\n\n\t/* extensions */\n\tif (der.peek() === Local(3)) {\n\t\tder.readSequence(Local(3));\n\t\tvar extEnd = der.offset + der.length;\n\t\tder.readSequence();\n\n\t\twhile (der.offset < extEnd)\n\t\t\treadExtension(cert, buf, der);\n\n\t\tassert.strictEqual(der.offset, extEnd);\n\t}\n\n\tassert.strictEqual(der.offset, sigOffset);\n\n\tder.readSequence();\n\tafter = der.offset + der.length;\n\tvar sigAlgOid = der.readOID();\n\tvar sigAlg = SIGN_ALGS[sigAlgOid];\n\tif (sigAlg === undefined)\n\t\tthrow (new Error('unknown signature algorithm ' + sigAlgOid));\n\tder._offset = after;\n\n\tvar sigData = der.readString(asn1.Ber.BitString, true);\n\tif (sigData[0] === 0)\n\t\tsigData = sigData.slice(1);\n\tvar algParts = sigAlg.split('-');\n\n\tsig.signature = Signature.parse(sigData, algParts[0], 'asn1');\n\tsig.signature.hashAlgorithm = algParts[1];\n\tsig.algo = sigAlg;\n\tsig.cache = buf.slice(tbsStart, tbsEnd);\n\n\treturn (new Certificate(cert));\n}\n\nfunction readDate(der) {\n\tif (der.peek() === asn1.Ber.UTCTime) {\n\t\treturn (utcTimeToDate(der.readString(asn1.Ber.UTCTime)));\n\t} else if (der.peek() === asn1.Ber.GeneralizedTime) {\n\t\treturn (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime)));\n\t} else {\n\t\tthrow (new Error('Unsupported date format'));\n\t}\n}\n\nfunction writeDate(der, date) {\n\tif (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) {\n\t\tder.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime);\n\t} else {\n\t\tder.writeString(dateToUTCTime(date), asn1.Ber.UTCTime);\n\t}\n}\n\n/* RFC5280, section 4.2.1.6 (GeneralName type) */\nvar ALTNAME = {\n\tOtherName: Local(0),\n\tRFC822Name: Context(1),\n\tDNSName: Context(2),\n\tX400Address: Local(3),\n\tDirectoryName: Local(4),\n\tEDIPartyName: Local(5),\n\tURI: Context(6),\n\tIPAddress: Context(7),\n\tOID: Context(8)\n};\n\n/* RFC5280, section 4.2.1.12 (KeyPurposeId) */\nvar EXTPURPOSE = {\n\t'serverAuth': '1.3.6.1.5.5.7.3.1',\n\t'clientAuth': '1.3.6.1.5.5.7.3.2',\n\t'codeSigning': '1.3.6.1.5.5.7.3.3',\n\n\t/* See https://github.com/joyent/oid-docs/blob/master/root.md */\n\t'joyentDocker': '1.3.6.1.4.1.38678.1.4.1',\n\t'joyentCmon': '1.3.6.1.4.1.38678.1.4.2'\n};\nvar EXTPURPOSE_REV = {};\nObject.keys(EXTPURPOSE).forEach(function (k) {\n\tEXTPURPOSE_REV[EXTPURPOSE[k]] = k;\n});\n\nvar KEYUSEBITS = [\n\t'signature', 'identity', 'keyEncryption',\n\t'encryption', 'keyAgreement', 'ca', 'crl'\n];\n\nfunction readExtension(cert, buf, der) {\n\tder.readSequence();\n\tvar after = der.offset + der.length;\n\tvar extId = der.readOID();\n\tvar id;\n\tvar sig = cert.signatures.x509;\n\tif (!sig.extras.exts)\n\t\tsig.extras.exts = [];\n\n\tvar critical;\n\tif (der.peek() === asn1.Ber.Boolean)\n\t\tcritical = der.readBoolean();\n\n\tswitch (extId) {\n\tcase (EXTS.basicConstraints):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tvar bcEnd = der.offset + der.length;\n\t\tvar ca = false;\n\t\tif (der.peek() === asn1.Ber.Boolean)\n\t\t\tca = der.readBoolean();\n\t\tif (cert.purposes === undefined)\n\t\t\tcert.purposes = [];\n\t\tif (ca === true)\n\t\t\tcert.purposes.push('ca');\n\t\tvar bc = { oid: extId, critical: critical };\n\t\tif (der.offset < bcEnd && der.peek() === asn1.Ber.Integer)\n\t\t\tbc.pathLen = der.readInt();\n\t\tsig.extras.exts.push(bc);\n\t\tbreak;\n\tcase (EXTS.extKeyUsage):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tif (cert.purposes === undefined)\n\t\t\tcert.purposes = [];\n\t\tvar ekEnd = der.offset + der.length;\n\t\twhile (der.offset < ekEnd) {\n\t\t\tvar oid = der.readOID();\n\t\t\tcert.purposes.push(EXTPURPOSE_REV[oid] || oid);\n\t\t}\n\t\t/*\n\t\t * This is a bit of a hack: in the case where we have a cert\n\t\t * that's only allowed to do serverAuth or clientAuth (and not\n\t\t * the other), we want to make sure all our Subjects are of\n\t\t * the right type. But we already parsed our Subjects and\n\t\t * decided if they were hosts or users earlier (since it appears\n\t\t * first in the cert).\n\t\t *\n\t\t * So we go through and mutate them into the right kind here if\n\t\t * it doesn't match. This might not be hugely beneficial, as it\n\t\t * seems that single-purpose certs are not often seen in the\n\t\t * wild.\n\t\t */\n\t\tif (cert.purposes.indexOf('serverAuth') !== -1 &&\n\t\t cert.purposes.indexOf('clientAuth') === -1) {\n\t\t\tcert.subjects.forEach(function (ide) {\n\t\t\t\tif (ide.type !== 'host') {\n\t\t\t\t\tide.type = 'host';\n\t\t\t\t\tide.hostname = ide.uid ||\n\t\t\t\t\t ide.email ||\n\t\t\t\t\t ide.components[0].value;\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (cert.purposes.indexOf('clientAuth') !== -1 &&\n\t\t cert.purposes.indexOf('serverAuth') === -1) {\n\t\t\tcert.subjects.forEach(function (ide) {\n\t\t\t\tif (ide.type !== 'user') {\n\t\t\t\t\tide.type = 'user';\n\t\t\t\t\tide.uid = ide.hostname ||\n\t\t\t\t\t ide.email ||\n\t\t\t\t\t ide.components[0].value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsig.extras.exts.push({ oid: extId, critical: critical });\n\t\tbreak;\n\tcase (EXTS.keyUsage):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tvar bits = der.readString(asn1.Ber.BitString, true);\n\t\tvar setBits = readBitField(bits, KEYUSEBITS);\n\t\tsetBits.forEach(function (bit) {\n\t\t\tif (cert.purposes === undefined)\n\t\t\t\tcert.purposes = [];\n\t\t\tif (cert.purposes.indexOf(bit) === -1)\n\t\t\t\tcert.purposes.push(bit);\n\t\t});\n\t\tsig.extras.exts.push({ oid: extId, critical: critical,\n\t\t bits: bits });\n\t\tbreak;\n\tcase (EXTS.altName):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tvar aeEnd = der.offset + der.length;\n\t\twhile (der.offset < aeEnd) {\n\t\t\tswitch (der.peek()) {\n\t\t\tcase ALTNAME.OtherName:\n\t\t\tcase ALTNAME.EDIPartyName:\n\t\t\t\tder.readSequence();\n\t\t\t\tder._offset += der.length;\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.OID:\n\t\t\t\tder.readOID(ALTNAME.OID);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.RFC822Name:\n\t\t\t\t/* RFC822 specifies email addresses */\n\t\t\t\tvar email = der.readString(ALTNAME.RFC822Name);\n\t\t\t\tid = Identity.forEmail(email);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.DirectoryName:\n\t\t\t\tder.readSequence(ALTNAME.DirectoryName);\n\t\t\t\tid = Identity.parseAsn1(der);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.DNSName:\n\t\t\t\tvar host = der.readString(\n\t\t\t\t ALTNAME.DNSName);\n\t\t\t\tid = Identity.forHost(host);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tder.readString(der.peek());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsig.extras.exts.push({ oid: extId, critical: critical });\n\t\tbreak;\n\tdefault:\n\t\tsig.extras.exts.push({\n\t\t\toid: extId,\n\t\t\tcritical: critical,\n\t\t\tdata: der.readString(asn1.Ber.OctetString, true)\n\t\t});\n\t\tbreak;\n\t}\n\n\tder._offset = after;\n}\n\nvar UTCTIME_RE =\n /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;\nfunction utcTimeToDate(t) {\n\tvar m = t.match(UTCTIME_RE);\n\tassert.ok(m, 'timestamps must be in UTC');\n\tvar d = new Date();\n\n\tvar thisYear = d.getUTCFullYear();\n\tvar century = Math.floor(thisYear / 100) * 100;\n\n\tvar year = parseInt(m[1], 10);\n\tif (thisYear % 100 < 50 && year >= 60)\n\t\tyear += (century - 1);\n\telse\n\t\tyear += century;\n\td.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10));\n\td.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));\n\tif (m[6] && m[6].length > 0)\n\t\td.setUTCSeconds(parseInt(m[6], 10));\n\treturn (d);\n}\n\nvar GTIME_RE =\n /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;\nfunction gTimeToDate(t) {\n\tvar m = t.match(GTIME_RE);\n\tassert.ok(m);\n\tvar d = new Date();\n\n\td.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1,\n\t parseInt(m[3], 10));\n\td.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));\n\tif (m[6] && m[6].length > 0)\n\t\td.setUTCSeconds(parseInt(m[6], 10));\n\treturn (d);\n}\n\nfunction zeroPad(n, m) {\n\tif (m === undefined)\n\t\tm = 2;\n\tvar s = '' + n;\n\twhile (s.length < m)\n\t\ts = '0' + s;\n\treturn (s);\n}\n\nfunction dateToUTCTime(d) {\n\tvar s = '';\n\ts += zeroPad(d.getUTCFullYear() % 100);\n\ts += zeroPad(d.getUTCMonth() + 1);\n\ts += zeroPad(d.getUTCDate());\n\ts += zeroPad(d.getUTCHours());\n\ts += zeroPad(d.getUTCMinutes());\n\ts += zeroPad(d.getUTCSeconds());\n\ts += 'Z';\n\treturn (s);\n}\n\nfunction dateToGTime(d) {\n\tvar s = '';\n\ts += zeroPad(d.getUTCFullYear(), 4);\n\ts += zeroPad(d.getUTCMonth() + 1);\n\ts += zeroPad(d.getUTCDate());\n\ts += zeroPad(d.getUTCHours());\n\ts += zeroPad(d.getUTCMinutes());\n\ts += zeroPad(d.getUTCSeconds());\n\ts += 'Z';\n\treturn (s);\n}\n\nfunction sign(cert, key) {\n\tif (cert.signatures.x509 === undefined)\n\t\tcert.signatures.x509 = {};\n\tvar sig = cert.signatures.x509;\n\n\tsig.algo = key.type + '-' + key.defaultHashAlgorithm();\n\tif (SIGN_ALGS[sig.algo] === undefined)\n\t\treturn (false);\n\n\tvar der = new asn1.BerWriter();\n\twriteTBSCert(cert, der);\n\tvar blob = der.buffer;\n\tsig.cache = blob;\n\n\tvar signer = key.createSign();\n\tsigner.write(blob);\n\tcert.signatures.x509.signature = signer.sign();\n\n\treturn (true);\n}\n\nfunction signAsync(cert, signer, done) {\n\tif (cert.signatures.x509 === undefined)\n\t\tcert.signatures.x509 = {};\n\tvar sig = cert.signatures.x509;\n\n\tvar der = new asn1.BerWriter();\n\twriteTBSCert(cert, der);\n\tvar blob = der.buffer;\n\tsig.cache = blob;\n\n\tsigner(blob, function (err, signature) {\n\t\tif (err) {\n\t\t\tdone(err);\n\t\t\treturn;\n\t\t}\n\t\tsig.algo = signature.type + '-' + signature.hashAlgorithm;\n\t\tif (SIGN_ALGS[sig.algo] === undefined) {\n\t\t\tdone(new Error('Invalid signing algorithm \"' +\n\t\t\t sig.algo + '\"'));\n\t\t\treturn;\n\t\t}\n\t\tsig.signature = signature;\n\t\tdone();\n\t});\n}\n\nfunction write(cert, options) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tvar der = new asn1.BerWriter();\n\tder.startSequence();\n\tif (sig.cache) {\n\t\tder._ensure(sig.cache.length);\n\t\tsig.cache.copy(der._buf, der._offset);\n\t\tder._offset += sig.cache.length;\n\t} else {\n\t\twriteTBSCert(cert, der);\n\t}\n\n\tder.startSequence();\n\tder.writeOID(SIGN_ALGS[sig.algo]);\n\tif (sig.algo.match(/^rsa-/))\n\t\tder.writeNull();\n\tder.endSequence();\n\n\tvar sigData = sig.signature.toBuffer('asn1');\n\tvar data = Buffer.alloc(sigData.length + 1);\n\tdata[0] = 0;\n\tsigData.copy(data, 1);\n\tder.writeBuffer(data, asn1.Ber.BitString);\n\tder.endSequence();\n\n\treturn (der.buffer);\n}\n\nfunction writeTBSCert(cert, der) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tder.startSequence();\n\n\tder.startSequence(Local(0));\n\tder.writeInt(2);\n\tder.endSequence();\n\n\tder.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer);\n\n\tder.startSequence();\n\tder.writeOID(SIGN_ALGS[sig.algo]);\n\tif (sig.algo.match(/^rsa-/))\n\t\tder.writeNull();\n\tder.endSequence();\n\n\tcert.issuer.toAsn1(der);\n\n\tder.startSequence();\n\twriteDate(der, cert.validFrom);\n\twriteDate(der, cert.validUntil);\n\tder.endSequence();\n\n\tvar subject = cert.subjects[0];\n\tvar altNames = cert.subjects.slice(1);\n\tsubject.toAsn1(der);\n\n\tpkcs8.writePkcs8(der, cert.subjectKey);\n\n\tif (sig.extras && sig.extras.issuerUniqueID) {\n\t\tder.writeBuffer(sig.extras.issuerUniqueID, Local(1));\n\t}\n\n\tif (sig.extras && sig.extras.subjectUniqueID) {\n\t\tder.writeBuffer(sig.extras.subjectUniqueID, Local(2));\n\t}\n\n\tif (altNames.length > 0 || subject.type === 'host' ||\n\t (cert.purposes !== undefined && cert.purposes.length > 0) ||\n\t (sig.extras && sig.extras.exts)) {\n\t\tder.startSequence(Local(3));\n\t\tder.startSequence();\n\n\t\tvar exts = [];\n\t\tif (cert.purposes !== undefined && cert.purposes.length > 0) {\n\t\t\texts.push({\n\t\t\t\toid: EXTS.basicConstraints,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t\texts.push({\n\t\t\t\toid: EXTS.keyUsage,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t\texts.push({\n\t\t\t\toid: EXTS.extKeyUsage,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t}\n\t\texts.push({ oid: EXTS.altName });\n\t\tif (sig.extras && sig.extras.exts)\n\t\t\texts = sig.extras.exts;\n\n\t\tfor (var i = 0; i < exts.length; ++i) {\n\t\t\tder.startSequence();\n\t\t\tder.writeOID(exts[i].oid);\n\n\t\t\tif (exts[i].critical !== undefined)\n\t\t\t\tder.writeBoolean(exts[i].critical);\n\n\t\t\tif (exts[i].oid === EXTS.altName) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tif (subject.type === 'host') {\n\t\t\t\t\tder.writeString(subject.hostname,\n\t\t\t\t\t Context(2));\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < altNames.length; ++j) {\n\t\t\t\t\tif (altNames[j].type === 'host') {\n\t\t\t\t\t\tder.writeString(\n\t\t\t\t\t\t altNames[j].hostname,\n\t\t\t\t\t\t ALTNAME.DNSName);\n\t\t\t\t\t} else if (altNames[j].type ===\n\t\t\t\t\t 'email') {\n\t\t\t\t\t\tder.writeString(\n\t\t\t\t\t\t altNames[j].email,\n\t\t\t\t\t\t ALTNAME.RFC822Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Encode anything else as a\n\t\t\t\t\t\t * DN style name for now.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tder.startSequence(\n\t\t\t\t\t\t ALTNAME.DirectoryName);\n\t\t\t\t\t\taltNames[j].toAsn1(der);\n\t\t\t\t\t\tder.endSequence();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.basicConstraints) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tvar ca = (cert.purposes.indexOf('ca') !== -1);\n\t\t\t\tvar pathLen = exts[i].pathLen;\n\t\t\t\tder.writeBoolean(ca);\n\t\t\t\tif (pathLen !== undefined)\n\t\t\t\t\tder.writeInt(pathLen);\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.extKeyUsage) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tcert.purposes.forEach(function (purpose) {\n\t\t\t\t\tif (purpose === 'ca')\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (KEYUSEBITS.indexOf(purpose) !== -1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar oid = purpose;\n\t\t\t\t\tif (EXTPURPOSE[purpose] !== undefined)\n\t\t\t\t\t\toid = EXTPURPOSE[purpose];\n\t\t\t\t\tder.writeOID(oid);\n\t\t\t\t});\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.keyUsage) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\t/*\n\t\t\t\t * If we parsed this certificate from a byte\n\t\t\t\t * stream (i.e. we didn't generate it in sshpk)\n\t\t\t\t * then we'll have a \".bits\" property on the\n\t\t\t\t * ext with the original raw byte contents.\n\t\t\t\t *\n\t\t\t\t * If we have this, use it here instead of\n\t\t\t\t * regenerating it. This guarantees we output\n\t\t\t\t * the same data we parsed, so signatures still\n\t\t\t\t * validate.\n\t\t\t\t */\n\t\t\t\tif (exts[i].bits !== undefined) {\n\t\t\t\t\tder.writeBuffer(exts[i].bits,\n\t\t\t\t\t asn1.Ber.BitString);\n\t\t\t\t} else {\n\t\t\t\t\tvar bits = writeBitField(cert.purposes,\n\t\t\t\t\t KEYUSEBITS);\n\t\t\t\t\tder.writeBuffer(bits,\n\t\t\t\t\t asn1.Ber.BitString);\n\t\t\t\t}\n\t\t\t\tder.endSequence();\n\t\t\t} else {\n\t\t\t\tder.writeBuffer(exts[i].data,\n\t\t\t\t asn1.Ber.OctetString);\n\t\t\t}\n\n\t\t\tder.endSequence();\n\t\t}\n\n\t\tder.endSequence();\n\t\tder.endSequence();\n\t}\n\n\tder.endSequence();\n}\n\n/*\n * Reads an ASN.1 BER bitfield out of the Buffer produced by doing\n * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw\n * contents of the BitString tag, which is a count of unused bits followed by\n * the bits as a right-padded byte string.\n *\n * `bits` is the Buffer, `bitIndex` should contain an array of string names\n * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec.\n *\n * Returns an array of Strings, the names of the bits that were set to 1.\n */\nfunction readBitField(bits, bitIndex) {\n\tvar bitLen = 8 * (bits.length - 1) - bits[0];\n\tvar setBits = {};\n\tfor (var i = 0; i < bitLen; ++i) {\n\t\tvar byteN = 1 + Math.floor(i / 8);\n\t\tvar bit = 7 - (i % 8);\n\t\tvar mask = 1 << bit;\n\t\tvar bitVal = ((bits[byteN] & mask) !== 0);\n\t\tvar name = bitIndex[i];\n\t\tif (bitVal && typeof (name) === 'string') {\n\t\t\tsetBits[name] = true;\n\t\t}\n\t}\n\treturn (Object.keys(setBits));\n}\n\n/*\n * `setBits` is an array of strings, containing the names for each bit that\n * sould be set to 1. `bitIndex` is same as in `readBitField()`.\n *\n * Returns a Buffer, ready to be written out with `BerWriter#writeString()`.\n */\nfunction writeBitField(setBits, bitIndex) {\n\tvar bitLen = bitIndex.length;\n\tvar blen = Math.ceil(bitLen / 8);\n\tvar unused = blen * 8 - bitLen;\n\tvar bits = Buffer.alloc(1 + blen); // zero-filled\n\tbits[0] = unused;\n\tfor (var i = 0; i < bitLen; ++i) {\n\t\tvar byteN = 1 + Math.floor(i / 8);\n\t\tvar bit = 7 - (i % 8);\n\t\tvar mask = 1 << bit;\n\t\tvar name = bitIndex[i];\n\t\tif (name === undefined)\n\t\t\tcontinue;\n\t\tvar bitVal = (setBits.indexOf(name) !== -1);\n\t\tif (bitVal) {\n\t\t\tbits[byteN] |= mask;\n\t\t}\n\t}\n\treturn (bits);\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/formats/x509.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/identity.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/identity.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2017 Joyent, Inc.\n\nmodule.exports = Identity;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Fingerprint = __webpack_require__(/*! ./fingerprint */ \"./node_modules/sshpk/lib/fingerprint.js\");\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\n\n/*JSSTYLED*/\nvar DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\\-]{0,62})(?:\\.([*]|[a-z0-9][a-z0-9\\-]{0,62}))*$/i;\n\nvar oids = {};\noids.cn = '2.5.4.3';\noids.o = '2.5.4.10';\noids.ou = '2.5.4.11';\noids.l = '2.5.4.7';\noids.s = '2.5.4.8';\noids.c = '2.5.4.6';\noids.sn = '2.5.4.4';\noids.postalCode = '2.5.4.17';\noids.serialNumber = '2.5.4.5';\noids.street = '2.5.4.9';\noids.x500UniqueIdentifier = '2.5.4.45';\noids.role = '2.5.4.72';\noids.telephoneNumber = '2.5.4.20';\noids.description = '2.5.4.13';\noids.dc = '0.9.2342.19200300.100.1.25';\noids.uid = '0.9.2342.19200300.100.1.1';\noids.mail = '0.9.2342.19200300.100.1.3';\noids.title = '2.5.4.12';\noids.gn = '2.5.4.42';\noids.initials = '2.5.4.43';\noids.pseudonym = '2.5.4.65';\noids.emailAddress = '1.2.840.113549.1.9.1';\n\nvar unoids = {};\nObject.keys(oids).forEach(function (k) {\n\tunoids[oids[k]] = k;\n});\n\nfunction Identity(opts) {\n\tvar self = this;\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.components, 'options.components');\n\tthis.components = opts.components;\n\tthis.componentLookup = {};\n\tthis.components.forEach(function (c) {\n\t\tif (c.name && !c.oid)\n\t\t\tc.oid = oids[c.name];\n\t\tif (c.oid && !c.name)\n\t\t\tc.name = unoids[c.oid];\n\t\tif (self.componentLookup[c.name] === undefined)\n\t\t\tself.componentLookup[c.name] = [];\n\t\tself.componentLookup[c.name].push(c);\n\t});\n\tif (this.componentLookup.cn && this.componentLookup.cn.length > 0) {\n\t\tthis.cn = this.componentLookup.cn[0].value;\n\t}\n\tassert.optionalString(opts.type, 'options.type');\n\tif (opts.type === undefined) {\n\t\tif (this.components.length === 1 &&\n\t\t this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1 &&\n\t\t this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.cn[0].value;\n\n\t\t} else if (this.componentLookup.dc &&\n\t\t this.components.length === this.componentLookup.dc.length) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.dc.map(\n\t\t\t function (c) {\n\t\t\t\treturn (c.value);\n\t\t\t}).join('.');\n\n\t\t} else if (this.componentLookup.uid &&\n\t\t this.components.length ===\n\t\t this.componentLookup.uid.length) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.uid[0].value;\n\n\t\t} else if (this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1 &&\n\t\t this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.cn[0].value;\n\n\t\t} else if (this.componentLookup.uid &&\n\t\t this.componentLookup.uid.length === 1) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.uid[0].value;\n\n\t\t} else if (this.componentLookup.mail &&\n\t\t this.componentLookup.mail.length === 1) {\n\t\t\tthis.type = 'email';\n\t\t\tthis.email = this.componentLookup.mail[0].value;\n\n\t\t} else if (this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.cn[0].value;\n\n\t\t} else {\n\t\t\tthis.type = 'unknown';\n\t\t}\n\t} else {\n\t\tthis.type = opts.type;\n\t\tif (this.type === 'host')\n\t\t\tthis.hostname = opts.hostname;\n\t\telse if (this.type === 'user')\n\t\t\tthis.uid = opts.uid;\n\t\telse if (this.type === 'email')\n\t\t\tthis.email = opts.email;\n\t\telse\n\t\t\tthrow (new Error('Unknown type ' + this.type));\n\t}\n}\n\nIdentity.prototype.toString = function () {\n\treturn (this.components.map(function (c) {\n\t\tvar n = c.name.toUpperCase();\n\t\t/*JSSTYLED*/\n\t\tn = n.replace(/=/g, '\\\\=');\n\t\tvar v = c.value;\n\t\t/*JSSTYLED*/\n\t\tv = v.replace(/,/g, '\\\\,');\n\t\treturn (n + '=' + v);\n\t}).join(', '));\n};\n\nIdentity.prototype.get = function (name, asArray) {\n\tassert.string(name, 'name');\n\tvar arr = this.componentLookup[name];\n\tif (arr === undefined || arr.length === 0)\n\t\treturn (undefined);\n\tif (!asArray && arr.length > 1)\n\t\tthrow (new Error('Multiple values for attribute ' + name));\n\tif (!asArray)\n\t\treturn (arr[0].value);\n\treturn (arr.map(function (c) {\n\t\treturn (c.value);\n\t}));\n};\n\nIdentity.prototype.toArray = function (idx) {\n\treturn (this.components.map(function (c) {\n\t\treturn ({\n\t\t\tname: c.name,\n\t\t\tvalue: c.value\n\t\t});\n\t}));\n};\n\n/*\n * These are from X.680 -- PrintableString allowed chars are in section 37.4\n * table 8. Spec for IA5Strings is \"1,6 + SPACE + DEL\" where 1 refers to\n * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006\n * (the basic ASCII character set).\n */\n/* JSSTYLED */\nvar NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\\/:=?-]/;\n/* JSSTYLED */\nvar NOT_IA5 = /[^\\x00-\\x7f]/;\n\nIdentity.prototype.toAsn1 = function (der, tag) {\n\tder.startSequence(tag);\n\tthis.components.forEach(function (c) {\n\t\tder.startSequence(asn1.Ber.Constructor | asn1.Ber.Set);\n\t\tder.startSequence();\n\t\tder.writeOID(c.oid);\n\t\t/*\n\t\t * If we fit in a PrintableString, use that. Otherwise use an\n\t\t * IA5String or UTF8String.\n\t\t *\n\t\t * If this identity was parsed from a DN, use the ASN.1 types\n\t\t * from the original representation (otherwise this might not\n\t\t * be a full match for the original in some validators).\n\t\t */\n\t\tif (c.asn1type === asn1.Ber.Utf8String ||\n\t\t c.value.match(NOT_IA5)) {\n\t\t\tvar v = Buffer.from(c.value, 'utf8');\n\t\t\tder.writeBuffer(v, asn1.Ber.Utf8String);\n\n\t\t} else if (c.asn1type === asn1.Ber.IA5String ||\n\t\t c.value.match(NOT_PRINTABLE)) {\n\t\t\tder.writeString(c.value, asn1.Ber.IA5String);\n\n\t\t} else {\n\t\t\tvar type = asn1.Ber.PrintableString;\n\t\t\tif (c.asn1type !== undefined)\n\t\t\t\ttype = c.asn1type;\n\t\t\tder.writeString(c.value, type);\n\t\t}\n\t\tder.endSequence();\n\t\tder.endSequence();\n\t});\n\tder.endSequence();\n};\n\nfunction globMatch(a, b) {\n\tif (a === '**' || b === '**')\n\t\treturn (true);\n\tvar aParts = a.split('.');\n\tvar bParts = b.split('.');\n\tif (aParts.length !== bParts.length)\n\t\treturn (false);\n\tfor (var i = 0; i < aParts.length; ++i) {\n\t\tif (aParts[i] === '*' || bParts[i] === '*')\n\t\t\tcontinue;\n\t\tif (aParts[i] !== bParts[i])\n\t\t\treturn (false);\n\t}\n\treturn (true);\n}\n\nIdentity.prototype.equals = function (other) {\n\tif (!Identity.isIdentity(other, [1, 0]))\n\t\treturn (false);\n\tif (other.components.length !== this.components.length)\n\t\treturn (false);\n\tfor (var i = 0; i < this.components.length; ++i) {\n\t\tif (this.components[i].oid !== other.components[i].oid)\n\t\t\treturn (false);\n\t\tif (!globMatch(this.components[i].value,\n\t\t other.components[i].value)) {\n\t\t\treturn (false);\n\t\t}\n\t}\n\treturn (true);\n};\n\nIdentity.forHost = function (hostname) {\n\tassert.string(hostname, 'hostname');\n\treturn (new Identity({\n\t\ttype: 'host',\n\t\thostname: hostname,\n\t\tcomponents: [ { name: 'cn', value: hostname } ]\n\t}));\n};\n\nIdentity.forUser = function (uid) {\n\tassert.string(uid, 'uid');\n\treturn (new Identity({\n\t\ttype: 'user',\n\t\tuid: uid,\n\t\tcomponents: [ { name: 'uid', value: uid } ]\n\t}));\n};\n\nIdentity.forEmail = function (email) {\n\tassert.string(email, 'email');\n\treturn (new Identity({\n\t\ttype: 'email',\n\t\temail: email,\n\t\tcomponents: [ { name: 'mail', value: email } ]\n\t}));\n};\n\nIdentity.parseDN = function (dn) {\n\tassert.string(dn, 'dn');\n\tvar parts = [''];\n\tvar idx = 0;\n\tvar rem = dn;\n\twhile (rem.length > 0) {\n\t\tvar m;\n\t\t/*JSSTYLED*/\n\t\tif ((m = /^,/.exec(rem)) !== null) {\n\t\t\tparts[++idx] = '';\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^\\\\,/.exec(rem)) !== null) {\n\t\t\tparts[idx] += ',';\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^\\\\./.exec(rem)) !== null) {\n\t\t\tparts[idx] += m[0];\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^[^\\\\,]+/.exec(rem)) !== null) {\n\t\t\tparts[idx] += m[0];\n\t\t\trem = rem.slice(m[0].length);\n\t\t} else {\n\t\t\tthrow (new Error('Failed to parse DN'));\n\t\t}\n\t}\n\tvar cmps = parts.map(function (c) {\n\t\tc = c.trim();\n\t\tvar eqPos = c.indexOf('=');\n\t\twhile (eqPos > 0 && c.charAt(eqPos - 1) === '\\\\')\n\t\t\teqPos = c.indexOf('=', eqPos + 1);\n\t\tif (eqPos === -1) {\n\t\t\tthrow (new Error('Failed to parse DN'));\n\t\t}\n\t\t/*JSSTYLED*/\n\t\tvar name = c.slice(0, eqPos).toLowerCase().replace(/\\\\=/g, '=');\n\t\tvar value = c.slice(eqPos + 1);\n\t\treturn ({ name: name, value: value });\n\t});\n\treturn (new Identity({ components: cmps }));\n};\n\nIdentity.fromArray = function (components) {\n\tassert.arrayOfObject(components, 'components');\n\tcomponents.forEach(function (cmp) {\n\t\tassert.object(cmp, 'component');\n\t\tassert.string(cmp.name, 'component.name');\n\t\tif (!Buffer.isBuffer(cmp.value) &&\n\t\t !(typeof (cmp.value) === 'string')) {\n\t\t\tthrow (new Error('Invalid component value'));\n\t\t}\n\t});\n\treturn (new Identity({ components: components }));\n};\n\nIdentity.parseAsn1 = function (der, top) {\n\tvar components = [];\n\tder.readSequence(top);\n\tvar end = der.offset + der.length;\n\twhile (der.offset < end) {\n\t\tder.readSequence(asn1.Ber.Constructor | asn1.Ber.Set);\n\t\tvar after = der.offset + der.length;\n\t\tder.readSequence();\n\t\tvar oid = der.readOID();\n\t\tvar type = der.peek();\n\t\tvar value;\n\t\tswitch (type) {\n\t\tcase asn1.Ber.PrintableString:\n\t\tcase asn1.Ber.IA5String:\n\t\tcase asn1.Ber.OctetString:\n\t\tcase asn1.Ber.T61String:\n\t\t\tvalue = der.readString(type);\n\t\t\tbreak;\n\t\tcase asn1.Ber.Utf8String:\n\t\t\tvalue = der.readString(type, true);\n\t\t\tvalue = value.toString('utf8');\n\t\t\tbreak;\n\t\tcase asn1.Ber.CharacterString:\n\t\tcase asn1.Ber.BMPString:\n\t\t\tvalue = der.readString(type, true);\n\t\t\tvalue = value.toString('utf16le');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('Unknown asn1 type ' + type));\n\t\t}\n\t\tcomponents.push({ oid: oid, asn1type: type, value: value });\n\t\tder._offset = after;\n\t}\n\tder._offset = end;\n\treturn (new Identity({\n\t\tcomponents: components\n\t}));\n};\n\nIdentity.isIdentity = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Identity, ver));\n};\n\n/*\n * API versions for Identity:\n * [1,0] -- initial ver\n */\nIdentity.prototype._sshpkApiVersion = [1, 0];\n\nIdentity._oldVersionDetect = function (obj) {\n\treturn ([1, 0]);\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/identity.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/sshpk/lib/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nvar Key = __webpack_require__(/*! ./key */ \"./node_modules/sshpk/lib/key.js\");\nvar Fingerprint = __webpack_require__(/*! ./fingerprint */ \"./node_modules/sshpk/lib/fingerprint.js\");\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar PrivateKey = __webpack_require__(/*! ./private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar Certificate = __webpack_require__(/*! ./certificate */ \"./node_modules/sshpk/lib/certificate.js\");\nvar Identity = __webpack_require__(/*! ./identity */ \"./node_modules/sshpk/lib/identity.js\");\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\n\nmodule.exports = {\n\t/* top-level classes */\n\tKey: Key,\n\tparseKey: Key.parse,\n\tFingerprint: Fingerprint,\n\tparseFingerprint: Fingerprint.parse,\n\tSignature: Signature,\n\tparseSignature: Signature.parse,\n\tPrivateKey: PrivateKey,\n\tparsePrivateKey: PrivateKey.parse,\n\tgeneratePrivateKey: PrivateKey.generate,\n\tCertificate: Certificate,\n\tparseCertificate: Certificate.parse,\n\tcreateSelfSignedCertificate: Certificate.createSelfSigned,\n\tcreateCertificate: Certificate.create,\n\tIdentity: Identity,\n\tidentityFromDN: Identity.parseDN,\n\tidentityForHost: Identity.forHost,\n\tidentityForUser: Identity.forUser,\n\tidentityForEmail: Identity.forEmail,\n\tidentityFromArray: Identity.fromArray,\n\n\t/* errors */\n\tFingerprintFormatError: errs.FingerprintFormatError,\n\tInvalidAlgorithmError: errs.InvalidAlgorithmError,\n\tKeyParseError: errs.KeyParseError,\n\tSignatureParseError: errs.SignatureParseError,\n\tKeyEncryptedError: errs.KeyEncryptedError,\n\tCertificateParseError: errs.CertificateParseError\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/key.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/sshpk/lib/key.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright 2018 Joyent, Inc.\n\nmodule.exports = Key;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Fingerprint = __webpack_require__(/*! ./fingerprint */ \"./node_modules/sshpk/lib/fingerprint.js\");\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar DiffieHellman = __webpack_require__(/*! ./dhe */ \"./node_modules/sshpk/lib/dhe.js\").DiffieHellman;\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar PrivateKey = __webpack_require__(/*! ./private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar edCompat;\n\ntry {\n\tedCompat = __webpack_require__(/*! ./ed-compat */ \"./node_modules/sshpk/lib/ed-compat.js\");\n} catch (e) {\n\t/* Just continue through, and bail out if we try to use it. */\n}\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar KeyParseError = errs.KeyParseError;\n\nvar formats = {};\nformats['auto'] = __webpack_require__(/*! ./formats/auto */ \"./node_modules/sshpk/lib/formats/auto.js\");\nformats['pem'] = __webpack_require__(/*! ./formats/pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\nformats['pkcs1'] = __webpack_require__(/*! ./formats/pkcs1 */ \"./node_modules/sshpk/lib/formats/pkcs1.js\");\nformats['pkcs8'] = __webpack_require__(/*! ./formats/pkcs8 */ \"./node_modules/sshpk/lib/formats/pkcs8.js\");\nformats['rfc4253'] = __webpack_require__(/*! ./formats/rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nformats['ssh'] = __webpack_require__(/*! ./formats/ssh */ \"./node_modules/sshpk/lib/formats/ssh.js\");\nformats['ssh-private'] = __webpack_require__(/*! ./formats/ssh-private */ \"./node_modules/sshpk/lib/formats/ssh-private.js\");\nformats['openssh'] = formats['ssh-private'];\nformats['dnssec'] = __webpack_require__(/*! ./formats/dnssec */ \"./node_modules/sshpk/lib/formats/dnssec.js\");\nformats['putty'] = __webpack_require__(/*! ./formats/putty */ \"./node_modules/sshpk/lib/formats/putty.js\");\nformats['ppk'] = formats['putty'];\n\nfunction Key(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.parts, 'options.parts');\n\tassert.string(opts.type, 'options.type');\n\tassert.optionalString(opts.comment, 'options.comment');\n\n\tvar algInfo = algs.info[opts.type];\n\tif (typeof (algInfo) !== 'object')\n\t\tthrow (new InvalidAlgorithmError(opts.type));\n\n\tvar partLookup = {};\n\tfor (var i = 0; i < opts.parts.length; ++i) {\n\t\tvar part = opts.parts[i];\n\t\tpartLookup[part.name] = part;\n\t}\n\n\tthis.type = opts.type;\n\tthis.parts = opts.parts;\n\tthis.part = partLookup;\n\tthis.comment = undefined;\n\tthis.source = opts.source;\n\n\t/* for speeding up hashing/fingerprint operations */\n\tthis._rfc4253Cache = opts._rfc4253Cache;\n\tthis._hashCache = {};\n\n\tvar sz;\n\tthis.curve = undefined;\n\tif (this.type === 'ecdsa') {\n\t\tvar curve = this.part.curve.data.toString();\n\t\tthis.curve = curve;\n\t\tsz = algs.curves[curve].size;\n\t} else if (this.type === 'ed25519' || this.type === 'curve25519') {\n\t\tsz = 256;\n\t\tthis.curve = 'curve25519';\n\t} else {\n\t\tvar szPart = this.part[algInfo.sizePart];\n\t\tsz = szPart.data.length;\n\t\tsz = sz * 8 - utils.countZeros(szPart.data);\n\t}\n\tthis.size = sz;\n}\n\nKey.formats = formats;\n\nKey.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'ssh';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\tif (format === 'rfc4253') {\n\t\tif (this._rfc4253Cache === undefined)\n\t\t\tthis._rfc4253Cache = formats['rfc4253'].write(this);\n\t\treturn (this._rfc4253Cache);\n\t}\n\n\treturn (formats[format].write(this, options));\n};\n\nKey.prototype.toString = function (format, options) {\n\treturn (this.toBuffer(format, options).toString());\n};\n\nKey.prototype.hash = function (algo, type) {\n\tassert.string(algo, 'algorithm');\n\tassert.optionalString(type, 'type');\n\tif (type === undefined)\n\t\ttype = 'ssh';\n\talgo = algo.toLowerCase();\n\tif (algs.hashAlgs[algo] === undefined)\n\t\tthrow (new InvalidAlgorithmError(algo));\n\n\tvar cacheKey = algo + '||' + type;\n\tif (this._hashCache[cacheKey])\n\t\treturn (this._hashCache[cacheKey]);\n\n\tvar buf;\n\tif (type === 'ssh') {\n\t\tbuf = this.toBuffer('rfc4253');\n\t} else if (type === 'spki') {\n\t\tbuf = formats.pkcs8.pkcs8ToBuffer(this);\n\t} else {\n\t\tthrow (new Error('Hash type ' + type + ' not supported'));\n\t}\n\tvar hash = crypto.createHash(algo).update(buf).digest();\n\tthis._hashCache[cacheKey] = hash;\n\treturn (hash);\n};\n\nKey.prototype.fingerprint = function (algo, type) {\n\tif (algo === undefined)\n\t\talgo = 'sha256';\n\tif (type === undefined)\n\t\ttype = 'ssh';\n\tassert.string(algo, 'algorithm');\n\tassert.string(type, 'type');\n\tvar opts = {\n\t\ttype: 'key',\n\t\thash: this.hash(algo, type),\n\t\talgorithm: algo,\n\t\thashType: type\n\t};\n\treturn (new Fingerprint(opts));\n};\n\nKey.prototype.defaultHashAlgorithm = function () {\n\tvar hashAlgo = 'sha1';\n\tif (this.type === 'rsa')\n\t\thashAlgo = 'sha256';\n\tif (this.type === 'dsa' && this.size > 1024)\n\t\thashAlgo = 'sha256';\n\tif (this.type === 'ed25519')\n\t\thashAlgo = 'sha512';\n\tif (this.type === 'ecdsa') {\n\t\tif (this.size <= 256)\n\t\t\thashAlgo = 'sha256';\n\t\telse if (this.size <= 384)\n\t\t\thashAlgo = 'sha384';\n\t\telse\n\t\t\thashAlgo = 'sha512';\n\t}\n\treturn (hashAlgo);\n};\n\nKey.prototype.createVerify = function (hashAlgo) {\n\tif (hashAlgo === undefined)\n\t\thashAlgo = this.defaultHashAlgorithm();\n\tassert.string(hashAlgo, 'hash algorithm');\n\n\t/* ED25519 is not supported by OpenSSL, use a javascript impl. */\n\tif (this.type === 'ed25519' && edCompat !== undefined)\n\t\treturn (new edCompat.Verifier(this, hashAlgo));\n\tif (this.type === 'curve25519')\n\t\tthrow (new Error('Curve25519 keys are not suitable for ' +\n\t\t 'signing or verification'));\n\n\tvar v, nm, err;\n\ttry {\n\t\tnm = hashAlgo.toUpperCase();\n\t\tv = crypto.createVerify(nm);\n\t} catch (e) {\n\t\terr = e;\n\t}\n\tif (v === undefined || (err instanceof Error &&\n\t err.message.match(/Unknown message digest/))) {\n\t\tnm = 'RSA-';\n\t\tnm += hashAlgo.toUpperCase();\n\t\tv = crypto.createVerify(nm);\n\t}\n\tassert.ok(v, 'failed to create verifier');\n\tvar oldVerify = v.verify.bind(v);\n\tvar key = this.toBuffer('pkcs8');\n\tvar curve = this.curve;\n\tvar self = this;\n\tv.verify = function (signature, fmt) {\n\t\tif (Signature.isSignature(signature, [2, 0])) {\n\t\t\tif (signature.type !== self.type)\n\t\t\t\treturn (false);\n\t\t\tif (signature.hashAlgorithm &&\n\t\t\t signature.hashAlgorithm !== hashAlgo)\n\t\t\t\treturn (false);\n\t\t\tif (signature.curve && self.type === 'ecdsa' &&\n\t\t\t signature.curve !== curve)\n\t\t\t\treturn (false);\n\t\t\treturn (oldVerify(key, signature.toBuffer('asn1')));\n\n\t\t} else if (typeof (signature) === 'string' ||\n\t\t Buffer.isBuffer(signature)) {\n\t\t\treturn (oldVerify(key, signature, fmt));\n\n\t\t/*\n\t\t * Avoid doing this on valid arguments, walking the prototype\n\t\t * chain can be quite slow.\n\t\t */\n\t\t} else if (Signature.isSignature(signature, [1, 0])) {\n\t\t\tthrow (new Error('signature was created by too old ' +\n\t\t\t 'a version of sshpk and cannot be verified'));\n\n\t\t} else {\n\t\t\tthrow (new TypeError('signature must be a string, ' +\n\t\t\t 'Buffer, or Signature object'));\n\t\t}\n\t};\n\treturn (v);\n};\n\nKey.prototype.createDiffieHellman = function () {\n\tif (this.type === 'rsa')\n\t\tthrow (new Error('RSA keys do not support Diffie-Hellman'));\n\n\treturn (new DiffieHellman(this));\n};\nKey.prototype.createDH = Key.prototype.createDiffieHellman;\n\nKey.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\tif (k instanceof PrivateKey)\n\t\t\tk = k.toPublic();\n\t\tif (!k.comment)\n\t\t\tk.comment = options.filename;\n\t\treturn (k);\n\t} catch (e) {\n\t\tif (e.name === 'KeyEncryptedError')\n\t\t\tthrow (e);\n\t\tthrow (new KeyParseError(options.filename, format, e));\n\t}\n};\n\nKey.isKey = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Key, ver));\n};\n\n/*\n * API versions for Key:\n * [1,0] -- initial ver, may take Signature for createVerify or may not\n * [1,1] -- added pkcs1, pkcs8 formats\n * [1,2] -- added auto, ssh-private, openssh formats\n * [1,3] -- added defaultHashAlgorithm\n * [1,4] -- added ed support, createDH\n * [1,5] -- first explicitly tagged version\n * [1,6] -- changed ed25519 part names\n * [1,7] -- spki hash types\n */\nKey.prototype._sshpkApiVersion = [1, 7];\n\nKey._oldVersionDetect = function (obj) {\n\tassert.func(obj.toBuffer);\n\tassert.func(obj.fingerprint);\n\tif (obj.createDH)\n\t\treturn ([1, 4]);\n\tif (obj.defaultHashAlgorithm)\n\t\treturn ([1, 3]);\n\tif (obj.formats['auto'])\n\t\treturn ([1, 2]);\n\tif (obj.formats['pkcs1'])\n\t\treturn ([1, 1]);\n\treturn ([1, 0]);\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/key.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/private-key.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/private-key.js ***!
|
||
\***********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2017 Joyent, Inc.\n\nmodule.exports = PrivateKey;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar Fingerprint = __webpack_require__(/*! ./fingerprint */ \"./node_modules/sshpk/lib/fingerprint.js\");\nvar Signature = __webpack_require__(/*! ./signature */ \"./node_modules/sshpk/lib/signature.js\");\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar dhe = __webpack_require__(/*! ./dhe */ \"./node_modules/sshpk/lib/dhe.js\");\nvar generateECDSA = dhe.generateECDSA;\nvar generateED25519 = dhe.generateED25519;\nvar edCompat = __webpack_require__(/*! ./ed-compat */ \"./node_modules/sshpk/lib/ed-compat.js\");\nvar nacl = __webpack_require__(/*! tweetnacl */ \"./node_modules/tweetnacl/nacl-fast.js\");\n\nvar Key = __webpack_require__(/*! ./key */ \"./node_modules/sshpk/lib/key.js\");\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar KeyParseError = errs.KeyParseError;\nvar KeyEncryptedError = errs.KeyEncryptedError;\n\nvar formats = {};\nformats['auto'] = __webpack_require__(/*! ./formats/auto */ \"./node_modules/sshpk/lib/formats/auto.js\");\nformats['pem'] = __webpack_require__(/*! ./formats/pem */ \"./node_modules/sshpk/lib/formats/pem.js\");\nformats['pkcs1'] = __webpack_require__(/*! ./formats/pkcs1 */ \"./node_modules/sshpk/lib/formats/pkcs1.js\");\nformats['pkcs8'] = __webpack_require__(/*! ./formats/pkcs8 */ \"./node_modules/sshpk/lib/formats/pkcs8.js\");\nformats['rfc4253'] = __webpack_require__(/*! ./formats/rfc4253 */ \"./node_modules/sshpk/lib/formats/rfc4253.js\");\nformats['ssh-private'] = __webpack_require__(/*! ./formats/ssh-private */ \"./node_modules/sshpk/lib/formats/ssh-private.js\");\nformats['openssh'] = formats['ssh-private'];\nformats['ssh'] = formats['ssh-private'];\nformats['dnssec'] = __webpack_require__(/*! ./formats/dnssec */ \"./node_modules/sshpk/lib/formats/dnssec.js\");\n\nfunction PrivateKey(opts) {\n\tassert.object(opts, 'options');\n\tKey.call(this, opts);\n\n\tthis._pubCache = undefined;\n}\nutil.inherits(PrivateKey, Key);\n\nPrivateKey.formats = formats;\n\nPrivateKey.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'pkcs1';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\treturn (formats[format].write(this, options));\n};\n\nPrivateKey.prototype.hash = function (algo, type) {\n\treturn (this.toPublic().hash(algo, type));\n};\n\nPrivateKey.prototype.fingerprint = function (algo, type) {\n\treturn (this.toPublic().fingerprint(algo, type));\n};\n\nPrivateKey.prototype.toPublic = function () {\n\tif (this._pubCache)\n\t\treturn (this._pubCache);\n\n\tvar algInfo = algs.info[this.type];\n\tvar pubParts = [];\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tvar p = algInfo.parts[i];\n\t\tpubParts.push(this.part[p]);\n\t}\n\n\tthis._pubCache = new Key({\n\t\ttype: this.type,\n\t\tsource: this,\n\t\tparts: pubParts\n\t});\n\tif (this.comment)\n\t\tthis._pubCache.comment = this.comment;\n\treturn (this._pubCache);\n};\n\nPrivateKey.prototype.derive = function (newType) {\n\tassert.string(newType, 'type');\n\tvar priv, pub, pair;\n\n\tif (this.type === 'ed25519' && newType === 'curve25519') {\n\t\tpriv = this.part.k.data;\n\t\tif (priv[0] === 0x00)\n\t\t\tpriv = priv.slice(1);\n\n\t\tpair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));\n\t\tpub = Buffer.from(pair.publicKey);\n\n\t\treturn (new PrivateKey({\n\t\t\ttype: 'curve25519',\n\t\t\tparts: [\n\t\t\t\t{ name: 'A', data: utils.mpNormalize(pub) },\n\t\t\t\t{ name: 'k', data: utils.mpNormalize(priv) }\n\t\t\t]\n\t\t}));\n\t} else if (this.type === 'curve25519' && newType === 'ed25519') {\n\t\tpriv = this.part.k.data;\n\t\tif (priv[0] === 0x00)\n\t\t\tpriv = priv.slice(1);\n\n\t\tpair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));\n\t\tpub = Buffer.from(pair.publicKey);\n\n\t\treturn (new PrivateKey({\n\t\t\ttype: 'ed25519',\n\t\t\tparts: [\n\t\t\t\t{ name: 'A', data: utils.mpNormalize(pub) },\n\t\t\t\t{ name: 'k', data: utils.mpNormalize(priv) }\n\t\t\t]\n\t\t}));\n\t}\n\tthrow (new Error('Key derivation not supported from ' + this.type +\n\t ' to ' + newType));\n};\n\nPrivateKey.prototype.createVerify = function (hashAlgo) {\n\treturn (this.toPublic().createVerify(hashAlgo));\n};\n\nPrivateKey.prototype.createSign = function (hashAlgo) {\n\tif (hashAlgo === undefined)\n\t\thashAlgo = this.defaultHashAlgorithm();\n\tassert.string(hashAlgo, 'hash algorithm');\n\n\t/* ED25519 is not supported by OpenSSL, use a javascript impl. */\n\tif (this.type === 'ed25519' && edCompat !== undefined)\n\t\treturn (new edCompat.Signer(this, hashAlgo));\n\tif (this.type === 'curve25519')\n\t\tthrow (new Error('Curve25519 keys are not suitable for ' +\n\t\t 'signing or verification'));\n\n\tvar v, nm, err;\n\ttry {\n\t\tnm = hashAlgo.toUpperCase();\n\t\tv = crypto.createSign(nm);\n\t} catch (e) {\n\t\terr = e;\n\t}\n\tif (v === undefined || (err instanceof Error &&\n\t err.message.match(/Unknown message digest/))) {\n\t\tnm = 'RSA-';\n\t\tnm += hashAlgo.toUpperCase();\n\t\tv = crypto.createSign(nm);\n\t}\n\tassert.ok(v, 'failed to create verifier');\n\tvar oldSign = v.sign.bind(v);\n\tvar key = this.toBuffer('pkcs1');\n\tvar type = this.type;\n\tvar curve = this.curve;\n\tv.sign = function () {\n\t\tvar sig = oldSign(key);\n\t\tif (typeof (sig) === 'string')\n\t\t\tsig = Buffer.from(sig, 'binary');\n\t\tsig = Signature.parse(sig, type, 'asn1');\n\t\tsig.hashAlgorithm = hashAlgo;\n\t\tsig.curve = curve;\n\t\treturn (sig);\n\t};\n\treturn (v);\n};\n\nPrivateKey.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\tassert.ok(k instanceof PrivateKey, 'key is not a private key');\n\t\tif (!k.comment)\n\t\t\tk.comment = options.filename;\n\t\treturn (k);\n\t} catch (e) {\n\t\tif (e.name === 'KeyEncryptedError')\n\t\t\tthrow (e);\n\t\tthrow (new KeyParseError(options.filename, format, e));\n\t}\n};\n\nPrivateKey.isPrivateKey = function (obj, ver) {\n\treturn (utils.isCompatible(obj, PrivateKey, ver));\n};\n\nPrivateKey.generate = function (type, options) {\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.object(options, 'options');\n\n\tswitch (type) {\n\tcase 'ecdsa':\n\t\tif (options.curve === undefined)\n\t\t\toptions.curve = 'nistp256';\n\t\tassert.string(options.curve, 'options.curve');\n\t\treturn (generateECDSA(options.curve));\n\tcase 'ed25519':\n\t\treturn (generateED25519());\n\tdefault:\n\t\tthrow (new Error('Key generation not supported with key ' +\n\t\t 'type \"' + type + '\"'));\n\t}\n};\n\n/*\n * API versions for PrivateKey:\n * [1,0] -- initial ver\n * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats\n * [1,2] -- added defaultHashAlgorithm\n * [1,3] -- added derive, ed, createDH\n * [1,4] -- first tagged version\n * [1,5] -- changed ed25519 part names and format\n * [1,6] -- type arguments for hash() and fingerprint()\n */\nPrivateKey.prototype._sshpkApiVersion = [1, 6];\n\nPrivateKey._oldVersionDetect = function (obj) {\n\tassert.func(obj.toPublic);\n\tassert.func(obj.createSign);\n\tif (obj.derive)\n\t\treturn ([1, 3]);\n\tif (obj.defaultHashAlgorithm)\n\t\treturn ([1, 2]);\n\tif (obj.formats['auto'])\n\t\treturn ([1, 1]);\n\treturn ([1, 0]);\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/private-key.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/signature.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/signature.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = Signature;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar errs = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/lib/errors.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/sshpk/lib/utils.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\nvar SSHBuffer = __webpack_require__(/*! ./ssh-buffer */ \"./node_modules/sshpk/lib/ssh-buffer.js\");\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar SignatureParseError = errs.SignatureParseError;\n\nfunction Signature(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.parts, 'options.parts');\n\tassert.string(opts.type, 'options.type');\n\n\tvar partLookup = {};\n\tfor (var i = 0; i < opts.parts.length; ++i) {\n\t\tvar part = opts.parts[i];\n\t\tpartLookup[part.name] = part;\n\t}\n\n\tthis.type = opts.type;\n\tthis.hashAlgorithm = opts.hashAlgo;\n\tthis.curve = opts.curve;\n\tthis.parts = opts.parts;\n\tthis.part = partLookup;\n}\n\nSignature.prototype.toBuffer = function (format) {\n\tif (format === undefined)\n\t\tformat = 'asn1';\n\tassert.string(format, 'format');\n\n\tvar buf;\n\tvar stype = 'ssh-' + this.type;\n\n\tswitch (this.type) {\n\tcase 'rsa':\n\t\tswitch (this.hashAlgorithm) {\n\t\tcase 'sha256':\n\t\t\tstype = 'rsa-sha2-256';\n\t\t\tbreak;\n\t\tcase 'sha512':\n\t\t\tstype = 'rsa-sha2-512';\n\t\t\tbreak;\n\t\tcase 'sha1':\n\t\tcase undefined:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('SSH signature ' +\n\t\t\t 'format does not support hash ' +\n\t\t\t 'algorithm ' + this.hashAlgorithm));\n\t\t}\n\t\tif (format === 'ssh') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString(stype);\n\t\t\tbuf.writePart(this.part.sig);\n\t\t\treturn (buf.toBuffer());\n\t\t} else {\n\t\t\treturn (this.part.sig.data);\n\t\t}\n\t\tbreak;\n\n\tcase 'ed25519':\n\t\tif (format === 'ssh') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString(stype);\n\t\t\tbuf.writePart(this.part.sig);\n\t\t\treturn (buf.toBuffer());\n\t\t} else {\n\t\t\treturn (this.part.sig.data);\n\t\t}\n\t\tbreak;\n\n\tcase 'dsa':\n\tcase 'ecdsa':\n\t\tvar r, s;\n\t\tif (format === 'asn1') {\n\t\t\tvar der = new asn1.BerWriter();\n\t\t\tder.startSequence();\n\t\t\tr = utils.mpNormalize(this.part.r.data);\n\t\t\ts = utils.mpNormalize(this.part.s.data);\n\t\t\tder.writeBuffer(r, asn1.Ber.Integer);\n\t\t\tder.writeBuffer(s, asn1.Ber.Integer);\n\t\t\tder.endSequence();\n\t\t\treturn (der.buffer);\n\t\t} else if (format === 'ssh' && this.type === 'dsa') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString('ssh-dss');\n\t\t\tr = this.part.r.data;\n\t\t\tif (r.length > 20 && r[0] === 0x00)\n\t\t\t\tr = r.slice(1);\n\t\t\ts = this.part.s.data;\n\t\t\tif (s.length > 20 && s[0] === 0x00)\n\t\t\t\ts = s.slice(1);\n\t\t\tif ((this.hashAlgorithm &&\n\t\t\t this.hashAlgorithm !== 'sha1') ||\n\t\t\t r.length + s.length !== 40) {\n\t\t\t\tthrow (new Error('OpenSSH only supports ' +\n\t\t\t\t 'DSA signatures with SHA1 hash'));\n\t\t\t}\n\t\t\tbuf.writeBuffer(Buffer.concat([r, s]));\n\t\t\treturn (buf.toBuffer());\n\t\t} else if (format === 'ssh' && this.type === 'ecdsa') {\n\t\t\tvar inner = new SSHBuffer({});\n\t\t\tr = this.part.r.data;\n\t\t\tinner.writeBuffer(r);\n\t\t\tinner.writePart(this.part.s);\n\n\t\t\tbuf = new SSHBuffer({});\n\t\t\t/* XXX: find a more proper way to do this? */\n\t\t\tvar curve;\n\t\t\tif (r[0] === 0x00)\n\t\t\t\tr = r.slice(1);\n\t\t\tvar sz = r.length * 8;\n\t\t\tif (sz === 256)\n\t\t\t\tcurve = 'nistp256';\n\t\t\telse if (sz === 384)\n\t\t\t\tcurve = 'nistp384';\n\t\t\telse if (sz === 528)\n\t\t\t\tcurve = 'nistp521';\n\t\t\tbuf.writeString('ecdsa-sha2-' + curve);\n\t\t\tbuf.writeBuffer(inner.toBuffer());\n\t\t\treturn (buf.toBuffer());\n\t\t}\n\t\tthrow (new Error('Invalid signature format'));\n\tdefault:\n\t\tthrow (new Error('Invalid signature data'));\n\t}\n};\n\nSignature.prototype.toString = function (format) {\n\tassert.optionalString(format, 'format');\n\treturn (this.toBuffer(format).toString('base64'));\n};\n\nSignature.parse = function (data, type, format) {\n\tif (typeof (data) === 'string')\n\t\tdata = Buffer.from(data, 'base64');\n\tassert.buffer(data, 'data');\n\tassert.string(format, 'format');\n\tassert.string(type, 'type');\n\n\tvar opts = {};\n\topts.type = type.toLowerCase();\n\topts.parts = [];\n\n\ttry {\n\t\tassert.ok(data.length > 0, 'signature must not be empty');\n\t\tswitch (opts.type) {\n\t\tcase 'rsa':\n\t\t\treturn (parseOneNum(data, type, format, opts));\n\t\tcase 'ed25519':\n\t\t\treturn (parseOneNum(data, type, format, opts));\n\n\t\tcase 'dsa':\n\t\tcase 'ecdsa':\n\t\t\tif (format === 'asn1')\n\t\t\t\treturn (parseDSAasn1(data, type, format, opts));\n\t\t\telse if (opts.type === 'dsa')\n\t\t\t\treturn (parseDSA(data, type, format, opts));\n\t\t\telse\n\t\t\t\treturn (parseECDSA(data, type, format, opts));\n\n\t\tdefault:\n\t\t\tthrow (new InvalidAlgorithmError(type));\n\t\t}\n\n\t} catch (e) {\n\t\tif (e instanceof InvalidAlgorithmError)\n\t\t\tthrow (e);\n\t\tthrow (new SignatureParseError(type, format, e));\n\t}\n};\n\nfunction parseOneNum(data, type, format, opts) {\n\tif (format === 'ssh') {\n\t\ttry {\n\t\t\tvar buf = new SSHBuffer({buffer: data});\n\t\t\tvar head = buf.readString();\n\t\t} catch (e) {\n\t\t\t/* fall through */\n\t\t}\n\t\tif (buf !== undefined) {\n\t\t\tvar msg = 'SSH signature does not match expected ' +\n\t\t\t 'type (expected ' + type + ', got ' + head + ')';\n\t\t\tswitch (head) {\n\t\t\tcase 'ssh-rsa':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha1';\n\t\t\t\tbreak;\n\t\t\tcase 'rsa-sha2-256':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha256';\n\t\t\t\tbreak;\n\t\t\tcase 'rsa-sha2-512':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha512';\n\t\t\t\tbreak;\n\t\t\tcase 'ssh-ed25519':\n\t\t\t\tassert.strictEqual(type, 'ed25519', msg);\n\t\t\t\topts.hashAlgo = 'sha512';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow (new Error('Unknown SSH signature ' +\n\t\t\t\t 'type: ' + head));\n\t\t\t}\n\t\t\tvar sig = buf.readPart();\n\t\t\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\t\t\tsig.name = 'sig';\n\t\t\topts.parts.push(sig);\n\t\t\treturn (new Signature(opts));\n\t\t}\n\t}\n\topts.parts.push({name: 'sig', data: data});\n\treturn (new Signature(opts));\n}\n\nfunction parseDSAasn1(data, type, format, opts) {\n\tvar der = new asn1.BerReader(data);\n\tder.readSequence();\n\tvar r = der.readString(asn1.Ber.Integer, true);\n\tvar s = der.readString(asn1.Ber.Integer, true);\n\n\topts.parts.push({name: 'r', data: utils.mpNormalize(r)});\n\topts.parts.push({name: 's', data: utils.mpNormalize(s)});\n\n\treturn (new Signature(opts));\n}\n\nfunction parseDSA(data, type, format, opts) {\n\tif (data.length != 40) {\n\t\tvar buf = new SSHBuffer({buffer: data});\n\t\tvar d = buf.readBuffer();\n\t\tif (d.toString('ascii') === 'ssh-dss')\n\t\t\td = buf.readBuffer();\n\t\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\t\tassert.strictEqual(d.length, 40, 'invalid inner length');\n\t\tdata = d;\n\t}\n\topts.parts.push({name: 'r', data: data.slice(0, 20)});\n\topts.parts.push({name: 's', data: data.slice(20, 40)});\n\treturn (new Signature(opts));\n}\n\nfunction parseECDSA(data, type, format, opts) {\n\tvar buf = new SSHBuffer({buffer: data});\n\n\tvar r, s;\n\tvar inner = buf.readBuffer();\n\tvar stype = inner.toString('ascii');\n\tif (stype.slice(0, 6) === 'ecdsa-') {\n\t\tvar parts = stype.split('-');\n\t\tassert.strictEqual(parts[0], 'ecdsa');\n\t\tassert.strictEqual(parts[1], 'sha2');\n\t\topts.curve = parts[2];\n\t\tswitch (opts.curve) {\n\t\tcase 'nistp256':\n\t\t\topts.hashAlgo = 'sha256';\n\t\t\tbreak;\n\t\tcase 'nistp384':\n\t\t\topts.hashAlgo = 'sha384';\n\t\t\tbreak;\n\t\tcase 'nistp521':\n\t\t\topts.hashAlgo = 'sha512';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('Unsupported ECDSA curve: ' +\n\t\t\t opts.curve));\n\t\t}\n\t\tinner = buf.readBuffer();\n\t\tassert.ok(buf.atEnd(), 'extra trailing bytes on outer');\n\t\tbuf = new SSHBuffer({buffer: inner});\n\t\tr = buf.readPart();\n\t} else {\n\t\tr = {data: inner};\n\t}\n\n\ts = buf.readPart();\n\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\n\tr.name = 'r';\n\ts.name = 's';\n\n\topts.parts.push(r);\n\topts.parts.push(s);\n\treturn (new Signature(opts));\n}\n\nSignature.isSignature = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Signature, ver));\n};\n\n/*\n * API versions for Signature:\n * [1,0] -- initial ver\n * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent\n * hashAlgorithm property\n * [2,1] -- first tagged version\n */\nSignature.prototype._sshpkApiVersion = [2, 1];\n\nSignature._oldVersionDetect = function (obj) {\n\tassert.func(obj.toBuffer);\n\tif (obj.hasOwnProperty('hashAlgorithm'))\n\t\treturn ([2, 0]);\n\treturn ([1, 0]);\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/signature.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/ssh-buffer.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/sshpk/lib/ssh-buffer.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = SSHBuffer;\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\n\nfunction SSHBuffer(opts) {\n\tassert.object(opts, 'options');\n\tif (opts.buffer !== undefined)\n\t\tassert.buffer(opts.buffer, 'options.buffer');\n\n\tthis._size = opts.buffer ? opts.buffer.length : 1024;\n\tthis._buffer = opts.buffer || Buffer.alloc(this._size);\n\tthis._offset = 0;\n}\n\nSSHBuffer.prototype.toBuffer = function () {\n\treturn (this._buffer.slice(0, this._offset));\n};\n\nSSHBuffer.prototype.atEnd = function () {\n\treturn (this._offset >= this._buffer.length);\n};\n\nSSHBuffer.prototype.remainder = function () {\n\treturn (this._buffer.slice(this._offset));\n};\n\nSSHBuffer.prototype.skip = function (n) {\n\tthis._offset += n;\n};\n\nSSHBuffer.prototype.expand = function () {\n\tthis._size *= 2;\n\tvar buf = Buffer.alloc(this._size);\n\tthis._buffer.copy(buf, 0);\n\tthis._buffer = buf;\n};\n\nSSHBuffer.prototype.readPart = function () {\n\treturn ({data: this.readBuffer()});\n};\n\nSSHBuffer.prototype.readBuffer = function () {\n\tvar len = this._buffer.readUInt32BE(this._offset);\n\tthis._offset += 4;\n\tassert.ok(this._offset + len <= this._buffer.length,\n\t 'length out of bounds at +0x' + this._offset.toString(16) +\n\t ' (data truncated?)');\n\tvar buf = this._buffer.slice(this._offset, this._offset + len);\n\tthis._offset += len;\n\treturn (buf);\n};\n\nSSHBuffer.prototype.readString = function () {\n\treturn (this.readBuffer().toString());\n};\n\nSSHBuffer.prototype.readCString = function () {\n\tvar offset = this._offset;\n\twhile (offset < this._buffer.length &&\n\t this._buffer[offset] !== 0x00)\n\t\toffset++;\n\tassert.ok(offset < this._buffer.length, 'c string does not terminate');\n\tvar str = this._buffer.slice(this._offset, offset).toString();\n\tthis._offset = offset + 1;\n\treturn (str);\n};\n\nSSHBuffer.prototype.readInt = function () {\n\tvar v = this._buffer.readUInt32BE(this._offset);\n\tthis._offset += 4;\n\treturn (v);\n};\n\nSSHBuffer.prototype.readInt64 = function () {\n\tassert.ok(this._offset + 8 < this._buffer.length,\n\t 'buffer not long enough to read Int64');\n\tvar v = this._buffer.slice(this._offset, this._offset + 8);\n\tthis._offset += 8;\n\treturn (v);\n};\n\nSSHBuffer.prototype.readChar = function () {\n\tvar v = this._buffer[this._offset++];\n\treturn (v);\n};\n\nSSHBuffer.prototype.writeBuffer = function (buf) {\n\twhile (this._offset + 4 + buf.length > this._size)\n\t\tthis.expand();\n\tthis._buffer.writeUInt32BE(buf.length, this._offset);\n\tthis._offset += 4;\n\tbuf.copy(this._buffer, this._offset);\n\tthis._offset += buf.length;\n};\n\nSSHBuffer.prototype.writeString = function (str) {\n\tthis.writeBuffer(Buffer.from(str, 'utf8'));\n};\n\nSSHBuffer.prototype.writeCString = function (str) {\n\twhile (this._offset + 1 + str.length > this._size)\n\t\tthis.expand();\n\tthis._buffer.write(str, this._offset);\n\tthis._offset += str.length;\n\tthis._buffer[this._offset++] = 0;\n};\n\nSSHBuffer.prototype.writeInt = function (v) {\n\twhile (this._offset + 4 > this._size)\n\t\tthis.expand();\n\tthis._buffer.writeUInt32BE(v, this._offset);\n\tthis._offset += 4;\n};\n\nSSHBuffer.prototype.writeInt64 = function (v) {\n\tassert.buffer(v, 'value');\n\tif (v.length > 8) {\n\t\tvar lead = v.slice(0, v.length - 8);\n\t\tfor (var i = 0; i < lead.length; ++i) {\n\t\t\tassert.strictEqual(lead[i], 0,\n\t\t\t 'must fit in 64 bits of precision');\n\t\t}\n\t\tv = v.slice(v.length - 8, v.length);\n\t}\n\twhile (this._offset + 8 > this._size)\n\t\tthis.expand();\n\tv.copy(this._buffer, this._offset);\n\tthis._offset += 8;\n};\n\nSSHBuffer.prototype.writeChar = function (v) {\n\twhile (this._offset + 1 > this._size)\n\t\tthis.expand();\n\tthis._buffer[this._offset++] = v;\n};\n\nSSHBuffer.prototype.writePart = function (p) {\n\tthis.writeBuffer(p.data);\n};\n\nSSHBuffer.prototype.write = function (buf) {\n\twhile (this._offset + buf.length > this._size)\n\t\tthis.expand();\n\tbuf.copy(this._buffer, this._offset);\n\tthis._offset += buf.length;\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/ssh-buffer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/lib/utils.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/sshpk/lib/utils.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tbufferSplit: bufferSplit,\n\taddRSAMissing: addRSAMissing,\n\tcalculateDSAPublic: calculateDSAPublic,\n\tcalculateED25519Public: calculateED25519Public,\n\tcalculateX25519Public: calculateX25519Public,\n\tmpNormalize: mpNormalize,\n\tmpDenormalize: mpDenormalize,\n\tecNormalize: ecNormalize,\n\tcountZeros: countZeros,\n\tassertCompatible: assertCompatible,\n\tisCompatible: isCompatible,\n\topensslKeyDeriv: opensslKeyDeriv,\n\topensshCipherInfo: opensshCipherInfo,\n\tpublicFromPrivateECDSA: publicFromPrivateECDSA,\n\tzeroPadToLength: zeroPadToLength,\n\twriteBitString: writeBitString,\n\treadBitString: readBitString,\n\tpbkdf2: pbkdf2\n};\n\nvar assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar PrivateKey = __webpack_require__(/*! ./private-key */ \"./node_modules/sshpk/lib/private-key.js\");\nvar Key = __webpack_require__(/*! ./key */ \"./node_modules/sshpk/lib/key.js\");\nvar crypto = __webpack_require__(/*! crypto */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar algs = __webpack_require__(/*! ./algs */ \"./node_modules/sshpk/lib/algs.js\");\nvar asn1 = __webpack_require__(/*! asn1 */ \"./node_modules/sshpk/node_modules/asn1/lib/index.js\");\n\nvar ec = __webpack_require__(/*! ecc-jsbn/lib/ec */ \"./node_modules/ecc-jsbn/lib/ec.js\");\nvar jsbn = __webpack_require__(/*! jsbn */ \"./node_modules/jsbn/index.js\").BigInteger;\nvar nacl = __webpack_require__(/*! tweetnacl */ \"./node_modules/tweetnacl/nacl-fast.js\");\n\nvar MAX_CLASS_DEPTH = 3;\n\nfunction isCompatible(obj, klass, needVer) {\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (false);\n\tif (needVer === undefined)\n\t\tneedVer = klass.prototype._sshpkApiVersion;\n\tif (obj instanceof klass &&\n\t klass.prototype._sshpkApiVersion[0] == needVer[0])\n\t\treturn (true);\n\tvar proto = Object.getPrototypeOf(obj);\n\tvar depth = 0;\n\twhile (proto.constructor.name !== klass.name) {\n\t\tproto = Object.getPrototypeOf(proto);\n\t\tif (!proto || ++depth > MAX_CLASS_DEPTH)\n\t\t\treturn (false);\n\t}\n\tif (proto.constructor.name !== klass.name)\n\t\treturn (false);\n\tvar ver = proto._sshpkApiVersion;\n\tif (ver === undefined)\n\t\tver = klass._oldVersionDetect(obj);\n\tif (ver[0] != needVer[0] || ver[1] < needVer[1])\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction assertCompatible(obj, klass, needVer, name) {\n\tif (name === undefined)\n\t\tname = 'object';\n\tassert.ok(obj, name + ' must not be null');\n\tassert.object(obj, name + ' must be an object');\n\tif (needVer === undefined)\n\t\tneedVer = klass.prototype._sshpkApiVersion;\n\tif (obj instanceof klass &&\n\t klass.prototype._sshpkApiVersion[0] == needVer[0])\n\t\treturn;\n\tvar proto = Object.getPrototypeOf(obj);\n\tvar depth = 0;\n\twhile (proto.constructor.name !== klass.name) {\n\t\tproto = Object.getPrototypeOf(proto);\n\t\tassert.ok(proto && ++depth <= MAX_CLASS_DEPTH,\n\t\t name + ' must be a ' + klass.name + ' instance');\n\t}\n\tassert.strictEqual(proto.constructor.name, klass.name,\n\t name + ' must be a ' + klass.name + ' instance');\n\tvar ver = proto._sshpkApiVersion;\n\tif (ver === undefined)\n\t\tver = klass._oldVersionDetect(obj);\n\tassert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1],\n\t name + ' must be compatible with ' + klass.name + ' klass ' +\n\t 'version ' + needVer[0] + '.' + needVer[1]);\n}\n\nvar CIPHER_LEN = {\n\t'des-ede3-cbc': { key: 24, iv: 8 },\n\t'aes-128-cbc': { key: 16, iv: 16 },\n\t'aes-256-cbc': { key: 32, iv: 16 }\n};\nvar PKCS5_SALT_LEN = 8;\n\nfunction opensslKeyDeriv(cipher, salt, passphrase, count) {\n\tassert.buffer(salt, 'salt');\n\tassert.buffer(passphrase, 'passphrase');\n\tassert.number(count, 'iteration count');\n\n\tvar clen = CIPHER_LEN[cipher];\n\tassert.object(clen, 'supported cipher');\n\n\tsalt = salt.slice(0, PKCS5_SALT_LEN);\n\n\tvar D, D_prev, bufs;\n\tvar material = Buffer.alloc(0);\n\twhile (material.length < clen.key + clen.iv) {\n\t\tbufs = [];\n\t\tif (D_prev)\n\t\t\tbufs.push(D_prev);\n\t\tbufs.push(passphrase);\n\t\tbufs.push(salt);\n\t\tD = Buffer.concat(bufs);\n\t\tfor (var j = 0; j < count; ++j)\n\t\t\tD = crypto.createHash('md5').update(D).digest();\n\t\tmaterial = Buffer.concat([material, D]);\n\t\tD_prev = D;\n\t}\n\n\treturn ({\n\t key: material.slice(0, clen.key),\n\t iv: material.slice(clen.key, clen.key + clen.iv)\n\t});\n}\n\n/* See: RFC2898 */\nfunction pbkdf2(hashAlg, salt, iterations, size, passphrase) {\n\tvar hkey = Buffer.alloc(salt.length + 4);\n\tsalt.copy(hkey);\n\n\tvar gen = 0, ts = [];\n\tvar i = 1;\n\twhile (gen < size) {\n\t\tvar t = T(i++);\n\t\tgen += t.length;\n\t\tts.push(t);\n\t}\n\treturn (Buffer.concat(ts).slice(0, size));\n\n\tfunction T(I) {\n\t\thkey.writeUInt32BE(I, hkey.length - 4);\n\n\t\tvar hmac = crypto.createHmac(hashAlg, passphrase);\n\t\thmac.update(hkey);\n\n\t\tvar Ti = hmac.digest();\n\t\tvar Uc = Ti;\n\t\tvar c = 1;\n\t\twhile (c++ < iterations) {\n\t\t\thmac = crypto.createHmac(hashAlg, passphrase);\n\t\t\thmac.update(Uc);\n\t\t\tUc = hmac.digest();\n\t\t\tfor (var x = 0; x < Ti.length; ++x)\n\t\t\t\tTi[x] ^= Uc[x];\n\t\t}\n\t\treturn (Ti);\n\t}\n}\n\n/* Count leading zero bits on a buffer */\nfunction countZeros(buf) {\n\tvar o = 0, obit = 8;\n\twhile (o < buf.length) {\n\t\tvar mask = (1 << obit);\n\t\tif ((buf[o] & mask) === mask)\n\t\t\tbreak;\n\t\tobit--;\n\t\tif (obit < 0) {\n\t\t\to++;\n\t\t\tobit = 8;\n\t\t}\n\t}\n\treturn (o*8 + (8 - obit) - 1);\n}\n\nfunction bufferSplit(buf, chr) {\n\tassert.buffer(buf);\n\tassert.string(chr);\n\n\tvar parts = [];\n\tvar lastPart = 0;\n\tvar matches = 0;\n\tfor (var i = 0; i < buf.length; ++i) {\n\t\tif (buf[i] === chr.charCodeAt(matches))\n\t\t\t++matches;\n\t\telse if (buf[i] === chr.charCodeAt(0))\n\t\t\tmatches = 1;\n\t\telse\n\t\t\tmatches = 0;\n\n\t\tif (matches >= chr.length) {\n\t\t\tvar newPart = i + 1;\n\t\t\tparts.push(buf.slice(lastPart, newPart - matches));\n\t\t\tlastPart = newPart;\n\t\t\tmatches = 0;\n\t\t}\n\t}\n\tif (lastPart <= buf.length)\n\t\tparts.push(buf.slice(lastPart, buf.length));\n\n\treturn (parts);\n}\n\nfunction ecNormalize(buf, addZero) {\n\tassert.buffer(buf);\n\tif (buf[0] === 0x00 && buf[1] === 0x04) {\n\t\tif (addZero)\n\t\t\treturn (buf);\n\t\treturn (buf.slice(1));\n\t} else if (buf[0] === 0x04) {\n\t\tif (!addZero)\n\t\t\treturn (buf);\n\t} else {\n\t\twhile (buf[0] === 0x00)\n\t\t\tbuf = buf.slice(1);\n\t\tif (buf[0] === 0x02 || buf[0] === 0x03)\n\t\t\tthrow (new Error('Compressed elliptic curve points ' +\n\t\t\t 'are not supported'));\n\t\tif (buf[0] !== 0x04)\n\t\t\tthrow (new Error('Not a valid elliptic curve point'));\n\t\tif (!addZero)\n\t\t\treturn (buf);\n\t}\n\tvar b = Buffer.alloc(buf.length + 1);\n\tb[0] = 0x0;\n\tbuf.copy(b, 1);\n\treturn (b);\n}\n\nfunction readBitString(der, tag) {\n\tif (tag === undefined)\n\t\ttag = asn1.Ber.BitString;\n\tvar buf = der.readString(tag, true);\n\tassert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' +\n\t 'not supported (0x' + buf[0].toString(16) + ')');\n\treturn (buf.slice(1));\n}\n\nfunction writeBitString(der, buf, tag) {\n\tif (tag === undefined)\n\t\ttag = asn1.Ber.BitString;\n\tvar b = Buffer.alloc(buf.length + 1);\n\tb[0] = 0x00;\n\tbuf.copy(b, 1);\n\tder.writeBuffer(b, tag);\n}\n\nfunction mpNormalize(buf) {\n\tassert.buffer(buf);\n\twhile (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00)\n\t\tbuf = buf.slice(1);\n\tif ((buf[0] & 0x80) === 0x80) {\n\t\tvar b = Buffer.alloc(buf.length + 1);\n\t\tb[0] = 0x00;\n\t\tbuf.copy(b, 1);\n\t\tbuf = b;\n\t}\n\treturn (buf);\n}\n\nfunction mpDenormalize(buf) {\n\tassert.buffer(buf);\n\twhile (buf.length > 1 && buf[0] === 0x00)\n\t\tbuf = buf.slice(1);\n\treturn (buf);\n}\n\nfunction zeroPadToLength(buf, len) {\n\tassert.buffer(buf);\n\tassert.number(len);\n\twhile (buf.length > len) {\n\t\tassert.equal(buf[0], 0x00);\n\t\tbuf = buf.slice(1);\n\t}\n\twhile (buf.length < len) {\n\t\tvar b = Buffer.alloc(buf.length + 1);\n\t\tb[0] = 0x00;\n\t\tbuf.copy(b, 1);\n\t\tbuf = b;\n\t}\n\treturn (buf);\n}\n\nfunction bigintToMpBuf(bigint) {\n\tvar buf = Buffer.from(bigint.toByteArray());\n\tbuf = mpNormalize(buf);\n\treturn (buf);\n}\n\nfunction calculateDSAPublic(g, p, x) {\n\tassert.buffer(g);\n\tassert.buffer(p);\n\tassert.buffer(x);\n\tg = new jsbn(g);\n\tp = new jsbn(p);\n\tx = new jsbn(x);\n\tvar y = g.modPow(x, p);\n\tvar ybuf = bigintToMpBuf(y);\n\treturn (ybuf);\n}\n\nfunction calculateED25519Public(k) {\n\tassert.buffer(k);\n\n\tvar kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));\n\treturn (Buffer.from(kp.publicKey));\n}\n\nfunction calculateX25519Public(k) {\n\tassert.buffer(k);\n\n\tvar kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));\n\treturn (Buffer.from(kp.publicKey));\n}\n\nfunction addRSAMissing(key) {\n\tassert.object(key);\n\tassertCompatible(key, PrivateKey, [1, 1]);\n\n\tvar d = new jsbn(key.part.d.data);\n\tvar buf;\n\n\tif (!key.part.dmodp) {\n\t\tvar p = new jsbn(key.part.p.data);\n\t\tvar dmodp = d.mod(p.subtract(1));\n\n\t\tbuf = bigintToMpBuf(dmodp);\n\t\tkey.part.dmodp = {name: 'dmodp', data: buf};\n\t\tkey.parts.push(key.part.dmodp);\n\t}\n\tif (!key.part.dmodq) {\n\t\tvar q = new jsbn(key.part.q.data);\n\t\tvar dmodq = d.mod(q.subtract(1));\n\n\t\tbuf = bigintToMpBuf(dmodq);\n\t\tkey.part.dmodq = {name: 'dmodq', data: buf};\n\t\tkey.parts.push(key.part.dmodq);\n\t}\n}\n\nfunction publicFromPrivateECDSA(curveName, priv) {\n\tassert.string(curveName, 'curveName');\n\tassert.buffer(priv);\n\tvar params = algs.curves[curveName];\n\tvar p = new jsbn(params.p);\n\tvar a = new jsbn(params.a);\n\tvar b = new jsbn(params.b);\n\tvar curve = new ec.ECCurveFp(p, a, b);\n\tvar G = curve.decodePointHex(params.G.toString('hex'));\n\n\tvar d = new jsbn(mpNormalize(priv));\n\tvar pub = G.multiply(d);\n\tpub = Buffer.from(curve.encodePointHex(pub), 'hex');\n\n\tvar parts = [];\n\tparts.push({name: 'curve', data: Buffer.from(curveName)});\n\tparts.push({name: 'Q', data: pub});\n\n\tvar key = new Key({type: 'ecdsa', curve: curve, parts: parts});\n\treturn (key);\n}\n\nfunction opensshCipherInfo(cipher) {\n\tvar inf = {};\n\tswitch (cipher) {\n\tcase '3des-cbc':\n\t\tinf.keySize = 24;\n\t\tinf.blockSize = 8;\n\t\tinf.opensslName = 'des-ede3-cbc';\n\t\tbreak;\n\tcase 'blowfish-cbc':\n\t\tinf.keySize = 16;\n\t\tinf.blockSize = 8;\n\t\tinf.opensslName = 'bf-cbc';\n\t\tbreak;\n\tcase 'aes128-cbc':\n\tcase 'aes128-ctr':\n\tcase 'aes128-gcm@openssh.com':\n\t\tinf.keySize = 16;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-128-' + cipher.slice(7, 10);\n\t\tbreak;\n\tcase 'aes192-cbc':\n\tcase 'aes192-ctr':\n\tcase 'aes192-gcm@openssh.com':\n\t\tinf.keySize = 24;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-192-' + cipher.slice(7, 10);\n\t\tbreak;\n\tcase 'aes256-cbc':\n\tcase 'aes256-ctr':\n\tcase 'aes256-gcm@openssh.com':\n\t\tinf.keySize = 32;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-256-' + cipher.slice(7, 10);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error(\n\t\t 'Unsupported openssl cipher \"' + cipher + '\"'));\n\t}\n\treturn (inf);\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/lib/utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/node_modules/asn1/lib/ber/errors.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/sshpk/node_modules/asn1/lib/ber/errors.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.\n\n\nmodule.exports = {\n\n newInvalidAsn1Error: function (msg) {\n var e = new Error();\n e.name = 'InvalidAsn1Error';\n e.message = msg || '';\n return e;\n }\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/node_modules/asn1/lib/ber/errors.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/node_modules/asn1/lib/ber/index.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/sshpk/node_modules/asn1/lib/ber/index.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.\n\nvar errors = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/errors.js\");\nvar types = __webpack_require__(/*! ./types */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/types.js\");\n\nvar Reader = __webpack_require__(/*! ./reader */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/reader.js\");\nvar Writer = __webpack_require__(/*! ./writer */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/writer.js\");\n\n\n// --- Exports\n\nmodule.exports = {\n\n Reader: Reader,\n\n Writer: Writer\n\n};\n\nfor (var t in types) {\n if (types.hasOwnProperty(t))\n module.exports[t] = types[t];\n}\nfor (var e in errors) {\n if (errors.hasOwnProperty(e))\n module.exports[e] = errors[e];\n}\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/node_modules/asn1/lib/ber/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/node_modules/asn1/lib/ber/reader.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/sshpk/node_modules/asn1/lib/ber/reader.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.\n\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\n\nvar ASN1 = __webpack_require__(/*! ./types */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/types.js\");\nvar errors = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/errors.js\");\n\n\n// --- Globals\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\n\n\n\n// --- API\n\nfunction Reader(data) {\n if (!data || !Buffer.isBuffer(data))\n throw new TypeError('data must be a node Buffer');\n\n this._buf = data;\n this._size = data.length;\n\n // These hold the \"current\" state\n this._len = 0;\n this._offset = 0;\n}\n\nObject.defineProperty(Reader.prototype, 'length', {\n enumerable: true,\n get: function () { return (this._len); }\n});\n\nObject.defineProperty(Reader.prototype, 'offset', {\n enumerable: true,\n get: function () { return (this._offset); }\n});\n\nObject.defineProperty(Reader.prototype, 'remain', {\n get: function () { return (this._size - this._offset); }\n});\n\nObject.defineProperty(Reader.prototype, 'buffer', {\n get: function () { return (this._buf.slice(this._offset)); }\n});\n\n\n/**\n * Reads a single byte and advances offset; you can pass in `true` to make this\n * a \"peek\" operation (i.e., get the byte, but don't advance the offset).\n *\n * @param {Boolean} peek true means don't move offset.\n * @return {Number} the next byte, null if not enough data.\n */\nReader.prototype.readByte = function (peek) {\n if (this._size - this._offset < 1)\n return null;\n\n var b = this._buf[this._offset] & 0xff;\n\n if (!peek)\n this._offset += 1;\n\n return b;\n};\n\n\nReader.prototype.peek = function () {\n return this.readByte(true);\n};\n\n\n/**\n * Reads a (potentially) variable length off the BER buffer. This call is\n * not really meant to be called directly, as callers have to manipulate\n * the internal buffer afterwards.\n *\n * As a result of this call, you can call `Reader.length`, until the\n * next thing called that does a readLength.\n *\n * @return {Number} the amount of offset to advance the buffer.\n * @throws {InvalidAsn1Error} on bad ASN.1\n */\nReader.prototype.readLength = function (offset) {\n if (offset === undefined)\n offset = this._offset;\n\n if (offset >= this._size)\n return null;\n\n var lenB = this._buf[offset++] & 0xff;\n if (lenB === null)\n return null;\n\n if ((lenB & 0x80) === 0x80) {\n lenB &= 0x7f;\n\n if (lenB === 0)\n throw newInvalidAsn1Error('Indefinite length not supported');\n\n if (lenB > 4)\n throw newInvalidAsn1Error('encoding too long');\n\n if (this._size - offset < lenB)\n return null;\n\n this._len = 0;\n for (var i = 0; i < lenB; i++)\n this._len = (this._len << 8) + (this._buf[offset++] & 0xff);\n\n } else {\n // Wasn't a variable length\n this._len = lenB;\n }\n\n return offset;\n};\n\n\n/**\n * Parses the next sequence in this BER buffer.\n *\n * To get the length of the sequence, call `Reader.length`.\n *\n * @return {Number} the sequence's tag.\n */\nReader.prototype.readSequence = function (tag) {\n var seq = this.peek();\n if (seq === null)\n return null;\n if (tag !== undefined && tag !== seq)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + seq.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n if (o === null)\n return null;\n\n this._offset = o;\n return seq;\n};\n\n\nReader.prototype.readInt = function () {\n return this._readTag(ASN1.Integer);\n};\n\n\nReader.prototype.readBoolean = function () {\n return (this._readTag(ASN1.Boolean) === 0 ? false : true);\n};\n\n\nReader.prototype.readEnumeration = function () {\n return this._readTag(ASN1.Enumeration);\n};\n\n\nReader.prototype.readString = function (tag, retbuf) {\n if (!tag)\n tag = ASN1.OctetString;\n\n var b = this.peek();\n if (b === null)\n return null;\n\n if (b !== tag)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + b.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n\n if (o === null)\n return null;\n\n if (this.length > this._size - o)\n return null;\n\n this._offset = o;\n\n if (this.length === 0)\n return retbuf ? Buffer.alloc(0) : '';\n\n var str = this._buf.slice(this._offset, this._offset + this.length);\n this._offset += this.length;\n\n return retbuf ? str : str.toString('utf8');\n};\n\nReader.prototype.readOID = function (tag) {\n if (!tag)\n tag = ASN1.OID;\n\n var b = this.readString(tag, true);\n if (b === null)\n return null;\n\n var values = [];\n var value = 0;\n\n for (var i = 0; i < b.length; i++) {\n var byte = b[i] & 0xff;\n\n value <<= 7;\n value += byte & 0x7f;\n if ((byte & 0x80) === 0) {\n values.push(value);\n value = 0;\n }\n }\n\n value = values.shift();\n values.unshift(value % 40);\n values.unshift((value / 40) >> 0);\n\n return values.join('.');\n};\n\n\nReader.prototype._readTag = function (tag) {\n assert.ok(tag !== undefined);\n\n var b = this.peek();\n\n if (b === null)\n return null;\n\n if (b !== tag)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + b.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n if (o === null)\n return null;\n\n if (this.length > 4)\n throw newInvalidAsn1Error('Integer too long: ' + this.length);\n\n if (this.length > this._size - o)\n return null;\n this._offset = o;\n\n var fb = this._buf[this._offset];\n var value = 0;\n\n for (var i = 0; i < this.length; i++) {\n value <<= 8;\n value |= (this._buf[this._offset++] & 0xff);\n }\n\n if ((fb & 0x80) === 0x80 && i !== 4)\n value -= (1 << (i * 8));\n\n return value >> 0;\n};\n\n\n\n// --- Exported API\n\nmodule.exports = Reader;\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/node_modules/asn1/lib/ber/reader.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/node_modules/asn1/lib/ber/types.js":
|
||
/*!***************************************************************!*\
|
||
!*** ./node_modules/sshpk/node_modules/asn1/lib/ber/types.js ***!
|
||
\***************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.\n\n\nmodule.exports = {\n EOC: 0,\n Boolean: 1,\n Integer: 2,\n BitString: 3,\n OctetString: 4,\n Null: 5,\n OID: 6,\n ObjectDescriptor: 7,\n External: 8,\n Real: 9, // float\n Enumeration: 10,\n PDV: 11,\n Utf8String: 12,\n RelativeOID: 13,\n Sequence: 16,\n Set: 17,\n NumericString: 18,\n PrintableString: 19,\n T61String: 20,\n VideotexString: 21,\n IA5String: 22,\n UTCTime: 23,\n GeneralizedTime: 24,\n GraphicString: 25,\n VisibleString: 26,\n GeneralString: 28,\n UniversalString: 29,\n CharacterString: 30,\n BMPString: 31,\n Constructor: 32,\n Context: 128\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/node_modules/asn1/lib/ber/types.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/node_modules/asn1/lib/ber/writer.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/sshpk/node_modules/asn1/lib/ber/writer.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.\n\nvar assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\nvar Buffer = __webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer;\nvar ASN1 = __webpack_require__(/*! ./types */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/types.js\");\nvar errors = __webpack_require__(/*! ./errors */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/errors.js\");\n\n\n// --- Globals\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\n\nvar DEFAULT_OPTS = {\n size: 1024,\n growthFactor: 8\n};\n\n\n// --- Helpers\n\nfunction merge(from, to) {\n assert.ok(from);\n assert.equal(typeof (from), 'object');\n assert.ok(to);\n assert.equal(typeof (to), 'object');\n\n var keys = Object.getOwnPropertyNames(from);\n keys.forEach(function (key) {\n if (to[key])\n return;\n\n var value = Object.getOwnPropertyDescriptor(from, key);\n Object.defineProperty(to, key, value);\n });\n\n return to;\n}\n\n\n\n// --- API\n\nfunction Writer(options) {\n options = merge(DEFAULT_OPTS, options || {});\n\n this._buf = Buffer.alloc(options.size || 1024);\n this._size = this._buf.length;\n this._offset = 0;\n this._options = options;\n\n // A list of offsets in the buffer where we need to insert\n // sequence tag/len pairs.\n this._seq = [];\n}\n\nObject.defineProperty(Writer.prototype, 'buffer', {\n get: function () {\n if (this._seq.length)\n throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');\n\n return (this._buf.slice(0, this._offset));\n }\n});\n\nWriter.prototype.writeByte = function (b) {\n if (typeof (b) !== 'number')\n throw new TypeError('argument must be a Number');\n\n this._ensure(1);\n this._buf[this._offset++] = b;\n};\n\n\nWriter.prototype.writeInt = function (i, tag) {\n if (typeof (i) !== 'number')\n throw new TypeError('argument must be a Number');\n if (typeof (tag) !== 'number')\n tag = ASN1.Integer;\n\n var sz = 4;\n\n while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) &&\n (sz > 1)) {\n sz--;\n i <<= 8;\n }\n\n if (sz > 4)\n throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');\n\n this._ensure(2 + sz);\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = sz;\n\n while (sz-- > 0) {\n this._buf[this._offset++] = ((i & 0xff000000) >>> 24);\n i <<= 8;\n }\n\n};\n\n\nWriter.prototype.writeNull = function () {\n this.writeByte(ASN1.Null);\n this.writeByte(0x00);\n};\n\n\nWriter.prototype.writeEnumeration = function (i, tag) {\n if (typeof (i) !== 'number')\n throw new TypeError('argument must be a Number');\n if (typeof (tag) !== 'number')\n tag = ASN1.Enumeration;\n\n return this.writeInt(i, tag);\n};\n\n\nWriter.prototype.writeBoolean = function (b, tag) {\n if (typeof (b) !== 'boolean')\n throw new TypeError('argument must be a Boolean');\n if (typeof (tag) !== 'number')\n tag = ASN1.Boolean;\n\n this._ensure(3);\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = 0x01;\n this._buf[this._offset++] = b ? 0xff : 0x00;\n};\n\n\nWriter.prototype.writeString = function (s, tag) {\n if (typeof (s) !== 'string')\n throw new TypeError('argument must be a string (was: ' + typeof (s) + ')');\n if (typeof (tag) !== 'number')\n tag = ASN1.OctetString;\n\n var len = Buffer.byteLength(s);\n this.writeByte(tag);\n this.writeLength(len);\n if (len) {\n this._ensure(len);\n this._buf.write(s, this._offset);\n this._offset += len;\n }\n};\n\n\nWriter.prototype.writeBuffer = function (buf, tag) {\n if (typeof (tag) !== 'number')\n throw new TypeError('tag must be a number');\n if (!Buffer.isBuffer(buf))\n throw new TypeError('argument must be a buffer');\n\n this.writeByte(tag);\n this.writeLength(buf.length);\n this._ensure(buf.length);\n buf.copy(this._buf, this._offset, 0, buf.length);\n this._offset += buf.length;\n};\n\n\nWriter.prototype.writeStringArray = function (strings) {\n if ((!strings instanceof Array))\n throw new TypeError('argument must be an Array[String]');\n\n var self = this;\n strings.forEach(function (s) {\n self.writeString(s);\n });\n};\n\n// This is really to solve DER cases, but whatever for now\nWriter.prototype.writeOID = function (s, tag) {\n if (typeof (s) !== 'string')\n throw new TypeError('argument must be a string');\n if (typeof (tag) !== 'number')\n tag = ASN1.OID;\n\n if (!/^([0-9]+\\.){3,}[0-9]+$/.test(s))\n throw new Error('argument is not a valid OID string');\n\n function encodeOctet(bytes, octet) {\n if (octet < 128) {\n bytes.push(octet);\n } else if (octet < 16384) {\n bytes.push((octet >>> 7) | 0x80);\n bytes.push(octet & 0x7F);\n } else if (octet < 2097152) {\n bytes.push((octet >>> 14) | 0x80);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else if (octet < 268435456) {\n bytes.push((octet >>> 21) | 0x80);\n bytes.push(((octet >>> 14) | 0x80) & 0xFF);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else {\n bytes.push(((octet >>> 28) | 0x80) & 0xFF);\n bytes.push(((octet >>> 21) | 0x80) & 0xFF);\n bytes.push(((octet >>> 14) | 0x80) & 0xFF);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n }\n }\n\n var tmp = s.split('.');\n var bytes = [];\n bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));\n tmp.slice(2).forEach(function (b) {\n encodeOctet(bytes, parseInt(b, 10));\n });\n\n var self = this;\n this._ensure(2 + bytes.length);\n this.writeByte(tag);\n this.writeLength(bytes.length);\n bytes.forEach(function (b) {\n self.writeByte(b);\n });\n};\n\n\nWriter.prototype.writeLength = function (len) {\n if (typeof (len) !== 'number')\n throw new TypeError('argument must be a Number');\n\n this._ensure(4);\n\n if (len <= 0x7f) {\n this._buf[this._offset++] = len;\n } else if (len <= 0xff) {\n this._buf[this._offset++] = 0x81;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffff) {\n this._buf[this._offset++] = 0x82;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffffff) {\n this._buf[this._offset++] = 0x83;\n this._buf[this._offset++] = len >> 16;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else {\n throw newInvalidAsn1Error('Length too long (> 4 bytes)');\n }\n};\n\nWriter.prototype.startSequence = function (tag) {\n if (typeof (tag) !== 'number')\n tag = ASN1.Sequence | ASN1.Constructor;\n\n this.writeByte(tag);\n this._seq.push(this._offset);\n this._ensure(3);\n this._offset += 3;\n};\n\n\nWriter.prototype.endSequence = function () {\n var seq = this._seq.pop();\n var start = seq + 3;\n var len = this._offset - start;\n\n if (len <= 0x7f) {\n this._shift(start, len, -2);\n this._buf[seq] = len;\n } else if (len <= 0xff) {\n this._shift(start, len, -1);\n this._buf[seq] = 0x81;\n this._buf[seq + 1] = len;\n } else if (len <= 0xffff) {\n this._buf[seq] = 0x82;\n this._buf[seq + 1] = len >> 8;\n this._buf[seq + 2] = len;\n } else if (len <= 0xffffff) {\n this._shift(start, len, 1);\n this._buf[seq] = 0x83;\n this._buf[seq + 1] = len >> 16;\n this._buf[seq + 2] = len >> 8;\n this._buf[seq + 3] = len;\n } else {\n throw newInvalidAsn1Error('Sequence too long');\n }\n};\n\n\nWriter.prototype._shift = function (start, len, shift) {\n assert.ok(start !== undefined);\n assert.ok(len !== undefined);\n assert.ok(shift);\n\n this._buf.copy(this._buf, start + shift, start, start + len);\n this._offset += shift;\n};\n\nWriter.prototype._ensure = function (len) {\n assert.ok(len);\n\n if (this._size - this._offset < len) {\n var sz = this._size * this._options.growthFactor;\n if (sz - this._offset < len)\n sz += len;\n\n var buf = Buffer.alloc(sz);\n\n this._buf.copy(buf, 0, 0, this._offset);\n this._buf = buf;\n this._size = sz;\n }\n};\n\n\n\n// --- Exported API\n\nmodule.exports = Writer;\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/node_modules/asn1/lib/ber/writer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/sshpk/node_modules/asn1/lib/index.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/sshpk/node_modules/asn1/lib/index.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.\n\n// If you have no idea what ASN.1 or BER is, see this:\n// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nvar Ber = __webpack_require__(/*! ./ber/index */ \"./node_modules/sshpk/node_modules/asn1/lib/ber/index.js\");\n\n\n\n// --- Exported API\n\nmodule.exports = {\n\n Ber: Ber,\n\n BerReader: Ber.Reader,\n\n BerWriter: Ber.Writer\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/sshpk/node_modules/asn1/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stable/stable.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/stable/stable.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("//! stable.js 0.1.8, https://github.com/Two-Screen/stable\n//! © 2018 Angry Bytes and contributors. MIT licensed.\n\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n}(this, (function () { 'use strict';\n\n // A stable array sort, because `Array#sort()` is not guaranteed stable.\n // This is an implementation of merge sort, without recursion.\n\n var stable = function (arr, comp) {\n return exec(arr.slice(), comp)\n };\n\n stable.inplace = function (arr, comp) {\n var result = exec(arr, comp);\n\n // This simply copies back if the result isn't in the original array,\n // which happens on an odd number of passes.\n if (result !== arr) {\n pass(result, null, arr.length, arr);\n }\n\n return arr\n };\n\n // Execute the sort using the input array and a second buffer as work space.\n // Returns one of those two, containing the final result.\n function exec(arr, comp) {\n if (typeof(comp) !== 'function') {\n comp = function (a, b) {\n return String(a).localeCompare(b)\n };\n }\n\n // Short-circuit when there's nothing to sort.\n var len = arr.length;\n if (len <= 1) {\n return arr\n }\n\n // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc.\n // Chunks are the size of the left or right hand in merge sort.\n // Stop when the left-hand covers all of the array.\n var buffer = new Array(len);\n for (var chk = 1; chk < len; chk *= 2) {\n pass(arr, comp, chk, buffer);\n\n var tmp = arr;\n arr = buffer;\n buffer = tmp;\n }\n\n return arr\n }\n\n // Run a single pass with the given chunk size.\n var pass = function (arr, comp, chk, result) {\n var len = arr.length;\n var i = 0;\n // Step size / double chunk size.\n var dbl = chk * 2;\n // Bounds of the left and right chunks.\n var l, r, e;\n // Iterators over the left and right chunk.\n var li, ri;\n\n // Iterate over pairs of chunks.\n for (l = 0; l < len; l += dbl) {\n r = l + chk;\n e = r + chk;\n if (r > len) r = len;\n if (e > len) e = len;\n\n // Iterate both chunks in parallel.\n li = l;\n ri = r;\n while (true) {\n // Compare the chunks.\n if (li < r && ri < e) {\n // This works for a regular `sort()` compatible comparator,\n // but also for a simple comparator like: `a > b`\n if (comp(arr[li], arr[ri]) <= 0) {\n result[i++] = arr[li++];\n }\n else {\n result[i++] = arr[ri++];\n }\n }\n // Nothing to compare, just flush what's left.\n else if (li < r) {\n result[i++] = arr[li++];\n }\n else if (ri < e) {\n result[i++] = arr[ri++];\n }\n // Both iterators are at the chunk ends.\n else {\n break\n }\n }\n }\n };\n\n return stable;\n\n})));\n\n\n//# sourceURL=webpack:///./node_modules/stable/stable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stealthy-require/lib/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/stealthy-require/lib/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nvar isNative = /\\.node$/;\n\nfunction forEach(obj, callback) {\n for ( var key in obj ) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n continue;\n }\n callback(key);\n }\n}\n\nfunction assign(target, source) {\n forEach(source, function (key) {\n target[key] = source[key];\n });\n return target;\n}\n\nfunction clearCache(requireCache) {\n forEach(requireCache, function (resolvedPath) {\n if (!isNative.test(resolvedPath)) {\n delete requireCache[resolvedPath];\n }\n });\n}\n\nmodule.exports = function (requireCache, callback, callbackForModulesToKeep, module) {\n\n var originalCache = assign({}, requireCache);\n clearCache(requireCache);\n\n if (callbackForModulesToKeep) {\n\n var originalModuleChildren = module.children ? module.children.slice() : false; // Creates a shallow copy of module.children\n\n callbackForModulesToKeep();\n\n // Lists the cache entries made by callbackForModulesToKeep()\n var modulesToKeep = [];\n forEach(requireCache, function (key) {\n modulesToKeep.push(key);\n });\n\n // Discards the modules required in callbackForModulesToKeep()\n clearCache(requireCache);\n\n if (module.children) { // Only true for node.js\n module.children = originalModuleChildren; // Removes last references to modules required in callbackForModulesToKeep() -> No memory leak\n }\n\n // Takes the cache entries of the original cache in case the modules where required before\n for ( var i = 0; i < modulesToKeep.length; i+=1 ) {\n if (originalCache[modulesToKeep[i]]) {\n requireCache[modulesToKeep[i]] = originalCache[modulesToKeep[i]];\n }\n }\n\n }\n\n var freshModule = callback();\n\n var stealthCache = callbackForModulesToKeep ? assign({}, requireCache) : false;\n\n clearCache(requireCache);\n\n if (callbackForModulesToKeep) {\n // In case modules to keep were required inside the stealthy require for the first time, copy them to the restored cache\n for ( var k = 0; k < modulesToKeep.length; k+=1 ) {\n if (stealthCache[modulesToKeep[k]]) {\n requireCache[modulesToKeep[k]] = stealthCache[modulesToKeep[k]];\n }\n }\n }\n\n assign(requireCache, originalCache);\n\n return freshModule;\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/stealthy-require/lib/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/index.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/stream-browserify/index.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\ninherits(Stream, EE);\nStream.Readable = __webpack_require__(/*! readable-stream/readable.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js\");\nStream.Writable = __webpack_require__(/*! readable-stream/writable.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/writable-browser.js\");\nStream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/duplex-browser.js\");\nStream.Transform = __webpack_require__(/*! readable-stream/transform.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/transform.js\");\nStream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/passthrough.js\");\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/duplex-browser.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/duplex-browser.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/duplex-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!*******************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\*******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!************************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!*********************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\*********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 6);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!**********************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\**********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!*********************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\*********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!********************************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\********************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 7);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!*****************************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\*****************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!************************************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\************************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/passthrough.js":
|
||
/*!************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/passthrough.js ***!
|
||
\************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! ./readable */ \"./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js\").PassThrough\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js ***!
|
||
\*****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/transform.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/transform.js ***!
|
||
\**********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! ./readable */ \"./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js\").Transform\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-browserify/node_modules/readable-stream/writable-browser.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/stream-browserify/node_modules/readable-stream/writable-browser.js ***!
|
||
\*****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js\");\n\n\n//# sourceURL=webpack:///./node_modules/stream-browserify/node_modules/readable-stream/writable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/stream-http/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {var ClientRequest = __webpack_require__(/*! ./lib/request */ \"./node_modules/stream-http/lib/request.js\")\nvar response = __webpack_require__(/*! ./lib/response */ \"./node_modules/stream-http/lib/response.js\")\nvar extend = __webpack_require__(/*! xtend */ \"./node_modules/xtend/immutable.js\")\nvar statusCodes = __webpack_require__(/*! builtin-status-codes */ \"./node_modules/builtin-status-codes/browser.js\")\nvar url = __webpack_require__(/*! url */ \"./node_modules/url/url.js\")\n\nvar http = exports\n\nhttp.request = function (opts, cb) {\n\tif (typeof opts === 'string')\n\t\topts = url.parse(opts)\n\telse\n\t\topts = extend(opts)\n\n\t// Normally, the page is loaded from http or https, so not specifying a protocol\n\t// will result in a (valid) protocol-relative url. However, this won't work if\n\t// the protocol is something else, like 'file:'\n\tvar defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : ''\n\n\tvar protocol = opts.protocol || defaultProtocol\n\tvar host = opts.hostname || opts.host\n\tvar port = opts.port\n\tvar path = opts.path || '/'\n\n\t// Necessary for IPv6 addresses\n\tif (host && host.indexOf(':') !== -1)\n\t\thost = '[' + host + ']'\n\n\t// This may be a relative url. The browser should always be able to interpret it correctly.\n\topts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path\n\topts.method = (opts.method || 'GET').toUpperCase()\n\topts.headers = opts.headers || {}\n\n\t// Also valid opts.auth, opts.mode\n\n\tvar req = new ClientRequest(opts)\n\tif (cb)\n\t\treq.on('response', cb)\n\treturn req\n}\n\nhttp.get = function get (opts, cb) {\n\tvar req = http.request(opts, cb)\n\treq.end()\n\treturn req\n}\n\nhttp.ClientRequest = ClientRequest\nhttp.IncomingMessage = response.IncomingMessage\n\nhttp.Agent = function () {}\nhttp.Agent.defaultMaxSockets = 4\n\nhttp.globalAgent = new http.Agent()\n\nhttp.STATUS_CODES = statusCodes\n\nhttp.METHODS = [\n\t'CHECKOUT',\n\t'CONNECT',\n\t'COPY',\n\t'DELETE',\n\t'GET',\n\t'HEAD',\n\t'LOCK',\n\t'M-SEARCH',\n\t'MERGE',\n\t'MKACTIVITY',\n\t'MKCOL',\n\t'MOVE',\n\t'NOTIFY',\n\t'OPTIONS',\n\t'PATCH',\n\t'POST',\n\t'PROPFIND',\n\t'PROPPATCH',\n\t'PURGE',\n\t'PUT',\n\t'REPORT',\n\t'SEARCH',\n\t'SUBSCRIBE',\n\t'TRACE',\n\t'UNLOCK',\n\t'UNSUBSCRIBE'\n]\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-http/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/lib/capability.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/stream-http/lib/capability.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream)\n\nexports.writableStream = isFunction(global.WritableStream)\n\nexports.abortController = isFunction(global.AbortController)\n\nexports.blobConstructor = false\ntry {\n\tnew Blob([new ArrayBuffer(1)])\n\texports.blobConstructor = true\n} catch (e) {}\n\n// The xhr request to example.com may violate some restrictive CSP configurations,\n// so if we're running in a browser that supports `fetch`, avoid calling getXHR()\n// and assume support for certain features below.\nvar xhr\nfunction getXHR () {\n\t// Cache the xhr value\n\tif (xhr !== undefined) return xhr\n\n\tif (global.XMLHttpRequest) {\n\t\txhr = new global.XMLHttpRequest()\n\t\t// If XDomainRequest is available (ie only, where xhr might not work\n\t\t// cross domain), use the page location. Otherwise use example.com\n\t\t// Note: this doesn't actually make an http request.\n\t\ttry {\n\t\t\txhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com')\n\t\t} catch(e) {\n\t\t\txhr = null\n\t\t}\n\t} else {\n\t\t// Service workers don't have XHR\n\t\txhr = null\n\t}\n\treturn xhr\n}\n\nfunction checkTypeSupport (type) {\n\tvar xhr = getXHR()\n\tif (!xhr) return false\n\ttry {\n\t\txhr.responseType = type\n\t\treturn xhr.responseType === type\n\t} catch (e) {}\n\treturn false\n}\n\n// For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'.\n// Safari 7.1 appears to have fixed this bug.\nvar haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined'\nvar haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice)\n\n// If fetch is supported, then arraybuffer will be supported too. Skip calling\n// checkTypeSupport(), since that calls getXHR().\nexports.arraybuffer = exports.fetch || (haveArrayBuffer && checkTypeSupport('arraybuffer'))\n\n// These next two tests unavoidably show warnings in Chrome. Since fetch will always\n// be used if it's available, just return false for these to avoid the warnings.\nexports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream')\nexports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer &&\n\tcheckTypeSupport('moz-chunked-arraybuffer')\n\n// If fetch is supported, then overrideMimeType will be supported too. Skip calling\n// getXHR().\nexports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false)\n\nexports.vbArray = isFunction(global.VBArray)\n\nfunction isFunction (value) {\n\treturn typeof value === 'function'\n}\n\nxhr = null // Help gc\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-http/lib/capability.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/lib/request.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/stream-http/lib/request.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, global, process) {var capability = __webpack_require__(/*! ./capability */ \"./node_modules/stream-http/lib/capability.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar response = __webpack_require__(/*! ./response */ \"./node_modules/stream-http/lib/response.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/stream-http/node_modules/readable-stream/readable-browser.js\")\nvar toArrayBuffer = __webpack_require__(/*! to-arraybuffer */ \"./node_modules/to-arraybuffer/index.js\")\n\nvar IncomingMessage = response.IncomingMessage\nvar rStates = response.readyStates\n\nfunction decideMode (preferBinary, useFetch) {\n\tif (capability.fetch && useFetch) {\n\t\treturn 'fetch'\n\t} else if (capability.mozchunkedarraybuffer) {\n\t\treturn 'moz-chunked-arraybuffer'\n\t} else if (capability.msstream) {\n\t\treturn 'ms-stream'\n\t} else if (capability.arraybuffer && preferBinary) {\n\t\treturn 'arraybuffer'\n\t} else if (capability.vbArray && preferBinary) {\n\t\treturn 'text:vbarray'\n\t} else {\n\t\treturn 'text'\n\t}\n}\n\nvar ClientRequest = module.exports = function (opts) {\n\tvar self = this\n\tstream.Writable.call(self)\n\n\tself._opts = opts\n\tself._body = []\n\tself._headers = {}\n\tif (opts.auth)\n\t\tself.setHeader('Authorization', 'Basic ' + new Buffer(opts.auth).toString('base64'))\n\tObject.keys(opts.headers).forEach(function (name) {\n\t\tself.setHeader(name, opts.headers[name])\n\t})\n\n\tvar preferBinary\n\tvar useFetch = true\n\tif (opts.mode === 'disable-fetch' || ('requestTimeout' in opts && !capability.abortController)) {\n\t\t// If the use of XHR should be preferred. Not typically needed.\n\t\tuseFetch = false\n\t\tpreferBinary = true\n\t} else if (opts.mode === 'prefer-streaming') {\n\t\t// If streaming is a high priority but binary compatibility and\n\t\t// the accuracy of the 'content-type' header aren't\n\t\tpreferBinary = false\n\t} else if (opts.mode === 'allow-wrong-content-type') {\n\t\t// If streaming is more important than preserving the 'content-type' header\n\t\tpreferBinary = !capability.overrideMimeType\n\t} else if (!opts.mode || opts.mode === 'default' || opts.mode === 'prefer-fast') {\n\t\t// Use binary if text streaming may corrupt data or the content-type header, or for speed\n\t\tpreferBinary = true\n\t} else {\n\t\tthrow new Error('Invalid value for opts.mode')\n\t}\n\tself._mode = decideMode(preferBinary, useFetch)\n\tself._fetchTimer = null\n\n\tself.on('finish', function () {\n\t\tself._onFinish()\n\t})\n}\n\ninherits(ClientRequest, stream.Writable)\n\nClientRequest.prototype.setHeader = function (name, value) {\n\tvar self = this\n\tvar lowerName = name.toLowerCase()\n\t// This check is not necessary, but it prevents warnings from browsers about setting unsafe\n\t// headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but\n\t// http-browserify did it, so I will too.\n\tif (unsafeHeaders.indexOf(lowerName) !== -1)\n\t\treturn\n\n\tself._headers[lowerName] = {\n\t\tname: name,\n\t\tvalue: value\n\t}\n}\n\nClientRequest.prototype.getHeader = function (name) {\n\tvar header = this._headers[name.toLowerCase()]\n\tif (header)\n\t\treturn header.value\n\treturn null\n}\n\nClientRequest.prototype.removeHeader = function (name) {\n\tvar self = this\n\tdelete self._headers[name.toLowerCase()]\n}\n\nClientRequest.prototype._onFinish = function () {\n\tvar self = this\n\n\tif (self._destroyed)\n\t\treturn\n\tvar opts = self._opts\n\n\tvar headersObj = self._headers\n\tvar body = null\n\tif (opts.method !== 'GET' && opts.method !== 'HEAD') {\n\t\tif (capability.arraybuffer) {\n\t\t\tbody = toArrayBuffer(Buffer.concat(self._body))\n\t\t} else if (capability.blobConstructor) {\n\t\t\tbody = new global.Blob(self._body.map(function (buffer) {\n\t\t\t\treturn toArrayBuffer(buffer)\n\t\t\t}), {\n\t\t\t\ttype: (headersObj['content-type'] || {}).value || ''\n\t\t\t})\n\t\t} else {\n\t\t\t// get utf8 string\n\t\t\tbody = Buffer.concat(self._body).toString()\n\t\t}\n\t}\n\n\t// create flattened list of headers\n\tvar headersList = []\n\tObject.keys(headersObj).forEach(function (keyName) {\n\t\tvar name = headersObj[keyName].name\n\t\tvar value = headersObj[keyName].value\n\t\tif (Array.isArray(value)) {\n\t\t\tvalue.forEach(function (v) {\n\t\t\t\theadersList.push([name, v])\n\t\t\t})\n\t\t} else {\n\t\t\theadersList.push([name, value])\n\t\t}\n\t})\n\n\tif (self._mode === 'fetch') {\n\t\tvar signal = null\n\t\tvar fetchTimer = null\n\t\tif (capability.abortController) {\n\t\t\tvar controller = new AbortController()\n\t\t\tsignal = controller.signal\n\t\t\tself._fetchAbortController = controller\n\n\t\t\tif ('requestTimeout' in opts && opts.requestTimeout !== 0) {\n\t\t\t\tself._fetchTimer = global.setTimeout(function () {\n\t\t\t\t\tself.emit('requestTimeout')\n\t\t\t\t\tif (self._fetchAbortController)\n\t\t\t\t\t\tself._fetchAbortController.abort()\n\t\t\t\t}, opts.requestTimeout)\n\t\t\t}\n\t\t}\n\n\t\tglobal.fetch(self._opts.url, {\n\t\t\tmethod: self._opts.method,\n\t\t\theaders: headersList,\n\t\t\tbody: body || undefined,\n\t\t\tmode: 'cors',\n\t\t\tcredentials: opts.withCredentials ? 'include' : 'same-origin',\n\t\t\tsignal: signal\n\t\t}).then(function (response) {\n\t\t\tself._fetchResponse = response\n\t\t\tself._connect()\n\t\t}, function (reason) {\n\t\t\tglobal.clearTimeout(self._fetchTimer)\n\t\t\tif (!self._destroyed)\n\t\t\t\tself.emit('error', reason)\n\t\t})\n\t} else {\n\t\tvar xhr = self._xhr = new global.XMLHttpRequest()\n\t\ttry {\n\t\t\txhr.open(self._opts.method, self._opts.url, true)\n\t\t} catch (err) {\n\t\t\tprocess.nextTick(function () {\n\t\t\t\tself.emit('error', err)\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\t// Can't set responseType on really old browsers\n\t\tif ('responseType' in xhr)\n\t\t\txhr.responseType = self._mode.split(':')[0]\n\n\t\tif ('withCredentials' in xhr)\n\t\t\txhr.withCredentials = !!opts.withCredentials\n\n\t\tif (self._mode === 'text' && 'overrideMimeType' in xhr)\n\t\t\txhr.overrideMimeType('text/plain; charset=x-user-defined')\n\n\t\tif ('requestTimeout' in opts) {\n\t\t\txhr.timeout = opts.requestTimeout\n\t\t\txhr.ontimeout = function () {\n\t\t\t\tself.emit('requestTimeout')\n\t\t\t}\n\t\t}\n\n\t\theadersList.forEach(function (header) {\n\t\t\txhr.setRequestHeader(header[0], header[1])\n\t\t})\n\n\t\tself._response = null\n\t\txhr.onreadystatechange = function () {\n\t\t\tswitch (xhr.readyState) {\n\t\t\t\tcase rStates.LOADING:\n\t\t\t\tcase rStates.DONE:\n\t\t\t\t\tself._onXHRProgress()\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// Necessary for streaming in Firefox, since xhr.response is ONLY defined\n\t\t// in onprogress, not in onreadystatechange with xhr.readyState = 3\n\t\tif (self._mode === 'moz-chunked-arraybuffer') {\n\t\t\txhr.onprogress = function () {\n\t\t\t\tself._onXHRProgress()\n\t\t\t}\n\t\t}\n\n\t\txhr.onerror = function () {\n\t\t\tif (self._destroyed)\n\t\t\t\treturn\n\t\t\tself.emit('error', new Error('XHR error'))\n\t\t}\n\n\t\ttry {\n\t\t\txhr.send(body)\n\t\t} catch (err) {\n\t\t\tprocess.nextTick(function () {\n\t\t\t\tself.emit('error', err)\n\t\t\t})\n\t\t\treturn\n\t\t}\n\t}\n}\n\n/**\n * Checks if xhr.status is readable and non-zero, indicating no error.\n * Even though the spec says it should be available in readyState 3,\n * accessing it throws an exception in IE8\n */\nfunction statusValid (xhr) {\n\ttry {\n\t\tvar status = xhr.status\n\t\treturn (status !== null && status !== 0)\n\t} catch (e) {\n\t\treturn false\n\t}\n}\n\nClientRequest.prototype._onXHRProgress = function () {\n\tvar self = this\n\n\tif (!statusValid(self._xhr) || self._destroyed)\n\t\treturn\n\n\tif (!self._response)\n\t\tself._connect()\n\n\tself._response._onXHRProgress()\n}\n\nClientRequest.prototype._connect = function () {\n\tvar self = this\n\n\tif (self._destroyed)\n\t\treturn\n\n\tself._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer)\n\tself._response.on('error', function(err) {\n\t\tself.emit('error', err)\n\t})\n\n\tself.emit('response', self._response)\n}\n\nClientRequest.prototype._write = function (chunk, encoding, cb) {\n\tvar self = this\n\n\tself._body.push(chunk)\n\tcb()\n}\n\nClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () {\n\tvar self = this\n\tself._destroyed = true\n\tglobal.clearTimeout(self._fetchTimer)\n\tif (self._response)\n\t\tself._response._destroyed = true\n\tif (self._xhr)\n\t\tself._xhr.abort()\n\telse if (self._fetchAbortController)\n\t\tself._fetchAbortController.abort()\n}\n\nClientRequest.prototype.end = function (data, encoding, cb) {\n\tvar self = this\n\tif (typeof data === 'function') {\n\t\tcb = data\n\t\tdata = undefined\n\t}\n\n\tstream.Writable.prototype.end.call(self, data, encoding, cb)\n}\n\nClientRequest.prototype.flushHeaders = function () {}\nClientRequest.prototype.setTimeout = function () {}\nClientRequest.prototype.setNoDelay = function () {}\nClientRequest.prototype.setSocketKeepAlive = function () {}\n\n// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method\nvar unsafeHeaders = [\n\t'accept-charset',\n\t'accept-encoding',\n\t'access-control-request-headers',\n\t'access-control-request-method',\n\t'connection',\n\t'content-length',\n\t'cookie',\n\t'cookie2',\n\t'date',\n\t'dnt',\n\t'expect',\n\t'host',\n\t'keep-alive',\n\t'origin',\n\t'referer',\n\t'te',\n\t'trailer',\n\t'transfer-encoding',\n\t'upgrade',\n\t'via'\n]\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-http/lib/request.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/lib/response.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/stream-http/lib/response.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, Buffer, global) {var capability = __webpack_require__(/*! ./capability */ \"./node_modules/stream-http/lib/capability.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/stream-http/node_modules/readable-stream/readable-browser.js\")\n\nvar rStates = exports.readyStates = {\n\tUNSENT: 0,\n\tOPENED: 1,\n\tHEADERS_RECEIVED: 2,\n\tLOADING: 3,\n\tDONE: 4\n}\n\nvar IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) {\n\tvar self = this\n\tstream.Readable.call(self)\n\n\tself._mode = mode\n\tself.headers = {}\n\tself.rawHeaders = []\n\tself.trailers = {}\n\tself.rawTrailers = []\n\n\t// Fake the 'close' event, but only once 'end' fires\n\tself.on('end', function () {\n\t\t// The nextTick is necessary to prevent the 'request' module from causing an infinite loop\n\t\tprocess.nextTick(function () {\n\t\t\tself.emit('close')\n\t\t})\n\t})\n\n\tif (mode === 'fetch') {\n\t\tself._fetchResponse = response\n\n\t\tself.url = response.url\n\t\tself.statusCode = response.status\n\t\tself.statusMessage = response.statusText\n\t\t\n\t\tresponse.headers.forEach(function (header, key){\n\t\t\tself.headers[key.toLowerCase()] = header\n\t\t\tself.rawHeaders.push(key, header)\n\t\t})\n\n\t\tif (capability.writableStream) {\n\t\t\tvar writable = new WritableStream({\n\t\t\t\twrite: function (chunk) {\n\t\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\t\tif (self._destroyed) {\n\t\t\t\t\t\t\treject()\n\t\t\t\t\t\t} else if(self.push(new Buffer(chunk))) {\n\t\t\t\t\t\t\tresolve()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself._resumeFetch = resolve\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tclose: function () {\n\t\t\t\t\tglobal.clearTimeout(fetchTimer)\n\t\t\t\t\tif (!self._destroyed)\n\t\t\t\t\t\tself.push(null)\n\t\t\t\t},\n\t\t\t\tabort: function (err) {\n\t\t\t\t\tif (!self._destroyed)\n\t\t\t\t\t\tself.emit('error', err)\n\t\t\t\t}\n\t\t\t})\n\n\t\t\ttry {\n\t\t\t\tresponse.body.pipeTo(writable).catch(function (err) {\n\t\t\t\t\tglobal.clearTimeout(fetchTimer)\n\t\t\t\t\tif (!self._destroyed)\n\t\t\t\t\t\tself.emit('error', err)\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t} catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this\n\t\t}\n\t\t// fallback for when writableStream or pipeTo aren't available\n\t\tvar reader = response.body.getReader()\n\t\tfunction read () {\n\t\t\treader.read().then(function (result) {\n\t\t\t\tif (self._destroyed)\n\t\t\t\t\treturn\n\t\t\t\tif (result.done) {\n\t\t\t\t\tglobal.clearTimeout(fetchTimer)\n\t\t\t\t\tself.push(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tself.push(new Buffer(result.value))\n\t\t\t\tread()\n\t\t\t}).catch(function (err) {\n\t\t\t\tglobal.clearTimeout(fetchTimer)\n\t\t\t\tif (!self._destroyed)\n\t\t\t\t\tself.emit('error', err)\n\t\t\t})\n\t\t}\n\t\tread()\n\t} else {\n\t\tself._xhr = xhr\n\t\tself._pos = 0\n\n\t\tself.url = xhr.responseURL\n\t\tself.statusCode = xhr.status\n\t\tself.statusMessage = xhr.statusText\n\t\tvar headers = xhr.getAllResponseHeaders().split(/\\r?\\n/)\n\t\theaders.forEach(function (header) {\n\t\t\tvar matches = header.match(/^([^:]+):\\s*(.*)/)\n\t\t\tif (matches) {\n\t\t\t\tvar key = matches[1].toLowerCase()\n\t\t\t\tif (key === 'set-cookie') {\n\t\t\t\t\tif (self.headers[key] === undefined) {\n\t\t\t\t\t\tself.headers[key] = []\n\t\t\t\t\t}\n\t\t\t\t\tself.headers[key].push(matches[2])\n\t\t\t\t} else if (self.headers[key] !== undefined) {\n\t\t\t\t\tself.headers[key] += ', ' + matches[2]\n\t\t\t\t} else {\n\t\t\t\t\tself.headers[key] = matches[2]\n\t\t\t\t}\n\t\t\t\tself.rawHeaders.push(matches[1], matches[2])\n\t\t\t}\n\t\t})\n\n\t\tself._charset = 'x-user-defined'\n\t\tif (!capability.overrideMimeType) {\n\t\t\tvar mimeType = self.rawHeaders['mime-type']\n\t\t\tif (mimeType) {\n\t\t\t\tvar charsetMatch = mimeType.match(/;\\s*charset=([^;])(;|$)/)\n\t\t\t\tif (charsetMatch) {\n\t\t\t\t\tself._charset = charsetMatch[1].toLowerCase()\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!self._charset)\n\t\t\t\tself._charset = 'utf-8' // best guess\n\t\t}\n\t}\n}\n\ninherits(IncomingMessage, stream.Readable)\n\nIncomingMessage.prototype._read = function () {\n\tvar self = this\n\n\tvar resolve = self._resumeFetch\n\tif (resolve) {\n\t\tself._resumeFetch = null\n\t\tresolve()\n\t}\n}\n\nIncomingMessage.prototype._onXHRProgress = function () {\n\tvar self = this\n\n\tvar xhr = self._xhr\n\n\tvar response = null\n\tswitch (self._mode) {\n\t\tcase 'text:vbarray': // For IE9\n\t\t\tif (xhr.readyState !== rStates.DONE)\n\t\t\t\tbreak\n\t\t\ttry {\n\t\t\t\t// This fails in IE8\n\t\t\t\tresponse = new global.VBArray(xhr.responseBody).toArray()\n\t\t\t} catch (e) {}\n\t\t\tif (response !== null) {\n\t\t\t\tself.push(new Buffer(response))\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Falls through in IE8\t\n\t\tcase 'text':\n\t\t\ttry { // This will fail when readyState = 3 in IE9. Switch mode and wait for readyState = 4\n\t\t\t\tresponse = xhr.responseText\n\t\t\t} catch (e) {\n\t\t\t\tself._mode = 'text:vbarray'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif (response.length > self._pos) {\n\t\t\t\tvar newData = response.substr(self._pos)\n\t\t\t\tif (self._charset === 'x-user-defined') {\n\t\t\t\t\tvar buffer = new Buffer(newData.length)\n\t\t\t\t\tfor (var i = 0; i < newData.length; i++)\n\t\t\t\t\t\tbuffer[i] = newData.charCodeAt(i) & 0xff\n\n\t\t\t\t\tself.push(buffer)\n\t\t\t\t} else {\n\t\t\t\t\tself.push(newData, self._charset)\n\t\t\t\t}\n\t\t\t\tself._pos = response.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'arraybuffer':\n\t\t\tif (xhr.readyState !== rStates.DONE || !xhr.response)\n\t\t\t\tbreak\n\t\t\tresponse = xhr.response\n\t\t\tself.push(new Buffer(new Uint8Array(response)))\n\t\t\tbreak\n\t\tcase 'moz-chunked-arraybuffer': // take whole\n\t\t\tresponse = xhr.response\n\t\t\tif (xhr.readyState !== rStates.LOADING || !response)\n\t\t\t\tbreak\n\t\t\tself.push(new Buffer(new Uint8Array(response)))\n\t\t\tbreak\n\t\tcase 'ms-stream':\n\t\t\tresponse = xhr.response\n\t\t\tif (xhr.readyState !== rStates.LOADING)\n\t\t\t\tbreak\n\t\t\tvar reader = new global.MSStreamReader()\n\t\t\treader.onprogress = function () {\n\t\t\t\tif (reader.result.byteLength > self._pos) {\n\t\t\t\t\tself.push(new Buffer(new Uint8Array(reader.result.slice(self._pos))))\n\t\t\t\t\tself._pos = reader.result.byteLength\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.onload = function () {\n\t\t\t\tself.push(null)\n\t\t\t}\n\t\t\t// reader.onerror = ??? // TODO: this\n\t\t\treader.readAsArrayBuffer(response)\n\t\t\tbreak\n\t}\n\n\t// The ms-stream case handles end separately in reader.onload()\n\tif (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') {\n\t\tself.push(null)\n\t}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-http/lib/response.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js":
|
||
/*!*************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js ***!
|
||
\*************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_readable.js\");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_writable.js\");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/_stream_passthrough.js":
|
||
/*!******************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/_stream_passthrough.js ***!
|
||
\******************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_transform.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/_stream_passthrough.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/_stream_readable.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/_stream_readable.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 18);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/_stream_readable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/_stream_transform.js":
|
||
/*!****************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/_stream_transform.js ***!
|
||
\****************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/_stream_transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/_stream_writable.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/_stream_writable.js ***!
|
||
\***************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\");\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/_stream_writable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/BufferList.js":
|
||
/*!**************************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
|
||
\**************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 19);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/BufferList.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/destroy.js":
|
||
/*!***********************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/destroy.js ***!
|
||
\***********************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/destroy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/stream-browser.js":
|
||
/*!******************************************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
|
||
\******************************************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter;\n\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/lib/internal/streams/stream-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-http/node_modules/readable-stream/readable-browser.js":
|
||
/*!***********************************************************************************!*\
|
||
!*** ./node_modules/stream-http/node_modules/readable-stream/readable-browser.js ***!
|
||
\***********************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_readable.js\");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_writable.js\");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_duplex.js\");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_transform.js\");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \"./node_modules/stream-http/node_modules/readable-stream/lib/_stream_passthrough.js\");\n\n\n//# sourceURL=webpack:///./node_modules/stream-http/node_modules/readable-stream/readable-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-to-blob-url/index.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/stream-to-blob-url/index.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = getBlobURL\n\nconst getBlob = __webpack_require__(/*! stream-to-blob */ \"./node_modules/stream-to-blob-url/node_modules/stream-to-blob/index.js\")\n\nasync function getBlobURL (stream, mimeType) {\n const blob = await getBlob(stream, mimeType)\n const url = URL.createObjectURL(blob)\n return url\n}\n\n\n//# sourceURL=webpack:///./node_modules/stream-to-blob-url/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-to-blob-url/node_modules/stream-to-blob/index.js":
|
||
/*!******************************************************************************!*\
|
||
!*** ./node_modules/stream-to-blob-url/node_modules/stream-to-blob/index.js ***!
|
||
\******************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* global Blob */\n\nmodule.exports = streamToBlob\n\nfunction streamToBlob (stream, mimeType) {\n if (mimeType != null && typeof mimeType !== 'string') {\n throw new Error('Invalid mimetype, expected string.')\n }\n return new Promise((resolve, reject) => {\n const chunks = []\n stream\n .on('data', chunk => chunks.push(chunk))\n .once('end', () => {\n const blob = mimeType != null\n ? new Blob(chunks, { type: mimeType })\n : new Blob(chunks)\n resolve(blob)\n })\n .once('error', reject)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/stream-to-blob-url/node_modules/stream-to-blob/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-to-blob/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/stream-to-blob/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* global Blob */\n\nvar once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\n\nmodule.exports = function getBlob (stream, mimeType, cb) {\n if (typeof mimeType === 'function') return getBlob(stream, null, mimeType)\n cb = once(cb)\n var chunks = []\n stream\n .on('data', function (chunk) {\n chunks.push(chunk)\n })\n .on('end', function () {\n var blob = mimeType\n ? new Blob(chunks, { type: mimeType })\n : new Blob(chunks)\n cb(null, blob)\n })\n .on('error', cb)\n}\n\n\n//# sourceURL=webpack:///./node_modules/stream-to-blob/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-to-pull-stream/index.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/stream-to-pull-stream/index.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {var pull = __webpack_require__(/*! pull-stream/pull */ \"./node_modules/pull-stream/pull.js\")\nvar looper = __webpack_require__(/*! looper */ \"./node_modules/looper/index.js\")\n\nfunction destroy (stream) {\n if(!stream.destroy)\n console.error(\n 'warning, stream-to-pull-stream: \\n'\n + 'the wrapped node-stream does not implement `destroy`, \\n'\n + 'this may cause resource leaks.'\n )\n else stream.destroy()\n\n}\n\nfunction write(read, stream, cb) {\n var ended, closed = false, did\n function done () {\n if(did) return\n did = true\n cb && cb(ended === true ? null : ended)\n }\n\n function onClose () {\n if(closed) return\n closed = true\n cleanup()\n if(!ended) read(ended = true, done)\n else done()\n }\n function onError (err) {\n cleanup()\n if(!ended) read(ended = err, done)\n }\n function cleanup() {\n stream.on('finish', onClose)\n stream.removeListener('close', onClose)\n stream.removeListener('error', onError)\n }\n stream.on('close', onClose)\n stream.on('finish', onClose)\n stream.on('error', onError)\n process.nextTick(function () {\n looper(function (next) {\n read(null, function (end, data) {\n ended = ended || end\n //you can't \"end\" a stdout stream, so this needs to be handled specially.\n if(end === true)\n return stream._isStdio ? done() : stream.end()\n\n if(ended = ended || end) {\n destroy(stream)\n return done(ended)\n }\n\n //I noticed a problem streaming to the terminal:\n //sometimes the end got cut off, creating invalid output.\n //it seems that stdout always emits \"drain\" when it ends.\n //so this seems to work, but i have been unable to reproduce this test\n //automatically, so you need to run ./test/stdout.js a few times and the end is valid json.\n if(stream._isStdio)\n stream.write(data, function () { next() })\n else {\n var pause = stream.write(data)\n if(pause === false)\n stream.once('drain', next)\n else next()\n }\n })\n })\n })\n}\n\nfunction first (emitter, events, handler) {\n function listener (val) {\n events.forEach(function (e) {\n emitter.removeListener(e, listener)\n })\n handler(val)\n }\n events.forEach(function (e) {\n emitter.on(e, listener)\n })\n return emitter\n}\n\nfunction read2(stream) {\n var ended = false, waiting = false\n var _cb\n\n function read () {\n var data = stream.read()\n if(data !== null && _cb) {\n var cb = _cb; _cb = null\n cb(null, data)\n }\n }\n\n stream.on('readable', function () {\n waiting = true\n _cb && read()\n })\n .on('end', function () {\n ended = true\n _cb && _cb(ended)\n })\n .on('error', function (err) {\n ended = err\n _cb && _cb(ended)\n })\n\n return function (end, cb) {\n _cb = cb\n if(ended)\n cb(ended)\n else if(waiting)\n read()\n }\n}\n\nfunction read1(stream) {\n var buffer = [], cbs = [], ended, paused = false\n\n var draining\n function drain() {\n while((buffer.length || ended) && cbs.length)\n cbs.shift()(buffer.length ? null : ended, buffer.shift())\n if(!buffer.length && (paused)) {\n paused = false\n stream.resume()\n }\n }\n\n stream.on('data', function (data) {\n buffer.push(data)\n drain()\n if(buffer.length && stream.pause) {\n paused = true\n stream.pause()\n }\n })\n stream.on('end', function () {\n ended = true\n drain()\n })\n stream.on('close', function () {\n ended = true\n drain()\n })\n stream.on('error', function (err) {\n ended = err\n drain()\n })\n return function (abort, cb) {\n if(!cb) throw new Error('*must* provide cb')\n if(abort) {\n function onAbort () {\n while(cbs.length) cbs.shift()(abort)\n cb(abort)\n }\n //if the stream happens to have already ended, then we don't need to abort.\n if(ended) return onAbort()\n stream.once('close', onAbort)\n destroy(stream)\n }\n else {\n cbs.push(cb)\n drain()\n }\n }\n}\n\nvar read = read1\n\nvar sink = function (stream, cb) {\n return function (read) {\n return write(read, stream, cb)\n }\n}\n\nvar source = function (stream) {\n return read1(stream)\n}\n\nexports = module.exports = function (stream, cb) {\n return (\n (stream.writable && stream.write)\n ? stream.readable\n ? function(_read) {\n write(_read, stream, cb);\n return read1(stream)\n }\n : sink(stream, cb)\n : source(stream)\n )\n}\n\nexports.sink = sink\nexports.source = source\nexports.read = read\nexports.read1 = read1\nexports.read2 = read2\nexports.duplex = function (stream, cb) {\n return {\n source: source(stream),\n sink: sink(stream, cb)\n }\n}\nexports.transform = function (stream) {\n return function (read) {\n var _source = source(stream)\n sink(stream)(read); return _source\n }\n}\n\n\n\n\n\n\n\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/stream-to-pull-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/stream-with-known-length-to-buffer/index.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/stream-with-known-length-to-buffer/index.js ***!
|
||
\******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var once = __webpack_require__(/*! once */ \"./node_modules/once/once.js\")\n\nmodule.exports = function getBuffer (stream, length, cb) {\n cb = once(cb)\n var buf = Buffer.alloc(length)\n var offset = 0\n stream\n .on('data', function (chunk) {\n chunk.copy(buf, offset)\n offset += chunk.length\n })\n .on('end', function () { cb(null, buf) })\n .on('error', cb)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/stream-with-known-length-to-buffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/string_decoder/lib/string_decoder.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/string_decoder/lib/string_decoder.js ***!
|
||
\***********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}\n\n//# sourceURL=webpack:///./node_modules/string_decoder/lib/string_decoder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tar-stream/extract.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/tar-stream/extract.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\")\nvar bl = __webpack_require__(/*! bl */ \"./node_modules/bl/bl.js\")\nvar headers = __webpack_require__(/*! ./headers */ \"./node_modules/tar-stream/headers.js\")\n\nvar Writable = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Writable\nvar PassThrough = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").PassThrough\n\nvar noop = function () {}\n\nvar overflow = function (size) {\n size &= 511\n return size && 512 - size\n}\n\nvar emptyStream = function (self, offset) {\n var s = new Source(self, offset)\n s.end()\n return s\n}\n\nvar mixinPax = function (header, pax) {\n if (pax.path) header.name = pax.path\n if (pax.linkpath) header.linkname = pax.linkpath\n if (pax.size) header.size = parseInt(pax.size, 10)\n header.pax = pax\n return header\n}\n\nvar Source = function (self, offset) {\n this._parent = self\n this.offset = offset\n PassThrough.call(this)\n}\n\nutil.inherits(Source, PassThrough)\n\nSource.prototype.destroy = function (err) {\n this._parent.destroy(err)\n}\n\nvar Extract = function (opts) {\n if (!(this instanceof Extract)) return new Extract(opts)\n Writable.call(this, opts)\n\n opts = opts || {}\n\n this._offset = 0\n this._buffer = bl()\n this._missing = 0\n this._partial = false\n this._onparse = noop\n this._header = null\n this._stream = null\n this._overflow = null\n this._cb = null\n this._locked = false\n this._destroyed = false\n this._pax = null\n this._paxGlobal = null\n this._gnuLongPath = null\n this._gnuLongLinkPath = null\n\n var self = this\n var b = self._buffer\n\n var oncontinue = function () {\n self._continue()\n }\n\n var onunlock = function (err) {\n self._locked = false\n if (err) return self.destroy(err)\n if (!self._stream) oncontinue()\n }\n\n var onstreamend = function () {\n self._stream = null\n var drain = overflow(self._header.size)\n if (drain) self._parse(drain, ondrain)\n else self._parse(512, onheader)\n if (!self._locked) oncontinue()\n }\n\n var ondrain = function () {\n self._buffer.consume(overflow(self._header.size))\n self._parse(512, onheader)\n oncontinue()\n }\n\n var onpaxglobalheader = function () {\n var size = self._header.size\n self._paxGlobal = headers.decodePax(b.slice(0, size))\n b.consume(size)\n onstreamend()\n }\n\n var onpaxheader = function () {\n var size = self._header.size\n self._pax = headers.decodePax(b.slice(0, size))\n if (self._paxGlobal) self._pax = Object.assign({}, self._paxGlobal, self._pax)\n b.consume(size)\n onstreamend()\n }\n\n var ongnulongpath = function () {\n var size = self._header.size\n this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)\n b.consume(size)\n onstreamend()\n }\n\n var ongnulonglinkpath = function () {\n var size = self._header.size\n this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)\n b.consume(size)\n onstreamend()\n }\n\n var onheader = function () {\n var offset = self._offset\n var header\n try {\n header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding)\n } catch (err) {\n self.emit('error', err)\n }\n b.consume(512)\n\n if (!header) {\n self._parse(512, onheader)\n oncontinue()\n return\n }\n if (header.type === 'gnu-long-path') {\n self._parse(header.size, ongnulongpath)\n oncontinue()\n return\n }\n if (header.type === 'gnu-long-link-path') {\n self._parse(header.size, ongnulonglinkpath)\n oncontinue()\n return\n }\n if (header.type === 'pax-global-header') {\n self._parse(header.size, onpaxglobalheader)\n oncontinue()\n return\n }\n if (header.type === 'pax-header') {\n self._parse(header.size, onpaxheader)\n oncontinue()\n return\n }\n\n if (self._gnuLongPath) {\n header.name = self._gnuLongPath\n self._gnuLongPath = null\n }\n\n if (self._gnuLongLinkPath) {\n header.linkname = self._gnuLongLinkPath\n self._gnuLongLinkPath = null\n }\n\n if (self._pax) {\n self._header = header = mixinPax(header, self._pax)\n self._pax = null\n }\n\n self._locked = true\n\n if (!header.size || header.type === 'directory') {\n self._parse(512, onheader)\n self.emit('entry', header, emptyStream(self, offset), onunlock)\n return\n }\n\n self._stream = new Source(self, offset)\n\n self.emit('entry', header, self._stream, onunlock)\n self._parse(header.size, onstreamend)\n oncontinue()\n }\n\n this._onheader = onheader\n this._parse(512, onheader)\n}\n\nutil.inherits(Extract, Writable)\n\nExtract.prototype.destroy = function (err) {\n if (this._destroyed) return\n this._destroyed = true\n\n if (err) this.emit('error', err)\n this.emit('close')\n if (this._stream) this._stream.emit('close')\n}\n\nExtract.prototype._parse = function (size, onparse) {\n if (this._destroyed) return\n this._offset += size\n this._missing = size\n if (onparse === this._onheader) this._partial = false\n this._onparse = onparse\n}\n\nExtract.prototype._continue = function () {\n if (this._destroyed) return\n var cb = this._cb\n this._cb = noop\n if (this._overflow) this._write(this._overflow, undefined, cb)\n else cb()\n}\n\nExtract.prototype._write = function (data, enc, cb) {\n if (this._destroyed) return\n\n var s = this._stream\n var b = this._buffer\n var missing = this._missing\n if (data.length) this._partial = true\n\n // we do not reach end-of-chunk now. just forward it\n\n if (data.length < missing) {\n this._missing -= data.length\n this._overflow = null\n if (s) return s.write(data, cb)\n b.append(data)\n return cb()\n }\n\n // end-of-chunk. the parser should call cb.\n\n this._cb = cb\n this._missing = 0\n\n var overflow = null\n if (data.length > missing) {\n overflow = data.slice(missing)\n data = data.slice(0, missing)\n }\n\n if (s) s.end(data)\n else b.append(data)\n\n this._overflow = overflow\n this._onparse()\n}\n\nExtract.prototype._final = function (cb) {\n if (this._partial) return this.destroy(new Error('Unexpected end of data'))\n cb()\n}\n\nmodule.exports = Extract\n\n\n//# sourceURL=webpack:///./node_modules/tar-stream/extract.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tar-stream/headers.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/tar-stream/headers.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var alloc = Buffer.alloc\n\nvar ZEROS = '0000000000000000000'\nvar SEVENS = '7777777777777777777'\nvar ZERO_OFFSET = '0'.charCodeAt(0)\nvar USTAR_MAGIC = Buffer.from('ustar\\x00', 'binary')\nvar USTAR_VER = Buffer.from('00', 'binary')\nvar GNU_MAGIC = Buffer.from('ustar\\x20', 'binary')\nvar GNU_VER = Buffer.from('\\x20\\x00', 'binary')\nvar MASK = parseInt('7777', 8)\nvar MAGIC_OFFSET = 257\nvar VERSION_OFFSET = 263\n\nvar clamp = function (index, len, defaultValue) {\n if (typeof index !== 'number') return defaultValue\n index = ~~index // Coerce to integer.\n if (index >= len) return len\n if (index >= 0) return index\n index += len\n if (index >= 0) return index\n return 0\n}\n\nvar toType = function (flag) {\n switch (flag) {\n case 0:\n return 'file'\n case 1:\n return 'link'\n case 2:\n return 'symlink'\n case 3:\n return 'character-device'\n case 4:\n return 'block-device'\n case 5:\n return 'directory'\n case 6:\n return 'fifo'\n case 7:\n return 'contiguous-file'\n case 72:\n return 'pax-header'\n case 55:\n return 'pax-global-header'\n case 27:\n return 'gnu-long-link-path'\n case 28:\n case 30:\n return 'gnu-long-path'\n }\n\n return null\n}\n\nvar toTypeflag = function (flag) {\n switch (flag) {\n case 'file':\n return 0\n case 'link':\n return 1\n case 'symlink':\n return 2\n case 'character-device':\n return 3\n case 'block-device':\n return 4\n case 'directory':\n return 5\n case 'fifo':\n return 6\n case 'contiguous-file':\n return 7\n case 'pax-header':\n return 72\n }\n\n return 0\n}\n\nvar indexOf = function (block, num, offset, end) {\n for (; offset < end; offset++) {\n if (block[offset] === num) return offset\n }\n return end\n}\n\nvar cksum = function (block) {\n var sum = 8 * 32\n for (var i = 0; i < 148; i++) sum += block[i]\n for (var j = 156; j < 512; j++) sum += block[j]\n return sum\n}\n\nvar encodeOct = function (val, n) {\n val = val.toString(8)\n if (val.length > n) return SEVENS.slice(0, n) + ' '\n else return ZEROS.slice(0, n - val.length) + val + ' '\n}\n\n/* Copied from the node-tar repo and modified to meet\n * tar-stream coding standard.\n *\n * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349\n */\nfunction parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n var positive\n if (buf[0] === 0x80) positive = true\n else if (buf[0] === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n var zero = false\n var tuple = []\n for (var i = buf.length - 1; i > 0; i--) {\n var byte = buf[i]\n if (positive) tuple.push(byte)\n else if (zero && byte === 0) tuple.push(0)\n else if (zero) {\n zero = false\n tuple.push(0x100 - byte)\n } else tuple.push(0xFF - byte)\n }\n\n var sum = 0\n var l = tuple.length\n for (i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}\n\nvar decodeOct = function (val, offset, length) {\n val = val.slice(offset, offset + length)\n offset = 0\n\n // If prefixed with 0x80 then parse as a base-256 integer\n if (val[offset] & 0x80) {\n return parse256(val)\n } else {\n // Older versions of tar can prefix with spaces\n while (offset < val.length && val[offset] === 32) offset++\n var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)\n while (offset < end && val[offset] === 0) offset++\n if (end === offset) return 0\n return parseInt(val.slice(offset, end).toString(), 8)\n }\n}\n\nvar decodeStr = function (val, offset, length, encoding) {\n return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding)\n}\n\nvar addLength = function (str) {\n var len = Buffer.byteLength(str)\n var digits = Math.floor(Math.log(len) / Math.log(10)) + 1\n if (len + digits >= Math.pow(10, digits)) digits++\n\n return (len + digits) + str\n}\n\nexports.decodeLongPath = function (buf, encoding) {\n return decodeStr(buf, 0, buf.length, encoding)\n}\n\nexports.encodePax = function (opts) { // TODO: encode more stuff in pax\n var result = ''\n if (opts.name) result += addLength(' path=' + opts.name + '\\n')\n if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\\n')\n var pax = opts.pax\n if (pax) {\n for (var key in pax) {\n result += addLength(' ' + key + '=' + pax[key] + '\\n')\n }\n }\n return Buffer.from(result)\n}\n\nexports.decodePax = function (buf) {\n var result = {}\n\n while (buf.length) {\n var i = 0\n while (i < buf.length && buf[i] !== 32) i++\n var len = parseInt(buf.slice(0, i).toString(), 10)\n if (!len) return result\n\n var b = buf.slice(i + 1, len - 1).toString()\n var keyIndex = b.indexOf('=')\n if (keyIndex === -1) return result\n result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1)\n\n buf = buf.slice(len)\n }\n\n return result\n}\n\nexports.encode = function (opts) {\n var buf = alloc(512)\n var name = opts.name\n var prefix = ''\n\n if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/'\n if (Buffer.byteLength(name) !== name.length) return null // utf-8\n\n while (Buffer.byteLength(name) > 100) {\n var i = name.indexOf('/')\n if (i === -1) return null\n prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i)\n name = name.slice(i + 1)\n }\n\n if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null\n if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null\n\n buf.write(name)\n buf.write(encodeOct(opts.mode & MASK, 6), 100)\n buf.write(encodeOct(opts.uid, 6), 108)\n buf.write(encodeOct(opts.gid, 6), 116)\n buf.write(encodeOct(opts.size, 11), 124)\n buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136)\n\n buf[156] = ZERO_OFFSET + toTypeflag(opts.type)\n\n if (opts.linkname) buf.write(opts.linkname, 157)\n\n USTAR_MAGIC.copy(buf, MAGIC_OFFSET)\n USTAR_VER.copy(buf, VERSION_OFFSET)\n if (opts.uname) buf.write(opts.uname, 265)\n if (opts.gname) buf.write(opts.gname, 297)\n buf.write(encodeOct(opts.devmajor || 0, 6), 329)\n buf.write(encodeOct(opts.devminor || 0, 6), 337)\n\n if (prefix) buf.write(prefix, 345)\n\n buf.write(encodeOct(cksum(buf), 6), 148)\n\n return buf\n}\n\nexports.decode = function (buf, filenameEncoding) {\n var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET\n\n var name = decodeStr(buf, 0, 100, filenameEncoding)\n var mode = decodeOct(buf, 100, 8)\n var uid = decodeOct(buf, 108, 8)\n var gid = decodeOct(buf, 116, 8)\n var size = decodeOct(buf, 124, 12)\n var mtime = decodeOct(buf, 136, 12)\n var type = toType(typeflag)\n var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding)\n var uname = decodeStr(buf, 265, 32)\n var gname = decodeStr(buf, 297, 32)\n var devmajor = decodeOct(buf, 329, 8)\n var devminor = decodeOct(buf, 337, 8)\n\n var c = cksum(buf)\n\n // checksum is still initial value if header was null.\n if (c === 8 * 32) return null\n\n // valid checksum\n if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?')\n\n if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {\n // ustar (posix) format.\n // prepend prefix, if present.\n if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name\n } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 &&\n GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {\n // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and\n // multi-volume tarballs.\n } else {\n throw new Error('Invalid tar header: unknown format.')\n }\n\n // to support old tar versions that use trailing / to indicate dirs\n if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5\n\n return {\n name: name,\n mode: mode,\n uid: uid,\n gid: gid,\n size: size,\n mtime: new Date(1000 * mtime),\n type: type,\n linkname: linkname,\n uname: uname,\n gname: gname,\n devmajor: devmajor,\n devminor: devminor\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/tar-stream/headers.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tar-stream/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/tar-stream/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("exports.extract = __webpack_require__(/*! ./extract */ \"./node_modules/tar-stream/extract.js\")\nexports.pack = __webpack_require__(/*! ./pack */ \"./node_modules/tar-stream/pack.js\")\n\n\n//# sourceURL=webpack:///./node_modules/tar-stream/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tar-stream/pack.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/tar-stream/pack.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {var constants = __webpack_require__(/*! fs-constants */ \"./node_modules/fs-constants/browser.js\")\nvar eos = __webpack_require__(/*! end-of-stream */ \"./node_modules/end-of-stream/index.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar alloc = Buffer.alloc\n\nvar Readable = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Readable\nvar Writable = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\").Writable\nvar StringDecoder = __webpack_require__(/*! string_decoder */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder\n\nvar headers = __webpack_require__(/*! ./headers */ \"./node_modules/tar-stream/headers.js\")\n\nvar DMODE = parseInt('755', 8)\nvar FMODE = parseInt('644', 8)\n\nvar END_OF_TAR = alloc(1024)\n\nvar noop = function () {}\n\nvar overflow = function (self, size) {\n size &= 511\n if (size) self.push(END_OF_TAR.slice(0, 512 - size))\n}\n\nfunction modeToType (mode) {\n switch (mode & constants.S_IFMT) {\n case constants.S_IFBLK: return 'block-device'\n case constants.S_IFCHR: return 'character-device'\n case constants.S_IFDIR: return 'directory'\n case constants.S_IFIFO: return 'fifo'\n case constants.S_IFLNK: return 'symlink'\n }\n\n return 'file'\n}\n\nvar Sink = function (to) {\n Writable.call(this)\n this.written = 0\n this._to = to\n this._destroyed = false\n}\n\ninherits(Sink, Writable)\n\nSink.prototype._write = function (data, enc, cb) {\n this.written += data.length\n if (this._to.push(data)) return cb()\n this._to._drain = cb\n}\n\nSink.prototype.destroy = function () {\n if (this._destroyed) return\n this._destroyed = true\n this.emit('close')\n}\n\nvar LinkSink = function () {\n Writable.call(this)\n this.linkname = ''\n this._decoder = new StringDecoder('utf-8')\n this._destroyed = false\n}\n\ninherits(LinkSink, Writable)\n\nLinkSink.prototype._write = function (data, enc, cb) {\n this.linkname += this._decoder.write(data)\n cb()\n}\n\nLinkSink.prototype.destroy = function () {\n if (this._destroyed) return\n this._destroyed = true\n this.emit('close')\n}\n\nvar Void = function () {\n Writable.call(this)\n this._destroyed = false\n}\n\ninherits(Void, Writable)\n\nVoid.prototype._write = function (data, enc, cb) {\n cb(new Error('No body allowed for this entry'))\n}\n\nVoid.prototype.destroy = function () {\n if (this._destroyed) return\n this._destroyed = true\n this.emit('close')\n}\n\nvar Pack = function (opts) {\n if (!(this instanceof Pack)) return new Pack(opts)\n Readable.call(this, opts)\n\n this._drain = noop\n this._finalized = false\n this._finalizing = false\n this._destroyed = false\n this._stream = null\n}\n\ninherits(Pack, Readable)\n\nPack.prototype.entry = function (header, buffer, callback) {\n if (this._stream) throw new Error('already piping an entry')\n if (this._finalized || this._destroyed) return\n\n if (typeof buffer === 'function') {\n callback = buffer\n buffer = null\n }\n\n if (!callback) callback = noop\n\n var self = this\n\n if (!header.size || header.type === 'symlink') header.size = 0\n if (!header.type) header.type = modeToType(header.mode)\n if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE\n if (!header.uid) header.uid = 0\n if (!header.gid) header.gid = 0\n if (!header.mtime) header.mtime = new Date()\n\n if (typeof buffer === 'string') buffer = Buffer.from(buffer)\n if (Buffer.isBuffer(buffer)) {\n header.size = buffer.length\n this._encode(header)\n this.push(buffer)\n overflow(self, header.size)\n process.nextTick(callback)\n return new Void()\n }\n\n if (header.type === 'symlink' && !header.linkname) {\n var linkSink = new LinkSink()\n eos(linkSink, function (err) {\n if (err) { // stream was closed\n self.destroy()\n return callback(err)\n }\n\n header.linkname = linkSink.linkname\n self._encode(header)\n callback()\n })\n\n return linkSink\n }\n\n this._encode(header)\n\n if (header.type !== 'file' && header.type !== 'contiguous-file') {\n process.nextTick(callback)\n return new Void()\n }\n\n var sink = new Sink(this)\n\n this._stream = sink\n\n eos(sink, function (err) {\n self._stream = null\n\n if (err) { // stream was closed\n self.destroy()\n return callback(err)\n }\n\n if (sink.written !== header.size) { // corrupting tar\n self.destroy()\n return callback(new Error('size mismatch'))\n }\n\n overflow(self, header.size)\n if (self._finalizing) self.finalize()\n callback()\n })\n\n return sink\n}\n\nPack.prototype.finalize = function () {\n if (this._stream) {\n this._finalizing = true\n return\n }\n\n if (this._finalized) return\n this._finalized = true\n this.push(END_OF_TAR)\n this.push(null)\n}\n\nPack.prototype.destroy = function (err) {\n if (this._destroyed) return\n this._destroyed = true\n\n if (err) this.emit('error', err)\n this.emit('close')\n if (this._stream && this._stream.destroy) this._stream.destroy()\n}\n\nPack.prototype._encode = function (header) {\n if (!header.pax) {\n var buf = headers.encode(header)\n if (buf) {\n this.push(buf)\n return\n }\n }\n this._encodePax(header)\n}\n\nPack.prototype._encodePax = function (header) {\n var paxHeader = headers.encodePax({\n name: header.name,\n linkname: header.linkname,\n pax: header.pax\n })\n\n var newHeader = {\n name: 'PaxHeader',\n mode: header.mode,\n uid: header.uid,\n gid: header.gid,\n size: paxHeader.length,\n mtime: header.mtime,\n type: 'pax-header',\n linkname: header.linkname && 'PaxHeader',\n uname: header.uname,\n gname: header.gname,\n devmajor: header.devmajor,\n devminor: header.devminor\n }\n\n this.push(headers.encode(newHeader))\n this.push(paxHeader)\n overflow(this, paxHeader.length)\n\n newHeader.size = header.size\n newHeader.type = header.type\n this.push(headers.encode(newHeader))\n}\n\nPack.prototype._read = function (n) {\n var drain = this._drain\n this._drain = noop\n drain()\n}\n\nmodule.exports = Pack\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/tar-stream/pack.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/thirty-two/lib/thirty-two/index.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/thirty-two/lib/thirty-two/index.js ***!
|
||
\*********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* \nCopyright (c) 2011, Chris Umbel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in \nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n*/\n\nvar base32 = __webpack_require__(/*! ./thirty-two */ \"./node_modules/thirty-two/lib/thirty-two/thirty-two.js\");\n\nexports.encode = base32.encode;\nexports.decode = base32.decode;\n\n\n//# sourceURL=webpack:///./node_modules/thirty-two/lib/thirty-two/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/thirty-two/lib/thirty-two/thirty-two.js":
|
||
/*!**************************************************************!*\
|
||
!*** ./node_modules/thirty-two/lib/thirty-two/thirty-two.js ***!
|
||
\**************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\nCopyright (c) 2011, Chris Umbel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\nvar charTable = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";\nvar byteTable = [\n 0xff, 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,\n 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,\n 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,\n 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,\n 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff,\n 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,\n 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,\n 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,\n 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff\n];\n\nfunction quintetCount(buff) {\n var quintets = Math.floor(buff.length / 5);\n return buff.length % 5 === 0 ? quintets: quintets + 1;\n}\n\nexports.encode = function(plain) {\n if(!Buffer.isBuffer(plain)){\n \tplain = new Buffer(plain);\n }\n var i = 0;\n var j = 0;\n var shiftIndex = 0;\n var digit = 0;\n var encoded = new Buffer(quintetCount(plain) * 8);\n\n /* byte by byte isn't as pretty as quintet by quintet but tests a bit\n faster. will have to revisit. */\n while(i < plain.length) {\n var current = plain[i];\n\n if(shiftIndex > 3) {\n digit = current & (0xff >> shiftIndex);\n shiftIndex = (shiftIndex + 5) % 8;\n digit = (digit << shiftIndex) | ((i + 1 < plain.length) ?\n plain[i + 1] : 0) >> (8 - shiftIndex);\n i++;\n } else {\n digit = (current >> (8 - (shiftIndex + 5))) & 0x1f;\n shiftIndex = (shiftIndex + 5) % 8;\n if(shiftIndex === 0) i++;\n }\n\n encoded[j] = charTable.charCodeAt(digit);\n j++;\n }\n\n for(i = j; i < encoded.length; i++) {\n encoded[i] = 0x3d; //'='.charCodeAt(0)\n }\n\n return encoded;\n};\n\nexports.decode = function(encoded) {\n var shiftIndex = 0;\n var plainDigit = 0;\n var plainChar;\n var plainPos = 0;\n if(!Buffer.isBuffer(encoded)){\n \tencoded = new Buffer(encoded);\n }\n var decoded = new Buffer(Math.ceil(encoded.length * 5 / 8));\n\n /* byte by byte isn't as pretty as octet by octet but tests a bit\n faster. will have to revisit. */\n for(var i = 0; i < encoded.length; i++) {\n \tif(encoded[i] === 0x3d){ //'='\n \t\tbreak;\n \t}\n\n var encodedByte = encoded[i] - 0x30;\n\n if(encodedByte < byteTable.length) {\n plainDigit = byteTable[encodedByte];\n\n if(shiftIndex <= 3) {\n shiftIndex = (shiftIndex + 5) % 8;\n\n if(shiftIndex === 0) {\n plainChar |= plainDigit;\n decoded[plainPos] = plainChar;\n plainPos++;\n plainChar = 0;\n } else {\n plainChar |= 0xff & (plainDigit << (8 - shiftIndex));\n }\n } else {\n shiftIndex = (shiftIndex + 5) % 8;\n plainChar |= 0xff & (plainDigit >>> shiftIndex);\n decoded[plainPos] = plainChar;\n plainPos++;\n\n plainChar = 0xff & (plainDigit << (8 - shiftIndex));\n }\n } else {\n \tthrow new Error('Invalid input - it is not base32 encoded string');\n }\n }\n\n return decoded.slice(0, plainPos);\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/thirty-two/lib/thirty-two/thirty-two.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/to-arraybuffer/index.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/to-arraybuffer/index.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var Buffer = __webpack_require__(/*! buffer */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer\n\nmodule.exports = function (buf) {\n\t// If the buffer is backed by a Uint8Array, a faster version will work\n\tif (buf instanceof Uint8Array) {\n\t\t// If the buffer isn't a subarray, return the underlying ArrayBuffer\n\t\tif (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {\n\t\t\treturn buf.buffer\n\t\t} else if (typeof buf.buffer.slice === 'function') {\n\t\t\t// Otherwise we need to get a proper copy\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)\n\t\t}\n\t}\n\n\tif (Buffer.isBuffer(buf)) {\n\t\t// This is the slow version that will work with any Buffer\n\t\t// implementation (even in old browsers)\n\t\tvar arrayCopy = new Uint8Array(buf.length)\n\t\tvar len = buf.length\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tarrayCopy[i] = buf[i]\n\t\t}\n\t\treturn arrayCopy.buffer\n\t} else {\n\t\tthrow new Error('Argument must be a Buffer')\n\t}\n}\n\n\n//# sourceURL=webpack:///./node_modules/to-arraybuffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/torrent-discovery/index.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/torrent-discovery/index.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {const debug = __webpack_require__(/*! debug */ \"./node_modules/torrent-discovery/node_modules/debug/src/browser.js\")('torrent-discovery')\nconst DHT = __webpack_require__(/*! bittorrent-dht/client */ 23) // empty object in browser\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter\nconst parallel = __webpack_require__(/*! run-parallel */ \"./node_modules/run-parallel/index.js\")\nconst Tracker = __webpack_require__(/*! bittorrent-tracker/client */ \"./node_modules/bittorrent-tracker/client.js\")\n\nclass Discovery extends EventEmitter {\n constructor (opts) {\n super()\n\n if (!opts.peerId) throw new Error('Option `peerId` is required')\n if (!opts.infoHash) throw new Error('Option `infoHash` is required')\n if (!process.browser && !opts.port) throw new Error('Option `port` is required')\n\n this.peerId = typeof opts.peerId === 'string'\n ? opts.peerId\n : opts.peerId.toString('hex')\n this.infoHash = typeof opts.infoHash === 'string'\n ? opts.infoHash.toLowerCase()\n : opts.infoHash.toString('hex')\n this._port = opts.port // torrent port\n this._userAgent = opts.userAgent // User-Agent header for http requests\n\n this.destroyed = false\n\n this._announce = opts.announce || []\n this._intervalMs = opts.intervalMs || (15 * 60 * 1000)\n this._trackerOpts = null\n this._dhtAnnouncing = false\n this._dhtTimeout = false\n this._internalDHT = false // is the DHT created internally?\n\n this._onWarning = err => {\n this.emit('warning', err)\n }\n this._onError = err => {\n this.emit('error', err)\n }\n this._onDHTPeer = (peer, infoHash) => {\n if (infoHash.toString('hex') !== this.infoHash) return\n this.emit('peer', `${peer.host}:${peer.port}`, 'dht')\n }\n this._onTrackerPeer = peer => {\n this.emit('peer', peer, 'tracker')\n }\n this._onTrackerAnnounce = () => {\n this.emit('trackerAnnounce')\n }\n\n const createDHT = (port, opts) => {\n const dht = new DHT(opts)\n dht.on('warning', this._onWarning)\n dht.on('error', this._onError)\n dht.listen(port)\n this._internalDHT = true\n return dht\n }\n\n if (opts.tracker === false) {\n this.tracker = null\n } else if (opts.tracker && typeof opts.tracker === 'object') {\n this._trackerOpts = Object.assign({}, opts.tracker)\n this.tracker = this._createTracker()\n } else {\n this.tracker = this._createTracker()\n }\n\n if (opts.dht === false || typeof DHT !== 'function') {\n this.dht = null\n } else if (opts.dht && typeof opts.dht.addNode === 'function') {\n this.dht = opts.dht\n } else if (opts.dht && typeof opts.dht === 'object') {\n this.dht = createDHT(opts.dhtPort, opts.dht)\n } else {\n this.dht = createDHT(opts.dhtPort)\n }\n\n if (this.dht) {\n this.dht.on('peer', this._onDHTPeer)\n this._dhtAnnounce()\n }\n }\n\n updatePort (port) {\n if (port === this._port) return\n this._port = port\n\n if (this.dht) this._dhtAnnounce()\n\n if (this.tracker) {\n this.tracker.stop()\n this.tracker.destroy(() => {\n this.tracker = this._createTracker()\n })\n }\n }\n\n complete (opts) {\n if (this.tracker) {\n this.tracker.complete(opts)\n }\n }\n\n destroy (cb) {\n if (this.destroyed) return\n this.destroyed = true\n\n clearTimeout(this._dhtTimeout)\n\n const tasks = []\n\n if (this.tracker) {\n this.tracker.stop()\n this.tracker.removeListener('warning', this._onWarning)\n this.tracker.removeListener('error', this._onError)\n this.tracker.removeListener('peer', this._onTrackerPeer)\n this.tracker.removeListener('update', this._onTrackerAnnounce)\n tasks.push(cb => {\n this.tracker.destroy(cb)\n })\n }\n\n if (this.dht) {\n this.dht.removeListener('peer', this._onDHTPeer)\n }\n\n if (this._internalDHT) {\n this.dht.removeListener('warning', this._onWarning)\n this.dht.removeListener('error', this._onError)\n tasks.push(cb => {\n this.dht.destroy(cb)\n })\n }\n\n parallel(tasks, cb)\n\n // cleanup\n this.dht = null\n this.tracker = null\n this._announce = null\n }\n\n _createTracker () {\n const opts = Object.assign({}, this._trackerOpts, {\n infoHash: this.infoHash,\n announce: this._announce,\n peerId: this.peerId,\n port: this._port,\n userAgent: this._userAgent\n })\n\n const tracker = new Tracker(opts)\n tracker.on('warning', this._onWarning)\n tracker.on('error', this._onError)\n tracker.on('peer', this._onTrackerPeer)\n tracker.on('update', this._onTrackerAnnounce)\n tracker.setInterval(this._intervalMs)\n tracker.start()\n return tracker\n }\n\n _dhtAnnounce () {\n if (this._dhtAnnouncing) return\n debug('dht announce')\n\n this._dhtAnnouncing = true\n clearTimeout(this._dhtTimeout)\n\n this.dht.announce(this.infoHash, this._port, err => {\n this._dhtAnnouncing = false\n debug('dht announce complete')\n\n if (err) this.emit('warning', err)\n this.emit('dhtAnnounce')\n\n if (!this.destroyed) {\n this._dhtTimeout = setTimeout(() => {\n this._dhtAnnounce()\n }, this._intervalMs + Math.floor(Math.random() * this._intervalMs / 5))\n if (this._dhtTimeout.unref) this._dhtTimeout.unref()\n }\n })\n }\n}\n\nmodule.exports = Discovery\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/torrent-discovery/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/torrent-discovery/node_modules/debug/src/browser.js":
|
||
/*!**************************************************************************!*\
|
||
!*** ./node_modules/torrent-discovery/node_modules/debug/src/browser.js ***!
|
||
\**************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/torrent-discovery/node_modules/debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/torrent-discovery/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/torrent-discovery/node_modules/debug/src/common.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/torrent-discovery/node_modules/debug/src/common.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/torrent-discovery/node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/torrent-piece/index.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/torrent-piece/index.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const BLOCK_LENGTH = 1 << 14\n\nclass Piece {\n constructor (length) {\n this.length = length\n this.missing = length\n this.sources = null\n\n this._chunks = Math.ceil(length / BLOCK_LENGTH)\n this._remainder = (length % BLOCK_LENGTH) || BLOCK_LENGTH\n this._buffered = 0\n this._buffer = null\n this._cancellations = null\n this._reservations = 0\n this._flushed = false\n }\n\n chunkLength (i) {\n return i === this._chunks - 1 ? this._remainder : BLOCK_LENGTH\n }\n\n chunkLengthRemaining (i) {\n return this.length - (i * BLOCK_LENGTH)\n }\n\n chunkOffset (i) {\n return i * BLOCK_LENGTH\n }\n\n reserve () {\n if (!this.init()) return -1\n if (this._cancellations.length) return this._cancellations.pop()\n if (this._reservations < this._chunks) return this._reservations++\n return -1\n }\n\n reserveRemaining () {\n if (!this.init()) return -1\n if (this._reservations < this._chunks) {\n const min = this._reservations\n this._reservations = this._chunks\n return min\n }\n return -1\n }\n\n cancel (i) {\n if (!this.init()) return\n this._cancellations.push(i)\n }\n\n cancelRemaining (i) {\n if (!this.init()) return\n this._reservations = i\n }\n\n get (i) {\n if (!this.init()) return null\n return this._buffer[i]\n }\n\n set (i, data, source) {\n if (!this.init()) return false\n const len = data.length\n const blocks = Math.ceil(len / BLOCK_LENGTH)\n for (let j = 0; j < blocks; j++) {\n if (!this._buffer[i + j]) {\n const offset = j * BLOCK_LENGTH\n const splitData = data.slice(offset, offset + BLOCK_LENGTH)\n this._buffered++\n this._buffer[i + j] = splitData\n this.missing -= splitData.length\n if (!this.sources.includes(source)) {\n this.sources.push(source)\n }\n }\n }\n return this._buffered === this._chunks\n }\n\n flush () {\n if (!this._buffer || this._chunks !== this._buffered) return null\n const buffer = Buffer.concat(this._buffer, this.length)\n this._buffer = null\n this._cancellations = null\n this.sources = null\n this._flushed = true\n return buffer\n }\n\n init () {\n if (this._flushed) return false\n if (this._buffer) return true\n this._buffer = new Array(this._chunks)\n this._cancellations = []\n this.sources = []\n return true\n }\n}\n\nObject.defineProperty(Piece, 'BLOCK_LENGTH', { value: BLOCK_LENGTH })\n\nmodule.exports = Piece\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/torrent-piece/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/cookie.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/cookie.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar net = __webpack_require__(/*! net */ \"./node_modules/node-libs-browser/mock/empty.js\");\nvar urlParse = __webpack_require__(/*! url */ \"./node_modules/url/url.js\").parse;\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/tough-cookie/lib/pubsuffix-psl.js\");\nvar Store = __webpack_require__(/*! ./store */ \"./node_modules/tough-cookie/lib/store.js\").Store;\nvar MemoryCookieStore = __webpack_require__(/*! ./memstore */ \"./node_modules/tough-cookie/lib/memstore.js\").MemoryCookieStore;\nvar pathMatch = __webpack_require__(/*! ./pathMatch */ \"./node_modules/tough-cookie/lib/pathMatch.js\").pathMatch;\nvar VERSION = __webpack_require__(/*! ./version */ \"./node_modules/tough-cookie/lib/version.js\");\n\nvar punycode;\ntry {\n punycode = __webpack_require__(/*! punycode */ \"./node_modules/punycode/punycode.js\");\n} catch(e) {\n console.warn(\"tough-cookie: can't load punycode; won't use punycode for domain normalization\");\n}\n\n// From RFC6265 S4.1.1\n// note that it excludes \\x3B \";\"\nvar COOKIE_OCTETS = /^[\\x21\\x23-\\x2B\\x2D-\\x3A\\x3C-\\x5B\\x5D-\\x7E]+$/;\n\nvar CONTROL_CHARS = /[\\x00-\\x1F]/;\n\n// From Chromium // '\\r', '\\n' and '\\0' should be treated as a terminator in\n// the \"relaxed\" mode, see:\n// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60\nvar TERMINATORS = ['\\n', '\\r', '\\0'];\n\n// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or \";\"'\n// Note ';' is \\x3B\nvar PATH_VALUE = /[\\x20-\\x3A\\x3C-\\x7E]+/;\n\n// date-time parsing constants (RFC6265 S5.1.1)\n\nvar DATE_DELIM = /[\\x09\\x20-\\x2F\\x3B-\\x40\\x5B-\\x60\\x7B-\\x7E]/;\n\nvar MONTH_TO_NUM = {\n jan:0, feb:1, mar:2, apr:3, may:4, jun:5,\n jul:6, aug:7, sep:8, oct:9, nov:10, dec:11\n};\nvar NUM_TO_MONTH = [\n 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'\n];\nvar NUM_TO_DAY = [\n 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'\n];\n\nvar MAX_TIME = 2147483647000; // 31-bit max\nvar MIN_TIME = 0; // 31-bit min\n\n/*\n * Parses a Natural number (i.e., non-negative integer) with either the\n * <min>*<max>DIGIT ( non-digit *OCTET )\n * or\n * <min>*<max>DIGIT\n * grammar (RFC6265 S5.1.1).\n *\n * The \"trailingOK\" boolean controls if the grammar accepts a\n * \"( non-digit *OCTET )\" trailer.\n */\nfunction parseDigits(token, minDigits, maxDigits, trailingOK) {\n var count = 0;\n while (count < token.length) {\n var c = token.charCodeAt(count);\n // \"non-digit = %x00-2F / %x3A-FF\"\n if (c <= 0x2F || c >= 0x3A) {\n break;\n }\n count++;\n }\n\n // constrain to a minimum and maximum number of digits.\n if (count < minDigits || count > maxDigits) {\n return null;\n }\n\n if (!trailingOK && count != token.length) {\n return null;\n }\n\n return parseInt(token.substr(0,count), 10);\n}\n\nfunction parseTime(token) {\n var parts = token.split(':');\n var result = [0,0,0];\n\n /* RF6256 S5.1.1:\n * time = hms-time ( non-digit *OCTET )\n * hms-time = time-field \":\" time-field \":\" time-field\n * time-field = 1*2DIGIT\n */\n\n if (parts.length !== 3) {\n return null;\n }\n\n for (var i = 0; i < 3; i++) {\n // \"time-field\" must be strictly \"1*2DIGIT\", HOWEVER, \"hms-time\" can be\n // followed by \"( non-digit *OCTET )\" so therefore the last time-field can\n // have a trailer\n var trailingOK = (i == 2);\n var num = parseDigits(parts[i], 1, 2, trailingOK);\n if (num === null) {\n return null;\n }\n result[i] = num;\n }\n\n return result;\n}\n\nfunction parseMonth(token) {\n token = String(token).substr(0,3).toLowerCase();\n var num = MONTH_TO_NUM[token];\n return num >= 0 ? num : null;\n}\n\n/*\n * RFC6265 S5.1.1 date parser (see RFC for full grammar)\n */\nfunction parseDate(str) {\n if (!str) {\n return;\n }\n\n /* RFC6265 S5.1.1:\n * 2. Process each date-token sequentially in the order the date-tokens\n * appear in the cookie-date\n */\n var tokens = str.split(DATE_DELIM);\n if (!tokens) {\n return;\n }\n\n var hour = null;\n var minute = null;\n var second = null;\n var dayOfMonth = null;\n var month = null;\n var year = null;\n\n for (var i=0; i<tokens.length; i++) {\n var token = tokens[i].trim();\n if (!token.length) {\n continue;\n }\n\n var result;\n\n /* 2.1. If the found-time flag is not set and the token matches the time\n * production, set the found-time flag and set the hour- value,\n * minute-value, and second-value to the numbers denoted by the digits in\n * the date-token, respectively. Skip the remaining sub-steps and continue\n * to the next date-token.\n */\n if (second === null) {\n result = parseTime(token);\n if (result) {\n hour = result[0];\n minute = result[1];\n second = result[2];\n continue;\n }\n }\n\n /* 2.2. If the found-day-of-month flag is not set and the date-token matches\n * the day-of-month production, set the found-day-of- month flag and set\n * the day-of-month-value to the number denoted by the date-token. Skip\n * the remaining sub-steps and continue to the next date-token.\n */\n if (dayOfMonth === null) {\n // \"day-of-month = 1*2DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 1, 2, true);\n if (result !== null) {\n dayOfMonth = result;\n continue;\n }\n }\n\n /* 2.3. If the found-month flag is not set and the date-token matches the\n * month production, set the found-month flag and set the month-value to\n * the month denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (month === null) {\n result = parseMonth(token);\n if (result !== null) {\n month = result;\n continue;\n }\n }\n\n /* 2.4. If the found-year flag is not set and the date-token matches the\n * year production, set the found-year flag and set the year-value to the\n * number denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (year === null) {\n // \"year = 2*4DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 2, 4, true);\n if (result !== null) {\n year = result;\n /* From S5.1.1:\n * 3. If the year-value is greater than or equal to 70 and less\n * than or equal to 99, increment the year-value by 1900.\n * 4. If the year-value is greater than or equal to 0 and less\n * than or equal to 69, increment the year-value by 2000.\n */\n if (year >= 70 && year <= 99) {\n year += 1900;\n } else if (year >= 0 && year <= 69) {\n year += 2000;\n }\n }\n }\n }\n\n /* RFC 6265 S5.1.1\n * \"5. Abort these steps and fail to parse the cookie-date if:\n * * at least one of the found-day-of-month, found-month, found-\n * year, or found-time flags is not set,\n * * the day-of-month-value is less than 1 or greater than 31,\n * * the year-value is less than 1601,\n * * the hour-value is greater than 23,\n * * the minute-value is greater than 59, or\n * * the second-value is greater than 59.\n * (Note that leap seconds cannot be represented in this syntax.)\"\n *\n * So, in order as above:\n */\n if (\n dayOfMonth === null || month === null || year === null || second === null ||\n dayOfMonth < 1 || dayOfMonth > 31 ||\n year < 1601 ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return;\n }\n\n return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));\n}\n\nfunction formatDate(date) {\n var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;\n var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;\n var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;\n var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;\n return NUM_TO_DAY[date.getUTCDay()] + ', ' +\n d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+\n h+':'+m+':'+s+' GMT';\n}\n\n// S5.1.2 Canonicalized Host Names\nfunction canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}\n\n// S5.1.3 Domain Matching\nfunction domainMatch(str, domStr, canonicalize) {\n if (str == null || domStr == null) {\n return null;\n }\n if (canonicalize !== false) {\n str = canonicalDomain(str);\n domStr = canonicalDomain(domStr);\n }\n\n /*\n * \"The domain string and the string are identical. (Note that both the\n * domain string and the string will have been canonicalized to lower case at\n * this point)\"\n */\n if (str == domStr) {\n return true;\n }\n\n /* \"All of the following [three] conditions hold:\" (order adjusted from the RFC) */\n\n /* \"* The string is a host name (i.e., not an IP address).\" */\n if (net.isIP(str)) {\n return false;\n }\n\n /* \"* The domain string is a suffix of the string\" */\n var idx = str.indexOf(domStr);\n if (idx <= 0) {\n return false; // it's a non-match (-1) or prefix (0)\n }\n\n // e.g \"a.b.c\".indexOf(\"b.c\") === 2\n // 5 === 3+2\n if (str.length !== domStr.length + idx) { // it's not a suffix\n return false;\n }\n\n /* \"* The last character of the string that is not included in the domain\n * string is a %x2E (\".\") character.\" */\n if (str.substr(idx-1,1) !== '.') {\n return false;\n }\n\n return true;\n}\n\n\n// RFC6265 S5.1.4 Paths and Path-Match\n\n/*\n * \"The user agent MUST use an algorithm equivalent to the following algorithm\n * to compute the default-path of a cookie:\"\n *\n * Assumption: the path (and not query part or absolute uri) is passed in.\n */\nfunction defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}\n\nfunction trimTerminator(str) {\n for (var t = 0; t < TERMINATORS.length; t++) {\n var terminatorIdx = str.indexOf(TERMINATORS[t]);\n if (terminatorIdx !== -1) {\n str = str.substr(0,terminatorIdx);\n }\n }\n\n return str;\n}\n\nfunction parseCookiePair(cookiePair, looseMode) {\n cookiePair = trimTerminator(cookiePair);\n\n var firstEq = cookiePair.indexOf('=');\n if (looseMode) {\n if (firstEq === 0) { // '=' is immediately at start\n cookiePair = cookiePair.substr(1);\n firstEq = cookiePair.indexOf('='); // might still need to split on '='\n }\n } else { // non-loose mode\n if (firstEq <= 0) { // no '=' or is at start\n return; // needs to have non-empty \"cookie-name\"\n }\n }\n\n var cookieName, cookieValue;\n if (firstEq <= 0) {\n cookieName = \"\";\n cookieValue = cookiePair.trim();\n } else {\n cookieName = cookiePair.substr(0, firstEq).trim();\n cookieValue = cookiePair.substr(firstEq+1).trim();\n }\n\n if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {\n return;\n }\n\n var c = new Cookie();\n c.key = cookieName;\n c.value = cookieValue;\n return c;\n}\n\nfunction parse(str, options) {\n if (!options || typeof options !== 'object') {\n options = {};\n }\n str = str.trim();\n\n // We use a regex to parse the \"name-value-pair\" part of S5.2\n var firstSemi = str.indexOf(';'); // S5.2 step 1\n var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);\n var c = parseCookiePair(cookiePair, !!options.loose);\n if (!c) {\n return;\n }\n\n if (firstSemi === -1) {\n return c;\n }\n\n // S5.2.3 \"unparsed-attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\" plus later on in the same section\n // \"discard the first \";\" and trim\".\n var unparsed = str.slice(firstSemi + 1).trim();\n\n // \"If the unparsed-attributes string is empty, skip the rest of these\n // steps.\"\n if (unparsed.length === 0) {\n return c;\n }\n\n /*\n * S5.2 says that when looping over the items \"[p]rocess the attribute-name\n * and attribute-value according to the requirements in the following\n * subsections\" for every item. Plus, for many of the individual attributes\n * in S5.3 it says to use the \"attribute-value of the last attribute in the\n * cookie-attribute-list\". Therefore, in this implementation, we overwrite\n * the previous value.\n */\n var cookie_avs = unparsed.split(';');\n while (cookie_avs.length) {\n var av = cookie_avs.shift().trim();\n if (av.length === 0) { // happens if \";;\" appears\n continue;\n }\n var av_sep = av.indexOf('=');\n var av_key, av_value;\n\n if (av_sep === -1) {\n av_key = av;\n av_value = null;\n } else {\n av_key = av.substr(0,av_sep);\n av_value = av.substr(av_sep+1);\n }\n\n av_key = av_key.trim().toLowerCase();\n\n if (av_value) {\n av_value = av_value.trim();\n }\n\n switch(av_key) {\n case 'expires': // S5.2.1\n if (av_value) {\n var exp = parseDate(av_value);\n // \"If the attribute-value failed to parse as a cookie date, ignore the\n // cookie-av.\"\n if (exp) {\n // over and underflow not realistically a concern: V8's getTime() seems to\n // store something larger than a 32-bit time_t (even with 32-bit node)\n c.expires = exp;\n }\n }\n break;\n\n case 'max-age': // S5.2.2\n if (av_value) {\n // \"If the first character of the attribute-value is not a DIGIT or a \"-\"\n // character ...[or]... If the remainder of attribute-value contains a\n // non-DIGIT character, ignore the cookie-av.\"\n if (/^-?[0-9]+$/.test(av_value)) {\n var delta = parseInt(av_value, 10);\n // \"If delta-seconds is less than or equal to zero (0), let expiry-time\n // be the earliest representable date and time.\"\n c.setMaxAge(delta);\n }\n }\n break;\n\n case 'domain': // S5.2.3\n // \"If the attribute-value is empty, the behavior is undefined. However,\n // the user agent SHOULD ignore the cookie-av entirely.\"\n if (av_value) {\n // S5.2.3 \"Let cookie-domain be the attribute-value without the leading %x2E\n // (\".\") character.\"\n var domain = av_value.trim().replace(/^\\./, '');\n if (domain) {\n // \"Convert the cookie-domain to lower case.\"\n c.domain = domain.toLowerCase();\n }\n }\n break;\n\n case 'path': // S5.2.4\n /*\n * \"If the attribute-value is empty or if the first character of the\n * attribute-value is not %x2F (\"/\"):\n * Let cookie-path be the default-path.\n * Otherwise:\n * Let cookie-path be the attribute-value.\"\n *\n * We'll represent the default-path as null since it depends on the\n * context of the parsing.\n */\n c.path = av_value && av_value[0] === \"/\" ? av_value : null;\n break;\n\n case 'secure': // S5.2.5\n /*\n * \"If the attribute-name case-insensitively matches the string \"Secure\",\n * the user agent MUST append an attribute to the cookie-attribute-list\n * with an attribute-name of Secure and an empty attribute-value.\"\n */\n c.secure = true;\n break;\n\n case 'httponly': // S5.2.6 -- effectively the same as 'secure'\n c.httpOnly = true;\n break;\n\n default:\n c.extensions = c.extensions || [];\n c.extensions.push(av);\n break;\n }\n }\n\n return c;\n}\n\n// avoid the V8 deoptimization monster!\nfunction jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}\n\nfunction fromJSON(str) {\n if (!str) {\n return null;\n }\n\n var obj;\n if (typeof str === 'string') {\n obj = jsonParse(str);\n if (obj instanceof Error) {\n return null;\n }\n } else {\n // assume it's an Object\n obj = str;\n }\n\n var c = new Cookie();\n for (var i=0; i<Cookie.serializableProperties.length; i++) {\n var prop = Cookie.serializableProperties[i];\n if (obj[prop] === undefined ||\n obj[prop] === Cookie.prototype[prop])\n {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (obj[prop] === null) {\n c[prop] = null;\n } else {\n c[prop] = obj[prop] == \"Infinity\" ?\n \"Infinity\" : new Date(obj[prop]);\n }\n } else {\n c[prop] = obj[prop];\n }\n }\n\n return c;\n}\n\n/* Section 5.4 part 2:\n * \"* Cookies with longer paths are listed before cookies with\n * shorter paths.\n *\n * * Among cookies that have equal-length path fields, cookies with\n * earlier creation-times are listed before cookies with later\n * creation-times.\"\n */\n\nfunction cookieCompare(a,b) {\n var cmp = 0;\n\n // descending for length: b CMP a\n var aPathLen = a.path ? a.path.length : 0;\n var bPathLen = b.path ? b.path.length : 0;\n cmp = bPathLen - aPathLen;\n if (cmp !== 0) {\n return cmp;\n }\n\n // ascending for time: a CMP b\n var aTime = a.creation ? a.creation.getTime() : MAX_TIME;\n var bTime = b.creation ? b.creation.getTime() : MAX_TIME;\n cmp = aTime - bTime;\n if (cmp !== 0) {\n return cmp;\n }\n\n // break ties for the same millisecond (precision of JavaScript's clock)\n cmp = a.creationIndex - b.creationIndex;\n\n return cmp;\n}\n\n// Gives the permutation of all possible pathMatch()es of a given path. The\n// array is in longest-to-shortest order. Handy for indexing.\nfunction permutePath(path) {\n if (path === '/') {\n return ['/'];\n }\n if (path.lastIndexOf('/') === path.length-1) {\n path = path.substr(0,path.length-1);\n }\n var permutations = [path];\n while (path.length > 1) {\n var lindex = path.lastIndexOf('/');\n if (lindex === 0) {\n break;\n }\n path = path.substr(0,lindex);\n permutations.push(path);\n }\n permutations.push('/');\n return permutations;\n}\n\nfunction getCookieContext(url) {\n if (url instanceof Object) {\n return url;\n }\n // NOTE: decodeURI will throw on malformed URIs (see GH-32).\n // Therefore, we will just skip decoding for such URIs.\n try {\n url = decodeURI(url);\n }\n catch(err) {\n // Silently swallow error\n }\n\n return urlParse(url);\n}\n\nfunction Cookie(options) {\n options = options || {};\n\n Object.keys(options).forEach(function(prop) {\n if (Cookie.prototype.hasOwnProperty(prop) &&\n Cookie.prototype[prop] !== options[prop] &&\n prop.substr(0,1) !== '_')\n {\n this[prop] = options[prop];\n }\n }, this);\n\n this.creation = this.creation || new Date();\n\n // used to break creation ties in cookieCompare():\n Object.defineProperty(this, 'creationIndex', {\n configurable: false,\n enumerable: false, // important for assert.deepEqual checks\n writable: true,\n value: ++Cookie.cookiesCreated\n });\n}\n\nCookie.cookiesCreated = 0; // incremented each time a cookie is created\n\nCookie.parse = parse;\nCookie.fromJSON = fromJSON;\n\nCookie.prototype.key = \"\";\nCookie.prototype.value = \"\";\n\n// the order in which the RFC has them:\nCookie.prototype.expires = \"Infinity\"; // coerces to literal Infinity\nCookie.prototype.maxAge = null; // takes precedence over expires for TTL\nCookie.prototype.domain = null;\nCookie.prototype.path = null;\nCookie.prototype.secure = false;\nCookie.prototype.httpOnly = false;\nCookie.prototype.extensions = null;\n\n// set by the CookieJar:\nCookie.prototype.hostOnly = null; // boolean when set\nCookie.prototype.pathIsDefault = null; // boolean when set\nCookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse\nCookie.prototype.lastAccessed = null; // Date when set\nObject.defineProperty(Cookie.prototype, 'creationIndex', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: 0\n});\n\nCookie.serializableProperties = Object.keys(Cookie.prototype)\n .filter(function(prop) {\n return !(\n Cookie.prototype[prop] instanceof Function ||\n prop === 'creationIndex' ||\n prop.substr(0,1) === '_'\n );\n });\n\nCookie.prototype.inspect = function inspect() {\n var now = Date.now();\n return 'Cookie=\"'+this.toString() +\n '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +\n '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +\n '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +\n '\"';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;\n}\n\nCookie.prototype.toJSON = function() {\n var obj = {};\n\n var props = Cookie.serializableProperties;\n for (var i=0; i<props.length; i++) {\n var prop = props[i];\n if (this[prop] === Cookie.prototype[prop]) {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (this[prop] === null) {\n obj[prop] = null;\n } else {\n obj[prop] = this[prop] == \"Infinity\" ? // intentionally not ===\n \"Infinity\" : this[prop].toISOString();\n }\n } else if (prop === 'maxAge') {\n if (this[prop] !== null) {\n // again, intentionally not ===\n obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?\n this[prop].toString() : this[prop];\n }\n } else {\n if (this[prop] !== Cookie.prototype[prop]) {\n obj[prop] = this[prop];\n }\n }\n }\n\n return obj;\n};\n\nCookie.prototype.clone = function() {\n return fromJSON(this.toJSON());\n};\n\nCookie.prototype.validate = function validate() {\n if (!COOKIE_OCTETS.test(this.value)) {\n return false;\n }\n if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {\n return false;\n }\n if (this.maxAge != null && this.maxAge <= 0) {\n return false; // \"Max-Age=\" non-zero-digit *DIGIT\n }\n if (this.path != null && !PATH_VALUE.test(this.path)) {\n return false;\n }\n\n var cdomain = this.cdomain();\n if (cdomain) {\n if (cdomain.match(/\\.$/)) {\n return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this\n }\n var suffix = pubsuffix.getPublicSuffix(cdomain);\n if (suffix == null) { // it's a public suffix\n return false;\n }\n }\n return true;\n};\n\nCookie.prototype.setExpires = function setExpires(exp) {\n if (exp instanceof Date) {\n this.expires = exp;\n } else {\n this.expires = parseDate(exp) || \"Infinity\";\n }\n};\n\nCookie.prototype.setMaxAge = function setMaxAge(age) {\n if (age === Infinity || age === -Infinity) {\n this.maxAge = age.toString(); // so JSON.stringify() works\n } else {\n this.maxAge = age;\n }\n};\n\n// gives Cookie header format\nCookie.prototype.cookieString = function cookieString() {\n var val = this.value;\n if (val == null) {\n val = '';\n }\n if (this.key === '') {\n return val;\n }\n return this.key+'='+val;\n};\n\n// gives Set-Cookie header format\nCookie.prototype.toString = function toString() {\n var str = this.cookieString();\n\n if (this.expires != Infinity) {\n if (this.expires instanceof Date) {\n str += '; Expires='+formatDate(this.expires);\n } else {\n str += '; Expires='+this.expires;\n }\n }\n\n if (this.maxAge != null && this.maxAge != Infinity) {\n str += '; Max-Age='+this.maxAge;\n }\n\n if (this.domain && !this.hostOnly) {\n str += '; Domain='+this.domain;\n }\n if (this.path) {\n str += '; Path='+this.path;\n }\n\n if (this.secure) {\n str += '; Secure';\n }\n if (this.httpOnly) {\n str += '; HttpOnly';\n }\n if (this.extensions) {\n this.extensions.forEach(function(ext) {\n str += '; '+ext;\n });\n }\n\n return str;\n};\n\n// TTL() partially replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\n// S5.3 says to give the \"latest representable date\" for which we use Infinity\n// For \"expired\" we use 0\nCookie.prototype.TTL = function TTL(now) {\n /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires\n * attribute, the Max-Age attribute has precedence and controls the\n * expiration date of the cookie.\n * (Concurs with S5.3 step 3)\n */\n if (this.maxAge != null) {\n return this.maxAge<=0 ? 0 : this.maxAge*1000;\n }\n\n var expires = this.expires;\n if (expires != Infinity) {\n if (!(expires instanceof Date)) {\n expires = parseDate(expires) || Infinity;\n }\n\n if (expires == Infinity) {\n return Infinity;\n }\n\n return expires.getTime() - (now || Date.now());\n }\n\n return Infinity;\n};\n\n// expiryTime() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\nCookie.prototype.expiryTime = function expiryTime(now) {\n if (this.maxAge != null) {\n var relativeTo = now || this.creation || new Date();\n var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;\n return relativeTo.getTime() + age;\n }\n\n if (this.expires == Infinity) {\n return Infinity;\n }\n return this.expires.getTime();\n};\n\n// expiryDate() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere), except it returns a Date\nCookie.prototype.expiryDate = function expiryDate(now) {\n var millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n};\n\n// This replaces the \"persistent-flag\" parts of S5.3 step 3\nCookie.prototype.isPersistent = function isPersistent() {\n return (this.maxAge != null || this.expires != Infinity);\n};\n\n// Mostly S5.1.2 and S5.2.3:\nCookie.prototype.cdomain =\nCookie.prototype.canonicalizedDomain = function canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n};\n\nfunction CookieJar(store, options) {\n if (typeof options === \"boolean\") {\n options = {rejectPublicSuffixes: options};\n } else if (options == null) {\n options = {};\n }\n if (options.rejectPublicSuffixes != null) {\n this.rejectPublicSuffixes = options.rejectPublicSuffixes;\n }\n if (options.looseMode != null) {\n this.enableLooseMode = options.looseMode;\n }\n\n if (!store) {\n store = new MemoryCookieStore();\n }\n this.store = store;\n}\nCookieJar.prototype.store = null;\nCookieJar.prototype.rejectPublicSuffixes = true;\nCookieJar.prototype.enableLooseMode = false;\nvar CAN_BE_SYNC = [];\n\nCAN_BE_SYNC.push('setCookie');\nCookieJar.prototype.setCookie = function(cookie, url, options, cb) {\n var err;\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var loose = this.enableLooseMode;\n if (options.loose != null) {\n loose = options.loose;\n }\n\n // S5.3 step 1\n if (!(cookie instanceof Cookie)) {\n cookie = Cookie.parse(cookie, { loose: loose });\n }\n if (!cookie) {\n err = new Error(\"Cookie failed to parse\");\n return cb(options.ignoreError ? null : err);\n }\n\n // S5.3 step 2\n var now = options.now || new Date(); // will assign later to save effort in the face of errors\n\n // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()\n\n // S5.3 step 4: NOOP; domain is null by default\n\n // S5.3 step 5: public suffixes\n if (this.rejectPublicSuffixes && cookie.domain) {\n var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());\n if (suffix == null) { // e.g. \"com\"\n err = new Error(\"Cookie has domain set to a public suffix\");\n return cb(options.ignoreError ? null : err);\n }\n }\n\n // S5.3 step 6:\n if (cookie.domain) {\n if (!domainMatch(host, cookie.cdomain(), false)) {\n err = new Error(\"Cookie not in this host's domain. Cookie:\"+cookie.cdomain()+\" Request:\"+host);\n return cb(options.ignoreError ? null : err);\n }\n\n if (cookie.hostOnly == null) { // don't reset if already set\n cookie.hostOnly = false;\n }\n\n } else {\n cookie.hostOnly = true;\n cookie.domain = host;\n }\n\n //S5.2.4 If the attribute-value is empty or if the first character of the\n //attribute-value is not %x2F (\"/\"):\n //Let cookie-path be the default-path.\n if (!cookie.path || cookie.path[0] !== '/') {\n cookie.path = defaultPath(context.pathname);\n cookie.pathIsDefault = true;\n }\n\n // S5.3 step 8: NOOP; secure attribute\n // S5.3 step 9: NOOP; httpOnly attribute\n\n // S5.3 step 10\n if (options.http === false && cookie.httpOnly) {\n err = new Error(\"Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n\n var store = this.store;\n\n if (!store.updateCookie) {\n store.updateCookie = function(oldCookie, newCookie, cb) {\n this.putCookie(newCookie, cb);\n };\n }\n\n function withCookie(err, oldCookie) {\n if (err) {\n return cb(err);\n }\n\n var next = function(err) {\n if (err) {\n return cb(err);\n } else {\n cb(null, cookie);\n }\n };\n\n if (oldCookie) {\n // S5.3 step 11 - \"If the cookie store contains a cookie with the same name,\n // domain, and path as the newly created cookie:\"\n if (options.http === false && oldCookie.httpOnly) { // step 11.2\n err = new Error(\"old Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n cookie.creation = oldCookie.creation; // step 11.3\n cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker\n cookie.lastAccessed = now;\n // Step 11.4 (delete cookie) is implied by just setting the new one:\n store.updateCookie(oldCookie, cookie, next); // step 12\n\n } else {\n cookie.creation = cookie.lastAccessed = now;\n store.putCookie(cookie, next); // step 12\n }\n }\n\n store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);\n};\n\n// RFC6365 S5.4\nCAN_BE_SYNC.push('getCookies');\nCookieJar.prototype.getCookies = function(url, options, cb) {\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var path = context.pathname || '/';\n\n var secure = options.secure;\n if (secure == null && context.protocol &&\n (context.protocol == 'https:' || context.protocol == 'wss:'))\n {\n secure = true;\n }\n\n var http = options.http;\n if (http == null) {\n http = true;\n }\n\n var now = options.now || Date.now();\n var expireCheck = options.expire !== false;\n var allPaths = !!options.allPaths;\n var store = this.store;\n\n function matchingCookie(c) {\n // \"Either:\n // The cookie's host-only-flag is true and the canonicalized\n // request-host is identical to the cookie's domain.\n // Or:\n // The cookie's host-only-flag is false and the canonicalized\n // request-host domain-matches the cookie's domain.\"\n if (c.hostOnly) {\n if (c.domain != host) {\n return false;\n }\n } else {\n if (!domainMatch(host, c.domain, false)) {\n return false;\n }\n }\n\n // \"The request-uri's path path-matches the cookie's path.\"\n if (!allPaths && !pathMatch(path, c.path)) {\n return false;\n }\n\n // \"If the cookie's secure-only-flag is true, then the request-uri's\n // scheme must denote a \"secure\" protocol\"\n if (c.secure && !secure) {\n return false;\n }\n\n // \"If the cookie's http-only-flag is true, then exclude the cookie if the\n // cookie-string is being generated for a \"non-HTTP\" API\"\n if (c.httpOnly && !http) {\n return false;\n }\n\n // deferred from S5.3\n // non-RFC: allow retention of expired cookies by choice\n if (expireCheck && c.expiryTime() <= now) {\n store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored\n return false;\n }\n\n return true;\n }\n\n store.findCookies(host, allPaths ? null : path, function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n cookies = cookies.filter(matchingCookie);\n\n // sorting of S5.4 part 2\n if (options.sort !== false) {\n cookies = cookies.sort(cookieCompare);\n }\n\n // S5.4 part 3\n var now = new Date();\n cookies.forEach(function(c) {\n c.lastAccessed = now;\n });\n // TODO persist lastAccessed\n\n cb(null,cookies);\n });\n};\n\nCAN_BE_SYNC.push('getCookieString');\nCookieJar.prototype.getCookieString = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies\n .sort(cookieCompare)\n .map(function(c){\n return c.cookieString();\n })\n .join('; '));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('getSetCookieStrings');\nCookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies.map(function(c){\n return c.toString();\n }));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('serialize');\nCookieJar.prototype.serialize = function(cb) {\n var type = this.store.constructor.name;\n if (type === 'Object') {\n type = null;\n }\n\n // update README.md \"Serialization Format\" if you change this, please!\n var serialized = {\n // The version of tough-cookie that serialized this jar. Generally a good\n // practice since future versions can make data import decisions based on\n // known past behavior. When/if this matters, use `semver`.\n version: 'tough-cookie@'+VERSION,\n\n // add the store type, to make humans happy:\n storeType: type,\n\n // CookieJar configuration:\n rejectPublicSuffixes: !!this.rejectPublicSuffixes,\n\n // this gets filled from getAllCookies:\n cookies: []\n };\n\n if (!(this.store.getAllCookies &&\n typeof this.store.getAllCookies === 'function'))\n {\n return cb(new Error('store does not support getAllCookies and cannot be serialized'));\n }\n\n this.store.getAllCookies(function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n serialized.cookies = cookies.map(function(cookie) {\n // convert to serialized 'raw' cookies\n cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;\n\n // Remove the index so new ones get assigned during deserialization\n delete cookie.creationIndex;\n\n return cookie;\n });\n\n return cb(null, serialized);\n });\n};\n\n// well-known name that JSON.stringify calls\nCookieJar.prototype.toJSON = function() {\n return this.serializeSync();\n};\n\n// use the class method CookieJar.deserialize instead of calling this directly\nCAN_BE_SYNC.push('_importCookies');\nCookieJar.prototype._importCookies = function(serialized, cb) {\n var jar = this;\n var cookies = serialized.cookies;\n if (!cookies || !Array.isArray(cookies)) {\n return cb(new Error('serialized jar has no cookies array'));\n }\n cookies = cookies.slice(); // do not modify the original\n\n function putNext(err) {\n if (err) {\n return cb(err);\n }\n\n if (!cookies.length) {\n return cb(err, jar);\n }\n\n var cookie;\n try {\n cookie = fromJSON(cookies.shift());\n } catch (e) {\n return cb(e);\n }\n\n if (cookie === null) {\n return putNext(null); // skip this cookie\n }\n\n jar.store.putCookie(cookie, putNext);\n }\n\n putNext();\n};\n\nCookieJar.deserialize = function(strOrObj, store, cb) {\n if (arguments.length !== 3) {\n // store is optional\n cb = store;\n store = null;\n }\n\n var serialized;\n if (typeof strOrObj === 'string') {\n serialized = jsonParse(strOrObj);\n if (serialized instanceof Error) {\n return cb(serialized);\n }\n } else {\n serialized = strOrObj;\n }\n\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n jar._importCookies(serialized, function(err) {\n if (err) {\n return cb(err);\n }\n cb(null, jar);\n });\n};\n\nCookieJar.deserializeSync = function(strOrObj, store) {\n var serialized = typeof strOrObj === 'string' ?\n JSON.parse(strOrObj) : strOrObj;\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n\n // catch this mistake early:\n if (!jar.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n jar._importCookiesSync(serialized);\n return jar;\n};\nCookieJar.fromJSON = CookieJar.deserializeSync;\n\nCookieJar.prototype.clone = function(newStore, cb) {\n if (arguments.length === 1) {\n cb = newStore;\n newStore = null;\n }\n\n this.serialize(function(err,serialized) {\n if (err) {\n return cb(err);\n }\n CookieJar.deserialize(serialized, newStore, cb);\n });\n};\n\nCAN_BE_SYNC.push('removeAllCookies');\nCookieJar.prototype.removeAllCookies = function(cb) {\n var store = this.store;\n\n // Check that the store implements its own removeAllCookies(). The default\n // implementation in Store will immediately call the callback with a \"not\n // implemented\" Error.\n if (store.removeAllCookies instanceof Function &&\n store.removeAllCookies !== Store.prototype.removeAllCookies)\n {\n return store.removeAllCookies(cb);\n }\n\n store.getAllCookies(function(err, cookies) {\n if (err) {\n return cb(err);\n }\n\n if (cookies.length === 0) {\n return cb(null);\n }\n\n var completedCount = 0;\n var removeErrors = [];\n\n function removeCookieCb(removeErr) {\n if (removeErr) {\n removeErrors.push(removeErr);\n }\n\n completedCount++;\n\n if (completedCount === cookies.length) {\n return cb(removeErrors.length ? removeErrors[0] : null);\n }\n }\n\n cookies.forEach(function(cookie) {\n store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb);\n });\n });\n};\n\nCookieJar.prototype._cloneSync = syncWrap('clone');\nCookieJar.prototype.cloneSync = function(newStore) {\n if (!newStore.synchronous) {\n throw new Error('CookieJar clone destination store is not synchronous; use async API instead.');\n }\n return this._cloneSync(newStore);\n};\n\n// Use a closure to provide a true imperative API for synchronous stores.\nfunction syncWrap(method) {\n return function() {\n if (!this.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n var args = Array.prototype.slice.call(arguments);\n var syncErr, syncResult;\n args.push(function syncCb(err, result) {\n syncErr = err;\n syncResult = result;\n });\n this[method].apply(this, args);\n\n if (syncErr) {\n throw syncErr;\n }\n return syncResult;\n };\n}\n\n// wrap all declared CAN_BE_SYNC methods in the sync wrapper\nCAN_BE_SYNC.forEach(function(method) {\n CookieJar.prototype[method+'Sync'] = syncWrap(method);\n});\n\nexports.version = VERSION;\nexports.CookieJar = CookieJar;\nexports.Cookie = Cookie;\nexports.Store = Store;\nexports.MemoryCookieStore = MemoryCookieStore;\nexports.parseDate = parseDate;\nexports.formatDate = formatDate;\nexports.parse = parse;\nexports.fromJSON = fromJSON;\nexports.domainMatch = domainMatch;\nexports.defaultPath = defaultPath;\nexports.pathMatch = pathMatch;\nexports.getPublicSuffix = pubsuffix.getPublicSuffix;\nexports.cookieCompare = cookieCompare;\nexports.permuteDomain = __webpack_require__(/*! ./permuteDomain */ \"./node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain;\nexports.permutePath = permutePath;\nexports.canonicalDomain = canonicalDomain;\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/cookie.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/memstore.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/memstore.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar Store = __webpack_require__(/*! ./store */ \"./node_modules/tough-cookie/lib/store.js\").Store;\nvar permuteDomain = __webpack_require__(/*! ./permuteDomain */ \"./node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain;\nvar pathMatch = __webpack_require__(/*! ./pathMatch */ \"./node_modules/tough-cookie/lib/pathMatch.js\").pathMatch;\nvar util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nfunction MemoryCookieStore() {\n Store.call(this);\n this.idx = {};\n}\nutil.inherits(MemoryCookieStore, Store);\nexports.MemoryCookieStore = MemoryCookieStore;\nMemoryCookieStore.prototype.idx = null;\n\n// Since it's just a struct in RAM, this Store is synchronous\nMemoryCookieStore.prototype.synchronous = true;\n\n// force a default depth:\nMemoryCookieStore.prototype.inspect = function() {\n return \"{ idx: \"+util.inspect(this.idx, false, 2)+' }';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;\n}\n\nMemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {\n if (!this.idx[domain]) {\n return cb(null,undefined);\n }\n if (!this.idx[domain][path]) {\n return cb(null,undefined);\n }\n return cb(null,this.idx[domain][path][key]||null);\n};\n\nMemoryCookieStore.prototype.findCookies = function(domain, path, cb) {\n var results = [];\n if (!domain) {\n return cb(null,[]);\n }\n\n var pathMatcher;\n if (!path) {\n // null means \"all paths\"\n pathMatcher = function matchAll(domainIndex) {\n for (var curPath in domainIndex) {\n var pathIndex = domainIndex[curPath];\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n };\n\n } else {\n pathMatcher = function matchRFC(domainIndex) {\n //NOTE: we should use path-match algorithm from S5.1.4 here\n //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)\n Object.keys(domainIndex).forEach(function (cookiePath) {\n if (pathMatch(path, cookiePath)) {\n var pathIndex = domainIndex[cookiePath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n });\n };\n }\n\n var domains = permuteDomain(domain) || [domain];\n var idx = this.idx;\n domains.forEach(function(curDomain) {\n var domainIndex = idx[curDomain];\n if (!domainIndex) {\n return;\n }\n pathMatcher(domainIndex);\n });\n\n cb(null,results);\n};\n\nMemoryCookieStore.prototype.putCookie = function(cookie, cb) {\n if (!this.idx[cookie.domain]) {\n this.idx[cookie.domain] = {};\n }\n if (!this.idx[cookie.domain][cookie.path]) {\n this.idx[cookie.domain][cookie.path] = {};\n }\n this.idx[cookie.domain][cookie.path][cookie.key] = cookie;\n cb(null);\n};\n\nMemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // updateCookie() may avoid updating cookies that are identical. For example,\n // lastAccessed may not be important to some stores and an equality\n // comparison could exclude that field.\n this.putCookie(newCookie,cb);\n};\n\nMemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {\n if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {\n delete this.idx[domain][path][key];\n }\n cb(null);\n};\n\nMemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {\n if (this.idx[domain]) {\n if (path) {\n delete this.idx[domain][path];\n } else {\n delete this.idx[domain];\n }\n }\n return cb(null);\n};\n\nMemoryCookieStore.prototype.removeAllCookies = function(cb) {\n this.idx = {};\n return cb(null);\n}\n\nMemoryCookieStore.prototype.getAllCookies = function(cb) {\n var cookies = [];\n var idx = this.idx;\n\n var domains = Object.keys(idx);\n domains.forEach(function(domain) {\n var paths = Object.keys(idx[domain]);\n paths.forEach(function(path) {\n var keys = Object.keys(idx[domain][path]);\n keys.forEach(function(key) {\n if (key !== null) {\n cookies.push(idx[domain][path][key]);\n }\n });\n });\n });\n\n // Sort by creationIndex so deserializing retains the creation order.\n // When implementing your own store, this SHOULD retain the order too\n cookies.sort(function(a,b) {\n return (a.creationIndex||0) - (b.creationIndex||0);\n });\n\n cb(null, cookies);\n};\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/memstore.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/pathMatch.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/pathMatch.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * \"A request-path path-matches a given cookie-path if at least one of the\n * following conditions holds:\"\n */\nfunction pathMatch (reqPath, cookiePath) {\n // \"o The cookie-path and the request-path are identical.\"\n if (cookiePath === reqPath) {\n return true;\n }\n\n var idx = reqPath.indexOf(cookiePath);\n if (idx === 0) {\n // \"o The cookie-path is a prefix of the request-path, and the last\n // character of the cookie-path is %x2F (\"/\").\"\n if (cookiePath.substr(-1) === \"/\") {\n return true;\n }\n\n // \" o The cookie-path is a prefix of the request-path, and the first\n // character of the request-path that is not included in the cookie- path\n // is a %x2F (\"/\") character.\"\n if (reqPath.substr(cookiePath.length, 1) === \"/\") {\n return true;\n }\n }\n\n return false;\n}\n\nexports.pathMatch = pathMatch;\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/pathMatch.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/permuteDomain.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/permuteDomain.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/tough-cookie/lib/pubsuffix-psl.js\");\n\n// Gives the permutation of all possible domainMatch()es of a given domain. The\n// array is in shortest-to-longest order. Handy for indexing.\nfunction permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}\n\nexports.permuteDomain = permuteDomain;\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/permuteDomain.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/pubsuffix-psl.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/pubsuffix-psl.js ***!
|
||
\********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2018, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar psl = __webpack_require__(/*! psl */ \"./node_modules/psl/index.js\");\n\nfunction getPublicSuffix(domain) {\n return psl.get(domain);\n}\n\nexports.getPublicSuffix = getPublicSuffix;\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/pubsuffix-psl.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/store.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/store.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*jshint unused:false */\n\nfunction Store() {\n}\nexports.Store = Store;\n\n// Stores may be synchronous, but are still required to use a\n// Continuation-Passing Style API. The CookieJar itself will expose a \"*Sync\"\n// API that converts from synchronous-callbacks to imperative style.\nStore.prototype.synchronous = false;\n\nStore.prototype.findCookie = function(domain, path, key, cb) {\n throw new Error('findCookie is not implemented');\n};\n\nStore.prototype.findCookies = function(domain, path, cb) {\n throw new Error('findCookies is not implemented');\n};\n\nStore.prototype.putCookie = function(cookie, cb) {\n throw new Error('putCookie is not implemented');\n};\n\nStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // recommended default implementation:\n // return this.putCookie(newCookie, cb);\n throw new Error('updateCookie is not implemented');\n};\n\nStore.prototype.removeCookie = function(domain, path, key, cb) {\n throw new Error('removeCookie is not implemented');\n};\n\nStore.prototype.removeCookies = function(domain, path, cb) {\n throw new Error('removeCookies is not implemented');\n};\n\nStore.prototype.removeAllCookies = function(cb) {\n throw new Error('removeAllCookies is not implemented');\n}\n\nStore.prototype.getAllCookies = function(cb) {\n throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');\n};\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/store.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tough-cookie/lib/version.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/tough-cookie/lib/version.js ***!
|
||
\**************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// generated by genversion\nmodule.exports = '2.5.0'\n\n\n//# sourceURL=webpack:///./node_modules/tough-cookie/lib/version.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tunnel-agent/index.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/tunnel-agent/index.js ***!
|
||
\********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar net = __webpack_require__(/*! net */ \"./node_modules/node-libs-browser/mock/empty.js\")\n , tls = __webpack_require__(/*! tls */ \"./node_modules/node-libs-browser/mock/empty.js\")\n , http = __webpack_require__(/*! http */ \"./node_modules/stream-http/index.js\")\n , https = __webpack_require__(/*! https */ \"./node_modules/https-browserify/index.js\")\n , events = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\n , assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\")\n , util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\")\n , Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\n ;\n\nexports.httpOverHttp = httpOverHttp\nexports.httpsOverHttp = httpsOverHttp\nexports.httpOverHttps = httpOverHttps\nexports.httpsOverHttps = httpsOverHttps\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options)\n agent.request = http.request\n return agent\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options)\n agent.request = http.request\n agent.createSocket = createSecureSocket\n agent.defaultPort = 443\n return agent\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options)\n agent.request = https.request\n return agent\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options)\n agent.request = https.request\n agent.createSocket = createSecureSocket\n agent.defaultPort = 443\n return agent\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this\n self.options = options || {}\n self.proxyOptions = self.options.proxy || {}\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets\n self.requests = []\n self.sockets = []\n\n self.on('free', function onFree(socket, host, port) {\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i]\n if (pending.host === host && pending.port === port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1)\n pending.request.onSocket(socket)\n return\n }\n }\n socket.destroy()\n self.removeSocket(socket)\n })\n}\nutil.inherits(TunnelingAgent, events.EventEmitter)\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, options) {\n var self = this\n\n // Legacy API: addRequest(req, host, port, path)\n if (typeof options === 'string') {\n options = {\n host: options,\n port: arguments[2],\n path: arguments[3]\n };\n }\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push({host: options.host, port: options.port, request: req})\n return\n }\n\n // If we are under maxSockets create a new one.\n self.createConnection({host: options.host, port: options.port, request: req})\n}\n\nTunnelingAgent.prototype.createConnection = function createConnection(pending) {\n var self = this\n\n self.createSocket(pending, function(socket) {\n socket.on('free', onFree)\n socket.on('close', onCloseOrRemove)\n socket.on('agentRemove', onCloseOrRemove)\n pending.request.onSocket(socket)\n\n function onFree() {\n self.emit('free', socket, pending.host, pending.port)\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket)\n socket.removeListener('free', onFree)\n socket.removeListener('close', onCloseOrRemove)\n socket.removeListener('agentRemove', onCloseOrRemove)\n }\n })\n}\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this\n var placeholder = {}\n self.sockets.push(placeholder)\n\n var connectOptions = mergeOptions({}, self.proxyOptions,\n { method: 'CONNECT'\n , path: options.host + ':' + options.port\n , agent: false\n }\n )\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {}\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n Buffer.from(connectOptions.proxyAuth).toString('base64')\n }\n\n debug('making CONNECT request')\n var connectReq = self.request(connectOptions)\n connectReq.useChunkedEncodingByDefault = false // for v0.6\n connectReq.once('response', onResponse) // for v0.6\n connectReq.once('upgrade', onUpgrade) // for v0.6\n connectReq.once('connect', onConnect) // for v0.7 or later\n connectReq.once('error', onError)\n connectReq.end()\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head)\n })\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners()\n socket.removeAllListeners()\n\n if (res.statusCode === 200) {\n assert.equal(head.length, 0)\n debug('tunneling connection has established')\n self.sockets[self.sockets.indexOf(placeholder)] = socket\n cb(socket)\n } else {\n debug('tunneling socket could not be established, statusCode=%d', res.statusCode)\n var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)\n error.code = 'ECONNRESET'\n options.request.emit('error', error)\n self.removeSocket(placeholder)\n }\n }\n\n function onError(cause) {\n connectReq.removeAllListeners()\n\n debug('tunneling socket could not be established, cause=%s\\n', cause.message, cause.stack)\n var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)\n error.code = 'ECONNRESET'\n options.request.emit('error', error)\n self.removeSocket(placeholder)\n }\n}\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) return\n\n this.sockets.splice(pos, 1)\n\n var pending = this.requests.shift()\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createConnection(pending)\n }\n}\n\nfunction createSecureSocket(options, cb) {\n var self = this\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, mergeOptions({}, self.options,\n { servername: options.host\n , socket: socket\n }\n ))\n self.sockets[self.sockets.indexOf(socket)] = secureSocket\n cb(secureSocket)\n })\n}\n\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i]\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides)\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j]\n if (overrides[k] !== undefined) {\n target[k] = overrides[k]\n }\n }\n }\n }\n return target\n}\n\n\nvar debug\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments)\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0]\n } else {\n args.unshift('TUNNEL:')\n }\n console.error.apply(console, args)\n }\n} else {\n debug = function() {}\n}\nexports.debug = debug // for test\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/tunnel-agent/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/tweetnacl/nacl-fast.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/tweetnacl/nacl-fast.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n var i, r = new Float64Array(16);\n if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n return r;\n};\n\n// Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n gf1 = gf([1]),\n _121665 = gf([0xdb41, 1]),\n D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n x[i] = (h >> 24) & 0xff;\n x[i+1] = (h >> 16) & 0xff;\n x[i+2] = (h >> 8) & 0xff;\n x[i+3] = h & 0xff;\n x[i+4] = (l >> 24) & 0xff;\n x[i+5] = (l >> 16) & 0xff;\n x[i+6] = (l >> 8) & 0xff;\n x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n var i,d = 0;\n for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n x0 = x0 + j0 | 0;\n x1 = x1 + j1 | 0;\n x2 = x2 + j2 | 0;\n x3 = x3 + j3 | 0;\n x4 = x4 + j4 | 0;\n x5 = x5 + j5 | 0;\n x6 = x6 + j6 | 0;\n x7 = x7 + j7 | 0;\n x8 = x8 + j8 | 0;\n x9 = x9 + j9 | 0;\n x10 = x10 + j10 | 0;\n x11 = x11 + j11 | 0;\n x12 = x12 + j12 | 0;\n x13 = x13 + j13 | 0;\n x14 = x14 + j14 | 0;\n x15 = x15 + j15 | 0;\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x1 >>> 0 & 0xff;\n o[ 5] = x1 >>> 8 & 0xff;\n o[ 6] = x1 >>> 16 & 0xff;\n o[ 7] = x1 >>> 24 & 0xff;\n\n o[ 8] = x2 >>> 0 & 0xff;\n o[ 9] = x2 >>> 8 & 0xff;\n o[10] = x2 >>> 16 & 0xff;\n o[11] = x2 >>> 24 & 0xff;\n\n o[12] = x3 >>> 0 & 0xff;\n o[13] = x3 >>> 8 & 0xff;\n o[14] = x3 >>> 16 & 0xff;\n o[15] = x3 >>> 24 & 0xff;\n\n o[16] = x4 >>> 0 & 0xff;\n o[17] = x4 >>> 8 & 0xff;\n o[18] = x4 >>> 16 & 0xff;\n o[19] = x4 >>> 24 & 0xff;\n\n o[20] = x5 >>> 0 & 0xff;\n o[21] = x5 >>> 8 & 0xff;\n o[22] = x5 >>> 16 & 0xff;\n o[23] = x5 >>> 24 & 0xff;\n\n o[24] = x6 >>> 0 & 0xff;\n o[25] = x6 >>> 8 & 0xff;\n o[26] = x6 >>> 16 & 0xff;\n o[27] = x6 >>> 24 & 0xff;\n\n o[28] = x7 >>> 0 & 0xff;\n o[29] = x7 >>> 8 & 0xff;\n o[30] = x7 >>> 16 & 0xff;\n o[31] = x7 >>> 24 & 0xff;\n\n o[32] = x8 >>> 0 & 0xff;\n o[33] = x8 >>> 8 & 0xff;\n o[34] = x8 >>> 16 & 0xff;\n o[35] = x8 >>> 24 & 0xff;\n\n o[36] = x9 >>> 0 & 0xff;\n o[37] = x9 >>> 8 & 0xff;\n o[38] = x9 >>> 16 & 0xff;\n o[39] = x9 >>> 24 & 0xff;\n\n o[40] = x10 >>> 0 & 0xff;\n o[41] = x10 >>> 8 & 0xff;\n o[42] = x10 >>> 16 & 0xff;\n o[43] = x10 >>> 24 & 0xff;\n\n o[44] = x11 >>> 0 & 0xff;\n o[45] = x11 >>> 8 & 0xff;\n o[46] = x11 >>> 16 & 0xff;\n o[47] = x11 >>> 24 & 0xff;\n\n o[48] = x12 >>> 0 & 0xff;\n o[49] = x12 >>> 8 & 0xff;\n o[50] = x12 >>> 16 & 0xff;\n o[51] = x12 >>> 24 & 0xff;\n\n o[52] = x13 >>> 0 & 0xff;\n o[53] = x13 >>> 8 & 0xff;\n o[54] = x13 >>> 16 & 0xff;\n o[55] = x13 >>> 24 & 0xff;\n\n o[56] = x14 >>> 0 & 0xff;\n o[57] = x14 >>> 8 & 0xff;\n o[58] = x14 >>> 16 & 0xff;\n o[59] = x14 >>> 24 & 0xff;\n\n o[60] = x15 >>> 0 & 0xff;\n o[61] = x15 >>> 8 & 0xff;\n o[62] = x15 >>> 16 & 0xff;\n o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x5 >>> 0 & 0xff;\n o[ 5] = x5 >>> 8 & 0xff;\n o[ 6] = x5 >>> 16 & 0xff;\n o[ 7] = x5 >>> 24 & 0xff;\n\n o[ 8] = x10 >>> 0 & 0xff;\n o[ 9] = x10 >>> 8 & 0xff;\n o[10] = x10 >>> 16 & 0xff;\n o[11] = x10 >>> 24 & 0xff;\n\n o[12] = x15 >>> 0 & 0xff;\n o[13] = x15 >>> 8 & 0xff;\n o[14] = x15 >>> 16 & 0xff;\n o[15] = x15 >>> 24 & 0xff;\n\n o[16] = x6 >>> 0 & 0xff;\n o[17] = x6 >>> 8 & 0xff;\n o[18] = x6 >>> 16 & 0xff;\n o[19] = x6 >>> 24 & 0xff;\n\n o[20] = x7 >>> 0 & 0xff;\n o[21] = x7 >>> 8 & 0xff;\n o[22] = x7 >>> 16 & 0xff;\n o[23] = x7 >>> 24 & 0xff;\n\n o[24] = x8 >>> 0 & 0xff;\n o[25] = x8 >>> 8 & 0xff;\n o[26] = x8 >>> 16 & 0xff;\n o[27] = x8 >>> 24 & 0xff;\n\n o[28] = x9 >>> 0 & 0xff;\n o[29] = x9 >>> 8 & 0xff;\n o[30] = x9 >>> 16 & 0xff;\n o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n mpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n }\n return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = x[i];\n }\n return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n this.buffer = new Uint8Array(16);\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.leftover = 0;\n this.fin = 0;\n\n var t0, t1, t2, t3, t4, t5, t6, t7;\n\n t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;\n t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\n t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\n this.r[5] = ((t4 >>> 1)) & 0x1ffe;\n t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\n t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n this.r[9] = ((t7 >>> 5)) & 0x007f;\n\n this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n var hibit = this.fin ? 0 : (1 << 11);\n var t0, t1, t2, t3, t4, t5, t6, t7, c;\n var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n var h0 = this.h[0],\n h1 = this.h[1],\n h2 = this.h[2],\n h3 = this.h[3],\n h4 = this.h[4],\n h5 = this.h[5],\n h6 = this.h[6],\n h7 = this.h[7],\n h8 = this.h[8],\n h9 = this.h[9];\n\n var r0 = this.r[0],\n r1 = this.r[1],\n r2 = this.r[2],\n r3 = this.r[3],\n r4 = this.r[4],\n r5 = this.r[5],\n r6 = this.r[6],\n r7 = this.r[7],\n r8 = this.r[8],\n r9 = this.r[9];\n\n while (bytes >= 16) {\n t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;\n t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;\n t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;\n h5 += ((t4 >>> 1)) & 0x1fff;\n t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;\n t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n h9 += ((t7 >>> 5)) | hibit;\n\n c = 0;\n\n d0 = c;\n d0 += h0 * r0;\n d0 += h1 * (5 * r9);\n d0 += h2 * (5 * r8);\n d0 += h3 * (5 * r7);\n d0 += h4 * (5 * r6);\n c = (d0 >>> 13); d0 &= 0x1fff;\n d0 += h5 * (5 * r5);\n d0 += h6 * (5 * r4);\n d0 += h7 * (5 * r3);\n d0 += h8 * (5 * r2);\n d0 += h9 * (5 * r1);\n c += (d0 >>> 13); d0 &= 0x1fff;\n\n d1 = c;\n d1 += h0 * r1;\n d1 += h1 * r0;\n d1 += h2 * (5 * r9);\n d1 += h3 * (5 * r8);\n d1 += h4 * (5 * r7);\n c = (d1 >>> 13); d1 &= 0x1fff;\n d1 += h5 * (5 * r6);\n d1 += h6 * (5 * r5);\n d1 += h7 * (5 * r4);\n d1 += h8 * (5 * r3);\n d1 += h9 * (5 * r2);\n c += (d1 >>> 13); d1 &= 0x1fff;\n\n d2 = c;\n d2 += h0 * r2;\n d2 += h1 * r1;\n d2 += h2 * r0;\n d2 += h3 * (5 * r9);\n d2 += h4 * (5 * r8);\n c = (d2 >>> 13); d2 &= 0x1fff;\n d2 += h5 * (5 * r7);\n d2 += h6 * (5 * r6);\n d2 += h7 * (5 * r5);\n d2 += h8 * (5 * r4);\n d2 += h9 * (5 * r3);\n c += (d2 >>> 13); d2 &= 0x1fff;\n\n d3 = c;\n d3 += h0 * r3;\n d3 += h1 * r2;\n d3 += h2 * r1;\n d3 += h3 * r0;\n d3 += h4 * (5 * r9);\n c = (d3 >>> 13); d3 &= 0x1fff;\n d3 += h5 * (5 * r8);\n d3 += h6 * (5 * r7);\n d3 += h7 * (5 * r6);\n d3 += h8 * (5 * r5);\n d3 += h9 * (5 * r4);\n c += (d3 >>> 13); d3 &= 0x1fff;\n\n d4 = c;\n d4 += h0 * r4;\n d4 += h1 * r3;\n d4 += h2 * r2;\n d4 += h3 * r1;\n d4 += h4 * r0;\n c = (d4 >>> 13); d4 &= 0x1fff;\n d4 += h5 * (5 * r9);\n d4 += h6 * (5 * r8);\n d4 += h7 * (5 * r7);\n d4 += h8 * (5 * r6);\n d4 += h9 * (5 * r5);\n c += (d4 >>> 13); d4 &= 0x1fff;\n\n d5 = c;\n d5 += h0 * r5;\n d5 += h1 * r4;\n d5 += h2 * r3;\n d5 += h3 * r2;\n d5 += h4 * r1;\n c = (d5 >>> 13); d5 &= 0x1fff;\n d5 += h5 * r0;\n d5 += h6 * (5 * r9);\n d5 += h7 * (5 * r8);\n d5 += h8 * (5 * r7);\n d5 += h9 * (5 * r6);\n c += (d5 >>> 13); d5 &= 0x1fff;\n\n d6 = c;\n d6 += h0 * r6;\n d6 += h1 * r5;\n d6 += h2 * r4;\n d6 += h3 * r3;\n d6 += h4 * r2;\n c = (d6 >>> 13); d6 &= 0x1fff;\n d6 += h5 * r1;\n d6 += h6 * r0;\n d6 += h7 * (5 * r9);\n d6 += h8 * (5 * r8);\n d6 += h9 * (5 * r7);\n c += (d6 >>> 13); d6 &= 0x1fff;\n\n d7 = c;\n d7 += h0 * r7;\n d7 += h1 * r6;\n d7 += h2 * r5;\n d7 += h3 * r4;\n d7 += h4 * r3;\n c = (d7 >>> 13); d7 &= 0x1fff;\n d7 += h5 * r2;\n d7 += h6 * r1;\n d7 += h7 * r0;\n d7 += h8 * (5 * r9);\n d7 += h9 * (5 * r8);\n c += (d7 >>> 13); d7 &= 0x1fff;\n\n d8 = c;\n d8 += h0 * r8;\n d8 += h1 * r7;\n d8 += h2 * r6;\n d8 += h3 * r5;\n d8 += h4 * r4;\n c = (d8 >>> 13); d8 &= 0x1fff;\n d8 += h5 * r3;\n d8 += h6 * r2;\n d8 += h7 * r1;\n d8 += h8 * r0;\n d8 += h9 * (5 * r9);\n c += (d8 >>> 13); d8 &= 0x1fff;\n\n d9 = c;\n d9 += h0 * r9;\n d9 += h1 * r8;\n d9 += h2 * r7;\n d9 += h3 * r6;\n d9 += h4 * r5;\n c = (d9 >>> 13); d9 &= 0x1fff;\n d9 += h5 * r4;\n d9 += h6 * r3;\n d9 += h7 * r2;\n d9 += h8 * r1;\n d9 += h9 * r0;\n c += (d9 >>> 13); d9 &= 0x1fff;\n\n c = (((c << 2) + c)) | 0;\n c = (c + d0) | 0;\n d0 = c & 0x1fff;\n c = (c >>> 13);\n d1 += c;\n\n h0 = d0;\n h1 = d1;\n h2 = d2;\n h3 = d3;\n h4 = d4;\n h5 = d5;\n h6 = d6;\n h7 = d7;\n h8 = d8;\n h9 = d9;\n\n mpos += 16;\n bytes -= 16;\n }\n this.h[0] = h0;\n this.h[1] = h1;\n this.h[2] = h2;\n this.h[3] = h3;\n this.h[4] = h4;\n this.h[5] = h5;\n this.h[6] = h6;\n this.h[7] = h7;\n this.h[8] = h8;\n this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n var g = new Uint16Array(10);\n var c, mask, f, i;\n\n if (this.leftover) {\n i = this.leftover;\n this.buffer[i++] = 1;\n for (; i < 16; i++) this.buffer[i] = 0;\n this.fin = 1;\n this.blocks(this.buffer, 0, 16);\n }\n\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n for (i = 2; i < 10; i++) {\n this.h[i] += c;\n c = this.h[i] >>> 13;\n this.h[i] &= 0x1fff;\n }\n this.h[0] += (c * 5);\n c = this.h[0] >>> 13;\n this.h[0] &= 0x1fff;\n this.h[1] += c;\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n this.h[2] += c;\n\n g[0] = this.h[0] + 5;\n c = g[0] >>> 13;\n g[0] &= 0x1fff;\n for (i = 1; i < 10; i++) {\n g[i] = this.h[i] + c;\n c = g[i] >>> 13;\n g[i] &= 0x1fff;\n }\n g[9] -= (1 << 13);\n\n mask = (c ^ 1) - 1;\n for (i = 0; i < 10; i++) g[i] &= mask;\n mask = ~mask;\n for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;\n this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;\n this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;\n this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;\n this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;\n this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;\n this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;\n this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;\n\n f = this.h[0] + this.pad[0];\n this.h[0] = f & 0xffff;\n for (i = 1; i < 8; i++) {\n f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n this.h[i] = f & 0xffff;\n }\n\n mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n var i, want;\n\n if (this.leftover) {\n want = (16 - this.leftover);\n if (want > bytes)\n want = bytes;\n for (i = 0; i < want; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n bytes -= want;\n mpos += want;\n this.leftover += want;\n if (this.leftover < 16)\n return;\n this.blocks(this.buffer, 0, 16);\n this.leftover = 0;\n }\n\n if (bytes >= 16) {\n want = bytes - (bytes % 16);\n this.blocks(m, mpos, want);\n mpos += want;\n bytes -= want;\n }\n\n if (bytes) {\n for (i = 0; i < bytes; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n this.leftover += bytes;\n }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n var s = new poly1305(k);\n s.update(m, mpos, n);\n s.finish(out, outpos);\n return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n var x = new Uint8Array(16);\n crypto_onetimeauth(x,0,m,mpos,n,k);\n return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n var i;\n if (d < 32) return -1;\n crypto_stream_xor(c,0,m,0,d,n,k);\n crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n for (i = 0; i < 16; i++) c[i] = 0;\n return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n var i;\n var x = new Uint8Array(32);\n if (d < 32) return -1;\n crypto_stream(x,0,32,n,k);\n if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n crypto_stream_xor(m,0,c,0,d,n,k);\n for (i = 0; i < 32; i++) m[i] = 0;\n return 0;\n}\n\nfunction set25519(r, a) {\n var i;\n for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n var i, v, c = 1;\n for (i = 0; i < 16; i++) {\n v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n var t, c = ~(b-1);\n for (var i = 0; i < 16; i++) {\n t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\n\nfunction pack25519(o, n) {\n var i, j, b;\n var m = gf(), t = gf();\n for (i = 0; i < 16; i++) t[i] = n[i];\n car25519(t);\n car25519(t);\n car25519(t);\n for (j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n m[i-1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n b = (m[15]>>16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1-b);\n }\n for (i = 0; i < 16; i++) {\n o[2*i] = t[i] & 0xff;\n o[2*i+1] = t[i]>>8;\n }\n}\n\nfunction neq25519(a, b) {\n var c = new Uint8Array(32), d = new Uint8Array(32);\n pack25519(c, a);\n pack25519(d, b);\n return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n var d = new Uint8Array(32);\n pack25519(d, a);\n return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n var i;\n for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n var v, c,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11],\n b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n\n // first car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n // second car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n o[ 0] = t0;\n o[ 1] = t1;\n o[ 2] = t2;\n o[ 3] = t3;\n o[ 4] = t4;\n o[ 5] = t5;\n o[ 6] = t6;\n o[ 7] = t7;\n o[ 8] = t8;\n o[ 9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\n\nfunction S(o, a) {\n M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 253; a >= 0; a--) {\n S(c, c);\n if(a !== 2 && a !== 4) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 250; a >= 0; a--) {\n S(c, c);\n if(a !== 1) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n var z = new Uint8Array(32);\n var x = new Float64Array(80), r, i;\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf();\n for (i = 0; i < 31; i++) z[i] = n[i];\n z[31]=(n[31]&127)|64;\n z[0]&=248;\n unpack25519(x,p);\n for (i = 0; i < 16; i++) {\n b[i]=x[i];\n d[i]=a[i]=c[i]=0;\n }\n a[0]=d[0]=1;\n for (i=254; i>=0; --i) {\n r=(z[i>>>3]>>>(i&7))&1;\n sel25519(a,b,r);\n sel25519(c,d,r);\n A(e,a,c);\n Z(a,a,c);\n A(c,b,d);\n Z(b,b,d);\n S(d,e);\n S(f,a);\n M(a,c,a);\n M(c,b,e);\n A(e,a,c);\n Z(a,a,c);\n S(b,a);\n Z(c,d,f);\n M(a,c,_121665);\n A(a,a,d);\n M(c,c,a);\n M(a,d,f);\n M(d,b,x);\n S(b,e);\n sel25519(a,b,r);\n sel25519(c,d,r);\n }\n for (i = 0; i < 16; i++) {\n x[i+16]=a[i];\n x[i+32]=c[i];\n x[i+48]=b[i];\n x[i+64]=d[i];\n }\n var x32 = x.subarray(32);\n var x16 = x.subarray(16);\n inv25519(x32,x32);\n M(x16,x16,x32);\n pack25519(q,x16);\n return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n randombytes(x, 32);\n return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n var s = new Uint8Array(32);\n crypto_scalarmult(s, x, y);\n return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n var wh = new Int32Array(16), wl = new Int32Array(16),\n bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n th, tl, i, j, h, l, a, b, c, d;\n\n var ah0 = hh[0],\n ah1 = hh[1],\n ah2 = hh[2],\n ah3 = hh[3],\n ah4 = hh[4],\n ah5 = hh[5],\n ah6 = hh[6],\n ah7 = hh[7],\n\n al0 = hl[0],\n al1 = hl[1],\n al2 = hl[2],\n al3 = hl[3],\n al4 = hl[4],\n al5 = hl[5],\n al6 = hl[6],\n al7 = hl[7];\n\n var pos = 0;\n while (n >= 128) {\n for (i = 0; i < 16; i++) {\n j = 8 * i + pos;\n wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n }\n for (i = 0; i < 80; i++) {\n bh0 = ah0;\n bh1 = ah1;\n bh2 = ah2;\n bh3 = ah3;\n bh4 = ah4;\n bh5 = ah5;\n bh6 = ah6;\n bh7 = ah7;\n\n bl0 = al0;\n bl1 = al1;\n bl2 = al2;\n bl3 = al3;\n bl4 = al4;\n bl5 = al5;\n bl6 = al6;\n bl7 = al7;\n\n // add\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma1\n h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Ch\n h = (ah4 & ah5) ^ (~ah4 & ah6);\n l = (al4 & al5) ^ (~al4 & al6);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // K\n h = K[i*2];\n l = K[i*2+1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // w\n h = wh[i%16];\n l = wl[i%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n th = c & 0xffff | d << 16;\n tl = a & 0xffff | b << 16;\n\n // add\n h = th;\n l = tl;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma0\n h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Maj\n h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh7 = (c & 0xffff) | (d << 16);\n bl7 = (a & 0xffff) | (b << 16);\n\n // add\n h = bh3;\n l = bl3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = th;\n l = tl;\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh3 = (c & 0xffff) | (d << 16);\n bl3 = (a & 0xffff) | (b << 16);\n\n ah1 = bh0;\n ah2 = bh1;\n ah3 = bh2;\n ah4 = bh3;\n ah5 = bh4;\n ah6 = bh5;\n ah7 = bh6;\n ah0 = bh7;\n\n al1 = bl0;\n al2 = bl1;\n al3 = bl2;\n al4 = bl3;\n al5 = bl4;\n al6 = bl5;\n al7 = bl6;\n al0 = bl7;\n\n if (i%16 === 15) {\n for (j = 0; j < 16; j++) {\n // add\n h = wh[j];\n l = wl[j];\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = wh[(j+9)%16];\n l = wl[(j+9)%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma0\n th = wh[(j+1)%16];\n tl = wl[(j+1)%16];\n h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma1\n th = wh[(j+14)%16];\n tl = wl[(j+14)%16];\n h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n wh[j] = (c & 0xffff) | (d << 16);\n wl[j] = (a & 0xffff) | (b << 16);\n }\n }\n }\n\n // add\n h = ah0;\n l = al0;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[0];\n l = hl[0];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[0] = ah0 = (c & 0xffff) | (d << 16);\n hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n h = ah1;\n l = al1;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[1];\n l = hl[1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[1] = ah1 = (c & 0xffff) | (d << 16);\n hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n h = ah2;\n l = al2;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[2];\n l = hl[2];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[2] = ah2 = (c & 0xffff) | (d << 16);\n hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n h = ah3;\n l = al3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[3];\n l = hl[3];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[3] = ah3 = (c & 0xffff) | (d << 16);\n hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n h = ah4;\n l = al4;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[4];\n l = hl[4];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[4] = ah4 = (c & 0xffff) | (d << 16);\n hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n h = ah5;\n l = al5;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[5];\n l = hl[5];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[5] = ah5 = (c & 0xffff) | (d << 16);\n hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n h = ah6;\n l = al6;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[6];\n l = hl[6];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[6] = ah6 = (c & 0xffff) | (d << 16);\n hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[7];\n l = hl[7];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[7] = ah7 = (c & 0xffff) | (d << 16);\n hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n pos += 128;\n n -= 128;\n }\n\n return n;\n}\n\nfunction crypto_hash(out, m, n) {\n var hh = new Int32Array(8),\n hl = new Int32Array(8),\n x = new Uint8Array(256),\n i, b = n;\n\n hh[0] = 0x6a09e667;\n hh[1] = 0xbb67ae85;\n hh[2] = 0x3c6ef372;\n hh[3] = 0xa54ff53a;\n hh[4] = 0x510e527f;\n hh[5] = 0x9b05688c;\n hh[6] = 0x1f83d9ab;\n hh[7] = 0x5be0cd19;\n\n hl[0] = 0xf3bcc908;\n hl[1] = 0x84caa73b;\n hl[2] = 0xfe94f82b;\n hl[3] = 0x5f1d36f1;\n hl[4] = 0xade682d1;\n hl[5] = 0x2b3e6c1f;\n hl[6] = 0xfb41bd6b;\n hl[7] = 0x137e2179;\n\n crypto_hashblocks_hl(hh, hl, m, n);\n n %= 128;\n\n for (i = 0; i < n; i++) x[i] = m[b-n+i];\n x[n] = 128;\n\n n = 256-128*(n<112?1:0);\n x[n-9] = 0;\n ts64(x, n-8, (b / 0x20000000) | 0, b << 3);\n crypto_hashblocks_hl(hh, hl, x, n);\n\n for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n return 0;\n}\n\nfunction add(p, q) {\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf(),\n g = gf(), h = gf(), t = gf();\n\n Z(a, p[1], p[0]);\n Z(t, q[1], q[0]);\n M(a, a, t);\n A(b, p[0], p[1]);\n A(t, q[0], q[1]);\n M(b, b, t);\n M(c, p[3], q[3]);\n M(c, c, D2);\n M(d, p[2], q[2]);\n A(d, d, d);\n Z(e, b, a);\n Z(f, d, c);\n A(g, d, c);\n A(h, b, a);\n\n M(p[0], e, f);\n M(p[1], h, g);\n M(p[2], g, f);\n M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n var i;\n for (i = 0; i < 4; i++) {\n sel25519(p[i], q[i], b);\n }\n}\n\nfunction pack(r, p) {\n var tx = gf(), ty = gf(), zi = gf();\n inv25519(zi, p[2]);\n M(tx, p[0], zi);\n M(ty, p[1], zi);\n pack25519(r, ty);\n r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n var b, i;\n set25519(p[0], gf0);\n set25519(p[1], gf1);\n set25519(p[2], gf1);\n set25519(p[3], gf0);\n for (i = 255; i >= 0; --i) {\n b = (s[(i/8)|0] >> (i&7)) & 1;\n cswap(p, q, b);\n add(q, p);\n add(p, p);\n cswap(p, q, b);\n }\n}\n\nfunction scalarbase(p, s) {\n var q = [gf(), gf(), gf(), gf()];\n set25519(q[0], X);\n set25519(q[1], Y);\n set25519(q[2], gf1);\n M(q[3], X, Y);\n scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n var d = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()];\n var i;\n\n if (!seeded) randombytes(sk, 32);\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n scalarbase(p, d);\n pack(pk, p);\n\n for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n var carry, i, j, k;\n for (i = 63; i >= 32; --i) {\n carry = 0;\n for (j = i - 32, k = i - 12; j < k; ++j) {\n x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n carry = (x[j] + 128) >> 8;\n x[j] -= carry * 256;\n }\n x[j] += carry;\n x[i] = 0;\n }\n carry = 0;\n for (j = 0; j < 32; j++) {\n x[j] += carry - (x[31] >> 4) * L[j];\n carry = x[j] >> 8;\n x[j] &= 255;\n }\n for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n for (i = 0; i < 32; i++) {\n x[i+1] += x[i] >> 8;\n r[i] = x[i] & 255;\n }\n}\n\nfunction reduce(r) {\n var x = new Float64Array(64), i;\n for (i = 0; i < 64; i++) x[i] = r[i];\n for (i = 0; i < 64; i++) r[i] = 0;\n modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n var i, j, x = new Float64Array(64);\n var p = [gf(), gf(), gf(), gf()];\n\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n var smlen = n + 64;\n for (i = 0; i < n; i++) sm[64 + i] = m[i];\n for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n crypto_hash(r, sm.subarray(32), n+32);\n reduce(r);\n scalarbase(p, r);\n pack(sm, p);\n\n for (i = 32; i < 64; i++) sm[i] = sk[i];\n crypto_hash(h, sm, n + 64);\n reduce(h);\n\n for (i = 0; i < 64; i++) x[i] = 0;\n for (i = 0; i < 32; i++) x[i] = r[i];\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 32; j++) {\n x[i+j] += h[i] * d[j];\n }\n }\n\n modL(sm.subarray(32), x);\n return smlen;\n}\n\nfunction unpackneg(r, p) {\n var t = gf(), chk = gf(), num = gf(),\n den = gf(), den2 = gf(), den4 = gf(),\n den6 = gf();\n\n set25519(r[2], gf1);\n unpack25519(r[1], p);\n S(num, r[1]);\n M(den, num, D);\n Z(num, num, r[2]);\n A(den, r[2], den);\n\n S(den2, den);\n S(den4, den2);\n M(den6, den4, den2);\n M(t, den6, num);\n M(t, t, den);\n\n pow2523(t, t);\n M(t, t, num);\n M(t, t, den);\n M(t, t, den);\n M(r[0], t, den);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) M(r[0], r[0], I);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) return -1;\n\n if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n M(r[3], r[0], r[1]);\n return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n var i, mlen;\n var t = new Uint8Array(32), h = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()],\n q = [gf(), gf(), gf(), gf()];\n\n mlen = -1;\n if (n < 64) return -1;\n\n if (unpackneg(q, pk)) return -1;\n\n for (i = 0; i < n; i++) m[i] = sm[i];\n for (i = 0; i < 32; i++) m[i+32] = pk[i];\n crypto_hash(h, m, n);\n reduce(h);\n scalarmult(p, q, h);\n\n scalarbase(q, sm.subarray(32));\n add(p, q);\n pack(t, p);\n\n n -= 64;\n if (crypto_verify_32(sm, 0, t, 0)) {\n for (i = 0; i < n; i++) m[i] = 0;\n return -1;\n }\n\n for (i = 0; i < n; i++) m[i] = sm[i + 64];\n mlen = n;\n return mlen;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n crypto_secretbox_NONCEBYTES = 24,\n crypto_secretbox_ZEROBYTES = 32,\n crypto_secretbox_BOXZEROBYTES = 16,\n crypto_scalarmult_BYTES = 32,\n crypto_scalarmult_SCALARBYTES = 32,\n crypto_box_PUBLICKEYBYTES = 32,\n crypto_box_SECRETKEYBYTES = 32,\n crypto_box_BEFORENMBYTES = 32,\n crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n crypto_sign_BYTES = 64,\n crypto_sign_PUBLICKEYBYTES = 32,\n crypto_sign_SECRETKEYBYTES = 64,\n crypto_sign_SEEDBYTES = 32,\n crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n crypto_core_hsalsa20: crypto_core_hsalsa20,\n crypto_stream_xor: crypto_stream_xor,\n crypto_stream: crypto_stream,\n crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n crypto_stream_salsa20: crypto_stream_salsa20,\n crypto_onetimeauth: crypto_onetimeauth,\n crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n crypto_verify_16: crypto_verify_16,\n crypto_verify_32: crypto_verify_32,\n crypto_secretbox: crypto_secretbox,\n crypto_secretbox_open: crypto_secretbox_open,\n crypto_scalarmult: crypto_scalarmult,\n crypto_scalarmult_base: crypto_scalarmult_base,\n crypto_box_beforenm: crypto_box_beforenm,\n crypto_box_afternm: crypto_box_afternm,\n crypto_box: crypto_box,\n crypto_box_open: crypto_box_open,\n crypto_box_keypair: crypto_box_keypair,\n crypto_hash: crypto_hash,\n crypto_sign: crypto_sign,\n crypto_sign_keypair: crypto_sign_keypair,\n crypto_sign_open: crypto_sign_open,\n\n crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n crypto_sign_BYTES: crypto_sign_BYTES,\n crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n crypto_hash_BYTES: crypto_hash_BYTES\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n var t, i;\n for (i = 0; i < arguments.length; i++) {\n if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')\n throw new TypeError('unexpected type ' + t + ', use Uint8Array');\n }\n}\n\nfunction cleanup(arr) {\n for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\n// TODO: Completely remove this in v0.15.\nif (!nacl.util) {\n nacl.util = {};\n nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {\n throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');\n };\n}\n\nnacl.randomBytes = function(n) {\n var b = new Uint8Array(n);\n randombytes(b, n);\n return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n checkArrayTypes(msg, nonce, key);\n checkLengths(key, nonce);\n var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n var c = new Uint8Array(m.length);\n for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n crypto_secretbox(c, m, m.length, nonce, key);\n return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n checkArrayTypes(box, nonce, key);\n checkLengths(key, nonce);\n var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n var m = new Uint8Array(c.length);\n for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n if (c.length < 32) return false;\n if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;\n return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n checkArrayTypes(n, p);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult(q, n, p);\n return q;\n};\n\nnacl.scalarMult.base = function(n) {\n checkArrayTypes(n);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult_base(q, n);\n return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n checkArrayTypes(publicKey, secretKey);\n checkBoxLengths(publicKey, secretKey);\n var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n crypto_box_beforenm(k, publicKey, secretKey);\n return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n crypto_box_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n crypto_scalarmult_base(pk, secretKey);\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n checkArrayTypes(msg, secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n crypto_sign(signedMsg, msg, msg.length, secretKey);\n return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n if (arguments.length !== 2)\n throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');\n checkArrayTypes(signedMsg, publicKey);\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var tmp = new Uint8Array(signedMsg.length);\n var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n if (mlen < 0) return null;\n var m = new Uint8Array(mlen);\n for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n var signedMsg = nacl.sign(msg, secretKey);\n var sig = new Uint8Array(crypto_sign_BYTES);\n for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n checkArrayTypes(msg, sig, publicKey);\n if (sig.length !== crypto_sign_BYTES)\n throw new Error('bad signature size');\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n var i;\n for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n crypto_sign_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n checkArrayTypes(seed);\n if (seed.length !== crypto_sign_SEEDBYTES)\n throw new Error('bad seed size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n for (var i = 0; i < 32; i++) sk[i] = seed[i];\n crypto_sign_keypair(pk, sk, true);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n checkArrayTypes(msg);\n var h = new Uint8Array(crypto_hash_BYTES);\n crypto_hash(h, msg, msg.length);\n return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n checkArrayTypes(x, y);\n // Zero length arguments are considered not equal.\n if (x.length === 0 || y.length === 0) return false;\n if (x.length !== y.length) return false;\n return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n randombytes = fn;\n};\n\n(function() {\n // Initialize PRNG if environment provides CSPRNG.\n // If not, methods calling randombytes will throw.\n var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n if (crypto && crypto.getRandomValues) {\n // Browsers.\n var QUOTA = 65536;\n nacl.setPRNG(function(x, n) {\n var i, v = new Uint8Array(n);\n for (i = 0; i < n; i += QUOTA) {\n crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n }\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n } else if (true) {\n // Node.js.\n crypto = __webpack_require__(/*! crypto */ 38);\n if (crypto && crypto.randomBytes) {\n nacl.setPRNG(function(x, n) {\n var i, v = crypto.randomBytes(n);\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n }\n }\n})();\n\n})( true && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n\n\n//# sourceURL=webpack:///./node_modules/tweetnacl/nacl-fast.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/typedarray-to-buffer/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/typedarray-to-buffer/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Convert a typed array to a Buffer without a copy\n *\n * Author: Feross Aboukhadijeh <https://feross.org>\n * License: MIT\n *\n * `npm install typedarray-to-buffer`\n */\n\nvar isTypedArray = __webpack_require__(/*! is-typedarray */ \"./node_modules/is-typedarray/index.js\").strict\n\nmodule.exports = function typedarrayToBuffer (arr) {\n if (isTypedArray(arr)) {\n // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer\n var buf = Buffer.from(arr.buffer)\n if (arr.byteLength !== arr.buffer.byteLength) {\n // Respect the \"view\", i.e. byteOffset and byteLength, without doing a copy\n buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength)\n }\n return buf\n } else {\n // Pass through all other types to `Buffer.from`\n return Buffer.from(arr)\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/typedarray-to-buffer/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/uint64be/index.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/uint64be/index.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var bufferAlloc = __webpack_require__(/*! buffer-alloc */ \"./node_modules/buffer-alloc/index.js\")\n\nvar UINT_32_MAX = Math.pow(2, 32)\n\nexports.encodingLength = function () {\n return 8\n}\n\nexports.encode = function (num, buf, offset) {\n if (!buf) buf = bufferAlloc(8)\n if (!offset) offset = 0\n\n var top = Math.floor(num / UINT_32_MAX)\n var rem = num - top * UINT_32_MAX\n\n buf.writeUInt32BE(top, offset)\n buf.writeUInt32BE(rem, offset + 4)\n return buf\n}\n\nexports.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n var top = buf.readUInt32BE(offset)\n var rem = buf.readUInt32BE(offset + 4)\n\n return top * UINT_32_MAX + rem\n}\n\nexports.encode.bytes = 8\nexports.decode.bytes = 8\n\n\n//# sourceURL=webpack:///./node_modules/uint64be/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/uniq/uniq.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/uniq/uniq.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nfunction unique_pred(list, compare) {\n var ptr = 1\n , len = list.length\n , a=list[0], b=list[0]\n for(var i=1; i<len; ++i) {\n b = a\n a = list[i]\n if(compare(a, b)) {\n if(i === ptr) {\n ptr++\n continue\n }\n list[ptr++] = a\n }\n }\n list.length = ptr\n return list\n}\n\nfunction unique_eq(list) {\n var ptr = 1\n , len = list.length\n , a=list[0], b = list[0]\n for(var i=1; i<len; ++i, b=a) {\n b = a\n a = list[i]\n if(a !== b) {\n if(i === ptr) {\n ptr++\n continue\n }\n list[ptr++] = a\n }\n }\n list.length = ptr\n return list\n}\n\nfunction unique(list, compare, sorted) {\n if(list.length === 0) {\n return list\n }\n if(compare) {\n if(!sorted) {\n list.sort(compare)\n }\n return unique_pred(list, compare)\n }\n if(!sorted) {\n list.sort()\n }\n return unique_eq(list)\n}\n\nmodule.exports = unique\n\n\n//# sourceURL=webpack:///./node_modules/uniq/uniq.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/unique-by/index.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/unique-by/index.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = uniqueBy;\n\nfunction uniqueBy(arr, getValue) {\n var unique = [];\n var found = {};\n\n if (typeof getValue !== 'function') {\n var key = getValue;\n getValue = function defaultGetValue(obj) {\n return obj[key];\n };\n }\n\n arr.forEach(function addUniques(obj) {\n var value = getValue(obj);\n if (!found[value]) {\n found[value] = true;\n unique.push(obj);\n }\n });\n\n return unique;\n}\n\n\n//# sourceURL=webpack:///./node_modules/unique-by/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/unordered-array-remove/index.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/unordered-array-remove/index.js ***!
|
||
\******************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = remove\n\nfunction remove (arr, i) {\n if (i >= arr.length || i < 0) return\n var last = arr.pop()\n if (i < arr.length) {\n var tmp = arr[i]\n arr[i] = last\n return tmp\n }\n return last\n}\n\n\n//# sourceURL=webpack:///./node_modules/unordered-array-remove/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/uri-js/dist/es5/uri.all.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/uri-js/dist/es5/uri.all.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */\n(function (global, factory) {\n\t true ? factory(exports) :\n\tundefined;\n}(this, (function (exports) { 'use strict';\n\nfunction merge() {\n for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {\n sets[_key] = arguments[_key];\n }\n\n if (sets.length > 1) {\n sets[0] = sets[0].slice(0, -1);\n var xl = sets.length - 1;\n for (var x = 1; x < xl; ++x) {\n sets[x] = sets[x].slice(1, -1);\n }\n sets[xl] = sets[xl].slice(1);\n return sets.join('');\n } else {\n return sets[0];\n }\n}\nfunction subexp(str) {\n return \"(?:\" + str + \")\";\n}\nfunction typeOf(o) {\n return o === undefined ? \"undefined\" : o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase();\n}\nfunction toUpperCase(str) {\n return str.toUpperCase();\n}\nfunction toArray(obj) {\n return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];\n}\nfunction assign(target, source) {\n var obj = target;\n if (source) {\n for (var key in source) {\n obj[key] = source[key];\n }\n }\n return obj;\n}\n\nfunction buildExps(isIRI) {\n var ALPHA$$ = \"[A-Za-z]\",\n CR$ = \"[\\\\x0D]\",\n DIGIT$$ = \"[0-9]\",\n DQUOTE$$ = \"[\\\\x22]\",\n HEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"),\n //case-insensitive\n LF$$ = \"[\\\\x0A]\",\n SP$$ = \"[\\\\x20]\",\n PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)),\n //expanded\n GEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n SUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n UCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\",\n //subset, excludes bidi control characters\n IPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\",\n //subset\n UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n USERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n DEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n DEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$),\n //relaxed parsing rules\n IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n H16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n LS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n IPV6ADDRESS1$ = subexp(subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$),\n // 6( h16 \":\" ) ls32\n IPV6ADDRESS2$ = subexp(\"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$),\n // \"::\" 5( h16 \":\" ) ls32\n IPV6ADDRESS3$ = subexp(subexp(H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$),\n //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$),\n //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$),\n //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$),\n //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$),\n //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$),\n //[ *5( h16 \":\" ) h16 ] \"::\" h16\n IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\"),\n //[ *6( h16 \":\" ) h16 ] \"::\"\n IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n ZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"),\n //RFC 6874\n IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$),\n //RFC 6874\n IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$),\n //RFC 6874, with relaxed parsing rules\n IPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n IP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"),\n //RFC 6874\n REG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n HOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n PORT$ = subexp(DIGIT$$ + \"*\"),\n AUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n PCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n SEGMENT$ = subexp(PCHAR$ + \"*\"),\n SEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n PATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n PATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"),\n //simplified\n PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),\n //simplified\n PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),\n //simplified\n PATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n PATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n QUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n FRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n HIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n RELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n RELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n URI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n ABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n GENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n RELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n ABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n SAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n AUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\";\n return {\n NOT_SCHEME: new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n NOT_USERINFO: new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_HOST: new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_PATH: new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_PATH_NOSCHEME: new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_QUERY: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n NOT_FRAGMENT: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n ESCAPE: new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n UNRESERVED: new RegExp(UNRESERVED$$, \"g\"),\n OTHER_CHARS: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n PCT_ENCODED: new RegExp(PCT_ENCODED$, \"g\"),\n IPV4ADDRESS: new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n IPV6ADDRESS: new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n };\n}\nvar URI_PROTOCOL = buildExps(false);\n\nvar IRI_PROTOCOL = buildExps(true);\n\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar toConsumableArray = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n};\n\n/** Highest positive signed 32-bit float value */\n\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nvar regexPunycode = /^xn--/;\nvar regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nvar regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nvar errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error$1(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tvar result = [];\n\tvar length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tvar parts = string.split('@');\n\tvar result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tvar labels = string.split('.');\n\tvar encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tvar output = [];\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t// Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nvar ucs2encode = function ucs2encode(array) {\n\treturn String.fromCodePoint.apply(String, toConsumableArray(array));\n};\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nvar basicToDigit = function basicToDigit(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nvar digitToBasic = function digitToBasic(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nvar adapt = function adapt(delta, numPoints, firstTime) {\n\tvar k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nvar decode = function decode(input) {\n\t// Don't use UCS-2.\n\tvar output = [];\n\tvar inputLength = input.length;\n\tvar i = 0;\n\tvar n = initialN;\n\tvar bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tvar basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (var j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror$1('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tvar oldi = i;\n\t\tfor (var w = 1, k = base;; /* no condition */k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror$1('invalid-input');\n\t\t\t}\n\n\t\t\tvar digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror$1('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tvar t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror$1('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\t\t}\n\n\t\tvar out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror$1('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\t}\n\n\treturn String.fromCodePoint.apply(String, output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nvar encode = function encode(input) {\n\tvar output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tvar inputLength = input.length;\n\n\t// Initialize the state.\n\tvar n = initialN;\n\tvar delta = 0;\n\tvar bias = initialBias;\n\n\t// Handle the basic code points.\n\tvar _iteratorNormalCompletion = true;\n\tvar _didIteratorError = false;\n\tvar _iteratorError = undefined;\n\n\ttry {\n\t\tfor (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar _currentValue2 = _step.value;\n\n\t\t\tif (_currentValue2 < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(_currentValue2));\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\n\t\t\t\t_iterator.return();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (_didIteratorError) {\n\t\t\t\tthrow _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar basicLength = output.length;\n\tvar handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tvar m = maxInt;\n\t\tvar _iteratorNormalCompletion2 = true;\n\t\tvar _didIteratorError2 = false;\n\t\tvar _iteratorError2 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar currentValue = _step2.value;\n\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow.\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return) {\n\t\t\t\t\t_iterator2.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) {\n\t\t\t\t\tthrow _iteratorError2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror$1('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tvar _iteratorNormalCompletion3 = true;\n\t\tvar _didIteratorError3 = false;\n\t\tvar _iteratorError3 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t\t\t\tvar _currentValue = _step3.value;\n\n\t\t\t\tif (_currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror$1('overflow');\n\t\t\t\t}\n\t\t\t\tif (_currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\t\tvar q = delta;\n\t\t\t\t\tfor (var k = base;; /* no condition */k += base) {\n\t\t\t\t\t\tvar t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar qMinusT = q - t;\n\t\t\t\t\t\tvar baseMinusT = base - t;\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError3 = true;\n\t\t\t_iteratorError3 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t\t\t\t\t_iterator3.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError3) {\n\t\t\t\t\tthrow _iteratorError3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nvar toUnicode = function toUnicode(input) {\n\treturn mapDomain(input, function (string) {\n\t\treturn regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nvar toASCII = function toASCII(input) {\n\treturn mapDomain(input, function (string) {\n\t\treturn regexNonASCII.test(string) ? 'xn--' + encode(string) : string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nvar punycode = {\n\t/**\n * A string representing the current Punycode.js version number.\n * @memberOf punycode\n * @type String\n */\n\t'version': '2.1.0',\n\t/**\n * An object of methods to convert from JavaScript's internal character\n * representation (UCS-2) to Unicode code points, and back.\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode\n * @type Object\n */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\n/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/uri-js\n */\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\nvar SCHEMES = {};\nfunction pctEncChar(chr) {\n var c = chr.charCodeAt(0);\n var e = void 0;\n if (c < 16) e = \"%0\" + c.toString(16).toUpperCase();else if (c < 128) e = \"%\" + c.toString(16).toUpperCase();else if (c < 2048) e = \"%\" + (c >> 6 | 192).toString(16).toUpperCase() + \"%\" + (c & 63 | 128).toString(16).toUpperCase();else e = \"%\" + (c >> 12 | 224).toString(16).toUpperCase() + \"%\" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + \"%\" + (c & 63 | 128).toString(16).toUpperCase();\n return e;\n}\nfunction pctDecChars(str) {\n var newStr = \"\";\n var i = 0;\n var il = str.length;\n while (i < il) {\n var c = parseInt(str.substr(i + 1, 2), 16);\n if (c < 128) {\n newStr += String.fromCharCode(c);\n i += 3;\n } else if (c >= 194 && c < 224) {\n if (il - i >= 6) {\n var c2 = parseInt(str.substr(i + 4, 2), 16);\n newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);\n } else {\n newStr += str.substr(i, 6);\n }\n i += 6;\n } else if (c >= 224) {\n if (il - i >= 9) {\n var _c = parseInt(str.substr(i + 4, 2), 16);\n var c3 = parseInt(str.substr(i + 7, 2), 16);\n newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);\n } else {\n newStr += str.substr(i, 9);\n }\n i += 9;\n } else {\n newStr += str.substr(i, 3);\n i += 3;\n }\n }\n return newStr;\n}\nfunction _normalizeComponentEncoding(components, protocol) {\n function decodeUnreserved(str) {\n var decStr = pctDecChars(str);\n return !decStr.match(protocol.UNRESERVED) ? str : decStr;\n }\n if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n return components;\n}\n\nfunction _stripLeadingZeros(str) {\n return str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\nfunction _normalizeIPv4(host, protocol) {\n var matches = host.match(protocol.IPV4ADDRESS) || [];\n\n var _matches = slicedToArray(matches, 2),\n address = _matches[1];\n\n if (address) {\n return address.split(\".\").map(_stripLeadingZeros).join(\".\");\n } else {\n return host;\n }\n}\nfunction _normalizeIPv6(host, protocol) {\n var matches = host.match(protocol.IPV6ADDRESS) || [];\n\n var _matches2 = slicedToArray(matches, 3),\n address = _matches2[1],\n zone = _matches2[2];\n\n if (address) {\n var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),\n _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),\n last = _address$toLowerCase$2[0],\n first = _address$toLowerCase$2[1];\n\n var firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n var lastFields = last.split(\":\").map(_stripLeadingZeros);\n var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n var fieldCount = isLastFieldIPv4Address ? 7 : 8;\n var lastFieldsStart = lastFields.length - fieldCount;\n var fields = Array(fieldCount);\n for (var x = 0; x < fieldCount; ++x) {\n fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n }\n if (isLastFieldIPv4Address) {\n fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n }\n var allZeroFields = fields.reduce(function (acc, field, index) {\n if (!field || field === \"0\") {\n var lastLongest = acc[acc.length - 1];\n if (lastLongest && lastLongest.index + lastLongest.length === index) {\n lastLongest.length++;\n } else {\n acc.push({ index: index, length: 1 });\n }\n }\n return acc;\n }, []);\n var longestZeroFields = allZeroFields.sort(function (a, b) {\n return b.length - a.length;\n })[0];\n var newHost = void 0;\n if (longestZeroFields && longestZeroFields.length > 1) {\n var newFirst = fields.slice(0, longestZeroFields.index);\n var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n newHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n } else {\n newHost = fields.join(\":\");\n }\n if (zone) {\n newHost += \"%\" + zone;\n }\n return newHost;\n } else {\n return host;\n }\n}\nvar URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nvar NO_MATCH_IS_UNDEFINED = \"\".match(/(){0}/)[1] === undefined;\nfunction parse(uriString) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var components = {};\n var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;\n if (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n var matches = uriString.match(URI_PARSE);\n if (matches) {\n if (NO_MATCH_IS_UNDEFINED) {\n //store each component\n components.scheme = matches[1];\n components.userinfo = matches[3];\n components.host = matches[4];\n components.port = parseInt(matches[5], 10);\n components.path = matches[6] || \"\";\n components.query = matches[7];\n components.fragment = matches[8];\n //fix port number\n if (isNaN(components.port)) {\n components.port = matches[5];\n }\n } else {\n //IE FIX for improper RegExp matching\n //store each component\n components.scheme = matches[1] || undefined;\n components.userinfo = uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined;\n components.host = uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined;\n components.port = parseInt(matches[5], 10);\n components.path = matches[6] || \"\";\n components.query = uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined;\n components.fragment = uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined;\n //fix port number\n if (isNaN(components.port)) {\n components.port = uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined;\n }\n }\n if (components.host) {\n //normalize IP hosts\n components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n }\n //determine reference type\n if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n components.reference = \"same-document\";\n } else if (components.scheme === undefined) {\n components.reference = \"relative\";\n } else if (components.fragment === undefined) {\n components.reference = \"absolute\";\n } else {\n components.reference = \"uri\";\n }\n //check for reference errors\n if (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n components.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n }\n //find scheme handler\n var schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n //check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n //if host component is a domain name\n if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {\n //convert Unicode IDN -> ASCII IDN\n try {\n components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n } catch (e) {\n components.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n }\n }\n //convert IRI -> URI\n _normalizeComponentEncoding(components, URI_PROTOCOL);\n } else {\n //normalize encodings\n _normalizeComponentEncoding(components, protocol);\n }\n //perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(components, options);\n }\n } else {\n components.error = components.error || \"URI can not be parsed.\";\n }\n return components;\n}\n\nfunction _recomposeAuthority(components, options) {\n var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;\n var uriTokens = [];\n if (components.userinfo !== undefined) {\n uriTokens.push(components.userinfo);\n uriTokens.push(\"@\");\n }\n if (components.host !== undefined) {\n //normalize IP hosts, add brackets and escape zone separator for IPv6\n uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {\n return \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\";\n }));\n }\n if (typeof components.port === \"number\") {\n uriTokens.push(\":\");\n uriTokens.push(components.port.toString(10));\n }\n return uriTokens.length ? uriTokens.join(\"\") : undefined;\n}\n\nvar RDS1 = /^\\.\\.?\\//;\nvar RDS2 = /^\\/\\.(\\/|$)/;\nvar RDS3 = /^\\/\\.\\.(\\/|$)/;\nvar RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\nfunction removeDotSegments(input) {\n var output = [];\n while (input.length) {\n if (input.match(RDS1)) {\n input = input.replace(RDS1, \"\");\n } else if (input.match(RDS2)) {\n input = input.replace(RDS2, \"/\");\n } else if (input.match(RDS3)) {\n input = input.replace(RDS3, \"/\");\n output.pop();\n } else if (input === \".\" || input === \"..\") {\n input = \"\";\n } else {\n var im = input.match(RDS5);\n if (im) {\n var s = im[0];\n input = input.slice(s.length);\n output.push(s);\n } else {\n throw new Error(\"Unexpected dot segment condition\");\n }\n }\n }\n return output.join(\"\");\n}\n\nfunction serialize(components) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;\n var uriTokens = [];\n //find scheme handler\n var schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n //perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n if (components.host) {\n //if host component is an IPv6 address\n if (protocol.IPV6ADDRESS.test(components.host)) {}\n //TODO: normalize IPv6 address as per RFC 5952\n\n //if host component is a domain name\n else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {\n //convert IDN via punycode\n try {\n components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);\n } catch (e) {\n components.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n }\n }\n }\n //normalize encoding\n _normalizeComponentEncoding(components, protocol);\n if (options.reference !== \"suffix\" && components.scheme) {\n uriTokens.push(components.scheme);\n uriTokens.push(\":\");\n }\n var authority = _recomposeAuthority(components, options);\n if (authority !== undefined) {\n if (options.reference !== \"suffix\") {\n uriTokens.push(\"//\");\n }\n uriTokens.push(authority);\n if (components.path && components.path.charAt(0) !== \"/\") {\n uriTokens.push(\"/\");\n }\n }\n if (components.path !== undefined) {\n var s = components.path;\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s);\n }\n if (authority === undefined) {\n s = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n }\n uriTokens.push(s);\n }\n if (components.query !== undefined) {\n uriTokens.push(\"?\");\n uriTokens.push(components.query);\n }\n if (components.fragment !== undefined) {\n uriTokens.push(\"#\");\n uriTokens.push(components.fragment);\n }\n return uriTokens.join(\"\"); //merge tokens into a string\n}\n\nfunction resolveComponents(base, relative) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var skipNormalization = arguments[3];\n\n var target = {};\n if (!skipNormalization) {\n base = parse(serialize(base, options), options); //normalize base components\n relative = parse(serialize(relative, options), options); //normalize relative components\n }\n options = options || {};\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme;\n //target.authority = relative.authority;\n target.userinfo = relative.userinfo;\n target.host = relative.host;\n target.port = relative.port;\n target.path = removeDotSegments(relative.path || \"\");\n target.query = relative.query;\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n //target.authority = relative.authority;\n target.userinfo = relative.userinfo;\n target.host = relative.host;\n target.port = relative.port;\n target.path = removeDotSegments(relative.path || \"\");\n target.query = relative.query;\n } else {\n if (!relative.path) {\n target.path = base.path;\n if (relative.query !== undefined) {\n target.query = relative.query;\n } else {\n target.query = base.query;\n }\n } else {\n if (relative.path.charAt(0) === \"/\") {\n target.path = removeDotSegments(relative.path);\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = \"/\" + relative.path;\n } else if (!base.path) {\n target.path = relative.path;\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n }\n target.path = removeDotSegments(target.path);\n }\n target.query = relative.query;\n }\n //target.authority = base.authority;\n target.userinfo = base.userinfo;\n target.host = base.host;\n target.port = base.port;\n }\n target.scheme = base.scheme;\n }\n target.fragment = relative.fragment;\n return target;\n}\n\nfunction resolve(baseURI, relativeURI, options) {\n var schemelessOptions = assign({ scheme: 'null' }, options);\n return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n}\n\nfunction normalize(uri, options) {\n if (typeof uri === \"string\") {\n uri = serialize(parse(uri, options), options);\n } else if (typeOf(uri) === \"object\") {\n uri = parse(serialize(uri, options), options);\n }\n return uri;\n}\n\nfunction equal(uriA, uriB, options) {\n if (typeof uriA === \"string\") {\n uriA = serialize(parse(uriA, options), options);\n } else if (typeOf(uriA) === \"object\") {\n uriA = serialize(uriA, options);\n }\n if (typeof uriB === \"string\") {\n uriB = serialize(parse(uriB, options), options);\n } else if (typeOf(uriB) === \"object\") {\n uriB = serialize(uriB, options);\n }\n return uriA === uriB;\n}\n\nfunction escapeComponent(str, options) {\n return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);\n}\n\nfunction unescapeComponent(str, options) {\n return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);\n}\n\nvar handler = {\n scheme: \"http\",\n domainHost: true,\n parse: function parse(components, options) {\n //report missing host\n if (!components.host) {\n components.error = components.error || \"HTTP URIs must have a host.\";\n }\n return components;\n },\n serialize: function serialize(components, options) {\n //normalize the default port\n if (components.port === (String(components.scheme).toLowerCase() !== \"https\" ? 80 : 443) || components.port === \"\") {\n components.port = undefined;\n }\n //normalize the empty path\n if (!components.path) {\n components.path = \"/\";\n }\n //NOTE: We do not parse query strings for HTTP URIs\n //as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n //and not the HTTP spec.\n return components;\n }\n};\n\nvar handler$1 = {\n scheme: \"https\",\n domainHost: handler.domainHost,\n parse: handler.parse,\n serialize: handler.serialize\n};\n\nvar O = {};\nvar isIRI = true;\n//RFC 3986\nvar UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nvar HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nvar PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nvar ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nvar QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nvar VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nvar SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nvar UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nvar PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nvar NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nvar NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nvar NOT_HFVALUE = NOT_HFNAME;\nfunction decodeUnreserved(str) {\n var decStr = pctDecChars(str);\n return !decStr.match(UNRESERVED) ? str : decStr;\n}\nvar handler$2 = {\n scheme: \"mailto\",\n parse: function parse$$1(components, options) {\n var mailtoComponents = components;\n var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(\",\") : [];\n mailtoComponents.path = undefined;\n if (mailtoComponents.query) {\n var unknownHeaders = false;\n var headers = {};\n var hfields = mailtoComponents.query.split(\"&\");\n for (var x = 0, xl = hfields.length; x < xl; ++x) {\n var hfield = hfields[x].split(\"=\");\n switch (hfield[0]) {\n case \"to\":\n var toAddrs = hfield[1].split(\",\");\n for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {\n to.push(toAddrs[_x]);\n }\n break;\n case \"subject\":\n mailtoComponents.subject = unescapeComponent(hfield[1], options);\n break;\n case \"body\":\n mailtoComponents.body = unescapeComponent(hfield[1], options);\n break;\n default:\n unknownHeaders = true;\n headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n break;\n }\n }\n if (unknownHeaders) mailtoComponents.headers = headers;\n }\n mailtoComponents.query = undefined;\n for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {\n var addr = to[_x2].split(\"@\");\n addr[0] = unescapeComponent(addr[0]);\n if (!options.unicodeSupport) {\n //convert Unicode IDN -> ASCII IDN\n try {\n addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n } catch (e) {\n mailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n }\n } else {\n addr[1] = unescapeComponent(addr[1], options).toLowerCase();\n }\n to[_x2] = addr.join(\"@\");\n }\n return mailtoComponents;\n },\n serialize: function serialize$$1(mailtoComponents, options) {\n var components = mailtoComponents;\n var to = toArray(mailtoComponents.to);\n if (to) {\n for (var x = 0, xl = to.length; x < xl; ++x) {\n var toAddr = String(to[x]);\n var atIdx = toAddr.lastIndexOf(\"@\");\n var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n var domain = toAddr.slice(atIdx + 1);\n //convert IDN via punycode\n try {\n domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);\n } catch (e) {\n components.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n }\n to[x] = localPart + \"@\" + domain;\n }\n components.path = to.join(\",\");\n }\n var headers = mailtoComponents.headers = mailtoComponents.headers || {};\n if (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n if (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n var fields = [];\n for (var name in headers) {\n if (headers[name] !== O[name]) {\n fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + \"=\" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));\n }\n }\n if (fields.length) {\n components.query = fields.join(\"&\");\n }\n return components;\n }\n};\n\nvar URN_PARSE = /^([^\\:]+)\\:(.*)/;\n//RFC 2141\nvar handler$3 = {\n scheme: \"urn\",\n parse: function parse$$1(components, options) {\n var matches = components.path && components.path.match(URN_PARSE);\n var urnComponents = components;\n if (matches) {\n var scheme = options.scheme || urnComponents.scheme || \"urn\";\n var nid = matches[1].toLowerCase();\n var nss = matches[2];\n var urnScheme = scheme + \":\" + (options.nid || nid);\n var schemeHandler = SCHEMES[urnScheme];\n urnComponents.nid = nid;\n urnComponents.nss = nss;\n urnComponents.path = undefined;\n if (schemeHandler) {\n urnComponents = schemeHandler.parse(urnComponents, options);\n }\n } else {\n urnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n }\n return urnComponents;\n },\n serialize: function serialize$$1(urnComponents, options) {\n var scheme = options.scheme || urnComponents.scheme || \"urn\";\n var nid = urnComponents.nid;\n var urnScheme = scheme + \":\" + (options.nid || nid);\n var schemeHandler = SCHEMES[urnScheme];\n if (schemeHandler) {\n urnComponents = schemeHandler.serialize(urnComponents, options);\n }\n var uriComponents = urnComponents;\n var nss = urnComponents.nss;\n uriComponents.path = (nid || options.nid) + \":\" + nss;\n return uriComponents;\n }\n};\n\nvar UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\n//RFC 4122\nvar handler$4 = {\n scheme: \"urn:uuid\",\n parse: function parse(urnComponents, options) {\n var uuidComponents = urnComponents;\n uuidComponents.uuid = uuidComponents.nss;\n uuidComponents.nss = undefined;\n if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n uuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n }\n return uuidComponents;\n },\n serialize: function serialize(uuidComponents, options) {\n var urnComponents = uuidComponents;\n //normalize UUID\n urnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n return urnComponents;\n }\n};\n\nSCHEMES[handler.scheme] = handler;\nSCHEMES[handler$1.scheme] = handler$1;\nSCHEMES[handler$2.scheme] = handler$2;\nSCHEMES[handler$3.scheme] = handler$3;\nSCHEMES[handler$4.scheme] = handler$4;\n\nexports.SCHEMES = SCHEMES;\nexports.pctEncChar = pctEncChar;\nexports.pctDecChars = pctDecChars;\nexports.parse = parse;\nexports.removeDotSegments = removeDotSegments;\nexports.serialize = serialize;\nexports.resolveComponents = resolveComponents;\nexports.resolve = resolve;\nexports.normalize = normalize;\nexports.equal = equal;\nexports.escapeComponent = escapeComponent;\nexports.unescapeComponent = unescapeComponent;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=uri.all.js.map\n\n\n//# sourceURL=webpack:///./node_modules/uri-js/dist/es5/uri.all.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/url/url.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/url/url.js ***!
|
||
\*********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar punycode = __webpack_require__(/*! punycode */ \"./node_modules/punycode/punycode.js\");\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/url/util.js\");\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\");\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n\n\n//# sourceURL=webpack:///./node_modules/url/url.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/url/util.js":
|
||
/*!**********************************!*\
|
||
!*** ./node_modules/url/util.js ***!
|
||
\**********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/url/util.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ut_metadata/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ut_metadata/index.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst bencode = __webpack_require__(/*! bencode */ \"./node_modules/bencode/lib/index.js\")\nconst BitField = __webpack_require__(/*! bitfield */ \"./node_modules/bitfield/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/ut_metadata/node_modules/debug/src/browser.js\")('ut_metadata')\nconst sha1 = __webpack_require__(/*! simple-sha1 */ \"./node_modules/simple-sha1/browser.js\")\n\nconst MAX_METADATA_SIZE = 1E7 // 10 MB\nconst BITFIELD_GROW = 1E3\nconst PIECE_LENGTH = 1 << 14 // 16 KiB\n\nmodule.exports = metadata => {\n class utMetadata extends EventEmitter {\n constructor (wire) {\n super()\n\n this._wire = wire\n\n this._fetching = false\n this._metadataComplete = false\n this._metadataSize = null\n // how many reject messages to tolerate before quitting\n this._remainingRejects = null\n\n // The largest torrent file that I know of is ~1-2MB, which is ~100\n // pieces. Therefore, cap the bitfield to 10x that (1000 pieces) so a\n // malicious peer can't make it grow to fill all memory.\n this._bitfield = new BitField(0, { grow: BITFIELD_GROW })\n\n if (Buffer.isBuffer(metadata)) {\n this.setMetadata(metadata)\n }\n }\n\n onHandshake (infoHash, peerId, extensions) {\n this._infoHash = infoHash\n }\n\n onExtendedHandshake (handshake) {\n if (!handshake.m || !handshake.m.ut_metadata) {\n return this.emit('warning', new Error('Peer does not support ut_metadata'))\n }\n if (!handshake.metadata_size) {\n return this.emit('warning', new Error('Peer does not have metadata'))\n }\n if (typeof handshake.metadata_size !== 'number' ||\n MAX_METADATA_SIZE < handshake.metadata_size ||\n handshake.metadata_size <= 0) {\n return this.emit('warning', new Error('Peer gave invalid metadata size'))\n }\n\n this._metadataSize = handshake.metadata_size\n this._numPieces = Math.ceil(this._metadataSize / PIECE_LENGTH)\n this._remainingRejects = this._numPieces * 2\n\n if (this._fetching) {\n this._requestPieces()\n }\n }\n\n onMessage (buf) {\n let dict\n let trailer\n try {\n const str = buf.toString()\n const trailerIndex = str.indexOf('ee') + 2\n dict = bencode.decode(str.substring(0, trailerIndex))\n trailer = buf.slice(trailerIndex)\n } catch (err) {\n // drop invalid messages\n return\n }\n\n switch (dict.msg_type) {\n case 0:\n // ut_metadata request (from peer)\n // example: { 'msg_type': 0, 'piece': 0 }\n this._onRequest(dict.piece)\n break\n case 1:\n // ut_metadata data (in response to our request)\n // example: { 'msg_type': 1, 'piece': 0, 'total_size': 3425 }\n this._onData(dict.piece, trailer, dict.total_size)\n break\n case 2:\n // ut_metadata reject (peer doesn't have piece we requested)\n // { 'msg_type': 2, 'piece': 0 }\n this._onReject(dict.piece)\n break\n }\n }\n\n /**\n * Ask the peer to send metadata.\n * @public\n */\n fetch () {\n if (this._metadataComplete) {\n return\n }\n this._fetching = true\n if (this._metadataSize) {\n this._requestPieces()\n }\n }\n\n /**\n * Stop asking the peer to send metadata.\n * @public\n */\n cancel () {\n this._fetching = false\n }\n\n setMetadata (metadata) {\n if (this._metadataComplete) return true\n debug('set metadata')\n\n // if full torrent dictionary was passed in, pull out just `info` key\n try {\n const info = bencode.decode(metadata).info\n if (info) {\n metadata = bencode.encode(info)\n }\n } catch (err) {}\n\n // check hash\n if (this._infoHash && this._infoHash !== sha1.sync(metadata)) {\n return false\n }\n\n this.cancel()\n\n this.metadata = metadata\n this._metadataComplete = true\n this._metadataSize = this.metadata.length\n this._wire.extendedHandshake.metadata_size = this._metadataSize\n\n this.emit('metadata', bencode.encode({\n info: bencode.decode(this.metadata)\n }))\n\n return true\n }\n\n _send (dict, trailer) {\n let buf = bencode.encode(dict)\n if (Buffer.isBuffer(trailer)) {\n buf = Buffer.concat([buf, trailer])\n }\n this._wire.extended('ut_metadata', buf)\n }\n\n _request (piece) {\n this._send({ msg_type: 0, piece })\n }\n\n _data (piece, buf, totalSize) {\n const msg = { msg_type: 1, piece }\n if (typeof totalSize === 'number') {\n msg.total_size = totalSize\n }\n this._send(msg, buf)\n }\n\n _reject (piece) {\n this._send({ msg_type: 2, piece })\n }\n\n _onRequest (piece) {\n if (!this._metadataComplete) {\n this._reject(piece)\n return\n }\n const start = piece * PIECE_LENGTH\n let end = start + PIECE_LENGTH\n if (end > this._metadataSize) {\n end = this._metadataSize\n }\n const buf = this.metadata.slice(start, end)\n this._data(piece, buf, this._metadataSize)\n }\n\n _onData (piece, buf, totalSize) {\n if (buf.length > PIECE_LENGTH) {\n return\n }\n buf.copy(this.metadata, piece * PIECE_LENGTH)\n this._bitfield.set(piece)\n this._checkDone()\n }\n\n _onReject (piece) {\n if (this._remainingRejects > 0 && this._fetching) {\n // If we haven't been rejected too much,\n // then try to request the piece again\n this._request(piece)\n this._remainingRejects -= 1\n } else {\n this.emit('warning', new Error('Peer sent \"reject\" too much'))\n }\n }\n\n _requestPieces () {\n this.metadata = Buffer.alloc(this._metadataSize)\n for (let piece = 0; piece < this._numPieces; piece++) {\n this._request(piece)\n }\n }\n\n _checkDone () {\n let done = true\n for (let piece = 0; piece < this._numPieces; piece++) {\n if (!this._bitfield.get(piece)) {\n done = false\n break\n }\n }\n if (!done) return\n\n // attempt to set metadata -- may fail sha1 check\n const success = this.setMetadata(this.metadata)\n\n if (!success) {\n this._failedMetadata()\n }\n }\n\n _failedMetadata () {\n // reset bitfield & try again\n this._bitfield = new BitField(0, { grow: BITFIELD_GROW })\n this._remainingRejects -= this._numPieces\n if (this._remainingRejects > 0) {\n this._requestPieces()\n } else {\n this.emit('warning', new Error('Peer sent invalid metadata'))\n }\n }\n }\n\n // Name of the bittorrent-protocol extension\n utMetadata.prototype.name = 'ut_metadata'\n\n return utMetadata\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/ut_metadata/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ut_metadata/node_modules/debug/src/browser.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/ut_metadata/node_modules/debug/src/browser.js ***!
|
||
\********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/ut_metadata/node_modules/debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/ut_metadata/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ut_metadata/node_modules/debug/src/common.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/ut_metadata/node_modules/debug/src/common.js ***!
|
||
\*******************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/ut_metadata/node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/util-deprecate/browser.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/util-deprecate/browser.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(global) {\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/util-deprecate/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/uuid/lib/bytesToUuid.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/uuid/lib/bytesToUuid.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([bth[buf[i++]], bth[buf[i++]], \n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]]]).join('');\n}\n\nmodule.exports = bytesToUuid;\n\n\n//# sourceURL=webpack:///./node_modules/uuid/lib/bytesToUuid.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/uuid/lib/rng-browser.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/uuid/lib/rng-browser.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/uuid/lib/rng-browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/uuid/v4.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/uuid/v4.js ***!
|
||
\*********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var rng = __webpack_require__(/*! ./lib/rng */ \"./node_modules/uuid/lib/rng-browser.js\");\nvar bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ \"./node_modules/uuid/lib/bytesToUuid.js\");\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n\n//# sourceURL=webpack:///./node_modules/uuid/v4.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/varint/decode.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/varint/decode.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = read\n\nvar MSB = 0x80\n , REST = 0x7F\n\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length\n\n do {\n if (counter >= l) {\n read.bytes = 0\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++]\n res += shift < 28\n ? (b & REST) << shift\n : (b & REST) * Math.pow(2, shift)\n shift += 7\n } while (b >= MSB)\n\n read.bytes = counter - offset\n\n return res\n}\n\n\n//# sourceURL=webpack:///./node_modules/varint/decode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/varint/encode.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/varint/encode.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = encode\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n out = out || []\n offset = offset || 0\n var oldOffset = offset\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB\n num /= 128\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB\n num >>>= 7\n }\n out[offset] = num | 0\n \n encode.bytes = offset - oldOffset + 1\n \n return out\n}\n\n\n//# sourceURL=webpack:///./node_modules/varint/encode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/varint/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/varint/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("module.exports = {\n encode: __webpack_require__(/*! ./encode.js */ \"./node_modules/varint/encode.js\")\n , decode: __webpack_require__(/*! ./decode.js */ \"./node_modules/varint/decode.js\")\n , encodingLength: __webpack_require__(/*! ./length.js */ \"./node_modules/varint/length.js\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/varint/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/varint/length.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/varint/length.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\nvar N1 = Math.pow(2, 7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n}\n\n\n//# sourceURL=webpack:///./node_modules/varint/length.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/verror/lib/verror.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/verror/lib/verror.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/*\n * verror.js: richer JavaScript errors\n */\n\nvar mod_assertplus = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\nvar mod_extsprintf = __webpack_require__(/*! extsprintf */ \"./node_modules/verror/node_modules/extsprintf/lib/extsprintf.js\");\nvar mod_isError = __webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\").isError;\nvar sprintf = mod_extsprintf.sprintf;\n\n/*\n * Public interface\n */\n\n/* So you can 'var VError = require('verror')' */\nmodule.exports = VError;\n/* For compatibility */\nVError.VError = VError;\n/* Other exported classes */\nVError.SError = SError;\nVError.WError = WError;\nVError.MultiError = MultiError;\n\n/*\n * Common function used to parse constructor arguments for VError, WError, and\n * SError. Named arguments to this function:\n *\n * strict\t\tforce strict interpretation of sprintf arguments, even\n * \t\t\tif the options in \"argv\" don't say so\n *\n * argv\t\terror's constructor arguments, which are to be\n * \t\t\tinterpreted as described in README.md. For quick\n * \t\t\treference, \"argv\" has one of the following forms:\n *\n * [ sprintf_args... ] (argv[0] is a string)\n * [ cause, sprintf_args... ] (argv[0] is an Error)\n * [ options, sprintf_args... ] (argv[0] is an object)\n *\n * This function normalizes these forms, producing an object with the following\n * properties:\n *\n * options equivalent to \"options\" in third form. This will never\n * \t\t\tbe a direct reference to what the caller passed in\n * \t\t\t(i.e., it may be a shallow copy), so it can be freely\n * \t\t\tmodified.\n *\n * shortmessage result of sprintf(sprintf_args), taking options.strict\n * \t\t\tinto account as described in README.md.\n */\nfunction parseConstructorArguments(args)\n{\n\tvar argv, options, sprintf_args, shortmessage, k;\n\n\tmod_assertplus.object(args, 'args');\n\tmod_assertplus.bool(args.strict, 'args.strict');\n\tmod_assertplus.array(args.argv, 'args.argv');\n\targv = args.argv;\n\n\t/*\n\t * First, figure out which form of invocation we've been given.\n\t */\n\tif (argv.length === 0) {\n\t\toptions = {};\n\t\tsprintf_args = [];\n\t} else if (mod_isError(argv[0])) {\n\t\toptions = { 'cause': argv[0] };\n\t\tsprintf_args = argv.slice(1);\n\t} else if (typeof (argv[0]) === 'object') {\n\t\toptions = {};\n\t\tfor (k in argv[0]) {\n\t\t\toptions[k] = argv[0][k];\n\t\t}\n\t\tsprintf_args = argv.slice(1);\n\t} else {\n\t\tmod_assertplus.string(argv[0],\n\t\t 'first argument to VError, SError, or WError ' +\n\t\t 'constructor must be a string, object, or Error');\n\t\toptions = {};\n\t\tsprintf_args = argv;\n\t}\n\n\t/*\n\t * Now construct the error's message.\n\t *\n\t * extsprintf (which we invoke here with our caller's arguments in order\n\t * to construct this Error's message) is strict in its interpretation of\n\t * values to be processed by the \"%s\" specifier. The value passed to\n\t * extsprintf must actually be a string or something convertible to a\n\t * String using .toString(). Passing other values (notably \"null\" and\n\t * \"undefined\") is considered a programmer error. The assumption is\n\t * that if you actually want to print the string \"null\" or \"undefined\",\n\t * then that's easy to do that when you're calling extsprintf; on the\n\t * other hand, if you did NOT want that (i.e., there's actually a bug\n\t * where the program assumes some variable is non-null and tries to\n\t * print it, which might happen when constructing a packet or file in\n\t * some specific format), then it's better to stop immediately than\n\t * produce bogus output.\n\t *\n\t * However, sometimes the bug is only in the code calling VError, and a\n\t * programmer might prefer to have the error message contain \"null\" or\n\t * \"undefined\" rather than have the bug in the error path crash the\n\t * program (making the first bug harder to identify). For that reason,\n\t * by default VError converts \"null\" or \"undefined\" arguments to their\n\t * string representations and passes those to extsprintf. Programmers\n\t * desiring the strict behavior can use the SError class or pass the\n\t * \"strict\" option to the VError constructor.\n\t */\n\tmod_assertplus.object(options);\n\tif (!options.strict && !args.strict) {\n\t\tsprintf_args = sprintf_args.map(function (a) {\n\t\t\treturn (a === null ? 'null' :\n\t\t\t a === undefined ? 'undefined' : a);\n\t\t});\n\t}\n\n\tif (sprintf_args.length === 0) {\n\t\tshortmessage = '';\n\t} else {\n\t\tshortmessage = sprintf.apply(null, sprintf_args);\n\t}\n\n\treturn ({\n\t 'options': options,\n\t 'shortmessage': shortmessage\n\t});\n}\n\n/*\n * See README.md for reference documentation.\n */\nfunction VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}\n\nmod_util.inherits(VError, Error);\nVError.prototype.name = 'VError';\n\nVError.prototype.toString = function ve_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\n\treturn (str);\n};\n\n/*\n * This method is provided for compatibility. New callers should use\n * VError.cause() instead. That method also uses the saner `null` return value\n * when there is no cause.\n */\nVError.prototype.cause = function ve_cause()\n{\n\tvar cause = VError.cause(this);\n\treturn (cause === null ? undefined : cause);\n};\n\n/*\n * Static methods\n *\n * These class-level methods are provided so that callers can use them on\n * instances of Errors that are not VErrors. New interfaces should be provided\n * only using static methods to eliminate the class of programming mistake where\n * people fail to check whether the Error object has the corresponding methods.\n */\n\nVError.cause = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\treturn (mod_isError(err.jse_cause) ? err.jse_cause : null);\n};\n\nVError.info = function (err)\n{\n\tvar rv, cause, k;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tcause = VError.cause(err);\n\tif (cause !== null) {\n\t\trv = VError.info(cause);\n\t} else {\n\t\trv = {};\n\t}\n\n\tif (typeof (err.jse_info) == 'object' && err.jse_info !== null) {\n\t\tfor (k in err.jse_info) {\n\t\t\trv[k] = err.jse_info[k];\n\t\t}\n\t}\n\n\treturn (rv);\n};\n\nVError.findCauseByName = function (err, name)\n{\n\tvar cause;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.string(name, 'name');\n\tmod_assertplus.ok(name.length > 0, 'name cannot be empty');\n\n\tfor (cause = err; cause !== null; cause = VError.cause(cause)) {\n\t\tmod_assertplus.ok(mod_isError(cause));\n\t\tif (cause.name == name) {\n\t\t\treturn (cause);\n\t\t}\n\t}\n\n\treturn (null);\n};\n\nVError.hasCauseWithName = function (err, name)\n{\n\treturn (VError.findCauseByName(err, name) !== null);\n};\n\nVError.fullStack = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\n\tvar cause = VError.cause(err);\n\n\tif (cause) {\n\t\treturn (err.stack + '\\ncaused by: ' + VError.fullStack(cause));\n\t}\n\n\treturn (err.stack);\n};\n\nVError.errorFromList = function (errors)\n{\n\tmod_assertplus.arrayOfObject(errors, 'errors');\n\n\tif (errors.length === 0) {\n\t\treturn (null);\n\t}\n\n\terrors.forEach(function (e) {\n\t\tmod_assertplus.ok(mod_isError(e));\n\t});\n\n\tif (errors.length == 1) {\n\t\treturn (errors[0]);\n\t}\n\n\treturn (new MultiError(errors));\n};\n\nVError.errorForEach = function (err, func)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.func(func, 'func');\n\n\tif (err instanceof MultiError) {\n\t\terr.errors().forEach(function iterError(e) { func(e); });\n\t} else {\n\t\tfunc(err);\n\t}\n};\n\n\n/*\n * SError is like VError, but stricter about types. You cannot pass \"null\" or\n * \"undefined\" as string arguments to the formatter.\n */\nfunction SError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof SError)) {\n\t\tobj = Object.create(SError.prototype);\n\t\tSError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': true\n\t});\n\n\toptions = parsed.options;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\n/*\n * We don't bother setting SError.prototype.name because once constructed,\n * SErrors are just like VErrors.\n */\nmod_util.inherits(SError, VError);\n\n\n/*\n * Represents a collection of errors for the purpose of consumers that generally\n * only deal with one error. Callers can extract the individual errors\n * contained in this object, but may also just treat it as a normal single\n * error, in which case a summary message will be printed.\n */\nfunction MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}\n\nmod_util.inherits(MultiError, VError);\nMultiError.prototype.name = 'MultiError';\n\nMultiError.prototype.errors = function me_errors()\n{\n\treturn (this.ase_errors.slice(0));\n};\n\n\n/*\n * See README.md for reference details.\n */\nfunction WError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof WError)) {\n\t\tobj = Object.create(WError.prototype);\n\t\tWError.apply(obj, args);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\toptions = parsed.options;\n\toptions['skipCauseMessage'] = true;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\nmod_util.inherits(WError, VError);\nWError.prototype.name = 'WError';\n\nWError.prototype.toString = function we_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\tif (this.jse_cause && this.jse_cause.message)\n\t\tstr += '; caused by ' + this.jse_cause.toString();\n\n\treturn (str);\n};\n\n/*\n * For purely historical reasons, WError's cause() function allows you to set\n * the cause.\n */\nWError.prototype.cause = function we_cause(c)\n{\n\tif (mod_isError(c))\n\t\tthis.jse_cause = c;\n\n\treturn (this.jse_cause);\n};\n\n\n//# sourceURL=webpack:///./node_modules/verror/lib/verror.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/verror/node_modules/extsprintf/lib/extsprintf.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/verror/node_modules/extsprintf/lib/extsprintf.js ***!
|
||
\***********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = __webpack_require__(/*! assert */ \"./node_modules/assert/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"./node_modules/node-libs-browser/node_modules/util/util.js\");\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(ofmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\n\t/* variadic arguments used to fill in conversion specifiers */\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\t/* remaining format string */\n\tvar fmt = ofmt;\n\n\t/* components of the current conversion specifier */\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\n\t/* return value */\n\tvar ret = '';\n\n\t/* current variadic argument (1-based) */\n\tvar argn = 1;\n\t/* 0-based position in the format string that we've read */\n\tvar posn = 0;\n\t/* 1-based position in the format string of the current conversion */\n\tvar convposn;\n\t/* current conversion specifier */\n\tvar curconv;\n\n\tmod_assert.equal('string', typeof (fmt),\n\t 'first argument must be a format string');\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\t/*\n\t\t * Update flags related to the current conversion specifier's\n\t\t * position so that we can report clear error messages.\n\t\t */\n\t\tcurconv = match[0].substring(match[1].length);\n\t\tconvposn = posn + match[1].length + 1;\n\t\tposn += match[0].length;\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'has no matching argument ' +\n\t\t\t '(too few arguments passed)'));\n\t\t}\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/)) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses unsupported flags'));\n\t\t}\n\n\t\tif (precision.length > 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses non-zero precision (not supported)'));\n\t\t}\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null) {\n\t\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t\t 'attempted to print undefined or null ' +\n\t\t\t\t 'as a string (argument ' + argn + ' to ' +\n\t\t\t\t 'sprintf)'));\n\t\t\t}\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'is not supported'));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsError(fmtstr, convposn, curconv, reason) {\n\tmod_assert.equal(typeof (fmtstr), 'string');\n\tmod_assert.equal(typeof (curconv), 'string');\n\tmod_assert.equal(typeof (convposn), 'number');\n\tmod_assert.equal(typeof (reason), 'string');\n\treturn (new Error('format string \"' + fmtstr +\n\t '\": conversion specifier \"' + curconv + '\" at character ' +\n\t convposn + ' ' + reason));\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/verror/node_modules/extsprintf/lib/extsprintf.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/videostream/mp4-remuxer.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/videostream/mp4-remuxer.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bs = __webpack_require__(/*! binary-search */ \"./node_modules/binary-search/index.js\")\nvar EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar mp4 = __webpack_require__(/*! mp4-stream */ \"./node_modules/mp4-stream/index.js\")\nvar Box = __webpack_require__(/*! mp4-box-encoding */ \"./node_modules/mp4-box-encoding/index.js\")\nvar RangeSliceStream = __webpack_require__(/*! range-slice-stream */ \"./node_modules/range-slice-stream/index.js\")\n\nmodule.exports = MP4Remuxer\n\nfunction MP4Remuxer (file) {\n\tvar self = this\n\tEventEmitter.call(self)\n\tself._tracks = []\n\tself._fragmentSequence = 1\n\tself._file = file\n\tself._decoder = null\n\tself._findMoov(0)\n}\n\ninherits(MP4Remuxer, EventEmitter)\n\nMP4Remuxer.prototype._findMoov = function (offset) {\n\tvar self = this\n\n\tif (self._decoder) {\n\t\tself._decoder.destroy()\n\t}\n\n\tself._decoder = mp4.decode()\n\tvar fileStream = self._file.createReadStream({\n\t\tstart: offset\n\t})\n\tfileStream.pipe(self._decoder)\n\n\tself._decoder.once('box', function (headers) {\n\t\tif (headers.type === 'moov') {\n\t\t\tself._decoder.decode(function (moov) {\n\t\t\t\tfileStream.destroy()\n\t\t\t\ttry {\n\t\t\t\t\tself._processMoov(moov)\n\t\t\t\t} catch (err) {\n\t\t\t\t\terr.message = 'Cannot parse mp4 file: ' + err.message\n\t\t\t\t\tself.emit('error', err)\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tfileStream.destroy()\n\t\t\tself._findMoov(offset + headers.length)\n\t\t}\n\t})\n}\n\nfunction RunLengthIndex (entries, countName) {\n\tvar self = this\n\tself._entries = entries\n\tself._countName = countName || 'count'\n\tself._index = 0\n\tself._offset = 0\n\n\tself.value = self._entries[0]\n}\n\nRunLengthIndex.prototype.inc = function () {\n\tvar self = this\n\tself._offset++\n\tif (self._offset >= self._entries[self._index][self._countName]) {\n\t\tself._index++\n\t\tself._offset = 0\n\t}\n\n\tself.value = self._entries[self._index]\n}\n\nMP4Remuxer.prototype._processMoov = function (moov) {\n\tvar self = this\n\n\tvar traks = moov.traks\n\tself._tracks = []\n\tself._hasVideo = false\n\tself._hasAudio = false\n\tfor (var i = 0; i < traks.length; i++) {\n\t\tvar trak = traks[i]\n\t\tvar stbl = trak.mdia.minf.stbl\n\t\tvar stsdEntry = stbl.stsd.entries[0]\n\t\tvar handlerType = trak.mdia.hdlr.handlerType\n\t\tvar codec\n\t\tvar mime\n\t\tif (handlerType === 'vide' && stsdEntry.type === 'avc1') {\n\t\t\tif (self._hasVideo) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tself._hasVideo = true\n\t\t\tcodec = 'avc1'\n\t\t\tif (stsdEntry.avcC) {\n\t\t\t\tcodec += '.' + stsdEntry.avcC.mimeCodec\n\t\t\t}\n\t\t\tmime = 'video/mp4; codecs=\"' + codec + '\"'\n\t\t} else if (handlerType === 'soun' && stsdEntry.type === 'mp4a') {\n\t\t\tif (self._hasAudio) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tself._hasAudio = true\n\t\t\tcodec = 'mp4a'\n\t\t\tif (stsdEntry.esds && stsdEntry.esds.mimeCodec) {\n\t\t\t\tcodec += '.' + stsdEntry.esds.mimeCodec\n\t\t\t}\n\t\t\tmime = 'audio/mp4; codecs=\"' + codec + '\"'\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar samples = []\n\t\tvar sample = 0\n\n\t\t// Chunk/position data\n\t\tvar sampleInChunk = 0\n\t\tvar chunk = 0\n\t\tvar offsetInChunk = 0\n\t\tvar sampleToChunkIndex = 0\n\n\t\t// Time data\n\t\tvar dts = 0\n\t\tvar decodingTimeEntry = new RunLengthIndex(stbl.stts.entries)\n\t\tvar presentationOffsetEntry = null\n\t\tif (stbl.ctts) {\n\t\t\tpresentationOffsetEntry = new RunLengthIndex(stbl.ctts.entries)\n\t\t}\n\n\t\t// Sync table index\n\t\tvar syncSampleIndex = 0\n\n\t\twhile (true) {\n\t\t\tvar currChunkEntry = stbl.stsc.entries[sampleToChunkIndex]\n\n\t\t\t// Compute size\n\t\t\tvar size = stbl.stsz.entries[sample]\n\n\t\t\t// Compute time data\n\t\t\tvar duration = decodingTimeEntry.value.duration\n\t\t\tvar presentationOffset = presentationOffsetEntry ? presentationOffsetEntry.value.compositionOffset : 0\n\n\t\t\t// Compute sync\n\t\t\tvar sync = true\n\t\t\tif (stbl.stss) {\n\t\t\t\tsync = stbl.stss.entries[syncSampleIndex] === sample + 1\n\t\t\t}\n\n\t\t\t// Create new sample entry\n\t\t\tvar chunkOffsetTable = stbl.stco || stbl.co64\n\t\t\tsamples.push({\n\t\t\t\tsize: size,\n\t\t\t\tduration: duration,\n\t\t\t\tdts: dts,\n\t\t\t\tpresentationOffset: presentationOffset,\n\t\t\t\tsync: sync,\n\t\t\t\toffset: offsetInChunk + chunkOffsetTable.entries[chunk]\n\t\t\t})\n\n\t\t\t// Go to next sample\n\t\t\tsample++\n\t\t\tif (sample >= stbl.stsz.entries.length) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Move position/chunk\n\t\t\tsampleInChunk++\n\t\t\toffsetInChunk += size\n\t\t\tif (sampleInChunk >= currChunkEntry.samplesPerChunk) {\n\t\t\t\t// Move to new chunk\n\t\t\t\tsampleInChunk = 0\n\t\t\t\toffsetInChunk = 0\n\t\t\t\tchunk++\n\t\t\t\t// Move sample to chunk box index\n\t\t\t\tvar nextChunkEntry = stbl.stsc.entries[sampleToChunkIndex + 1]\n\t\t\t\tif (nextChunkEntry && chunk + 1 >= nextChunkEntry.firstChunk) {\n\t\t\t\t\tsampleToChunkIndex++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Move time forward\n\t\t\tdts += duration\n\t\t\tdecodingTimeEntry.inc()\n\t\t\tpresentationOffsetEntry && presentationOffsetEntry.inc()\n\n\t\t\t// Move sync table index\n\t\t\tif (sync) {\n\t\t\t\tsyncSampleIndex++\n\t\t\t}\n\t\t}\n\n\t\ttrak.mdia.mdhd.duration = 0\n\t\ttrak.tkhd.duration = 0\n\n\t\tvar defaultSampleDescriptionIndex = currChunkEntry.sampleDescriptionId\n\n\t\tvar trackMoov = {\n\t\t\ttype: 'moov',\n\t\t\tmvhd: moov.mvhd,\n\t\t\ttraks: [{\n\t\t\t\ttkhd: trak.tkhd,\n\t\t\t\tmdia: {\n\t\t\t\t\tmdhd: trak.mdia.mdhd,\n\t\t\t\t\thdlr: trak.mdia.hdlr,\n\t\t\t\t\telng: trak.mdia.elng,\n\t\t\t\t\tminf: {\n\t\t\t\t\t\tvmhd: trak.mdia.minf.vmhd,\n\t\t\t\t\t\tsmhd: trak.mdia.minf.smhd,\n\t\t\t\t\t\tdinf: trak.mdia.minf.dinf,\n\t\t\t\t\t\tstbl: {\n\t\t\t\t\t\t\tstsd: stbl.stsd,\n\t\t\t\t\t\t\tstts: empty(),\n\t\t\t\t\t\t\tctts: empty(),\n\t\t\t\t\t\t\tstsc: empty(),\n\t\t\t\t\t\t\tstsz: empty(),\n\t\t\t\t\t\t\tstco: empty(),\n\t\t\t\t\t\t\tstss: empty()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}],\n\t\t\tmvex: {\n\t\t\t\tmehd: {\n\t\t\t\t\tfragmentDuration: moov.mvhd.duration\n\t\t\t\t},\n\t\t\t\ttrexs: [{\n\t\t\t\t\ttrackId: trak.tkhd.trackId,\n\t\t\t\t\tdefaultSampleDescriptionIndex: defaultSampleDescriptionIndex,\n\t\t\t\t\tdefaultSampleDuration: 0,\n\t\t\t\t\tdefaultSampleSize: 0,\n\t\t\t\t\tdefaultSampleFlags: 0\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\n\t\tself._tracks.push({\n\t\t\ttrackId: trak.tkhd.trackId,\n\t\t\ttimeScale: trak.mdia.mdhd.timeScale,\n\t\t\tsamples: samples,\n\t\t\tcurrSample: null,\n\t\t\tcurrTime: null,\n\t\t\tmoov: trackMoov,\n\t\t\tmime: mime\n\t\t})\n\t}\n\n\tif (self._tracks.length === 0) {\n\t\tself.emit('error', new Error('no playable tracks'))\n\t\treturn\n\t}\n\n\t// Must be set last since this is used above\n\tmoov.mvhd.duration = 0\n\n\tself._ftyp = {\n\t\ttype: 'ftyp',\n\t\tbrand: 'iso5',\n\t\tbrandVersion: 0,\n\t\tcompatibleBrands: [\n\t\t\t'iso5'\n\t\t]\n\t}\n\n\tvar ftypBuf = Box.encode(self._ftyp)\n\tvar data = self._tracks.map(function (track) {\n\t\tvar moovBuf = Box.encode(track.moov)\n\t\treturn {\n\t\t\tmime: track.mime,\n\t\t\tinit: Buffer.concat([ftypBuf, moovBuf])\n\t\t}\n\t})\n\n\tself.emit('ready', data)\n}\n\nfunction empty () {\n\treturn {\n\t\tversion: 0,\n\t\tflags: 0,\n\t\tentries: []\n\t}\n}\n\nMP4Remuxer.prototype.seek = function (time) {\n\tvar self = this\n\tif (!self._tracks) {\n\t\tthrow new Error('Not ready yet; wait for \\'ready\\' event')\n\t}\n\n\tif (self._fileStream) {\n\t\tself._fileStream.destroy()\n\t\tself._fileStream = null\n\t}\n\n\tvar startOffset = -1\n\tself._tracks.map(function (track, i) {\n\t\t// find the keyframe before the time\n\t\t// stream from there\n\t\tif (track.outStream) {\n\t\t\ttrack.outStream.destroy()\n\t\t}\n\t\tif (track.inStream) {\n\t\t\ttrack.inStream.destroy()\n\t\t\ttrack.inStream = null\n\t\t}\n\t\tvar outStream = track.outStream = mp4.encode()\n\t\tvar fragment = self._generateFragment(i, time)\n\t\tif (!fragment) {\n\t\t\treturn outStream.finalize()\n\t\t}\n\n\t\tif (startOffset === -1 || fragment.ranges[0].start < startOffset) {\n\t\t\tstartOffset = fragment.ranges[0].start\n\t\t}\n\n\t\twriteFragment(fragment)\n\n\t\tfunction writeFragment (frag) {\n\t\t\tif (outStream.destroyed) return\n\t\t\toutStream.box(frag.moof, function (err) {\n\t\t\t\tif (err) return self.emit('error', err)\n\t\t\t\tif (outStream.destroyed) return\n\t\t\t\tvar slicedStream = track.inStream.slice(frag.ranges)\n\t\t\t\tslicedStream.pipe(outStream.mediaData(frag.length, function (err) {\n\t\t\t\t\tif (err) return self.emit('error', err)\n\t\t\t\t\tif (outStream.destroyed) return\n\t\t\t\t\tvar nextFrag = self._generateFragment(i)\n\t\t\t\t\tif (!nextFrag) {\n\t\t\t\t\t\treturn outStream.finalize()\n\t\t\t\t\t}\n\t\t\t\t\twriteFragment(nextFrag)\n\t\t\t\t}))\n\t\t\t})\n\t\t}\n\t})\n\n\tif (startOffset >= 0) {\n\t\tvar fileStream = self._fileStream = self._file.createReadStream({\n\t\t\tstart: startOffset\n\t\t})\n\n\t\tself._tracks.forEach(function (track) {\n\t\t\ttrack.inStream = new RangeSliceStream(startOffset, {\n\t\t\t\t// Allow up to a 10MB offset between audio and video,\n\t\t\t\t// which should be fine for any reasonable interleaving\n\t\t\t\t// interval and bitrate\n\t\t\t\thighWaterMark: 10000000\n\t\t\t})\n\t\t\tfileStream.pipe(track.inStream)\n\t\t})\n\t}\n\n\treturn self._tracks.map(function (track) {\n\t\treturn track.outStream\n\t})\n}\n\nMP4Remuxer.prototype._findSampleBefore = function (trackInd, time) {\n\tvar self = this\n\n\tvar track = self._tracks[trackInd]\n\tvar scaledTime = Math.floor(track.timeScale * time)\n\tvar sample = bs(track.samples, scaledTime, function (sample, t) {\n\t\tvar pts = sample.dts + sample.presentationOffset// - track.editShift\n\t\treturn pts - t\n\t})\n\tif (sample === -1) {\n\t\tsample = 0\n\t} else if (sample < 0) {\n\t\tsample = -sample - 2\n\t}\n\t// sample is now the last sample with dts <= time\n\t// Find the preceeding sync sample\n\twhile (!track.samples[sample].sync) {\n\t\tsample--\n\t}\n\treturn sample\n}\n\nvar MIN_FRAGMENT_DURATION = 1 // second\n\nMP4Remuxer.prototype._generateFragment = function (track, time) {\n\tvar self = this\n\t/*\n\t1. Find correct sample\n\t2. Process backward until sync sample found\n\t3. Process forward until next sync sample after MIN_FRAGMENT_DURATION found\n\t*/\n\tvar currTrack = self._tracks[track]\n\tvar firstSample\n\tif (time !== undefined) {\n\t\tfirstSample = self._findSampleBefore(track, time)\n\t} else {\n\t\tfirstSample = currTrack.currSample\n\t}\n\n\tif (firstSample >= currTrack.samples.length)\n\t\treturn null\n\n\tvar startDts = currTrack.samples[firstSample].dts\n\n\tvar totalLen = 0\n\tvar ranges = []\n\tfor (var currSample = firstSample; currSample < currTrack.samples.length; currSample++) {\n\t\tvar sample = currTrack.samples[currSample]\n\t\tif (sample.sync && sample.dts - startDts >= currTrack.timeScale * MIN_FRAGMENT_DURATION) {\n\t\t\tbreak // This is a reasonable place to end the fragment\n\t\t}\n\n\t\ttotalLen += sample.size\n\t\tvar currRange = ranges.length - 1\n\t\tif (currRange < 0 || ranges[currRange].end !== sample.offset) {\n\t\t\t// Push a new range\n\t\t\tranges.push({\n\t\t\t\tstart: sample.offset,\n\t\t\t\tend: sample.offset + sample.size\n\t\t\t})\n\t\t} else {\n\t\t\tranges[currRange].end += sample.size\n\t\t}\n\t}\n\n\tcurrTrack.currSample = currSample\n\n\treturn {\n\t\tmoof: self._generateMoof(track, firstSample, currSample),\n\t\tranges: ranges,\n\t\tlength: totalLen\n\t}\n}\n\nMP4Remuxer.prototype._generateMoof = function (track, firstSample, lastSample) {\n\tvar self = this\n\n\tvar currTrack = self._tracks[track]\n\n\tvar entries = []\n\tvar trunVersion = 0\n\tfor (var j = firstSample; j < lastSample; j++) {\n\t\tvar currSample = currTrack.samples[j]\n\t\tif (currSample.presentationOffset < 0)\n\t\t\ttrunVersion = 1\n\t\tentries.push({\n\t\t\tsampleDuration: currSample.duration,\n\t\t\tsampleSize: currSample.size,\n\t\t\tsampleFlags: currSample.sync ? 0x2000000 : 0x1010000,\n\t\t\tsampleCompositionTimeOffset: currSample.presentationOffset\n\t\t})\n\t}\n\n\tvar moof = {\n\t\ttype: 'moof',\n\t\tmfhd: {\n\t\t\tsequenceNumber: self._fragmentSequence++\n\t\t},\n\t\ttrafs: [{\n\t\t\ttfhd: {\n\t\t\t\tflags: 0x20000, // default-base-is-moof\n\t\t\t\ttrackId: currTrack.trackId\n\t\t\t},\n\t\t\ttfdt: {\n\t\t\t\tbaseMediaDecodeTime: currTrack.samples[firstSample].dts\n\t\t\t},\n\t\t\ttrun: {\n\t\t\t\tflags: 0xf01,\n\t\t\t\tdataOffset: 8, // The moof size has to be added to this later as well\n\t\t\t\tentries: entries,\n\t\t\t\tversion: trunVersion\n\t\t\t}\n\t\t}]\n\t}\n\n\t// Update the offset\n\tmoof.trafs[0].trun.dataOffset += Box.encodingLength(moof)\n\n\treturn moof\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/videostream/mp4-remuxer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/videostream/videostream.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/videostream/videostream.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("var MediaElementWrapper = __webpack_require__(/*! mediasource */ \"./node_modules/mediasource/index.js\")\nvar pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\n\nvar MP4Remuxer = __webpack_require__(/*! ./mp4-remuxer */ \"./node_modules/videostream/mp4-remuxer.js\")\n\nmodule.exports = VideoStream\n\nfunction VideoStream (file, mediaElem, opts) {\n\tvar self = this\n\tif (!(this instanceof VideoStream)) return new VideoStream(file, mediaElem, opts)\n\topts = opts || {}\n\n\tself.detailedError = null\n\n\tself._elem = mediaElem\n\tself._elemWrapper = new MediaElementWrapper(mediaElem)\n\tself._waitingFired = false\n\tself._trackMeta = null\n\tself._file = file\n\tself._tracks = null\n\tif (self._elem.preload !== 'none') {\n\t\tself._createMuxer()\n\t}\n\n\tself._onError = function (err) {\n\t\tself.detailedError = self._elemWrapper.detailedError\n\t\tself.destroy() // don't pass err though so the user doesn't need to listen for errors\n\t}\n\tself._onWaiting = function () {\n\t\tself._waitingFired = true\n\t\tif (!self._muxer) {\n\t\t\tself._createMuxer()\n\t\t} else if (self._tracks) {\n\t\t\tself._pump()\n\t\t}\n\t}\n\tif(self._elem.autoplay)\n\t\tself._elem.preload = \"auto\";\n\tself._elem.addEventListener('waiting', self._onWaiting)\n\tself._elem.addEventListener('error', self._onError)\n}\n\nVideoStream.prototype._createMuxer = function () {\n\tvar self = this\n\tself._muxer = new MP4Remuxer(self._file)\n\tself._muxer.on('ready', function (data) {\n\t\tself._tracks = data.map(function (trackData) {\n\t\t\tvar mediaSource = self._elemWrapper.createWriteStream(trackData.mime)\n\t\t\tmediaSource.on('error', function (err) {\n\t\t\t\tself._elemWrapper.error(err)\n\t\t\t})\n\t\t\tvar track = {\n\t\t\t\tmuxed: null,\n\t\t\t\tmediaSource: mediaSource,\n\t\t\t\tinitFlushed: false,\n\t\t\t\tonInitFlushed: null\n\t\t\t}\n\t\t\tmediaSource.write(trackData.init, function (err) {\n\t\t\t\ttrack.initFlushed = true\n\t\t\t\tif (track.onInitFlushed) {\n\t\t\t\t\ttrack.onInitFlushed(err)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn track\n\t\t})\n\n\t\tif (self._waitingFired || self._elem.preload === 'auto') {\n\t\t\tself._pump()\n\t\t}\n\t})\n\n\tself._muxer.on('error', function (err) {\n\t\tself._elemWrapper.error(err)\n\t})\n}\n\nVideoStream.prototype._pump = function () {\n\tvar self = this\n\n\tvar muxed = self._muxer.seek(self._elem.currentTime, !self._tracks)\n\n\tself._tracks.forEach(function (track, i) {\n\t\tvar pumpTrack = function () {\n\t\t\tif (track.muxed) {\n\t\t\t\ttrack.muxed.destroy()\n\t\t\t\ttrack.mediaSource = self._elemWrapper.createWriteStream(track.mediaSource)\n\t\t\t\ttrack.mediaSource.on('error', function (err) {\n\t\t\t\t\tself._elemWrapper.error(err)\n\t\t\t\t})\n\t\t\t}\n\t\t\ttrack.muxed = muxed[i]\n\t\t\tpump(track.muxed, track.mediaSource)\n\t\t}\n\t\tif (!track.initFlushed) {\n\t\t\ttrack.onInitFlushed = function (err) {\n\t\t\t\tif (err) {\n\t\t\t\t\tself._elemWrapper.error(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tpumpTrack()\n\t\t\t}\n\t\t} else {\n\t\t\tpumpTrack()\n\t\t}\n\t})\n}\n\nVideoStream.prototype.destroy = function () {\n\tvar self = this\n\tif (self.destroyed) {\n\t\treturn\n\t}\n\tself.destroyed = true\n\n\tself._elem.removeEventListener('waiting', self._onWaiting)\n\tself._elem.removeEventListener('error', self._onError)\n\n\tif (self._tracks) {\n\t\tself._tracks.forEach(function (track) {\n\t\t\tif (track.muxed) {\n\t\t\t\ttrack.muxed.destroy()\n\t\t\t}\n\t\t})\n\t}\n\n\tself._elem.src = ''\n}\n\n\n//# sourceURL=webpack:///./node_modules/videostream/videostream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webpack/buildin/amd-options.js":
|
||
/*!****************************************!*\
|
||
!*** (webpack)/buildin/amd-options.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n\n/* WEBPACK VAR INJECTION */}.call(this, {}))\n\n//# sourceURL=webpack:///(webpack)/buildin/amd-options.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webpack/buildin/global.js":
|
||
/*!***********************************!*\
|
||
!*** (webpack)/buildin/global.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webpack/buildin/module.js":
|
||
/*!***********************************!*\
|
||
!*** (webpack)/buildin/module.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack:///(webpack)/buildin/module.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/webtorrent/index.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer, global, process) {/* global FileList */\n\nconst { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst concat = __webpack_require__(/*! simple-concat */ \"./node_modules/simple-concat/index.js\")\nconst createTorrent = __webpack_require__(/*! create-torrent */ \"./node_modules/create-torrent/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('webtorrent')\nconst DHT = __webpack_require__(/*! bittorrent-dht/client */ 15) // browser exclude\nconst loadIPSet = __webpack_require__(/*! load-ip-set */ 16) // browser exclude\nconst parallel = __webpack_require__(/*! run-parallel */ \"./node_modules/run-parallel/index.js\")\nconst parseTorrent = __webpack_require__(/*! parse-torrent */ \"./node_modules/parse-torrent/index.js\")\nconst path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\nconst Peer = __webpack_require__(/*! simple-peer */ \"./node_modules/simple-peer/index.js\")\nconst randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nconst speedometer = __webpack_require__(/*! speedometer */ \"./node_modules/speedometer/index.js\")\n\nconst TCPPool = __webpack_require__(/*! ./lib/tcp-pool */ 22) // browser exclude\nconst Torrent = __webpack_require__(/*! ./lib/torrent */ \"./node_modules/webtorrent/lib/torrent.js\")\nconst VERSION = __webpack_require__(/*! ./package.json */ \"./node_modules/webtorrent/package.json\").version\n\n/**\n * Version number in Azureus-style. Generated from major and minor semver version.\n * For example:\n * '0.16.1' -> '0016'\n * '1.2.5' -> '0102'\n */\nconst VERSION_STR = VERSION\n .replace(/\\d*./g, v => `0${v % 100}`.slice(-2))\n .slice(0, 4)\n\n/**\n * Version prefix string (used in peer ID). WebTorrent uses the Azureus-style\n * encoding: '-', two characters for client id ('WW'), four ascii digits for version\n * number, '-', followed by random numbers.\n * For example:\n * '-WW0102-'...\n */\nconst VERSION_PREFIX = `-WW${VERSION_STR}-`\n\n/**\n * WebTorrent Client\n * @param {Object=} opts\n */\nclass WebTorrent extends EventEmitter {\n constructor (opts = {}) {\n super()\n\n if (typeof opts.peerId === 'string') {\n this.peerId = opts.peerId\n } else if (Buffer.isBuffer(opts.peerId)) {\n this.peerId = opts.peerId.toString('hex')\n } else {\n this.peerId = Buffer.from(VERSION_PREFIX + randombytes(9).toString('base64')).toString('hex')\n }\n this.peerIdBuffer = Buffer.from(this.peerId, 'hex')\n\n if (typeof opts.nodeId === 'string') {\n this.nodeId = opts.nodeId\n } else if (Buffer.isBuffer(opts.nodeId)) {\n this.nodeId = opts.nodeId.toString('hex')\n } else {\n this.nodeId = randombytes(20).toString('hex')\n }\n this.nodeIdBuffer = Buffer.from(this.nodeId, 'hex')\n\n this._debugId = this.peerId.toString('hex').substring(0, 7)\n\n this.destroyed = false\n this.listening = false\n this.torrentPort = opts.torrentPort || 0\n this.dhtPort = opts.dhtPort || 0\n this.tracker = opts.tracker !== undefined ? opts.tracker : {}\n this.torrents = []\n this.maxConns = Number(opts.maxConns) || 55\n\n this._debug(\n 'new webtorrent (peerId %s, nodeId %s, port %s)',\n this.peerId, this.nodeId, this.torrentPort\n )\n\n if (this.tracker) {\n if (typeof this.tracker !== 'object') this.tracker = {}\n if (opts.rtcConfig) {\n // TODO: remove in v1\n console.warn('WebTorrent: opts.rtcConfig is deprecated. Use opts.tracker.rtcConfig instead')\n this.tracker.rtcConfig = opts.rtcConfig\n }\n if (opts.wrtc) {\n // TODO: remove in v1\n console.warn('WebTorrent: opts.wrtc is deprecated. Use opts.tracker.wrtc instead')\n this.tracker.wrtc = opts.wrtc\n }\n if (global.WRTC && !this.tracker.wrtc) {\n this.tracker.wrtc = global.WRTC\n }\n }\n\n if (typeof TCPPool === 'function') {\n this._tcpPool = new TCPPool(this)\n } else {\n process.nextTick(() => {\n this._onListening()\n })\n }\n\n // stats\n this._downloadSpeed = speedometer()\n this._uploadSpeed = speedometer()\n\n if (opts.dht !== false && typeof DHT === 'function' /* browser exclude */) {\n // use a single DHT instance for all torrents, so the routing table can be reused\n this.dht = new DHT(Object.assign({}, { nodeId: this.nodeId }, opts.dht))\n\n this.dht.once('error', err => {\n this._destroy(err)\n })\n\n this.dht.once('listening', () => {\n const address = this.dht.address()\n if (address) this.dhtPort = address.port\n })\n\n // Ignore warning when there are > 10 torrents in the client\n this.dht.setMaxListeners(0)\n\n this.dht.listen(this.dhtPort)\n } else {\n this.dht = false\n }\n\n // Enable or disable BEP19 (Web Seeds). Enabled by default:\n this.enableWebSeeds = opts.webSeeds !== false\n\n const ready = () => {\n if (this.destroyed) return\n this.ready = true\n this.emit('ready')\n }\n\n if (typeof loadIPSet === 'function' && opts.blocklist != null) {\n loadIPSet(opts.blocklist, {\n headers: {\n 'user-agent': `WebTorrent/${VERSION} (https://webtorrent.io)`\n }\n }, (err, ipSet) => {\n if (err) return this.error(`Failed to load blocklist: ${err.message}`)\n this.blocked = ipSet\n ready()\n })\n } else {\n process.nextTick(ready)\n }\n }\n\n get downloadSpeed () { return this._downloadSpeed() }\n\n get uploadSpeed () { return this._uploadSpeed() }\n\n get progress () {\n const torrents = this.torrents.filter(torrent => torrent.progress !== 1)\n const downloaded = torrents.reduce((total, torrent) => total + torrent.downloaded, 0)\n const length = torrents.reduce((total, torrent) => total + (torrent.length || 0), 0) || 1\n return downloaded / length\n }\n\n get ratio () {\n const uploaded = this.torrents.reduce((total, torrent) => total + torrent.uploaded, 0)\n const received = this.torrents.reduce((total, torrent) => total + torrent.received, 0) || 1\n return uploaded / received\n }\n\n /**\n * Returns the torrent with the given `torrentId`. Convenience method. Easier than\n * searching through the `client.torrents` array. Returns `null` if no matching torrent\n * found.\n *\n * @param {string|Buffer|Object|Torrent} torrentId\n * @return {Torrent|null}\n */\n get (torrentId) {\n if (torrentId instanceof Torrent) {\n if (this.torrents.includes(torrentId)) return torrentId\n } else {\n let parsed\n try { parsed = parseTorrent(torrentId) } catch (err) {}\n\n if (!parsed) return null\n if (!parsed.infoHash) throw new Error('Invalid torrent identifier')\n\n for (const torrent of this.torrents) {\n if (torrent.infoHash === parsed.infoHash) return torrent\n }\n }\n return null\n }\n\n // TODO: remove in v1\n download (torrentId, opts, ontorrent) {\n console.warn('WebTorrent: client.download() is deprecated. Use client.add() instead')\n return this.add(torrentId, opts, ontorrent)\n }\n\n /**\n * Start downloading a new torrent. Aliased as `client.download`.\n * @param {string|Buffer|Object} torrentId\n * @param {Object} opts torrent-specific options\n * @param {function=} ontorrent called when the torrent is ready (has metadata)\n */\n add (torrentId, opts = {}, ontorrent) {\n if (this.destroyed) throw new Error('client is destroyed')\n if (typeof opts === 'function') [opts, ontorrent] = [{}, opts]\n\n const onInfoHash = () => {\n if (this.destroyed) return\n for (const t of this.torrents) {\n if (t.infoHash === torrent.infoHash && t !== torrent) {\n torrent._destroy(new Error(`Cannot add duplicate torrent ${torrent.infoHash}`))\n return\n }\n }\n }\n\n const onReady = () => {\n if (this.destroyed) return\n if (typeof ontorrent === 'function') ontorrent(torrent)\n this.emit('torrent', torrent)\n }\n\n function onClose () {\n torrent.removeListener('_infoHash', onInfoHash)\n torrent.removeListener('ready', onReady)\n torrent.removeListener('close', onClose)\n }\n\n this._debug('add')\n opts = opts ? Object.assign({}, opts) : {}\n\n const torrent = new Torrent(torrentId, this, opts)\n this.torrents.push(torrent)\n\n torrent.once('_infoHash', onInfoHash)\n torrent.once('ready', onReady)\n torrent.once('close', onClose)\n\n return torrent\n }\n\n /**\n * Start seeding a new file/folder.\n * @param {string|File|FileList|Buffer|Array.<string|File|Buffer>} input\n * @param {Object=} opts\n * @param {function=} onseed called when torrent is seeding\n */\n seed (input, opts, onseed) {\n if (this.destroyed) throw new Error('client is destroyed')\n if (typeof opts === 'function') [opts, onseed] = [{}, opts]\n\n this._debug('seed')\n opts = opts ? Object.assign({}, opts) : {}\n\n // no need to verify the hashes we create\n opts.skipVerify = true\n\n const isFilePath = typeof input === 'string'\n\n // When seeding from fs path, initialize store from that path to avoid a copy\n if (isFilePath) opts.path = path.dirname(input)\n if (!opts.createdBy) opts.createdBy = `WebTorrent/${VERSION_STR}`\n\n const onTorrent = torrent => {\n const tasks = [\n cb => {\n // when a filesystem path is specified, files are already in the FS store\n if (isFilePath) return cb()\n torrent.load(streams, cb)\n }\n ]\n if (this.dht) {\n tasks.push(cb => {\n torrent.once('dhtAnnounce', cb)\n })\n }\n parallel(tasks, err => {\n if (this.destroyed) return\n if (err) return torrent._destroy(err)\n _onseed(torrent)\n })\n }\n\n const _onseed = torrent => {\n this._debug('on seed')\n if (typeof onseed === 'function') onseed(torrent)\n torrent.emit('seed')\n this.emit('seed', torrent)\n }\n\n const torrent = this.add(null, opts, onTorrent)\n let streams\n\n if (isFileList(input)) input = Array.from(input)\n else if (!Array.isArray(input)) input = [input]\n\n parallel(input.map(item => cb => {\n if (isReadable(item)) concat(item, cb)\n else cb(null, item)\n }), (err, input) => {\n if (this.destroyed) return\n if (err) return torrent._destroy(err)\n\n createTorrent.parseInput(input, opts, (err, files) => {\n if (this.destroyed) return\n if (err) return torrent._destroy(err)\n\n streams = files.map(file => file.getStream)\n\n createTorrent(input, opts, (err, torrentBuf) => {\n if (this.destroyed) return\n if (err) return torrent._destroy(err)\n\n const existingTorrent = this.get(torrentBuf)\n if (existingTorrent) {\n torrent._destroy(new Error(`Cannot add duplicate torrent ${existingTorrent.infoHash}`))\n } else {\n torrent._onTorrentId(torrentBuf)\n }\n })\n })\n })\n\n return torrent\n }\n\n /**\n * Remove a torrent from the client.\n * @param {string|Buffer|Torrent} torrentId\n * @param {function} cb\n */\n remove (torrentId, cb) {\n this._debug('remove')\n const torrent = this.get(torrentId)\n if (!torrent) throw new Error(`No torrent with id ${torrentId}`)\n this._remove(torrentId, cb)\n }\n\n _remove (torrentId, cb) {\n const torrent = this.get(torrentId)\n if (!torrent) return\n this.torrents.splice(this.torrents.indexOf(torrent), 1)\n torrent.destroy(cb)\n }\n\n address () {\n if (!this.listening) return null\n return this._tcpPool\n ? this._tcpPool.server.address()\n : { address: '0.0.0.0', family: 'IPv4', port: 0 }\n }\n\n /**\n * Destroy the client, including all torrents and connections to peers.\n * @param {function} cb\n */\n destroy (cb) {\n if (this.destroyed) throw new Error('client already destroyed')\n this._destroy(null, cb)\n }\n\n _destroy (err, cb) {\n this._debug('client destroy')\n this.destroyed = true\n\n const tasks = this.torrents.map(torrent => cb => {\n torrent.destroy(cb)\n })\n\n if (this._tcpPool) {\n tasks.push(cb => {\n this._tcpPool.destroy(cb)\n })\n }\n\n if (this.dht) {\n tasks.push(cb => {\n this.dht.destroy(cb)\n })\n }\n\n parallel(tasks, cb)\n\n if (err) this.emit('error', err)\n\n this.torrents = []\n this._tcpPool = null\n this.dht = null\n }\n\n _onListening () {\n this._debug('listening')\n this.listening = true\n\n if (this._tcpPool) {\n // Sometimes server.address() returns `null` in Docker.\n const address = this._tcpPool.server.address()\n if (address) this.torrentPort = address.port\n }\n\n this.emit('listening')\n }\n\n _debug () {\n const args = [].slice.call(arguments)\n args[0] = `[${this._debugId}] ${args[0]}`\n debug(...args)\n }\n}\n\nWebTorrent.WEBRTC_SUPPORT = Peer.WEBRTC_SUPPORT\nWebTorrent.VERSION = VERSION\n\n/**\n * Check if `obj` is a node Readable stream\n * @param {*} obj\n * @return {boolean}\n */\nfunction isReadable (obj) {\n return typeof obj === 'object' && obj != null && typeof obj.pipe === 'function'\n}\n\n/**\n * Check if `obj` is a W3C `FileList` object\n * @param {*} obj\n * @return {boolean}\n */\nfunction isFileList (obj) {\n return typeof FileList !== 'undefined' && obj instanceof FileList\n}\n\nmodule.exports = WebTorrent\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/webtorrent/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/lib/file-stream.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/webtorrent/lib/file-stream.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('webtorrent:file-stream')\nconst stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\n\n/**\n * Readable stream of a torrent file\n *\n * @param {File} file\n * @param {Object} opts\n * @param {number} opts.start stream slice of file, starting from this byte (inclusive)\n * @param {number} opts.end stream slice of file, ending with this byte (inclusive)\n */\nclass FileStream extends stream.Readable {\n constructor (file, opts) {\n super(opts)\n\n this.destroyed = false\n this._torrent = file._torrent\n\n const start = (opts && opts.start) || 0\n const end = (opts && opts.end && opts.end < file.length)\n ? opts.end\n : file.length - 1\n\n const pieceLength = file._torrent.pieceLength\n\n this._startPiece = (start + file.offset) / pieceLength | 0\n this._endPiece = (end + file.offset) / pieceLength | 0\n\n this._piece = this._startPiece\n this._offset = (start + file.offset) - (this._startPiece * pieceLength)\n\n this._missing = end - start + 1\n this._reading = false\n this._notifying = false\n this._criticalLength = Math.min((1024 * 1024 / pieceLength) | 0, 2)\n }\n\n _read () {\n if (this._reading) return\n this._reading = true\n this._notify()\n }\n\n _notify () {\n if (!this._reading || this._missing === 0) return\n if (!this._torrent.bitfield.get(this._piece)) {\n return this._torrent.critical(this._piece, this._piece + this._criticalLength)\n }\n\n if (this._notifying) return\n this._notifying = true\n\n if (this._torrent.destroyed) return this._destroy(new Error('Torrent removed'))\n\n const p = this._piece\n this._torrent.store.get(p, (err, buffer) => {\n this._notifying = false\n if (this.destroyed) return\n if (err) return this._destroy(err)\n debug('read %s (length %s) (err %s)', p, buffer.length, err && err.message)\n\n if (this._offset) {\n buffer = buffer.slice(this._offset)\n this._offset = 0\n }\n\n if (this._missing < buffer.length) {\n buffer = buffer.slice(0, this._missing)\n }\n this._missing -= buffer.length\n\n debug('pushing buffer of length %s', buffer.length)\n this._reading = false\n this.push(buffer)\n\n if (this._missing === 0) this.push(null)\n })\n this._piece += 1\n }\n\n destroy (onclose) {\n this._destroy(null, onclose)\n }\n\n _destroy (err, onclose) {\n if (this.destroyed) return\n this.destroyed = true\n\n if (!this._torrent.destroyed) {\n this._torrent.deselect(this._startPiece, this._endPiece, true)\n }\n\n if (err) this.emit('error', err)\n this.emit('close')\n if (onclose) onclose()\n }\n}\n\nmodule.exports = FileStream\n\n\n//# sourceURL=webpack:///./node_modules/webtorrent/lib/file-stream.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/lib/file.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/webtorrent/lib/file.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst { PassThrough } = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\")\nconst eos = __webpack_require__(/*! end-of-stream */ \"./node_modules/end-of-stream/index.js\")\nconst path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\nconst render = __webpack_require__(/*! render-media */ \"./node_modules/render-media/index.js\")\nconst streamToBlob = __webpack_require__(/*! stream-to-blob */ \"./node_modules/webtorrent/node_modules/stream-to-blob/index.js\")\nconst streamToBlobURL = __webpack_require__(/*! stream-to-blob-url */ \"./node_modules/stream-to-blob-url/index.js\")\nconst streamToBuffer = __webpack_require__(/*! stream-with-known-length-to-buffer */ \"./node_modules/stream-with-known-length-to-buffer/index.js\")\nconst FileStream = __webpack_require__(/*! ./file-stream */ \"./node_modules/webtorrent/lib/file-stream.js\")\n\nclass File extends EventEmitter {\n constructor (torrent, file) {\n super()\n\n this._torrent = torrent\n this._destroyed = false\n\n this.name = file.name\n this.path = file.path\n this.length = file.length\n this.offset = file.offset\n\n this.done = false\n\n const start = file.offset\n const end = start + file.length - 1\n\n this._startPiece = start / this._torrent.pieceLength | 0\n this._endPiece = end / this._torrent.pieceLength | 0\n\n if (this.length === 0) {\n this.done = true\n this.emit('done')\n }\n }\n\n get downloaded () {\n if (!this._torrent.bitfield) return 0\n\n const { pieces, bitfield, pieceLength } = this._torrent\n const { _startPiece: start, _endPiece: end } = this\n const piece = pieces[start]\n\n // Calculate first piece diffrently, it sometimes have a offset\n let downloaded = bitfield.get(start)\n ? pieceLength - (this.offset % pieceLength)\n : Math.max(piece.length - piece.missing - this.offset, 0)\n\n for (let index = start + 1; index <= end; ++index) {\n if (bitfield.get(index)) {\n // verified data\n downloaded += pieceLength\n } else {\n // \"in progress\" data\n const piece = pieces[index]\n downloaded += piece.length - piece.missing\n }\n }\n\n // We don't have a end-offset and one small file can fith in the middle\n // of one chunk, so return this.length if it's oversized\n return Math.min(downloaded, this.length)\n }\n\n get progress () {\n return this.length ? this.downloaded / this.length : 0\n }\n\n select (priority) {\n if (this.length === 0) return\n this._torrent.select(this._startPiece, this._endPiece, priority)\n }\n\n deselect () {\n if (this.length === 0) return\n this._torrent.deselect(this._startPiece, this._endPiece, false)\n }\n\n createReadStream (opts) {\n if (this.length === 0) {\n const empty = new PassThrough()\n process.nextTick(() => {\n empty.end()\n })\n return empty\n }\n\n const fileStream = new FileStream(this, opts)\n this._torrent.select(fileStream._startPiece, fileStream._endPiece, true, () => {\n fileStream._notify()\n })\n eos(fileStream, () => {\n if (this._destroyed) return\n if (!this._torrent.destroyed) {\n this._torrent.deselect(fileStream._startPiece, fileStream._endPiece, true)\n }\n })\n return fileStream\n }\n\n getBuffer (cb) {\n streamToBuffer(this.createReadStream(), this.length, cb)\n }\n\n getBlob (cb) {\n if (typeof window === 'undefined') throw new Error('browser-only method')\n streamToBlob(this.createReadStream(), this._getMimeType())\n .then(\n blob => cb(null, blob),\n err => cb(err)\n )\n }\n\n getBlobURL (cb) {\n if (typeof window === 'undefined') throw new Error('browser-only method')\n streamToBlobURL(this.createReadStream(), this._getMimeType())\n .then(\n blobUrl => cb(null, blobUrl),\n err => cb(err)\n )\n }\n\n appendTo (elem, opts, cb) {\n if (typeof window === 'undefined') throw new Error('browser-only method')\n render.append(this, elem, opts, cb)\n }\n\n renderTo (elem, opts, cb) {\n if (typeof window === 'undefined') throw new Error('browser-only method')\n render.render(this, elem, opts, cb)\n }\n\n _getMimeType () {\n return render.mime[path.extname(this.name).toLowerCase()]\n }\n\n _destroy () {\n this._destroyed = true\n this._torrent = null\n }\n}\n\nmodule.exports = File\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/webtorrent/lib/file.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/lib/peer.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/webtorrent/lib/peer.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const arrayRemove = __webpack_require__(/*! unordered-array-remove */ \"./node_modules/unordered-array-remove/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('webtorrent:peer')\nconst Wire = __webpack_require__(/*! bittorrent-protocol */ \"./node_modules/bittorrent-protocol/index.js\")\n\nconst WebConn = __webpack_require__(/*! ./webconn */ \"./node_modules/webtorrent/lib/webconn.js\")\n\nconst CONNECT_TIMEOUT_TCP = 5000\nconst CONNECT_TIMEOUT_WEBRTC = 25000\nconst HANDSHAKE_TIMEOUT = 25000\n\n/**\n * WebRTC peer connections start out connected, because WebRTC peers require an\n * \"introduction\" (i.e. WebRTC signaling), and there's no equivalent to an IP address\n * that lets you refer to a WebRTC endpoint.\n */\nexports.createWebRTCPeer = (conn, swarm) => {\n const peer = new Peer(conn.id, 'webrtc')\n peer.conn = conn\n peer.swarm = swarm\n\n if (peer.conn.connected) {\n peer.onConnect()\n } else {\n peer.conn.once('connect', () => { peer.onConnect() })\n peer.conn.once('error', err => { peer.destroy(err) })\n peer.startConnectTimeout()\n }\n\n return peer\n}\n\n/**\n * Incoming TCP peers start out connected, because the remote peer connected to the\n * listening port of the TCP server. Until the remote peer sends a handshake, we don't\n * know what swarm the connection is intended for.\n */\nexports.createTCPIncomingPeer = conn => {\n const addr = `${conn.remoteAddress}:${conn.remotePort}`\n const peer = new Peer(addr, 'tcpIncoming')\n peer.conn = conn\n peer.addr = addr\n\n peer.onConnect()\n\n return peer\n}\n\n/**\n * Outgoing TCP peers start out with just an IP address. At some point (when there is an\n * available connection), the client can attempt to connect to the address.\n */\nexports.createTCPOutgoingPeer = (addr, swarm) => {\n const peer = new Peer(addr, 'tcpOutgoing')\n peer.addr = addr\n peer.swarm = swarm\n\n return peer\n}\n\n/**\n * Peer that represents a Web Seed (BEP17 / BEP19).\n */\nexports.createWebSeedPeer = (url, swarm) => {\n const peer = new Peer(url, 'webSeed')\n peer.swarm = swarm\n peer.conn = new WebConn(url, swarm)\n\n peer.onConnect()\n\n return peer\n}\n\n/**\n * Peer. Represents a peer in the torrent swarm.\n *\n * @param {string} id \"ip:port\" string, peer id (for WebRTC peers), or url (for Web Seeds)\n * @param {string} type the type of the peer\n */\nclass Peer {\n constructor (id, type) {\n this.id = id\n this.type = type\n\n debug('new %s Peer %s', type, id)\n\n this.addr = null\n this.conn = null\n this.swarm = null\n this.wire = null\n\n this.connected = false\n this.destroyed = false\n this.timeout = null // handshake timeout\n this.retries = 0 // outgoing TCP connection retry count\n\n this.sentHandshake = false\n }\n\n /**\n * Called once the peer is connected (i.e. fired 'connect' event)\n * @param {Socket} conn\n */\n onConnect () {\n if (this.destroyed) return\n this.connected = true\n\n debug('Peer %s connected', this.id)\n\n clearTimeout(this.connectTimeout)\n\n const conn = this.conn\n conn.once('end', () => {\n this.destroy()\n })\n conn.once('close', () => {\n this.destroy()\n })\n conn.once('finish', () => {\n this.destroy()\n })\n conn.once('error', err => {\n this.destroy(err)\n })\n\n const wire = this.wire = new Wire()\n wire.type = this.type\n wire.once('end', () => {\n this.destroy()\n })\n wire.once('close', () => {\n this.destroy()\n })\n wire.once('finish', () => {\n this.destroy()\n })\n wire.once('error', err => {\n this.destroy(err)\n })\n\n wire.once('handshake', (infoHash, peerId) => {\n this.onHandshake(infoHash, peerId)\n })\n this.startHandshakeTimeout()\n\n conn.pipe(wire).pipe(conn)\n if (this.swarm && !this.sentHandshake) this.handshake()\n }\n\n /**\n * Called when handshake is received from remote peer.\n * @param {string} infoHash\n * @param {string} peerId\n */\n onHandshake (infoHash, peerId) {\n if (!this.swarm) return // `this.swarm` not set yet, so do nothing\n if (this.destroyed) return\n\n if (this.swarm.destroyed) {\n return this.destroy(new Error('swarm already destroyed'))\n }\n if (infoHash !== this.swarm.infoHash) {\n return this.destroy(new Error('unexpected handshake info hash for this swarm'))\n }\n if (peerId === this.swarm.peerId) {\n return this.destroy(new Error('refusing to connect to ourselves'))\n }\n\n debug('Peer %s got handshake %s', this.id, infoHash)\n\n clearTimeout(this.handshakeTimeout)\n\n this.retries = 0\n\n let addr = this.addr\n if (!addr && this.conn.remoteAddress && this.conn.remotePort) {\n addr = `${this.conn.remoteAddress}:${this.conn.remotePort}`\n }\n this.swarm._onWire(this.wire, addr)\n\n // swarm could be destroyed in user's 'wire' event handler\n if (!this.swarm || this.swarm.destroyed) return\n\n if (!this.sentHandshake) this.handshake()\n }\n\n handshake () {\n const opts = {\n dht: this.swarm.private ? false : !!this.swarm.client.dht\n }\n this.wire.handshake(this.swarm.infoHash, this.swarm.client.peerId, opts)\n this.sentHandshake = true\n }\n\n startConnectTimeout () {\n clearTimeout(this.connectTimeout)\n this.connectTimeout = setTimeout(() => {\n this.destroy(new Error('connect timeout'))\n }, this.type === 'webrtc' ? CONNECT_TIMEOUT_WEBRTC : CONNECT_TIMEOUT_TCP)\n if (this.connectTimeout.unref) this.connectTimeout.unref()\n }\n\n startHandshakeTimeout () {\n clearTimeout(this.handshakeTimeout)\n this.handshakeTimeout = setTimeout(() => {\n this.destroy(new Error('handshake timeout'))\n }, HANDSHAKE_TIMEOUT)\n if (this.handshakeTimeout.unref) this.handshakeTimeout.unref()\n }\n\n destroy (err) {\n if (this.destroyed) return\n this.destroyed = true\n this.connected = false\n\n debug('destroy %s (error: %s)', this.id, err && (err.message || err))\n\n clearTimeout(this.connectTimeout)\n clearTimeout(this.handshakeTimeout)\n\n const swarm = this.swarm\n const conn = this.conn\n const wire = this.wire\n\n this.swarm = null\n this.conn = null\n this.wire = null\n\n if (swarm && wire) {\n arrayRemove(swarm.wires, swarm.wires.indexOf(wire))\n }\n if (conn) {\n conn.on('error', () => {})\n conn.destroy()\n }\n if (wire) wire.destroy()\n if (swarm) swarm.removePeer(this.id)\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/webtorrent/lib/peer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/lib/rarity-map.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/webtorrent/lib/rarity-map.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("\n/**\n * Mapping of torrent pieces to their respective availability in the torrent swarm. Used\n * by the torrent manager for implementing the rarest piece first selection strategy.\n */\nclass RarityMap {\n constructor (torrent) {\n this._torrent = torrent\n this._numPieces = torrent.pieces.length\n this._pieces = new Array(this._numPieces)\n\n this._onWire = wire => {\n this.recalculate()\n this._initWire(wire)\n }\n this._onWireHave = index => {\n this._pieces[index] += 1\n }\n this._onWireBitfield = () => {\n this.recalculate()\n }\n\n this._torrent.wires.forEach(wire => {\n this._initWire(wire)\n })\n this._torrent.on('wire', this._onWire)\n this.recalculate()\n }\n\n /**\n * Get the index of the rarest piece. Optionally, pass a filter function to exclude\n * certain pieces (for instance, those that we already have).\n *\n * @param {function} pieceFilterFunc\n * @return {number} index of rarest piece, or -1\n */\n getRarestPiece (pieceFilterFunc) {\n let candidates = []\n let min = Infinity\n\n for (let i = 0; i < this._numPieces; ++i) {\n if (pieceFilterFunc && !pieceFilterFunc(i)) continue\n\n const availability = this._pieces[i]\n if (availability === min) {\n candidates.push(i)\n } else if (availability < min) {\n candidates = [i]\n min = availability\n }\n }\n\n if (candidates.length) {\n // if there are multiple pieces with the same availability, choose one randomly\n return candidates[Math.random() * candidates.length | 0]\n } else {\n return -1\n }\n }\n\n destroy () {\n this._torrent.removeListener('wire', this._onWire)\n this._torrent.wires.forEach(wire => {\n this._cleanupWireEvents(wire)\n })\n this._torrent = null\n this._pieces = null\n\n this._onWire = null\n this._onWireHave = null\n this._onWireBitfield = null\n }\n\n _initWire (wire) {\n wire._onClose = () => {\n this._cleanupWireEvents(wire)\n for (let i = 0; i < this._numPieces; ++i) {\n this._pieces[i] -= wire.peerPieces.get(i)\n }\n }\n\n wire.on('have', this._onWireHave)\n wire.on('bitfield', this._onWireBitfield)\n wire.once('close', wire._onClose)\n }\n\n /**\n * Recalculates piece availability across all peers in the torrent.\n */\n recalculate () {\n this._pieces.fill(0)\n\n for (const wire of this._torrent.wires) {\n for (let i = 0; i < this._numPieces; ++i) {\n this._pieces[i] += wire.peerPieces.get(i)\n }\n }\n }\n\n _cleanupWireEvents (wire) {\n wire.removeListener('have', this._onWireHave)\n wire.removeListener('bitfield', this._onWireBitfield)\n if (wire._onClose) wire.removeListener('close', wire._onClose)\n wire._onClose = null\n }\n}\n\nmodule.exports = RarityMap\n\n\n//# sourceURL=webpack:///./node_modules/webtorrent/lib/rarity-map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/lib/torrent.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/webtorrent/lib/torrent.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process, global) {/* global Blob */\n\nconst addrToIPPort = __webpack_require__(/*! addr-to-ip-port */ \"./node_modules/addr-to-ip-port/index.js\")\nconst BitField = __webpack_require__(/*! bitfield */ \"./node_modules/webtorrent/node_modules/bitfield/index.js\")\nconst ChunkStoreWriteStream = __webpack_require__(/*! chunk-store-stream/write */ \"./node_modules/chunk-store-stream/write.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('webtorrent:torrent')\nconst Discovery = __webpack_require__(/*! torrent-discovery */ \"./node_modules/torrent-discovery/index.js\")\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\").EventEmitter\nconst fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\")\nconst FSChunkStore = __webpack_require__(/*! fs-chunk-store */ \"./node_modules/memory-chunk-store/index.js\") // browser: `memory-chunk-store`\nconst get = __webpack_require__(/*! simple-get */ \"./node_modules/simple-get/index.js\")\nconst ImmediateChunkStore = __webpack_require__(/*! immediate-chunk-store */ \"./node_modules/immediate-chunk-store/index.js\")\nconst MultiStream = __webpack_require__(/*! multistream */ \"./node_modules/multistream/index.js\")\nconst net = __webpack_require__(/*! net */ 30) // browser exclude\nconst os = __webpack_require__(/*! os */ 31) // browser exclude\nconst parallel = __webpack_require__(/*! run-parallel */ \"./node_modules/run-parallel/index.js\")\nconst parallelLimit = __webpack_require__(/*! run-parallel-limit */ \"./node_modules/run-parallel-limit/index.js\")\nconst parseTorrent = __webpack_require__(/*! parse-torrent */ \"./node_modules/parse-torrent/index.js\")\nconst path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\")\nconst Piece = __webpack_require__(/*! torrent-piece */ \"./node_modules/torrent-piece/index.js\")\nconst pump = __webpack_require__(/*! pump */ \"./node_modules/pump/index.js\")\nconst randomIterate = __webpack_require__(/*! random-iterate */ \"./node_modules/random-iterate/index.js\")\nconst sha1 = __webpack_require__(/*! simple-sha1 */ \"./node_modules/simple-sha1/browser.js\")\nconst speedometer = __webpack_require__(/*! speedometer */ \"./node_modules/speedometer/index.js\")\nconst uniq = __webpack_require__(/*! uniq */ \"./node_modules/uniq/uniq.js\")\nconst utMetadata = __webpack_require__(/*! ut_metadata */ \"./node_modules/ut_metadata/index.js\")\nconst utPex = __webpack_require__(/*! ut_pex */ 32) // browser exclude\nconst parseRange = __webpack_require__(/*! parse-numeric-range */ \"./node_modules/parse-numeric-range/index.js\")\n\nconst File = __webpack_require__(/*! ./file */ \"./node_modules/webtorrent/lib/file.js\")\nconst Peer = __webpack_require__(/*! ./peer */ \"./node_modules/webtorrent/lib/peer.js\")\nconst RarityMap = __webpack_require__(/*! ./rarity-map */ \"./node_modules/webtorrent/lib/rarity-map.js\")\nconst Server = __webpack_require__(/*! ./server */ 37) // browser exclude\n\nconst MAX_BLOCK_LENGTH = 128 * 1024\nconst PIECE_TIMEOUT = 30000\nconst CHOKE_TIMEOUT = 5000\nconst SPEED_THRESHOLD = 3 * Piece.BLOCK_LENGTH\n\nconst PIPELINE_MIN_DURATION = 0.5\nconst PIPELINE_MAX_DURATION = 1\n\nconst RECHOKE_INTERVAL = 10000 // 10 seconds\nconst RECHOKE_OPTIMISTIC_DURATION = 2 // 30 seconds\n\n// IndexedDB chunk stores used in the browser benefit from maximum concurrency\nconst FILESYSTEM_CONCURRENCY = process.browser ? Infinity : 2\n\nconst RECONNECT_WAIT = [1000, 5000, 15000]\n\nconst VERSION = __webpack_require__(/*! ../package.json */ \"./node_modules/webtorrent/package.json\").version\nconst USER_AGENT = `WebTorrent/${VERSION} (https://webtorrent.io)`\n\nlet TMP\ntry {\n TMP = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent')\n} catch (err) {\n TMP = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent')\n}\n\nclass Torrent extends EventEmitter {\n constructor (torrentId, client, opts) {\n super()\n\n this._debugId = 'unknown infohash'\n this.client = client\n\n this.announce = opts.announce\n this.urlList = opts.urlList\n\n this.path = opts.path\n this.skipVerify = !!opts.skipVerify\n this._store = opts.store || FSChunkStore\n this._getAnnounceOpts = opts.getAnnounceOpts\n\n this.strategy = opts.strategy || 'sequential'\n\n this.maxWebConns = opts.maxWebConns || 4\n\n this._rechokeNumSlots = (opts.uploads === false || opts.uploads === 0)\n ? 0\n : (+opts.uploads || 10)\n this._rechokeOptimisticWire = null\n this._rechokeOptimisticTime = 0\n this._rechokeIntervalId = null\n\n this.ready = false\n this.destroyed = false\n this.paused = false\n this.done = false\n\n this.metadata = null\n this.store = null\n this.files = []\n this.pieces = []\n\n this._amInterested = false\n this._selections = []\n this._critical = []\n\n this.wires = [] // open wires (added *after* handshake)\n\n this._queue = [] // queue of outgoing tcp peers to connect to\n this._peers = {} // connected peers (addr/peerId -> Peer)\n this._peersLength = 0 // number of elements in `this._peers` (cache, for perf)\n\n // stats\n this.received = 0\n this.uploaded = 0\n this._downloadSpeed = speedometer()\n this._uploadSpeed = speedometer()\n\n // for cleanup\n this._servers = []\n this._xsRequests = []\n\n // TODO: remove this and expose a hook instead\n // optimization: don't recheck every file if it hasn't changed\n this._fileModtimes = opts.fileModtimes\n\n if (torrentId !== null) this._onTorrentId(torrentId)\n\n this._debug('new torrent')\n }\n\n get timeRemaining () {\n if (this.done) return 0\n if (this.downloadSpeed === 0) return Infinity\n return ((this.length - this.downloaded) / this.downloadSpeed) * 1000\n }\n\n get downloaded () {\n if (!this.bitfield) return 0\n let downloaded = 0\n for (let index = 0, len = this.pieces.length; index < len; ++index) {\n if (this.bitfield.get(index)) { // verified data\n downloaded += (index === len - 1) ? this.lastPieceLength : this.pieceLength\n } else { // \"in progress\" data\n const piece = this.pieces[index]\n downloaded += (piece.length - piece.missing)\n }\n }\n return downloaded\n }\n\n // TODO: re-enable this. The number of missing pieces. Used to implement 'end game' mode.\n // Object.defineProperty(Storage.prototype, 'numMissing', {\n // get: function () {\n // var self = this\n // var numMissing = self.pieces.length\n // for (var index = 0, len = self.pieces.length; index < len; index++) {\n // numMissing -= self.bitfield.get(index)\n // }\n // return numMissing\n // }\n // })\n\n get downloadSpeed () { return this._downloadSpeed() }\n\n get uploadSpeed () { return this._uploadSpeed() }\n\n get progress () { return this.length ? this.downloaded / this.length : 0 }\n\n get ratio () { return this.uploaded / (this.received || 1) }\n\n get numPeers () { return this.wires.length }\n\n get torrentFileBlobURL () {\n if (typeof window === 'undefined') throw new Error('browser-only property')\n if (!this.torrentFile) return null\n return URL.createObjectURL(\n new Blob([this.torrentFile], { type: 'application/x-bittorrent' })\n )\n }\n\n get _numQueued () {\n return this._queue.length + (this._peersLength - this._numConns)\n }\n\n get _numConns () {\n let numConns = 0\n for (const id in this._peers) {\n if (this._peers[id].connected) numConns += 1\n }\n return numConns\n }\n\n // TODO: remove in v1\n get swarm () {\n console.warn('WebTorrent: `torrent.swarm` is deprecated. Use `torrent` directly instead.')\n return this\n }\n\n _onTorrentId (torrentId) {\n if (this.destroyed) return\n\n let parsedTorrent\n try { parsedTorrent = parseTorrent(torrentId) } catch (err) {}\n if (parsedTorrent) {\n // Attempt to set infoHash property synchronously\n this.infoHash = parsedTorrent.infoHash\n this._debugId = parsedTorrent.infoHash.toString('hex').substring(0, 7)\n process.nextTick(() => {\n if (this.destroyed) return\n this._onParsedTorrent(parsedTorrent)\n })\n } else {\n // If torrentId failed to parse, it could be in a form that requires an async\n // operation, i.e. http/https link, filesystem path, or Blob.\n parseTorrent.remote(torrentId, (err, parsedTorrent) => {\n if (this.destroyed) return\n if (err) return this._destroy(err)\n this._onParsedTorrent(parsedTorrent)\n })\n }\n }\n\n _onParsedTorrent (parsedTorrent) {\n if (this.destroyed) return\n\n this._processParsedTorrent(parsedTorrent)\n\n if (!this.infoHash) {\n return this._destroy(new Error('Malformed torrent data: No info hash'))\n }\n\n if (!this.path) this.path = path.join(TMP, this.infoHash)\n\n this._rechokeIntervalId = setInterval(() => {\n this._rechoke()\n }, RECHOKE_INTERVAL)\n if (this._rechokeIntervalId.unref) this._rechokeIntervalId.unref()\n\n // Private 'infoHash' event allows client.add to check for duplicate torrents and\n // destroy them before the normal 'infoHash' event is emitted. Prevents user\n // applications from needing to deal with duplicate 'infoHash' events.\n this.emit('_infoHash', this.infoHash)\n if (this.destroyed) return\n\n this.emit('infoHash', this.infoHash)\n if (this.destroyed) return // user might destroy torrent in event handler\n\n if (this.client.listening) {\n this._onListening()\n } else {\n this.client.once('listening', () => {\n this._onListening()\n })\n }\n }\n\n _processParsedTorrent (parsedTorrent) {\n this._debugId = parsedTorrent.infoHash.toString('hex').substring(0, 7)\n\n if (this.announce) {\n // Allow specifying trackers via `opts` parameter\n parsedTorrent.announce = parsedTorrent.announce.concat(this.announce)\n }\n\n if (this.client.tracker && global.WEBTORRENT_ANNOUNCE && !this.private) {\n // So `webtorrent-hybrid` can force specific trackers to be used\n parsedTorrent.announce = parsedTorrent.announce.concat(global.WEBTORRENT_ANNOUNCE)\n }\n\n if (this.urlList) {\n // Allow specifying web seeds via `opts` parameter\n parsedTorrent.urlList = parsedTorrent.urlList.concat(this.urlList)\n }\n\n uniq(parsedTorrent.announce)\n uniq(parsedTorrent.urlList)\n\n Object.assign(this, parsedTorrent)\n\n this.magnetURI = parseTorrent.toMagnetURI(parsedTorrent)\n this.torrentFile = parseTorrent.toTorrentFile(parsedTorrent)\n }\n\n _onListening () {\n if (this.discovery || this.destroyed) return\n\n let trackerOpts = this.client.tracker\n if (trackerOpts) {\n trackerOpts = Object.assign({}, this.client.tracker, {\n getAnnounceOpts: () => {\n const opts = {\n uploaded: this.uploaded,\n downloaded: this.downloaded,\n left: Math.max(this.length - this.downloaded, 0)\n }\n if (this.client.tracker.getAnnounceOpts) {\n Object.assign(opts, this.client.tracker.getAnnounceOpts())\n }\n if (this._getAnnounceOpts) {\n // TODO: consider deprecating this, as it's redundant with the former case\n Object.assign(opts, this._getAnnounceOpts())\n }\n return opts\n }\n })\n }\n\n // begin discovering peers via DHT and trackers\n this.discovery = new Discovery({\n infoHash: this.infoHash,\n announce: this.announce,\n peerId: this.client.peerId,\n dht: !this.private && this.client.dht,\n tracker: trackerOpts,\n port: this.client.torrentPort,\n userAgent: USER_AGENT\n })\n\n this.discovery.on('error', (err) => {\n this._destroy(err)\n })\n\n this.discovery.on('peer', (peer) => {\n // Don't create new outgoing TCP connections when torrent is done\n if (typeof peer === 'string' && this.done) return\n this.addPeer(peer)\n })\n\n this.discovery.on('trackerAnnounce', () => {\n this.emit('trackerAnnounce')\n if (this.numPeers === 0) this.emit('noPeers', 'tracker')\n })\n\n this.discovery.on('dhtAnnounce', () => {\n this.emit('dhtAnnounce')\n if (this.numPeers === 0) this.emit('noPeers', 'dht')\n })\n\n this.discovery.on('warning', (err) => {\n this.emit('warning', err)\n })\n\n if (this.info) {\n // if full metadata was included in initial torrent id, use it immediately. Otherwise,\n // wait for torrent-discovery to find peers and ut_metadata to get the metadata.\n this._onMetadata(this)\n } else if (this.xs) {\n this._getMetadataFromServer()\n }\n }\n\n _getMetadataFromServer () {\n // to allow function hoisting\n const self = this\n\n const urls = Array.isArray(this.xs) ? this.xs : [this.xs]\n\n const tasks = urls.map(url => cb => {\n getMetadataFromURL(url, cb)\n })\n parallel(tasks)\n\n function getMetadataFromURL (url, cb) {\n if (url.indexOf('http://') !== 0 && url.indexOf('https://') !== 0) {\n self.emit('warning', new Error(`skipping non-http xs param: ${url}`))\n return cb(null)\n }\n\n const opts = {\n url,\n method: 'GET',\n headers: {\n 'user-agent': USER_AGENT\n }\n }\n let req\n try {\n req = get.concat(opts, onResponse)\n } catch (err) {\n self.emit('warning', new Error(`skipping invalid url xs param: ${url}`))\n return cb(null)\n }\n\n self._xsRequests.push(req)\n\n function onResponse (err, res, torrent) {\n if (self.destroyed) return cb(null)\n if (self.metadata) return cb(null)\n\n if (err) {\n self.emit('warning', new Error(`http error from xs param: ${url}`))\n return cb(null)\n }\n if (res.statusCode !== 200) {\n self.emit('warning', new Error(`non-200 status code ${res.statusCode} from xs param: ${url}`))\n return cb(null)\n }\n\n let parsedTorrent\n try {\n parsedTorrent = parseTorrent(torrent)\n } catch (err) {}\n\n if (!parsedTorrent) {\n self.emit('warning', new Error(`got invalid torrent file from xs param: ${url}`))\n return cb(null)\n }\n\n if (parsedTorrent.infoHash !== self.infoHash) {\n self.emit('warning', new Error(`got torrent file with incorrect info hash from xs param: ${url}`))\n return cb(null)\n }\n\n self._onMetadata(parsedTorrent)\n cb(null)\n }\n }\n }\n\n /**\n * Called when the full torrent metadata is received.\n */\n _onMetadata (metadata) {\n if (this.metadata || this.destroyed) return\n this._debug('got metadata')\n\n this._xsRequests.forEach(req => {\n req.abort()\n })\n this._xsRequests = []\n\n let parsedTorrent\n if (metadata && metadata.infoHash) {\n // `metadata` is a parsed torrent (from parse-torrent module)\n parsedTorrent = metadata\n } else {\n try {\n parsedTorrent = parseTorrent(metadata)\n } catch (err) {\n return this._destroy(err)\n }\n }\n\n this._processParsedTorrent(parsedTorrent)\n this.metadata = this.torrentFile\n\n // add web seed urls (BEP19)\n if (this.client.enableWebSeeds) {\n this.urlList.forEach(url => {\n this.addWebSeed(url)\n })\n }\n\n this._rarityMap = new RarityMap(this)\n\n this.store = new ImmediateChunkStore(\n new this._store(this.pieceLength, {\n torrent: {\n infoHash: this.infoHash\n },\n files: this.files.map(file => ({\n path: path.join(this.path, file.path),\n length: file.length,\n offset: file.offset\n })),\n length: this.length,\n name: this.infoHash\n })\n )\n\n this.files = this.files.map(file => new File(this, file))\n\n // Select only specified files (BEP53) http://www.bittorrent.org/beps/bep_0053.html\n if (this.so) {\n const selectOnlyFiles = parseRange.parse(this.so)\n\n this.files.forEach((v, i) => {\n if (selectOnlyFiles.includes(i)) this.files[i].select(true)\n })\n } else {\n // start off selecting the entire torrent with low priority\n if (this.pieces.length !== 0) {\n this.select(0, this.pieces.length - 1, false)\n }\n }\n\n this._hashes = this.pieces\n\n this.pieces = this.pieces.map((hash, i) => {\n const pieceLength = (i === this.pieces.length - 1)\n ? this.lastPieceLength\n : this.pieceLength\n return new Piece(pieceLength)\n })\n\n this._reservations = this.pieces.map(() => [])\n\n this.bitfield = new BitField(this.pieces.length)\n\n this.wires.forEach(wire => {\n // If we didn't have the metadata at the time ut_metadata was initialized for this\n // wire, we still want to make it available to the peer in case they request it.\n if (wire.ut_metadata) wire.ut_metadata.setMetadata(this.metadata)\n\n this._onWireWithMetadata(wire)\n })\n\n if (this.skipVerify) {\n // Skip verifying exisitng data and just assume it's correct\n this._markAllVerified()\n this._onStore()\n } else {\n const onPiecesVerified = (err) => {\n if (err) return this._destroy(err)\n this._debug('done verifying')\n this._onStore()\n }\n\n this._debug('verifying existing torrent data')\n if (this._fileModtimes && this._store === FSChunkStore) {\n // don't verify if the files haven't been modified since we last checked\n this.getFileModtimes((err, fileModtimes) => {\n if (err) return this._destroy(err)\n\n const unchanged = this.files.map((_, index) => fileModtimes[index] === this._fileModtimes[index]).every(x => x)\n\n if (unchanged) {\n this._markAllVerified()\n this._onStore()\n } else {\n this._verifyPieces(onPiecesVerified)\n }\n })\n } else {\n this._verifyPieces(onPiecesVerified)\n }\n }\n\n this.emit('metadata')\n }\n\n /*\n * TODO: remove this\n * Gets the last modified time of every file on disk for this torrent.\n * Only valid in Node, not in the browser.\n */\n getFileModtimes (cb) {\n const ret = []\n parallelLimit(this.files.map((file, index) => cb => {\n fs.stat(path.join(this.path, file.path), (err, stat) => {\n if (err && err.code !== 'ENOENT') return cb(err)\n ret[index] = stat && stat.mtime.getTime()\n cb(null)\n })\n }), FILESYSTEM_CONCURRENCY, err => {\n this._debug('done getting file modtimes')\n cb(err, ret)\n })\n }\n\n _verifyPieces (cb) {\n parallelLimit(this.pieces.map((piece, index) => cb => {\n if (this.destroyed) return cb(new Error('torrent is destroyed'))\n\n this.store.get(index, (err, buf) => {\n if (this.destroyed) return cb(new Error('torrent is destroyed'))\n\n if (err) return process.nextTick(cb, null) // ignore error\n sha1(buf, hash => {\n if (this.destroyed) return cb(new Error('torrent is destroyed'))\n\n if (hash === this._hashes[index]) {\n if (!this.pieces[index]) return cb(null)\n this._debug('piece verified %s', index)\n this._markVerified(index)\n } else {\n this._debug('piece invalid %s', index)\n }\n cb(null)\n })\n })\n }), FILESYSTEM_CONCURRENCY, cb)\n }\n\n rescanFiles (cb) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n if (!cb) cb = noop\n\n this._verifyPieces((err) => {\n if (err) {\n this._destroy(err)\n return cb(err)\n }\n\n this._checkDone()\n cb(null)\n })\n }\n\n _markAllVerified () {\n for (let index = 0; index < this.pieces.length; index++) {\n this._markVerified(index)\n }\n }\n\n _markVerified (index) {\n this.pieces[index] = null\n this._reservations[index] = null\n this.bitfield.set(index, true)\n }\n\n /**\n * Called when the metadata, listening server, and underlying chunk store is initialized.\n */\n _onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case any selections were made before torrent was ready\n this._updateSelections()\n }\n\n destroy (cb) {\n this._destroy(null, cb)\n }\n\n _destroy (err, cb) {\n if (this.destroyed) return\n this.destroyed = true\n this._debug('destroy')\n\n this.client._remove(this)\n\n clearInterval(this._rechokeIntervalId)\n\n this._xsRequests.forEach(req => {\n req.abort()\n })\n\n if (this._rarityMap) {\n this._rarityMap.destroy()\n }\n\n for (const id in this._peers) {\n this.removePeer(id)\n }\n\n this.files.forEach(file => {\n if (file instanceof File) file._destroy()\n })\n\n const tasks = this._servers.map(server => cb => {\n server.destroy(cb)\n })\n\n if (this.discovery) {\n tasks.push(cb => {\n this.discovery.destroy(cb)\n })\n }\n\n if (this.store) {\n tasks.push(cb => {\n this.store.close(cb)\n })\n }\n\n parallel(tasks, cb)\n\n if (err) {\n // Torrent errors are emitted at `torrent.on('error')`. If there are no 'error'\n // event handlers on the torrent instance, then the error will be emitted at\n // `client.on('error')`. This prevents throwing an uncaught exception\n // (unhandled 'error' event), but it makes it impossible to distinguish client\n // errors versus torrent errors. Torrent errors are not fatal, and the client\n // is still usable afterwards. Therefore, always listen for errors in both\n // places (`client.on('error')` and `torrent.on('error')`).\n if (this.listenerCount('error') === 0) {\n this.client.emit('error', err)\n } else {\n this.emit('error', err)\n }\n }\n\n this.emit('close')\n\n this.client = null\n this.files = []\n this.discovery = null\n this.store = null\n this._rarityMap = null\n this._peers = null\n this._servers = null\n this._xsRequests = null\n }\n\n addPeer (peer) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n if (!this.infoHash) throw new Error('addPeer() must not be called before the `infoHash` event')\n\n if (this.client.blocked) {\n let host\n if (typeof peer === 'string') {\n let parts\n try {\n parts = addrToIPPort(peer)\n } catch (e) {\n this._debug('ignoring peer: invalid %s', peer)\n this.emit('invalidPeer', peer)\n return false\n }\n host = parts[0]\n } else if (typeof peer.remoteAddress === 'string') {\n host = peer.remoteAddress\n }\n\n if (host && this.client.blocked.contains(host)) {\n this._debug('ignoring peer: blocked %s', peer)\n if (typeof peer !== 'string') peer.destroy()\n this.emit('blockedPeer', peer)\n return false\n }\n }\n\n const wasAdded = !!this._addPeer(peer)\n if (wasAdded) {\n this.emit('peer', peer)\n } else {\n this.emit('invalidPeer', peer)\n }\n return wasAdded\n }\n\n _addPeer (peer) {\n if (this.destroyed) {\n if (typeof peer !== 'string') peer.destroy()\n return null\n }\n if (typeof peer === 'string' && !this._validAddr(peer)) {\n this._debug('ignoring peer: invalid %s', peer)\n return null\n }\n\n const id = (peer && peer.id) || peer\n if (this._peers[id]) {\n this._debug('ignoring peer: duplicate (%s)', id)\n if (typeof peer !== 'string') peer.destroy()\n return null\n }\n\n if (this.paused) {\n this._debug('ignoring peer: torrent is paused')\n if (typeof peer !== 'string') peer.destroy()\n return null\n }\n\n this._debug('add peer %s', id)\n\n let newPeer\n if (typeof peer === 'string') {\n // `peer` is an addr (\"ip:port\" string)\n newPeer = Peer.createTCPOutgoingPeer(peer, this)\n } else {\n // `peer` is a WebRTC connection (simple-peer)\n newPeer = Peer.createWebRTCPeer(peer, this)\n }\n\n this._peers[newPeer.id] = newPeer\n this._peersLength += 1\n\n if (typeof peer === 'string') {\n // `peer` is an addr (\"ip:port\" string)\n this._queue.push(newPeer)\n this._drain()\n }\n\n return newPeer\n }\n\n addWebSeed (url) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n\n if (!/^https?:\\/\\/.+/.test(url)) {\n this.emit('warning', new Error(`ignoring invalid web seed: ${url}`))\n this.emit('invalidPeer', url)\n return\n }\n\n if (this._peers[url]) {\n this.emit('warning', new Error(`ignoring duplicate web seed: ${url}`))\n this.emit('invalidPeer', url)\n return\n }\n\n this._debug('add web seed %s', url)\n\n const newPeer = Peer.createWebSeedPeer(url, this)\n this._peers[newPeer.id] = newPeer\n this._peersLength += 1\n\n this.emit('peer', url)\n }\n\n /**\n * Called whenever a new incoming TCP peer connects to this torrent swarm. Called with a\n * peer that has already sent a handshake.\n */\n _addIncomingPeer (peer) {\n if (this.destroyed) return peer.destroy(new Error('torrent is destroyed'))\n if (this.paused) return peer.destroy(new Error('torrent is paused'))\n\n this._debug('add incoming peer %s', peer.id)\n\n this._peers[peer.id] = peer\n this._peersLength += 1\n }\n\n removePeer (peer) {\n const id = (peer && peer.id) || peer\n peer = this._peers[id]\n\n if (!peer) return\n\n this._debug('removePeer %s', id)\n\n delete this._peers[id]\n this._peersLength -= 1\n\n peer.destroy()\n\n // If torrent swarm was at capacity before, try to open a new connection now\n this._drain()\n }\n\n select (start, end, priority, notify) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n\n if (start < 0 || end < start || this.pieces.length <= end) {\n throw new Error(`invalid selection ${start} : ${end}`)\n }\n priority = Number(priority) || 0\n\n this._debug('select %s-%s (priority %s)', start, end, priority)\n\n this._selections.push({\n from: start,\n to: end,\n offset: 0,\n priority,\n notify: notify || noop\n })\n\n this._selections.sort((a, b) => b.priority - a.priority)\n\n this._updateSelections()\n }\n\n deselect (start, end, priority) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n\n priority = Number(priority) || 0\n this._debug('deselect %s-%s (priority %s)', start, end, priority)\n\n for (let i = 0; i < this._selections.length; ++i) {\n const s = this._selections[i]\n if (s.from === start && s.to === end && s.priority === priority) {\n this._selections.splice(i, 1)\n break\n }\n }\n\n this._updateSelections()\n }\n\n critical (start, end) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n\n this._debug('critical %s-%s', start, end)\n\n for (let i = start; i <= end; ++i) {\n this._critical[i] = true\n }\n\n this._updateSelections()\n }\n\n _onWire (wire, addr) {\n this._debug('got wire %s (%s)', wire._debugId, addr || 'Unknown')\n\n wire.on('download', downloaded => {\n if (this.destroyed) return\n this.received += downloaded\n this._downloadSpeed(downloaded)\n this.client._downloadSpeed(downloaded)\n this.emit('download', downloaded)\n this.client.emit('download', downloaded)\n })\n\n wire.on('upload', uploaded => {\n if (this.destroyed) return\n this.uploaded += uploaded\n this._uploadSpeed(uploaded)\n this.client._uploadSpeed(uploaded)\n this.emit('upload', uploaded)\n this.client.emit('upload', uploaded)\n })\n\n this.wires.push(wire)\n\n if (addr) {\n // Sometimes RTCPeerConnection.getStats() doesn't return an ip:port for peers\n const parts = addrToIPPort(addr)\n wire.remoteAddress = parts[0]\n wire.remotePort = parts[1]\n }\n\n // When peer sends PORT message, add that DHT node to routing table\n if (this.client.dht && this.client.dht.listening) {\n wire.on('port', port => {\n if (this.destroyed || this.client.dht.destroyed) {\n return\n }\n if (!wire.remoteAddress) {\n return this._debug('ignoring PORT from peer with no address')\n }\n if (port === 0 || port > 65536) {\n return this._debug('ignoring invalid PORT from peer')\n }\n\n this._debug('port: %s (from %s)', port, addr)\n this.client.dht.addNode({ host: wire.remoteAddress, port })\n })\n }\n\n wire.on('timeout', () => {\n this._debug('wire timeout (%s)', addr)\n // TODO: this might be destroying wires too eagerly\n wire.destroy()\n })\n\n // Timeout for piece requests to this peer\n wire.setTimeout(PIECE_TIMEOUT, true)\n\n // Send KEEP-ALIVE (every 60s) so peers will not disconnect the wire\n wire.setKeepAlive(true)\n\n // use ut_metadata extension\n wire.use(utMetadata(this.metadata))\n\n wire.ut_metadata.on('warning', err => {\n this._debug('ut_metadata warning: %s', err.message)\n })\n\n if (!this.metadata) {\n wire.ut_metadata.on('metadata', metadata => {\n this._debug('got metadata via ut_metadata')\n this._onMetadata(metadata)\n })\n wire.ut_metadata.fetch()\n }\n\n // use ut_pex extension if the torrent is not flagged as private\n if (typeof utPex === 'function' && !this.private) {\n wire.use(utPex())\n\n wire.ut_pex.on('peer', peer => {\n // Only add potential new peers when we're not seeding\n if (this.done) return\n this._debug('ut_pex: got peer: %s (from %s)', peer, addr)\n this.addPeer(peer)\n })\n\n wire.ut_pex.on('dropped', peer => {\n // the remote peer believes a given peer has been dropped from the torrent swarm.\n // if we're not currently connected to it, then remove it from the queue.\n const peerObj = this._peers[peer]\n if (peerObj && !peerObj.connected) {\n this._debug('ut_pex: dropped peer: %s (from %s)', peer, addr)\n this.removePeer(peer)\n }\n })\n\n wire.once('close', () => {\n // Stop sending updates to remote peer\n wire.ut_pex.reset()\n })\n }\n\n // Hook to allow user-defined `bittorrent-protocol` extensions\n // More info: https://github.com/webtorrent/bittorrent-protocol#extension-api\n this.emit('wire', wire, addr)\n\n if (this.metadata) {\n process.nextTick(() => {\n // This allows wire.handshake() to be called (by Peer.onHandshake) before any\n // messages get sent on the wire\n this._onWireWithMetadata(wire)\n })\n }\n }\n\n _onWireWithMetadata (wire) {\n let timeoutId = null\n\n const onChokeTimeout = () => {\n if (this.destroyed || wire.destroyed) return\n\n if (this._numQueued > 2 * (this._numConns - this.numPeers) &&\n wire.amInterested) {\n wire.destroy()\n } else {\n timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT)\n if (timeoutId.unref) timeoutId.unref()\n }\n }\n\n let i\n const updateSeedStatus = () => {\n if (wire.peerPieces.buffer.length !== this.bitfield.buffer.length) return\n for (i = 0; i < this.pieces.length; ++i) {\n if (!wire.peerPieces.get(i)) return\n }\n wire.isSeeder = true\n wire.choke() // always choke seeders\n }\n\n wire.on('bitfield', () => {\n updateSeedStatus()\n this._update()\n })\n\n wire.on('have', () => {\n updateSeedStatus()\n this._update()\n })\n\n wire.once('interested', () => {\n wire.unchoke()\n })\n\n wire.once('close', () => {\n clearTimeout(timeoutId)\n })\n\n wire.on('choke', () => {\n clearTimeout(timeoutId)\n timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT)\n if (timeoutId.unref) timeoutId.unref()\n })\n\n wire.on('unchoke', () => {\n clearTimeout(timeoutId)\n this._update()\n })\n\n wire.on('request', (index, offset, length, cb) => {\n if (length > MAX_BLOCK_LENGTH) {\n // Per spec, disconnect from peers that request >128KB\n return wire.destroy()\n }\n if (this.pieces[index]) return\n this.store.get(index, { offset, length }, cb)\n })\n\n wire.bitfield(this.bitfield) // always send bitfield (required)\n wire.uninterested() // always start out uninterested (as per protocol)\n\n // Send PORT message to peers that support DHT\n if (wire.peerExtensions.dht && this.client.dht && this.client.dht.listening) {\n wire.port(this.client.dht.address().port)\n }\n\n if (wire.type !== 'webSeed') { // do not choke on webseeds\n timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT)\n if (timeoutId.unref) timeoutId.unref()\n }\n\n wire.isSeeder = false\n updateSeedStatus()\n }\n\n /**\n * Called on selection changes.\n */\n _updateSelections () {\n if (!this.ready || this.destroyed) return\n\n process.nextTick(() => {\n this._gcSelections()\n })\n this._updateInterest()\n this._update()\n }\n\n /**\n * Garbage collect selections with respect to the store's current state.\n */\n _gcSelections () {\n for (let i = 0; i < this._selections.length; ++i) {\n const s = this._selections[i]\n const oldOffset = s.offset\n\n // check for newly downloaded pieces in selection\n while (this.bitfield.get(s.from + s.offset) && s.from + s.offset < s.to) {\n s.offset += 1\n }\n\n if (oldOffset !== s.offset) s.notify()\n if (s.to !== s.from + s.offset) continue\n if (!this.bitfield.get(s.from + s.offset)) continue\n\n this._selections.splice(i, 1) // remove fully downloaded selection\n i -= 1 // decrement i to offset splice\n\n s.notify()\n this._updateInterest()\n }\n\n if (!this._selections.length) this.emit('idle')\n }\n\n /**\n * Update interested status for all peers.\n */\n _updateInterest () {\n const prev = this._amInterested\n this._amInterested = !!this._selections.length\n\n this.wires.forEach(wire => {\n let interested = false\n for (let index = 0; index < this.pieces.length; ++index) {\n if (this.pieces[index] && wire.peerPieces.get(index)) {\n interested = true\n break\n }\n }\n\n if (interested) wire.interested()\n else wire.uninterested()\n })\n\n if (prev === this._amInterested) return\n if (this._amInterested) this.emit('interested')\n else this.emit('uninterested')\n }\n\n /**\n * Heartbeat to update all peers and their requests.\n */\n _update () {\n if (this.destroyed) return\n\n // update wires in random order for better request distribution\n const ite = randomIterate(this.wires)\n let wire\n while ((wire = ite())) {\n this._updateWireWrapper(wire)\n }\n }\n\n _updateWireWrapper (wire) {\n const self = this\n\n if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function') {\n window.requestIdleCallback(function () { self._updateWire(wire) })\n } else {\n self._updateWire(wire)\n }\n }\n\n /**\n * Attempts to update a peer's requests\n */\n _updateWire (wire) {\n // to allow function hoisting\n const self = this\n\n if (wire.peerChoking) return\n if (!wire.downloaded) return validateWire()\n\n const minOutstandingRequests = getBlockPipelineLength(wire, PIPELINE_MIN_DURATION)\n if (wire.requests.length >= minOutstandingRequests) return\n const maxOutstandingRequests = getBlockPipelineLength(wire, PIPELINE_MAX_DURATION)\n\n trySelectWire(false) || trySelectWire(true)\n\n function genPieceFilterFunc (start, end, tried, rank) {\n return i => i >= start && i <= end && !(i in tried) && wire.peerPieces.get(i) && (!rank || rank(i))\n }\n\n // TODO: Do we need both validateWire and trySelectWire?\n function validateWire () {\n if (wire.requests.length) return\n\n let i = self._selections.length\n while (i--) {\n const next = self._selections[i]\n let piece\n if (self.strategy === 'rarest') {\n const start = next.from + next.offset\n const end = next.to\n const len = end - start + 1\n const tried = {}\n let tries = 0\n const filter = genPieceFilterFunc(start, end, tried)\n\n while (tries < len) {\n piece = self._rarityMap.getRarestPiece(filter)\n if (piece < 0) break\n if (self._request(wire, piece, false)) return\n tried[piece] = true\n tries += 1\n }\n } else {\n for (piece = next.to; piece >= next.from + next.offset; --piece) {\n if (!wire.peerPieces.get(piece)) continue\n if (self._request(wire, piece, false)) return\n }\n }\n }\n\n // TODO: wire failed to validate as useful; should we close it?\n // probably not, since 'have' and 'bitfield' messages might be coming\n }\n\n function speedRanker () {\n const speed = wire.downloadSpeed() || 1\n if (speed > SPEED_THRESHOLD) return () => true\n\n const secs = Math.max(1, wire.requests.length) * Piece.BLOCK_LENGTH / speed\n let tries = 10\n let ptr = 0\n\n return index => {\n if (!tries || self.bitfield.get(index)) return true\n\n let missing = self.pieces[index].missing\n\n for (; ptr < self.wires.length; ptr++) {\n const otherWire = self.wires[ptr]\n const otherSpeed = otherWire.downloadSpeed()\n\n if (otherSpeed < SPEED_THRESHOLD) continue\n if (otherSpeed <= speed) continue\n if (!otherWire.peerPieces.get(index)) continue\n if ((missing -= otherSpeed * secs) > 0) continue\n\n tries--\n return false\n }\n\n return true\n }\n }\n\n function shufflePriority (i) {\n let last = i\n for (let j = i; j < self._selections.length && self._selections[j].priority; j++) {\n last = j\n }\n const tmp = self._selections[i]\n self._selections[i] = self._selections[last]\n self._selections[last] = tmp\n }\n\n function trySelectWire (hotswap) {\n if (wire.requests.length >= maxOutstandingRequests) return true\n const rank = speedRanker()\n\n for (let i = 0; i < self._selections.length; i++) {\n const next = self._selections[i]\n\n let piece\n if (self.strategy === 'rarest') {\n const start = next.from + next.offset\n const end = next.to\n const len = end - start + 1\n const tried = {}\n let tries = 0\n const filter = genPieceFilterFunc(start, end, tried, rank)\n\n while (tries < len) {\n piece = self._rarityMap.getRarestPiece(filter)\n if (piece < 0) break\n\n // request all non-reserved blocks in this piece\n while (self._request(wire, piece, self._critical[piece] || hotswap)) {}\n\n if (wire.requests.length < maxOutstandingRequests) {\n tried[piece] = true\n tries++\n continue\n }\n\n if (next.priority) shufflePriority(i)\n return true\n }\n } else {\n for (piece = next.from + next.offset; piece <= next.to; piece++) {\n if (!wire.peerPieces.get(piece) || !rank(piece)) continue\n\n // request all non-reserved blocks in piece\n while (self._request(wire, piece, self._critical[piece] || hotswap)) {}\n\n if (wire.requests.length < maxOutstandingRequests) continue\n\n if (next.priority) shufflePriority(i)\n return true\n }\n }\n }\n\n return false\n }\n }\n\n /**\n * Called periodically to update the choked status of all peers, handling optimistic\n * unchoking as described in BEP3.\n */\n _rechoke () {\n if (!this.ready) return\n\n if (this._rechokeOptimisticTime > 0) this._rechokeOptimisticTime -= 1\n else this._rechokeOptimisticWire = null\n\n const peers = []\n\n this.wires.forEach(wire => {\n if (!wire.isSeeder && wire !== this._rechokeOptimisticWire) {\n peers.push({\n wire,\n downloadSpeed: wire.downloadSpeed(),\n uploadSpeed: wire.uploadSpeed(),\n salt: Math.random(),\n isChoked: true\n })\n }\n })\n\n peers.sort(rechokeSort)\n\n let unchokeInterested = 0\n let i = 0\n for (; i < peers.length && unchokeInterested < this._rechokeNumSlots; ++i) {\n peers[i].isChoked = false\n if (peers[i].wire.peerInterested) unchokeInterested += 1\n }\n\n // Optimistically unchoke a peer\n if (!this._rechokeOptimisticWire && i < peers.length && this._rechokeNumSlots) {\n const candidates = peers.slice(i).filter(peer => peer.wire.peerInterested)\n const optimistic = candidates[randomInt(candidates.length)]\n\n if (optimistic) {\n optimistic.isChoked = false\n this._rechokeOptimisticWire = optimistic.wire\n this._rechokeOptimisticTime = RECHOKE_OPTIMISTIC_DURATION\n }\n }\n\n // Unchoke best peers\n peers.forEach(peer => {\n if (peer.wire.amChoking !== peer.isChoked) {\n if (peer.isChoked) peer.wire.choke()\n else peer.wire.unchoke()\n }\n })\n\n function rechokeSort (peerA, peerB) {\n // Prefer higher download speed\n if (peerA.downloadSpeed !== peerB.downloadSpeed) {\n return peerB.downloadSpeed - peerA.downloadSpeed\n }\n\n // Prefer higher upload speed\n if (peerA.uploadSpeed !== peerB.uploadSpeed) {\n return peerB.uploadSpeed - peerA.uploadSpeed\n }\n\n // Prefer unchoked\n if (peerA.wire.amChoking !== peerB.wire.amChoking) {\n return peerA.wire.amChoking ? 1 : -1\n }\n\n // Random order\n return peerA.salt - peerB.salt\n }\n }\n\n /**\n * Attempts to cancel a slow block request from another wire such that the\n * given wire may effectively swap out the request for one of its own.\n */\n _hotswap (wire, index) {\n const speed = wire.downloadSpeed()\n if (speed < Piece.BLOCK_LENGTH) return false\n if (!this._reservations[index]) return false\n\n const r = this._reservations[index]\n if (!r) {\n return false\n }\n\n let minSpeed = Infinity\n let minWire\n\n let i\n for (i = 0; i < r.length; i++) {\n const otherWire = r[i]\n if (!otherWire || otherWire === wire) continue\n\n const otherSpeed = otherWire.downloadSpeed()\n if (otherSpeed >= SPEED_THRESHOLD) continue\n if (2 * otherSpeed > speed || otherSpeed > minSpeed) continue\n\n minWire = otherWire\n minSpeed = otherSpeed\n }\n\n if (!minWire) return false\n\n for (i = 0; i < r.length; i++) {\n if (r[i] === minWire) r[i] = null\n }\n\n for (i = 0; i < minWire.requests.length; i++) {\n const req = minWire.requests[i]\n if (req.piece !== index) continue\n\n this.pieces[index].cancel((req.offset / Piece.BLOCK_LENGTH) | 0)\n }\n\n this.emit('hotswap', minWire, wire, index)\n return true\n }\n\n /**\n * Attempts to request a block from the given wire.\n */\n _request (wire, index, hotswap) {\n const self = this\n const numRequests = wire.requests.length\n const isWebSeed = wire.type === 'webSeed'\n\n if (self.bitfield.get(index)) return false\n\n const maxOutstandingRequests = isWebSeed\n ? Math.min(\n getPiecePipelineLength(wire, PIPELINE_MAX_DURATION, self.pieceLength),\n self.maxWebConns\n )\n : getBlockPipelineLength(wire, PIPELINE_MAX_DURATION)\n\n if (numRequests >= maxOutstandingRequests) return false\n // var endGame = (wire.requests.length === 0 && self.store.numMissing < 30)\n\n const piece = self.pieces[index]\n let reservation = isWebSeed ? piece.reserveRemaining() : piece.reserve()\n\n if (reservation === -1 && hotswap && self._hotswap(wire, index)) {\n reservation = isWebSeed ? piece.reserveRemaining() : piece.reserve()\n }\n if (reservation === -1) return false\n\n let r = self._reservations[index]\n if (!r) r = self._reservations[index] = []\n let i = r.indexOf(null)\n if (i === -1) i = r.length\n r[i] = wire\n\n const chunkOffset = piece.chunkOffset(reservation)\n const chunkLength = isWebSeed ? piece.chunkLengthRemaining(reservation) : piece.chunkLength(reservation)\n\n wire.request(index, chunkOffset, chunkLength, function onChunk (err, chunk) {\n if (self.destroyed) return\n\n // TODO: what is this for?\n if (!self.ready) return self.once('ready', () => { onChunk(err, chunk) })\n\n if (r[i] === wire) r[i] = null\n\n if (piece !== self.pieces[index]) return onUpdateTick()\n\n if (err) {\n self._debug(\n 'error getting piece %s (offset: %s length: %s) from %s: %s',\n index, chunkOffset, chunkLength, `${wire.remoteAddress}:${wire.remotePort}`,\n err.message\n )\n isWebSeed ? piece.cancelRemaining(reservation) : piece.cancel(reservation)\n onUpdateTick()\n return\n }\n\n self._debug(\n 'got piece %s (offset: %s length: %s) from %s',\n index, chunkOffset, chunkLength, `${wire.remoteAddress}:${wire.remotePort}`\n )\n\n if (!piece.set(reservation, chunk, wire)) return onUpdateTick()\n\n const buf = piece.flush()\n\n // TODO: might need to set self.pieces[index] = null here since sha1 is async\n\n sha1(buf, hash => {\n if (self.destroyed) return\n\n if (hash === self._hashes[index]) {\n if (!self.pieces[index]) return\n self._debug('piece verified %s', index)\n\n self.pieces[index] = null\n self._reservations[index] = null\n self.bitfield.set(index, true)\n\n self.store.put(index, buf)\n\n self.wires.forEach(wire => {\n wire.have(index)\n })\n\n // We also check `self.destroyed` since `torrent.destroy()` could have been\n // called in the `torrent.on('done')` handler, triggered by `_checkDone()`.\n if (self._checkDone() && !self.destroyed) self.discovery.complete()\n } else {\n self.pieces[index] = new Piece(piece.length)\n self.emit('warning', new Error(`Piece ${index} failed verification`))\n }\n onUpdateTick()\n })\n })\n\n function onUpdateTick () {\n process.nextTick(() => { self._update() })\n }\n\n return true\n }\n\n _checkDone () {\n if (this.destroyed) return\n\n // are any new files done?\n this.files.forEach(file => {\n if (file.done) return\n for (let i = file._startPiece; i <= file._endPiece; ++i) {\n if (!this.bitfield.get(i)) return\n }\n file.done = true\n file.emit('done')\n this._debug(`file done: ${file.name}`)\n })\n\n // is the torrent done? (if all current selections are satisfied, or there are\n // no selections, then torrent is done)\n let done = true\n for (let i = 0; i < this._selections.length; i++) {\n const selection = this._selections[i]\n for (let piece = selection.from; piece <= selection.to; piece++) {\n if (!this.bitfield.get(piece)) {\n done = false\n break\n }\n }\n if (!done) break\n }\n if (!this.done && done) {\n this.done = true\n this._debug(`torrent done: ${this.infoHash}`)\n this.emit('done')\n }\n this._gcSelections()\n\n return done\n }\n\n load (streams, cb) {\n if (this.destroyed) throw new Error('torrent is destroyed')\n if (!this.ready) return this.once('ready', () => { this.load(streams, cb) })\n\n if (!Array.isArray(streams)) streams = [streams]\n if (!cb) cb = noop\n\n const readable = new MultiStream(streams)\n const writable = new ChunkStoreWriteStream(this.store, this.pieceLength)\n\n pump(readable, writable, err => {\n if (err) return cb(err)\n this._markAllVerified()\n this._checkDone()\n cb(null)\n })\n }\n\n createServer (requestListener) {\n if (typeof Server !== 'function') throw new Error('node.js-only method')\n if (this.destroyed) throw new Error('torrent is destroyed')\n const server = new Server(this, requestListener)\n this._servers.push(server)\n return server\n }\n\n pause () {\n if (this.destroyed) return\n this._debug('pause')\n this.paused = true\n }\n\n resume () {\n if (this.destroyed) return\n this._debug('resume')\n this.paused = false\n this._drain()\n }\n\n _debug () {\n const args = [].slice.call(arguments)\n args[0] = `[${this.client._debugId}] [${this._debugId}] ${args[0]}`\n debug(...args)\n }\n\n /**\n * Pop a peer off the FIFO queue and connect to it. When _drain() gets called,\n * the queue will usually have only one peer in it, except when there are too\n * many peers (over `this.maxConns`) in which case they will just sit in the\n * queue until another connection closes.\n */\n _drain () {\n this._debug('_drain numConns %s maxConns %s', this._numConns, this.client.maxConns)\n if (typeof net.connect !== 'function' || this.destroyed || this.paused ||\n this._numConns >= this.client.maxConns) {\n return\n }\n this._debug('drain (%s queued, %s/%s peers)', this._numQueued, this.numPeers, this.client.maxConns)\n\n const peer = this._queue.shift()\n if (!peer) return // queue could be empty\n\n this._debug('tcp connect attempt to %s', peer.addr)\n\n const parts = addrToIPPort(peer.addr)\n const opts = {\n host: parts[0],\n port: parts[1]\n }\n\n const conn = peer.conn = net.connect(opts)\n\n conn.once('connect', () => { peer.onConnect() })\n conn.once('error', err => { peer.destroy(err) })\n peer.startConnectTimeout()\n\n // When connection closes, attempt reconnect after timeout (with exponential backoff)\n conn.on('close', () => {\n if (this.destroyed) return\n\n // TODO: If torrent is done, do not try to reconnect after a timeout\n\n if (peer.retries >= RECONNECT_WAIT.length) {\n this._debug(\n 'conn %s closed: will not re-add (max %s attempts)',\n peer.addr, RECONNECT_WAIT.length\n )\n return\n }\n\n const ms = RECONNECT_WAIT[peer.retries]\n this._debug(\n 'conn %s closed: will re-add to queue in %sms (attempt %s)',\n peer.addr, ms, peer.retries + 1\n )\n\n const reconnectTimeout = setTimeout(() => {\n const newPeer = this._addPeer(peer.addr)\n if (newPeer) newPeer.retries = peer.retries + 1\n }, ms)\n if (reconnectTimeout.unref) reconnectTimeout.unref()\n })\n }\n\n /**\n * Returns `true` if string is valid IPv4/6 address.\n * @param {string} addr\n * @return {boolean}\n */\n _validAddr (addr) {\n let parts\n try {\n parts = addrToIPPort(addr)\n } catch (e) {\n return false\n }\n const host = parts[0]\n const port = parts[1]\n return port > 0 && port < 65535 &&\n !(host === '127.0.0.1' && port === this.client.torrentPort)\n }\n}\n\nfunction getBlockPipelineLength (wire, duration) {\n return 2 + Math.ceil(duration * wire.downloadSpeed() / Piece.BLOCK_LENGTH)\n}\n\nfunction getPiecePipelineLength (wire, duration, pieceLength) {\n return 1 + Math.ceil(duration * wire.downloadSpeed() / pieceLength)\n}\n\n/**\n * Returns a random integer in [0,high)\n */\nfunction randomInt (high) {\n return Math.random() * high | 0\n}\n\nfunction noop () {}\n\nmodule.exports = Torrent\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/webtorrent/lib/torrent.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/lib/webconn.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/webtorrent/lib/webconn.js ***!
|
||
\************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const BitField = __webpack_require__(/*! bitfield */ \"./node_modules/webtorrent/node_modules/bitfield/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('webtorrent:webconn')\nconst get = __webpack_require__(/*! simple-get */ \"./node_modules/simple-get/index.js\")\nconst sha1 = __webpack_require__(/*! simple-sha1 */ \"./node_modules/simple-sha1/browser.js\")\nconst Wire = __webpack_require__(/*! bittorrent-protocol */ \"./node_modules/bittorrent-protocol/index.js\")\n\nconst VERSION = __webpack_require__(/*! ../package.json */ \"./node_modules/webtorrent/package.json\").version\n\n/**\n * Converts requests for torrent blocks into http range requests.\n * @param {string} url web seed url\n * @param {Object} torrent\n */\nclass WebConn extends Wire {\n constructor (url, torrent) {\n super()\n\n this.url = url\n this.webPeerId = sha1.sync(url)\n this._torrent = torrent\n\n this._init()\n }\n\n _init () {\n this.setKeepAlive(true)\n\n this.once('handshake', (infoHash, peerId) => {\n if (this.destroyed) return\n this.handshake(infoHash, this.webPeerId)\n const numPieces = this._torrent.pieces.length\n const bitfield = new BitField(numPieces)\n for (let i = 0; i <= numPieces; i++) {\n bitfield.set(i, true)\n }\n this.bitfield(bitfield)\n })\n\n this.once('interested', () => {\n debug('interested')\n this.unchoke()\n })\n\n this.on('uninterested', () => { debug('uninterested') })\n this.on('choke', () => { debug('choke') })\n this.on('unchoke', () => { debug('unchoke') })\n this.on('bitfield', () => { debug('bitfield') })\n\n this.on('request', (pieceIndex, offset, length, callback) => {\n debug('request pieceIndex=%d offset=%d length=%d', pieceIndex, offset, length)\n this.httpRequest(pieceIndex, offset, length, callback)\n })\n }\n\n httpRequest (pieceIndex, offset, length, cb) {\n const pieceOffset = pieceIndex * this._torrent.pieceLength\n const rangeStart = pieceOffset + offset /* offset within whole torrent */\n const rangeEnd = rangeStart + length - 1\n\n // Web seed URL format:\n // For single-file torrents, make HTTP range requests directly to the web seed URL\n // For multi-file torrents, add the torrent folder and file name to the URL\n const files = this._torrent.files\n let requests\n if (files.length <= 1) {\n requests = [{\n url: this.url,\n start: rangeStart,\n end: rangeEnd\n }]\n } else {\n const requestedFiles = files.filter(file => {\n return file.offset <= rangeEnd && (file.offset + file.length) > rangeStart\n })\n if (requestedFiles.length < 1) {\n return cb(new Error('Could not find file corresponnding to web seed range request'))\n }\n\n requests = requestedFiles.map(requestedFile => {\n const fileEnd = requestedFile.offset + requestedFile.length - 1\n const url = this.url +\n (this.url[this.url.length - 1] === '/' ? '' : '/') +\n requestedFile.path\n return {\n url,\n fileOffsetInRange: Math.max(requestedFile.offset - rangeStart, 0),\n start: Math.max(rangeStart - requestedFile.offset, 0),\n end: Math.min(fileEnd, rangeEnd - requestedFile.offset)\n }\n })\n }\n\n // Now make all the HTTP requests we need in order to load this piece\n // Usually that's one requests, but sometimes it will be multiple\n // Send requests in parallel and wait for them all to come back\n let numRequestsSucceeded = 0\n let hasError = false\n\n let ret\n if (requests.length > 1) {\n ret = Buffer.alloc(length)\n }\n\n requests.forEach(request => {\n const url = request.url\n const start = request.start\n const end = request.end\n debug(\n 'Requesting url=%s pieceIndex=%d offset=%d length=%d start=%d end=%d',\n url, pieceIndex, offset, length, start, end\n )\n const opts = {\n url,\n method: 'GET',\n headers: {\n 'user-agent': `WebTorrent/${VERSION} (https://webtorrent.io)`,\n range: `bytes=${start}-${end}`\n }\n }\n function onResponse (res, data) {\n if (res.statusCode < 200 || res.statusCode >= 300) {\n hasError = true\n return cb(new Error(`Unexpected HTTP status code ${res.statusCode}`))\n }\n debug('Got data of length %d', data.length)\n\n if (requests.length === 1) {\n // Common case: fetch piece in a single HTTP request, return directly\n cb(null, data)\n } else {\n // Rare case: reconstruct multiple HTTP requests across 2+ files into one\n // piece buffer\n data.copy(ret, request.fileOffsetInRange)\n if (++numRequestsSucceeded === requests.length) {\n cb(null, ret)\n }\n }\n }\n get.concat(opts, (err, res, data) => {\n if (hasError) return\n if (err) {\n // Browsers allow HTTP redirects for simple cross-origin\n // requests but not for requests that require preflight.\n // Use a simple request to unravel any redirects and get the\n // final URL. Retry the original request with the new URL if\n // it's different.\n //\n // This test is imperfect but it's simple and good for common\n // cases. It catches all cross-origin cases but matches a few\n // same-origin cases too.\n if (typeof window === 'undefined' || url.startsWith(`${window.location.origin}/`)) {\n hasError = true\n return cb(err)\n }\n\n return get.head(url, (errHead, res) => {\n if (hasError) return\n if (errHead) {\n hasError = true\n return cb(errHead)\n }\n if (res.statusCode < 200 || res.statusCode >= 300) {\n hasError = true\n return cb(new Error(`Unexpected HTTP status code ${res.statusCode}`))\n }\n if (res.url === url) {\n hasError = true\n return cb(err)\n }\n\n opts.url = res.url\n get.concat(opts, (err, res, data) => {\n if (hasError) return\n if (err) {\n hasError = true\n return cb(err)\n }\n onResponse(res, data)\n })\n })\n }\n onResponse(res, data)\n })\n })\n }\n\n destroy () {\n super.destroy()\n this._torrent = null\n }\n}\n\nmodule.exports = WebConn\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/webtorrent/lib/webconn.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/node_modules/bitfield/index.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/webtorrent/node_modules/bitfield/index.js ***!
|
||
\****************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("function getByteSize (num) {\r\n let out = num >> 3\r\n if (num % 8 !== 0) out++\r\n return out\r\n}\r\n\r\nclass BitField {\r\n constructor (data = 0, opts) {\r\n const grow = opts != null && opts.grow\r\n this.grow = (grow && isFinite(grow) && getByteSize(grow)) || grow || 0\r\n this.buffer = typeof data === 'number' ? new Uint8Array(getByteSize(data)) : data\r\n }\r\n\r\n get (i) {\r\n const j = i >> 3\r\n return (j < this.buffer.length) &&\r\n !!(this.buffer[j] & (128 >> (i % 8)))\r\n }\r\n\r\n set (i, b = true) {\r\n const j = i >> 3\r\n if (b) {\r\n if (this.buffer.length < j + 1) {\r\n const length = Math.max(j + 1, Math.min(2 * this.buffer.length, this.grow))\r\n if (length <= this.grow) {\r\n const newBuffer = new Uint8Array(length)\r\n newBuffer.set(this.buffer)\r\n this.buffer = newBuffer\r\n }\r\n }\r\n // Set\r\n this.buffer[j] |= 128 >> (i % 8)\r\n } else if (j < this.buffer.length) {\r\n // Clear\r\n this.buffer[j] &= ~(128 >> (i % 8))\r\n }\r\n }\r\n}\r\n\r\nif (true) module.exports = BitField\r\n\n\n//# sourceURL=webpack:///./node_modules/webtorrent/node_modules/bitfield/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/node_modules/stream-to-blob/index.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/webtorrent/node_modules/stream-to-blob/index.js ***!
|
||
\**********************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* global Blob */\n\nmodule.exports = streamToBlob\n\nfunction streamToBlob (stream, mimeType) {\n if (mimeType != null && typeof mimeType !== 'string') {\n throw new Error('Invalid mimetype, expected string.')\n }\n return new Promise((resolve, reject) => {\n const chunks = []\n stream\n .on('data', chunk => chunks.push(chunk))\n .once('end', () => {\n const blob = mimeType != null\n ? new Blob(chunks, { type: mimeType })\n : new Blob(chunks)\n resolve(blob)\n })\n .once('error', reject)\n })\n}\n\n\n//# sourceURL=webpack:///./node_modules/webtorrent/node_modules/stream-to-blob/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/webtorrent/package.json":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/webtorrent/package.json ***!
|
||
\**********************************************/
|
||
/*! exports provided: name, description, version, author, browser, browserify, bugs, chromeapp, dependencies, devDependencies, engines, homepage, keywords, license, main, repository, scripts, default */
|
||
/***/ (function(module) {
|
||
|
||
eval("module.exports = {\"name\":\"webtorrent\",\"description\":\"Streaming torrent client\",\"version\":\"0.107.3\",\"author\":{\"name\":\"WebTorrent, LLC\",\"email\":\"feross@webtorrent.io\",\"url\":\"https://webtorrent.io\"},\"browser\":{\"./lib/server.js\":false,\"./lib/tcp-pool.js\":false,\"bittorrent-dht/client\":false,\"fs-chunk-store\":\"memory-chunk-store\",\"load-ip-set\":false,\"net\":false,\"os\":false,\"ut_pex\":false},\"browserify\":{\"transform\":[\"package-json-versionify\"]},\"bugs\":{\"url\":\"https://github.com/webtorrent/webtorrent/issues\"},\"chromeapp\":{\"fs-chunk-store\":\"memory-chunk-store\",\"http\":\"http-node\",\"load-ip-set\":false,\"net\":\"chrome-net\",\"os\":false},\"dependencies\":{\"addr-to-ip-port\":\"^1.4.2\",\"bitfield\":\"^3.0.0\",\"bittorrent-dht\":\"^9.0.0\",\"bittorrent-protocol\":\"^3.0.0\",\"chrome-net\":\"^3.3.2\",\"chunk-store-stream\":\"^4.0.0\",\"create-torrent\":\"^4.0.0\",\"debug\":\"^4.1.0\",\"end-of-stream\":\"^1.1.0\",\"fs-chunk-store\":\"^2.0.0\",\"http-node\":\"github:feross/http-node#cddd2872f0020ecf5016f326cf5e58c965eef52a\",\"immediate-chunk-store\":\"^2.0.0\",\"load-ip-set\":\"^2.1.0\",\"memory-chunk-store\":\"^1.2.0\",\"mime\":\"^2.4.0\",\"multistream\":\"^4.0.0\",\"package-json-versionify\":\"^1.0.2\",\"parse-numeric-range\":\"^0.0.2\",\"parse-torrent\":\"^7.0.0\",\"pump\":\"^3.0.0\",\"random-iterate\":\"^1.0.1\",\"randombytes\":\"^2.0.3\",\"range-parser\":\"^1.2.0\",\"readable-stream\":\"^3.0.6\",\"render-media\":\"^3.0.0\",\"run-parallel\":\"^1.1.6\",\"run-parallel-limit\":\"^1.0.3\",\"simple-concat\":\"^1.0.0\",\"simple-get\":\"^3.0.1\",\"simple-peer\":\"^9.0.0\",\"simple-sha1\":\"^2.0.8\",\"speedometer\":\"^1.0.0\",\"stream-to-blob\":\"^2.0.0\",\"stream-to-blob-url\":\"^3.0.0\",\"stream-with-known-length-to-buffer\":\"^1.0.0\",\"torrent-discovery\":\"^9.1.1\",\"torrent-piece\":\"^2.0.0\",\"uniq\":\"^1.0.1\",\"unordered-array-remove\":\"^1.0.2\",\"ut_metadata\":\"^3.3.0\",\"ut_pex\":\"^2.0.0\"},\"devDependencies\":{\"airtap\":\"^2.0.3\",\"bittorrent-tracker\":\"^9.14.0\",\"browserify\":\"^16.4.0\",\"disc\":\"^1.3.3\",\"electron\":\"^6.0.1\",\"finalhandler\":\"^1.0.0\",\"network-address\":\"^1.1.0\",\"run-series\":\"^1.1.4\",\"serve-static\":\"^1.11.1\",\"standard\":\"*\",\"tape\":\"^4.6.0\",\"tinyify\":\"^2.5.1\",\"webtorrent-fixtures\":\"^1.5.0\"},\"engines\":{\"node\":\">=10\"},\"homepage\":\"https://webtorrent.io\",\"keywords\":[\"bittorrent\",\"bittorrent client\",\"download\",\"mad science\",\"p2p\",\"peer-to-peer\",\"peers\",\"streaming\",\"swarm\",\"torrent\",\"web torrent\",\"webrtc\",\"webrtc data\",\"webtorrent\"],\"license\":\"MIT\",\"main\":\"index.js\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/webtorrent/webtorrent.git\"},\"scripts\":{\"build\":\"browserify --standalone WebTorrent --plugin tinyify . > webtorrent.min.js\",\"build-debug\":\"browserify --standalone WebTorrent . > webtorrent.debug.js\",\"size\":\"npm run size-js && npm run size-disc\",\"size-disc\":\"browserify --plugin tinyify --full-paths . | discify --open\",\"size-js\":\"npm run build && cat webtorrent.min.js | gzip | wc -c\",\"test\":\"standard && npm run test-node && npm run test-browser\",\"test-browser\":\"airtap -- test/*.js test/browser/*.js\",\"test-browser-local\":\"airtap --local -- test/*.js test/browser/*.js\",\"test-node\":\"tape test/*.js test/node/*.js\",\"update-authors\":\"./scripts/update-authors.sh\"}};\n\n//# sourceURL=webpack:///./node_modules/webtorrent/package.json?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/wolkjs/index.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/wolkjs/index.js ***!
|
||
\**************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("if( false ) {}\n\nif (false) {}\n\nif (false) {}\n\nconst FS = __webpack_require__(/*! ./lib/fs.js */ \"./node_modules/wolkjs/lib/fs.js\") ;\nmodule.exports.FS = FS;\n\nconst WOLK = __webpack_require__(/*! ./lib/wolk.js */ \"./node_modules/wolkjs/lib/wolk.js\");\nmodule.exports.WOLK = WOLK;\n\n\n//# sourceURL=webpack:///./node_modules/wolkjs/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/wolkjs/lib/fs.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/wolkjs/lib/fs.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nconst request = __webpack_require__(/*! request */ \"./node_modules/request/index.js\");\nconst rp = __webpack_require__(/*! request-promise */ \"./node_modules/request-promise/lib/rp.js\");\nconst rperrors = __webpack_require__(/*! request-promise/errors */ \"./node_modules/request-promise/errors.js\");\nconst path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\nconst crypto = __webpack_require__(/*! @trust/webcrypto */ \"./node_modules/@trust/webcrypto/src/index.js\")\nconst fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\");\nconst sha256 = __webpack_require__(/*! sha256 */ \"./node_modules/sha256/lib/sha256.js\");\nconst WolkError = __webpack_require__(/*! ./wolkerror.js */ \"./node_modules/wolkjs/lib/wolkerror.js\")\n\nconst defaultAccountFile = \"default\"\nconst ecdsaPublicKeyFile = \"public.key\"\nconst ecdsaPrivateKeyFile = \"private.key\"\nconst rsaPublicKeyFile = \"id_rsa.pub\"\nconst rsaPrivateKeyFile = \"id_rsa\"\nconst friendsKeyFile = \"friends.key\"\nconst personalKeyFile = \"personal.key\"\n\nconst ProtocolName = \"wolk\"\nconst PayloadChunk = \"chunk\"\n\nconst SystemCollection = \"buckets\";\nconst SMTTreeDepth = 160;\n\n/* TransactionType Constants */\nconst TransactionTransfer = 1\nconst TransactionRegisterNode = 2\nconst TransactionUpdateNode = 3\nconst TransactionBandwidthCheck = 4\nconst TransactionSetQuota = 5\nconst TransactionSetKey = 6\nconst TransactionDeleteKey = 7\nconst TransactionSetName = 8\nconst TransactionMutate = 9\n\n/* BucketType Constants */\nconst BucketCloudstore = 0\nconst BucketNoSQL = 1\nconst BucketSQL = 2\nconst DefaultMaxBucketSize = 1000000\n\n/* SQLREQUEST OPTION Constants */\nconst RT_PUT = 'Put'\nconst RT_GET = \"Get\"\nconst RT_DELETE = \"Delete\"\nconst RT_QUERY = \"Query\"\nconst RT_SCAN = \"Scan\"\nconst DEFAULT_DEVELOPER_TRUST_LEVEL = 1 //0 = regular web behavior no proof checking | 1 = check ALL proofs | In between check that % of time\nconst DEFAULT_USER_TRUST_LEVEL = 1 //0 = regular web behavior no proof checking | 1 = check ALL proofs | In between check that % of time\n\nclass WOLK {\n constructor() {\n this.provider = \"https://cloud.wolk.com\";\n this.keyDir = \"~/.wolk/keys\"\n this.developerTrustLevel = DEFAULT_DEVELOPER_TRUST_LEVEL\n this.userTrustLevel = DEFAULT_USER_TRUST_LEVEL\n this.setWolkTrustLevel()\n }\n\n async init() {\n return await this.loadDefaultAccount()\n .then( (account) => {\n return account\n })\n .catch( (err) => {\n console.log(\"WOLK: loadAccount error: \" + err)\n throw err;\n })\n }\n\n setKeyDir(_keyDir) {\n this.keyDir = _keyDir\n }\n\n setProvider( provider ) {\n this.provider = provider\n }\n\n setDeveloperTrustLevel( level ) {\n this.developerTrustLevel = level\n }\n\n setUserTrustLevel( level ) {\n this.userTrustLevel = level\n }\n\n setWolkTrustLevel() {\n if( this.userTrustLevel > this.developerTrustLevel ) {\n this.wolkTrustLevel = this.userTrustLevel\n } else {\n this.wolkTrustLevel = this.developerTrustLevel\n }\n }\n\n // account operations\n loadDefaultAccount() {\n let fn = path.join(this.keyDir, defaultAccountFile)\n if (fs.existsSync(fn)) {\n let defaultAccount = fs.readFileSync(fn, 'utf8');\n // console.log(\"Default account: \", defaultAccount)\n return this.loadAccount(defaultAccount)\n .then( () => {\n //console.log(\"[fs:loadDefaultAccount] loadAccount - loaded: \" + defaultAccount)\n return defaultAccount\n })\n .catch( (err) => {\n throw new WolkError(0, \"Unable to load defaultAccount [\" + defaultAccount + \"]\")\n })\n } else {\n throw new WolkError(0, \"No Default Account found: please create one\")\n }\n return new Promise(function(resolve, reject) {\n resolve(\"\");\n });\n }\n\n async setDefaultAccount( name ) {\n name = name.toLowerCase();\n let fn = path.join(this.keyDir, defaultAccountFile)\n return await p_writefile(fn, name, 'utf8')\n .then( () => {\n //console.log('SUCC: Setting default account')\n this.defaultAccount = name\n //console.log(\"SetDefault\")\n return new Promise( function(resolve, reject) {\n resolve(name);\n });\n })\n }\n\n async createAccount(name, callback) {\n name = name.toLowerCase();\n // we assume account not on blockchain\n let accountDir = path.join(this.keyDir, name)\n if (fs.existsSync(accountDir)) {\n console.log(\"Account Already Exists Setting as DEFAULT:\", accountDir)\n //console.log(\"Provider: \" + this.provider)\n return await this.setDefaultAccount( name )\n .then( () => {\n //console.log(\"loading default\")\n return this.loadDefaultAccount()\n .then(() => {\n return this.loadAccount(name)\n .then( () => { return \"accountexistslocally\"; })\n .catch( (err) => { console.error(\"[fs:createAccount] Error - loadAccount: \" + name + \" | \" + err); });\n });\n })\n } else {\n console.log(\"Creating necessary key files locally\")\n fs.mkdirSync(accountDir, { recursive: true }, (err) => {\n if (err) throw err;\n });\n\n // generate RSA + ECDSA Keys\n let rsaKey = await crypto.subtle.generateKey({\n name: \"RSASSA-PKCS1-v1_5\",\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: \"SHA-256\" }\n }, true, [\"sign\", \"verify\"]);\n let ecdsaKey = await crypto.subtle.generateKey({\n name: \"ECDSA\",\n namedCurve: \"P-256\"\n }, true, [\"sign\", \"verify\"]);\n\n let friendsKey = await crypto.subtle.generateKey(\n {\n name: \"AES-CTR\",\n length: 256, //can be 128, 192, or 256\n },\n true,\n [\"encrypt\", \"decrypt\"] //can \"encrypt\", \"decrypt\", \"wrapKey\", or \"unwrapKey\"\n )\n\n let personalKey = await crypto.subtle.generateKey(\n {\n name: \"AES-CTR\",\n length: 256, //can be 128, 192, or 256\n },\n true,\n [\"encrypt\", \"decrypt\"] //can \"encrypt\", \"decrypt\", \"wrapKey\", or \"unwrapKey\"\n )\n this.rsaKey = rsaKey.privateKey\n this.ecdsaKey = ecdsaKey.privateKey\n this.friendsKey = friendsKey\n this.personalKey = personalKey\n\n // export RSA + ECDSA Keys\n let rsaPublicKey = await crypto.subtle.exportKey(\"jwk\", rsaKey.publicKey)\n let rsaPrivateKey = await crypto.subtle.exportKey(\"jwk\", rsaKey.privateKey)\n let ecdsaPublicKey = await crypto.subtle.exportKey(\"jwk\", ecdsaKey.publicKey)\n let ecdsaPrivateKey = await crypto.subtle.exportKey(\"jwk\", ecdsaKey.privateKey)\n let friendsExportKey = await crypto.subtle.exportKey(\"jwk\", friendsKey)\n let personalExportKey = await crypto.subtle.exportKey(\"jwk\", personalKey)\n\n this.ecdsaPublicKey = JSON.stringify(ecdsaPublicKey);\n this.ecdsaPrivateKey = JSON.stringify(ecdsaPrivateKey);\n this.rsaPrivateKey = JSON.stringify(rsaPrivateKey);\n this.rsaPublicKey = JSON.stringify(rsaPublicKey);\n this.friendsExportKey = JSON.stringify(friendsExportKey);\n this.personalExportKey = JSON.stringify(personalExportKey);\n\n // save files\n return p_writefile(path.join(accountDir, rsaPrivateKeyFile), this.rsaPrivateKey, 'utf8')\n .then( () => { return p_writefile(path.join(accountDir, rsaPublicKeyFile), this.rsaPublicKey, 'utf8') })\n .then( () => { return p_writefile(path.join(accountDir, ecdsaPublicKeyFile), this.ecdsaPublicKey, 'utf8') })\n .then( () => { return p_writefile(path.join(accountDir, ecdsaPrivateKeyFile), this.ecdsaPrivateKey, 'utf8') })\n .then( () => { return p_writefile(path.join(accountDir, friendsKeyFile), this.friendsExportKey, 'utf8') })\n .then( () => { return p_writefile(path.join(accountDir, personalKeyFile), this.personalExportKey, 'utf8') })\n .then( () => {\n //console.log(\"Saved keys\")\n if (this.defaultAccount == undefined) {\n this.defaultAccount = name\n let fn = path.join(this.keyDir, defaultAccountFile)\n return p_writefile(fn, name, 'utf8')\n }\n return new Promise((resolve, reject) => { resolve(\"\") });\n })\n .then( async () => {\n return await this.loadDefaultAccount(name).then( async () => {\n let setNameProm = await this.setName(name, JSON.stringify(rsaPublicKey), callback)\n return setNameProm\n });\n })\n .catch( (err) => { throw new WolkError(0, \"ERROR: createAccount \" + err) });\n }\n }\n\n loadAccount(name) {\n name = name.toLowerCase();\n let accountDir = path.join(this.keyDir, name)\n if (!fs.existsSync(accountDir)) {\n console.log(\"no such directory:\", accountDir)\n }\n this.ecdsaPublicKey = fs.readFileSync(path.join(accountDir, ecdsaPublicKeyFile), 'utf8');\n this.ecdsaPrivateKey = fs.readFileSync(path.join(accountDir, ecdsaPrivateKeyFile), 'utf8');\n this.rsaPrivateKey = fs.readFileSync(path.join(accountDir, rsaPrivateKeyFile), 'utf8');\n this.rsaPublicKey = fs.readFileSync(path.join(accountDir, rsaPublicKeyFile), 'utf8');\n this.friendsExportKey = fs.readFileSync(path.join(accountDir, friendsKeyFile), 'utf8');\n this.personalExportKey = fs.readFileSync(path.join(accountDir, personalKeyFile), 'utf8');\n\n return crypto.subtle.importKey(\"jwk\", JSON.parse(this.ecdsaPrivateKey), {\n name: \"ECDSA\",\n namedCurve: \"P-256\"\n }, false, ['sign'])\n .then((result, err) => {\n this.ecdsaKey = {}\n this.ecdsaKey.privateKey = result;\n return\n })\n .catch((error) => {\n //console.log(\" Error Getting ECDSA Private key: \" + error);\n });\n }\n\n setName(name, rsaPublicKey, callback) {\n name = name.toLowerCase();\n return this.post(name, {\n \"name\": name,\n \"rsaPublicKey\": Buffer.from(rsaPublicKey).toString('base64')\n }, {}, callback);\n }\n\n determineProofValue() {\n let randProof = Math.random();\n if ( randProof <= this.wolkTrustLevel ) {\n return 1\n } else {\n return 0\n }\n }\n\n // Blockchain operations\n getBlock(blockNumber, callback) {\n return this.get(joinPath('wolk', 'block', blockNumber.toString(10)), { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n getNode(nodeNumber, callback) {\n return this.get(joinPath('wolk', 'node', nodeNumber.toString(10)), { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n\n getPeers(nodeNumber, callback) {\n return this.get(joinPath('wolk', 'info'), { \"Proof\": this.determineProofValue() }, callback)\n .then( (info) => {\n if( typeof info == 'string' ) {\n info = JSON.parse(info)\n }\n return info.peers\n })\n .catch( (err) => { throw err; });\n }\n getPendingTxCount(nodeNumber, callback) {\n return this.get(joinPath('wolk', 'info'), { \"Proof\": this.determineProofValue() }, callback)\n .then( (info) => {\n if( typeof info == 'string' ) {\n info = JSON.parse(info)\n }\n return info.pendingTxCount\n })\n .catch( (err) => { throw err; });\n }\n updateNode(nodeNumber, nodeInfo, callback) {\n return this.patch(joinPath('wolk', 'node', nodeNumber.toString(10)), nodeInfo, {}, callback);\n }\n getName(name, callback) {\n name = name.toLowerCase();\n return this.get(joinPath('wolk', 'name', name), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n getAccount(name, callback) {\n name = name.toLowerCase();\n return this.get(joinPath('wolk', 'account', name), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n getLatestBlockNumber(callback) {\n return this.get(joinPath('wolk', 'block', 'latest'), { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n getBalance(name_address, callback) {\n name_address = name_address.toLowerCase();\n return this.getAccount(name_address)\n .then( accObject => {\n var account = JSON.parse(accObject)\n return account.balance\n })\n .catch( (err) => { throw err; });\n }\n getTransaction(txhash, callback) {\n return this.get(joinPath('wolk', 'tx', txhash), { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n transfer(recipient, amount, callback) {\n return this.post(joinPath('wolk', 'transfer'), {\n \"recipient\": recipient,\n \"amount\": amount\n }, {}, callback);\n }\n // NoSQL\n createBucket(owner, collection, options, callback) {\n var txBucket = NewTxBucket(collection, BucketCloudstore, options)\n return this.post(joinPath(owner, collection), JSON.stringify(txBucket), {}, callback);\n }\n createCollection(owner, collection, options, callback) {\n var txBucket = NewTxBucket(collection, BucketNoSQL, options)\n return this.post(joinPath(owner, collection), JSON.stringify(txBucket), {}, callback);\n }\n listCollections(owner, callback) {\n return this.get(owner, { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n listCollection(owner, collection, callback) {\n return this.get(joinPath(owner, collection), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n deleteCollection(owner, collection, callback) {\n return this.delete(joinPath(owner, collection), {}, callback);\n }\n scanCollection(owner, collection, hdrs, callback) {\n return this.get(joinPath(owner, collection), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n setKey(owner, collection, key, value, waitfortx, callback) {\n return this.put(joinPath(owner, collection, key), value, { \"WaitForTx\": waitfortx }, callback);\n }\n getKey(owner, collection, key, hdrs, callback) {\n //console.log(\"Getting key: owner \" + owner + \" | collection \" + collection + \" | key \" + key)\n return this.get(joinPath(owner, collection, key), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n\n getChunk( chunkId, options, callback) {\n return this.get(joinPath(ProtocolName, PayloadChunk, chunkId), { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n\n deleteKey(owner, collection, key, callback) {\n return this.delete(joinPath(owner, collection, key), {}, callback);\n }\n\n // SQL\n createDatabase(owner, database, options, callback) {\n return this.post(joinPath(owner, database), JSON.stringify({\n \"name\": database,\n \"bucketType\": BucketSQL,\n \"requesterPays\": 0,\n \"encryption\": \"none\"\n }), options, {}, callback);\n }\n listDatabases(owner, callback) {\n return this.get(joinPath(owner), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n deleteDatabase(owner, database, callback) {\n return this.delete(joinPath(owner, collection), {}, callback);\n }\n executeSQL(owner, database, sql, hdrs, callback) {\n return this.post(joinPath(owner, database, sql), sql, hdrs, callback);\n }\n\n // NOT EXPOSED\n async get(path, hdrs, callback) {\n return this.wrequest(\"GET\", path, null, hdrs, callback);\n }\n\n async post(path, body, hdrs, callback) {\n return this.wrequest(\"POST\", path, body, hdrs, callback);\n }\n\n async put(path, body, hdrs, callback) {\n return this.wrequest(\"PUT\", path, body, hdrs, callback);\n }\n\n async patch(path, body, hdrs, callback) {\n return this.wrequest(\"PATCH\", path, body, hdrs, callback);\n }\n\n async delete(path, hdrs, callback) {\n return this.wrequest(\"DELETE\", path, null, hdrs, callback);\n }\n\n sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n computeHash(b) {\n return(Buffer.from(this.toByteArray(sha256(Buffer.from(b)))));\n }\n\n toByteArray(hexString) {\n var result = [];\n while (hexString.length >= 2) {\n result.push(parseInt(hexString.substring(0, 2), 16));\n hexString = hexString.substring(2, hexString.length);\n }\n return result;\n }\n\n async waitForTx(txhash, callback) {\n let done = false;\n let calls = 0;\n while (!done) {\n this.getTransaction(txhash, function(err, body, verified) {\n if (err) {\n //console.log(\"err:\", err);\n } else {\n try {\n let tx = JSON.parse(body)\n if (tx.BlockNumber != undefined) {\n done = true;\n return callback(null, tx);\n }\n } catch (e) {\n\n }\n }\n })\n await this.sleep(500);\n if (calls++ > 15) {\n done = true;\n return callback(new Error('timeout, tx not included'), null);\n }\n }\n }\n\n async wrequest(method, path, body, hdrs, callback) {\n let that = this;\n if( typeof callback === 'function' ) {\n return this.wreq(method, path, body, hdrs, callback);\n } else {\n return new Promise((resolve, reject) => {\n return that.wreq(method, path, body, hdrs, function(err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n });\n }\n }\n\n async wreq(method, path, body, hdrs, callback) {\n let payloadBytes = method + \"/\" + path;\n if ( (method == \"POST\") || (method == \"PATCH\") ) {\n if (typeof body === \"object\") {\n body = JSON.stringify(body);\n }\n if ( body != null ) { payloadBytes += body; }\n }\n let payload = Buffer.from(payloadBytes).toString('utf8')\n let that = this\n\n var requestOptions = {\n method: method,\n url: this.provider + \"/\" + path,\n headers: {\n \"Requester\": this.ecdsaPublicKey,\n \"Msg\": payloadBytes\n },\n body: body,\n //json: true,\n resolveWithFullResponse: true\n }\n for (var hdr in hdrs) {\n requestOptions.headers[hdr] = hdrs[hdr];\n }\n var proof = ''\n var proofType = ''\n var signature\n\n if ( this.ecdsaKey != undefined ) {\n signature = await crypto.subtle.sign({ name: \"ECDSA\", hash: { name: \"SHA-256\" } }, this.ecdsaKey.privateKey, payload)\n .catch(function(err) { console.error(\"ERR: crypto.subtle.sign \" + err); });\n requestOptions.headers.Sig = buf2hex(signature);\n // console.log('payload')\n // console.log(payload)\n // console.log('raw sig')\n // console.log(signature)\n // console.log('sig buf2hex')\n // console.log(requestOptions.headers.Sig)\n } else {\n //console.warn(\"WARN: ecdsaKey is undefined\");\n }\n\n\t //console.log(\"RequestOption: \" + JSON.stringify(requestOptions));\n return rp(requestOptions)\n .then((response) => {\n //console.log(\"\\nprocessing response: \" + JSON.stringify(response))\n if (response.statusCode == \"200\") {\n //TODO: ERROR HANDLING?\n if (response.headers['proof'] != undefined && response.headers['proof-type'] != undefined) {\n //console.log(\"Response headers = \" + JSON.stringify(response.headers))\n proof = response.headers['proof']\n proofType = response.headers['proof-type']\n }\n return response.body\n } else {\n console.log(\"ERROR: StatusCode \", response.statusCode, JSON.stringify(response.status), JSON.stringify(response.statusText))\n // TODO: use response.status\n return callback(new WolkError(response.statusCode, response.body), null);\n }\n })\n .then(function(body) {\n //console.log(\"\\nprocessing body: \" + JSON.stringify(body))\n if ( requestOptions.headers.Proof != 1 ) {\n if( method == \"GET\" ) {\n //console.log(\"proof not requested for request\")\n }\n return callback(null, body);\n } else {\n console.log(\"Checking Proof\")\n if ( proof.length > 0 ) {\n //console.log(\"\\nPROOF: \" + JSON.stringify(proof))\n return verifyHeaders(path, hdrs, proof, proofType, body)\n .then( (verified) => {\n if (verified) {\n //console.log(\"body verified\")\n return callback(null, body);\n } else {\n //console.log(\"body NOTverified\")\n let statusCode = 412\n return callback(new WolkError(statusCode, \"unverified proof\"), body);\n }\n })\n let statusCode = 412\n .catch( (err) => { return callback(new WolkError(statusCode, \"unverified proof due to error : \" + err), null); })\n } else {\n //console.log(body)\n //console.log(\"ERROR: proof requested but not returned by wolk provider: \", that.provider)\n let statusCode = 412\n return callback(new WolkError(statusCode, \"proof requested but not returned by wolk provider: [\" + this.provider + \"]\"), null);\n }\n }\n })\n .catch(rperrors.StatusCodeError, function(reason) {\n var error = new WolkError(reason.statusCode, reason.error )\n return callback( error, null ) //+ \" reqopt: \" + JSON.stringify(requestOptions)))\n })\n .catch( (err) => {\n //console.log(err)\n let statusCode = 503\n return callback(new WolkError(statusCode, err), null);\n })\n //.catch( rperrors.RequestError, function(reason) { console.error(\"ERROR: 1RequestError \" + reason.cause); })\n }\n}\n\nfunction NewTxBucket(name, bucketType, options) {\n var txBucket = {\n name: name,\n bucketType: bucketType\n };\n if( options != undefined ) {\n txBucket.requesterPays = 0; //options.requesterPays\n //TODO: txBucket.writers = options.validWriters\n //TODO: txBucket.schemaURL = options.schema\n txBucket.encryption = \"none\"; //options.encryption\n txBucket.shimURL = options.shimURL\n }\n return txBucket\n}\n\nfunction p_writefile(path, data, encoding) {\n return new Promise(function(resolve, reject) {\n fs.writeFile(path, data, encoding, function(err) {\n if (err) { reject(err); }\n else { resolve(data); }\n });\n });\n}\n\nfunction buf2hex(buffer) { // buffer is an ArrayBuffer\n return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');\n}\n\nfunction joinPath (...args) {\n return args.map((part, i) => {\n if (i === 0) {\n return part.trim().replace(/[\\/]*$/g, '')\n } else {\n return part.trim().replace(/(^[\\/]*|[\\/]*$)/g, '')\n }\n }).filter(x => x.length).join('/')\n}\n\nfunction Computehash(b) {\n return crypto.subtle.digest({ name: \"SHA-256\" }, b)\n .catch( (err) => {\n console.error(\"[fs.js:ComputeHash] error calling crypto.subtle.digest => \" + err)\n })\n}\n\nfunction hexStringToByte(str) {\n if (!str) {\n return new Uint8Array();\n }\n if ((str[0] == \"0\") && (str[1] == \"x\")) {\n str = str.substr(2, str.length - 2);\n }\n var a = [];\n for (var i = 0, len = str.length; i < len; i += 2) {\n a.push(parseInt(str.substr(i, 2), 16));\n }\n return new Uint8Array(a);\n}\n\nfunction getBit(k, i) {\n let bitn = i % 8;\n let byten = 20 - 1 - (i >> 3);\n let res = ((1 << bitn) & k[byten]) > 0;\n return res;\n}\n\nfunction equalBytes(buf1, buf2) {\n if (buf1.byteLength != buf2.byteLength) return false;\n var dv1 = new Int8Array(buf1);\n var dv2 = new Int8Array(buf2);\n for (var i = 0; i != buf1.byteLength; i++) {\n if (dv1[i] != dv2[i]) return false;\n }\n return true;\n}\n\nfunction deserializeProof(sp) {\n let proofhashes = [];\n for (var i = 0; i < sp.Proof.length; i++) {\n proofhashes.push(hexStringToByte(sp.Proof[i]));\n }\n let p = {\n \"SMTTreeDepth\": 160,\n \"Key\": hexStringToByte(sp.Key),\n \"Proof\": proofhashes,\n \"ProofBits\": hexStringToByte(sp.ProofBits)\n }\n return (p);\n}\n\nasync function computeDefaultHashes(smtTreeDepth) {\n var defaultHashes = new Array();\n defaultHashes[0] = new Uint8Array(await Computehash(new Uint8Array(0)));\n for (var level = 1; level < smtTreeDepth; level++) {\n defaultHashes[level] = await Computehash(Uint8Array.of(...new Uint8Array(defaultHashes[level - 1]), ...new Uint8Array(defaultHashes[level - 1])));\n }\n return defaultHashes\n}\n\nasync function checkSMTProof(p, key, val, root, verbose) {\n var defaultHashes = await computeDefaultHashes(160)\n let cur = val;\n let ProofBits = p.ProofBits;\n let pi = 0; // indexes p.Proof\n var combinedHashes;\n for (var i = 0; i < p.SMTTreeDepth; i++) {\n if (getBit(ProofBits, i)) {\n var pb = p.Proof[pi];\n if (getBit(key, i)) {\n cur = await Computehash(Uint8Array.of(...pb, ...new Uint8Array(cur)));\n } else { // i-th bit is \"0\", so hash with H([]) on the right\n cur = await Computehash(Uint8Array.of(...new Uint8Array(cur), ...pb));\n }\n pi++;\n } else {\n if (getBit(key, i)) { // i-th bit is \"1\", so hash with H([]) on the left\n cur = await Computehash(Uint8Array.of(...new Uint8Array(defaultHashes[i]), ...new Uint8Array(cur)));\n } else {\n cur = await Computehash(Uint8Array.of(...new Uint8Array(cur), ...new Uint8Array(defaultHashes[i])));\n }\n }\n }\n let merkleRootComputed = buf2hex(cur);\n let merkleRootExpected = buf2hex(root);\n if (merkleRootComputed == merkleRootExpected) {\n if (verbose > 1) console.log(\"SUCCESS\", \"merkleRootComputed\", merkleRootComputed);\n // TODO: check that this merkleRoot is actually IN the block with GetBlock\n return true;\n }\n console.log(\"checkSMTProof FAIL-merkleRoot MISMATCH\", merkleRootComputed) // \"merkleRootExpected\", merkleRootExpected);\n return false;\n}\n\nfunction verifyHeaders(path, requestHeaders, proof, proofType, body) {\n //console.log(\"RequestHeaders: \" + JSON.stringify(requestHeaders) + \" PT: \" + proofType)\n if (requestHeaders.Proof != undefined) {\n switch (proofType) {\n case \"SMT\":\n let smtProof = JSON.parse(proof)\n return verifySMTProof(smtProof, 0);\n case \"NoSQLScan\":\n case \"NoSQL\":\n let nosqlProof = JSON.parse(proof)\n return verifyNoSQLProof(proofType, nosqlProof, path, 0, body, 0);\n }\n } else {\n // console.log(\"requested proof, but no proof in response\");\n return true;\n }\n return false;\n}\n\nasync function verifySMTProof(proofObject, verbose) {\n let proof = deserializeProof(proofObject.Proof);\n return await checkSMTProof(proof,\n hexStringToByte(proofObject.KeyHash),\n hexStringToByte(proofObject.TxHash),\n hexStringToByte(proofObject.MerkleRoot),\n verbose);\n}\n\nasync function verifyNoSQLProof(proofType, proofObject, path, contentLen, body, verbose) {\n let wolkUrlObject = parseWolkPath(path)\n if (proofObject.Collection != wolkUrlObject.collection) {\n console.log(\"Collection Mismatch\", proofObject.Collection, wolkUrlObject.collection)\n return false;\n }\n let defaultHashes = await computeDefaultHashes(160);\n\n if (proofType == \"NoSQLScan\") {\n if ( proofObject.ScanProofs != undefined ) {\n console.log(\"NoSQLScan with ScanProofs\")\n for (var i = 0; i < proofObject.ScanProofs.length; i++) {\n let p = proofObject.ScanProofs[i];\n let prf = deserializeProof(p.KeyProof);\n if (proofObject.Collection.length == 0) {\n // TODO: add await\n let smtCheck = await checkSMTProof(prf, prf.Key, hexStringToByte(p.TxHash), hexStringToByte(proofObject.SystemMerkleRoot), defaultHashes, verbose)\n if (!smtCheck) {\n return false;\n }\n } else {\n let smtCheck = checkSMTProof(prf, prf.Key, hexStringToByte(p.TxHash), hexStringToByte(proofObject.CollectionMerkleRoot), defaultHashes, verbose)\n if (!smtCheck) {\n return false;\n }\n }\n }\n } else {\n if (proofObject.Collection.length == 0) { //listCollections\n if ( ! ( proofObject.SystemChunkHash === \"0x44a00e7ae0499c6e377b95709f3851843976ea6c2a86eff46adfe15608d22005\") ) {\n return false;\n }\n let prf = deserializeProof(proofObject.SystemProof)\n let smtCheck = checkSMTProof(prf, prf.Key, hexStringToByte(proofObject.SystemChunkHash), hexStringToByte(proofObject.KeyMerkleRoot), defaultHashes, verbose)\n if (!smtCheck) {\n return false;\n }\n console.log(\"NoSQLScan SUCCESS\", \"ch\", proofObject.SystemChunkHash, \"mr\", proofObject.KeyMerkleRoot)\n } else { //scanCollection\n if ( ! ( proofObject.CollectionChunkHash === \"0x44a00e7ae0499c6e377b95709f3851843976ea6c2a86eff46adfe15608d22005\" ) ) {\n return false;\n }\n }\n }\n console.log(\"NoSQLScan Proof Verified\")\n return true;\n }\n\n if (proofObject.Key != wolkUrlObject.path) {\n console.log(proofObject)\n console.log(\"Key Mismatch: [\", proofObject.Key, \"] key: [\", wolkUrlObject.path, \"]\")\n return false;\n }\n\n // Verify Proof Process: at proof.Key position (which is keyToAddress(Key) where key is supplied by user)\n // there is proof.TxHash, which hashes up to proof.CollectionMerkleRoot\n //console.log(\"proofObject.KeyProof: \" + JSON.stringify(proofObject) )\n let keyProof = deserializeProof(proofObject.KeyProof);\n let keyHash = await keyToAddress(wolkUrlObject.path);\n if (!equalBytes(keyHash, keyProof.Key)) {\n console.log(\"Key Mismatch\", keyProof.Key, \"keyHash\", keyHash, \"path\", wolkUrlObject.path);\n return false;\n }\n\n // position: keyhash, txhash = value hashes up to merkleroot\n let proof_txHash = hexStringToByte(proofObject.TxHash);\n let proof_collectionMerkleRoot = hexStringToByte(proofObject.CollectionMerkleRoot);\n let keyProofCheck = await checkSMTProof(keyProof, keyHash, proof_txHash, proof_collectionMerkleRoot, defaultHashes, verbose)\n if (!keyProofCheck) {\n console.log(\"KeyProof Verification FAILED\");\n return false;\n }\n console.log(\"KeyProofCheck: \", keyProofCheck);\n if (proofObject.Tx == undefined) {\n console.log(\"Tx not supplied\")\n return false;\n }\n\n // check that txhash matches provided tx ... TODO: check that pr.TxHash matches the Tx returned ***in RLP encoded form***\n let txhash = hexStringToByte(proofObject.Tx.txhash);\n let owner = wolkUrlObject.owner;\n let txsigner = hexStringToByte(proofObject.Tx.signer);\n /*\n if (!equalBytes(txhash, proof_txHash)) {\n console.log(\"Tx mismatch\", txhash, proof_txHash);\n return false;\n }\n let txAmount = proofObject.Tx.amount;\n let contentLength = contentLen;\n if (contentLength != txAmount) {\n console.log(\"Header:Content-Length Does not Match Tx.Amount\", \"Header:Content-Length\", contentLength, \"Tx.Amount\", txAmount);\n return false;\n }\n // TODO: check that TxSigner is valid, matches owner\n if (!equalBytes(txsigner, owner)) {\n // TODO: check against writers list?\n console.log(\"Signer mismatch\");\n return false\n }\n if (!verifyContentHash(proofObject.Tx.GenericHash, body)) {\n console.log(\"ContentHash Mismatch\");\n return false;\n }\n */\n\n // Verify Proof Process: at proof.Key position (which is proof.CollectionHash=CollectionHash(owner, collection))\n // there is proof.CollectionChunkHash, which hashes up to proof.KeyMerkleRoot\n let collectionProof = deserializeProof(proofObject.CollectionProof);\n let collHash = await collectionHash(owner, wolkUrlObject.collection)\n if (!equalBytes(collectionProof.Key, collHash)) {\n console.log(\"Collection Mismatch\", collectionProof.Key, \"collHash\", collHash);\n return false;\n }\n\n let proof_collectionChunkHash = hexStringToByte(proofObject.CollectionChunkHash);\n let proof_keyMerkleRoot = hexStringToByte(proofObject.KeyMerkleRoot);\n let collectionCheck = await checkSMTProof(collectionProof, collHash, proof_collectionChunkHash, proof_keyMerkleRoot, defaultHashes, verbose)\n if ( ! collectionCheck ) {\n console.log(\"CollectionProof Verification FAILED\", collectionProof);\n return false;\n }\n console.log(\"CollectionProof Verified\");\n\n // Verify proof process: at proof.Key position (which is proof.SystemHash=CollectionHash(owner, SystemCollection))\n // there is the value proof.SystemChunkHash, which hashes up to proof.KeyMerkleRoot\n let systemProof = deserializeProof(proofObject.SystemProof)\n let systemHash = await keyToAddress(owner)\n if (!equalBytes(systemProof.Key, systemHash)) {\n console.log(\"System Mismatch\")\n return false;\n }\n let proof_systemChunkHash = hexStringToByte(proofObject.SystemChunkHash);\n //let proof_keyMerkleRoot = hexStringToByte(proofObject.KeyMerkleRoot);\n let ownerCheck = await checkSMTProof(systemProof, systemHash, proof_systemChunkHash, proof_keyMerkleRoot, defaultHashes, verbose)\n if ( ! ownerCheck ) {\n console.log(\"SystemProof FAILED\")\n return false;\n }\n console.log(\"SystemProof Verified\");\n return true;\n}\n\nasync function keyToAddress(k) {\n return new Uint8Array(await Computehash(unicodeStringToTypedArray(k))).subarray(0, 20);\n}\n\nfunction unicodeStringToTypedArray(s) {\n var escstr = encodeURIComponent(s);\n var binstr = escstr.replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode('0x' + p1);\n });\n var ua = new Uint8Array(binstr.length);\n Array.prototype.forEach.call(binstr, function(ch, i) {\n ua[i] = ch.charCodeAt(0);\n });\n return ua;\n}\n\nasync function collectionHash(owner, collection) {\n let x = await Computehash(Uint8Array.of(...unicodeStringToTypedArray(owner), ...unicodeStringToTypedArray(collection)));\n return new Uint8Array(x.slice(0, 20))\n}\n\n// GenerateRandomKey generates a random key of length l\nfunction GenerateRandomKey(length) {\n /*TODO:\n\tkey := make([]byte, l)\n\tvar total int\n\tfor total < l {\n\t\tread, _ := rand.Read(key[total:])\n\t\ttotal += read\n\t}\n\treturn key\n */\n}\n\nfunction parseWolkPath(wolkPath) {\n let urlParts = wolkPath.split(\"/\");\n var owner = \"\"\n var collection = \"\"\n var key = \"\"\n var wolkUrlObject = {\n owner: \"\",\n collection: \"\",\n path: \"\",\n };\n /* i.e. owner/collection/key -- NOTE: Different from parseWolkUrl */\n\n if (urlParts.length > 0) {\n wolkUrlObject.owner = urlParts.shift();\n }\n if (urlParts.length > 0) {\n wolkUrlObject.collection = urlParts.shift();\n }\n if (urlParts.length > 0) {\n wolkUrlObject.path = urlParts.join(\"/\")\n }\n return wolkUrlObject;\n}\n\nif (typeof window !== 'undefined' && typeof window.WOLK === 'undefined') {\n window.WOLK = WOLK;\n}\nmodule.exports = WOLK;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/wolkjs/lib/fs.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/wolkjs/lib/wolk.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/wolkjs/lib/wolk.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const idb = __webpack_require__(/*! idb */ \"./node_modules/idb/build/idb.js\");\nconst BucketCloudstore = 0\nconst BucketNoSQL = 1\nconst BucketSQL = 2\n\nconst DEFAULT_DEVELOPER_TRUST_LEVEL = 0 //0 = regular web behavior no proof checking | 1 = check ALL proofs | In between check that % of time\nconst DEFAULT_USER_TRUST_LEVEL = 0 //0 = regular web behavior no proof checking | 1 = check ALL proofs | In between check that % of time\n\nclass WOLK {\n\n constructor() {\n this.provider = \"https://cloud.wolk.com\"; //DEFAULT PROVIDER\n this.developerTrustLevel = DEFAULT_DEVELOPER_TRUST_LEVEL\n this.userTrustLevel = DEFAULT_USER_TRUST_LEVEL\n this.setWolkTrustLevel()\n }\n\n async init() {\n this.dbPromise = idb.openDb('names', 1, upgradeDB => {\n upgradeDB.createObjectStore('names', {\n keyPath: 'name'\n });\n });\n\n return await this.dbPromise.then( async db => {\n return await this.loadAccounts();\n })\n .catch(err => {\n console.log(\"WOLK: loadAccount error: \" + err)\n throw new Error(\"Error loading accounts: \" + err)\n });\n }\n\n setProvider(provider) {\n this.provider = provider;\n }\n\n setDeveloperTrustLevel( level ) {\n this.developerTrustLevel = level\n }\n\n setUserTrustLevel( level ) {\n this.userTrustLevel = level\n }\n\n setWolkTrustLevel() {\n if( this.userTrustLevel > this.developerTrustLevel ) {\n this.wolkTrustLevel = this.userTrustLevel\n } else {\n this.wolkTrustLevel = this.developerTrustLevel\n }\n }\n\n determineProofValue() {\n let randProof = Math.random();\n if ( randProof <= this.wolkTrustLevel ) {\n return 1\n } else {\n return 0\n }\n }\n\n loadAccounts(callback) {\n var that = this\n var keyRangeValue = null;\n return this.dbPromise\n .then( db => {\n return db.transaction(['names'], 'readonly').objectStore('names').getAll();\n })\n .then( accounts => {\n //console.log(\"WOLK: retrieved names: \" + accounts + \" json: \" + JSON.stringify(accounts));\n if (accounts.length > 0) {\n let account = accounts[accounts.length - 1]\n console.log(\"WOLK: last Account\", account)\n var accountEcdsaPrivateKey = account.ecdsaPrivateKey\n if ( typeof account.ecdsaPrivateKey == 'object' ) {\n } else {\n accountEcdsaPrivateKey = JSON.parse(account.ecdsaPrivateKey)\n }\n return window.crypto.subtle.importKey(\n \"jwk\",\n accountEcdsaPrivateKey, {\n name: \"ECDSA\",\n namedCurve: \"P-256\",\n },\n false,\n [\"sign\"])\n .then(function(ecdsaKey) {\n that.ecdsaKey = {}\n that.ecdsaKey.privateKey = ecdsaKey;\n that.ecdsaPublicKey = account.ecdsaPublicKey\n console.log(\"WOLK: loadAccounts\", ecdsaKey)\n var accountRsaPrivateKey = account.rsaPrivateKey\n if ( typeof account.rsaPrivateKey == 'object' ) {\n } else {\n accountRsaPrivateKey = JSON.parse(account.rsaPrivateKey)\n }\n return window.crypto.subtle.importKey(\n \"jwk\",\n accountRsaPrivateKey, {\n name: \"RSASSA-PKCS1-v1_5\",\n hash: { name: \"SHA-256\" },\n },\n false,\n [\"sign\"]\n )\n .then(function(rsaKey) {\n that.rsaKey = rsaKey;\n console.log(\"Loaded\")\n return\n })\n .catch(function(err) {\n console.error(err)\n });\n })\n .catch(function(err) {\n console.error(err)\n });\n }\n console.log('# of Accounts', accounts.length);\n })\n .catch( err => {\n console.log(err)\n })\n }\n\n async createAccount(name, callback) {\n let that = this\n name = name.toLowerCase();\n console.log(\"createAccount\", name)\n // generate + export RSA Key\n await window.crypto.subtle.generateKey({\n name: \"RSASSA-PKCS1-v1_5\",\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: {\n name: \"SHA-256\"\n }\n }, true, [\"sign\", \"verify\"])\n .then((rsaKey) => {\n var account = {}\n return window.crypto.subtle.exportKey(\"jwk\", rsaKey.privateKey)\n .then(function(rsaPrivateKey) {\n account.rsaPrivateKey = rsaPrivateKey\n return window.crypto.subtle.exportKey(\"jwk\", rsaKey.publicKey);\n })\n .then(function(rsaPublicKey) {\n account.rsaPrivateKey = rsaPublicKey\n return window.crypto.subtle.generateKey({ name: \"ECDSA\", namedCurve: \"P-256\"}, true, [\"sign\", \"verify\"])\n })\n .then(function(ecdsaKey) {\n return window.crypto.subtle.exportKey(\"jwk\", ecdsaKey.privateKey)\n .then(function(ecdsaPrivateKey) {\n account.ecdsaPrivateKey = ecdsaPrivateKey\n return window.crypto.subtle.exportKey(\"jwk\", ecdsaKey.publicKey)\n })\n .then(function(ecdsaPublicKey) {\n account.ecdsaPublicKey = ecdsaPublicKey\n account.name = name\n console.log(account);\n return that.dbPromise\n .then( db => {\n return db.transaction(['names'], 'readwrite').objectStore('names').put(account);\n })\n .then( () => {\n that.ecdsaPublicKey = JSON.stringify(account.ecdsaPublicKey)\n that.ecdsaPrivateKey = account.ecdsaPrivateKey\n that.ecdsaKey = ecdsaKey\n return that.setName(name, JSON.stringify(account.rsaPublicKey), callback)\n })\n .catch( err => {\n account = {}\n console.error(\"ERROR sending name: \" + err)\n })\n })\n .catch( err => {\n account = {}\n console.error(\"ERROR setting up keys: \" + err)\n })\n })\n .catch( err => {\n account = {}\n console.err(\"ERROR parsing ecdsaKey: \" + err)\n });\n })\n .catch( err => {\n account = {}\n console.err(\"ERROR generating account: \" + err)\n });\n }\n\n setName(name, rsaPublicKey, callback) {\n return this.post(name, {\n \"name\": name,\n \"rsaPublicKey\": btoa(rsaPublicKey)\n }, {}, callback);\n }\n\n // Blockchain operations\n getBlock(blockNumber, callback) {\n return this.get(joinPath('wolk', 'block', blockNumber.toString(10)), {}, callback)\n .catch( (err) => { throw err; });\n }\n getNode(nodeNumber, callback) {\n return this.get(joinPath('wolk', 'node', nodeNumber.toString(10)), {}, callback)\n .catch( (err) => { throw err; });\n }\n updateNode(nodeNumber, nodeInfo, callback) {\n return this.patch(joinPath('wolk', 'node', nodeNumber.toString(10)), nodeInfo, {}, callback)\n .catch( (err) => { throw err; });\n }\n getPeers(nodeNumber, callback) {\n return this.get(joinPath('wolk', 'info'), {}, callback)\n .catch( (err) => { throw err; });\n }\n getName(name, callback) {\n return this.get(joinPath('wolk', 'name', name), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n getAccount(name, callback) {\n return this.get(joinPath('wolk', 'account', name), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n getLatestBlockNumber(callback) {\n return this.get(joinPath('wolk', 'block', 'latest'), {}, callback)\n .catch( (err) => { throw err; });\n }\n getTransaction(txhash, callback) {\n return this.get(joinPath('wolk', 'tx', txhash), {}, callback)\n .catch( (err) => { throw err; });\n }\n transfer(recipient, amount, callback) {\n return this.post(joinPath('wolk', 'transfer'), {\n \"recipient\": recipient,\n \"amount\": amount\n }, {}, callback);\n }\n // NoSQL\n createCollection(owner, collection, callback) {\n return this.post(joinPath(owner, collection), JSON.stringify({\n \"name\": collection,\n \"bucketType\": BucketNoSQL,\n \"requesterPays\": 0,\n \"encryption\": \"none\"\n }), {}, callback);\n }\n listCollections(owner, callback) {\n return this.get(owner, { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n listCollection(owner, collection, callback) {\n return this.get(joinPath(owner, collection), {\n \"Proof\": this.determineProofValue()\n }, callback);\n }\n deleteCollection(owner, collection, callback) {\n return this.delete(joinPath(owner, collection), {}, callback);\n }\n scanCollection(owner, collection, hdrs, callback) {\n return this.get(joinPath(owner, collection), { \"Proof\": this.determineProofValue() }, callback)\n .catch( (err) => { throw err; });\n }\n setKey(owner, collection, key, value, callback) {\n return this.put(joinPath(owner, collection, key), value, {}, callback);\n }\n getKey(owner, collection, key, hdrs, callback) {\n return this.get(joinPath(owner, collection, key), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n deleteKey(owner, collection, key, callback) {\n return this.delete(joinPath(owner, collection, key), {}, callback);\n }\n\n // SQL\n createDatabase(owner, database, options, callback) {\n return this.post(joinPath(owner, database), JSON.stringify({\n \"name\": database,\n \"bucketType\": BucketSQL,\n \"requesterPays\": 0,\n \"encryption\": \"none\"\n }), options, {}, callback);\n }\n listDatabases(owner, callback) {\n return this.get(joinPath(owner), {\n \"Proof\": this.determineProofValue()\n }, callback)\n .catch( (err) => { throw err; });\n }\n deleteDatabase(owner, database, callback) {\n return this.delete(joinPath(owner, collection), {}, callback);\n }\n executeSQL(owner, database, sql, hdrs, callback) {\n return this.post(joinPath(owner, database, sql), sql, hdrs, callback);\n }\n\n // NOT EXPOSED\n async get(path, hdrs, callback) {\n return this.wrequest(\"GET\", path, null, hdrs, callback);\n }\n\n async post(path, body, hdrs, callback) {\n return this.wrequest(\"POST\", path, body, hdrs, callback);\n }\n\n async put(path, body, hdrs, callback) {\n return this.wrequest(\"PUT\", path, body, hdrs, callback);\n }\n\n async patch(path, body, hdrs, callback) {\n return this.wrequest(\"PATCH\", path, body, hdrs, callback);\n }\n\n async delete(path, hdrs, callback) {\n return this.wrequest(\"DELETE\", path, null, hdrs, callback);\n }\n\n sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n async waitForTx(txhash, callback) {\n let done = false;\n let calls = 0;\n while (!done) {\n this.getTransaction(txhash, function(err, body, verified) {\n if (err) {\n //console.log(\"err:\", err);\n } else {\n try {\n let tx = JSON.parse(body)\n if (tx.BlockNumber != undefined) {\n done = true;\n return callback(null, tx);\n }\n } catch (e) {\n\n }\n }\n })\n await this.sleep(500);\n if (calls++ > 15) {\n done = true;\n return callback(new Error('timeout, tx not included'), null);\n }\n }\n }\n async wrequest(method, path, body, hdrs, callback) {\n let enc = new TextEncoder(\"utf-8\")\n let payloadBytes = method + \"/\" + path;\n if ( (method == \"POST\") || (method == \"PATCH\") ) {\n if (typeof body === \"object\") {\n body = JSON.stringify(body);\n }\n if ( body != null ) {\n payloadBytes += body;\n }\n }\n let payload = enc.encode(payloadBytes);\n let that = this\n\n var requestOptions = {\n method: method,\n headers: {\n \"Requester\": that.ecdsaPublicKey,\n \"Msg\": payloadBytes\n },\n body: body\n }\n\n if( typeof callback === 'function' ) {\n window.crypto.subtle.sign({ name: \"ECDSA\", hash: { name: \"SHA-256\" } }, this.ecdsaKey.privateKey, payload)\n .then(function(signature) {\n requestOptions.headers.Sig = buf2hex(signature);\n var url = that.provider + \"/\" + path\n fetch(url, requestOptions)\n .then(function(response) {\n if (response.ok) {\n return response.text()\n } else {\n console.log(\"ERROR:\", response.status, response.statusText)\n // TODO: use response.status\n return callback(new Error(response.text()), null, false);\n }\n })\n .then(function(body) {\n let verified = true; // TODO: verifyHeaders(wolkUrlObject, hdrs, result.headers, body)\n return callback(null, body, verified);\n })\n .catch(function(err) {\n console.log(err)\n callback(err, null, false)\n })\n })\n .catch(function(err) {\n console.error(err);\n callback(err, null, false)\n });\n } else {\n console.log(\"WOLK: Promise route\")\n return window.crypto.subtle.sign({ name: \"ECDSA\", hash: { name: \"SHA-256\" } }, this.ecdsaKey.privateKey, payload)\n .then(function(signature) {\n requestOptions.headers.Sig = buf2hex(signature);\n var url = that.provider + \"/\" + path\n return fetch(url, requestOptions)\n .then(function(response) {\n if (response.ok) {\n return response.text()\n } else {\n console.log(\"ERROR:\", response.status, response.statusText)\n // TODO: use response.status\n throw new Error(response);\n //return response\n }\n })\n .then(function(body) {\n let verified = true; // TODO: verifyHeaders(wolkUrlObject, hdrs, result.headers, body)\n return body;\n })\n .catch(function(err) {\n console.log(err)\n throw err;\n // callback(err, null, false)\n })\n })\n .catch(function(err) {\n console.error(err);\n throw err;\n });\n }\n }\n}\n\nfunction buf2hex(buffer) { // buffer is an ArrayBuffer\n return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');\n}\n\njoinPath = (...args) => {\n return args.map((part, i) => {\n if (i === 0) {\n return part.trim().replace(/[\\/]*$/g, '')\n } else {\n return part.trim().replace(/(^[\\/]*|[\\/]*$)/g, '')\n }\n }).filter(x => x.length).join('/')\n}\n\nfunction sum(a, b) {\n return a + b;\n}\n\nif (typeof window !== 'undefined' && typeof window.WOLK === 'undefined') {\n window.WOLK = WOLK;\n}\n\nmodule.exports = WOLK;\n\n\n//# sourceURL=webpack:///./node_modules/wolkjs/lib/wolk.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/wolkjs/lib/wolkerror.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/wolkjs/lib/wolkerror.js ***!
|
||
\**********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("class WolkError extends Error {\n //throw new WolkError('400','KeyNotFound')\n constructor(statusCode='200', ...params) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(...params);\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, WolkError);\n }\n\n this.statusCode = statusCode;\n // Custom debugging information\n this.date = new Date();\n }\n}\n\nmodule.exports = WolkError;\n/*\ntry {\n throw new WolkError(404, 'Key Not Found');\n} catch(e){\n console.log(e.statusCode); 404\n console.log(e.date); //date()\n console.log(e.message); //Key Not Found\n console.log(e.stack); //stacktrace\n}\n*/\n\n\n//# sourceURL=webpack:///./node_modules/wolkjs/lib/wolkerror.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/wrappy/wrappy.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/wrappy/wrappy.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/wrappy/wrappy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/xtend/immutable.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/xtend/immutable.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n\n\n//# sourceURL=webpack:///./node_modules/xtend/immutable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-array/src/Array.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/y-array/src/Array.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global Y */\n\n\nfunction extend (Y) {\n class YArray extends Y.utils.CustomType {\n constructor (os, _model, _content) {\n super()\n this.os = os\n this._model = _model\n // Array of all the neccessary content\n this._content = _content\n\n // the parent of this type\n this._parent = null\n this._deepEventHandler = new Y.utils.EventListenerHandler()\n\n // this._debugEvents = [] // TODO: remove!!\n this.eventHandler = new Y.utils.EventHandler((op) => {\n // this._debugEvents.push(JSON.parse(JSON.stringify(op)))\n if (op.struct === 'Insert') {\n // when using indexeddb db adapter, the op could already exist (see y-js/y-indexeddb#2)\n if (this._content.some(function (c) { return Y.utils.compareIds(c.id, op.id) })) {\n // op exists\n return\n }\n let pos\n // we check op.left only!,\n // because op.right might not be defined when this is called\n if (op.left === null) {\n pos = 0\n } else {\n pos = 1 + this._content.findIndex(function (c) {\n return Y.utils.compareIds(c.id, op.left)\n })\n if (pos <= 0) {\n throw new Error('Unexpected operation!')\n }\n }\n /* (see above for new approach)\n var _e = this._content[pos]\n // when using indexeddb db adapter, the op could already exist (see y-js/y-indexeddb#2)\n // If the algorithm works correctly, the double should always exist on the correct position (pos - the computed destination)\n if (_e != null && Y.utils.compareIds(_e.id, op.id)) {\n // is already defined\n return\n }*/\n var values\n var length\n if (op.hasOwnProperty('opContent')) {\n this._content.splice(pos, 0, {\n id: op.id,\n type: op.opContent\n })\n length = 1\n let type = this.os.getType(op.opContent)\n type._parent = this._model\n values = [type]\n } else {\n var contents = op.content.map(function (c, i) {\n return {\n id: [op.id[0], op.id[1] + i],\n val: c\n }\n })\n // insert value in _content\n // It is not possible to insert more than ~2^16 elements in an Array (see #5). We handle this case explicitly\n if (contents.length < 30000) {\n this._content.splice.apply(this._content, [pos, 0].concat(contents))\n } else {\n this._content = this._content.slice(0, pos).concat(contents).concat(this._content.slice(pos))\n }\n values = op.content\n length = op.content.length\n }\n Y.utils.bubbleEvent(this, {\n type: 'insert',\n object: this,\n index: pos,\n values: values,\n length: length\n })\n } else if (op.struct === 'Delete') {\n var i = 0 // current position in _content\n for (; i < this._content.length && op.length > 0; i++) {\n var c = this._content[i]\n if (Y.utils.inDeletionRange(op, c.id)) {\n // is in deletion range!\n var delLength\n // check how many character to delete in one flush\n for (delLength = 1;\n delLength < op.length && i + delLength < this._content.length && Y.utils.inDeletionRange(op, this._content[i + delLength].id);\n delLength++) {}\n // last operation that will be deleted\n c = this._content[i + delLength - 1]\n // update delete operation\n op.length -= c.id[1] - op.target[1] + 1\n op.target = [c.id[0], c.id[1] + 1]\n // apply deletion & find send event\n let content = this._content.splice(i, delLength)\n let values = content.map((c) => {\n if (c.val != null) {\n return c.val\n } else {\n return this.os.getType(c.type)\n }\n })\n Y.utils.bubbleEvent(this, {\n type: 'delete',\n object: this,\n index: i,\n values: values,\n _content: content,\n length: delLength\n })\n // with the fresh delete op, we can continue\n // note: we don't have to increment i, because the i-th content was deleted\n // but on the other had, the (i+delLength)-th was not in deletion range\n // So we don't do i--\n }\n }\n } else {\n throw new Error('Unexpected struct!')\n }\n })\n }\n _getPathToChild (childId) {\n return this._content.findIndex(c =>\n c.type != null && Y.utils.compareIds(c.type, childId)\n )\n }\n _destroy () {\n this.eventHandler.destroy()\n this.eventHandler = null\n this._content = null\n this._model = null\n this._parent = null\n this.os = null\n }\n get length () {\n return this._content.length\n }\n get (pos) {\n if (pos == null || typeof pos !== 'number') {\n throw new Error('pos must be a number!')\n }\n if (pos >= this._content.length) {\n return undefined\n }\n if (this._content[pos].type == null) {\n return this._content[pos].val\n } else {\n return this.os.getType(this._content[pos].type)\n }\n }\n toArray () {\n return this._content.map((x, i) => {\n if (x.type != null) {\n return this.os.getType(x.type)\n } else {\n return x.val\n }\n })\n }\n push (contents) {\n return this.insert(this._content.length, contents)\n }\n insert (pos, contents) {\n if (typeof pos !== 'number') {\n throw new Error('pos must be a number!')\n }\n if (!Array.isArray(contents)) {\n throw new Error('contents must be an Array of objects!')\n }\n if (contents.length === 0) {\n return\n }\n if (pos > this._content.length || pos < 0) {\n throw new Error('This position exceeds the range of the array!')\n }\n var mostLeft = pos === 0 ? null : this._content[pos - 1].id\n\n var ops = []\n var prevId = mostLeft\n for (var i = 0; i < contents.length;) {\n var op = {\n left: prevId,\n origin: prevId,\n // right: mostRight,\n // NOTE: I intentionally do not define right here, because it could be deleted\n // at the time of inserting this operation (when we get the transaction),\n // and would therefore not defined in this._content\n parent: this._model,\n struct: 'Insert'\n }\n var _content = []\n var typeDefinition\n while (i < contents.length) {\n var val = contents[i++]\n typeDefinition = Y.utils.isTypeDefinition(val)\n if (!typeDefinition) {\n _content.push(val)\n } else if (_content.length > 0) {\n i-- // come back again later\n break\n } else {\n break\n }\n }\n if (_content.length > 0) {\n // content is defined\n op.content = _content\n op.id = this.os.getNextOpId(_content.length)\n } else {\n // otherwise its a type\n var typeid = this.os.getNextOpId(1)\n this.os.createType(typeDefinition, typeid)\n op.opContent = typeid\n op.id = this.os.getNextOpId(1)\n }\n ops.push(op)\n prevId = op.id\n }\n var eventHandler = this.eventHandler\n this.os.requestTransaction(function *() {\n // now we can set the right reference.\n var mostRight\n if (mostLeft != null) {\n var ml = yield* this.getInsertionCleanEnd(mostLeft)\n mostRight = ml.right\n } else {\n mostRight = (yield* this.getOperation(ops[0].parent)).start\n }\n for (var j = 0; j < ops.length; j++) {\n var op = ops[j]\n op.right = mostRight\n }\n yield* eventHandler.awaitOps(this, this.applyCreatedOperations, [ops])\n })\n // always remember to do that after this.os.requestTransaction\n // (otherwise values might contain a undefined reference to type)\n eventHandler.awaitAndPrematurelyCall(ops)\n }\n delete (pos, length) {\n if (length == null) { length = 1 }\n if (typeof length !== 'number') {\n throw new Error('length must be a number!')\n }\n if (typeof pos !== 'number') {\n throw new Error('pos must be a number!')\n }\n if (pos + length > this._content.length || pos < 0 || length < 0) {\n throw new Error('The deletion range exceeds the range of the array!')\n }\n if (length === 0) {\n return\n }\n var eventHandler = this.eventHandler\n var dels = []\n for (var i = 0; i < length; i = i + delLength) {\n var targetId = this._content[pos + i].id\n var delLength\n // how many insertions can we delete in one deletion?\n for (delLength = 1; i + delLength < length; delLength++) {\n if (!Y.utils.compareIds(this._content[pos + i + delLength].id, [targetId[0], targetId[1] + delLength])) {\n break\n }\n }\n dels.push({\n target: targetId,\n struct: 'Delete',\n length: delLength\n })\n }\n this.os.requestTransaction(function *() {\n yield* eventHandler.awaitOps(this, this.applyCreatedOperations, [dels])\n })\n // always remember to do that after this.os.requestTransaction\n // (otherwise values might contain a undefined reference to type)\n eventHandler.awaitAndPrematurelyCall(dels)\n }\n observe (f) {\n this.eventHandler.addEventListener(f)\n }\n observeDeep (f) {\n this._deepEventHandler.addEventListener(f)\n }\n unobserve (f) {\n this.eventHandler.removeEventListener(f)\n }\n unobserveDeep (f) {\n this._deepEventHandler.removeEventListener(f)\n }\n * _changed (transaction, op) {\n if (!op.deleted) {\n if (op.struct === 'Insert') {\n // update left\n var l = op.left\n var left\n while (l != null) {\n left = yield* transaction.getInsertion(l)\n if (!left.deleted) {\n break\n }\n l = left.left\n }\n op.left = l\n // if op contains opContent, initialize it\n if (op.opContent != null) {\n yield* transaction.store.initType.call(transaction, op.opContent)\n }\n }\n this.eventHandler.receivedOp(op)\n }\n }\n }\n\n Y.extend('Array', new Y.utils.CustomTypeDefinition({\n name: 'Array',\n class: YArray,\n struct: 'List',\n initType: function * YArrayInitializer (os, model) {\n var _content = []\n var _types = []\n yield* Y.Struct.List.map.call(this, model, function (op) {\n if (op.hasOwnProperty('opContent')) {\n _content.push({\n id: op.id,\n type: op.opContent\n })\n _types.push(op.opContent)\n } else {\n op.content.forEach(function (c, i) {\n _content.push({\n id: [op.id[0], op.id[1] + i],\n val: op.content[i]\n })\n })\n }\n })\n for (var i = 0; i < _types.length; i++) {\n var type = yield* this.store.initType.call(this, _types[i])\n type._parent = model.id\n }\n return new YArray(os, model.id, _content)\n },\n createType: function YArrayCreateType (os, model) {\n return new YArray(os, model.id, [])\n }\n }))\n}\n\nmodule.exports = extend\nif (typeof Y !== 'undefined') {\n extend(Y)\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-array/src/Array.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-indexeddb/src/IndexedDB.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/y-indexeddb/src/IndexedDB.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global Y, IDBKeyRange, indexedDB, localStorage, IDBRequest, IDBOpenDBRequest, IDBCursor, IDBCursorWithValue, addEventListener */\n\n// Thx to @jed for this script https://gist.github.com/jed/982883\nfunction generateGuid(a){return a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,generateGuid)} // eslint-disable-line\n\nfunction extend (Y) {\n Y.requestModules(['memory']).then(function () {\n class Store {\n constructor (transaction, name) {\n this.store = transaction.objectStore(name)\n }\n * find (id) {\n return yield this.store.get(id)\n }\n * put (v) {\n yield this.store.put(v)\n }\n * delete (id) {\n yield this.store.delete(id)\n }\n * findWithLowerBound (start) {\n return yield this.store.openCursor(IDBKeyRange.lowerBound(start))\n }\n * findWithUpperBound (end) {\n return yield this.store.openCursor(IDBKeyRange.upperBound(end), 'prev')\n }\n * findNext (id) {\n return yield* this.findWithLowerBound([id[0], id[1] + 1])\n }\n * findPrev (id) {\n return yield* this.findWithUpperBound([id[0], id[1] - 1])\n }\n * iterate (t, start, end, gen) {\n var range = null\n if (start != null && end != null) {\n range = IDBKeyRange.bound(start, end)\n } else if (start != null) {\n range = IDBKeyRange.lowerBound(start)\n } else if (end != null) {\n range = IDBKeyRange.upperBound(end)\n }\n var cursorResult\n if (range != null) {\n cursorResult = this.store.openCursor(range)\n } else {\n cursorResult = this.store.openCursor()\n }\n while ((yield cursorResult) != null) {\n yield* gen.call(t, cursorResult.result.value)\n cursorResult.result.continue()\n }\n }\n * flush () {}\n }\n\n function createStoreClone (Store) {\n class Clone extends Store {\n constructor () {\n super(...arguments)\n this.buffer = []\n this._copyTo = null\n }\n // copy to this store\n // it may be neccessary to reset this every time you create a transaction\n copyTo (store) {\n this._copyTo = store\n return this\n }\n * put (v, dontCopy) {\n if (!dontCopy) {\n this.buffer.push(this._copyTo.put(v))\n }\n yield* super.put(v)\n }\n * delete (id) {\n this.buffer.push(this._copyTo.delete(id))\n yield* super.delete(id)\n }\n * flush () {\n yield* super.flush()\n for (var i = 0; i < this.buffer.length; i++) {\n yield* this.buffer[i]\n }\n yield* this._copyTo.flush()\n }\n }\n return Clone\n }\n Y.utils.createStoreClone = createStoreClone\n\n var BufferedStore = Y.utils.createSmallLookupBuffer(Store)\n // var ClonedStore = Y.utils.createStoreClone(Y.utils.RBTree)\n\n class Transaction extends Y.Transaction {\n constructor (store) {\n super(store)\n var transaction = store.db.transaction(['OperationStore', 'StateStore', 'DeleteStore'], 'readwrite')\n this.store = store\n this.ss = new BufferedStore(transaction, 'StateStore')\n this.os = new BufferedStore(transaction, 'OperationStore')\n // this._ds = new BufferedStore(transaction, 'DeleteStore')\n // this.ds = store.dsClone.copyTo(this._ds)\n this.ds = new BufferedStore(transaction, 'DeleteStore')\n }\n }\n class OperationStore extends Y.AbstractDatabase {\n constructor (y, options) {\n /**\n * There will be no garbage collection when using this connector!\n * There may be several instances that communicate via localstorage,\n * and we don't want too many instances to garbage collect.\n * Currently, operationAdded (see AbstractDatabase) does not communicate updates to the garbage collector.\n *\n * While this could work, it only decreases performance.\n * Operations are automatically garbage collected when the client syncs (the server still garbage collects, if there is any).\n * Another advantage is that now the indexeddb adapter works with y-webrtc (since no gc is in place).\n *\n */\n if (options.gc == null) {\n options.gc = false\n }\n super(y, options)\n // dsClone is persistent over transactions!\n // _ds is not\n // this.dsClone = new ClonedStore()\n if (options == null) {\n options = {}\n }\n this.options = options\n if (options.namespace == null) {\n if (y.options.connector.room == null) {\n throw new Error('IndexedDB: expect a string (options.namespace)! (you can also skip this step if your connector has a room property)')\n } else {\n options.namespace = y.options.connector.room\n }\n }\n if (options.idbVersion != null) {\n this.idbVersion = options.idbVersion\n } else {\n this.idbVersion = 5\n }\n var store = this\n // initialize database!\n this.requestTransaction(function * () {\n store.db = yield indexedDB.open(options.namespace, store.idbVersion)\n })\n if (options.cleanStart) {\n if (typeof localStorage !== 'undefined') {\n delete localStorage[JSON.stringify(['Yjs_indexeddb', options.namespace])]\n }\n this.requestTransaction(function * () {\n yield this.os.store.clear()\n yield this.ds.store.clear() // formerly only _ds\n yield this.ss.store.clear()\n })\n }\n this.whenUserIdSet(function (userid) {\n if (typeof localStorage !== 'undefined' && localStorage[JSON.stringify(['Yjs_indexeddb', options.namespace])] == null) {\n localStorage[JSON.stringify(['Yjs_indexeddb', options.namespace])] = JSON.stringify([userid, 0])\n }\n })\n this.requestTransaction(function * () {\n // this should be executed after the previous two defined transactions\n // after we computed the upgrade event (see `yield indexedDB.open(..)`), we can check if userid is still stored on localstorage\n var uid = null\n if (typeof localStorage !== 'undefined') {\n uid = localStorage[JSON.stringify(['Yjs_indexeddb', options.namespace])]\n }\n if (uid != null) {\n store.setUserId(uid)\n if (typeof localStorage !== 'undefined') {\n var nextuid = JSON.parse(uid)\n nextuid[1] = nextuid[1] + 1\n localStorage[JSON.stringify(['Yjs_indexeddb', options.namespace])] = JSON.stringify(nextuid)\n }\n } else {\n // wait for a 200ms before setting a random user id\n setTimeout(function () {\n if (store.userId == null) {\n // the user is probably offline, so that the connector can't get a user id\n store.setUserId(generateGuid()) // TODO: maybe it is best to always use a generated uid\n }\n }, 200)\n }\n // copy from persistent Store to non persistent StoreClone. (there could already be content in Store)\n /*\n yield* this._ds.iterate(this, null, null, function * (o) {\n yield* this.ds.put(o, true)\n })\n */\n })\n var operationsToAdd = []\n this.communicationObserver = function (op) {\n operationsToAdd.push(op)\n if (operationsToAdd.length === 1) {\n store.requestTransaction(function * () {\n var _toAdd = []\n /*\n There is a special case (see issue y-js/y-indexeddb#2) which we need to handle:\n Assume a user creates a new type (lets say an Array) and then inserts something in it. Assume both operations are in operationsToAdd.\n Since a type is initialized first, it already knows about the insertion, and we no longer need to call .operationAdded.\n If we don't handle this case the type inserts the same operation twice.\n => So wee need to filter out the operations whose parent is also inclduded in operationsToAdd!\n */\n for (var i = 0; i < operationsToAdd.length; i++) {\n var op = operationsToAdd[i]\n if (op.parent == null || operationsToAdd.every(function (p) {\n return !Y.utils.compareIds(p.id, op.parent)\n })) {\n _toAdd.push(op)\n }\n }\n operationsToAdd = []\n\n for (i = 0; i < _toAdd.length; i++) {\n yield* this.store.operationAdded(this, _toAdd[i], true)\n }\n })\n }\n }\n Y.utils.localCommunication.addObserver(this.options.namespace, this.communicationObserver)\n }\n * operationAdded (transaction, op, noAdd) {\n yield* super.operationAdded(transaction, op)\n if (!noAdd) {\n Y.utils.localCommunication.broadcast(this.options.namespace, op)\n }\n }\n transact (makeGen) {\n var transaction = this.db != null ? new Transaction(this) : null\n var store = this\n\n var gen = makeGen.call(transaction)\n handleTransactions(gen.next())\n\n function handleTransactions (result) {\n var request = result.value\n if (result.done) {\n makeGen = store.getNextRequest()\n if (makeGen != null) {\n if (transaction == null && store.db != null) {\n transaction = new Transaction(store)\n }\n gen = makeGen.call(transaction)\n handleTransactions(gen.next())\n } // else no transaction in progress!\n return\n }\n // console.log('new request', request.source != null ? request.source.name : null)\n if (request.constructor === IDBRequest) {\n request.onsuccess = function () {\n var res = request.result\n if (res != null && res.constructor === IDBCursorWithValue) {\n res = res.value\n }\n handleTransactions(gen.next(res))\n }\n request.onerror = function (err) {\n gen.throw(err)\n }\n } else if (request.constructor === IDBCursor) {\n request.onsuccess = function () {\n handleTransactions(gen.next(request.result != null ? request.result.value : null))\n }\n request.onerror = function (err) {\n gen.throw(err)\n }\n } else if (request.constructor === IDBOpenDBRequest) {\n request.onsuccess = function (event) {\n var db = event.target.result\n handleTransactions(gen.next(db))\n }\n request.onerror = function () {\n gen.throw(\"Couldn't open IndexedDB database!\")\n }\n request.onupgradeneeded = function (event) {\n var db = event.target.result\n if (typeof localStorage !== 'undefined') {\n delete localStorage[JSON.stringify(['Yjs_indexeddb', store.options.namespace])]\n }\n if (db.objectStoreNames.contains('OperationStore')) {\n // delete only if exists (we skip the remaining tests)\n db.deleteObjectStore('OperationStore')\n db.deleteObjectStore('DeleteStore')\n db.deleteObjectStore('StateStore')\n }\n db.createObjectStore('OperationStore', {keyPath: 'id'})\n db.createObjectStore('DeleteStore', {keyPath: 'id'})\n db.createObjectStore('StateStore', {keyPath: 'id'})\n }\n } else {\n gen.throw('You must not yield this type!')\n }\n }\n }\n // TODO: implement \"free\"..\n * destroy () {\n this.db.close()\n }\n deleteDB () {\n Y.utils.localCommunication.removeObserver(this.options.namespace, this.communicationObserver)\n indexedDB.deleteDatabase(this.options.namespace)\n return Promise.resolve()\n }\n }\n if (Y.utils.localCommunication == null) {\n // localCommunication uses localStorage to communicate with all tabs / windows\n // Using pure localStorage does not call the event listener on the tab the event is created on.\n // Using this implementation the event is also called on the tab the event is created on.\n Y.utils.localCommunication = {\n observer: {},\n addObserver: function (room, f) {\n var listener = this.observer[room]\n if (listener == null) {\n listener = []\n this.observer[room] = listener\n }\n listener.push(f)\n },\n removeObserver: function (room, f) {\n this.observer[room] = this.observer[room].filter(function (g) { return f !== g })\n },\n broadcast: function (room, m) {\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem(JSON.stringify(['__YJS__', room]), JSON.stringify(m))\n }\n this.observer[room].map(function (f) {\n f(m)\n })\n }\n }\n if (typeof localStorage !== 'undefined') {\n addEventListener('storage', function (event) {\n var room\n try {\n var parsed = JSON.parse(event.key)\n if (parsed[0] === '__YJS__') {\n room = parsed[1]\n } else {\n return\n }\n } catch (e) { return }\n var listener = Y.utils.localCommunication.observer[room]\n if (listener != null) {\n listener.map(function (f) {\n f(JSON.parse(event.newValue))\n })\n }\n })\n }\n }\n Y.extend('indexeddb', OperationStore)\n })\n}\n\nmodule.exports = extend\nif (typeof Y !== 'undefined') {\n extend(Y)\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-indexeddb/src/IndexedDB.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-ipfs-connector/node_modules/debug/src/browser.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/y-ipfs-connector/node_modules/debug/src/browser.js ***!
|
||
\*************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n// eslint-disable-next-line complexity\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n var _console;\n\n // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (namespaces) {\n exports.storage.setItem('debug', namespaces);\n } else {\n exports.storage.removeItem('debug');\n }\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.getItem('debug');\n } catch (error) {} // Swallow\n // XXX (@Qix-) should we be logging these?\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n\nfunction localstorage() {\n try {\n // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n // The Browser also has localStorage in the global context.\n return localStorage;\n } catch (error) {// Swallow\n // XXX (@Qix-) should we be logging these?\n }\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/y-ipfs-connector/node_modules/debug/src/common.js\")(exports);\nvar formatters = module.exports.formatters;\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + error.message;\n }\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/y-ipfs-connector/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-ipfs-connector/node_modules/debug/src/common.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/y-ipfs-connector/node_modules/debug/src/common.js ***!
|
||
\************************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\nfunction setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}\n\nmodule.exports = setup;\n\n\n\n//# sourceURL=webpack:///./node_modules/y-ipfs-connector/node_modules/debug/src/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-ipfs-connector/src/decode.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/y-ipfs-connector/src/decode.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\nmodule.exports = (data) => {\n const str = data.toString()\n\n let json\n\n try {\n json = JSON.parse(str)\n } catch (err) {\n console.error('Failed parsing', str)\n throw err\n }\n\n return json\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-ipfs-connector/src/decode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-ipfs-connector/src/encode.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/y-ipfs-connector/src/encode.js ***!
|
||
\*****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nmodule.exports = (message) => Buffer.from(JSON.stringify(message))\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/buffer/index.js */ \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/y-ipfs-connector/src/encode.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-ipfs-connector/src/index.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/y-ipfs-connector/src/index.js ***!
|
||
\****************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global Y */\n\n\nconst log = __webpack_require__(/*! debug */ \"./node_modules/y-ipfs-connector/node_modules/debug/src/browser.js\")('y-ipfs-connector')\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/node-libs-browser/node_modules/events/events.js\")\nconst Room = __webpack_require__(/*! ipfs-pubsub-room */ \"./node_modules/ipfs-pubsub-room/src/index.js\")\nconst Queue = __webpack_require__(/*! async/queue */ \"./node_modules/async/queue.js\")\nconst Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nconst encode = __webpack_require__(/*! ./encode */ \"./node_modules/y-ipfs-connector/src/encode.js\")\nconst decode = __webpack_require__(/*! ./decode */ \"./node_modules/y-ipfs-connector/src/decode.js\")\n\nfunction extend (Y) {\n class YIpfsConnector extends Y.AbstractConnector {\n constructor (y, options) {\n if (options === undefined) {\n throw new Error('Options must not be undefined!')\n }\n if (options.room == null) {\n throw new Error('You must define a room name!')\n }\n if (!options.ipfs) {\n throw new Error('You must define a started IPFS object inside options')\n }\n\n if (!options.role) { options.role = 'master' }\n\n super(y, options)\n\n this._yConnectorOptions = options\n\n this.ipfs = options.ipfs\n\n const topic = this.ipfsPubSubTopic = 'y-ipfs:rooms:' + options.room\n\n this.roomEmitter = options.roomEmitter || new EventEmitter()\n this.roomEmitter.peers = () => this._room.getPeers()\n this.roomEmitter.id = () => topic\n\n this._receiveQueue = Queue(this._processQueue.bind(this), 1)\n\n this._room = Room(this.ipfs, topic)\n this._room.setMaxListeners(Infinity)\n\n this._room.on('error', (err) => {\n console.error(err)\n })\n\n this._room.on('message', (msg) => {\n if (this.ipfs._peerInfo && msg.from === this.ipfs._peerInfo.id.toB58String()) {\n return\n }\n\n const processMessage = () => {\n let message\n if (this._yConnectorOptions.decode) {\n message = this._yConnectorOptions.decode(msg.data)\n } else {\n message = decode(msg.data)\n }\n\n const proceed = () => {\n const yMessage = decode(message.payload)\n this.roomEmitter.emit('received message', msg.from, yMessage)\n\n if (yMessage.type === null) {\n return\n }\n\n this._queueReceiveMessage(msg.from, yMessage)\n }\n\n if (options.verifySignature) {\n const sig = message.signature && Buffer.from(message.signature, 'base64')\n options.verifySignature.call(\n null,\n msg.from,\n Buffer.from(message.payload),\n sig,\n (err, valid) => {\n if (err) {\n console.error(\n 'Error verifying signature from peer ' + msg.from +\n '. Discarding message.', err)\n return\n }\n\n if (!valid) {\n console.error(\n 'Invalid signature from peer ' + msg.from +\n '. Discarding message.')\n return\n }\n proceed()\n }\n )\n } else {\n proceed()\n }\n }\n\n if (!this._room.hasPeer(msg.from)) {\n const joinedListener = (peer) => {\n if (peer === msg.from) {\n this._room.removeListener('peer joined', joinedListener)\n processMessage()\n }\n }\n this._room.on('peer joined', joinedListener)\n } else {\n processMessage()\n }\n })\n\n this._room.on('peer joined', (peer) => {\n this.roomEmitter.emit('peer joined', peer)\n this.userJoined(peer, 'master')\n })\n\n this._room.on('peer left', (peer) => {\n this.roomEmitter.emit('peer left', peer)\n this.userLeft(peer)\n })\n\n if (this.ipfs.isOnline()) {\n this._start()\n } else {\n this.ipfs.once('ready', this._start.bind(this))\n }\n }\n\n _queueReceiveMessage (from, message) {\n this._receiveQueue.push({\n from: from,\n message: message\n })\n }\n\n _processQueue (item, callback) {\n const from = item.from\n const message = item.message\n\n if (from === this._ipfsUserId) {\n // ignore message from self\n callback()\n } else if (this._room.hasPeer(from)) {\n this.receiveMessage(from, message)\n callback()\n } else {\n this._receiveQueue.unshift(item)\n setTimeout(callback, 500)\n }\n }\n\n _start () {\n const id = this.ipfs._peerInfo.id.toB58String()\n this._ipfsUserId = id\n this.setUserId(id)\n }\n\n disconnect () {\n log('disconnect')\n this._room.leave()\n super.disconnect()\n }\n send (peer, message) {\n this._encodeMessage(message, (err, encodedMessage) => {\n if (err) {\n throw err\n }\n if (this._yConnectorOptions.encode) {\n encodedMessage = this._yConnectorOptions.encode(encodedMessage)\n }\n this._room.sendTo(peer, encodedMessage)\n this.roomEmitter.emit('sent message', peer, message)\n })\n }\n broadcast (message) {\n this._encodeMessage(message, (err, encodedMessage) => {\n if (err) {\n throw err\n }\n if (this._yConnectorOptions.encode) {\n encodedMessage = this._yConnectorOptions.encode(encodedMessage)\n }\n this._room.broadcast(encodedMessage)\n this.roomEmitter.emit('sent message', 'broadcast', message)\n })\n }\n isDisconnected () {\n return false\n }\n\n _encodeMessage (_message, callback) {\n const message = localEncode(_message)\n if (this._yConnectorOptions.sign) {\n this._yConnectorOptions.sign(Buffer.from(message), (err, signature) => {\n if (err) {\n return callback(err)\n }\n\n const sig = signature.toString('base64')\n\n callback(null, encode({\n signature: sig,\n payload: message\n }))\n })\n } else {\n callback(null, encode({\n payload: message\n }))\n }\n }\n }\n Y.extend('ipfs', YIpfsConnector)\n}\n\nmodule.exports = extend\nif (typeof Y !== 'undefined') {\n extend(Y)\n}\n\nfunction localEncode (m) {\n return JSON.stringify(m)\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-ipfs-connector/src/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-map/src/Map.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/y-map/src/Map.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global Y */\n\n\nfunction extend (Y /* :any */) {\n class YMap extends Y.utils.CustomType {\n /* ::\n _model: Id;\n os: Y.AbstractDatabase;\n map: Object;\n contents: any;\n opContents: Object;\n eventHandler: Function;\n */\n constructor (os, model, contents, opContents) {\n super()\n this._model = model.id\n this._parent = null\n this._deepEventHandler = new Y.utils.EventListenerHandler()\n this.os = os\n this.map = Y.utils.copyObject(model.map)\n this.contents = contents\n this.opContents = opContents\n this.eventHandler = new Y.utils.EventHandler(op => {\n var oldValue\n // key is the name to use to access (op)content\n var key = op.struct === 'Delete' ? op.key : op.parentSub\n\n // compute oldValue\n if (this.opContents[key] != null) {\n oldValue = this.os.getType(this.opContents[key])\n } else {\n oldValue = this.contents[key]\n }\n // compute op event\n if (op.struct === 'Insert') {\n if (op.left === null && !Y.utils.compareIds(op.id, this.map[key])) {\n var value\n // TODO: what if op.deleted??? I partially handles this case here.. but need to send delete event instead. somehow related to #4\n if (op.opContent != null) {\n value = this.os.getType(op.opContent)\n value._parent = this._model\n delete this.contents[key]\n if (op.deleted) {\n delete this.opContents[key]\n } else {\n this.opContents[key] = op.opContent\n }\n } else {\n value = op.content[0]\n delete this.opContents[key]\n if (op.deleted) {\n delete this.contents[key]\n } else {\n this.contents[key] = op.content[0]\n }\n }\n this.map[key] = op.id\n if (oldValue === undefined) {\n Y.utils.bubbleEvent(this, {\n name: key,\n object: this,\n type: 'add',\n value: value\n })\n } else {\n Y.utils.bubbleEvent(this, {\n name: key,\n object: this,\n oldValue: oldValue,\n type: 'update',\n value: value\n })\n }\n }\n } else if (op.struct === 'Delete') {\n if (Y.utils.compareIds(this.map[key], op.target)) {\n delete this.opContents[key]\n delete this.contents[key]\n Y.utils.bubbleEvent(this, {\n name: key,\n object: this,\n oldValue: oldValue,\n type: 'delete'\n })\n }\n } else {\n throw new Error('Unexpected Operation!')\n }\n })\n }\n _getPathToChild (childId) {\n return Object.keys(this.opContents).find(key =>\n Y.utils.compareIds(this.opContents[key], childId)\n )\n }\n _destroy () {\n this.eventHandler.destroy()\n this.eventHandler = null\n this.contents = null\n this.opContents = null\n this._model = null\n this._parent = null\n this.os = null\n this.map = null\n }\n get (key) {\n // return property.\n // if property does not exist, return null\n // if property is a type, return it\n if (key == null || typeof key !== 'string') {\n throw new Error('You must specify a key (as string)!')\n }\n if (this.opContents[key] == null) {\n return this.contents[key]\n } else {\n return this.os.getType(this.opContents[key])\n }\n }\n keys () {\n return Object.keys(this.contents).concat(Object.keys(this.opContents))\n }\n keysPrimitives () {\n return Object.keys(this.contents)\n }\n keysTypes () {\n return Object.keys(this.opContents)\n }\n /*\n If there is a primitive (not a custom type), then return it.\n Returns all primitive values, if propertyName is specified!\n Note: modifying the return value could result in inconsistencies!\n -- so make sure to copy it first!\n */\n getPrimitive (key) {\n if (key == null) {\n return Y.utils.copyObject(this.contents)\n } else if (typeof key !== 'string') {\n throw new Error('Key is expected to be a string!')\n } else {\n return this.contents[key]\n }\n }\n getType (key) {\n if (key == null || typeof key !== 'string') {\n throw new Error('You must specify a key (as string)!')\n } else if (this.opContents[key] != null) {\n return this.os.getType(this.opContents[key])\n } else {\n return null\n }\n }\n delete (key) {\n var right = this.map[key]\n if (right != null) {\n var del = {\n target: right,\n struct: 'Delete'\n }\n var eventHandler = this.eventHandler\n var modDel = Y.utils.copyObject(del)\n modDel.key = key\n this.os.requestTransaction(function *() {\n yield* eventHandler.awaitOps(this, this.applyCreatedOperations, [[del]])\n })\n // always remember to do that after this.os.requestTransaction\n // (otherwise values might contain a undefined reference to type)\n eventHandler.awaitAndPrematurelyCall([modDel])\n }\n }\n set (key, value) {\n // set property.\n // if property is a type, return it\n // if not, apply immediately on this type an call event\n\n var right = this.map[key] || null\n var insert /* :any */ = {\n id: this.os.getNextOpId(1),\n left: null,\n right: right,\n origin: null,\n parent: this._model,\n parentSub: key,\n struct: 'Insert'\n }\n var eventHandler = this.eventHandler\n var typeDefinition = Y.utils.isTypeDefinition(value)\n if (typeDefinition !== false) {\n var type = this.os.createType(typeDefinition)\n insert.opContent = type._model\n // construct a new type\n this.os.requestTransaction(function *() {\n yield* eventHandler.awaitOps(this, this.applyCreatedOperations, [[insert]])\n })\n // always remember to do that after this.os.requestTransaction\n // (otherwise values might contain a undefined reference to type)\n eventHandler.awaitAndPrematurelyCall([insert])\n return type\n } else {\n insert.content = [value]\n this.os.requestTransaction(function * () {\n yield* eventHandler.awaitOps(this, this.applyCreatedOperations, [[insert]])\n })\n // always remember to do that after this.os.requestTransaction\n // (otherwise values might contain a undefined reference to type)\n eventHandler.awaitAndPrematurelyCall([insert])\n return value\n }\n }\n observe (f) {\n this.eventHandler.addEventListener(f)\n }\n observeDeep (f) {\n this._deepEventHandler.addEventListener(f)\n }\n unobserve (f) {\n this.eventHandler.removeEventListener(f)\n }\n unobserveDeep (f) {\n this._deepEventHandler.removeEventListener(f)\n }\n /*\n Observe a path.\n\n E.g.\n ```\n o.set('textarea', Y.TextBind)\n o.observePath(['textarea'], function(t){\n // is called whenever textarea is replaced\n t.bind(textarea)\n })\n\n returns a function that removes the observer from the path.\n */\n observePath (path, f) {\n var self = this\n var propertyName\n function observeProperty (event) {\n // call f whenever path changes\n if (event.name === propertyName) {\n // call this also for delete events!\n f(self.get(propertyName))\n }\n }\n\n if (path.length < 1) {\n f(this)\n return function () {}\n } else if (path.length === 1) {\n propertyName = path[0]\n f(self.get(propertyName))\n this.observe(observeProperty)\n return function () {\n self.unobserve(f)\n }\n } else {\n var deleteChildObservers\n var resetObserverPath = function () {\n var map = self.get(path[0])\n if (!(map instanceof YMap)) {\n // its either not defined or a primitive value / not a map\n map = self.set(path[0], Y.Map)\n }\n deleteChildObservers = map.observePath(path.slice(1), f)\n }\n var observer = function (event) {\n if (event.name === path[0]) {\n if (deleteChildObservers != null) {\n deleteChildObservers()\n }\n if (event.type === 'add' || event.type === 'update') {\n resetObserverPath()\n }\n // TODO: what about the delete events?\n }\n }\n self.observe(observer)\n resetObserverPath()\n // returns a function that deletes all the child observers\n // and how to unobserve the observe from this object\n return function () {\n if (deleteChildObservers != null) {\n deleteChildObservers()\n }\n self.unobserve(observer)\n }\n }\n }\n * _changed (transaction, op) {\n if (op.struct === 'Delete') {\n if (op.key == null) {\n var target = yield* transaction.getOperation(op.target)\n op.key = target.parentSub\n }\n } else if (op.opContent != null) {\n yield* transaction.store.initType.call(transaction, op.opContent)\n }\n this.eventHandler.receivedOp(op)\n }\n }\n Y.extend('Map', new Y.utils.CustomTypeDefinition({\n name: 'Map',\n class: YMap,\n struct: 'Map',\n initType: function * YMapInitializer (os, model) {\n var contents = {}\n var opContents = {}\n var map = model.map\n for (var name in map) {\n var op = yield* this.getOperation(map[name])\n if (op.deleted) continue\n if (op.opContent != null) {\n opContents[name] = op.opContent\n var type = yield* this.store.initType.call(this, op.opContent)\n type._parent = model.id\n } else {\n contents[name] = op.content[0]\n }\n }\n return new YMap(os, model, contents, opContents)\n },\n createType: function YMapCreator (os, model) {\n return new YMap(os, model, {}, {})\n }\n }))\n}\n\nmodule.exports = extend\nif (typeof Y !== 'undefined') {\n extend(Y)\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-map/src/Map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-memory/src/Memory.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/y-memory/src/Memory.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global Y */\n\n\nfunction extend (Y) {\n __webpack_require__(/*! ./RedBlackTree.js */ \"./node_modules/y-memory/src/RedBlackTree.js\")(Y)\n class Transaction extends Y.Transaction {\n constructor (store) {\n super(store)\n this.store = store\n this.ss = store.ss\n this.os = store.os\n this.ds = store.ds\n }\n }\n var Store = Y.utils.RBTree\n var BufferedStore = Y.utils.createSmallLookupBuffer(Store)\n\n class Database extends Y.AbstractDatabase {\n constructor (y, opts) {\n super(y, opts)\n this.os = new BufferedStore()\n this.ds = new Store()\n this.ss = new BufferedStore()\n }\n logTable () {\n var self = this\n self.requestTransaction(function * () {\n console.log('User: ', this.store.y.connector.userId, \"==============================\") // eslint-disable-line\n console.log(\"State Set (SS):\", yield* this.getStateSet()) // eslint-disable-line\n console.log(\"Operation Store (OS):\") // eslint-disable-line\n yield* this.os.logTable() // eslint-disable-line\n console.log(\"Deletion Store (DS):\") //eslint-disable-line\n yield* this.ds.logTable() // eslint-disable-line\n if (this.store.gc1.length > 0 || this.store.gc2.length > 0) {\n console.warn('GC1|2 not empty!', this.store.gc1, this.store.gc2)\n }\n if (JSON.stringify(this.store.listenersById) !== '{}') {\n console.warn('listenersById not empty!')\n }\n if (JSON.stringify(this.store.listenersByIdExecuteNow) !== '[]') {\n console.warn('listenersByIdExecuteNow not empty!')\n }\n if (this.store.transactionInProgress) {\n console.warn('Transaction still in progress!')\n }\n }, true)\n }\n transact (makeGen) {\n var t = new Transaction(this)\n while (makeGen !== null) {\n var gen = makeGen.call(t)\n var res = gen.next()\n while (!res.done) {\n res = gen.next(res.value)\n }\n makeGen = this.getNextRequest()\n }\n }\n * destroy () {\n yield* super.destroy()\n delete this.os\n delete this.ss\n delete this.ds\n }\n }\n Y.extend('memory', Database)\n}\n\nmodule.exports = extend\nif (typeof Y !== 'undefined') {\n extend(Y)\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-memory/src/Memory.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-memory/src/RedBlackTree.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/y-memory/src/RedBlackTree.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\n\n/*\n This file contains a not so fancy implemantion of a Red Black Tree.\n*/\nmodule.exports = function (Y) {\n class N {\n // A created node is always red!\n constructor (val) {\n this.val = val\n this.color = true\n this._left = null\n this._right = null\n this._parent = null\n if (val.id === null) {\n throw new Error('You must define id!')\n }\n }\n isRed () { return this.color }\n isBlack () { return !this.color }\n redden () { this.color = true; return this }\n blacken () { this.color = false; return this }\n get grandparent () {\n return this.parent.parent\n }\n get parent () {\n return this._parent\n }\n get sibling () {\n return (this === this.parent.left)\n ? this.parent.right : this.parent.left\n }\n get left () {\n return this._left\n }\n get right () {\n return this._right\n }\n set left (n) {\n if (n !== null) {\n n._parent = this\n }\n this._left = n\n }\n set right (n) {\n if (n !== null) {\n n._parent = this\n }\n this._right = n\n }\n rotateLeft (tree) {\n var parent = this.parent\n var newParent = this.right\n var newRight = this.right.left\n newParent.left = this\n this.right = newRight\n if (parent === null) {\n tree.root = newParent\n newParent._parent = null\n } else if (parent.left === this) {\n parent.left = newParent\n } else if (parent.right === this) {\n parent.right = newParent\n } else {\n throw new Error('The elements are wrongly connected!')\n }\n }\n next () {\n if (this.right !== null) {\n // search the most left node in the right tree\n var o = this.right\n while (o.left !== null) {\n o = o.left\n }\n return o\n } else {\n var p = this\n while (p.parent !== null && p !== p.parent.left) {\n p = p.parent\n }\n return p.parent\n }\n }\n prev () {\n if (this.left !== null) {\n // search the most right node in the left tree\n var o = this.left\n while (o.right !== null) {\n o = o.right\n }\n return o\n } else {\n var p = this\n while (p.parent !== null && p !== p.parent.right) {\n p = p.parent\n }\n return p.parent\n }\n }\n rotateRight (tree) {\n var parent = this.parent\n var newParent = this.left\n var newLeft = this.left.right\n newParent.right = this\n this.left = newLeft\n if (parent === null) {\n tree.root = newParent\n newParent._parent = null\n } else if (parent.left === this) {\n parent.left = newParent\n } else if (parent.right === this) {\n parent.right = newParent\n } else {\n throw new Error('The elements are wrongly connected!')\n }\n }\n getUncle () {\n // we can assume that grandparent exists when this is called!\n if (this.parent === this.parent.parent.left) {\n return this.parent.parent.right\n } else {\n return this.parent.parent.left\n }\n }\n }\n\n class RBTree {\n constructor () {\n this.root = null\n this.length = 0\n }\n * findNext (id) {\n return yield* this.findWithLowerBound([id[0], id[1] + 1])\n }\n * findPrev (id) {\n return yield* this.findWithUpperBound([id[0], id[1] - 1])\n }\n findNodeWithLowerBound (from) {\n if (from === void 0) {\n throw new Error('You must define from!')\n }\n var o = this.root\n if (o === null) {\n return null\n } else {\n while (true) {\n if ((from === null || Y.utils.smaller(from, o.val.id)) && o.left !== null) {\n // o is included in the bound\n // try to find an element that is closer to the bound\n o = o.left\n } else if (from !== null && Y.utils.smaller(o.val.id, from)) {\n // o is not within the bound, maybe one of the right elements is..\n if (o.right !== null) {\n o = o.right\n } else {\n // there is no right element. Search for the next bigger element,\n // this should be within the bounds\n return o.next()\n }\n } else {\n return o\n }\n }\n }\n }\n findNodeWithUpperBound (to) {\n if (to === void 0) {\n throw new Error('You must define from!')\n }\n var o = this.root\n if (o === null) {\n return null\n } else {\n while (true) {\n if ((to === null || Y.utils.smaller(o.val.id, to)) && o.right !== null) {\n // o is included in the bound\n // try to find an element that is closer to the bound\n o = o.right\n } else if (to !== null && Y.utils.smaller(to, o.val.id)) {\n // o is not within the bound, maybe one of the left elements is..\n if (o.left !== null) {\n o = o.left\n } else {\n // there is no left element. Search for the prev smaller element,\n // this should be within the bounds\n return o.prev()\n }\n } else {\n return o\n }\n }\n }\n }\n findSmallestNode () {\n var o = this.root\n while (o != null && o.left != null) {\n o = o.left\n }\n return o\n }\n * findWithLowerBound (from) {\n var n = this.findNodeWithLowerBound(from)\n return n == null ? null : n.val\n }\n * findWithUpperBound (to) {\n var n = this.findNodeWithUpperBound(to)\n return n == null ? null : n.val\n }\n * iterate (t, from, to, f) {\n var o\n if (from === null) {\n o = this.findSmallestNode()\n } else {\n o = this.findNodeWithLowerBound(from)\n }\n while (o !== null && (to === null || Y.utils.smaller(o.val.id, to) || Y.utils.compareIds(o.val.id, to))) {\n yield* f.call(t, o.val)\n o = o.next()\n }\n return true\n }\n * logTable (from, to, filter) {\n if (filter == null) {\n filter = function () {\n return true\n }\n }\n if (from == null) { from = null }\n if (to == null) { to = null }\n var os = []\n yield* this.iterate(this, from, to, function * (o) {\n if (filter(o)) {\n var o_ = {}\n for (var key in o) {\n if (typeof o[key] === 'object') {\n o_[key] = JSON.stringify(o[key])\n } else {\n o_[key] = o[key]\n }\n }\n os.push(o_)\n }\n })\n if (console.table != null) {\n console.table(os)\n }\n }\n * find (id) {\n var n\n return (n = this.findNode(id)) ? n.val : null\n }\n findNode (id) {\n if (id == null || id.constructor !== Array) {\n throw new Error('Expect id to be an array!')\n }\n var o = this.root\n if (o === null) {\n return false\n } else {\n while (true) {\n if (o === null) {\n return false\n }\n if (Y.utils.smaller(id, o.val.id)) {\n o = o.left\n } else if (Y.utils.smaller(o.val.id, id)) {\n o = o.right\n } else {\n return o\n }\n }\n }\n }\n * delete (id) {\n if (id == null || id.constructor !== Array) {\n throw new Error('id is expected to be an Array!')\n }\n var d = this.findNode(id)\n if (d == null) {\n // throw new Error('Element does not exist!')\n return\n }\n this.length--\n if (d.left !== null && d.right !== null) {\n // switch d with the greates element in the left subtree.\n // o should have at most one child.\n var o = d.left\n // find\n while (o.right !== null) {\n o = o.right\n }\n // switch\n d.val = o.val\n d = o\n }\n // d has at most one child\n // let n be the node that replaces d\n var isFakeChild\n var child = d.left || d.right\n if (child === null) {\n isFakeChild = true\n child = new N({id: 0})\n child.blacken()\n d.right = child\n } else {\n isFakeChild = false\n }\n\n if (d.parent === null) {\n if (!isFakeChild) {\n this.root = child\n child.blacken()\n child._parent = null\n } else {\n this.root = null\n }\n return\n } else if (d.parent.left === d) {\n d.parent.left = child\n } else if (d.parent.right === d) {\n d.parent.right = child\n } else {\n throw new Error('Impossible!')\n }\n if (d.isBlack()) {\n if (child.isRed()) {\n child.blacken()\n } else {\n this._fixDelete(child)\n }\n }\n this.root.blacken()\n if (isFakeChild) {\n if (child.parent.left === child) {\n child.parent.left = null\n } else if (child.parent.right === child) {\n child.parent.right = null\n } else {\n throw new Error('Impossible #3')\n }\n }\n }\n _fixDelete (n) {\n function isBlack (node) {\n return node !== null ? node.isBlack() : true\n }\n function isRed (node) {\n return node !== null ? node.isRed() : false\n }\n if (n.parent === null) {\n // this can only be called after the first iteration of fixDelete.\n return\n }\n // d was already replaced by the child\n // d is not the root\n // d and child are black\n var sibling = n.sibling\n if (isRed(sibling)) {\n // make sibling the grandfather\n n.parent.redden()\n sibling.blacken()\n if (n === n.parent.left) {\n n.parent.rotateLeft(this)\n } else if (n === n.parent.right) {\n n.parent.rotateRight(this)\n } else {\n throw new Error('Impossible #2')\n }\n sibling = n.sibling\n }\n // parent, sibling, and children of n are black\n if (n.parent.isBlack() &&\n sibling.isBlack() &&\n isBlack(sibling.left) &&\n isBlack(sibling.right)\n ) {\n sibling.redden()\n this._fixDelete(n.parent)\n } else if (n.parent.isRed() &&\n sibling.isBlack() &&\n isBlack(sibling.left) &&\n isBlack(sibling.right)\n ) {\n sibling.redden()\n n.parent.blacken()\n } else {\n if (n === n.parent.left &&\n sibling.isBlack() &&\n isRed(sibling.left) &&\n isBlack(sibling.right)\n ) {\n sibling.redden()\n sibling.left.blacken()\n sibling.rotateRight(this)\n sibling = n.sibling\n } else if (n === n.parent.right &&\n sibling.isBlack() &&\n isRed(sibling.right) &&\n isBlack(sibling.left)\n ) {\n sibling.redden()\n sibling.right.blacken()\n sibling.rotateLeft(this)\n sibling = n.sibling\n }\n sibling.color = n.parent.color\n n.parent.blacken()\n if (n === n.parent.left) {\n sibling.right.blacken()\n n.parent.rotateLeft(this)\n } else {\n sibling.left.blacken()\n n.parent.rotateRight(this)\n }\n }\n }\n * put (v) {\n if (v == null || v.id == null || v.id.constructor !== Array) {\n throw new Error('v is expected to have an id property which is an Array!')\n }\n var node = new N(v)\n if (this.root !== null) {\n var p = this.root // p abbrev. parent\n while (true) {\n if (Y.utils.smaller(node.val.id, p.val.id)) {\n if (p.left === null) {\n p.left = node\n break\n } else {\n p = p.left\n }\n } else if (Y.utils.smaller(p.val.id, node.val.id)) {\n if (p.right === null) {\n p.right = node\n break\n } else {\n p = p.right\n }\n } else {\n p.val = node.val\n return p\n }\n }\n this._fixInsert(node)\n } else {\n this.root = node\n }\n this.length++\n this.root.blacken()\n return node\n }\n _fixInsert (n) {\n if (n.parent === null) {\n n.blacken()\n return\n } else if (n.parent.isBlack()) {\n return\n }\n var uncle = n.getUncle()\n if (uncle !== null && uncle.isRed()) {\n // Note: parent: red, uncle: red\n n.parent.blacken()\n uncle.blacken()\n n.grandparent.redden()\n this._fixInsert(n.grandparent)\n } else {\n // Note: parent: red, uncle: black or null\n // Now we transform the tree in such a way that\n // either of these holds:\n // 1) grandparent.left.isRed\n // and grandparent.left.left.isRed\n // 2) grandparent.right.isRed\n // and grandparent.right.right.isRed\n if (n === n.parent.right && n.parent === n.grandparent.left) {\n n.parent.rotateLeft(this)\n // Since we rotated and want to use the previous\n // cases, we need to set n in such a way that\n // n.parent.isRed again\n n = n.left\n } else if (n === n.parent.left && n.parent === n.grandparent.right) {\n n.parent.rotateRight(this)\n // see above\n n = n.right\n }\n // Case 1) or 2) hold from here on.\n // Now traverse grandparent, make parent a black node\n // on the highest level which holds two red nodes.\n n.parent.blacken()\n n.grandparent.redden()\n if (n === n.parent.left) {\n // Case 1\n n.grandparent.rotateRight(this)\n } else {\n // Case 2\n n.grandparent.rotateLeft(this)\n }\n }\n }\n * flush () {}\n }\n\n Y.utils.RBTree = RBTree\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-memory/src/RedBlackTree.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/y-text/src/Text.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/y-text/src/Text.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global Y, Element */\n\n\nvar diff = __webpack_require__(/*! fast-diff */ \"./node_modules/fast-diff/diff.js\")\nvar monacoIdentifierTemplate = { major: 0, minor: 0 }\n\nfunction extend (Y) {\n Y.requestModules(['Array']).then(function () {\n class YText extends Y.Array.typeDefinition['class'] {\n constructor (os, _model, _content) {\n super(os, _model, _content)\n this.textfields = []\n this.aceInstances = []\n this.codeMirrorInstances = []\n this.monacoInstances = []\n }\n toString () {\n return this._content.map(function (c) {\n return c.val\n }).join('')\n }\n insert (pos, content) {\n var arr = content.split('')\n for (var i = 0; i < arr.length; i++) {\n if (/[\\uD800-\\uDFFF]/.test(arr[i])) {\n // is surrogate pair\n arr[i] = arr[i] + arr[i + 1]\n arr[i + 1] = ''\n i++\n }\n }\n super.insert(pos, arr)\n }\n delete (pos, length) {\n if (length == null) { length = 1 }\n if (typeof length !== 'number') {\n throw new Error('length must be a number!')\n }\n if (typeof pos !== 'number') {\n throw new Error('pos must be a number!')\n }\n if (pos + length > this._content.length || pos < 0 || length < 0) {\n throw new Error('The deletion range exceeds the range of the array!')\n }\n if (length === 0) {\n return\n }\n // This is for the case that part of a surrogate pair is deleted\n // we store surrogate pairs like this: [.., '🐇', '', ..] (string, code)\n if (this._content.length > pos + length && this._content[pos + length].val === '' && this._content[pos + length - 1].val.length === 2) {\n // case one. first part of the surrogate pair is deleted\n let token = this._content[pos + length - 1].val[0]\n super.delete(pos, length + 1)\n super.insert(pos, [token])\n } else if (pos > 0 && this._content[pos].val === '' && this._content[pos - 1].val.length === 2) {\n // case two. second part of the surrogate pair is deleted\n let token = this._content[pos - 1].val[1]\n super.delete(pos - 1, length + 1)\n super.insert(pos - 1, [token])\n } else {\n super.delete(pos, length)\n }\n }\n unbindAll () {\n this.unbindTextareaAll()\n this.unbindAceAll()\n this.unbindCodeMirrorAll()\n this.unbindMonacoAll()\n }\n // Monaco implementation\n unbindMonaco (monacoInstance) {\n var i = this.monacoInstances.findIndex(function (binding) {\n return binding.editor === monacoInstance\n })\n if (i >= 0) {\n var binding = this.monacoInstances[i]\n this.unobserve(binding.yCallback)\n binding.disposeBinding()\n this.monacoInstances.splice(i, 1)\n }\n }\n unbindMonacoAll () {\n for (let i = this.monacoInstances.length - 1; i >= 0; i--) {\n this.unbindMonaco(this.monacoInstances[i].editor)\n }\n }\n bindMonaco (monacoInstance, options) {\n var self = this\n options = options || {}\n\n // this function makes sure that either the\n // monaco event is executed, or the yjs observer is executed\n var token = true\n function mutualExcluse (f) {\n if (token) {\n token = false\n try {\n f()\n } catch (e) {\n token = true\n throw new Error(e)\n }\n token = true\n }\n }\n monacoInstance.setValue(this.toString())\n\n function monacoCallback (event) {\n mutualExcluse(function () {\n // compute start.. (col+row -> index position)\n // We shouldn't compute the offset on the old model..\n // var start = monacoInstance.model.getOffsetAt({column: event.range.startColumn, lineNumber: event.range.startLineNumber})\n // So we compute the offset using the _content of this type\n for (var i = 0, line = 1; line < event.range.startLineNumber; i++) {\n if (self._content[i].val === '\\n') {\n line++\n }\n }\n var start = i + event.range.startColumn - 1\n\n // apply the delete operation first\n if (event.rangeLength > 0) {\n self.delete(start, event.rangeLength)\n }\n // apply insert operation\n self.insert(start, event.text)\n })\n }\n var disposeBinding = monacoInstance.onDidChangeModelContent(monacoCallback).dispose\n\n function yCallback (event) {\n mutualExcluse(function () {\n let start = monacoInstance.model.getPositionAt(event.index)\n var end, text\n if (event.type === 'insert') {\n end = start\n text = event.values.join('')\n } else if (event.type === 'delete') {\n end = monacoInstance.model.modifyPosition(start, event.length)\n text = ''\n }\n var range = {\n startLineNumber: start.lineNumber,\n startColumn: start.column,\n endLineNumber: end.lineNumber,\n endColumn: end.column\n }\n var id = {\n major: monacoIdentifierTemplate.major,\n minor: monacoIdentifierTemplate.minor++\n }\n monacoInstance.executeEdits('Yjs', [{\n id: id,\n range: range,\n text: text,\n forceMoveMarkers: true\n }])\n })\n }\n this.observe(yCallback)\n this.monacoInstances.push({\n editor: monacoInstance,\n yCallback: yCallback,\n monacoCallback: monacoCallback,\n disposeBinding: disposeBinding\n })\n }\n // CodeMirror implementation..\n unbindCodeMirror (codeMirrorInstance) {\n var i = this.codeMirrorInstances.findIndex(function (binding) {\n return binding.editor === codeMirrorInstance\n })\n if (i >= 0) {\n var binding = this.codeMirrorInstances[i]\n this.unobserve(binding.yCallback)\n binding.editor.off('changes', binding.codeMirrorCallback)\n this.codeMirrorInstances.splice(i, 1)\n }\n }\n unbindCodeMirrorAll () {\n for (let i = this.codeMirrorInstances.length - 1; i >= 0; i--) {\n this.unbindCodeMirror(this.codeMirrorInstances[i].editor)\n }\n }\n bindCodeMirror (codeMirrorInstance, options) {\n var self = this\n options = options || {}\n\n // this function makes sure that either the\n // codemirror event is executed, or the yjs observer is executed\n var token = true\n function mutualExcluse (f) {\n if (token) {\n token = false\n try {\n f()\n } catch (e) {\n token = true\n throw new Error(e)\n }\n token = true\n }\n }\n codeMirrorInstance.setValue(this.toString())\n\n function codeMirrorCallback (cm, deltas) {\n mutualExcluse(function () {\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i]\n var start = codeMirrorInstance.indexFromPos(delta.from)\n // apply the delete operation first\n if (delta.removed.length > 0) {\n var delLength = 0\n for (var j = 0; j < delta.removed.length; j++) {\n delLength += delta.removed[j].length\n }\n // \"enter\" is also a character in our case\n delLength += delta.removed.length - 1\n self.delete(start, delLength)\n }\n // apply insert operation\n self.insert(start, delta.text.join('\\n'))\n }\n })\n }\n codeMirrorInstance.on('changes', codeMirrorCallback)\n\n function yCallback (event) {\n mutualExcluse(function () {\n let from = codeMirrorInstance.posFromIndex(event.index)\n if (event.type === 'insert') {\n let to = from\n codeMirrorInstance.replaceRange(event.values.join(''), from, to)\n } else if (event.type === 'delete') {\n let to = codeMirrorInstance.posFromIndex(event.index + event.length)\n codeMirrorInstance.replaceRange('', from, to)\n }\n })\n }\n this.observe(yCallback)\n this.codeMirrorInstances.push({\n editor: codeMirrorInstance,\n yCallback: yCallback,\n codeMirrorCallback: codeMirrorCallback\n })\n }\n unbindAce (aceInstance) {\n var i = this.aceInstances.findIndex(function (binding) {\n return binding.editor === aceInstance\n })\n if (i >= 0) {\n var binding = this.aceInstances[i]\n this.unobserve(binding.yCallback)\n binding.editor.off('change', binding.aceCallback)\n this.aceInstances.splice(i, 1)\n }\n }\n unbindAceAll () {\n for (let i = this.aceInstances.length - 1; i >= 0; i--) {\n this.unbindAce(this.aceInstances[i].editor)\n }\n }\n bindAce (aceInstance, options) {\n var self = this\n options = options || {}\n\n // this function makes sure that either the\n // ace event is executed, or the yjs observer is executed\n var token = true\n function mutualExcluse (f) {\n if (token) {\n token = false\n try {\n f()\n } catch (e) {\n token = true\n throw new Error(e)\n }\n token = true\n }\n }\n aceInstance.setValue(this.toString())\n\n function aceCallback (delta) {\n mutualExcluse(function () {\n var start\n var length\n\n var aceDocument = aceInstance.getSession().getDocument()\n if (delta.action === 'insert') {\n start = aceDocument.positionToIndex(delta.start, 0)\n self.insert(start, delta.lines.join('\\n'))\n } else if (delta.action === 'remove') {\n start = aceDocument.positionToIndex(delta.start, 0)\n length = delta.lines.join('\\n').length\n self.delete(start, length)\n }\n })\n }\n aceInstance.on('change', aceCallback)\n\n aceInstance.selection.clearSelection()\n\n // We don't that ace is a global variable\n // see #2\n var aceClass\n if (typeof ace !== 'undefined' && options.aceClass == null) {\n aceClass = ace // eslint-disable-line\n } else {\n aceClass = options.aceClass\n }\n var aceRequire = options.aceRequire || aceClass.require\n var Range = aceRequire('ace/range').Range\n\n function yCallback (event) {\n var aceDocument = aceInstance.getSession().getDocument()\n mutualExcluse(function () {\n if (event.type === 'insert') {\n let start = aceDocument.indexToPosition(event.index, 0)\n aceDocument.insert(start, event.values.join(''))\n } else if (event.type === 'delete') {\n let start = aceDocument.indexToPosition(event.index, 0)\n let end = aceDocument.indexToPosition(event.index + event.length, 0)\n var range = new Range(start.row, start.column, end.row, end.column)\n aceDocument.remove(range)\n }\n })\n }\n this.observe(yCallback)\n this.aceInstances.push({\n editor: aceInstance,\n yCallback: yCallback,\n aceCallback: aceCallback\n })\n }\n bind () {\n var e = arguments[0]\n if (e instanceof Element) {\n this.bindTextarea.apply(this, arguments)\n } else if (e != null && e.session != null && e.getSession != null && e.setValue != null) {\n this.bindAce.apply(this, arguments)\n } else if (e != null && e.posFromIndex != null && e.replaceRange != null) {\n this.bindCodeMirror.apply(this, arguments)\n } else if (e != null && e.onDidChangeModelContent != null) {\n this.bindMonaco.apply(this, arguments)\n } else {\n console.error('Cannot bind, unsupported editor!')\n }\n }\n unbindTextarea (textarea) {\n var i = this.textfields.findIndex(function (binding) {\n return binding.editor === textarea\n })\n if (i >= 0) {\n var binding = this.textfields[i]\n this.unobserve(binding.yCallback)\n var e = binding.editor\n e.removeEventListener('input', binding.eventListener)\n this.textfields.splice(i, 1)\n }\n }\n unbindTextareaAll () {\n for (let i = this.textfields.length - 1; i >= 0; i--) {\n this.unbindTextarea(this.textfields[i].editor)\n }\n }\n bindTextarea (textfield, domRoot) {\n domRoot = domRoot || window; // eslint-disable-line\n if (domRoot.getSelection == null) {\n domRoot = window; // eslint-disable-line\n }\n\n // don't duplicate!\n for (var t = 0; t < this.textfields.length; t++) {\n if (this.textfields[t].editor === textfield) {\n return\n }\n }\n // this function makes sure that either the\n // textfieldt event is executed, or the yjs observer is executed\n var token = true\n function mutualExcluse (f) {\n if (token) {\n token = false\n try {\n f()\n } catch (e) {\n token = true\n throw new Error(e)\n }\n token = true\n }\n }\n\n var self = this\n textfield.value = this.toString()\n\n var createRange, writeRange, writeContent, getContent\n if (textfield.selectionStart != null && textfield.setSelectionRange != null) {\n createRange = function (fix) {\n var left = textfield.selectionStart\n var right = textfield.selectionEnd\n if (fix != null) {\n left = fix(left)\n right = fix(right)\n }\n return {\n left: left,\n right: right\n }\n }\n writeRange = function (range) {\n writeContent(self.toString())\n textfield.setSelectionRange(range.left, range.right)\n }\n writeContent = function (content) {\n textfield.value = content\n }\n getContent = function () {\n return textfield.value\n }\n } else {\n createRange = function (fix) {\n var range = {}\n var s = domRoot.getSelection()\n var clength = textfield.textContent.length\n range.left = Math.min(s.anchorOffset, clength)\n range.right = Math.min(s.focusOffset, clength)\n if (fix != null) {\n range.left = fix(range.left)\n range.right = fix(range.right)\n }\n var editedElement = s.focusNode\n if (editedElement === textfield || editedElement === textfield.childNodes[0]) {\n range.isReal = true\n } else {\n range.isReal = false\n }\n return range\n }\n\n writeRange = function (range) {\n writeContent(self.toString())\n var textnode = textfield.childNodes[0]\n if (range.isReal && textnode != null) {\n if (range.left < 0) {\n range.left = 0\n }\n range.right = Math.max(range.left, range.right)\n if (range.right > textnode.length) {\n range.right = textnode.length\n }\n range.left = Math.min(range.left, range.right)\n var r = document.createRange(); // eslint-disable-line\n r.setStart(textnode, range.left)\n r.setEnd(textnode, range.right)\n var s = domRoot.getSelection(); // eslint-disable-line\n s.removeAllRanges()\n s.addRange(r)\n }\n }\n writeContent = function (content) {\n textfield.innerText = content\n /*\n var contentArray = content.replace(new RegExp('\\n', 'g'), ' ').split(' '); // eslint-disable-line\n textfield.innerText = ''\n for (var i = 0; i < contentArray.length; i++) {\n var c = contentArray[i]\n textfield.innerText += c\n if (i !== contentArray.length - 1) {\n textfield.innerHTML += ' '\n }\n }\n */\n }\n getContent = function () {\n return textfield.innerText\n }\n }\n writeContent(this.toString())\n\n function yCallback (event) {\n mutualExcluse(() => {\n var oPos, fix\n if (event.type === 'insert') {\n oPos = event.index\n fix = function (cursor) { // eslint-disable-line\n if (cursor <= oPos) {\n return cursor\n } else {\n cursor += 1\n return cursor\n }\n }\n var r = createRange(fix)\n writeRange(r)\n } else if (event.type === 'delete') {\n oPos = event.index\n fix = function (cursor) { // eslint-disable-line\n if (cursor < oPos) {\n return cursor\n } else {\n cursor -= 1\n return cursor\n }\n }\n r = createRange(fix)\n writeRange(r)\n }\n })\n }\n this.observe(yCallback)\n\n var textfieldObserver = function textfieldObserver () {\n mutualExcluse(function () {\n var r = createRange(function (x) { return x })\n var oldContent = self.toString()\n var content = getContent()\n var diffs = diff(oldContent, content, r.left)\n var pos = 0\n for (var i = 0; i < diffs.length; i++) {\n var d = diffs[i]\n if (d[0] === 0) { // EQUAL\n pos += d[1].length\n } else if (d[0] === -1) { // DELETE\n self.delete(pos, d[1].length)\n } else { // INSERT\n self.insert(pos, d[1])\n pos += d[1].length\n }\n }\n })\n }\n textfield.addEventListener('input', textfieldObserver)\n this.textfields.push({\n editor: textfield,\n yCallback: yCallback,\n eventListener: textfieldObserver\n })\n }\n _destroy () {\n this.unbindAll()\n this.textfields = null\n this.aceInstances = null\n super._destroy()\n }\n }\n Y.extend('Text', new Y.utils.CustomTypeDefinition({\n name: 'Text',\n class: YText,\n struct: 'List',\n initType: function * YTextInitializer (os, model) {\n var _content = []\n yield * Y.Struct.List.map.call(this, model, function (op) {\n if (op.hasOwnProperty('opContent')) {\n throw new Error('Text must not contain types!')\n } else {\n op.content.forEach(function (c, i) {\n _content.push({\n id: [op.id[0], op.id[1] + i],\n val: op.content[i]\n })\n })\n }\n })\n return new YText(os, model.id, _content)\n },\n createType: function YTextCreator (os, model) {\n return new YText(os, model.id, [])\n }\n }))\n })\n}\n\nmodule.exports = extend\nif (typeof Y !== 'undefined') {\n extend(Y)\n}\n\n\n//# sourceURL=webpack:///./node_modules/y-text/src/Text.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yallist/iterator.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/yallist/iterator.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/yallist/iterator.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yallist/yallist.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/yallist/yallist.js ***!
|
||
\*****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("\nmodule.exports = Yallist\n\nYallist.Node = Node\nYallist.create = Yallist\n\nfunction Yallist (list) {\n var self = this\n if (!(self instanceof Yallist)) {\n self = new Yallist()\n }\n\n self.tail = null\n self.head = null\n self.length = 0\n\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item)\n })\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i])\n }\n }\n\n return self\n}\n\nYallist.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list')\n }\n\n var next = node.next\n var prev = node.prev\n\n if (next) {\n next.prev = prev\n }\n\n if (prev) {\n prev.next = next\n }\n\n if (node === this.head) {\n this.head = next\n }\n if (node === this.tail) {\n this.tail = prev\n }\n\n node.list.length--\n node.next = null\n node.prev = null\n node.list = null\n}\n\nYallist.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var head = this.head\n node.list = this\n node.next = head\n if (head) {\n head.prev = node\n }\n\n this.head = node\n if (!this.tail) {\n this.tail = node\n }\n this.length++\n}\n\nYallist.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var tail = this.tail\n node.list = this\n node.prev = tail\n if (tail) {\n tail.next = node\n }\n\n this.tail = node\n if (!this.head) {\n this.head = node\n }\n this.length++\n}\n\nYallist.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.pop = function () {\n if (!this.tail) {\n return undefined\n }\n\n var res = this.tail.value\n this.tail = this.tail.prev\n if (this.tail) {\n this.tail.next = null\n } else {\n this.head = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.shift = function () {\n if (!this.head) {\n return undefined\n }\n\n var res = this.head.value\n this.head = this.head.next\n if (this.head) {\n this.head.prev = null\n } else {\n this.tail = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.next\n }\n}\n\nYallist.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.prev\n }\n}\n\nYallist.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.map = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.next\n }\n return res\n}\n\nYallist.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.prev\n }\n return res\n}\n\nYallist.prototype.reduce = function (fn, initial) {\n var acc\n var walker = this.head\n if (arguments.length > 1) {\n acc = initial\n } else if (this.head) {\n walker = this.head.next\n acc = this.head.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i)\n walker = walker.next\n }\n\n return acc\n}\n\nYallist.prototype.reduceReverse = function (fn, initial) {\n var acc\n var walker = this.tail\n if (arguments.length > 1) {\n acc = initial\n } else if (this.tail) {\n walker = this.tail.prev\n acc = this.tail.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i)\n walker = walker.prev\n }\n\n return acc\n}\n\nYallist.prototype.toArray = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.next\n }\n return arr\n}\n\nYallist.prototype.toArrayReverse = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.prev\n }\n return arr\n}\n\nYallist.prototype.slice = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.sliceReverse = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.reverse = function () {\n var head = this.head\n var tail = this.tail\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev\n walker.prev = walker.next\n walker.next = p\n }\n this.head = tail\n this.tail = head\n return this\n}\n\nfunction push (self, item) {\n self.tail = new Node(item, self.tail, null, self)\n if (!self.head) {\n self.head = self.tail\n }\n self.length++\n}\n\nfunction unshift (self, item) {\n self.head = new Node(item, null, self.head, self)\n if (!self.tail) {\n self.tail = self.head\n }\n self.length++\n}\n\nfunction Node (value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list)\n }\n\n this.list = list\n this.value = value\n\n if (prev) {\n prev.next = this\n this.prev = prev\n } else {\n this.prev = null\n }\n\n if (next) {\n next.prev = this\n this.next = next\n } else {\n this.next = null\n }\n}\n\ntry {\n // add if support for Symbol.iterator is present\n __webpack_require__(/*! ./iterator.js */ \"./node_modules/yallist/iterator.js\")(Yallist)\n} catch (er) {}\n\n\n//# sourceURL=webpack:///./node_modules/yallist/yallist.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/node_modules/debug/src/browser.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/yjs/node_modules/debug/src/browser.js ***!
|
||
\************************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/yjs/node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/yjs/node_modules/debug/src/browser.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/node_modules/debug/src/debug.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/yjs/node_modules/debug/src/debug.js ***!
|
||
\**********************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/yjs/node_modules/ms/index.js\");\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/node_modules/debug/src/debug.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/node_modules/ms/index.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/yjs/node_modules/ms/index.js ***!
|
||
\***************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/node_modules/ms/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src sync recursive":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/yjs/src sync ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = \"./node_modules/yjs/src sync recursive\";\n\n//# sourceURL=webpack:///./node_modules/yjs/src_sync?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/Connector.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/yjs/src/Connector.js ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("function canRead (auth) { return auth === 'read' || auth === 'write' }\nfunction canWrite (auth) { return auth === 'write' }\n\nmodule.exports = function (Y/* :any */) {\n class AbstractConnector {\n /* ::\n y: YConfig;\n role: SyncRole;\n connections: Object;\n isSynced: boolean;\n userEventListeners: Array<Function>;\n whenSyncedListeners: Array<Function>;\n currentSyncTarget: ?UserId;\n syncingClients: Array<UserId>;\n forwardToSyncingClients: boolean;\n debug: boolean;\n syncStep2: Promise;\n userId: UserId;\n send: Function;\n broadcast: Function;\n broadcastOpBuffer: Array<Operation>;\n protocolVersion: number;\n */\n /*\n opts contains the following information:\n role : String Role of this client (\"master\" or \"slave\")\n userId : String Uniquely defines the user.\n debug: Boolean Whether to print debug messages (optional)\n */\n constructor (y, opts) {\n this.y = y\n if (opts == null) {\n opts = {}\n }\n // Prefer to receive untransformed operations. This does only work if\n // this client receives operations from only one other client.\n // In particular, this does not work with y-webrtc.\n // It will work with y-websockets-client\n if (opts.role == null || opts.role === 'master') {\n this.role = 'master'\n } else if (opts.role === 'slave') {\n this.role = 'slave'\n } else {\n throw new Error(\"Role must be either 'master' or 'slave'!\")\n }\n this.log = Y.debug('y:connector')\n this.logMessage = Y.debug('y:connector-message')\n this.y.db.forwardAppliedOperations = opts.forwardAppliedOperations || false\n this.role = opts.role\n this.connections = {}\n this.isSynced = false\n this.userEventListeners = []\n this.whenSyncedListeners = []\n this.currentSyncTarget = null\n this.syncingClients = []\n this.forwardToSyncingClients = opts.forwardToSyncingClients !== false\n this.debug = opts.debug === true\n this.syncStep2 = Promise.resolve()\n this.broadcastOpBuffer = []\n this.protocolVersion = 11\n this.authInfo = opts.auth || null\n this.checkAuth = opts.checkAuth || function () { return Promise.resolve('write') } // default is everyone has write access\n if (opts.generateUserId === true) {\n this.setUserId(Y.utils.generateGuid())\n }\n }\n resetAuth (auth) {\n if (this.authInfo !== auth) {\n this.authInfo = auth\n this.broadcast({\n type: 'auth',\n auth: this.authInfo\n })\n }\n }\n reconnect () {\n this.log('reconnecting..')\n return this.y.db.startGarbageCollector()\n }\n disconnect () {\n this.log('discronnecting..')\n this.connections = {}\n this.isSynced = false\n this.currentSyncTarget = null\n this.syncingClients = []\n this.whenSyncedListeners = []\n this.y.db.stopGarbageCollector()\n return this.y.db.whenTransactionsFinished()\n }\n repair () {\n this.log('Repairing the state of Yjs. This can happen if messages get lost, and Yjs detects that something is wrong. If this happens often, please report an issue here: https://github.com/y-js/yjs/issues')\n for (var name in this.connections) {\n this.connections[name].isSynced = false\n }\n this.isSynced = false\n this.currentSyncTarget = null\n this.findNextSyncTarget()\n }\n setUserId (userId) {\n if (this.userId == null) {\n this.log('Set userId to \"%s\"', userId)\n this.userId = userId\n return this.y.db.setUserId(userId)\n } else {\n return null\n }\n }\n onUserEvent (f) {\n this.userEventListeners.push(f)\n }\n removeUserEventListener (f) {\n this.userEventListeners = this.userEventListeners.filter(g => { f !== g })\n }\n userLeft (user) {\n if (this.connections[user] != null) {\n this.log('User left: %s', user)\n delete this.connections[user]\n if (user === this.currentSyncTarget) {\n this.currentSyncTarget = null\n this.findNextSyncTarget()\n }\n this.syncingClients = this.syncingClients.filter(function (cli) {\n return cli !== user\n })\n for (var f of this.userEventListeners) {\n f({\n action: 'userLeft',\n user: user\n })\n }\n }\n }\n userJoined (user, role) {\n if (role == null) {\n throw new Error('You must specify the role of the joined user!')\n }\n if (this.connections[user] != null) {\n throw new Error('This user already joined!')\n }\n this.log('User joined: %s', user)\n this.connections[user] = {\n isSynced: false,\n role: role\n }\n for (var f of this.userEventListeners) {\n f({\n action: 'userJoined',\n user: user,\n role: role\n })\n }\n if (this.currentSyncTarget == null) {\n this.findNextSyncTarget()\n }\n }\n // Execute a function _when_ we are connected.\n // If not connected, wait until connected\n whenSynced (f) {\n if (this.isSynced) {\n f()\n } else {\n this.whenSyncedListeners.push(f)\n }\n }\n findNextSyncTarget () {\n if (this.currentSyncTarget != null) {\n return // \"The current sync has not finished!\"\n }\n\n var syncUser = null\n for (var uid in this.connections) {\n if (!this.connections[uid].isSynced) {\n syncUser = uid\n break\n }\n }\n var conn = this\n if (syncUser != null) {\n this.currentSyncTarget = syncUser\n this.y.db.requestTransaction(function *() {\n var stateSet = yield* this.getStateSet()\n var deleteSet = yield* this.getDeleteSet()\n var answer = {\n type: 'sync step 1',\n stateSet: stateSet,\n deleteSet: deleteSet,\n protocolVersion: conn.protocolVersion,\n auth: conn.authInfo\n }\n conn.send(syncUser, answer)\n })\n } else {\n if (!conn.isSynced) {\n this.y.db.requestTransaction(function *() {\n if (!conn.isSynced) {\n // it is crucial that isSynced is set at the time garbageCollectAfterSync is called\n conn.isSynced = true\n yield* this.garbageCollectAfterSync()\n // call whensynced listeners\n for (var f of conn.whenSyncedListeners) {\n f()\n }\n conn.whenSyncedListeners = []\n }\n })\n }\n }\n }\n send (uid, message) {\n this.log('Send \\'%s\\' to %s', message.type, uid)\n this.logMessage('Message: %j', message)\n }\n broadcast (message) {\n this.log('Broadcast \\'%s\\'', message.type)\n this.logMessage('Message: %j', message)\n }\n /*\n Buffer operations, and broadcast them when ready.\n */\n broadcastOps (ops) {\n ops = ops.map(function (op) {\n return Y.Struct[op.struct].encode(op)\n })\n var self = this\n function broadcastOperations () {\n if (self.broadcastOpBuffer.length > 0) {\n self.broadcast({\n type: 'update',\n ops: self.broadcastOpBuffer\n })\n self.broadcastOpBuffer = []\n }\n }\n if (this.broadcastOpBuffer.length === 0) {\n this.broadcastOpBuffer = ops\n if (this.y.db.transactionInProgress) {\n this.y.db.whenTransactionsFinished().then(broadcastOperations)\n } else {\n setTimeout(broadcastOperations, 0)\n }\n } else {\n this.broadcastOpBuffer = this.broadcastOpBuffer.concat(ops)\n }\n }\n /*\n You received a raw message, and you know that it is intended for Yjs. Then call this function.\n */\n receiveMessage (sender/* :UserId */, message/* :Message */) {\n if (sender === this.userId) {\n return Promise.resolve()\n }\n this.log('Receive \\'%s\\' from %s', message.type, sender)\n this.logMessage('Message: %j', message)\n if (message.protocolVersion != null && message.protocolVersion !== this.protocolVersion) {\n this.log(\n `You tried to sync with a yjs instance that has a different protocol version\n (You: ${this.protocolVersion}, Client: ${message.protocolVersion}).\n The sync was stopped. You need to upgrade your dependencies (especially Yjs & the Connector)!\n `)\n this.send(sender, {\n type: 'sync stop',\n protocolVersion: this.protocolVersion\n })\n return Promise.reject('Incompatible protocol version')\n }\n if (message.auth != null && this.connections[sender] != null) {\n // authenticate using auth in message\n var auth = this.checkAuth(message.auth, this.y, sender)\n this.connections[sender].auth = auth\n auth.then(auth => {\n for (var f of this.userEventListeners) {\n f({\n action: 'userAuthenticated',\n user: sender,\n auth: auth\n })\n }\n })\n } else if (this.connections[sender] != null && this.connections[sender].auth == null) {\n // authenticate without otherwise\n this.connections[sender].auth = this.checkAuth(null, this.y, sender)\n }\n if (this.connections[sender] != null && this.connections[sender].auth != null) {\n return this.connections[sender].auth.then((auth) => {\n if (message.type === 'sync step 1' && canRead(auth)) {\n let conn = this\n let m = message\n\n this.y.db.requestTransaction(function *() {\n var currentStateSet = yield* this.getStateSet()\n if (canWrite(auth)) {\n yield* this.applyDeleteSet(m.deleteSet)\n }\n\n var ds = yield* this.getDeleteSet()\n var answer = {\n type: 'sync step 2',\n stateSet: currentStateSet,\n deleteSet: ds,\n protocolVersion: this.protocolVersion,\n auth: this.authInfo\n }\n answer.os = yield* this.getOperations(m.stateSet)\n conn.send(sender, answer)\n if (this.forwardToSyncingClients) {\n conn.syncingClients.push(sender)\n setTimeout(function () {\n conn.syncingClients = conn.syncingClients.filter(function (cli) {\n return cli !== sender\n })\n conn.send(sender, {\n type: 'sync done'\n })\n }, 5000) // TODO: conn.syncingClientDuration)\n } else {\n conn.send(sender, {\n type: 'sync done'\n })\n }\n })\n } else if (message.type === 'sync step 2' && canWrite(auth)) {\n var db = this.y.db\n var defer = {}\n defer.promise = new Promise(function (resolve) {\n defer.resolve = resolve\n })\n this.syncStep2 = defer.promise\n let m /* :MessageSyncStep2 */ = message\n db.requestTransaction(function * () {\n yield* this.applyDeleteSet(m.deleteSet)\n if (m.osUntransformed != null) {\n yield* this.applyOperationsUntransformed(m.osUntransformed, m.stateSet)\n } else {\n this.store.apply(m.os)\n }\n /*\n * This just sends the complete hb after some time\n * Mostly for debugging..\n *\n db.requestTransaction(function * () {\n var ops = yield* this.getOperations(m.stateSet)\n if (ops.length > 0) {\n if (!broadcastHB) { // TODO: consider to broadcast here..\n conn.send(sender, {\n type: 'update',\n ops: ops\n })\n } else {\n // broadcast only once!\n conn.broadcastOps(ops)\n }\n }\n })\n */\n defer.resolve()\n })\n } else if (message.type === 'sync done') {\n var self = this\n this.syncStep2.then(function () {\n self._setSyncedWith(sender)\n })\n } else if (message.type === 'update' && canWrite(auth)) {\n if (this.forwardToSyncingClients) {\n for (var client of this.syncingClients) {\n this.send(client, message)\n }\n }\n if (this.y.db.forwardAppliedOperations) {\n var delops = message.ops.filter(function (o) {\n return o.struct === 'Delete'\n })\n if (delops.length > 0) {\n this.broadcastOps(delops)\n }\n }\n this.y.db.apply(message.ops)\n }\n })\n } else {\n return Promise.reject('Unable to deliver message')\n }\n }\n _setSyncedWith (user) {\n var conn = this.connections[user]\n if (conn != null) {\n conn.isSynced = true\n }\n if (user === this.currentSyncTarget) {\n this.currentSyncTarget = null\n this.findNextSyncTarget()\n }\n }\n /*\n Currently, the HB encodes operations as JSON. For the moment I want to keep it\n that way. Maybe we support encoding in the HB as XML in the future, but for now I don't want\n too much overhead. Y is very likely to get changed a lot in the future\n\n Because we don't want to encode JSON as string (with character escaping, wich makes it pretty much unreadable)\n we encode the JSON as XML.\n\n When the HB support encoding as XML, the format should look pretty much like this.\n\n does not support primitive values as array elements\n expects an ltx (less than xml) object\n */\n parseMessageFromXml (m/* :any */) {\n function parseArray (node) {\n for (var n of node.children) {\n if (n.getAttribute('isArray') === 'true') {\n return parseArray(n)\n } else {\n return parseObject(n)\n }\n }\n }\n function parseObject (node/* :any */) {\n var json = {}\n for (var attrName in node.attrs) {\n var value = node.attrs[attrName]\n var int = parseInt(value, 10)\n if (isNaN(int) || ('' + int) !== value) {\n json[attrName] = value\n } else {\n json[attrName] = int\n }\n }\n for (var n/* :any */ in node.children) {\n var name = n.name\n if (n.getAttribute('isArray') === 'true') {\n json[name] = parseArray(n)\n } else {\n json[name] = parseObject(n)\n }\n }\n return json\n }\n parseObject(m)\n }\n /*\n encode message in xml\n we use string because Strophe only accepts an \"xml-string\"..\n So {a:4,b:{c:5}} will look like\n <y a=\"4\">\n <b c=\"5\"></b>\n </y>\n m - ltx element\n json - Object\n */\n encodeMessageToXml (msg, obj) {\n // attributes is optional\n function encodeObject (m, json) {\n for (var name in json) {\n var value = json[name]\n if (name == null) {\n // nop\n } else if (value.constructor === Object) {\n encodeObject(m.c(name), value)\n } else if (value.constructor === Array) {\n encodeArray(m.c(name), value)\n } else {\n m.setAttribute(name, value)\n }\n }\n }\n function encodeArray (m, array) {\n m.setAttribute('isArray', 'true')\n for (var e of array) {\n if (e.constructor === Object) {\n encodeObject(m.c('array-element'), e)\n } else {\n encodeArray(m.c('array-element'), e)\n }\n }\n }\n if (obj.constructor === Object) {\n encodeObject(msg.c('y', { xmlns: 'http://y.ninja/connector-stanza' }), obj)\n } else if (obj.constructor === Array) {\n encodeArray(msg.c('y', { xmlns: 'http://y.ninja/connector-stanza' }), obj)\n } else {\n throw new Error(\"I can't encode this json!\")\n }\n }\n }\n Y.AbstractConnector = AbstractConnector\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/Connector.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/Connectors/Test.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/yjs/src/Connectors/Test.js ***!
|
||
\*************************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* global getRandom, async */\n\n\nmodule.exports = function (Y) {\n var globalRoom = {\n users: {},\n buffers: {},\n removeUser: function (user) {\n for (var i in this.users) {\n this.users[i].userLeft(user)\n }\n delete this.users[user]\n delete this.buffers[user]\n },\n addUser: function (connector) {\n this.users[connector.userId] = connector\n this.buffers[connector.userId] = {}\n for (var uname in this.users) {\n if (uname !== connector.userId) {\n var u = this.users[uname]\n u.userJoined(connector.userId, 'master')\n connector.userJoined(u.userId, 'master')\n }\n }\n },\n whenTransactionsFinished: function () {\n var self = this\n return new Promise(function (resolve, reject) {\n // The connector first has to send the messages to the db.\n // Wait for the checkAuth-function to resolve\n // The test lib only has a simple checkAuth function: `() => Promise.resolve()`\n // Just add a function to the event-queue, in order to wait for the event.\n // TODO: this may be buggy in test applications (but it isn't be for real-life apps)\n setTimeout(function () {\n var ps = []\n for (var name in self.users) {\n ps.push(self.users[name].y.db.whenTransactionsFinished())\n }\n Promise.all(ps).then(resolve, reject)\n }, 10)\n })\n },\n flushOne: function flushOne () {\n var bufs = []\n for (var receiver in globalRoom.buffers) {\n let buff = globalRoom.buffers[receiver]\n var push = false\n for (let sender in buff) {\n if (buff[sender].length > 0) {\n push = true\n break\n }\n }\n if (push) {\n bufs.push(receiver)\n }\n }\n if (bufs.length > 0) {\n var userId = getRandom(bufs)\n let buff = globalRoom.buffers[userId]\n let sender = getRandom(Object.keys(buff))\n var m = buff[sender].shift()\n if (buff[sender].length === 0) {\n delete buff[sender]\n }\n var user = globalRoom.users[userId]\n return user.receiveMessage(m[0], m[1]).then(function () {\n return user.y.db.whenTransactionsFinished()\n }, function () {})\n } else {\n return false\n }\n },\n flushAll: function () {\n return new Promise(function (resolve) {\n // flushes may result in more created operations,\n // flush until there is nothing more to flush\n function nextFlush () {\n var c = globalRoom.flushOne()\n if (c) {\n while (c) {\n c = globalRoom.flushOne()\n }\n globalRoom.whenTransactionsFinished().then(nextFlush)\n } else {\n c = globalRoom.flushOne()\n if (c) {\n c.then(function () {\n globalRoom.whenTransactionsFinished().then(nextFlush)\n })\n } else {\n resolve()\n }\n }\n }\n globalRoom.whenTransactionsFinished().then(nextFlush)\n })\n }\n }\n Y.utils.globalRoom = globalRoom\n\n var userIdCounter = 0\n\n class Test extends Y.AbstractConnector {\n constructor (y, options) {\n if (options === undefined) {\n throw new Error('Options must not be undefined!')\n }\n options.role = 'master'\n options.forwardToSyncingClients = false\n super(y, options)\n this.setUserId((userIdCounter++) + '').then(() => {\n globalRoom.addUser(this)\n })\n this.globalRoom = globalRoom\n this.syncingClientDuration = 0\n }\n receiveMessage (sender, m) {\n return super.receiveMessage(sender, JSON.parse(JSON.stringify(m)))\n }\n send (userId, message) {\n var buffer = globalRoom.buffers[userId]\n if (buffer != null) {\n if (buffer[this.userId] == null) {\n buffer[this.userId] = []\n }\n buffer[this.userId].push(JSON.parse(JSON.stringify([this.userId, message])))\n }\n }\n broadcast (message) {\n for (var key in globalRoom.buffers) {\n var buff = globalRoom.buffers[key]\n if (buff[this.userId] == null) {\n buff[this.userId] = []\n }\n buff[this.userId].push(JSON.parse(JSON.stringify([this.userId, message])))\n }\n }\n isDisconnected () {\n return globalRoom.users[this.userId] == null\n }\n reconnect () {\n if (this.isDisconnected()) {\n globalRoom.addUser(this)\n super.reconnect()\n }\n return Y.utils.globalRoom.flushAll()\n }\n disconnect () {\n var waitForMe = Promise.resolve()\n if (!this.isDisconnected()) {\n globalRoom.removeUser(this.userId)\n waitForMe = super.disconnect()\n }\n var self = this\n return waitForMe.then(function () {\n return self.y.db.whenTransactionsFinished()\n })\n }\n flush () {\n var self = this\n return async(function * () {\n var buff = globalRoom.buffers[self.userId]\n while (Object.keys(buff).length > 0) {\n var sender = getRandom(Object.keys(buff))\n var m = buff[sender].shift()\n if (buff[sender].length === 0) {\n delete buff[sender]\n }\n yield this.receiveMessage(m[0], m[1])\n }\n yield self.whenTransactionsFinished()\n })\n }\n }\n\n Y.Test = Test\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/Connectors/Test.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/Database.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/yjs/src/Database.js ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* @flow */\n\n\nmodule.exports = function (Y /* :any */) {\n /*\n Partial definition of an OperationStore.\n TODO: name it Database, operation store only holds operations.\n\n A database definition must alse define the following methods:\n * logTable() (optional)\n - show relevant information information in a table\n * requestTransaction(makeGen)\n - request a transaction\n * destroy()\n - destroy the database\n */\n class AbstractDatabase {\n /* ::\n y: YConfig;\n forwardAppliedOperations: boolean;\n listenersById: Object;\n listenersByIdExecuteNow: Array<Object>;\n listenersByIdRequestPending: boolean;\n initializedTypes: Object;\n whenUserIdSetListener: ?Function;\n waitingTransactions: Array<Transaction>;\n transactionInProgress: boolean;\n executeOrder: Array<Object>;\n gc1: Array<Struct>;\n gc2: Array<Struct>;\n gcTimeout: number;\n gcInterval: any;\n garbageCollect: Function;\n executeOrder: Array<any>; // for debugging only\n userId: UserId;\n opClock: number;\n transactionsFinished: ?{promise: Promise, resolve: any};\n transact: (x: ?Generator) => any;\n */\n constructor (y, opts) {\n this.y = y\n this.dbOpts = opts\n var os = this\n this.userId = null\n var resolve\n this.userIdPromise = new Promise(function (r) {\n resolve = r\n })\n this.userIdPromise.resolve = resolve\n // whether to broadcast all applied operations (insert & delete hook)\n this.forwardAppliedOperations = false\n // E.g. this.listenersById[id] : Array<Listener>\n this.listenersById = {}\n // Execute the next time a transaction is requested\n this.listenersByIdExecuteNow = []\n // A transaction is requested\n this.listenersByIdRequestPending = false\n /* To make things more clear, the following naming conventions:\n * ls : we put this.listenersById on ls\n * l : Array<Listener>\n * id : Id (can't use as property name)\n * sid : String (converted from id via JSON.stringify\n so we can use it as a property name)\n\n Always remember to first overwrite\n a property before you iterate over it!\n */\n // TODO: Use ES7 Weak Maps. This way types that are no longer user,\n // wont be kept in memory.\n this.initializedTypes = {}\n this.waitingTransactions = []\n this.transactionInProgress = false\n this.transactionIsFlushed = false\n if (typeof YConcurrency_TestingMode !== 'undefined') {\n this.executeOrder = []\n }\n this.gc1 = [] // first stage\n this.gc2 = [] // second stage -> after that, remove the op\n\n function garbageCollect () {\n return os.whenTransactionsFinished().then(function () {\n if (os.gc1.length > 0 || os.gc2.length > 0) {\n if (!os.y.connector.isSynced) {\n console.warn('gc should be empty when not synced!')\n }\n return new Promise((resolve) => {\n os.requestTransaction(function * () {\n if (os.y.connector != null && os.y.connector.isSynced) {\n for (var i = 0; i < os.gc2.length; i++) {\n var oid = os.gc2[i]\n yield* this.garbageCollectOperation(oid)\n }\n os.gc2 = os.gc1\n os.gc1 = []\n }\n // TODO: Use setInterval here instead (when garbageCollect is called several times there will be several timeouts..)\n if (os.gcTimeout > 0) {\n os.gcInterval = setTimeout(garbageCollect, os.gcTimeout)\n }\n resolve()\n })\n })\n } else {\n // TODO: see above\n if (os.gcTimeout > 0) {\n os.gcInterval = setTimeout(garbageCollect, os.gcTimeout)\n }\n return Promise.resolve()\n }\n })\n }\n this.garbageCollect = garbageCollect\n this.startGarbageCollector()\n\n this.repairCheckInterval = !opts.repairCheckInterval ? 6000 : opts.repairCheckInterval\n this.opsReceivedTimestamp = new Date()\n this.startRepairCheck()\n }\n startGarbageCollector () {\n this.gc = this.dbOpts.gc == null || this.dbOpts.gc\n if (this.gc) {\n this.gcTimeout = !this.dbOpts.gcTimeout ? 50000 : this.dbOpts.gcTimeout\n } else {\n this.gcTimeout = -1\n }\n if (this.gcTimeout > 0) {\n this.garbageCollect()\n }\n }\n startRepairCheck () {\n var os = this\n if (this.repairCheckInterval > 0) {\n this.repairCheckIntervalHandler = setInterval(function repairOnMissingOperations () {\n /*\n Case 1. No ops have been received in a while (new Date() - os.opsReceivedTimestamp > os.repairCheckInterval)\n - 1.1 os.listenersById is empty. Then the state was correct the whole time. -> Nothing to do (nor to update)\n - 1.2 os.listenersById is not empty.\n * Then the state was incorrect for at least {os.repairCheckInterval} seconds.\n * -> Remove everything in os.listenersById and sync again (connector.repair())\n Case 2. An op has been received in the last {os.repairCheckInterval } seconds.\n It is not yet necessary to check for faulty behavior. Everything can still resolve itself. Wait for more messages.\n If nothing was received for a while and os.listenersById is still not emty, we are in case 1.2\n -> Do nothing\n\n Baseline here is: we really only have to catch case 1.2..\n */\n if (\n new Date() - os.opsReceivedTimestamp > os.repairCheckInterval &&\n Object.keys(os.listenersById).length > 0 // os.listenersById is not empty\n ) {\n // haven't received operations for over {os.repairCheckInterval} seconds, resend state vector\n os.listenersById = {}\n os.opsReceivedTimestamp = new Date() // update so you don't send repair several times in a row\n os.y.connector.repair()\n }\n }, this.repairCheckInterval)\n }\n }\n stopRepairCheck () {\n clearInterval(this.repairCheckIntervalHandler)\n }\n queueGarbageCollector (id) {\n if (this.y.connector.isSynced && this.gc) {\n this.gc1.push(id)\n }\n }\n emptyGarbageCollector () {\n return new Promise(resolve => {\n var check = () => {\n if (this.gc1.length > 0 || this.gc2.length > 0) {\n this.garbageCollect().then(check)\n } else {\n resolve()\n }\n }\n setTimeout(check, 0)\n })\n }\n addToDebug () {\n if (typeof YConcurrency_TestingMode !== 'undefined') {\n var command /* :string */ = Array.prototype.map.call(arguments, function (s) {\n if (typeof s === 'string') {\n return s\n } else {\n return JSON.stringify(s)\n }\n }).join('').replace(/\"/g, \"'\").replace(/,/g, ', ').replace(/:/g, ': ')\n this.executeOrder.push(command)\n }\n }\n getDebugData () {\n console.log(this.executeOrder.join('\\n'))\n }\n stopGarbageCollector () {\n var self = this\n this.gc = false\n this.gcTimeout = -1\n return new Promise(function (resolve) {\n self.requestTransaction(function * () {\n var ungc /* :Array<Struct> */ = self.gc1.concat(self.gc2)\n self.gc1 = []\n self.gc2 = []\n for (var i = 0; i < ungc.length; i++) {\n var op = yield* this.getOperation(ungc[i])\n if (op != null) {\n delete op.gc\n yield* this.setOperation(op)\n }\n }\n resolve()\n })\n })\n }\n /*\n Try to add to GC.\n\n TODO: rename this function\n\n Rulez:\n * Only gc if this user is online & gc turned on\n * The most left element in a list must not be gc'd.\n => There is at least one element in the list\n\n returns true iff op was added to GC\n */\n * addToGarbageCollector (op, left) {\n if (\n op.gc == null &&\n op.deleted === true &&\n this.store.gc &&\n this.store.y.connector.isSynced\n ) {\n var gc = false\n if (left != null && left.deleted === true) {\n gc = true\n } else if (op.content != null && op.content.length > 1) {\n op = yield* this.getInsertionCleanStart([op.id[0], op.id[1] + 1])\n gc = true\n }\n if (gc) {\n op.gc = true\n yield* this.setOperation(op)\n this.store.queueGarbageCollector(op.id)\n return true\n }\n }\n return false\n }\n removeFromGarbageCollector (op) {\n function filter (o) {\n return !Y.utils.compareIds(o, op.id)\n }\n this.gc1 = this.gc1.filter(filter)\n this.gc2 = this.gc2.filter(filter)\n delete op.gc\n }\n destroyTypes () {\n for (var key in this.initializedTypes) {\n var type = this.initializedTypes[key]\n if (type._destroy != null) {\n type._destroy()\n } else {\n console.error('The type you included does not provide destroy functionality, it will remain in memory (updating your packages will help).')\n }\n }\n }\n * destroy () {\n clearInterval(this.gcInterval)\n this.gcInterval = null\n this.stopRepairCheck()\n }\n setUserId (userId) {\n if (!this.userIdPromise.inProgress) {\n this.userIdPromise.inProgress = true\n var self = this\n self.requestTransaction(function * () {\n self.userId = userId\n var state = yield* this.getState(userId)\n self.opClock = state.clock\n self.userIdPromise.resolve(userId)\n })\n }\n return this.userIdPromise\n }\n whenUserIdSet (f) {\n this.userIdPromise.then(f)\n }\n getNextOpId (numberOfIds) {\n if (numberOfIds == null) {\n throw new Error('getNextOpId expects the number of created ids to create!')\n } else if (this.userId == null) {\n throw new Error('OperationStore not yet initialized!')\n } else {\n var id = [this.userId, this.opClock]\n this.opClock += numberOfIds\n return id\n }\n }\n /*\n Apply a list of operations.\n\n * we save a timestamp, because we received new operations that could resolve ops in this.listenersById (see this.startRepairCheck)\n * get a transaction\n * check whether all Struct.*.requiredOps are in the OS\n * check if it is an expected op (otherwise wait for it)\n * check if was deleted, apply a delete operation after op was applied\n */\n apply (ops) {\n this.opsReceivedTimestamp = new Date()\n for (var i = 0; i < ops.length; i++) {\n var o = ops[i]\n if (o.id == null || o.id[0] !== this.y.connector.userId) {\n var required = Y.Struct[o.struct].requiredOps(o)\n if (o.requires != null) {\n required = required.concat(o.requires)\n }\n this.whenOperationsExist(required, o)\n }\n }\n }\n /*\n op is executed as soon as every operation requested is available.\n Note that Transaction can (and should) buffer requests.\n */\n whenOperationsExist (ids, op) {\n if (ids.length > 0) {\n let listener = {\n op: op,\n missing: ids.length\n }\n\n for (let i = 0; i < ids.length; i++) {\n let id = ids[i]\n let sid = JSON.stringify(id)\n let l = this.listenersById[sid]\n if (l == null) {\n l = []\n this.listenersById[sid] = l\n }\n l.push(listener)\n }\n } else {\n this.listenersByIdExecuteNow.push({\n op: op\n })\n }\n\n if (this.listenersByIdRequestPending) {\n return\n }\n\n this.listenersByIdRequestPending = true\n var store = this\n\n this.requestTransaction(function * () {\n var exeNow = store.listenersByIdExecuteNow\n store.listenersByIdExecuteNow = []\n\n var ls = store.listenersById\n store.listenersById = {}\n\n store.listenersByIdRequestPending = false\n\n for (let key = 0; key < exeNow.length; key++) {\n let o = exeNow[key].op\n yield* store.tryExecute.call(this, o)\n }\n\n for (var sid in ls) {\n var l = ls[sid]\n var id = JSON.parse(sid)\n var op\n if (typeof id[1] === 'string') {\n op = yield* this.getOperation(id)\n } else {\n op = yield* this.getInsertion(id)\n }\n if (op == null) {\n store.listenersById[sid] = l\n } else {\n for (let i = 0; i < l.length; i++) {\n let listener = l[i]\n let o = listener.op\n if (--listener.missing === 0) {\n yield* store.tryExecute.call(this, o)\n }\n }\n }\n }\n })\n }\n /*\n Actually execute an operation, when all expected operations are available.\n */\n /* :: // TODO: this belongs somehow to transaction\n store: Object;\n getOperation: any;\n isGarbageCollected: any;\n addOperation: any;\n whenOperationsExist: any;\n */\n * tryExecute (op) {\n this.store.addToDebug('yield* this.store.tryExecute.call(this, ', JSON.stringify(op), ')')\n if (op.struct === 'Delete') {\n yield* Y.Struct.Delete.execute.call(this, op)\n // this is now called in Transaction.deleteOperation!\n // yield* this.store.operationAdded(this, op)\n } else {\n // check if this op was defined\n var defined = yield* this.getInsertion(op.id)\n while (defined != null && defined.content != null) {\n // check if this op has a longer content in the case it is defined\n if (defined.id[1] + defined.content.length < op.id[1] + op.content.length) {\n var overlapSize = defined.content.length - (op.id[1] - defined.id[1])\n op.content.splice(0, overlapSize)\n op.id = [op.id[0], op.id[1] + overlapSize]\n op.left = Y.utils.getLastId(defined)\n op.origin = op.left\n defined = yield* this.getOperation(op.id) // getOperation suffices here\n } else {\n break\n }\n }\n if (defined == null) {\n var opid = op.id\n var isGarbageCollected = yield* this.isGarbageCollected(opid)\n if (!isGarbageCollected) {\n // TODO: reduce number of get / put calls for op ..\n yield* Y.Struct[op.struct].execute.call(this, op)\n yield* this.addOperation(op)\n yield* this.store.operationAdded(this, op)\n // operationAdded can change op..\n op = yield* this.getOperation(opid)\n // if insertion, try to combine with left\n yield* this.tryCombineWithLeft(op)\n }\n }\n }\n }\n /*\n * Called by a transaction when an operation is added.\n * This function is especially important for y-indexeddb, where several instances may share a single database.\n * Every time an operation is created by one instance, it is send to all other instances and operationAdded is called\n *\n * If it's not a Delete operation:\n * * Checks if another operation is executable (listenersById)\n * * Update state, if possible\n *\n * Always:\n * * Call type\n */\n * operationAdded (transaction, op) {\n if (op.struct === 'Delete') {\n var type = this.initializedTypes[JSON.stringify(op.targetParent)]\n if (type != null) {\n yield* type._changed(transaction, op)\n }\n } else {\n // increase SS\n yield* transaction.updateState(op.id[0])\n var opLen = op.content != null ? op.content.length : 1\n for (let i = 0; i < opLen; i++) {\n // notify whenOperation listeners (by id)\n var sid = JSON.stringify([op.id[0], op.id[1] + i])\n var l = this.listenersById[sid]\n delete this.listenersById[sid]\n if (l != null) {\n for (var key in l) {\n var listener = l[key]\n if (--listener.missing === 0) {\n this.whenOperationsExist([], listener.op)\n }\n }\n }\n }\n var t = this.initializedTypes[JSON.stringify(op.parent)]\n\n // if parent is deleted, mark as gc'd and return\n if (op.parent != null) {\n var parentIsDeleted = yield* transaction.isDeleted(op.parent)\n if (parentIsDeleted) {\n yield* transaction.deleteList(op.id)\n return\n }\n }\n\n // notify parent, if it was instanciated as a custom type\n if (t != null) {\n let o = Y.utils.copyOperation(op)\n yield* t._changed(transaction, o)\n }\n if (!op.deleted) {\n // Delete if DS says this is actually deleted\n var len = op.content != null ? op.content.length : 1\n var startId = op.id // You must not use op.id in the following loop, because op will change when deleted\n // TODO: !! console.log('TODO: change this before commiting')\n for (let i = 0; i < len; i++) {\n var id = [startId[0], startId[1] + i]\n var opIsDeleted = yield* transaction.isDeleted(id)\n if (opIsDeleted) {\n var delop = {\n struct: 'Delete',\n target: id\n }\n yield* this.tryExecute.call(transaction, delop)\n }\n }\n }\n }\n }\n whenTransactionsFinished () {\n if (this.transactionInProgress) {\n if (this.transactionsFinished == null) {\n var resolve\n var promise = new Promise(function (r) {\n resolve = r\n })\n this.transactionsFinished = {\n resolve: resolve,\n promise: promise\n }\n }\n return this.transactionsFinished.promise\n } else {\n return Promise.resolve()\n }\n }\n // Check if there is another transaction request.\n // * the last transaction is always a flush :)\n getNextRequest () {\n if (this.waitingTransactions.length === 0) {\n if (this.transactionIsFlushed) {\n this.transactionInProgress = false\n this.transactionIsFlushed = false\n if (this.transactionsFinished != null) {\n this.transactionsFinished.resolve()\n this.transactionsFinished = null\n }\n return null\n } else {\n this.transactionIsFlushed = true\n return function * () {\n yield* this.flush()\n }\n }\n } else {\n this.transactionIsFlushed = false\n return this.waitingTransactions.shift()\n }\n }\n requestTransaction (makeGen/* :any */, callImmediately) {\n this.waitingTransactions.push(makeGen)\n if (!this.transactionInProgress) {\n this.transactionInProgress = true\n setTimeout(() => {\n this.transact(this.getNextRequest())\n }, 0)\n }\n }\n /*\n Get a created/initialized type.\n */\n getType (id) {\n return this.initializedTypes[JSON.stringify(id)]\n }\n /*\n Init type. This is called when a remote operation is retrieved, and transformed to a type\n TODO: delete type from store.initializedTypes[id] when corresponding id was deleted!\n */\n * initType (id, args) {\n var sid = JSON.stringify(id)\n var t = this.store.initializedTypes[sid]\n if (t == null) {\n var op/* :MapStruct | ListStruct */ = yield* this.getOperation(id)\n if (op != null) {\n t = yield* Y[op.type].typeDefinition.initType.call(this, this.store, op, args)\n this.store.initializedTypes[sid] = t\n }\n }\n return t\n }\n /*\n Create type. This is called when the local user creates a type (which is a synchronous action)\n */\n createType (typedefinition, id) {\n var structname = typedefinition[0].struct\n id = id || this.getNextOpId(1)\n var op = Y.Struct[structname].create(id)\n op.type = typedefinition[0].name\n\n this.requestTransaction(function * () {\n if (op.id[0] === '_') {\n yield* this.setOperation(op)\n } else {\n yield* this.applyCreatedOperations([op])\n }\n })\n var t = Y[op.type].typeDefinition.createType(this, op, typedefinition[1])\n this.initializedTypes[JSON.stringify(op.id)] = t\n return t\n }\n }\n Y.AbstractDatabase = AbstractDatabase\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/Database.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/Struct.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/yjs/src/Struct.js ***!
|
||
\****************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* @flow */\n\n\n/*\n An operation also defines the structure of a type. This is why operation and\n structure are used interchangeably here.\n\n It must be of the type Object. I hope to achieve some performance\n improvements when working on databases that support the json format.\n\n An operation must have the following properties:\n\n * encode\n - Encode the structure in a readable format (preferably string- todo)\n * decode (todo)\n - decode structure to json\n * execute\n - Execute the semantics of an operation.\n * requiredOps\n - Operations that are required to execute this operation.\n*/\nmodule.exports = function (Y/* :any */) {\n var Struct = {\n /* This is the only operation that is actually not a structure, because\n it is not stored in the OS. This is why it _does not_ have an id\n\n op = {\n target: Id\n }\n */\n Delete: {\n encode: function (op) {\n return {\n target: op.target,\n length: op.length || 0,\n struct: 'Delete'\n }\n },\n requiredOps: function (op) {\n return [] // [op.target]\n },\n execute: function * (op) {\n return yield* this.deleteOperation(op.target, op.length || 1)\n }\n },\n Insert: {\n /* {\n content: [any],\n opContent: Id,\n id: Id,\n left: Id,\n origin: Id,\n right: Id,\n parent: Id,\n parentSub: string (optional), // child of Map type\n }\n */\n encode: function (op/* :Insertion */) /* :Insertion */ {\n // TODO: you could not send the \"left\" property, then you also have to\n // \"op.left = null\" in $execute or $decode\n var e/* :any */ = {\n id: op.id,\n left: op.left,\n right: op.right,\n origin: op.origin,\n parent: op.parent,\n struct: op.struct\n }\n if (op.parentSub != null) {\n e.parentSub = op.parentSub\n }\n if (op.hasOwnProperty('opContent')) {\n e.opContent = op.opContent\n } else {\n e.content = op.content.slice()\n }\n\n return e\n },\n requiredOps: function (op) {\n var ids = []\n if (op.left != null) {\n ids.push(op.left)\n }\n if (op.right != null) {\n ids.push(op.right)\n }\n if (op.origin != null && !Y.utils.compareIds(op.left, op.origin)) {\n ids.push(op.origin)\n }\n // if (op.right == null && op.left == null) {\n ids.push(op.parent)\n\n if (op.opContent != null) {\n ids.push(op.opContent)\n }\n return ids\n },\n getDistanceToOrigin: function * (op) {\n if (op.left == null) {\n return 0\n } else {\n var d = 0\n var o = yield* this.getInsertion(op.left)\n while (!Y.utils.matchesId(o, op.origin)) {\n d++\n if (o.left == null) {\n break\n } else {\n o = yield* this.getInsertion(o.left)\n }\n }\n return d\n }\n },\n /*\n # $this has to find a unique position between origin and the next known character\n # case 1: $origin equals $o.origin: the $creator parameter decides if left or right\n # let $OL= [o1,o2,o3,o4], whereby $this is to be inserted between o1 and o4\n # o2,o3 and o4 origin is 1 (the position of o2)\n # there is the case that $this.creator < o2.creator, but o3.creator < $this.creator\n # then o2 knows o3. Since on another client $OL could be [o1,o3,o4] the problem is complex\n # therefore $this would be always to the right of o3\n # case 2: $origin < $o.origin\n # if current $this insert_position > $o origin: $this ins\n # else $insert_position will not change\n # (maybe we encounter case 1 later, then this will be to the right of $o)\n # case 3: $origin > $o.origin\n # $this insert_position is to the left of $o (forever!)\n */\n execute: function * (op) {\n var i // loop counter\n\n // during this function some ops may get split into two pieces (e.g. with getInsertionCleanEnd)\n // We try to merge them later, if possible\n var tryToRemergeLater = []\n\n if (op.origin != null) { // TODO: !== instead of !=\n // we save in origin that op originates in it\n // we need that later when we eventually garbage collect origin (see transaction)\n var origin = yield* this.getInsertionCleanEnd(op.origin)\n if (origin.originOf == null) {\n origin.originOf = []\n }\n origin.originOf.push(op.id)\n yield* this.setOperation(origin)\n if (origin.right != null) {\n tryToRemergeLater.push(origin.right)\n }\n }\n var distanceToOrigin = i = yield* Struct.Insert.getDistanceToOrigin.call(this, op) // most cases: 0 (starts from 0)\n\n // now we begin to insert op in the list of insertions..\n var o\n var parent\n var start\n\n // find o. o is the first conflicting operation\n if (op.left != null) {\n o = yield* this.getInsertionCleanEnd(op.left)\n if (!Y.utils.compareIds(op.left, op.origin) && o.right != null) {\n // only if not added previously\n tryToRemergeLater.push(o.right)\n }\n o = (o.right == null) ? null : yield* this.getOperation(o.right)\n } else { // left == null\n parent = yield* this.getOperation(op.parent)\n let startId = op.parentSub ? parent.map[op.parentSub] : parent.start\n start = startId == null ? null : yield* this.getOperation(startId)\n o = start\n }\n\n // make sure to split op.right if necessary (also add to tryCombineWithLeft)\n if (op.right != null) {\n tryToRemergeLater.push(op.right)\n yield* this.getInsertionCleanStart(op.right)\n }\n\n // handle conflicts\n while (true) {\n if (o != null && !Y.utils.compareIds(o.id, op.right)) {\n var oOriginDistance = yield* Struct.Insert.getDistanceToOrigin.call(this, o)\n if (oOriginDistance === i) {\n // case 1\n if (o.id[0] < op.id[0]) {\n op.left = Y.utils.getLastId(o)\n distanceToOrigin = i + 1 // just ignore o.content.length, doesn't make a difference\n }\n } else if (oOriginDistance < i) {\n // case 2\n if (i - distanceToOrigin <= oOriginDistance) {\n op.left = Y.utils.getLastId(o)\n distanceToOrigin = i + 1 // just ignore o.content.length, doesn't make a difference\n }\n } else {\n break\n }\n i++\n if (o.right != null) {\n o = yield* this.getInsertion(o.right)\n } else {\n o = null\n }\n } else {\n break\n }\n }\n\n // reconnect..\n var left = null\n var right = null\n if (parent == null) {\n parent = yield* this.getOperation(op.parent)\n }\n\n // reconnect left and set right of op\n if (op.left != null) {\n left = yield* this.getInsertion(op.left)\n // link left\n op.right = left.right\n left.right = op.id\n\n yield* this.setOperation(left)\n } else {\n // set op.right from parent, if necessary\n op.right = op.parentSub ? parent.map[op.parentSub] || null : parent.start\n }\n // reconnect right\n if (op.right != null) {\n // TODO: wanna connect right too?\n right = yield* this.getOperation(op.right)\n right.left = Y.utils.getLastId(op)\n\n // if right exists, and it is supposed to be gc'd. Remove it from the gc\n if (right.gc != null) {\n if (right.content != null && right.content.length > 1) {\n right = yield* this.getInsertionCleanEnd(right.id)\n }\n this.store.removeFromGarbageCollector(right)\n }\n yield* this.setOperation(right)\n }\n\n // update parents .map/start/end properties\n if (op.parentSub != null) {\n if (left == null) {\n parent.map[op.parentSub] = op.id\n yield* this.setOperation(parent)\n }\n // is a child of a map struct.\n // Then also make sure that only the most left element is not deleted\n // We do not call the type in this case (this is what the third parameter is for)\n if (op.right != null) {\n yield* this.deleteOperation(op.right, 1, true)\n }\n if (op.left != null) {\n yield* this.deleteOperation(op.id, 1, true)\n }\n } else {\n if (right == null || left == null) {\n if (right == null) {\n parent.end = Y.utils.getLastId(op)\n }\n if (left == null) {\n parent.start = op.id\n }\n yield* this.setOperation(parent)\n }\n }\n\n // try to merge original op.left and op.origin\n for (i = 0; i < tryToRemergeLater.length; i++) {\n var m = yield* this.getOperation(tryToRemergeLater[i])\n yield* this.tryCombineWithLeft(m)\n }\n }\n },\n List: {\n /*\n {\n start: null,\n end: null,\n struct: \"List\",\n type: \"\",\n id: this.os.getNextOpId(1)\n }\n */\n create: function (id) {\n return {\n start: null,\n end: null,\n struct: 'List',\n id: id\n }\n },\n encode: function (op) {\n var e = {\n struct: 'List',\n id: op.id,\n type: op.type\n }\n if (op.requires != null) {\n e.requires = op.requires\n }\n if (op.info != null) {\n e.info = op.info\n }\n return e\n },\n requiredOps: function () {\n /*\n var ids = []\n if (op.start != null) {\n ids.push(op.start)\n }\n if (op.end != null){\n ids.push(op.end)\n }\n return ids\n */\n return []\n },\n execute: function * (op) {\n op.start = null\n op.end = null\n },\n ref: function * (op, pos) {\n if (op.start == null) {\n return null\n }\n var res = null\n var o = yield* this.getOperation(op.start)\n\n while (true) {\n if (!o.deleted) {\n res = o\n pos--\n }\n if (pos >= 0 && o.right != null) {\n o = yield* this.getOperation(o.right)\n } else {\n break\n }\n }\n return res\n },\n map: function * (o, f) {\n o = o.start\n var res = []\n while (o != null) { // TODO: change to != (at least some convention)\n var operation = yield* this.getOperation(o)\n if (!operation.deleted) {\n res.push(f(operation))\n }\n o = operation.right\n }\n return res\n }\n },\n Map: {\n /*\n {\n map: {},\n struct: \"Map\",\n type: \"\",\n id: this.os.getNextOpId(1)\n }\n */\n create: function (id) {\n return {\n id: id,\n map: {},\n struct: 'Map'\n }\n },\n encode: function (op) {\n var e = {\n struct: 'Map',\n type: op.type,\n id: op.id,\n map: {} // overwrite map!!\n }\n if (op.requires != null) {\n e.requires = op.requires\n }\n if (op.info != null) {\n e.info = op.info\n }\n return e\n },\n requiredOps: function () {\n return []\n },\n execute: function * () {},\n /*\n Get a property by name\n */\n get: function * (op, name) {\n var oid = op.map[name]\n if (oid != null) {\n var res = yield* this.getOperation(oid)\n if (res == null || res.deleted) {\n return void 0\n } else if (res.opContent == null) {\n return res.content[0]\n } else {\n return yield* this.getType(res.opContent)\n }\n }\n }\n }\n }\n Y.Struct = Struct\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/Struct.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/Transaction.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/yjs/src/Transaction.js ***!
|
||
\*********************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* @flow */\n\n\n/*\n Partial definition of a transaction\n\n A transaction provides all the the async functionality on a database.\n\n By convention, a transaction has the following properties:\n * ss for StateSet\n * os for OperationStore\n * ds for DeleteStore\n\n A transaction must also define the following methods:\n * checkDeleteStoreForState(state)\n - When increasing the state of a user, an operation with an higher id\n may already be garbage collected, and therefore it will never be received.\n update the state to reflect this knowledge. This won't call a method to save the state!\n * getDeleteSet(id)\n - Get the delete set in a readable format:\n {\n \"userX\": [\n [5,1], // starting from position 5, one operations is deleted\n [9,4] // starting from position 9, four operations are deleted\n ],\n \"userY\": ...\n }\n * getOpsFromDeleteSet(ds) -- TODO: just call this.deleteOperation(id) here\n - get a set of deletions that need to be applied in order to get to\n achieve the state of the supplied ds\n * setOperation(op)\n - write `op` to the database.\n Note: this is allowed to return an in-memory object.\n E.g. the Memory adapter returns the object that it has in-memory.\n Changing values on this object will be stored directly in the database\n without calling this function. Therefore,\n setOperation may have no functionality in some adapters. This also has\n implications on the way we use operations that were served from the database.\n We try not to call copyObject, if not necessary.\n * addOperation(op)\n - add an operation to the database.\n This may only be called once for every op.id\n Must return a function that returns the next operation in the database (ordered by id)\n * getOperation(id)\n * removeOperation(id)\n - remove an operation from the database. This is called when an operation\n is garbage collected.\n * setState(state)\n - `state` is of the form\n {\n user: \"1\",\n clock: 4\n } <- meaning that we have four operations from user \"1\"\n (with these id's respectively: 0, 1, 2, and 3)\n * getState(user)\n * getStateVector()\n - Get the state of the OS in the form\n [{\n user: \"userX\",\n clock: 11\n },\n ..\n ]\n * getStateSet()\n - Get the state of the OS in the form\n {\n \"userX\": 11,\n \"userY\": 22\n }\n * getOperations(startSS)\n - Get the all the operations that are necessary in order to achive the\n stateSet of this user, starting from a stateSet supplied by another user\n * makeOperationReady(ss, op)\n - this is called only by `getOperations(startSS)`. It makes an operation\n applyable on a given SS.\n*/\nmodule.exports = function (Y/* :any */) {\n class TransactionInterface {\n /* ::\n store: Y.AbstractDatabase;\n ds: Store;\n os: Store;\n ss: Store;\n */\n /*\n Apply operations that this user created (no remote ones!)\n * does not check for Struct.*.requiredOps()\n * also broadcasts it through the connector\n */\n * applyCreatedOperations (ops) {\n var send = []\n for (var i = 0; i < ops.length; i++) {\n var op = ops[i]\n yield* this.store.tryExecute.call(this, op)\n if (op.id == null || typeof op.id[1] !== 'string') {\n send.push(Y.Struct[op.struct].encode(op))\n }\n }\n if (send.length > 0) { // TODO: && !this.store.forwardAppliedOperations (but then i don't send delete ops)\n // is connected, and this is not going to be send in addOperation\n this.store.y.connector.broadcastOps(send)\n }\n }\n\n * deleteList (start) {\n while (start != null) {\n start = yield* this.getOperation(start)\n if (!start.gc) {\n start.gc = true\n start.deleted = true\n yield* this.setOperation(start)\n var delLength = start.content != null ? start.content.length : 1\n yield* this.markDeleted(start.id, delLength)\n if (start.opContent != null) {\n yield* this.deleteOperation(start.opContent)\n }\n this.store.queueGarbageCollector(start.id)\n }\n start = start.right\n }\n }\n\n /*\n Mark an operation as deleted, and add it to the GC, if possible.\n */\n * deleteOperation (targetId, length, preventCallType) /* :Generator<any, any, any> */ {\n if (length == null) {\n length = 1\n }\n yield* this.markDeleted(targetId, length)\n while (length > 0) {\n var callType = false\n var target = yield* this.os.findWithUpperBound([targetId[0], targetId[1] + length - 1])\n var targetLength = target != null && target.content != null ? target.content.length : 1\n if (target == null || target.id[0] !== targetId[0] || target.id[1] + targetLength <= targetId[1]) {\n // does not exist or is not in the range of the deletion\n target = null\n length = 0\n } else {\n // does exist, check if it is too long\n if (!target.deleted) {\n if (target.id[1] < targetId[1]) {\n // starts to the left of the deletion range\n target = yield* this.getInsertionCleanStart(targetId)\n targetLength = target.content.length // must have content property!\n }\n if (target.id[1] + targetLength > targetId[1] + length) {\n // ends to the right of the deletion range\n target = yield* this.getInsertionCleanEnd([targetId[0], targetId[1] + length - 1])\n targetLength = target.content.length\n }\n }\n length = target.id[1] - targetId[1]\n }\n\n if (target != null) {\n if (!target.deleted) {\n callType = true\n // set deleted & notify type\n target.deleted = true\n // delete containing lists\n if (target.start != null) {\n // TODO: don't do it like this .. -.-\n yield* this.deleteList(target.start)\n // yield* this.deleteList(target.id) -- do not gc itself because this may still get referenced\n }\n if (target.map != null) {\n for (var name in target.map) {\n yield* this.deleteList(target.map[name])\n }\n // TODO: here to.. (see above)\n // yield* this.deleteList(target.id) -- see above\n }\n if (target.opContent != null) {\n yield* this.deleteOperation(target.opContent)\n // target.opContent = null\n }\n if (target.requires != null) {\n for (var i = 0; i < target.requires.length; i++) {\n yield* this.deleteOperation(target.requires[i])\n }\n }\n }\n var left\n if (target.left != null) {\n left = yield* this.getInsertion(target.left)\n } else {\n left = null\n }\n\n // set here because it was deleted and/or gc'd\n yield* this.setOperation(target)\n\n /*\n Check if it is possible to add right to the gc.\n Because this delete can't be responsible for left being gc'd,\n we don't have to add left to the gc..\n */\n var right\n if (target.right != null) {\n right = yield* this.getOperation(target.right)\n } else {\n right = null\n }\n if (callType && !preventCallType) {\n yield* this.store.operationAdded(this, {\n struct: 'Delete',\n target: target.id,\n length: targetLength,\n targetParent: target.parent\n })\n }\n // need to gc in the end!\n yield* this.store.addToGarbageCollector.call(this, target, left)\n if (right != null) {\n yield* this.store.addToGarbageCollector.call(this, right, target)\n }\n }\n }\n }\n /*\n Mark an operation as deleted&gc'd\n */\n * markGarbageCollected (id, len) {\n // this.mem.push([\"gc\", id]);\n this.store.addToDebug('yield* this.markGarbageCollected(', id, ', ', len, ')')\n var n = yield* this.markDeleted(id, len)\n if (n.id[1] < id[1] && !n.gc) {\n // un-extend left\n var newlen = n.len - (id[1] - n.id[1])\n n.len -= newlen\n yield* this.ds.put(n)\n n = {id: id, len: newlen, gc: false}\n yield* this.ds.put(n)\n }\n // get prev&next before adding a new operation\n var prev = yield* this.ds.findPrev(id)\n var next = yield* this.ds.findNext(id)\n\n if (id[1] + len < n.id[1] + n.len && !n.gc) {\n // un-extend right\n yield* this.ds.put({id: [id[0], id[1] + len], len: n.len - len, gc: false})\n n.len = len\n }\n // set gc'd\n n.gc = true\n // can extend left?\n if (\n prev != null &&\n prev.gc &&\n Y.utils.compareIds([prev.id[0], prev.id[1] + prev.len], n.id)\n ) {\n prev.len += n.len\n yield* this.ds.delete(n.id)\n n = prev\n // ds.put n here?\n }\n // can extend right?\n if (\n next != null &&\n next.gc &&\n Y.utils.compareIds([n.id[0], n.id[1] + n.len], next.id)\n ) {\n n.len += next.len\n yield* this.ds.delete(next.id)\n }\n yield* this.ds.put(n)\n yield* this.updateState(n.id[0])\n }\n /*\n Mark an operation as deleted.\n\n returns the delete node\n */\n * markDeleted (id, length) {\n if (length == null) {\n length = 1\n }\n // this.mem.push([\"del\", id]);\n var n = yield* this.ds.findWithUpperBound(id)\n if (n != null && n.id[0] === id[0]) {\n if (n.id[1] <= id[1] && id[1] <= n.id[1] + n.len) {\n // id is in n's range\n var diff = id[1] + length - (n.id[1] + n.len) // overlapping right\n if (diff > 0) {\n // id+length overlaps n\n if (!n.gc) {\n n.len += diff\n } else {\n diff = n.id[1] + n.len - id[1] // overlapping left (id till n.end)\n if (diff < length) {\n // a partial deletion\n n = {id: [id[0], id[1] + diff], len: length - diff, gc: false}\n yield* this.ds.put(n)\n } else {\n // already gc'd\n throw new Error('Cannot happen! (it dit though.. :()')\n // return n\n }\n }\n } else {\n // no overlapping, already deleted\n return n\n }\n } else {\n // cannot extend left (there is no left!)\n n = {id: id, len: length, gc: false}\n yield* this.ds.put(n) // TODO: you double-put !!\n }\n } else {\n // cannot extend left\n n = {id: id, len: length, gc: false}\n yield* this.ds.put(n)\n }\n // can extend right?\n var next = yield* this.ds.findNext(n.id)\n if (\n next != null &&\n n.id[0] === next.id[0] &&\n n.id[1] + n.len >= next.id[1]\n ) {\n diff = n.id[1] + n.len - next.id[1] // from next.start to n.end\n while (diff >= 0) {\n // n overlaps with next\n if (next.gc) {\n // gc is stronger, so reduce length of n\n n.len -= diff\n if (diff >= next.len) {\n // delete the missing range after next\n diff = diff - next.len // missing range after next\n if (diff > 0) {\n yield* this.ds.put(n) // unneccessary? TODO!\n yield* this.markDeleted([next.id[0], next.id[1] + next.len], diff)\n }\n }\n break\n } else {\n // we can extend n with next\n if (diff > next.len) {\n // n is even longer than next\n // get next.next, and try to extend it\n var _next = yield* this.ds.findNext(next.id)\n yield* this.ds.delete(next.id)\n if (_next == null || n.id[0] !== _next.id[0]) {\n break\n } else {\n next = _next\n diff = n.id[1] + n.len - next.id[1] // from next.start to n.end\n // continue!\n }\n } else {\n // n just partially overlaps with next. extend n, delete next, and break this loop\n n.len += next.len - diff\n yield* this.ds.delete(next.id)\n break\n }\n }\n }\n }\n yield* this.ds.put(n)\n return n\n }\n /*\n Call this method when the client is connected&synced with the\n other clients (e.g. master). This will query the database for\n operations that can be gc'd and add them to the garbage collector.\n */\n * garbageCollectAfterSync () {\n if (this.store.gc1.length > 0 || this.store.gc2.length > 0) {\n console.warn('gc should be empty after sync')\n }\n if (!this.store.gc) {\n return\n }\n yield* this.os.iterate(this, null, null, function * (op) {\n if (op.gc) {\n delete op.gc\n yield* this.setOperation(op)\n }\n if (op.parent != null) {\n var parentDeleted = yield* this.isDeleted(op.parent)\n if (parentDeleted) {\n op.gc = true\n if (!op.deleted) {\n yield* this.markDeleted(op.id, op.content != null ? op.content.length : 1)\n op.deleted = true\n if (op.opContent != null) {\n yield* this.deleteOperation(op.opContent)\n }\n if (op.requires != null) {\n for (var i = 0; i < op.requires.length; i++) {\n yield* this.deleteOperation(op.requires[i])\n }\n }\n }\n yield* this.setOperation(op)\n this.store.gc1.push(op.id) // this is ok becaues its shortly before sync (otherwise use queueGarbageCollector!)\n return\n }\n }\n if (op.deleted) {\n var left = null\n if (op.left != null) {\n left = yield* this.getInsertion(op.left)\n }\n yield* this.store.addToGarbageCollector.call(this, op, left)\n }\n })\n }\n /*\n Really remove an op and all its effects.\n The complicated case here is the Insert operation:\n * reset left\n * reset right\n * reset parent.start\n * reset parent.end\n * reset origins of all right ops\n */\n * garbageCollectOperation (id) {\n this.store.addToDebug('yield* this.garbageCollectOperation(', id, ')')\n var o = yield* this.getOperation(id)\n yield* this.markGarbageCollected(id, (o != null && o.content != null) ? o.content.length : 1) // always mark gc'd\n // if op exists, then clean that mess up..\n if (o != null) {\n var deps = []\n if (o.opContent != null) {\n deps.push(o.opContent)\n }\n if (o.requires != null) {\n deps = deps.concat(o.requires)\n }\n for (var i = 0; i < deps.length; i++) {\n var dep = yield* this.getOperation(deps[i])\n if (dep != null) {\n if (!dep.deleted) {\n yield* this.deleteOperation(dep.id)\n dep = yield* this.getOperation(dep.id)\n }\n dep.gc = true\n yield* this.setOperation(dep)\n this.store.queueGarbageCollector(dep.id)\n } else {\n yield* this.markGarbageCollected(deps[i], 1)\n }\n }\n\n // remove gc'd op from the left op, if it exists\n if (o.left != null) {\n var left = yield* this.getInsertion(o.left)\n left.right = o.right\n yield* this.setOperation(left)\n }\n // remove gc'd op from the right op, if it exists\n // also reset origins of right ops\n if (o.right != null) {\n var right = yield* this.getOperation(o.right)\n right.left = o.left\n yield* this.setOperation(right)\n\n if (o.originOf != null && o.originOf.length > 0) {\n // find new origin of right ops\n // origin is the first left deleted operation\n var neworigin = o.left\n var neworigin_ = null\n while (neworigin != null) {\n neworigin_ = yield* this.getInsertion(neworigin)\n if (neworigin_.deleted) {\n break\n }\n neworigin = neworigin_.left\n }\n\n // reset origin of all right ops (except first right - duh!),\n\n /* ** The following code does not rely on the the originOf property **\n I recently added originOf to all Insert Operations (see Struct.Insert.execute),\n which saves which operations originate in a Insert operation.\n Garbage collecting without originOf is more memory efficient, but is nearly impossible for large texts, or lists!\n But I keep this code for now\n ```\n // reset origin of right\n right.origin = neworigin\n // search until you find origin pointer to the left of o\n if (right.right != null) {\n var i = yield* this.getOperation(right.right)\n var ids = [o.id, o.right]\n while (ids.some(function (id) {\n return Y.utils.compareIds(id, i.origin)\n })) {\n if (Y.utils.compareIds(i.origin, o.id)) {\n // reset origin of i\n i.origin = neworigin\n yield* this.setOperation(i)\n }\n // get next i\n if (i.right == null) {\n break\n } else {\n ids.push(i.id)\n i = yield* this.getOperation(i.right)\n }\n }\n }\n ```\n */\n // ** Now the new implementation starts **\n // reset neworigin of all originOf[*]\n for (var _i in o.originOf) {\n var originsIn = yield* this.getOperation(o.originOf[_i])\n if (originsIn != null) {\n originsIn.origin = neworigin\n yield* this.setOperation(originsIn)\n }\n }\n if (neworigin != null) {\n if (neworigin_.originOf == null) {\n neworigin_.originOf = o.originOf\n } else {\n neworigin_.originOf = o.originOf.concat(neworigin_.originOf)\n }\n yield* this.setOperation(neworigin_)\n }\n // we don't need to set right here, because\n // right should be in o.originOf => it is set it the previous for loop\n }\n }\n // o may originate in another operation.\n // Since o is deleted, we have to reset o.origin's `originOf` property\n if (o.origin != null) {\n var origin = yield* this.getInsertion(o.origin)\n origin.originOf = origin.originOf.filter(function (_id) {\n return !Y.utils.compareIds(id, _id)\n })\n yield* this.setOperation(origin)\n }\n var parent\n if (o.parent != null) {\n parent = yield* this.getOperation(o.parent)\n }\n // remove gc'd op from parent, if it exists\n if (parent != null) {\n var setParent = false // whether to save parent to the os\n if (o.parentSub != null) {\n if (Y.utils.compareIds(parent.map[o.parentSub], o.id)) {\n setParent = true\n if (o.right != null) {\n parent.map[o.parentSub] = o.right\n } else {\n delete parent.map[o.parentSub]\n }\n }\n } else {\n if (Y.utils.compareIds(parent.start, o.id)) {\n // gc'd op is the start\n setParent = true\n parent.start = o.right\n }\n if (Y.utils.matchesId(o, parent.end)) {\n // gc'd op is the end\n setParent = true\n parent.end = o.left\n }\n }\n if (setParent) {\n yield* this.setOperation(parent)\n }\n }\n // finally remove it from the os\n yield* this.removeOperation(o.id)\n }\n }\n * checkDeleteStoreForState (state) {\n var n = yield* this.ds.findWithUpperBound([state.user, state.clock])\n if (n != null && n.id[0] === state.user && n.gc) {\n state.clock = Math.max(state.clock, n.id[1] + n.len)\n }\n }\n * updateState (user) {\n var state = yield* this.getState(user)\n yield* this.checkDeleteStoreForState(state)\n var o = yield* this.getInsertion([user, state.clock])\n var oLength = (o != null && o.content != null) ? o.content.length : 1\n while (o != null && user === o.id[0] && o.id[1] <= state.clock && o.id[1] + oLength > state.clock) {\n // either its a new operation (1. case), or it is an operation that was deleted, but is not yet in the OS\n state.clock += oLength\n yield* this.checkDeleteStoreForState(state)\n o = yield* this.os.findNext(o.id)\n oLength = (o != null && o.content != null) ? o.content.length : 1\n }\n yield* this.setState(state)\n }\n /*\n apply a delete set in order to get\n the state of the supplied ds\n */\n * applyDeleteSet (ds) {\n var deletions = []\n\n for (var user in ds) {\n var dv = ds[user]\n var pos = 0\n var d = dv[pos]\n yield* this.ds.iterate(this, [user, 0], [user, Number.MAX_VALUE], function * (n) {\n // cases:\n // 1. d deletes something to the right of n\n // => go to next n (break)\n // 2. d deletes something to the left of n\n // => create deletions\n // => reset d accordingly\n // *)=> if d doesn't delete anything anymore, go to next d (continue)\n // 3. not 2) and d deletes something that also n deletes\n // => reset d so that it doesn't contain n's deletion\n // *)=> if d does not delete anything anymore, go to next d (continue)\n while (d != null) {\n var diff = 0 // describe the diff of length in 1) and 2)\n if (n.id[1] + n.len <= d[0]) {\n // 1)\n break\n } else if (d[0] < n.id[1]) {\n // 2)\n // delete maximum the len of d\n // else delete as much as possible\n diff = Math.min(n.id[1] - d[0], d[1])\n deletions.push([user, d[0], diff, d[2]])\n } else {\n // 3)\n diff = n.id[1] + n.len - d[0] // never null (see 1)\n if (d[2] && !n.gc) {\n // d marks as gc'd but n does not\n // then delete either way\n deletions.push([user, d[0], Math.min(diff, d[1]), d[2]])\n }\n }\n if (d[1] <= diff) {\n // d doesn't delete anything anymore\n d = dv[++pos]\n } else {\n d[0] = d[0] + diff // reset pos\n d[1] = d[1] - diff // reset length\n }\n }\n })\n // for the rest.. just apply it\n for (; pos < dv.length; pos++) {\n d = dv[pos]\n deletions.push([user, d[0], d[1], d[2]])\n }\n }\n for (var i = 0; i < deletions.length; i++) {\n var del = deletions[i]\n // always try to delete..\n yield* this.deleteOperation([del[0], del[1]], del[2])\n if (del[3]) {\n // gc..\n yield* this.markGarbageCollected([del[0], del[1]], del[2]) // always mark gc'd\n // remove operation..\n var counter = del[1] + del[2]\n while (counter >= del[1]) {\n var o = yield* this.os.findWithUpperBound([del[0], counter - 1])\n if (o == null) {\n break\n }\n var oLen = o.content != null ? o.content.length : 1\n if (o.id[0] !== del[0] || o.id[1] + oLen <= del[1]) {\n // not in range\n break\n }\n if (o.id[1] + oLen > del[1] + del[2]) {\n // overlaps right\n o = yield* this.getInsertionCleanEnd([del[0], del[1] + del[2] - 1])\n }\n if (o.id[1] < del[1]) {\n // overlaps left\n o = yield* this.getInsertionCleanStart([del[0], del[1]])\n }\n counter = o.id[1]\n yield* this.garbageCollectOperation(o.id)\n }\n }\n if (this.store.forwardAppliedOperations) {\n var ops = []\n ops.push({struct: 'Delete', target: [del[0], del[1]], length: del[2]})\n this.store.y.connector.broadcastOps(ops)\n }\n }\n }\n * isGarbageCollected (id) {\n var n = yield* this.ds.findWithUpperBound(id)\n return n != null && n.id[0] === id[0] && id[1] < n.id[1] + n.len && n.gc\n }\n /*\n A DeleteSet (ds) describes all the deleted ops in the OS\n */\n * getDeleteSet () {\n var ds = {}\n yield* this.ds.iterate(this, null, null, function * (n) {\n var user = n.id[0]\n var counter = n.id[1]\n var len = n.len\n var gc = n.gc\n var dv = ds[user]\n if (dv === void 0) {\n dv = []\n ds[user] = dv\n }\n dv.push([counter, len, gc])\n })\n return ds\n }\n * isDeleted (id) {\n var n = yield* this.ds.findWithUpperBound(id)\n return n != null && n.id[0] === id[0] && id[1] < n.id[1] + n.len\n }\n * setOperation (op) {\n yield* this.os.put(op)\n return op\n }\n * addOperation (op) {\n yield* this.os.put(op)\n if (this.store.forwardAppliedOperations && typeof op.id[1] !== 'string') {\n // is connected, and this is not going to be send in addOperation\n this.store.y.connector.broadcastOps([op])\n }\n }\n // if insertion, try to combine with left insertion (if both have content property)\n * tryCombineWithLeft (op) {\n if (\n op != null &&\n op.left != null &&\n op.content != null &&\n op.left[0] === op.id[0] &&\n Y.utils.compareIds(op.left, op.origin)\n ) {\n var left = yield* this.getInsertion(op.left)\n if (left.content != null &&\n left.id[1] + left.content.length === op.id[1] &&\n left.originOf.length === 1 &&\n !left.gc && !left.deleted &&\n !op.gc && !op.deleted\n ) {\n // combine!\n if (op.originOf != null) {\n left.originOf = op.originOf\n } else {\n delete left.originOf\n }\n left.content = left.content.concat(op.content)\n left.right = op.right\n yield* this.os.delete(op.id)\n yield* this.setOperation(left)\n }\n }\n }\n * getInsertion (id) {\n var ins = yield* this.os.findWithUpperBound(id)\n if (ins == null) {\n return null\n } else {\n var len = ins.content != null ? ins.content.length : 1 // in case of opContent\n if (id[0] === ins.id[0] && id[1] < ins.id[1] + len) {\n return ins\n } else {\n return null\n }\n }\n }\n * getInsertionCleanStartEnd (id) {\n yield* this.getInsertionCleanStart(id)\n return yield* this.getInsertionCleanEnd(id)\n }\n // Return an insertion such that id is the first element of content\n // This function manipulates an operation, if necessary\n * getInsertionCleanStart (id) {\n var ins = yield* this.getInsertion(id)\n if (ins != null) {\n if (ins.id[1] === id[1]) {\n return ins\n } else {\n var left = Y.utils.copyObject(ins)\n ins.content = left.content.splice(id[1] - ins.id[1])\n ins.id = id\n var leftLid = Y.utils.getLastId(left)\n ins.origin = leftLid\n left.originOf = [ins.id]\n left.right = ins.id\n ins.left = leftLid\n // debugger // check\n yield* this.setOperation(left)\n yield* this.setOperation(ins)\n if (left.gc) {\n this.store.queueGarbageCollector(ins.id)\n }\n return ins\n }\n } else {\n return null\n }\n }\n // Return an insertion such that id is the last element of content\n // This function manipulates an operation, if necessary\n * getInsertionCleanEnd (id) {\n var ins = yield* this.getInsertion(id)\n if (ins != null) {\n if (ins.content == null || (ins.id[1] + ins.content.length - 1 === id[1])) {\n return ins\n } else {\n var right = Y.utils.copyObject(ins)\n right.content = ins.content.splice(id[1] - ins.id[1] + 1) // cut off remainder\n right.id = [id[0], id[1] + 1]\n var insLid = Y.utils.getLastId(ins)\n right.origin = insLid\n ins.originOf = [right.id]\n ins.right = right.id\n right.left = insLid\n // debugger // check\n yield* this.setOperation(right)\n yield* this.setOperation(ins)\n if (ins.gc) {\n this.store.queueGarbageCollector(right.id)\n }\n return ins\n }\n } else {\n return null\n }\n }\n * getOperation (id/* :any */)/* :Transaction<any> */ {\n var o = yield* this.os.find(id)\n if (id[0] !== '_' || o != null) {\n return o\n } else { // type is string\n // generate this operation?\n var comp = id[1].split('_')\n if (comp.length > 1) {\n var struct = comp[0]\n var op = Y.Struct[struct].create(id)\n op.type = comp[1]\n yield* this.setOperation(op)\n return op\n } else {\n // won't be called. but just in case..\n console.error('Unexpected case. How can this happen?')\n debugger // eslint-disable-line\n return null\n }\n }\n }\n * removeOperation (id) {\n yield* this.os.delete(id)\n }\n * setState (state) {\n var val = {\n id: [state.user],\n clock: state.clock\n }\n yield* this.ss.put(val)\n }\n * getState (user) {\n var n = yield* this.ss.find([user])\n var clock = n == null ? null : n.clock\n if (clock == null) {\n clock = 0\n }\n return {\n user: user,\n clock: clock\n }\n }\n * getStateVector () {\n var stateVector = []\n yield* this.ss.iterate(this, null, null, function * (n) {\n stateVector.push({\n user: n.id[0],\n clock: n.clock\n })\n })\n return stateVector\n }\n * getStateSet () {\n var ss = {}\n yield* this.ss.iterate(this, null, null, function * (n) {\n ss[n.id[0]] = n.clock\n })\n return ss\n }\n /*\n Here, we make all missing operations executable for the receiving user.\n\n Notes:\n startSS: denotes to the SV that the remote user sent\n currSS: denotes to the state vector that the user should have if he\n applies all already sent operations (increases is each step)\n\n We face several problems:\n * Execute op as is won't work because ops depend on each other\n -> find a way so that they do not anymore\n * When changing left, must not go more to the left than the origin\n * When changing right, you have to consider that other ops may have op\n as their origin, this means that you must not set one of these ops\n as the new right (interdependencies of ops)\n * can't just go to the right until you find the first known operation,\n With currSS\n -> interdependency of ops is a problem\n With startSS\n -> leads to inconsistencies when two users join at the same time.\n Then the position depends on the order of execution -> error!\n\n Solution:\n -> re-create originial situation\n -> set op.left = op.origin (which never changes)\n -> set op.right\n to the first operation that is known (according to startSS)\n or to the first operation that has an origin that is not to the\n right of op.\n -> Enforces unique execution order -> happy user\n\n Improvements: TODO\n * Could set left to origin, or the first known operation\n (startSS or currSS.. ?)\n -> Could be necessary when I turn GC again.\n -> Is a bad(ish) idea because it requires more computation\n\n What we do:\n * Iterate over all missing operations.\n * When there is an operation, where the right op is known, send this op all missing ops to the left to the user\n * I explained above what we have to do with each operation. Here is how we do it efficiently:\n 1. Go to the left until you find either op.origin, or a known operation (let o denote current operation in the iteration)\n 2. Found a known operation -> set op.left = o, and send it to the user. stop\n 3. Found o = op.origin -> set op.left = op.origin, and send it to the user. start again from 1. (set op = o)\n 4. Found some o -> set o.right = op, o.left = o.origin, send it to the user, continue\n */\n * getOperations (startSS) {\n // TODO: use bounds here!\n if (startSS == null) {\n startSS = {}\n }\n var send = []\n\n var endSV = yield* this.getStateVector()\n for (var endState of endSV) {\n var user = endState.user\n if (user === '_') {\n continue\n }\n var startPos = startSS[user] || 0\n if (startPos > 0) {\n // There is a change that [user, startPos] is in a composed Insertion (with a smaller counter)\n // find out if that is the case\n var firstMissing = yield* this.getInsertion([user, startPos])\n if (firstMissing != null) {\n // update startPos\n startPos = firstMissing.id[1]\n startSS[user] = startPos\n }\n }\n yield* this.os.iterate(this, [user, startPos], [user, Number.MAX_VALUE], function * (op) {\n op = Y.Struct[op.struct].encode(op)\n if (op.struct !== 'Insert') {\n send.push(op)\n } else if (op.right == null || op.right[1] < (startSS[op.right[0]] || 0)) {\n // case 1. op.right is known\n var o = op\n // Remember: ?\n // -> set op.right\n // 1. to the first operation that is known (according to startSS)\n // 2. or to the first operation that has an origin that is not to the\n // right of op.\n // For this we maintain a list of ops which origins are not found yet.\n var missing_origins = [op]\n var newright = op.right\n while (true) {\n if (o.left == null) {\n op.left = null\n send.push(op)\n if (!Y.utils.compareIds(o.id, op.id)) {\n o = Y.Struct[op.struct].encode(o)\n o.right = missing_origins[missing_origins.length - 1].id\n send.push(o)\n }\n break\n }\n o = yield* this.getInsertion(o.left)\n // we set another o, check if we can reduce $missing_origins\n while (missing_origins.length > 0 && Y.utils.matchesId(o, missing_origins[missing_origins.length - 1].origin)) {\n missing_origins.pop()\n }\n if (o.id[1] < (startSS[o.id[0]] || 0)) {\n // case 2. o is known\n op.left = Y.utils.getLastId(o)\n send.push(op)\n break\n } else if (Y.utils.matchesId(o, op.origin)) {\n // case 3. o is op.origin\n op.left = op.origin\n send.push(op)\n op = Y.Struct[op.struct].encode(o)\n op.right = newright\n if (missing_origins.length > 0) {\n console.log('This should not happen .. :( please report this')\n }\n missing_origins = [op]\n } else {\n // case 4. send o, continue to find op.origin\n var s = Y.Struct[op.struct].encode(o)\n s.right = missing_origins[missing_origins.length - 1].id\n s.left = s.origin\n send.push(s)\n missing_origins.push(o)\n }\n }\n }\n })\n }\n return send.reverse()\n }\n /*\n * Get the plain untransformed operations from the database.\n * You can apply these operations using .applyOperationsUntransformed(ops)\n *\n */\n * getOperationsUntransformed () {\n var ops = []\n yield* this.os.iterate(this, null, null, function * (op) {\n if (op.id[0] !== '_') {\n ops.push(op)\n }\n })\n return {\n untransformed: ops\n }\n }\n * applyOperationsUntransformed (m, stateSet) {\n var ops = m.untransformed\n for (var i = 0; i < ops.length; i++) {\n var op = ops[i]\n // create, and modify parent, if it is created implicitly\n if (op.parent != null && op.parent[0] === '_') {\n if (op.struct === 'Insert') {\n // update parents .map/start/end properties\n if (op.parentSub != null && op.left == null) {\n // op is child of Map\n let parent = yield* this.getOperation(op.parent)\n parent.map[op.parentSub] = op.id\n yield* this.setOperation(parent)\n } else if (op.right == null || op.left == null) {\n let parent = yield* this.getOperation(op.parent)\n if (op.right == null) {\n parent.end = Y.utils.getLastId(op)\n }\n if (op.left == null) {\n parent.start = op.id\n }\n yield* this.setOperation(parent)\n }\n }\n }\n yield* this.os.put(op)\n }\n for (var user in stateSet) {\n yield* this.ss.put({\n id: [user],\n clock: stateSet[user]\n })\n }\n }\n /* this is what we used before.. use this as a reference..\n * makeOperationReady (startSS, op) {\n op = Y.Struct[op.struct].encode(op)\n op = Y.utils.copyObject(op) -- use copyoperation instead now!\n var o = op\n var ids = [op.id]\n // search for the new op.right\n // it is either the first known op (according to startSS)\n // or the o that has no origin to the right of op\n // (this is why we use the ids array)\n while (o.right != null) {\n var right = yield* this.getOperation(o.right)\n if (o.right[1] < (startSS[o.right[0]] || 0) || !ids.some(function (id) {\n return Y.utils.compareIds(id, right.origin)\n })) {\n break\n }\n ids.push(o.right)\n o = right\n }\n op.right = o.right\n op.left = op.origin\n return op\n }\n */\n * flush () {\n yield* this.os.flush()\n yield* this.ss.flush()\n yield* this.ds.flush()\n }\n }\n Y.Transaction = TransactionInterface\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/Transaction.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/Utils.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/yjs/src/Utils.js ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* @flow */\n\n\n/*\n EventHandler is an helper class for constructing custom types.\n\n Why: When constructing custom types, you sometimes want your types to work\n synchronous: E.g.\n ``` Synchronous\n mytype.setSomething(\"yay\")\n mytype.getSomething() === \"yay\"\n ```\n versus\n ``` Asynchronous\n mytype.setSomething(\"yay\")\n mytype.getSomething() === undefined\n mytype.waitForSomething().then(function(){\n mytype.getSomething() === \"yay\"\n })\n ```\n\n The structures usually work asynchronously (you have to wait for the\n database request to finish). EventHandler helps you to make your type\n synchronous.\n*/\nmodule.exports = function (Y /* : any*/) {\n Y.utils = {}\n\n Y.utils.bubbleEvent = function (type, event) {\n type.eventHandler.callEventListeners(event)\n event.path = []\n while (type != null && type._deepEventHandler != null) {\n type._deepEventHandler.callEventListeners(event)\n var parent = null\n if (type._parent != null) {\n parent = type.os.getType(type._parent)\n }\n if (parent != null && parent._getPathToChild != null) {\n event.path = [parent._getPathToChild(type._model)].concat(event.path)\n type = parent\n } else {\n type = null\n }\n }\n }\n\n class EventListenerHandler {\n constructor () {\n this.eventListeners = []\n }\n destroy () {\n this.eventListeners = null\n }\n /*\n Basic event listener boilerplate...\n */\n addEventListener (f) {\n this.eventListeners.push(f)\n }\n removeEventListener (f) {\n this.eventListeners = this.eventListeners.filter(function (g) {\n return f !== g\n })\n }\n removeAllEventListeners () {\n this.eventListeners = []\n }\n callEventListeners (event) {\n for (var i = 0; i < this.eventListeners.length; i++) {\n try {\n var _event = {}\n for (var name in event) {\n _event[name] = event[name]\n }\n this.eventListeners[i](_event)\n } catch (e) {\n console.error('Your observer threw an error. This error was caught so that Yjs still can ensure data consistency! In order to debug this error you have to check \"Pause On Caught Exceptions\"', e)\n }\n }\n }\n }\n Y.utils.EventListenerHandler = EventListenerHandler\n\n class EventHandler extends EventListenerHandler {\n /* ::\n waiting: Array<Insertion | Deletion>;\n awaiting: number;\n onevent: Function;\n eventListeners: Array<Function>;\n */\n /*\n onevent: is called when the structure changes.\n\n Note: \"awaiting opertations\" is used to denote operations that were\n prematurely called. Events for received operations can not be executed until\n all prematurely called operations were executed (\"waiting operations\")\n */\n constructor (onevent /* : Function */) {\n super()\n this.waiting = []\n this.awaiting = 0\n this.onevent = onevent\n }\n destroy () {\n super.destroy()\n this.waiting = null\n this.onevent = null\n }\n /*\n Call this when a new operation arrives. It will be executed right away if\n there are no waiting operations, that you prematurely executed\n */\n receivedOp (op) {\n if (this.awaiting <= 0) {\n this.onevent(op)\n } else if (op.struct === 'Delete') {\n var self = this\n var checkDelete = function checkDelete (d) {\n if (d.length == null) {\n throw new Error('This shouldn\\'t happen! d.length must be defined!')\n }\n // we check if o deletes something in self.waiting\n // if so, we remove the deleted operation\n for (var w = 0; w < self.waiting.length; w++) {\n var i = self.waiting[w]\n if (i.struct === 'Insert' && i.id[0] === d.target[0]) {\n var iLength = i.hasOwnProperty('content') ? i.content.length : 1\n var dStart = d.target[1]\n var dEnd = d.target[1] + (d.length || 1)\n var iStart = i.id[1]\n var iEnd = i.id[1] + iLength\n // Check if they don't overlap\n if (iEnd <= dStart || dEnd <= iStart) {\n // no overlapping\n continue\n }\n // we check all overlapping cases. All cases:\n /*\n 1) iiiii\n ddddd\n --> modify i and d\n 2) iiiiiii\n ddddd\n --> modify i, remove d\n 3) iiiiiii\n ddd\n --> remove d, modify i, and create another i (for the right hand side)\n 4) iiiii\n ddddddd\n --> remove i, modify d\n 5) iiiiiii\n ddddddd\n --> remove both i and d (**)\n 6) iiiiiii\n ddddd\n --> modify i, remove d\n 7) iii\n ddddddd\n --> remove i, create and apply two d with checkDelete(d) (**)\n 8) iiiii\n ddddddd\n --> remove i, modify d (**)\n 9) iiiii\n ddddd\n --> modify i and d\n (**) (also check if i contains content or type)\n */\n // TODO: I left some debugger statements, because I want to debug all cases once in production. REMEMBER END TODO\n if (iStart < dStart) {\n if (dStart < iEnd) {\n if (iEnd < dEnd) {\n // Case 1\n // remove the right part of i's content\n i.content.splice(dStart - iStart)\n // remove the start of d's deletion\n d.length = dEnd - iEnd\n d.target = [d.target[0], iEnd]\n continue\n } else if (iEnd === dEnd) {\n // Case 2\n i.content.splice(dStart - iStart)\n // remove d, we do that by simply ending this function\n return\n } else { // (dEnd < iEnd)\n // Case 3\n var newI = {\n id: [i.id[0], dEnd],\n content: i.content.slice(dEnd - iStart),\n struct: 'Insert'\n }\n self.waiting.push(newI)\n i.content.splice(dStart - iStart)\n return\n }\n }\n } else if (dStart === iStart) {\n if (iEnd < dEnd) {\n // Case 4\n d.length = dEnd - iEnd\n d.target = [d.target[0], iEnd]\n i.content = []\n continue\n } else if (iEnd === dEnd) {\n // Case 5\n self.waiting.splice(w, 1)\n return\n } else { // (dEnd < iEnd)\n // Case 6\n i.content = i.content.slice(dEnd - iStart)\n i.id = [i.id[0], dEnd]\n return\n }\n } else { // (dStart < iStart)\n if (iStart < dEnd) {\n // they overlap\n /*\n 7) iii\n ddddddd\n --> remove i, create and apply two d with checkDelete(d) (**)\n 8) iiiii\n ddddddd\n --> remove i, modify d (**)\n 9) iiiii\n ddddd\n --> modify i and d\n */\n if (iEnd < dEnd) {\n // Case 7\n // debugger // TODO: You did not test this case yet!!!! (add the debugger here)\n self.waiting.splice(w, 1)\n checkDelete({\n target: [d.target[0], dStart],\n length: iStart - dStart,\n struct: 'Delete'\n })\n checkDelete({\n target: [d.target[0], iEnd],\n length: iEnd - dEnd,\n struct: 'Delete'\n })\n return\n } else if (iEnd === dEnd) {\n // Case 8\n self.waiting.splice(w, 1)\n w--\n d.length -= iLength\n continue\n } else { // dEnd < iEnd\n // Case 9\n d.length = iStart - dStart\n i.content.splice(0, dEnd - iStart)\n i.id = [i.id[0], dEnd]\n continue\n }\n }\n }\n }\n }\n // finished with remaining operations\n self.waiting.push(d)\n }\n if (op.key == null) {\n // deletes in list\n checkDelete(op)\n } else {\n // deletes in map\n this.waiting.push(op)\n }\n } else {\n this.waiting.push(op)\n }\n }\n /*\n You created some operations, and you want the `onevent` function to be\n called right away. Received operations will not be executed untill all\n prematurely called operations are executed\n */\n awaitAndPrematurelyCall (ops) {\n this.awaiting++\n ops.map(Y.utils.copyOperation).forEach(this.onevent)\n }\n * awaitOps (transaction, f, args) {\n function notSoSmartSort (array) {\n // this function sorts insertions in a executable order\n var result = []\n while (array.length > 0) {\n for (var i = 0; i < array.length; i++) {\n var independent = true\n for (var j = 0; j < array.length; j++) {\n if (Y.utils.matchesId(array[j], array[i].left)) {\n // array[i] depends on array[j]\n independent = false\n break\n }\n }\n if (independent) {\n result.push(array.splice(i, 1)[0])\n i--\n }\n }\n }\n return result\n }\n var before = this.waiting.length\n // somehow create new operations\n yield* f.apply(transaction, args)\n // remove all appended ops / awaited ops\n this.waiting.splice(before)\n if (this.awaiting > 0) this.awaiting--\n // if there are no awaited ops anymore, we can update all waiting ops, and send execute them (if there are still no awaited ops)\n if (this.awaiting === 0 && this.waiting.length > 0) {\n // update all waiting ops\n for (let i = 0; i < this.waiting.length; i++) {\n var o = this.waiting[i]\n if (o.struct === 'Insert') {\n var _o = yield* transaction.getInsertion(o.id)\n if (_o.parentSub != null && _o.left != null) {\n // if o is an insertion of a map struc (parentSub is defined), then it shouldn't be necessary to compute left\n this.waiting.splice(i, 1)\n i-- // update index\n } else if (!Y.utils.compareIds(_o.id, o.id)) {\n // o got extended\n o.left = [o.id[0], o.id[1] - 1]\n } else if (_o.left == null) {\n o.left = null\n } else {\n // find next undeleted op\n var left = yield* transaction.getInsertion(_o.left)\n while (left.deleted != null) {\n if (left.left != null) {\n left = yield* transaction.getInsertion(left.left)\n } else {\n left = null\n break\n }\n }\n o.left = left != null ? Y.utils.getLastId(left) : null\n }\n }\n }\n // the previous stuff was async, so we have to check again!\n // We also pull changes from the bindings, if there exists such a method, this could increase awaiting too\n if (this._pullChanges != null) {\n this._pullChanges()\n }\n if (this.awaiting === 0) {\n // sort by type, execute inserts first\n var ins = []\n var dels = []\n this.waiting.forEach(function (o) {\n if (o.struct === 'Delete') {\n dels.push(o)\n } else {\n ins.push(o)\n }\n })\n this.waiting = []\n // put in executable order\n ins = notSoSmartSort(ins)\n // this.onevent can trigger the creation of another operation\n // -> check if this.awaiting increased & stop computation if it does\n for (var i = 0; i < ins.length; i++) {\n if (this.awaiting === 0) {\n this.onevent(ins[i])\n } else {\n this.waiting = this.waiting.concat(ins.slice(i))\n break\n }\n }\n for (i = 0; i < dels.length; i++) {\n if (this.awaiting === 0) {\n this.onevent(dels[i])\n } else {\n this.waiting = this.waiting.concat(dels.slice(i))\n break\n }\n }\n }\n }\n }\n // TODO: Remove awaitedInserts and awaitedDeletes in favor of awaitedOps, as they are deprecated and do not always work\n // Do this in one of the coming releases that are breaking anyway\n /*\n Call this when you successfully awaited the execution of n Insert operations\n */\n awaitedInserts (n) {\n var ops = this.waiting.splice(this.waiting.length - n)\n for (var oid = 0; oid < ops.length; oid++) {\n var op = ops[oid]\n if (op.struct === 'Insert') {\n for (var i = this.waiting.length - 1; i >= 0; i--) {\n let w = this.waiting[i]\n // TODO: do I handle split operations correctly here? Super unlikely, but yeah..\n // Also: can this case happen? Can op be inserted in the middle of a larger op that is in $waiting?\n if (w.struct === 'Insert') {\n if (Y.utils.matchesId(w, op.left)) {\n // include the effect of op in w\n w.right = op.id\n // exclude the effect of w in op\n op.left = w.left\n } else if (Y.utils.compareIds(w.id, op.right)) {\n // similar..\n w.left = Y.utils.getLastId(op)\n op.right = w.right\n }\n }\n }\n } else {\n throw new Error('Expected Insert Operation!')\n }\n }\n this._tryCallEvents(n)\n }\n /*\n Call this when you successfully awaited the execution of n Delete operations\n */\n awaitedDeletes (n, newLeft) {\n var ops = this.waiting.splice(this.waiting.length - n)\n for (var j = 0; j < ops.length; j++) {\n var del = ops[j]\n if (del.struct === 'Delete') {\n if (newLeft != null) {\n for (var i = 0; i < this.waiting.length; i++) {\n let w = this.waiting[i]\n // We will just care about w.left\n if (w.struct === 'Insert' && Y.utils.compareIds(del.target, w.left)) {\n w.left = newLeft\n }\n }\n }\n } else {\n throw new Error('Expected Delete Operation!')\n }\n }\n this._tryCallEvents(n)\n }\n /* (private)\n Try to execute the events for the waiting operations\n */\n _tryCallEvents () {\n function notSoSmartSort (array) {\n var result = []\n while (array.length > 0) {\n for (var i = 0; i < array.length; i++) {\n var independent = true\n for (var j = 0; j < array.length; j++) {\n if (Y.utils.matchesId(array[j], array[i].left)) {\n // array[i] depends on array[j]\n independent = false\n break\n }\n }\n if (independent) {\n result.push(array.splice(i, 1)[0])\n i--\n }\n }\n }\n return result\n }\n if (this.awaiting > 0) this.awaiting--\n if (this.awaiting === 0 && this.waiting.length > 0) {\n var ins = []\n var dels = []\n this.waiting.forEach(function (o) {\n if (o.struct === 'Delete') {\n dels.push(o)\n } else {\n ins.push(o)\n }\n })\n ins = notSoSmartSort(ins)\n ins.forEach(this.onevent)\n dels.forEach(this.onevent)\n this.waiting = []\n }\n }\n }\n Y.utils.EventHandler = EventHandler\n\n /*\n Default class of custom types!\n */\n class CustomType {\n getPath () {\n var parent = null\n if (this._parent != null) {\n parent = this.os.getType(this._parent)\n }\n if (parent != null && parent._getPathToChild != null) {\n var firstKey = parent._getPathToChild(this._model)\n var parentKeys = parent.getPath()\n parentKeys.push(firstKey)\n return parentKeys\n } else {\n return []\n }\n }\n }\n Y.utils.CustomType = CustomType\n\n /*\n A wrapper for the definition of a custom type.\n Every custom type must have three properties:\n\n * struct\n - Structname of this type\n * initType\n - Given a model, creates a custom type\n * class\n - the constructor of the custom type (e.g. in order to inherit from a type)\n */\n class CustomTypeDefinition { // eslint-disable-line\n /* ::\n struct: any;\n initType: any;\n class: Function;\n name: String;\n */\n constructor (def) {\n if (def.struct == null ||\n def.initType == null ||\n def.class == null ||\n def.name == null ||\n def.createType == null\n ) {\n throw new Error('Custom type was not initialized correctly!')\n }\n this.struct = def.struct\n this.initType = def.initType\n this.createType = def.createType\n this.class = def.class\n this.name = def.name\n if (def.appendAdditionalInfo != null) {\n this.appendAdditionalInfo = def.appendAdditionalInfo\n }\n this.parseArguments = (def.parseArguments || function () {\n return [this]\n }).bind(this)\n this.parseArguments.typeDefinition = this\n }\n }\n Y.utils.CustomTypeDefinition = CustomTypeDefinition\n\n Y.utils.isTypeDefinition = function isTypeDefinition (v) {\n if (v != null) {\n if (v instanceof Y.utils.CustomTypeDefinition) return [v]\n else if (v.constructor === Array && v[0] instanceof Y.utils.CustomTypeDefinition) return v\n else if (v instanceof Function && v.typeDefinition instanceof Y.utils.CustomTypeDefinition) return [v.typeDefinition]\n }\n return false\n }\n\n /*\n Make a flat copy of an object\n (just copy properties)\n */\n function copyObject (o) {\n var c = {}\n for (var key in o) {\n c[key] = o[key]\n }\n return c\n }\n Y.utils.copyObject = copyObject\n\n /*\n Copy an operation, so that it can be manipulated.\n Note: You must not change subproperties (except o.content)!\n */\n function copyOperation (o) {\n o = copyObject(o)\n if (o.content != null) {\n o.content = o.content.map(function (c) { return c })\n }\n return o\n }\n\n Y.utils.copyOperation = copyOperation\n\n /*\n Defines a smaller relation on Id's\n */\n function smaller (a, b) {\n return a[0] < b[0] || (a[0] === b[0] && (a[1] < b[1] || typeof a[1] < typeof b[1]))\n }\n Y.utils.smaller = smaller\n\n function inDeletionRange (del, ins) {\n return del.target[0] === ins[0] && del.target[1] <= ins[1] && ins[1] < del.target[1] + (del.length || 1)\n }\n Y.utils.inDeletionRange = inDeletionRange\n\n function compareIds (id1, id2) {\n if (id1 == null || id2 == null) {\n return id1 === id2\n } else {\n return id1[0] === id2[0] && id1[1] === id2[1]\n }\n }\n Y.utils.compareIds = compareIds\n\n function matchesId (op, id) {\n if (id == null || op == null) {\n return id === op\n } else {\n if (id[0] === op.id[0]) {\n if (op.content == null) {\n return id[1] === op.id[1]\n } else {\n return id[1] >= op.id[1] && id[1] < op.id[1] + op.content.length\n }\n }\n }\n }\n Y.utils.matchesId = matchesId\n\n function getLastId (op) {\n if (op.content == null || op.content.length === 1) {\n return op.id\n } else {\n return [op.id[0], op.id[1] + op.content.length - 1]\n }\n }\n Y.utils.getLastId = getLastId\n\n function createEmptyOpsArray (n) {\n var a = new Array(n)\n for (var i = 0; i < a.length; i++) {\n a[i] = {\n id: [null, null]\n }\n }\n return a\n }\n\n function createSmallLookupBuffer (Store) {\n /*\n This buffer implements a very small buffer that temporarily stores operations\n after they are read / before they are written.\n The buffer basically implements FIFO. Often requested lookups will be re-queued every time they are looked up / written.\n\n It can speed up lookups on Operation Stores and State Stores. But it does not require notable use of memory or processing power.\n\n Good for os and ss, bot not for ds (because it often uses methods that require a flush)\n\n I tried to optimize this for performance, therefore no highlevel operations.\n */\n class SmallLookupBuffer extends Store {\n constructor (arg1, arg2) {\n // super(...arguments) -- do this when this is supported by stable nodejs\n super(arg1, arg2)\n this.writeBuffer = createEmptyOpsArray(5)\n this.readBuffer = createEmptyOpsArray(10)\n }\n * find (id, noSuperCall) {\n var i, r\n for (i = this.readBuffer.length - 1; i >= 0; i--) {\n r = this.readBuffer[i]\n // we don't have to use compareids, because id is always defined!\n if (r.id[1] === id[1] && r.id[0] === id[0]) {\n // found r\n // move r to the end of readBuffer\n for (; i < this.readBuffer.length - 1; i++) {\n this.readBuffer[i] = this.readBuffer[i + 1]\n }\n this.readBuffer[this.readBuffer.length - 1] = r\n return r\n }\n }\n var o\n for (i = this.writeBuffer.length - 1; i >= 0; i--) {\n r = this.writeBuffer[i]\n if (r.id[1] === id[1] && r.id[0] === id[0]) {\n o = r\n break\n }\n }\n if (i < 0 && noSuperCall === undefined) {\n // did not reach break in last loop\n // read id and put it to the end of readBuffer\n o = yield* super.find(id)\n }\n if (o != null) {\n for (i = 0; i < this.readBuffer.length - 1; i++) {\n this.readBuffer[i] = this.readBuffer[i + 1]\n }\n this.readBuffer[this.readBuffer.length - 1] = o\n }\n return o\n }\n * put (o) {\n var id = o.id\n var i, r // helper variables\n for (i = this.writeBuffer.length - 1; i >= 0; i--) {\n r = this.writeBuffer[i]\n if (r.id[1] === id[1] && r.id[0] === id[0]) {\n // is already in buffer\n // forget r, and move o to the end of writeBuffer\n for (; i < this.writeBuffer.length - 1; i++) {\n this.writeBuffer[i] = this.writeBuffer[i + 1]\n }\n this.writeBuffer[this.writeBuffer.length - 1] = o\n break\n }\n }\n if (i < 0) {\n // did not reach break in last loop\n // write writeBuffer[0]\n var write = this.writeBuffer[0]\n if (write.id[0] !== null) {\n yield* super.put(write)\n }\n // put o to the end of writeBuffer\n for (i = 0; i < this.writeBuffer.length - 1; i++) {\n this.writeBuffer[i] = this.writeBuffer[i + 1]\n }\n this.writeBuffer[this.writeBuffer.length - 1] = o\n }\n // check readBuffer for every occurence of o.id, overwrite if found\n // whether found or not, we'll append o to the readbuffer\n for (i = 0; i < this.readBuffer.length - 1; i++) {\n r = this.readBuffer[i + 1]\n if (r.id[1] === id[1] && r.id[0] === id[0]) {\n this.readBuffer[i] = o\n } else {\n this.readBuffer[i] = r\n }\n }\n this.readBuffer[this.readBuffer.length - 1] = o\n }\n * delete (id) {\n var i, r\n for (i = 0; i < this.readBuffer.length; i++) {\n r = this.readBuffer[i]\n if (r.id[1] === id[1] && r.id[0] === id[0]) {\n this.readBuffer[i] = {\n id: [null, null]\n }\n }\n }\n yield* this.flush()\n yield* super.delete(id)\n }\n * findWithLowerBound (id) {\n var o = yield* this.find(id, true)\n if (o != null) {\n return o\n } else {\n yield* this.flush()\n return yield* super.findWithLowerBound.apply(this, arguments)\n }\n }\n * findWithUpperBound (id) {\n var o = yield* this.find(id, true)\n if (o != null) {\n return o\n } else {\n yield* this.flush()\n return yield* super.findWithUpperBound.apply(this, arguments)\n }\n }\n * findNext () {\n yield* this.flush()\n return yield* super.findNext.apply(this, arguments)\n }\n * findPrev () {\n yield* this.flush()\n return yield* super.findPrev.apply(this, arguments)\n }\n * iterate () {\n yield* this.flush()\n yield* super.iterate.apply(this, arguments)\n }\n * flush () {\n for (var i = 0; i < this.writeBuffer.length; i++) {\n var write = this.writeBuffer[i]\n if (write.id[0] !== null) {\n yield* super.put(write)\n this.writeBuffer[i] = {\n id: [null, null]\n }\n }\n }\n }\n }\n return SmallLookupBuffer\n }\n Y.utils.createSmallLookupBuffer = createSmallLookupBuffer\n\n // Generates a unique id, for use as a user id.\n // Thx to @jed for this script https://gist.github.com/jed/982883\n function generateGuid(a){return a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,generateGuid)} // eslint-disable-line\n Y.utils.generateGuid = generateGuid\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/Utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/yjs/src/y.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/yjs/src/y.js ***!
|
||
\***********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("/* @flow */\n\n\n__webpack_require__(/*! ./Connector.js */ \"./node_modules/yjs/src/Connector.js\")(Y)\n__webpack_require__(/*! ./Database.js */ \"./node_modules/yjs/src/Database.js\")(Y)\n__webpack_require__(/*! ./Transaction.js */ \"./node_modules/yjs/src/Transaction.js\")(Y)\n__webpack_require__(/*! ./Struct.js */ \"./node_modules/yjs/src/Struct.js\")(Y)\n__webpack_require__(/*! ./Utils.js */ \"./node_modules/yjs/src/Utils.js\")(Y)\n__webpack_require__(/*! ./Connectors/Test.js */ \"./node_modules/yjs/src/Connectors/Test.js\")(Y)\n\nY.debug = __webpack_require__(/*! debug */ \"./node_modules/yjs/node_modules/debug/src/browser.js\")\n\nvar requiringModules = {}\n\nmodule.exports = Y\nY.requiringModules = requiringModules\n\nY.extend = function (name, value) {\n if (arguments.length === 2 && typeof name === 'string') {\n if (value instanceof Y.utils.CustomTypeDefinition) {\n Y[name] = value.parseArguments\n } else {\n Y[name] = value\n }\n if (requiringModules[name] != null) {\n requiringModules[name].resolve()\n delete requiringModules[name]\n }\n } else {\n for (var i = 0; i < arguments.length; i++) {\n var f = arguments[i]\n if (typeof f === 'function') {\n f(Y)\n } else {\n throw new Error('Expected function!')\n }\n }\n }\n}\n\nY.requestModules = requestModules\nfunction requestModules (modules) {\n var sourceDir\n if (Y.sourceDir === null) {\n sourceDir = null\n } else {\n sourceDir = Y.sourceDir || '/bower_components'\n }\n // determine if this module was compiled for es5 or es6 (y.js vs. y.es6)\n // if Insert.execute is a Function, then it isnt a generator..\n // then load the es5(.js) files..\n var extention = typeof regeneratorRuntime !== 'undefined' ? '.js' : '.es6'\n var promises = []\n for (var i = 0; i < modules.length; i++) {\n var module = modules[i].split('(')[0]\n var modulename = 'y-' + module.toLowerCase()\n if (Y[module] == null) {\n if (requiringModules[module] == null) {\n // module does not exist\n if (typeof window !== 'undefined' && window.Y !== 'undefined') {\n if (sourceDir != null) {\n var imported = document.createElement('script')\n imported.src = sourceDir + '/' + modulename + '/' + modulename + extention\n document.head.appendChild(imported)\n }\n let requireModule = {}\n requiringModules[module] = requireModule\n requireModule.promise = new Promise(function (resolve) {\n requireModule.resolve = resolve\n })\n promises.push(requireModule.promise)\n } else {\n console.info('YJS: Please do not depend on automatic requiring of modules anymore! Extend modules as follows `require(\\'y-modulename\\')(Y)`')\n __webpack_require__(\"./node_modules/yjs/src sync recursive\")(modulename)(Y)\n }\n } else {\n promises.push(requiringModules[modules[i]].promise)\n }\n }\n }\n return Promise.all(promises)\n}\n\n/* ::\ntype MemoryOptions = {\n name: 'memory'\n}\ntype IndexedDBOptions = {\n name: 'indexeddb',\n namespace: string\n}\ntype DbOptions = MemoryOptions | IndexedDBOptions\n\ntype WebRTCOptions = {\n name: 'webrtc',\n room: string\n}\ntype WebsocketsClientOptions = {\n name: 'websockets-client',\n room: string\n}\ntype ConnectionOptions = WebRTCOptions | WebsocketsClientOptions\n\ntype YOptions = {\n connector: ConnectionOptions,\n db: DbOptions,\n types: Array<TypeName>,\n sourceDir: string,\n share: {[key: string]: TypeName}\n}\n*/\n\nfunction Y (opts/* :YOptions */) /* :Promise<YConfig> */ {\n if (opts.hasOwnProperty('sourceDir')) {\n Y.sourceDir = opts.sourceDir\n }\n opts.types = opts.types != null ? opts.types : []\n var modules = [opts.db.name, opts.connector.name].concat(opts.types)\n for (var name in opts.share) {\n modules.push(opts.share[name])\n }\n return new Promise(function (resolve, reject) {\n if (opts == null) reject('An options object is expected! ')\n else if (opts.connector == null) reject('You must specify a connector! (missing connector property)')\n else if (opts.connector.name == null) reject('You must specify connector name! (missing connector.name property)')\n else if (opts.db == null) reject('You must specify a database! (missing db property)')\n else if (opts.connector.name == null) reject('You must specify db name! (missing db.name property)')\n else {\n opts = Y.utils.copyObject(opts)\n opts.connector = Y.utils.copyObject(opts.connector)\n opts.db = Y.utils.copyObject(opts.db)\n opts.share = Y.utils.copyObject(opts.share)\n setTimeout(function () {\n Y.requestModules(modules).then(function () {\n var yconfig = new YConfig(opts)\n yconfig.db.whenUserIdSet(function () {\n yconfig.init(function () {\n resolve(yconfig)\n })\n })\n }).catch(reject)\n }, 0)\n }\n })\n}\n\nclass YConfig {\n /* ::\n db: Y.AbstractDatabase;\n connector: Y.AbstractConnector;\n share: {[key: string]: any};\n options: Object;\n */\n constructor (opts, callback) {\n this.options = opts\n this.db = new Y[opts.db.name](this, opts.db)\n this.connector = new Y[opts.connector.name](this, opts.connector)\n this.connected = true\n }\n init (callback) {\n var opts = this.options\n var share = {}\n this.share = share\n this.db.requestTransaction(function * requestTransaction () {\n // create shared object\n for (var propertyname in opts.share) {\n var typeConstructor = opts.share[propertyname].split('(')\n var typeName = typeConstructor.splice(0, 1)\n var type = Y[typeName]\n var typedef = type.typeDefinition\n var id = ['_', typedef.struct + '_' + typeName + '_' + propertyname + '_' + typeConstructor]\n var args = []\n if (typeConstructor.length === 1) {\n try {\n args = JSON.parse('[' + typeConstructor[0].split(')')[0] + ']')\n } catch (e) {\n throw new Error('Was not able to parse type definition! (share.' + propertyname + ')')\n }\n if (type.typeDefinition.parseArguments == null) {\n throw new Error(typeName + ' does not expect arguments!')\n } else {\n args = typedef.parseArguments(args[0])[1]\n }\n }\n share[propertyname] = yield* this.store.initType.call(this, id, args)\n }\n this.store.whenTransactionsFinished()\n .then(callback)\n })\n }\n isConnected () {\n return this.connector.isSynced\n }\n disconnect () {\n if (this.connected) {\n this.connected = false\n return this.connector.disconnect()\n } else {\n return Promise.resolve()\n }\n }\n reconnect () {\n if (!this.connected) {\n this.connected = true\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }\n destroy () {\n var self = this\n return this.close().then(function () {\n if (self.db.deleteDB != null) {\n return self.db.deleteDB()\n } else {\n return Promise.resolve()\n }\n })\n }\n close () {\n var self = this\n this.share = null\n if (this.connector.destroy != null) {\n this.connector.destroy()\n } else {\n this.connector.disconnect()\n }\n return this.db.whenTransactionsFinished(function () {\n this.db.destroyTypes()\n // make sure to wait for all transactions before destroying the db\n this.db.requestTransaction(function * () {\n yield* self.db.destroy()\n })\n return this.db.whenTransactionsFinished()\n })\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/yjs/src/y.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./utils.js":
|
||
/*!******************!*\
|
||
!*** ./utils.js ***!
|
||
\******************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
eval("const errors = __webpack_require__(/*! ./Errors */ \"./Errors.js\");\n\nutils = {}; //utility functions\n\n// ==== OBJECT ORIENTED JAVASCRIPT ===============\n// This is a general purpose library of functions,\n//Parts of this file (consolearr, and createElement) are duplicated in dweb-transport; dweb-transports and dweb-objects repo\n\n// Utility function to print a array of items but just show number and last.\nutils.consolearr = (arr) => ((arr && arr.length >0) ? [arr.length+\" items inc:\", arr[arr.length-1]] : arr );\n\nutils.stringfrom = function(foo, hints={}) {\n try {\n // Generic way to turn anything into a string\n if (foo.constructor.name === \"Url\") // Can't use instanceof for some bizarre reason\n return foo.href;\n if (typeof foo === \"string\")\n return foo;\n return foo.toString(); // Last chance try and convert to a string based on a method of the object (could check for its existence)\n } catch (err) {\n throw new errors.CodingError(`Unable to turn ${foo} into a string ${err.message}`)\n }\n};\n\nutils.p_timeout = function(promise, ms, errorstr) {\n /* In a certain period, timeout and reject\n promise: A promise we want to watch to completion\n ms: Time in milliseconds to allow it to run\n errorstr: Error message in reject error\n throws: TimeoutError on timeout with message = errorstr\n */\n let timer = null;\n\n return Promise.race([\n new Promise((resolve, reject) => {\n timer = setTimeout(reject, ms, new errors.TimeoutError(errorstr || `Timed out in ${ms}ms`));\n }),\n promise.then((value) => {\n clearTimeout(timer);\n return value;\n })\n ]);\n}\n\nutils.createElement = function(tag, attrs, children) { // Note arguments is set to tag, attrs, child1, child2 etc\n // Note identical version in dweb-transport/js/utils.js and dweb-transports/utils.js and dweb-objects/utils.js\n var element = document.createElement(tag);\n for (let name in attrs) {\n let attrname = (name.toLowerCase() === \"classname\" ? \"class\" : name);\n if (name === \"dangerouslySetInnerHTML\") {\n element.innerHTML = attrs[name][\"__html\"];\n delete attrs.dangerouslySetInnerHTML;\n }\n if (attrs.hasOwnProperty(name)) {\n let value = attrs[name];\n if (value === true) {\n element.setAttribute(attrname, name);\n } else if (typeof value === \"object\" && !Array.isArray(value)) {\n if ([\"style\"].includes(attrname)) { // e.g. style: {fontSize: \"124px\"}\n for (let k in value) {\n element[attrname][k] = value[k];\n }\n } else {\n // Assume we are really trying to set the value to an object, allow it\n element[attrname] = value; // Wont let us use setAttribute(attrname, value) unclear if because unknow attribute or object\n }\n } else if (value !== false && value != null) {\n element.setAttribute(attrname, value.toString());\n }\n }\n }\n for (let i = 2; i < arguments.length; i++) { // Everything after attrs\n let child = arguments[i];\n if (!child) {\n } else if (Array.isArray(child)) {\n child.map((c) => element.appendChild(c.nodeType == null ?\n document.createTextNode(c.toString()) : c))\n }\n else {\n element.appendChild(\n child.nodeType == null ?\n document.createTextNode(child.toString()) : child);\n }\n }\n return element;\n}\n\n\nexports = module.exports = utils;\n\n\n//# sourceURL=webpack:///./utils.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 0:
|
||
/*!****************************!*\
|
||
!*** node-fetch (ignored) ***!
|
||
\****************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///node-fetch_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 1:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 10:
|
||
/*!********************!*\
|
||
!*** fs (ignored) ***!
|
||
\********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///fs_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 11:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 12:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 13:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 14:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 15:
|
||
/*!***************************************!*\
|
||
!*** bittorrent-dht/client (ignored) ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///bittorrent-dht/client_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 16:
|
||
/*!*****************************!*\
|
||
!*** load-ip-set (ignored) ***!
|
||
\*****************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///load-ip-set_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 17:
|
||
/*!*************************************!*\
|
||
!*** decompress-response (ignored) ***!
|
||
\*************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///decompress-response_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 18:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 19:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 2:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 20:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 21:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 22:
|
||
/*!********************************!*\
|
||
!*** ./lib/tcp-pool (ignored) ***!
|
||
\********************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///./lib/tcp-pool_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 23:
|
||
/*!***************************************!*\
|
||
!*** bittorrent-dht/client (ignored) ***!
|
||
\***************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///bittorrent-dht/client_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 24:
|
||
/*!*******************************!*\
|
||
!*** ./common-node (ignored) ***!
|
||
\*******************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///./common-node_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 25:
|
||
/*!*******************************************!*\
|
||
!*** ./lib/client/http-tracker (ignored) ***!
|
||
\*******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///./lib/client/http-tracker_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 26:
|
||
/*!******************************************!*\
|
||
!*** ./lib/client/udp-tracker (ignored) ***!
|
||
\******************************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///./lib/client/udp-tracker_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 27:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 28:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 29:
|
||
/*!********************!*\
|
||
!*** ws (ignored) ***!
|
||
\********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///ws_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 3:
|
||
/*!************************!*\
|
||
!*** crypto (ignored) ***!
|
||
\************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///crypto_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 30:
|
||
/*!*********************!*\
|
||
!*** net (ignored) ***!
|
||
\*********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///net_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 31:
|
||
/*!********************!*\
|
||
!*** os (ignored) ***!
|
||
\********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///os_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 32:
|
||
/*!************************!*\
|
||
!*** ut_pex (ignored) ***!
|
||
\************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///ut_pex_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 33:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 34:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 35:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 36:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 37:
|
||
/*!**************************!*\
|
||
!*** ./server (ignored) ***!
|
||
\**************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///./server_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 38:
|
||
/*!************************!*\
|
||
!*** crypto (ignored) ***!
|
||
\************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///crypto_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 4:
|
||
/*!************************!*\
|
||
!*** buffer (ignored) ***!
|
||
\************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///buffer_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 5:
|
||
/*!************************!*\
|
||
!*** crypto (ignored) ***!
|
||
\************************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///crypto_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 6:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 7:
|
||
/*!**********************!*\
|
||
!*** util (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///util_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 8:
|
||
/*!********************!*\
|
||
!*** fs (ignored) ***!
|
||
\********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///fs_(ignored)?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ 9:
|
||
/*!**********************!*\
|
||
!*** glob (ignored) ***!
|
||
\**********************/
|
||
/*! no static exports found */
|
||
/***/ (function(module, exports) {
|
||
|
||
eval("/* (ignored) */\n\n//# sourceURL=webpack:///glob_(ignored)?");
|
||
|
||
/***/ })
|
||
|
||
/******/ }); |